Transaction information processing method and apparatus, storage medium, and electronic device

By receiving transactions to be queried, obtaining related candidate transactions, and combining and changing associated transactions according to the transaction direction, the problem that Hive SQL on the Hive platform cannot perform full-scale relationship queries is solved, and full-scale relationship queries of transactions based on Hive SQL are realized on the Hive platform.

CN116308779BActive Publication Date: 2026-05-19INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
INDUSTRIAL AND COMMERCIAL BANK OF CHINA
Filing Date
2023-01-04
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

Hive SQL struggles to query all relationships in a data table on the Hive platform, mainly because it does not support loop statements and anonymous blocks, making it unable to handle complex relationships.

Method used

By receiving transactions to be queried, obtaining related candidate transactions, combining and changing related transactions according to transaction direction, grouping and determining the target transaction group set, and realizing full relationship query.

Benefits of technology

A full transaction relationship query based on Hive SQL was implemented on the Hive platform, solving the problem that Hive SQL could not handle complex relationships.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116308779B_ABST
    Figure CN116308779B_ABST
Patent Text Reader

Abstract

The application discloses a transaction information processing method and device, a storage medium and an electronic equipment. It relates to the field of financial technology. The method comprises the following steps: obtaining a transaction related to a to-be-queried transaction, determining the transaction related to the to-be-queried transaction as a candidate transaction; combining a plurality of candidate transactions according to transaction directions to obtain a plurality of groups of transactions; changing the transaction direction of an associated transaction in each group of transactions respectively to obtain a plurality of groups of updated transactions; grouping the plurality of groups of updated transactions according to the associated transactions to obtain a plurality of transaction group sets, determining a transaction group set in which the associated transaction is the to-be-queried transaction from the plurality of transaction group sets, and obtaining a target transaction group set; and determining the grouping information of the transaction related to the to-be-queried transaction according to the target transaction group set. Through the application, the problem that it is difficult to query the full-amount relationship of data in a data table based on Hive SQL on a Hive platform in the related art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of financial technology, and more specifically, to a transaction information processing method, apparatus, storage medium, and electronic device. Background Technology

[0002] Hive is a database management system built on the Hadoop big data platform. The relational query statements provided on the Hive platform are simply called Hive SQL. With the widespread use of big data in financial market risk control, the application scenarios for querying and statistically analyzing transaction data based on Hive SQL are becoming increasingly common. However, because the underlying API support of Hive SQL differs somewhat from traditional relational databases such as Oracle and MySQL, and it does not support low-level processing such as loop statements and anonymous blocks, it presents certain difficulties in handling data relationships, specifically as follows:

[0003] Suppose there exists a table T1 containing pairwise relationships: (A1, A2), (A2, A3), (A3, A4), and (A4, A5). A single query can only confirm the relationships between (A1, A2) and (A2, A3), (A2, A3) and (A3, A4), and (A3, A4) and (A4, A5). However, realizing the complete A1-A5 relationship requires looping. Since Hive SQL does not support loop statements, it is impossible to perform a query for all relationships using Hive SQL.

[0004] There is currently no effective solution to the problem of difficulty in querying the full relationships of data in a data table using Hive SQL on the Hive platform. Summary of the Invention

[0005] This application provides a transaction information processing method, apparatus, storage medium, and electronic device to solve the problem in the related art that it is difficult to query the full relationships of data in a data table based on Hive SQL on the Hive platform.

[0006] According to one aspect of this application, a transaction information processing method is provided. The method includes: receiving a transaction to be queried, retrieving transactions related to the transaction to be queried from a database, identifying the transaction to be queried and the transactions related to the transaction to be queried as candidate transactions, obtaining multiple candidate transactions; sequentially combining each candidate transaction with other candidate transactions from the multiple candidate transactions according to the transaction direction of the transaction, obtaining multiple sets of transactions, wherein each set of transactions includes a target transaction and related transactions, the target transaction and related transactions having opposite transaction directions; changing the related transactions in each set of transactions according to the transaction direction of the related transactions, obtaining multiple sets of updated transactions; grouping the multiple sets of updated transactions according to related transactions, obtaining multiple sets of transaction groups, and determining the related transactions from the multiple sets of transaction groups as the set of transaction groups for the transaction to be queried, obtaining a target set of transaction groups, wherein the related transactions in each set of transactions are the same; and determining the grouping information of transactions related to the transaction to be queried based on the target set of transaction groups.

[0007] Optionally, retrieving transactions related to the transaction to be queried from the database includes: obtaining attribute information of the transaction to be queried, obtaining target attribute information, and obtaining multiple initial transactions by retrieving transactions from the database whose attribute information is the same as the target attribute information; and identifying the multiple initial transactions as transactions related to the transaction to be queried.

