A transaction result query method, device, equipment and storage medium
By determining the personalized query interval time in the account server based on the processing time of each transaction server and conducting polling and querying, the load increase and delay problems caused by transaction result query in the existing technology are solved, and more efficient transaction results are achieved Get and better user experience.
Patent Information
- Application Number
- CN202210101455.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-27
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2042-01-27
AI Technical Summary
When querying transaction results, the existing technology adopts a fixed time interval uniformly, which increases the burden on different transaction servers and network load, or leads to delays in transaction results, affecting user experience.
By maintaining the personalized query interval duration for each trading server in the account server, it is determined based on the duration of each trading server processing historical transaction requests, and polling and querying is performed based on these query interval durations until the processing is completed. information.
It reduces the burden on the transaction server and network load, shortens the acquisition time of transaction results, and improves the user experience.
Smart Images

Figure CN114463114B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of data processing technology, and in particular to a transaction result query method, device, equipment and storage medium. Background Art
[0002] With the rapid development of the Internet, banks are more inclined to provide more convenient services through their corresponding bank APPs (Applications), such as consumer payments, transfers, account opening and other transactions. Taking a transfer transaction as an example, when a user enters the transfer amount and the transfer account in the bank APP, the bank APP sends the transfer request to the account server, and the account server then sends the transfer request to the transaction server corresponding to the bank, which executes the transfer transaction. During the process of the transaction server executing the transfer transaction, the account server queries the transfer result of the transaction server and sends the query result to the bank APP so that the user can understand the progress of the current transfer transaction.
[0003] At present, the account server queries the transaction results of different transaction servers at fixed time intervals. However, for some transactions, some transaction servers take a long time to process transactions, and the transaction servers cannot complete the transaction within the time interval, but the account server frequently accesses the transaction server to query the transaction results at time intervals, which will increase the burden of the transaction server and the network load. Some transaction servers take a short time to process transactions, and the transaction server has completed the transaction in a very short time, but the account server accesses the transaction server to query the transaction results at time intervals, and the transaction results obtained by the account server will be delayed, which increases the user's waiting time and reduces the user experience.
[0004] Therefore, since the time taken by different trading servers to process transactions varies greatly, if the account server uses a unified time interval to query the transaction results of different trading servers, it will increase the burden on the trading server and the network load, or there will be a delay in obtaining the transaction results. Summary of the invention
[0005] The embodiments of the present application provide a transaction result query method, apparatus, device and storage medium for reducing the burden on the transaction server and the network load, while reducing the delay in obtaining transaction results.
[0006] On the one hand, an embodiment of the present application provides a transaction result query method, which is applied to an account server in a transaction processing system, wherein the transaction processing system includes an account server and multiple transaction servers, and the method includes:
[0007] receiving a transaction request sent by a terminal device, and sending the transaction request to a target transaction server, where the target transaction server is one of the multiple transaction servers;
[0008] If the account server has at least one query interval duration for the target transaction server, sending a transaction result query request to the target transaction server according to the at least one query interval duration, and receiving a query response message returned by the target transaction server, wherein the at least one query interval duration is determined according to the processing duration of multiple historical transaction requests processed by the target transaction server;
[0009] If the received query response message is a processing end message, the query response message is sent to the terminal device.
[0010] Optionally, sending a transaction result query request to the target transaction server according to at least one query interval duration, and receiving a query response message returned by the target transaction server, comprises:
[0011] The polling selects a query interval from the at least one query interval as a target query interval, and sends a transaction result query request to the target transaction server after the target query interval, and receives a query response message returned by the target transaction server, until the query response message is a processing end message, and the polling operation is terminated.
[0012] Optionally, it also includes:
[0013] During each polling operation, the query response messages received are all messages that have not been processed yet.
[0014] Optionally, the at least one query interval duration is determined according to a processing duration of a plurality of historical transaction requests processed by the target transaction server, including:
[0015] Based on the processing times of the multiple historical transaction requests, determining multiple reference processing times and corresponding historical transaction request ratios;
[0016] Fitting the multiple reference processing times and corresponding historical transaction request ratios to obtain a processing time distribution curve;
[0017] The at least one query interval duration is determined according to the processing duration distribution curve and at least one distribution probability.
[0018] Optionally, the determining, based on the processing times of the multiple historical transaction requests, multiple reference processing times and corresponding historical transaction request ratios includes:
[0019] After deduplication of the processing times of the multiple historical transaction requests, the multiple processing times retained are used as reference processing times;
[0020] Determine a target number of historical transaction requests corresponding to each of a plurality of reference processing times;
[0021] Based on the obtained multiple target quantities and the total quantity of the multiple historical transaction requests, the historical transaction request ratios corresponding to the multiple reference processing durations are determined.
[0022] Optionally, it also includes:
[0023] If the account server does not have a query interval for the target transaction server, the transaction result query request is sent to the target transaction server according to a preset interval.
[0024] Optionally, it also includes:
[0025] If the account server does not have a query interval duration for the target transaction server, determining the transaction similarity between the target transaction server and the at least one other transaction server based on the characteristic data of the target transaction server and the characteristic data corresponding to each of the at least one other transaction servers; the account server includes at least one query interval duration corresponding to each of the at least one other transaction servers;
[0026] determining a reference transaction server from the at least one other transaction server based on the obtained respective transaction similarities;
[0027] The at least one query interval duration corresponding to the reference transaction server is used as the at least one query interval duration corresponding to the target transaction server.
[0028] Optionally, the characteristic data includes a memory size and a number of users corresponding to the transaction server.
[0029] Optionally, it also includes:
[0030] If the number of newly added historical transaction requests meets a preset condition, at least one query interval duration of the target transaction server is updated according to the processing durations of the original plurality of historical transaction requests and the newly added plurality of historical transaction requests.
[0031] On the one hand, an embodiment of the present application provides a transaction result query device, the device comprising:
[0032] a transceiver module, configured to receive a transaction request sent by a terminal device, and send the transaction request to a target transaction server, wherein the target transaction server is one of the multiple transaction servers;
[0033] a query module, configured to send a transaction result query request to the target transaction server according to the at least one query interval, and receive a query response message returned by the target transaction server if at least one query interval exists in the account server for the target transaction server, wherein the at least one query interval is determined according to a processing duration of a plurality of historical transaction requests processed by the target transaction server;
[0034] The transceiver module is further configured to send the query response message to the terminal device if the received query response message is a processing completion message.
[0035] Optionally, the query module is specifically used to:
[0036] The polling selects a query interval from the at least one query interval as a target query interval, and sends a transaction result query request to the target transaction server after the target query interval, and receives a query response message returned by the target transaction server, until the query response message is a processing end message, and the polling operation is terminated.
[0037] Optionally, the query module is further used to:
[0038] During each polling operation, the query response messages received are all messages that have not been processed yet.
[0039] Optionally, the query module is specifically used to:
[0040] Based on the processing times of the multiple historical transaction requests, determining multiple reference processing times and corresponding historical transaction request ratios;
[0041] Fitting the multiple reference processing times and corresponding historical transaction request ratios to obtain a processing time distribution curve;
[0042] The at least one query interval duration is determined according to the processing duration distribution curve and at least one distribution probability.
[0043] Optionally, the query module is specifically used to:
[0044] After deduplication of the processing times of the multiple historical transaction requests, the multiple processing times retained are used as reference processing times;
[0045] Determine a target number of historical transaction requests corresponding to each of a plurality of reference processing times;
[0046] Based on the obtained multiple target quantities and the total quantity of the multiple historical transaction requests, the historical transaction request ratios corresponding to the multiple reference processing durations are determined.
[0047] Optionally, an initial module is further included, and the initial module is specifically used to:
[0048] If the account server does not have a query interval for the target transaction server, the transaction result query request is sent to the target transaction server according to a preset interval.
[0049] Optionally, the initial module is further used to:
[0050] If the account server does not have a query interval duration for the target transaction server, determining the transaction similarity between the target transaction server and the at least one other transaction server based on the characteristic data of the target transaction server and the characteristic data corresponding to each of the at least one other transaction servers; the account server includes at least one query interval duration corresponding to each of the at least one other transaction servers;
[0051] determining a reference transaction server from the at least one other transaction server based on the obtained respective transaction similarities;
[0052] The at least one query interval duration corresponding to the reference transaction server is used as the at least one query interval duration corresponding to the target transaction server.
[0053] Optionally, the characteristic data includes a memory size and a number of users corresponding to the transaction server.
[0054] Optionally, an update module is further included, and the update module is specifically used to:
[0055] If the number of newly added historical transaction requests meets a preset condition, at least one query interval duration of the target transaction server is updated according to the processing durations of the original plurality of historical transaction requests and the newly added plurality of historical transaction requests.
[0056] On the one hand, an embodiment of the present application provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned transaction result query method when executing the program.
[0057] On the one hand, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program executable by a computer device. When the program is run on the computer device, the computer device executes the steps of the above-mentioned transaction result query method.
[0058] In the embodiment of the present application, since different target transaction servers correspond to different at least one query interval durations, the account server sends a transaction result query request to the target transaction server according to at least one query interval duration, thereby avoiding the account server from frequently accessing the target transaction server and avoiding delays in the account server in obtaining transaction results, thereby improving the user experience.
[0059] Since the at least one query interval duration corresponding to each target transaction server is determined according to the processing duration of multiple historical transaction requests processed by the target transaction server, the at least one query interval duration determined for each target transaction server is more accurate and can more accurately obtain transaction results in the shortest time, while avoiding frequent access to the target transaction server. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0061] Figure 1 A schematic diagram of a system architecture provided for an embodiment of the present application;
[0062] Figure 2 A flowchart of a transaction result query method provided in an embodiment of the present application;
[0063] Figure 3 A flowchart of a method for determining at least one query interval duration provided in an embodiment of the present application;
[0064] Figure 4 A flowchart of a method for determining at least one query interval duration provided in an embodiment of the present application;
[0065] Figure 5 A processing time scatter plot provided in an embodiment of the present application;
[0066] Figure 6 A processing time distribution curve diagram provided in an embodiment of the present application;
[0067] Figure 7 A flowchart of a transaction result query method provided in an embodiment of the present application;
[0068] Figure 8 A flowchart of a transaction result query method provided in an embodiment of the present application;
[0069] Fig. 9A schematic diagram of a system architecture provided for an embodiment of the present application;
[0070] Fig.10 A schematic diagram of the structure of a transaction result query device provided in an embodiment of the present application;
[0071] Fig.11 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0072] In order to make the purpose, technical solution and beneficial effects of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0073] refer to Figure 1 , which is a transaction processing system architecture diagram applicable to an embodiment of the present application, the transaction processing system architecture at least includes terminal devices 101~1, ..., terminal devices 101~X, account servers 102 and transaction servers 103~1, ..., transaction servers 103~Y, wherein X is an integer greater than 0, and Y is an integer greater than 0.
[0074] The terminal devices 101-1 to 101-X are all installed with a target application for initiating a transaction, which may be a pre-installed client, a web application, or a small program embedded in other applications, etc. The terminal devices 101-1 to 101-X may be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc., but are not limited thereto.
[0075] The account server 102 and the transaction servers 103-1, 103-2, ..., 103-Y are the backend servers of the target application, providing services for the target application. The account server 102 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0076] Transaction servers 103-1 to 103-Y may be independent physical servers, or a server cluster or distributed system composed of multiple physical servers. They may also be cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.
[0077] The terminal devices 101-1 to 101-X are respectively connected to the account server 102, which may be directly or indirectly connected via wired or wireless communication, and this application does not limit this. The account server 102 is respectively connected to the transaction server 103-1 to 103-Y, which may be directly or indirectly connected via wired or wireless communication, and this application does not limit this.
[0078] Taking the terminal device 101 - 1 as an example, the terminal device 101 - 1 sends a transaction request to the account server 102 in response to the transaction operation of the user.
[0079] The account server 102 receives the transaction request sent by the terminal device 101-1, and sends the transaction request to a target transaction server, wherein the target transaction server is one of the multiple transaction servers 103-1 to 103-Y.
[0080] If there is at least one query interval duration for the target transaction server in the account server 102, a transaction result query request is sent to the target transaction server according to the at least one query interval duration, and a query response message returned by the target transaction server is received, wherein the at least one query interval duration is determined according to the processing duration of multiple historical transaction requests processed by the target transaction server.
[0081] If the query response message received by the account server 102 is a processing completion message, the query response message is sent to the terminal device 101-1.
[0082] based on Figure 1 The transaction processing system architecture diagram, the present application embodiment provides a transaction result query method process, such as Figure 2 As shown, the process of this method is Figure 1 The terminal device 101-1, the account server 102 and the transaction servers 103-1 to 103-Y shown in the figure interactively execute the following steps:
[0083] Step S201: The terminal device sends a transaction request to the account server.
[0084] Step S202: the account server sends a transaction request to a target transaction server.
[0085] Specifically, the target transaction server is one of the multiple transaction servers. The terminal device may be a bank customer terminal device, and the multiple transaction servers are transaction servers of various banks.
[0086] The transaction request may be an account opening request, a consumption payment request, a transfer request, etc., which are not limited here.
[0087] The transaction request includes a bank code, and the account server determines a target transaction server from transaction servers of multiple banks according to the bank code in the transaction request.
[0088] Step S203: If there is at least one query interval for the target transaction server in the account server, a transaction result query request is sent to the target transaction server according to the at least one query interval, and a query response message returned by the target transaction server is received.
[0089] The at least one query interval duration is determined according to the processing duration of multiple historical transaction requests processed by the target transaction server.
[0090] The account server has at least one query interval duration corresponding to each of the multiple transaction servers.
[0091] Specifically, when there is at least one query interval for the target transaction server in the account server, the account server selects a query interval from the at least one query interval corresponding to the target transaction server as the target query interval, and sends a transaction result query request to the target transaction server after the target query interval, and receives a query response message returned by the target transaction server, until the query response message is a processing completion message, the polling operation is terminated. In each polling operation, the query response message received is a processing unfinished message.
[0092] Specifically, one query interval duration may be selected from at least one query interval duration in order from small to large as the target query interval duration. If after selecting the maximum query interval duration from at least one query interval duration, the processing end message returned by the target transaction server is still not obtained, the maximum query interval duration may be selected from at least one query interval duration as the target query interval duration, or one query interval duration may be selected from at least one query interval duration in order from small to large as the target query interval duration.
[0093] For example, as shown in Table 1, the account server includes bank code 1 and 3 query intervals (12s, 15s, and 18s) corresponding to transaction server 1, and bank code 2 and 3 query intervals (6s, 8s, and 10s) corresponding to transaction server 2.
[0094] Table 1.
[0095] Trading Server Bank Code Query interval length 1 Query interval duration 2 Query interval length 3 Trading Server 1 Bank Code 1 12s 15s 18s Trading Server 2 Bank Code 2 6s 8s 10s
[0096] Set the transaction request to include bank code 1, query table 1 according to bank code 1, determine the target transaction server as transaction server 1, after the account server sends the transaction request to transaction server 1, the account server selects 12s as the target query interval, and after 12s, sends a transaction result query request to transaction server 1. Transaction server 1 sends a query response message to the account server, and sets the query response message received by the account server as a processing unfinished message, then the account server selects 15s as the target query interval, and after 15s, sends a transaction result query request to transaction server 1. Transaction server 1 sends a query response message to the account server, and sets the query response message received by the account server as a processing unfinished message, then the account server selects 18s as the target query interval, and after 18s, sends a transaction result query request to transaction server 1. Transaction server 1 sends a query response message to the account server, and sets the query response message received by the account server as a processing completed message, then the polling operation ends.
[0097] Optionally, if the number of newly added historical transaction requests meets a preset condition, at least one query interval duration of the target transaction server is updated according to the processing durations of the original plurality of historical transaction requests and the newly added plurality of historical transaction requests.
[0098] Specifically, the number of newly added historical transaction requests is a multiple of a preset value, or the number of newly added historical transaction requests reaches a preset value.
[0099] For example, the number of original historical transaction requests is 20,000, and the number of newly added historical transaction requests is 1,000, which is a multiple of 1,000. Therefore, according to the processing time of the 20,000 original historical transaction requests and the 1,000 newly added historical transaction requests, at least one query interval of the target server is updated.
[0100] In view of the fact that there is no query interval for the target transaction server in the account server, the embodiment of the present application provides the following two implementation methods:
[0101] In a possible implementation manner, if the account server does not have a query interval for the target transaction server, a transaction result query request is sent to the target transaction server according to a preset interval.
[0102] Specifically, different target transaction servers may correspond to the same preset time interval or different preset time intervals.
[0103] For example, as shown in Table 1, there are three query interval durations corresponding to two transaction servers in the account server, and the two transaction servers are transaction server 1 and transaction server 2 respectively.
[0104] If the target transaction server is transaction server 3, and there is no query interval for transaction server 3 in the account server, and the preset interval corresponding to transaction server 3 is set to 2s, the account server sends a transaction result query request to transaction server 3 every 2s until the account server receives a processing completion message sent by transaction server 3.
[0105] In the embodiment of the present application, when there is no query interval for the target transaction server in the account server, a transaction result query request is sent to the target transaction server according to the preset interval. Since the interval setting is simple, the transaction processing system is easy to deploy and easy to promote.
[0106] Another possible implementation method is that if the account server does not have a query interval for the target transaction server, the account server executes Figure 3 The following steps:
[0107] Step S301: determining transaction similarities between the target transaction server and at least one other transaction server based on feature data of the target transaction server and feature data corresponding to at least one other transaction server.
[0108] Specifically, the account server includes at least one query interval duration corresponding to at least one other transaction server. The characteristic data may be the characteristics of the bank corresponding to the transaction server, such as bank size, bank attributes, etc.; the characteristic data may also be the server attributes corresponding to the transaction server, such as memory size, etc.; of course, the characteristic data may also include both bank characteristics and server attributes, and this application does not make specific limitations on this.
[0109] Similarity calculation is performed on the characteristic data of the target transaction server and the characteristic data corresponding to at least one other transaction server to determine transaction similarities between the target transaction server and at least one other transaction server.
[0110] The transaction similarity may be a bank similarity determined based on the characteristics of the bank corresponding to the transaction server; or a server similarity determined based on the server attributes corresponding to the transaction server.
[0111] Step S302: determining a reference transaction server from at least one other transaction server based on the obtained similarities of each transaction.
[0112] Specifically, a transaction server corresponding to the maximum transaction similarity is determined as a reference transaction server.
[0113] Step S303: using at least one query interval duration corresponding to the reference transaction server as at least one query interval duration corresponding to the target transaction server.
[0114] For example, as shown in Table 1, there are three query interval durations corresponding to two transaction servers in the account server, and the two transaction servers are transaction server 1 and transaction server 2 respectively.
[0115] If the target transaction server is transaction server 3, and there is no query interval for transaction server 3 in the account server, the bank size and bank attributes corresponding to transaction server 3 are determined. At the same time, the bank size and bank attributes corresponding to transaction server 1 and the bank size and bank attributes corresponding to transaction server 2 are determined.
[0116] The bank size and bank attributes corresponding to the transaction server 3 are similarly calculated with the bank size and bank attributes corresponding to the transaction server 1, and the transaction similarity between the transaction server 3 and the transaction server 1 is determined to be d31.
[0117] The bank size and bank attributes corresponding to the transaction server 3 are similarly calculated with the bank size and bank attributes corresponding to the transaction server 2, and the transaction similarity between the transaction server 3 and the transaction server 2 is determined to be d32.
[0118] If d31 is less than d32, transaction server 2 is determined as the reference transaction server.
[0119] The three query intervals corresponding to the reference transaction server are used as the three query intervals corresponding to transaction server 3, and the bank code 3 and the three query intervals corresponding to transaction server 3 are added to Table 1 to obtain the following Table 2:
[0120] Table 2.
[0121] Trading Server Bank Code Query interval length 1 Query interval duration 2 Query interval length 3 Trading Server 1 Bank Code 1 12s 15s 18s Trading Server 2 Bank Code 2 6s 8s 10s Trading Server 3 Bank Code 3 6s 8s 10s
[0122] In the embodiment of the present application, by finding a reference transaction server in at least one other transaction server and using at least one query interval duration corresponding to the reference transaction server as at least one query interval duration corresponding to the target transaction server, it is possible to avoid the account server from frequently accessing the target transaction server to a certain extent.
[0123] Step S204: If the query response message received by the account server is a processing completion message, the query response message is sent to the terminal device.
[0124] In the embodiment of the present application, since different target transaction servers correspond to different at least one query interval durations, the account server sends a transaction result query request to the target transaction server according to at least one query interval duration, thereby avoiding the account server from frequently accessing the target transaction server and avoiding delays in the account server in obtaining transaction results, thereby improving the user experience.
[0125] Since the at least one query interval duration corresponding to each target transaction server is determined according to the processing duration of multiple historical transaction requests processed by the target transaction server, the at least one query interval duration determined for each target transaction server is more accurate and can more accurately obtain transaction results in the shortest time, while avoiding frequent access to the target transaction server.
[0126] Optionally, in the above step S203, determining at least one query interval duration includes: Figure 4 The following steps:
[0127] Step S401 : determining a plurality of reference processing times and corresponding historical transaction request ratios based on the processing times of a plurality of historical transaction requests.
[0128] Specifically, after deduplicating the processing times of multiple historical transaction requests, the retained multiple processing times are used as reference processing times, and then the target number of historical transaction requests corresponding to each of the multiple reference processing times is determined. Finally, based on the multiple target numbers obtained and the total number of multiple historical transaction requests, the proportion of historical transaction requests corresponding to each of the multiple reference processing times is determined.
[0129] For example, there are 12 historical transaction requests in total, and the processing times of the 12 historical transaction requests are 2s, 4s, 6s, 8s, 4s, 3.5s, 2s, 7s, 6s, 3.5s, 3.5s, and 4s respectively.
[0130] After removing duplicates from the above processing times, the reference processing times obtained are 2s, 4s, 6s, 8s, 3.5s, and 7s. The target number of historical transaction requests corresponding to each reference processing time is determined, as shown in Table 3.
[0131] Table 3.
[0132] Reference processing time (s) Target quantity 2 2 4 3 6 2 8 1 3.5 3 7 1
[0133] The ratio of the target number corresponding to each reference processing time to the total number 12 of multiple historical transaction requests is calculated to determine the proportion of historical transaction requests corresponding to each reference processing time, as shown in Table 4.
[0134] Table 4.
[0135] Reference processing time (s) Target quantity Historical transaction request ratio 2 2 16.7% 4 3 25% 6 2 16.7% 8 1 8.3% 3.5 3 25% 7 1 8.3%
[0136] Step S402 , fitting multiple reference processing times and corresponding historical transaction request ratios to obtain a processing time distribution curve.
[0137] Specifically, a processing time scatter plot is drawn based on multiple reference processing times and corresponding historical transaction request ratios, and fitting is performed based on the processing time scatter plot to obtain a processing time distribution curve.
[0138] For example, for the reference processing time in Table 4 and the corresponding historical transaction request ratio, draw a corresponding processing time scatter plot, such as Figure 5 shown.
[0139] For scatter plot Figure 5 Fit each point in to obtain the processing time distribution curve as shown in Figure 6 The area under the processing time distribution curve is 1.
[0140] Step S403: determining at least one query interval duration according to the processing duration distribution curve and at least one distribution probability.
[0141] For example, the three distribution probabilities are 60%, 80% and 90% respectively. Figure 6 The processing time distribution curve and three distribution probabilities shown determine the three query interval durations.
[0142] The distribution probability is set to 60%, and based on the processing time distribution curve and the distribution probability of 60%, the query interval duration is determined to be 6s.
[0143] The distribution probability is set to 80%, and based on the processing time distribution curve and the distribution probability of 80%, the query interval duration is determined to be 8s.
[0144] The distribution probability is set to 90%, and based on the processing time distribution curve and the distribution probability of 90%, the query interval is determined to be 10 seconds.
[0145] Therefore, according to Figure 6The processing time distribution curve and three distribution probabilities are shown, and the three query intervals determined are 6s, 8s and 10s respectively.
[0146] In order to better explain the embodiments of the present application, the following takes a specific embodiment scenario as an example to introduce a process of a transaction result query method provided by the embodiments of the present application. Figure 7 As shown:
[0147] Step S701: The terminal device sends a transaction request to the account server.
[0148] Step S702: the account server sends a transaction request to a target transaction server.
[0149] Step S703: If there is at least one query interval for the target transaction server in the account server, execute step S704; otherwise, execute step S711.
[0150] Step S704: the account server selects a query interval duration from at least one query interval duration through polling as a target query interval duration.
[0151] Step S705: the account server sends a transaction result query request to the target transaction server after a target query interval.
[0152] Step S706: The target transaction server sends a processing not completed message to the account server.
[0153] Step S707: The account server selects a query interval duration from at least one query interval duration through polling as a target query interval duration.
[0154] Step S708: the account server sends a transaction result query request to the target transaction server after a target query interval.
[0155] Step S709: The target transaction server sends a processing completion message to the account server.
[0156] Step S710: the account server sends a processing completion message to the terminal device.
[0157] Step S711: the account server sends a transaction result query request to the target transaction server at a preset interval.
[0158] Step S712: The target transaction server sends a processing not completed message to the account server.
[0159] Step S713: the account server sends a transaction result query request to the target transaction server at a preset interval.
[0160] Step S714: The target transaction server sends a processing completion message to the account server.
[0161] Step S715: The account server sends a processing completion message to the terminal device.
[0162] In the embodiment of the present application, whether there is at least one query interval for the target transaction server in the account server is considered. If there is at least one query interval for the target transaction server in the account server, a transaction result query request is sent to the target transaction server according to the at least one query interval, thereby avoiding the account server from frequently accessing the target transaction server and avoiding delays in the account server in obtaining transaction results, thereby improving the user experience.
[0163] If the account server does not have a query interval for the target transaction server, it will send a transaction result query request to the target transaction server according to the preset interval. Since the interval setting is simple, the transaction processing system is easy to deploy and easy to promote.
[0164] In order to better explain the embodiment of the present application, the following is an example of a specific embodiment scenario, where the terminal device is a bank a customer terminal device, and the bank a customer terminal device corresponds to the transaction server A. The account server includes the bank code 1 corresponding to the transaction server A, and 3 query interval durations (12s, 15s and 18s), the bank code 2 corresponding to the transaction server B, and 3 query interval durations (6s, 8s and 10s), and the bank code 3 corresponding to the transaction server C, and 3 query interval durations (8s, 10s and 12s), as shown in Table 5.
[0165] Table 5.
[0166] Trading Server Bank Code Query interval length 1 Query interval duration 2 Query interval length 3 Trading Server A Bank Code 1 12s 15s 18s Trading Server B Bank Code 2 6s 8s 10s Trading Server C Bank Code 3 8s 10s 12s
[0167] In view of the above specific embodiment scenario, the present application embodiment provides a process of a transaction result query method, such as Figure 8 As shown:
[0168] Step S801: Bank a customer terminal device sends a transaction request to an account server.
[0169] Specifically, the transaction request includes bank code 1, and table 5 is queried according to bank code 1 to determine that the target transaction server is transaction server A.
[0170] Step S802: The account server sends a transaction request to transaction server A.
[0171] Step S803: There is at least one query interval for transaction server A in the account server, and 12 seconds is selected as the target query interval from the at least one query interval.
[0172] Step S804: the account server sends a transaction result query request to transaction server A after a target query interval of 12 seconds.
[0173] Step S805: Transaction server A sends a processing not completed message to the account server.
[0174] Step S806: The account server selects 15 seconds from at least one query interval as a target query interval.
[0175] Step S807: The account server sends a transaction result query request to transaction server A after a target query interval of 15 seconds.
[0176] Step S808: Transaction server A sends a processing not completed message to the account server.
[0177] Step S809: The account server selects 18 seconds from at least one query interval as a target query interval.
[0178] Step S810: The account server sends a transaction result query request to transaction server A after a target query interval of 18 seconds.
[0179] Step S811, transaction server A sends a processing completion message to the account server.
[0180] Step S812: The account server sends a processing completion message to the customer terminal device of bank a.
[0181] In order to better explain the embodiment of the present application, the following describes a transaction result query method provided by the embodiment of the present application in combination with a specific implementation scenario. Figure 1 The account server 102 in the example is executed. Fig. 9 As shown, it includes terminal devices 101-1, account server 102 and target transaction server 103-1. The account server 102 includes a transaction acquisition module 901, a query interval module 902, an initial module 903, a database 904 and a statistical analysis module 905.
[0182] The terminal device 101-1 sends a transaction request to the transaction acquisition module 901 of the account server 102.
[0183] The transaction acquisition module 901 sends a transaction request to the target transaction server 103-1.
[0184] If there is at least one query interval for the target transaction server 103-1 in the query interval module 902, a transaction result query request is sent to the target transaction server 103-1 according to the at least one query interval, and a query response message returned by the target transaction server 103-1 is received.
[0185] If the query response message received by the query interval duration module 902 is a processing completion message, the query response message is sent to the terminal device 101-1.
[0186] If the query interval duration for the target transaction server 103-1 does not exist in the query interval duration module 902, the initial module 903 sends a transaction result query request to the target transaction server 103-1 according to the preset interval duration.
[0187] Alternatively, the initial module 903 determines the transaction similarity between the target transaction server 103-1 and at least one other transaction server based on the feature data of the target transaction server 103-1 and the feature data corresponding to each other transaction server; determines a reference transaction server from at least one other transaction server based on the obtained transaction similarities; and uses at least one query interval duration corresponding to the reference transaction server as at least one query interval duration corresponding to the target transaction server 103-1.
[0188] The transaction request processed by the query interval duration module 902 or the initial module 903 is used as a historical transaction request, and the processing duration of the historical transaction request is added to the database 904 .
[0189] The statistical analysis module 905 determines multiple reference processing times and corresponding historical transaction request ratios based on the processing times of multiple historical transaction requests in the database 904; fits the multiple reference processing times and the corresponding historical transaction request ratios to obtain a processing time distribution curve; determines at least one query interval duration based on the processing time distribution curve and at least one distribution probability, and sends the at least one query interval duration to the query interval duration module 902.
[0190] When the number of newly added historical transaction requests meets the preset condition, the statistical analysis module 905 updates at least one query interval duration of the target transaction server 103-1 according to the processing durations of the original multiple historical transaction requests and the newly added multiple historical transaction requests in the database 904, and sends the at least one query interval duration to the query interval duration module 902.
[0191] Based on the same technical concept, the embodiment of the present application provides a transaction result query device, such as Fig.10 As shown, the transaction result query device 1000 includes:
[0192] The transceiver module 1001 is used to receive a transaction request sent by a terminal device, and send the transaction request to a target transaction server, where the target transaction server is one of the multiple transaction servers;
[0193] A query module 1002 is configured to send a transaction result query request to the target transaction server according to the at least one query interval, and receive a query response message returned by the target transaction server if at least one query interval exists in the account server for the target transaction server, wherein the at least one query interval is determined according to a processing duration of a plurality of historical transaction requests processed by the target transaction server;
[0194] The transceiver module 1001 is further configured to send the query response message to the terminal device if the received query response message is a processing end message.
[0195] Optionally, the query module 1002 is specifically used for:
[0196] The polling selects a query interval from the at least one query interval as a target query interval, and sends a transaction result query request to the target transaction server after the target query interval, and receives a query response message returned by the target transaction server, until the query response message is a processing end message, and the polling operation is terminated.
[0197] Optionally, the query module 1002 is further used to:
[0198] During each polling operation, the query response messages received are all messages that have not been processed yet.
[0199] Optionally, the query module 1002 is specifically used for:
[0200] Based on the processing times of the multiple historical transaction requests, determining multiple reference processing times and corresponding historical transaction request ratios;
[0201] Fitting the multiple reference processing times and corresponding historical transaction request ratios to obtain a processing time distribution curve;
[0202] The at least one query interval duration is determined according to the processing duration distribution curve and at least one distribution probability.
[0203] Optionally, the query module 1002 is specifically used for:
[0204] After deduplication of the processing times of the multiple historical transaction requests, the multiple processing times retained are used as reference processing times;
[0205] Determine a target number of historical transaction requests corresponding to each of a plurality of reference processing times;
[0206] Based on the obtained multiple target quantities and the total quantity of the multiple historical transaction requests, the historical transaction request ratios corresponding to the multiple reference processing durations are determined.
[0207] Optionally, an initial module 1003 is further included, and the initial module 1003 is specifically used for:
[0208] If the account server does not have a query interval for the target transaction server, the transaction result query request is sent to the target transaction server according to a preset interval.
[0209] Optionally, the initial module 1003 is further used for:
[0210] If the account server does not have a query interval duration for the target transaction server, determining the transaction similarity between the target transaction server and the at least one other transaction server based on the characteristic data of the target transaction server and the characteristic data corresponding to each of the at least one other transaction servers; the account server includes at least one query interval duration corresponding to each of the at least one other transaction servers;
[0211] determining a reference transaction server from the at least one other transaction server based on the obtained respective transaction similarities;
[0212] The at least one query interval duration corresponding to the reference transaction server is used as the at least one query interval duration corresponding to the target transaction server.
[0213] Optionally, the characteristic data includes a memory size and a number of users corresponding to the transaction server.
[0214] Optionally, an updating module 1004 is further included, and the updating module 1004 is specifically used for:
[0215] If the number of newly added historical transaction requests meets a preset condition, at least one query interval duration of the target transaction server is updated according to the processing durations of the original plurality of historical transaction requests and the newly added plurality of historical transaction requests.
[0216] Based on the same technical concept, the embodiment of the present application provides a computer device, which may be a terminal or a server, such as Fig.11 As shown, it includes at least one processor 1101 and a memory 1102 connected to the at least one processor. The specific connection medium between the processor 1101 and the memory 1102 is not limited in the embodiment of the present application. Fig.11For example, the processor 1101 and the memory 1102 are connected via a bus. The bus can be divided into an address bus, a data bus, a control bus, etc.
[0217] In the embodiment of the present application, the memory 1102 stores instructions that can be executed by at least one processor 1101. The at least one processor 1101 can execute the steps included in the above-mentioned transaction result query method by executing the instructions stored in the memory 1102.
[0218] Among them, the processor 1101 is the control center of the computer device, and can use various interfaces and lines to connect various parts of the computer device, and query the transaction results by running or executing instructions stored in the memory 1102 and calling data stored in the memory 1102. Optionally, the processor 1101 may include one or more processing units, and the processor 1101 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 1101. In some embodiments, the processor 1101 and the memory 1102 may be implemented on the same chip, and in some embodiments, they may also be implemented separately on independent chips.
[0219] Processor 1101 can be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit (ASIC), a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware processor for execution, or can be executed by a combination of hardware and software modules in the processor.
[0220] Memory 1102, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules. Memory 1102 may include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (Random Access Memory, RAM), static random access memory (Static Random Access Memory, SRAM), programmable read-only memory (Programmable Read Only Memory, PROM), read-only memory (Read Only Memory, ROM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), magnetic memory, disk, optical disk, etc. Memory 1102 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 1102 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.
[0221] Based on the same inventive concept, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program that can be executed by a computer device. When the program runs on the computer device, the computer device executes the steps of the above-mentioned transaction result query method.
[0222] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0223] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0224] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0225] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0226] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A transaction result query method, applied to an account server in a transaction processing system, wherein the transaction processing system includes an account server and multiple transaction servers, characterized in that: include: receiving a transaction request sent by a terminal device, and sending the transaction request to a target transaction server, where the target transaction server is one of the multiple transaction servers; Determining multiple reference processing times and corresponding historical transaction request ratios based on the processing times of multiple historical transaction requests processed by the target transaction server; Fitting the multiple reference processing times and corresponding historical transaction request ratios to obtain a processing time distribution curve; Determining at least one query interval duration according to the processing duration distribution curve and at least one distribution probability; Selecting a target query interval duration from the at least one query interval duration by polling in ascending order of the query interval duration; and sending a transaction result query request to the target transaction server after a target query interval; If after selecting the maximum query interval duration among at least one query interval duration, no processing completion message returned by the target transaction server is obtained, the maximum query interval duration is always selected as the target query interval duration in the following, until the processing completion message returned by the target transaction server is obtained, and the polling operation is terminated; If the received query response message is a processing end message, the query response message is sent to the terminal device.
2. The method according to claim 1, characterized in that Also includes: During each polling operation, the query response messages received are all messages that have not been processed yet.
3. The method according to claim 1, characterized in that The determining of multiple reference processing times and corresponding historical transaction request ratios based on the processing times of multiple historical transaction requests processed by the target transaction server includes: After deduplication of the processing times of the multiple historical transaction requests, the multiple processing times retained are used as reference processing times; Determine a target number of historical transaction requests corresponding to each of a plurality of reference processing times; Based on the obtained multiple target quantities and the total quantity of the multiple historical transaction requests, the historical transaction request ratios corresponding to the multiple reference processing durations are determined.
4. The method according to claim 1, characterized in that Also includes: If the account server does not have a query interval for the target transaction server, the transaction result query request is sent to the target transaction server according to a preset interval.
5. The method according to claim 1, characterized in that Also includes: If the account server does not have a query interval duration for the target transaction server, determining the transaction similarity between the target transaction server and the at least one other transaction server based on the characteristic data of the target transaction server and the characteristic data corresponding to each of the at least one other transaction servers; the account server includes at least one query interval duration corresponding to each of the at least one other transaction servers; determining a reference transaction server from the at least one other transaction server based on the obtained respective transaction similarities; The at least one query interval duration corresponding to the reference transaction server is used as the at least one query interval duration corresponding to the target transaction server.
6. The method according to claim 5, characterized in that The characteristic data includes the memory size and the number of users corresponding to the transaction server.
7. The method according to claim 3, characterized in that Also includes: If the number of newly added historical transaction requests meets a preset condition, at least one query interval duration of the target transaction server is updated according to the processing durations of the original plurality of historical transaction requests and the newly added plurality of historical transaction requests.
8. A transaction result query device, characterized in that: include: A transceiver module, used for receiving a transaction request sent by a terminal device, and sending the transaction request to a target transaction server, where the target transaction server is one of the multiple transaction servers; A query module, configured to determine a plurality of reference processing times and corresponding historical transaction request ratios based on the processing times of a plurality of historical transaction requests processed by the target transaction server; Fitting the multiple reference processing times and corresponding historical transaction request ratios to obtain a processing time distribution curve; Determining at least one query interval duration according to the processing duration distribution curve and at least one distribution probability; Selecting a target query interval duration from the at least one query interval duration by polling in ascending order of the query interval duration; and sending a transaction result query request to the target transaction server after a target query interval; If after selecting the maximum query interval duration among at least one query interval duration, no processing completion message returned by the target transaction server is obtained, the maximum query interval duration is always selected as the target query interval duration in the following, until the processing completion message returned by the target transaction server is obtained, and the polling operation is terminated; The transceiver module is further configured to send the query response message to the terminal device if the received query response message is a processing completion message.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of any one of the methods of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: It stores a computer program executable by a computer device. When the program is run on the computer device, the computer device executes the steps of any method described in claims 1 to 7.
Citation Information
Patent Citations
Message transmission method, device and system
CN105208125A
Transaction processing method and device and server
CN112114938A