Transaction summary query method and device, equipment, storage medium and program product
By obtaining the offset between the user time zone and the standard time zone in the transaction summary query, splitting the query interval and using pre-stored data tables to query transaction data, the accuracy and efficiency issues of transaction summary queries in different time zones are solved, and accurate and efficient transaction summaries are achieved.
Patent Information
- Application Number
- CN202510904224.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-01
- Publication Date
- 2025-10-17
AI Technical Summary
When existing transaction summary query methods perform transaction aggregation in different time zones, the results are inaccurate and the query efficiency is low, especially when the amount of user transaction data is large.
By obtaining the offset between the user time zone and the standard time zone, the query interval is split into the target complete query interval and the target scattered query interval. The transaction data query is performed using the pre-stored summary data table and time zone summary data table. The transaction data of the complete and scattered query intervals are processed separately and accumulated to obtain accurate transaction summary data.
It improves the accuracy and efficiency of transaction summary queries in different time zones, avoids errors in summary results caused by time zone differences, and improves the efficiency of transaction summary queries.
Smart Images

Figure CN120804128A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, and particularly relates to a transaction summary query method and device, equipment, a storage medium and a program product. BACKGROUND
[0002] In order to meet the diversified transaction record query requirements of users, financial service institutions often provide users with the function of custom transaction summary query, so that users can customize the time range and date range of transaction data to be summarized.
[0003] The current transaction summary query function is usually targeted at domestic users, so that foreign users will have inaccurate results when performing custom transaction summary query due to different time zones and domestic differences. When the amount of user transaction data is large, the transaction data in the user-defined time and date range needs to be summarized, which reduces the efficiency of the summary query. That is, the current method has the problems of inaccurate results of transaction summary query in different time zones and low query efficiency. SUMMARY
[0004] The main purpose of the present application is to provide a transaction summary query method, device, equipment, storage medium and program product, which aims to solve the technical problems of inaccurate results of transaction summary query in different time zones and low query efficiency.
[0005] To achieve the above purpose, the present application provides a transaction summary query method, which comprises:
[0006] In response to a transaction summary query request triggered by a user, a corresponding user ID, a user time zone and a query interval under the user time zone are obtained, wherein the query interval is a complete query interval, and the complete query interval is an interval with a starting time point of a day as a query starting time point and an ending time point of a day as a query cutoff time point;
[0007] Based on the user time zone and a preset standard time zone, the query interval is offset, and the offset query interval is split to obtain a target complete query interval and a target scattered query interval under the standard time zone;
[0008] Based on a preset summary data table, transaction data in the target complete query interval is queried to obtain first transaction summary data, wherein the summary data table has pre-stored transaction data summarized by transaction date;
[0009] Based on a preset time zone summary data table, transaction data in the target scattered query interval is queried to obtain second transaction summary data, wherein the time zone summary data table has pre-stored transaction data summarized by transaction date and transaction time period;
[0010] accumulating the first transaction summary data and the second transaction summary data to obtain transaction summary data.
[0011] In an embodiment, the query interval includes a start query time and an end query time, and the step of offsetting the query interval based on the user time zone and a preset standard time zone, and splitting the offset query interval to obtain a target complete query interval and a target scattered query interval in the standard time zone includes:
[0012] calculating a time zone offset based on the user time zone and the standard time zone;
[0013] offsetting the start query time and the end query time based on the time zone offset to obtain an offset target start query time and an offset target end query time, wherein the target start time includes an offset target start date, and the target end time includes an offset target end date;
[0014] determining an interval splitting time for splitting the query interval based on the target start date and the target end date;
[0015] determining an offset target query interval based on the offset target start query time and the offset target end query time;
[0016] splitting the target query interval based on the interval splitting time, the offset target start query time and the offset target end query time to obtain the target complete query interval and the target scattered query interval.
[0017] In an embodiment, the step of determining an interval splitting threshold based on the target start date and the target end date includes:
[0018] merging the next day of the target start date and a time point at the beginning of the day to obtain a first interval splitting time;
[0019] merging the previous day of the target end date and a time point at the end of the day to obtain a second interval splitting time.
[0020] In an embodiment, the target scattered query interval includes a first scattered query interval and a second scattered query interval, wherein the first scattered query interval is earlier than the second scattered query interval, and the step of splitting the target query interval based on the interval splitting time, the offset target start query time and the offset target end query time to obtain the target complete query interval and the target scattered query interval includes:
[0021] split the target query interval to obtain a first scattered query interval, wherein the first scattered query interval does not include the first interval split time, based on the target start query time as a query start time and the first interval split time as a query end time;
[0022] split the target query interval to obtain the target complete query interval, based on the first interval split time as a query start time and the second interval split time as a query end time;
[0023] split the target query interval to obtain a second scattered query interval, wherein the second scattered query interval does not include the second interval split time, based on the second interval split time as a query start time and the target end query time as a query end time.
[0024] In an embodiment, the target scattered query interval includes a first scattered query interval and a second scattered query interval, transaction data of different transaction time periods is stored in different fields of the time zone summary data table, and the step of querying the transaction data in the scattered query interval based on the preset time zone summary data table to obtain second transaction summary data includes:
[0025] calculating a first query total time of the first scattered query interval based on the target start query time and the first interval split time, and calculating a second query total time of the second scattered query interval based on the second interval split time and the target end query time;
[0026] calculating a first query field number of the first scattered query interval based on the first query total time and a summary time interval of the time zone summary data table, and calculating a second query field number of the second scattered query interval based on the second query total time and the summary time interval;
[0027] querying the transaction data in the time zone summary data table based on the first query field number and the first scattered query interval, and accumulating the queried transaction data to obtain third transaction summary data;
[0028] querying the transaction data in the time zone summary data table based on the second query field number and the second scattered query interval, and accumulating the queried transaction data to obtain fourth transaction summary data;
[0029] accumulating the third transaction summary data and the fourth transaction summary data to obtain the second transaction summary data.
[0030] In an embodiment, before the step of obtaining the corresponding user ID, user time zone and query interval under the user time zone in response to a transaction summary query request triggered by a user, the method further comprises:
[0031] When a transaction is generated, obtaining the transaction amount, transaction date and transaction time point of the transaction;
[0032] Based on the user ID and the transaction date, the transaction amount is accumulated into the summary data of the corresponding user and the corresponding date in the summary data table;
[0033] Based on the user ID, the transaction date and the transaction time point, the transaction amount is accumulated into the summary data of the corresponding user, the corresponding date and the corresponding time period in the time zone summary data table.
[0034] In addition, to achieve the above-mentioned purpose, the application further provides a transaction summary query device, which comprises:
[0035] An information obtaining module is configured to obtain the corresponding user ID, user time zone and query interval under the user time zone in response to a transaction summary query request triggered by a user, wherein the query interval is a complete query interval, and the complete query interval is an interval with a starting time point of a day as a query starting time point and an ending time point of a day as a query ending time point;
[0036] An interval offset module is configured to offset the query interval based on the user time zone and a preset standard time zone, and split the offset query interval to obtain a target complete query interval and a target scattered query interval under the standard time zone;
[0037] A first query module is configured to query the transaction data in the target complete query interval based on a preset summary data table to obtain first transaction summary data, wherein the summary data table has pre-stored transaction data summarized by transaction date;
[0038] A second query module is configured to query the transaction data in the target scattered query interval based on a preset time zone summary data table to obtain second transaction summary data, wherein the time zone summary data table has pre-stored transaction data summarized by transaction date and transaction time period;
[0039] A query summary module is configured to accumulate the first transaction summary data and the second transaction summary data to obtain transaction summary data.
[0040] In addition, to achieve the above object, the present application further provides a transaction summary query device, which comprises a memory, a processor and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the transaction summary query method as described above.
[0041] In addition, to achieve the above object, the present application further provides a storage medium, which is a computer readable storage medium, and the storage medium stores a computer program, and the computer program is executed by a processor to implement the steps of the transaction summary query method as described above.
[0042] In addition, to achieve the above object, the present application further provides a computer program product, which comprises a computer program, and the computer program is executed by a processor to implement the steps of the transaction summary query method as described above.
[0043] The one or more technical solutions provided by the present application have at least the following technical effects:
[0044] In response to a transaction summary query request triggered by a user, the present application acquires a corresponding user ID, a user time zone and a query interval under the user time zone, offsets the query interval based on the user time zone and a preset standard time zone, splits the offset query interval to obtain a target complete query interval and a target scattered query interval under the standard time zone, queries transaction data in the target complete query interval based on a preset summary data table to obtain first transaction summary data, queries transaction data in the target scattered query interval based on a preset time zone summary data table to obtain second transaction summary data, and accumulates the first transaction summary data and the second transaction summary data to obtain transaction summary data.
[0045] Compared with a method of only performing transaction summary based on domestic time, the present application converts query intervals under different time zones into query intervals under a standard time zone through time offset. Since the summary data table pre-stores transaction data summarized according to transaction dates, and the time zone summary data table pre-stores transaction data summarized according to transaction dates and transaction time periods, the present application can accurately query transaction data in an incomplete query interval after interval offset based on the summary data table and the time zone summary data table, thereby realizing accurate query of transaction summary data under different time zones. Since the transaction data summarized in the summary data table and the time zone summary data table is pre-stored, the present application does not need to perform real-time summary of transaction data when performing transaction summary query, thereby improving the efficiency of transaction summary query. Therefore, the present application can improve the efficiency of transaction summary query and the accuracy of transaction summary query under different time zones. BRIEF DESCRIPTION OF DRAWINGS
[0046] The accompanying drawings, which are incorporated herein and constitute part of the specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the application.
[0047] In order to more clearly illustrate the technical solutions of the embodiments of the present application or the prior art, the accompanying drawings required by the embodiments or prior art description will be briefly introduced as follows. Obviously, for those of ordinary skill in the art, the other drawings can also be obtained based on these drawings without any creative work.
[0048] Figure 1 A flowchart provided for the transaction summary query method embodiment one of the present application;
[0049] Figure 2 A flowchart provided for the transaction summary query method embodiment two of the present application;
[0050] Figure 3 A scenario diagram provided for the transaction summary query method embodiment two of the present application;
[0051] Figure 4 A module structure diagram of the transaction summary query device of the present application embodiment;
[0052] Figure 5 A device structure diagram of the hardware running environment involved in the transaction summary query method in the present application embodiment.
[0053] The object implementation, functional features and advantages of the present application will be further explained with reference to the accompanying drawings in conjunction with the embodiments. DETAILED DESCRIPTION
[0054] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application, and are not used to limit the present application.
[0055] In order to better understand the technical solutions of the present application, the following will be described in detail in conjunction with the drawings and specific embodiments of the present application.
[0056] It should be noted that the execution subject of the present embodiment can be a computing service device with data processing, network communication and program running functions, such as tablet computers, personal computers, mobile phones and the like, or an electronic device, a transaction summary query device and the like capable of realizing the above functions. The present embodiment and each of the following embodiments will be described below taking the transaction summary query device as an example.
[0057] To meet the diversified transaction record query requirements of users, financial service institutions often provide users with transaction summary query functions in addition to providing users with transaction list and transaction details query functions. Generally, the financial service institutions calculate the income and expenditure of users on a monthly or yearly basis, and also support users to make statistics according to a custom date range, so as to help users understand their own income and expenditure.
[0058] Many domestic financial service institutions mainly face domestic users, and the transaction time is stored and displayed according to the habits of domestic users, using Beijing time (UTC+8). This results in that when the user is in other time zones, the transaction record time is still displayed as Beijing time. For example, a user in London (UTC+0) completes a transfer transaction at 12 noon, and the transaction time after the transaction is successful is displayed as 8 pm (the Beijing time at that time), resulting in inaccurate results of transaction summary query. When the user has a large amount of transaction data, the transaction data of the user within the custom time and date range needs to be summarized, resulting in low efficiency of the summary query. That is, the current method has the problems of inaccurate results of transaction summary query in different time zones and low query efficiency.
[0059] Based on this, the embodiments of the present application provide a transaction summary query method, referring to Figure 1 , Figure 1 FIG. 1 is a flowchart of a first embodiment of the transaction summary query method of the present application.
[0060] In this embodiment, the transaction summary query method includes steps S10-S50:
[0061] Step S10, in response to a transaction summary query request triggered by a user, obtaining a corresponding user ID, a user time zone and a query interval under the user time zone, wherein the query interval is a complete query interval, and the complete query interval is an interval with a time point at the beginning of a day as a query starting time point and a time point at the end of a day as a query cutoff time point.
[0062] It should be noted that the transaction summary query request is a query request initiated by the user to view the overview of income and expenditure in a certain time range, the user ID is the number or account information of the user, which is used to locate the transaction data of the user in the system, the user time zone is the time zone corresponding to the geographical location where the user is currently located (such as UTC+8, UTC+0, etc.), which can be obtained through the device of the user initiating the query request, and the complete query interval is a range containing a complete day, which is adjusted from the user-defined date range based on the time of the user's time zone, that is, starting from 00:00:00 of the starting date and ending at 23:59:59 of the cutoff date.
[0063] It can be understood that the current financial service institutions usually use the unified Beijing time (UTC+8) for the storage and display of the transaction time, so that the statistical results are inconsistent with the actual time of the user's location when the user initiates a transaction summary query in different time zones, and even if some systems try to adjust the time display according to the user's time zone, it is often limited to the query of transaction data, without corresponding processing of transaction summary, thereby leading to inconsistency between the results of transaction summary query and the actual results.
[0064] Therefore, when receiving a transaction summary query request triggered by a user, the embodiment obtains the corresponding user ID, user time zone and query interval under the user time zone, and converts the query interval into a complete query interval, so that the transaction summary information of the user can be queried through the complete query interval under the user time zone, avoiding the problem of inaccurate transaction summary query caused by different query time zones.
[0065] In step S20, the query interval is offset based on the user time zone and a preset standard time zone, and the offset query interval is split to obtain a target complete query interval and a target scattered query interval under the standard time zone.
[0066] It should be noted that the preset standard time zone is a reference time used uniformly by the system, which is Beijing time (UTC+8) in this embodiment. The query interval offset is an operation of converting the time range defined based on the user time zone into the corresponding time range under the standard time zone. The target complete query interval is a time period under the standard time zone that can match the existing daily summary data in the summary data table. The target scattered query interval is a time period under the standard time zone that cannot completely match the daily data in the summary data table.
[0067] It can be understood that in order to convert the query interval under the non-standard time zone into the query interval under the standard time zone, the query interval is offset according to the user's time zone and the standard time zone. Since the query interval under the user time zone is a complete query interval, the offset will result in an incomplete query interval, which cannot be directly used for transaction summary query through the summary data table. Therefore, the embodiment splits the query interval into a complete query interval and a scattered query interval, so that when the user queries, the complete query interval and the scattered query interval can be processed respectively to realize the offset transaction summary query.
[0068] In a possible implementation, the query interval includes a starting query time and an ending query time, and the specific implementation of offsetting the query interval based on the user time zone and the preset standard time zone, and splitting the offset query interval to obtain the target complete query interval and the target scattered query interval under the standard time zone can also be:
[0069] based on the time zone offset, offsetting the start query time and the end query time respectively to obtain a target start query time and a target end query time, wherein the target start time comprises a target start date after offsetting, and the target end time comprises a target end date after offsetting, determining an interval splitting time for splitting the query interval based on the target start date and the target end date, determining a target query interval after offsetting based on the target start query time and the target end query time, splitting the target query interval based on the interval splitting time, the target start query time and the target end query time to obtain the target complete query interval and the target scattered query interval.
[0070] It should be noted that the start query time and the end query time are respectively the start time point and the end time point of the query time period defined by the user, the time zone offset is the difference value between the two time zones, the target start date and the target end date are respectively the query dates corresponding to the standard time zone after offsetting the time zone, and the interval splitting time is the boundary time point for defining the complete query interval and the scattered query interval, which is the whole day boundary (00:00:00 and 23:59:59 of a day) in this embodiment.
[0071] It can be understood that the complete query interval that has been aligned with the whole day boundary will no longer be able to align with the whole day boundary after offsetting, so that the transaction summary query cannot be performed by aggregating the data table. Therefore, the target start date and the target end date are used to determine the interval splitting time in this embodiment, so as to effectively separate the complete query interval that can be used for fast retrieval and the scattered query interval that needs to be calculated additionally, and improve the transaction and accuracy of the transaction summary query.
[0072] In a feasible implementation, the specific implementation of determining the interval splitting threshold based on the target start date and the target end date can also be:
[0073] merging the next day of the target start date and the time point at the beginning of the day to obtain a first interval splitting time, and merging the previous day of the target end date and the time point at the end of the day to obtain a second interval splitting time.
[0074] It should be noted that the first interval splitting time is the start boundary of the complete query interval and the scattered query interval, and the second interval splitting time is the end boundary of the complete query interval and the scattered query interval.
[0075] It can be understood that the offset query interval has multiple splitting methods, and can be split into complete query intervals and scattered query intervals of different sizes. Since the transaction summary query of the complete query interval can be directly performed by the transaction summary table by date, the query of the scattered query interval needs to be calculated additionally. Therefore, the embodiment merges the next day of the target start date and the time point at the beginning of the day to obtain a first interval splitting time, and merges the previous day of the target end date and the time point at the end of the day to obtain a second interval splitting time. Through the above calculation method, the first interval splitting time and the second interval splitting time are obtained, which can maximize the complete query interval during splitting and minimize the scattered query interval that needs to be calculated additionally, thereby reducing the time required for transaction summary query and improving the efficiency of transaction summary query.
[0076] In a feasible real-time manner, the target scattered query interval includes a first scattered query interval and a second scattered query interval, wherein the first scattered query interval is earlier than the second scattered query interval, and the specific embodiment of splitting the target query interval based on the interval splitting time, the target start query time and the target end query time to obtain the target complete query interval and the target scattered query interval can also be:
[0077] The target start query time is taken as the query start time, and the first interval splitting time is taken as the query end time to split the target query interval to obtain the first scattered query interval, wherein the first scattered query interval does not include the first interval splitting time. The first interval splitting time is taken as the query start time, and the second interval splitting time is taken as the query end time to split the target query interval to obtain the target complete query interval. The second interval splitting time is taken as the query start time, and the target end query time is taken as the query end time to split the target query interval to obtain the second scattered query interval, wherein the second scattered query interval does not include the second interval splitting time.
[0078] It should be noted that the first scattered query interval is a query interval before the split complete query interval, and the second scattered query interval is a query interval after the split complete query interval.
[0079] It can be understood that after the boundaries of the complete query interval are determined, the complete query interval can be split into three parts, including one complete query interval and two scattered query intervals, through the first interval splitting time and the second interval splitting time, so that the complete query interval and the scattered query interval can be queried respectively, and the accuracy of transaction summary query is improved.
[0080] Specifically, the interval splitting step is: obtaining a user ID, a time zone UTC+N where a user equipment is located, combining a query start date of UTC+N and +00:00:00 into a query start time Ts, and combining a query end date and +23:59:59 into a query end time Te, if N=8 (that is, Ts, Te are Beijing time of East Eight Zone, and no offset is needed), and for the scene of N≠8, calculating a time offset X=N-8, in units of hours.
[0081] Converting Ts, Te into UTC+8-based times Ts', Te', where Ts'=Ts-X, Te'=Te-X, Ts' and Te' are located in the UTC+8 time zone on dates Ds' and De' respectively. Based on the UTC+8 time zone, set Ts+1' as 00:00:00 at Ds'+1 day, and Te-1' as 23:59:59 at De'-1 day, at this time the query range [Ts', Te'] based on the UTC+8 time zone can be divided into [Ts', Ts+1'), [Ts+1', Te-1'], (Te-1', Te'] three intervals, where [Ts+1', Te-1'] is a complete date range, that is, a complete query interval, [Ts', Ts+1) is a first scattered query interval, and (Te-1', Te'] is a second scattered query interval.
[0082] In an embodiment, after the first interval splitting time and the second interval splitting time are calculated, the embodiment also compares the first interval splitting time and the second interval splitting time, and if the first interval splitting time is greater than the second interval splitting time, it is determined that the complete query interval is zero, and the transaction summary query is performed only through the first scattered query interval and the second scattered query interval.
[0083] In an embodiment, when a user performs a transaction summary query in a non-standard time zone, the number of queries of the user within a preset time is recorded, and if the number of queries exceeds a preset query number threshold, interval splitting and offset mapping are performed based on the user's multiple interval splitting records, so that when the user needs to perform a transaction summary query in different time zones, the query interval can be split through mapping, repeated calculation is avoided, and the efficiency of query interval offset and splitting is improved.
[0084] In an embodiment, after the query interval is offset based on the user time zone and the preset standard time zone, and the offset query interval is split, a corresponding bidirectional time mapping summary table is also generated, where the bidirectional time mapping summary table includes a mapping relationship of summary data under user time and standard time. The embodiment can show more detailed summary data through the above steps, and the summary data can be proofread, further improving the accuracy of the summary query.
[0085] In an embodiment, the embodiment also dynamically adjusts the time interval according to the relative difference between the time zone of the user and the standard time zone, and when performing the offset and splitting of the query interval, the accurate offset is queried through a preset time zone difference offset table, and the offset and splitting of the query interval are performed through the accurate offset, wherein the time zone difference offset table records the dynamic offset between each time zone including DST and the standard time zone. Through the above operation, the data deviation caused by ignoring DST can be avoided, and the accuracy of the offset and splitting of the query interval is further improved.
[0086] In an embodiment, the time zone difference offset table further includes the summer time entry time, the summer time exit time and the summer time additional offset, and the step of performing the offset and splitting of the query interval through the accurate offset further includes: judging whether the local query interval of the user covers the summer time start and end time points of the time zone, if there is coverage, respectively calculating two different offsets corresponding to the query interval before and after the summer time takes effect, and performing the offset and splitting of the query interval based on the different offsets. Through the above steps, the embodiment can effectively prevent data loss or errors caused by the change of summer time, thereby improving the accuracy of transaction summary data query.
[0087] In step S30, the transaction data in the target complete query interval is queried based on a preset summary data table to obtain first transaction summary data, wherein the summary data table has transaction data summarized by transaction date in advance;
[0088] It should be noted that the first transaction summary data includes summarized transaction income and transaction expenditure, the preset summary data table is a data table summarized by transaction date in advance and periodically updated in the system, and the first transaction summary data is transaction summary data accumulated from the summary data table based on the complete query interval.
[0089] It can be understood that the current transaction summary query method needs to summarize the transaction records found in the query one by one to obtain the final transaction summary query result. However, when the user has a large number of transactions in the selected time range, using this method will make the query response slow with the increase of the number of transactions, thereby causing performance problems. Therefore, the embodiment pre-stores the transaction data summarized by transaction date in the summary data table, thereby eliminating the need for transaction record summary when querying, and improving the efficiency of transaction summary query.
[0090] In step S40, the transaction data in the target scattered query interval is queried based on a preset time zone summary data table to obtain second transaction summary data, wherein the time zone summary data table has transaction data summarized by transaction date and transaction time period in advance;
[0091] It should be noted that the second transaction summary data includes summarized transaction income and transaction expenditure, the preset time zone summary data table is a data table in which transaction data is summarized according to specific transaction time in the system, and the second transaction summary data is a summary data table obtained by querying the transaction summary data from the time zone summary data table based on the scattered query interval.
[0092] It can be understood that the current transaction summary method queries the transaction summary data by date, and cannot query the transaction summary data of the non-complete query interval. Therefore, the embodiment additionally creates a time zone summary data table in which transaction data is summarized based on a specific time point, so as to query the transaction summary data of the non-complete query interval through the time zone summary data table, prevent the summary result error caused by the incomplete query interval, and improve the accuracy of the transaction summary query.
[0093] In step S50, the first transaction summary data and the second transaction summary data are accumulated to obtain transaction summary data.
[0094] It can be understood that the target scattered query interval and the target complete query interval are obtained by splitting the query interval determined by the user. Therefore, the embodiment quickly queries the transaction data in the target complete query interval through the summary data table, and accurately queries the data of the scattered query interval that cannot be queried by the summary data table through the time zone summary data table. Finally, the data queried by the above two methods is summarized, so as to improve the accuracy of the transaction summary data query while ensuring the efficiency of the transaction summary data query.
[0095] In summary, in response to the transaction summary query request triggered by the user, the embodiment obtains the corresponding user ID, user time zone and query interval under the user time zone, offsets the query interval based on the user time zone and the preset standard time zone, splits the offset query interval, obtains the target complete query interval and the target scattered query interval under the standard time zone, queries the transaction data in the target complete query interval based on the preset summary data table, obtains the first transaction summary data, queries the transaction data in the target scattered query interval based on the preset time zone summary data table, obtains the second transaction summary data, accumulates the first transaction summary data and the second transaction summary data, and obtains the transaction summary data.
[0096] Compared with the method of only aggregating transactions based on domestic time, the embodiment converts the query interval in different time zones into a query interval in a standard time zone through time offset. Since the aggregation data table pre-stores transaction data aggregated by transaction date, and the time zone aggregation data table pre-stores transaction data aggregated by transaction date and transaction time period, the embodiment can accurately query transaction data in the query interval after interval offset based on the aggregation data table and the time zone aggregation data table, thereby realizing accurate query of transaction aggregation data in different time zones. Since the transaction data aggregated in the aggregation data table and the time zone aggregation data table is pre-stored, real-time aggregation of transaction data is not required when transaction aggregation query is performed, and the efficiency of transaction aggregation query is improved. Therefore, the embodiment can improve the efficiency of transaction aggregation query and the accuracy of transaction aggregation query in different time zones.
[0097] Based on the first embodiment of the present application, the same or similar contents as the above embodiment one can be referred to the above description, and will not be described hereinafter. On this basis, please refer to Figure 2 , the target scattered query interval includes a first scattered query interval and a second scattered query interval, and transaction data of different transaction time periods is stored in different fields of the time zone aggregation data table. Step S40 further includes steps S41-S45:
[0098] Step S41, based on the target start query time and the first interval split time, the first query total time of the first scattered query interval is calculated, and based on the second interval split time and the target end query time, the second query total time of the second scattered query interval is calculated.
[0099] It should be noted that, in addition to the user ID, date and other necessary fields in the aggregation data table, the time zone aggregation data table also contains additional amount fields. The number of amount fields can be determined based on the preset aggregation time interval. In the embodiment, the preset aggregation time interval is 15 minutes, and there are 192 additional amount fields, which respectively save the total income and total expenditure of each 15 minutes from 0 o'clock in a day.
[0100] The first query total time is the time span from the start time point to the end time point of the first scattered query interval, and the second query total time is the time span from the start time point to the end time point of the first scattered query interval.
[0101] It can be understood that, unlike the aggregation data table, the time zone aggregation data table is not aggregated by date as a field, but aggregated by a specific time period. Therefore, the embodiment calculates the first query total time and the second query total time to determine the aggregation fields that need to be determined in the time zone aggregation data table, so as to accurately query the transaction data aggregation.
[0102] Step S42, based on the first query total time and the summary time interval of the time zone summary data table, calculate the first query field number of the first scattered query interval, and based on the second query total time and the summary time interval, calculate the second query field number of the second scattered query interval;
[0103] It should be noted that the summary time interval is used to determine the transaction storage time period when the transaction data is stored in the time zone summary data table, and the first query field number and the second query field number are the number of fields that need to be accessed in the time zone summary data table.
[0104] It can be understood that since there are corresponding number of amount fields in the time zone summary data table, each amount field stores the summary amount of user transactions in a time period. Therefore, after determining the first query total time and the second query total time that the user needs to query, the number of fields that need to be summarized is determined based on the summary time interval of the time zone summary data table, so as to realize the summarization of the data in the scattered query interval.
[0105] Step S43, based on the first query field number and the first scattered query interval, querying the transaction data in the time zone summary data table, and accumulating the transaction data obtained by querying to obtain third transaction summary data;
[0106] It should be noted that the third transaction summary data obtained by querying includes the summarized transaction income and transaction expenditure.
[0107] It can be understood that since each field in the time zone summary data table stores transaction summary data in a time period, and the first query total time usually includes multiple fields. Therefore, the embodiment finally obtains the transaction summary data of the first scattered query interval by accumulating the transaction summary data in the multiple fields obtained by querying.
[0108] Step S44, based on the second query field number and the second scattered query interval, querying the transaction data in the time zone summary data table, and accumulating the transaction data obtained by querying to obtain fourth transaction summary data;
[0109] It should be noted that the third transaction summary data obtained by querying includes the summarized transaction income and transaction expenditure.
[0110] It can be understood that the first scattered query interval and the second scattered query interval are respectively located before and after the complete query interval, and the two query intervals need to be queried respectively. Therefore, the embodiment is based on the second scattered query interval to query the transaction summary data, and the data obtained by the query is accumulated, so as to finally obtain the transaction summary data of the second scattered query interval.
[0111] In step S45, the third transaction summary data and the fourth transaction summary data are accumulated to obtain the second transaction summary data.
[0112] It can be understood that the embodiment accumulates the data obtained by querying the two scattered query intervals, and queries the transaction summary data of the scattered query interval which is prone to summary error, thereby improving the accuracy of the transaction summary query. For a specific transaction summary query process, please refer to the transaction summary query process of the first embodiment. Figure 3 .
[0113] In a feasible embodiment, in the specific embodiment of acquiring the corresponding user ID, user time zone and query interval before the user time zone in response to the transaction summary query request triggered by the user, the specific embodiment can also be:
[0114] When a transaction occurs, the user ID, transaction amount, transaction date and transaction time point of the transaction are acquired, the transaction amount is accumulated into the summary data of the corresponding user and the corresponding date in the summary data table based on the user ID and the transaction date, and the transaction amount is accumulated into the summary data of the corresponding user, the corresponding date and the corresponding time period in the time zone summary data table based on the user ID, the transaction date and the transaction time point.
[0115] It should be noted that the transaction time point is the specific time when the transaction occurs.
[0116] It can be understood that the current method can only summarize the transaction data of the corresponding date when summarizing the transaction, and if the transaction data is to be summarized in different time zones, the transaction data of the user needs to be summarized piece by piece, resulting in low efficiency of summary. Therefore, the embodiment stores the transaction amount in the corresponding summary data table and time zone summary data table when the corresponding transaction occurs. Through the above pre-summarization of data, it is not necessary to summarize again when querying, thereby improving the efficiency of transaction summary query.
[0117] In summary, the first query total time of the first scattered query interval is calculated first, and the second query total time of the second scattered query interval is calculated, and then the first query field number and the second query field number are calculated. Then, the data of the scattered query interval prone to summary error is subjected to transaction summary query through the query interval and the calculated query field number, thereby improving the accuracy of transaction summary query. Moreover, the transaction summary data of the present application is pre-stored in the summary data table and the time zone summary data table when the transaction is generated, so that it is not necessary to implement summary on each transaction record when querying, thereby improving the efficiency of transaction summary query.
[0118] It should be noted that the above examples are only used for understanding the present application and do not constitute a limitation on the transaction summary query method of the present application. More forms of simple transformation based on this technical concept are within the protection scope of the present application.
[0119] The present application also provides a transaction summary query device, which refers to Figure 4 The transaction summary query device comprises:
[0120] An information acquisition module 10 is configured to acquire a corresponding user ID, a user time zone and a query interval under the user time zone in response to a transaction summary query request triggered by a user, wherein the query interval is a complete query interval, and the complete query interval is an interval with a time point at the beginning of a day as a query starting time point and a time point at the end of a day as a query cutoff time point.
[0121] An interval offset module 20 is configured to offset the query interval based on the user time zone and a preset standard time zone, and split the offset query interval to obtain a target complete query interval and a target scattered query interval under the standard time zone.
[0122] A first query module 30 is configured to query transaction data in the target complete query interval based on a preset summary data table to obtain first transaction summary data, wherein the summary data table pre-stores transaction data summarized according to transaction dates.
[0123] A second query module 40 is configured to query transaction data in the target scattered query interval based on a preset time zone summary data table to obtain second transaction summary data, wherein the time zone summary data table pre-stores transaction data summarized according to transaction dates and transaction time periods.
[0124] A query summary module 50 is configured to accumulate the first transaction summary data and the second transaction summary data to obtain transaction summary data.
[0125] In an embodiment, the interval offset module comprises:
[0126] an offset amount calculation submodule, configured to calculate a time zone offset amount based on the user time zone and the standard time zone;
[0127] a time offset submodule, configured to offset the start query time and the end query time respectively based on the time zone offset amount to obtain an offset target start query time and an offset target end query time, wherein the target start time comprises an offset target start date, and the target end time comprises an offset target end date;
[0128] a split threshold determination submodule, configured to determine an interval split time for splitting a query interval based on the target start date and the target end date;
[0129] an interval determination submodule, configured to determine an offset target query interval based on the target start query time and the target end query time;
[0130] an interval split submodule, configured to split the target query interval based on the interval split time, the target start query time and the target end query time to obtain the target complete query interval and the target scattered query interval.
[0131] In an embodiment, the split threshold determination submodule comprises:
[0132] a first split determination unit, configured to combine a next day of the target start date and a time point at which the day starts to obtain a first interval split time;
[0133] a second split determination unit, configured to combine a previous day of the target end date and a time point at which the day ends to obtain a second interval split time.
[0134] In an embodiment, the interval split submodule comprises:
[0135] a first interval split unit, configured to split the target query interval based on the target start query time as a query start time and the first interval split time as a query end time to obtain a first scattered query interval, wherein the first scattered query interval does not include the first interval split time;
[0136] a complete interval split unit, configured to split the target query interval based on the first interval split time as a query start time and the second interval split time as a query end time to obtain the target complete query interval;
[0137] The second interval splitting unit is configured to split the target query interval to obtain a second scattered query interval, based on the second interval splitting time as a query start time and the target query end time as a query end time, wherein the second scattered query interval does not include the second interval splitting time.
[0138] In an embodiment, the second query module comprises:
[0139] The query total time determination sub-module is configured to calculate a first query total time of the first scattered query interval based on the target start query time and the first interval splitting time, and calculate a second query total time of the second scattered query interval based on the second interval splitting time and the target query end time.
[0140] The query field number determination sub-module is configured to calculate a first query field number of the first scattered query interval based on the first query total time and a summary time interval of the time zone summary data table, and calculate a second query field number of the second scattered query interval based on the second query total time and the summary time interval.
[0141] The first data query sub-module is configured to query transaction data in the time zone summary data table based on the first query field number and the first scattered query interval, and accumulate the queried transaction data to obtain third transaction summary data.
[0142] The second data query sub-module is configured to query transaction data in the time zone summary data table based on the second query field number and the second scattered query interval, and accumulate the queried transaction data to obtain fourth transaction summary data.
[0143] The data summary sub-module is configured to accumulate the third transaction summary data and the fourth transaction summary data to obtain the second transaction summary data.
[0144] In an embodiment, the transaction summary query device further comprises:
[0145] The transaction information acquisition module is configured to acquire a transaction amount, a transaction date and a transaction time point of the transaction when the transaction occurs.
[0146] The first transaction summary module is configured to accumulate the transaction amount to summary data of a corresponding user and a corresponding date in the summary data table based on the user ID and the transaction date.
[0147] A second transaction aggregation module is configured to accumulate the transaction amount into the aggregation data of the corresponding user, the corresponding date and the corresponding time period in the time zone aggregation data table based on the user ID, the transaction date and the transaction time point.
[0148] The transaction aggregation query device provided by the present application adopts the transaction aggregation query method in the above embodiments, and can solve the technical problems of inaccurate results and low query efficiency of transaction aggregation query in different time zones. Compared with the prior art, the transaction aggregation query device provided by the present application has the same beneficial effects as the transaction aggregation query method provided by the above embodiments, and other technical features in the transaction aggregation query device are the same as the features disclosed in the above embodiments, which will not be repeated here.
[0149] The present application provides a transaction aggregation query device, which comprises at least one processor and a memory in communication connection with the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the transaction aggregation query method in Embodiment I.
[0150] Reference will now be made to the drawings, and specific descriptions will be given below in accordance with the embodiments of the present application with reference to the drawings. Figure 5 The transaction aggregation query device in the embodiments of the present application can include but is not limited to mobile terminals such as mobile phones, tablet computers, notebook computers, digital broadcast receivers, PDAs (Personal Digital Assistant), PMPs (Portable Media Player), vehicle-mounted terminals (such as vehicle-mounted navigation terminals) and the like, and fixed terminals such as digital TVs, desktop computers and the like. Figure 5 The transaction aggregation query device shown is only an example, and should not bring any limitation to the functions and use range of the embodiments of the present application.
[0151] As Figure 5As shown, the transaction summary query device can include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.) that can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 1002 or programs loaded from a storage device 1003 into a random access memory (RAM) 1004. Various programs and data required for operation of the transaction summary query device are also stored in the RAM 1004. The processing device 1001, the ROM 1002, and the RAM 1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; the storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the transaction summary query device to communicate with other devices wirelessly or by wire to exchange data. Although the transaction summary query device with various systems is shown in the figure, it should be understood that all the shown systems are not required to be implemented or possessed. More or fewer systems can be alternatively implemented or possessed.
[0152] In particular, according to the embodiments disclosed in the present application, the processes described above with reference to the flowcharts can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product comprising a computer program carried on a computer readable medium, the computer program containing program codes for executing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network through the communication device, or installed from the storage device 1003, or installed from the ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the methods of the embodiments disclosed in the present application are performed.
[0153] The transaction summary query device provided in the present application adopts the transaction summary query method in the above-mentioned embodiments, and can solve the technical problems of inaccurate results and low query efficiency of transaction summary query in different time zones. Compared with the prior art, the transaction summary query device provided in the present application has the same beneficial effects as the transaction summary query method provided in the above-mentioned embodiments, and other technical features in the transaction summary query device are the same as the features disclosed in the above-mentioned method, which will not be repeated here.
[0154] It should be understood that various parts of the present application can be realized in hardware, software, firmware, or a combination thereof. In the above description of embodiments, specific functional, structural, material or characteristic features are combined in a manner appropriate for the particular example or embodiment. However, each feature can also be provided separately or in any appropriate sub-combination.
[0155] The above description is only specific embodiments of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think of changes or replacements within the technical scope disclosed by the present application, which should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
[0156] The present application provides a computer readable storage medium having stored thereon computer readable program instructions (i.e. computer programs) for performing the transaction summary query method in the above-described embodiments.
[0157] The computer readable storage medium provided by the present application may, for example, be a U disk, but is not limited to an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, system, or device, or any combination thereof. More specific examples of the computer readable storage medium can include, but are not limited to, an electrical connection having one or more conductive wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any appropriate combination thereof. In the present embodiment, the computer readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer readable storage medium can be transmitted in any appropriate medium, including but not limited to electrical wires, optical cables, RF (Radio Frequency), etc., or any appropriate combination thereof.
[0158] The above computer readable storage medium can be included in the transaction summary query device; or can exist separately and not be assembled into the transaction summary query device.
[0159] The above computer readable storage medium carries one or more programs, which, when executed by the transaction summary query device, cause the transaction summary query device to perform the above transaction summary query method.
[0160] Computer program code for carrying out operations of the present application can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).
[0161] The flow diagrams and the block diagrams in the drawings are meant as methodological and functional description of implementations of systems, methods, and computer program products according to the embodiments of the present application. In this regard, each block in the flow diagrams or block diagrams can represent a module, a segment, or a portion of code, which comprises one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently or the blocks may
[0162] The modules involved in the embodiments of the present application can be implemented in software or hardware. In some cases, the names of the modules do not constitute a limitation on the modules themselves.
[0163] The readable storage medium provided by the present application is a computer readable storage medium, which stores computer readable program instructions (i.e. computer programs) for executing the above transaction summary query method, and can solve the technical problems of inaccurate results and low query efficiency of transaction summary query in different time zones. Compared with the prior art, the computer readable storage medium provided by the present application has the same beneficial effects as the transaction summary query method provided by the above embodiments, which will not be described here.
[0164] The application also provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of the transaction summary query method as described above.
[0165] The computer program product provided by the application can solve the technical problems of inaccurate results and low query efficiency of transaction summary query in different time zones. Compared with the prior art, the beneficial effects of the computer program product provided by the application are the same as those of the transaction summary query method provided by the above-mentioned embodiments, and are not described here.
[0166] The user-related data (for example, user attribute data, user behavior data, and user geographic location, etc., the data types herein should be adaptively modified according to the scheme content) involved in the application are obtained after obtaining the user's permission or consent; that is, when the application is applied to a specific product or technology, the user's permission is required to realize the acquisition and processing of related data, and the processing of related data needs to comply with relevant laws, regulations and regulatory standards of relevant countries and regions.
[0167] The above only describes some embodiments of the application, and does not limit the patent scope of the application, and any equivalent structural transformation made by using the content of the application specification and drawings, or direct / indirect application in other related technical fields is included in the patent protection scope of the application.
Claims
1. A transaction summary query method, characterized in that: The method includes: In response to a transaction summary query request triggered by a user, obtaining the corresponding user ID, user time zone, and query interval in the user time zone, wherein the query interval is a complete query interval, which starts at the beginning of a day and ends at the end of a day; Based on the user time zone and the preset standard time zone, the query interval is offset, and the offset query interval is split to obtain a target complete query interval and a target scattered query interval under the standard time zone; Based on a preset summary data table, querying the transaction data within the target complete query interval to obtain first transaction summary data, wherein the summary data table pre-stores transaction data summarized by transaction date; Based on a preset time zone summary data table, querying the transaction data within the target scattered query interval to obtain second transaction summary data, wherein the time zone summary data table pre-stores transaction data summarized by transaction date and transaction time period; The first transaction summary data and the second transaction summary data are accumulated to obtain transaction summary data.
2. The method according to claim 1, wherein The query interval includes a start query time and an end query time. The steps of offsetting the query interval based on the user time zone and a preset standard time zone, and splitting the offset query interval to obtain a target complete query interval and a target scattered query interval under the standard time zone include: Calculating a time zone offset based on the user time zone and the standard time zone; Based on the time zone offset, the start query time and the end query time are offset respectively to obtain a target start query time and a target end query time after the offset, wherein the target start time includes a target start date after the offset, and the target end time includes a target end date after the offset; Determining, based on the target start date and the target end date, an interval splitting time for splitting the query interval; Determine a shifted target query interval based on the target start query time and the target end query time; The target query interval is split based on the interval splitting time, the target start query time, and the target end query time to obtain the target complete query interval and the target scattered query interval.
3. The method according to claim 2, wherein The step of determining the interval splitting threshold based on the target start date and the target end date includes: Merge the time point of the day after the target start date and the start of the day to obtain the first interval split time; The time point of the day before the target deadline and the end of the day are combined to obtain the second interval split time.
4. The method according to claim 3, wherein The target scattered query interval includes a first scattered query interval and a second scattered query interval, wherein the first scattered query interval is earlier than the second scattered query interval, and the step of splitting the target query interval based on the interval splitting time, the target start query time, and the target end query time to obtain the target complete query interval and the target scattered query interval includes: Using the target query start time as the query start time and the first interval splitting time as the query end time, the target query interval is split to obtain first scattered query intervals, wherein the first scattered query interval does not include the first interval splitting time; Splitting the target query interval using the first interval splitting time as the query start time and the second interval splitting time as the query end time to obtain the target complete query interval; The target query interval is split using the second interval splitting time as the query start time and the target query deadline time as the query deadline to obtain second scattered query intervals, wherein the second scattered query interval does not include the second interval splitting time.
5. The method according to claim 3, wherein: The target scattered query interval includes a first scattered query interval and a second scattered query interval, transaction data of different transaction time periods are stored in different fields of the time zone summary data table, and the step of querying the transaction data within the scattered query interval based on the preset time zone summary data table to obtain the second transaction summary data includes: Calculating a first total query time for the first scattered query interval based on the target start query time and the first interval split time, and calculating a second total query time for the second scattered query interval based on the second interval split time and the target end query time; Calculate the number of first query fields in the first scattered query interval based on the first query total time and the summary time interval of the time zone summary data table, and calculate the number of second query fields in the second scattered query interval based on the second query total time and the summary time interval; Based on the first query field number and the first scattered query interval, query the transaction data in the time zone summary data table, and accumulate the queryed transaction data to obtain third transaction summary data; Based on the second query field number and the second scattered query interval, query the transaction data in the time zone summary data table, and accumulate the queryed transaction data to obtain fourth transaction summary data; The third transaction summary data and the fourth transaction summary data are accumulated to obtain the second transaction summary data.
6. The method according to claim 5, wherein Before the step of obtaining the corresponding user ID, user time zone, and query interval in the user time zone in response to a transaction summary query request triggered by the user, the method further includes: When a transaction occurs, obtain the transaction amount, transaction date and transaction time; Based on the user ID and the transaction date, the transaction amount is added to the summary data of the corresponding user and the corresponding date in the summary data table; Based on the user ID, the transaction date and the transaction time point, the transaction amount is added to the summary data of the corresponding user, corresponding date and corresponding time period in the time zone summary data table.
7. A transaction summary query device, characterized in that: The device comprises: an information acquisition module, configured to, in response to a transaction summary query request triggered by a user, acquire a corresponding user ID, a user time zone, and a query interval within the user time zone, wherein the query interval is a complete query interval, which starts at the beginning of a day and ends at the end of a day; An interval offset module, configured to offset the query interval based on the user time zone and a preset standard time zone, and split the offset query interval to obtain a target complete query interval and a target scattered query interval under the standard time zone; a first query module configured to query transaction data within the target complete query interval based on a preset summary data table to obtain first transaction summary data, wherein the summary data table pre-stores transaction data summarized by transaction date; a second query module configured to query the transaction data within the target scattered query interval based on a preset time zone summary data table to obtain second transaction summary data, wherein the time zone summary data table pre-stores transaction data summarized by transaction date and transaction time period; The query summary module is used to accumulate the first transaction summary data and the second transaction summary data to obtain transaction summary data.
8. A transaction summary query device, characterized in that: The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the transaction summary query method according to any one of claims 1 to 6.
9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the transaction summary query method according to any one of claims 1 to 6 are implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the transaction summary query method according to any one of claims 1 to 6 are implemented.