[0008] Optionally, combining each candidate transaction with other candidate transactions from the multiple candidate transactions according to the transaction direction to obtain multiple sets of transactions includes: obtaining any candidate transaction to obtain a first candidate transaction; determining the transaction direction of the first candidate transaction to obtain a first transaction direction; obtaining candidate transactions from the remaining candidate transactions whose transaction direction is different from the first transaction direction to obtain multiple second candidate transactions, wherein the remaining candidate transactions are transactions other than the first candidate transaction from the multiple candidate transactions; and combining the first candidate transaction with each second candidate transaction in turn to obtain multiple sets of transactions.

[0009] Optionally, changing the related transactions based on the transaction direction of the related transactions in each group of transactions to obtain multiple groups of updated transactions includes: determining the transaction direction of the related transactions in each group of transactions to obtain a second transaction direction; sequentially determining whether the second transaction direction is a billing direction; if the second transaction direction is a billing direction, changing the corresponding related transaction to the target transaction in the same transaction group to obtain multiple groups of updated transactions.

[0010] Optionally, determining the grouping information of transactions related to the transaction to be queried based on the target transaction group set includes: obtaining the target transaction of each group of transactions in the target transaction group set to obtain multiple first target transactions; obtaining the target transaction of each group of transactions in each of the remaining transaction group sets to obtain multiple target transaction sets, wherein each of the remaining transaction group sets is a transaction group set other than the target transaction group set in the multiple transaction group sets; sequentially determining whether any first target transaction exists in each target transaction set; if any first target transaction exists in the target transaction set, changing the associated transaction of each group of transactions in the transaction group set corresponding to the target transaction set to the transaction to be queried to obtain multiple updated transaction group sets; and determining the grouping information of transactions related to the transaction to be queried based on the multiple updated transaction group sets and the target transaction group set.

[0011] Optionally, after combining each candidate transaction with other candidate transactions from multiple candidate transactions according to the transaction direction to obtain multiple sets of transactions, the method further includes: re-operating on duplicate transactions in the multiple sets of transactions to obtain updated multiple sets of transactions; and changing the transaction content in each set of transactions according to the transaction direction of related transactions in each set of transactions through the updated multiple sets of transactions to obtain multiple updated sets of transactions.

[0012] Optionally, the database is a Hive database.

[0013] According to another aspect of this application, a transaction information processing apparatus is provided. The apparatus includes: a first determining unit, configured to receive a transaction to be queried, and retrieve transactions related to the transaction to be queried from a database, determining the transaction to be queried and transactions related to the transaction to be queried as candidate transactions, thereby obtaining multiple candidate transactions; a combining unit, configured to sequentially combine each candidate transaction with other candidate transactions from the multiple candidate transactions according to the transaction direction of the transaction, thereby obtaining multiple sets of transactions, wherein each set of transactions includes a target transaction and related transactions, and the target transaction and related transactions have opposite transaction directions; a changing unit, configured to change the related transactions in each set of transactions according to the transaction direction of the related transactions, thereby obtaining multiple sets of updated transactions; a second determining unit, configured to group the multiple sets of updated transactions according to related transactions, thereby obtaining multiple sets of transaction groups, and determining related transactions from the multiple sets of transaction groups as the set of transaction groups for the transaction to be queried, thereby obtaining a target set of transaction groups, wherein the related transactions in each set of transactions are the same; and a third determining unit, configured to determine the grouping information of transactions related to the transaction to be queried based on the target set of transaction groups.

[0014] According to another aspect of the present invention, a computer storage medium is also provided for storing a program, wherein the program, when running, controls the device where the computer storage medium is located to execute a transaction information processing method.

[0015] According to another aspect of the present invention, an electronic device is also provided, comprising one or more processors and a memory; the memory stores computer-readable instructions, and the processor is configured to execute the computer-readable instructions, wherein the computer-readable instructions execute a transaction information processing method.

[0016] This application employs the following steps: receiving a transaction to be queried, retrieving transactions related to the transaction to be queried from the database, identifying the transaction to be queried and its related transactions as candidate transactions, resulting in multiple candidate transactions; combining each candidate transaction with other candidate transactions from the multiple candidate transactions according to the transaction direction, resulting in multiple sets of transactions, where each set of transactions includes a target transaction and related transactions, with the target transaction and related transactions having opposite transaction directions; changing the related transactions in each set of transactions according to their transaction directions, resulting in multiple sets of updated transactions; grouping the multiple sets of updated transactions according to their related transactions, resulting in multiple sets of transaction groups, and determining the related transactions from these sets as the set of transaction groups for the transaction to be queried, resulting in a target set of transaction groups, where the related transactions in each set of transaction groups are identical; and determining the grouping information of transactions related to the transaction to be queried based on the target set of transaction groups. This solves the problem in related technologies where it is difficult to query the full relationships of data in a data table using Hive SQL on the Hive platform. By retrieving transactions associated with the transaction to be queried from the database, and determining the transactions that have a transaction relationship with the transaction to be queried based on the transaction direction and relationship between multiple transactions, the transactions that have a transaction relationship with the transaction to be queried are obtained, thereby achieving the effect of performing a full transaction relationship query based on Hive SQL on the Hive platform. Attached Figure Description

[0017] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:

[0018] Figure 1 This is a flowchart of a transaction information processing method provided according to an embodiment of this application;

[0019] Figure 2 This is a flowchart of an optional related-party transaction modification method provided according to an embodiment of this application;

[0020] Figure 3 This is a schematic diagram of a transaction information processing device provided according to an embodiment of this application;

[0021] Figure 4 This is a schematic diagram of an electronic device provided according to an embodiment of this application. Detailed Implementation

[0022] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.

[0023] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0024] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0025] It should be noted that all information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) involved in this disclosure are information and data authorized by the user or fully authorized by all parties. For example, this system has an interface with relevant users or organizations. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain the relevant information after receiving consent information from the aforementioned user or organization.

[0026] It should be noted that the transaction information processing methods, devices, storage media, and electronic devices defined in this disclosure can be used in the financial technology field, or in any field other than the financial technology field. The application fields of the transaction information processing methods, devices, storage media, and electronic devices defined in this disclosure are not limited.

[0027] According to an embodiment of this application, a transaction information processing method is provided.

[0028] Figure 1 This is a flowchart of a transaction information processing method according to an embodiment of this application. Figure 1As shown, the method includes the following steps:

[0029] Step S101: Receive the transaction to be queried, and retrieve the transactions related to the transaction to be queried from the database. Determine the transaction to be queried and the transactions related to the transaction to be queried as candidate transactions to obtain multiple candidate transactions.

[0030] Specifically, the database stores a large number of reciprocal transaction sets. Because Hive SQL's underlying API support differs somewhat from traditional relational databases like Oracle and MySQL, it doesn't support low-level processing such as loop statements and anonymous blocks. Therefore, it's impossible to perform loop queries based on identical transactions across multiple data sets. In this case, all transactions in the database can be added to a data table. Then, based on the information of the transaction to be queried, related transactions can be retrieved from the data table, resulting in multiple candidate transactions. The related transactions are those that meet the following condition: their attribute information is the same as the attribute information of the transaction to be queried.

[0031] It should be noted that the transaction to be queried can be a confirmed reverse transaction in the financial market. In the financial market, reverse transactions are usually defined as transactions with similar prices and amounts. Their main purpose is to disrupt the normal trading order of the market through false transactions in order to increase market liquidity.

[0032] For example, if the transaction to be queried is A, with the following attributes: transaction time: October 1, 2022, 18:00, transaction start date: October 1, 2022, transaction end date: October 1, 2023, currency: X, transaction amount: Y, then based on this attribute information, transaction B can be obtained from the database. The attribute information for transaction B is: transaction time: October 1, 2022, 18:05, transaction start date: October 1, 2022, transaction end date: October 1, 2023, currency: X, transaction amount: Y. Furthermore, based on transaction B, transaction C can be obtained: transaction time: October 1, 2022, 18:14, transaction start date: October 1, 2022, transaction end date: October 1, 2023, currency: X, transaction amount: Y. Therefore, both transactions B and C are related to transaction A, and transactions A, B, and C are identified as candidate transactions.

[0033] Step S102: Based on the transaction direction, each candidate transaction is sequentially combined with other candidate transactions from the multiple candidate transactions to obtain multiple sets of transactions. Each set of transactions includes a target transaction and a related transaction, with the target transaction and the related transaction having opposite transaction directions.

[0034] Specifically, after obtaining multiple candidate transactions, each transaction is sequentially combined with transactions in the opposite direction from other candidate transactions to obtain multiple sets of transactions. For example, if the multiple candidate transactions are transactions A, B, C, D, E, and F, and the transaction direction of transactions A, C, D, and F is incoming, while the transaction direction of transactions B and E is outgoing, the resulting sets of transactions are: (A, B), (A, E), (B, A), (B, C), (B, D), (B, F), (C, B), (C, E), (D, B), (D, E), (E, A), (E, C), (E, D), (E, F), (F, B), (F, E). In each set of transactions, the transaction to the left of the comma is the target transaction, and the transaction to the right of the comma is the related transaction.

[0035] Step S103: Change the related transactions according to the transaction direction of the related transactions in each group of transactions to obtain multiple groups of updated transactions.

[0036] Specifically, after obtaining multiple sets of transactions, the related transactions in each set can be changed according to the transaction direction of the related transactions, thereby updating the transaction content in each set. For example, if the transaction direction of a related transaction is outgoing, the related transaction can be changed to the target transaction. That is, if a set of transactions is (A, E) and the transaction direction of transaction E is outgoing, E in the set of transactions can be changed to A, resulting in the changed set of transactions (A, A).

[0037] Step S104: Group the multiple updated transactions according to related transactions to obtain multiple transaction group sets, and determine the transaction group set of related transactions as the transaction to be queried from the multiple transaction group sets to obtain the target transaction group set. Among them, the related transactions in each group of transactions in each transaction group set are the same.

[0038] Specifically, after obtaining multiple sets of updated transactions, they can be grouped according to related transactions to obtain multiple transaction group sets. Then, the related transactions in the transaction group sets can be selected as the transaction group set of the transaction to be queried, thus obtaining the target transaction group set. Transaction information related to the transaction to be queried can be determined based on the target transaction group set.

[0039] Step S105: Determine the grouping information of the transactions related to the transaction to be queried based on the target transaction group set.

[0040] Specifically, transaction information related to the transaction to be queried can be determined based on the target transaction group set, and transaction information related to the transaction to be queried can be determined in other transaction group sets based on the transaction information related to the transaction to be queried. The association information in the other transaction group sets can be changed, thereby obtaining grouping information that can perform a full transaction relationship query on the transaction to be queried based on Hive SQL on the Hive platform.

[0041] The transaction information processing method provided in this application involves receiving a transaction to be queried, retrieving transactions related to the transaction to be queried from a database, identifying the transaction to be queried and its related transactions as candidate transactions, and obtaining multiple candidate transactions. Each candidate transaction is then combined with other candidate transactions from the multiple candidate transactions according to their transaction direction, resulting in multiple sets of transactions. Each set of transactions includes a target transaction and related transactions, with the target transaction and related transactions having opposite transaction directions. Related transactions in each set are then modified according to their transaction directions, resulting in multiple sets of updated transactions. These updated sets of transactions are grouped according to their related transactions, resulting in multiple sets of transaction groups. From these sets, related transactions are identified as the transaction group set for the transaction to be queried, resulting in a target transaction group set. The related transactions in each group of transactions within each transaction group set are identical. Finally, the grouping information of transactions related to the transaction to be queried is determined based on the target transaction group set. This method solves the problem in related technologies where it is difficult to query the full relationships of data in a data table using Hive SQL on the Hive platform. By retrieving transactions associated with the transaction to be queried from the database, and determining the transactions that have a transaction relationship with the transaction to be queried based on the transaction direction and association among multiple transactions, the transactions that have a transaction relationship with the transaction to be queried are obtained, thereby achieving the effect of performing a full transaction relationship query based on HiveSQL on the Hive platform.

[0042] Optionally, in the transaction information processing method provided in this application embodiment, obtaining transactions related to the transaction to be queried from the database includes: obtaining attribute information of the transaction to be queried, obtaining target attribute information, and obtaining multiple initial transactions by obtaining transactions whose attribute information is the same as the target attribute information from the database; and determining the multiple initial transactions as transactions related to the transaction to be queried.

[0043] Specifically, you can first add all transactions in the database to a data table in the database, and then retrieve transactions related to the transaction to be queried from the data table based on the attribute information of the transaction to be queried, thereby obtaining multiple candidate transactions.

[0044] For example, if the transaction to be queried is A, with the following attributes: transaction time: October 1, 2022, 18:00, transaction start date: October 1, 2022, transaction end date: October 1, 2023, currency: X, transaction amount: Y, then based on this attribute information, transaction B can be obtained from the database. The attribute information for transaction B is: transaction time: October 1, 2022, 18:05, transaction start date: October 1, 2022, transaction end date: October 1, 2023, currency: X, transaction amount: Y. Furthermore, based on transaction B, transaction C can be obtained: transaction time: October 1, 2022, 18:14, transaction start date: October 1, 2022, transaction end date: October 1, 2023, currency: X, transaction amount: Y. Therefore, both transactions B and C are related to transaction A, and transactions A, B, and C are identified as candidate transactions.

[0045] Optionally, in the transaction information processing method provided in this application embodiment, combining each candidate transaction with other candidate transactions from multiple candidate transactions according to the transaction direction to obtain multiple sets of transactions includes: obtaining any candidate transaction to obtain a first candidate transaction; determining the transaction direction of the first candidate transaction to obtain a first transaction direction; obtaining candidate transactions from the remaining candidate transactions whose transaction direction is different from the first transaction direction to obtain multiple second candidate transactions, wherein the remaining candidate transactions are transactions other than the first candidate transaction from the multiple candidate transactions; and sequentially combining the first candidate transaction with each second candidate transaction to obtain multiple sets of transactions.

[0046] Specifically, when multiple transactions are obtained as transaction AF, the transaction direction of each transaction can be determined first. For example, if the transaction direction of transactions A, C, D, and F is incoming, and the transaction direction of transactions B and E is outgoing, the resulting sets of transactions are: (A, B), (A, E), (B, A), (B, C), (B, D), (B, F), (C, B), (C, E), (D, B), (D, E), (E, A), (E, C), (E, D), (E, F), (F, B), (F, E). In each set of transactions, the transaction to the left of the comma is the target transaction, and the transaction to the right of the comma is the related transaction. The transaction directions of the two transactions in each set are opposite.

[0047] Optionally, in the transaction information processing method provided in this application embodiment, changing the related transactions according to the transaction direction of the related transactions in each group of transactions to obtain multiple groups of updated transactions includes: determining the transaction direction of the related transactions in each group of transactions to obtain a second transaction direction; sequentially determining whether the second transaction direction is a billing direction; if the second transaction direction is a billing direction, changing the corresponding related transaction to a target transaction in the same transaction group to obtain multiple groups of updated transactions.

[0048] Specifically, when updating each group of transactions, it can be determined whether the transaction direction of related transactions in each group is the outgoing direction. If it is the outgoing direction, the related transaction is changed to the target transaction in the same group. For example, if a group of transactions is (A, E), and transaction E is the outgoing direction, the group of transactions is changed to (A, A), thus completing the update of each group of transactions.

[0049] Optionally, in the transaction information processing method provided in this application embodiment, determining the grouping information of transactions related to the transaction to be queried based on the target transaction group set includes: obtaining the target transaction of each group of transactions in the target transaction group set to obtain multiple first target transactions; obtaining the target transaction of each group of transactions in each of the remaining transaction group sets to obtain multiple target transaction sets, wherein each of the remaining transaction group sets is a transaction group set other than the target transaction group set in the multiple transaction group sets; sequentially determining whether any first target transaction exists in each target transaction set; if any first target transaction exists in the target transaction set, changing the associated transaction of each group of transactions in the transaction group set corresponding to the target transaction set to the transaction to be queried to obtain multiple updated transaction group sets; and determining the grouping information of transactions related to the transaction to be queried based on the multiple updated transaction group sets and the target transaction group set.

[0050] Specifically, Figure 2 This is a flowchart of an optional related-party transaction modification method provided according to an embodiment of this application, such as... Figure 2 As shown, after obtaining the target transaction group set, it is first necessary to obtain all target transactions in the target transaction group set, and then determine the transaction group set in other transaction group sets that contain the above target transactions, and change the related transactions in these transaction group sets to the transactions to be queried, thereby obtaining multiple updated transaction group sets.

[0051] For example, the target transaction group set can be (A, A), (B, A), (E, A), and the other transaction group sets can be: Group 1: (B, C), (C, C), (E, C), Group 2: (B, D), (D, D), (E, D). Since B and E exist in the target transactions in both Group 1 and Group 2, the related transactions in Group 1 and Group 2 can be changed to the transaction to be queried, A. Then Group 1 is: (B, A), (C, A), (E, A), and Group 2 is: (B, A), (D, A), (E, A).

[0052] After obtaining the aforementioned multiple sets of transactions, these sets can be stored in a database. When querying the inverse transactions of transaction A, transactions B, C, D, and E can be retrieved directly, instead of only B and C. This achieves the effect of performing full transaction relationship queries on the Hive platform based on Hive SQL.

[0053] Optionally, in the transaction information processing method provided in this application embodiment, after combining each candidate transaction with other candidate transactions in the multiple candidate transactions according to the transaction direction of the transaction to obtain multiple sets of transactions, the method further includes: re-processing duplicate transactions in the multiple sets of transactions to obtain updated multiple sets of transactions; and executing the updated multiple sets of transactions to change the transaction content in each set of transactions according to the transaction direction of the associated transactions in each set of transactions to obtain multiple sets of updated transactions.

[0054] For example, after obtaining multiple sets of transactions, we might get: (A, A), (A, A), (B, A), (B, C), (B, D), (B, F), (C, C), (C, C), (D, D), (D, D), (E, A), (E, C), (E, D), (E, F), (F, F), (F, F). In this case, we need to remove duplicates to get (A, A), (B, A), (B, C), (B, D), (B, F), (C, C), (D, D), (E, A), (E, C), (E, D), (E, F), (F, F), which facilitates the execution of the next step.

[0055] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0056] This application also provides a transaction information processing apparatus. It should be noted that the transaction information processing apparatus of this application can be used to execute the transaction information processing method provided in this application. The transaction information processing apparatus provided in this application will be described below.

[0057] Figure 3 This is a schematic diagram of a transaction information processing device provided according to an embodiment of this application. Figure 3 As shown, the device includes: a first determining unit 31, a combining unit 32, a changing unit 33, a second determining unit 34, and a third determining unit 35.

[0058] The first determining unit 31 is used to receive the transaction to be queried, retrieve the transactions related to the transaction to be queried from the database, determine the transaction to be queried and the transactions related to the transaction to be queried as candidate transactions, and obtain multiple candidate transactions.

[0059] Combination unit 32 is used to combine each candidate transaction with other candidate transactions from multiple candidate transactions in sequence according to the transaction direction of the transaction to obtain multiple sets of transactions. Each set of transactions includes a target transaction and a related transaction, and the target transaction and the related transaction have opposite transaction directions.

[0060] The modification unit 33 is used to modify the related transactions according to the transaction direction of the related transactions in each group of transactions, so as to obtain multiple groups of updated transactions.

[0061] The second determining unit 34 is used to group multiple sets of updated transactions according to related transactions to obtain multiple transaction group sets, and to determine the transaction group set of related transactions as the transaction to be queried from the multiple transaction group sets to obtain the target transaction group set, wherein the related transactions in each group of transactions in each transaction group set are the same.

[0062] The third determining unit 35 is used to determine the grouping information of transactions related to the transaction to be queried based on the target transaction group set.

[0063] The transaction information processing apparatus provided in this application embodiment receives a transaction to be queried by a first determining unit 31, retrieves transactions related to the transaction to be queried from the database, and determines the transaction to be queried and transactions related to the transaction to be queried as candidate transactions, thus obtaining multiple candidate transactions. A combining unit 32 combines each candidate transaction with other candidate transactions from the multiple candidate transactions according to the transaction direction, thus obtaining multiple sets of transactions. Each set of transactions includes a target transaction and related transactions, with the target transaction and related transactions having opposite transaction directions. A modifying unit 33 modifies the related transactions in each set of transactions according to the transaction direction of the related transactions, thus obtaining multiple sets of updated transactions. A second determining unit 34 groups the multiple sets of updated transactions according to the related transactions, thus obtaining multiple sets of transaction groups, and determines the related transactions from the multiple sets of transaction groups as the set of transaction groups for the transaction to be queried, thus obtaining a target set of transaction groups. The related transactions in each set of transactions are the same. A third determining unit 35 determines the grouping information of transactions related to the transaction to be queried based on the target set of transaction groups. This solves the problem in related technologies where it is difficult to query the full relationships of data in a data table based on Hive SQL on the Hive platform. By retrieving transactions associated with the transaction to be queried from the database, and determining the transactions that have a transaction relationship with the transaction to be queried based on the transaction direction and relationship between multiple transactions, the transactions that have a transaction relationship with the transaction to be queried are obtained, thereby achieving the effect of performing a full transaction relationship query based on Hive SQL on the Hive platform.

[0064] Optionally, in the transaction information processing apparatus provided in the embodiments of this application, the first determining unit 31 includes: a first obtaining module, used to obtain attribute information of the transaction to be queried, obtain target attribute information, and obtain multiple initial transactions by obtaining the same attribute information from the database as the target attribute information; and a first determining module, used to determine the multiple initial transactions as transactions related to the transaction to be queried.

[0065] Optionally, in the transaction information processing apparatus provided in this application embodiment, the combination unit 32 includes: a second acquisition module, used to acquire any candidate transaction to obtain a first candidate transaction; a second determination module, used to determine the transaction direction of the first candidate transaction to obtain a first transaction direction; a third acquisition module, used to acquire candidate transactions whose transaction direction is different from the first transaction direction from the remaining candidate transactions to obtain multiple second candidate transactions, wherein the remaining candidate transactions are transactions other than the first candidate transaction among the multiple candidate transactions; and a combination module, used to sequentially combine the first candidate transaction with each second candidate transaction to obtain multiple sets of transactions.

[0066] Optionally, in the transaction information processing device provided in the embodiments of this application, the modification unit 33 includes: a third determining module, used to determine the transaction direction of related transactions in each group of transactions to obtain a second transaction direction; a first judging module, used to sequentially judge whether the second transaction direction is a billing direction; and a first modification module, used to change the corresponding related transaction to a target transaction in the same transaction group when the second transaction direction is a billing direction, to obtain multiple groups of updated transactions.

[0067] Optionally, in the transaction information processing apparatus provided in this application embodiment, the third determining unit 35 includes: a fourth obtaining module, used to obtain the target transaction of each group of transactions in the target transaction group set, to obtain multiple first target transactions; a fifth obtaining module, used to obtain the target transaction of each group of transactions in each of the remaining transaction group sets, to obtain multiple target transaction sets, wherein each of the remaining transaction group sets is a transaction group set other than the target transaction group set in the multiple transaction group sets; a second judging module, used to sequentially judge whether any first target transaction exists in each target transaction set; a second changing module, used to change the associated transaction of each group of transactions in the transaction group set corresponding to the target transaction set to the transaction to be queried when any first target transaction exists in the target transaction set, to obtain multiple updated transaction group sets; and a fourth determining module, used to determine the grouping information of transactions related to the transaction to be queried based on the multiple updated transaction group sets and the target transaction group set.

[0068] Optionally, in the transaction information processing apparatus provided in the embodiments of this application, the apparatus further includes: a deduplication unit, used to deduplicate duplicate transactions in multiple groups of transactions to obtain updated multiple groups of transactions; and an execution unit, used to execute the step of changing the transaction content in each group of transactions according to the transaction direction of the associated transactions in each group of transactions to obtain multiple updated transactions.

[0069] Optionally, in the transaction information processing apparatus provided in this application embodiment, the database is a Hive database.

[0070] The aforementioned transaction information processing device includes a processor and a memory. The first determining unit 31, the combining unit 32, the changing unit 33, the second determining unit 34, the third determining unit 35, etc., are all stored in the memory as program units. The processor executes the aforementioned program units stored in the memory to realize the corresponding functions.

[0071] The processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured, and adjusting kernel parameters can address the challenge of querying the full relationships of data in a Hive table using Hive SQL on the Hive platform.

[0072] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0073] This invention provides a computer-readable storage medium storing a program thereon, which, when executed by a processor, implements the transaction information processing method.

[0074] This invention provides a processor for running a program, wherein the program executes the transaction information processing method during runtime.

[0075] like Figure 4 As shown, this embodiment of the invention provides an electronic device 40, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it performs the following steps: receiving a transaction to be queried, retrieving transactions related to the transaction to be queried from a database, identifying the transaction to be queried and transactions related to the transaction to be queried as candidate transactions, obtaining multiple candidate transactions; sequentially combining each candidate transaction with other candidate transactions from the multiple candidate transactions according to the transaction direction, obtaining multiple sets of transactions, wherein each set of transactions includes a target transaction and related transactions, with the target transaction and related transactions having opposite transaction directions; changing the related transactions according to the transaction direction of the related transactions in each set of transactions, obtaining multiple sets of updated transactions; grouping the multiple sets of updated transactions according to related transactions, obtaining multiple sets of transaction groups, and determining the set of transaction groups from the multiple sets of transaction groups as the transaction group set of the transaction to be queried, obtaining a target set of transaction groups, wherein the related transactions in each set of transactions are the same; determining the grouping information of transactions related to the transaction to be queried based on the target set of transaction groups. The device in this document can be a server, PC, PAD, mobile phone, etc.

[0076] This application also provides a computer program product, which, when executed on a data processing device, is suitable for executing an initialization program comprising the following steps: receiving a transaction to be queried, retrieving transactions related to the transaction to be queried from a database, identifying the transaction to be queried and transactions related to the transaction to be queried as candidate transactions, obtaining multiple candidate transactions; sequentially combining each candidate transaction with other candidate transactions from the multiple candidate transactions according to the transaction direction, obtaining multiple sets of transactions, wherein each set of transactions includes a target transaction and a related transaction, the target transaction and the related transaction having opposite transaction directions; changing the related transactions according to the transaction direction of the related transactions in each set of transactions, obtaining multiple sets of updated transactions; grouping the multiple sets of updated transactions according to the related transactions, obtaining multiple sets of transaction groups, and determining the related transactions as the set of transaction groups for the transaction to be queried from the multiple sets of transaction groups, obtaining a target set of transaction groups, wherein the related transactions in each set of transactions are the same; determining the grouping information of transactions related to the transaction to be queried based on the target set of transaction groups.

[0077] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0078] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0079] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0080] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0081] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0082] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0083] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0084] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0085] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A method for processing transaction information, characterized in that, include: Receive the transaction to be queried, retrieve the transactions related to the transaction to be queried from the database, determine the transaction to be queried and the transactions related to the transaction to be queried as candidate transactions, and obtain multiple candidate transactions; Based on the transaction direction, each candidate transaction is sequentially combined with other candidate transactions from the plurality of candidate transactions to obtain multiple sets of transactions. Each set of transactions includes a target transaction and a related transaction. The target transaction and the related transaction have opposite transaction directions. The target transaction refers to the transaction to the left of the comma in each set of transactions, and the related transaction refers to the transaction to the right of the comma in each set of transactions. By changing the transaction direction of related transactions in each group of transactions, multiple updated groups of transactions are obtained; The multiple updated transactions are grouped according to the related transactions to obtain multiple transaction group sets. The related transactions are determined from the multiple transaction group sets as the transaction group set of the transaction to be queried to obtain the target transaction group set. The related transactions in each group of transactions in each transaction group set are the same. The same related transactions mean that all the details of the related transactions are the same. The grouping information of the transactions related to the transaction to be queried is determined based on the target transaction group set.

2. The method according to claim 1, characterized in that, Retrieving transactions related to the queried transaction from the database includes: Obtain the attribute information of the transaction to be queried, obtain the target attribute information, and retrieve the transactions whose attribute information is the same as the target attribute information from the database to obtain multiple initial transactions; The multiple initial transactions are identified as transactions related to the transaction to be queried.

3. The method according to claim 1, characterized in that, Based on the transaction direction, each candidate transaction is sequentially combined with other candidate transactions from the plurality of candidate transactions to obtain multiple sets of transactions, including: Obtain any candidate transaction and get the first candidate transaction; Determine the transaction direction of the first candidate transaction to obtain the first transaction direction; From the remaining candidate transactions, candidate transactions with different transaction directions from the first transaction direction are obtained to obtain multiple second candidate transactions, wherein the remaining candidate transactions are transactions other than the first candidate transaction among the multiple candidate transactions; The first candidate transaction is combined with each second candidate transaction in turn to obtain the multiple sets of transactions.

4. The method according to claim 1, characterized in that, By changing the transaction direction of related transactions within each transaction group, multiple updated transaction groups are obtained, including: Determine the transaction direction of related transactions in each group of transactions to obtain the second transaction direction; Determine sequentially whether the second transaction direction is the outflow direction; When the second transaction direction is the outgoing direction, the corresponding related transaction is changed to the target transaction in the same transaction group to obtain the multiple updated transactions.

5. The method according to claim 1, characterized in that, The grouping information of the transactions related to the transaction to be queried, determined based on the target transaction group set, includes: Obtain the target transaction for each group of transactions in the target transaction group set to obtain multiple first target transactions; Obtain the target transaction for each group of transactions in each of the remaining transaction group sets to obtain multiple target transaction sets, wherein each of the remaining transaction group sets is a set of transaction groups other than the target transaction group sets among the multiple transaction group sets; In turn, determine whether any of the first target transactions exists in each target transaction set; If any first target transaction exists in the target transaction set, the associated transaction of each group of transactions in the transaction group set corresponding to the target transaction set is changed to the transaction to be queried, resulting in multiple updated transaction group sets; The grouping information of the transactions related to the transaction to be queried is determined based on the multiple updated transaction group sets and the target transaction group set.

6. The method according to claim 1, characterized in that, After combining each candidate transaction with other candidate transactions from the plurality of candidate transactions according to the transaction direction to obtain multiple sets of transactions, the method further includes: Repeat the operation on the duplicate transaction groups in the multiple transaction groups to obtain the updated multiple transaction groups; The updated sets of transactions are executed by changing the transaction content of each set of transactions according to the transaction direction of the related transactions in each set of transactions, thus obtaining multiple sets of updated transactions.

7. The method according to claim 1, characterized in that, The database in question is a Hive database.

8. A transaction information processing device, characterized in that, include: The first determining unit is used to receive the transaction to be queried, retrieve the transactions related to the transaction to be queried from the database, determine the transaction to be queried and the transactions related to the transaction to be queried as candidate transactions, and obtain multiple candidate transactions; A combination unit is used to sequentially combine each candidate transaction with other candidate transactions among the plurality of candidate transactions according to the transaction direction of the transaction to obtain multiple sets of transactions. Each set of transactions includes a target transaction and an associated transaction. The target transaction and the associated transaction have opposite transaction directions. The target transaction refers to the transaction to the left of the comma in each set of transactions, and the associated transaction refers to the transaction to the right of the comma in each set of transactions. The change unit is used to change the related transactions according to the transaction direction of the related transactions in each group of transactions, so as to obtain multiple groups of updated transactions; The second determining unit is used to group the multiple sets of updated transactions according to the related transactions to obtain multiple transaction group sets, and determine the related transactions as the transaction group set of the transaction to be queried from the multiple transaction group sets to obtain the target transaction group set. In this case, the related transactions in each group of transactions in each transaction group set are the same. The same related transactions mean that all the details of the related transactions are the same. The third determining unit is used to determine the grouping information of transactions related to the transaction to be queried based on the target transaction group set.

9. A computer storage medium, characterized in that, The computer storage medium is used to store a program, wherein the program, when running, controls the device where the computer storage medium is located to execute the transaction information processing method according to any one of claims 1 to 7.

10. An electronic device, characterized in that, It includes one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the transaction information processing method according to any one of claims 1 to 7.