Order state query method, device and equipment and computer readable storage medium
By dividing order status query into two stages in the merchant system and dynamically adjusting the query time according to the number of queries, the invalid query and extended waiting problems caused by insufficient preset time interval settings are solved, and the optimization of resource utilization and user experience are achieved. promote.
Patent Information
- Application Number
- CN202410926548.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-11
- Publication Date
- 2024-11-05
AI Technical Summary
When the existing merchant system is waiting for the user to pay, if the value set by the preset time interval is small, it will cause invalid query and waste system resources; if the value set is large, it may cause the user to extend the time after the payment is successful, which will affect the impact of User experience.
The order status query is divided into two stages: the first stage is querying at a shorter time interval at the beginning of the order creation, and the second stage is querying at an exponentially growing time interval, and the query time is dynamically adjusted according to the number of queries to avoid invalid queries and extended waits.
This not only reduces the waste of system resources, but also improves timely feedback after successful payment and improves user experience.
Smart Images

Figure CN118897846A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of data processing technology, and in particular, relates to an order status query method, device, equipment and computer-readable storage medium. Background Art
[0002] Usually, when a user consumes in the merchant system, the merchant system can create an order for the user and call the third-party payment system to wait for the user to pay. After the user completes the payment, the third-party payment system can call a callback interface of the merchant system to return the payment result to the merchant system. If the payment result is successful, the merchant system can deliver the goods corresponding to the user's consumption to the customer. If the third-party payment system callback interface fails to call, or the payment result is payment failure, the merchant system needs to actively query the order status.
[0003] At present, the merchant system actively queries the order status by regularly querying at preset time intervals. However, if the preset time interval is set to a small value, and the user has not completed the payment for a long time (for example, within a week), multiple queries are invalid queries, thereby wasting system resources. If the preset time is set to a large value in order to save system resources, after the user completes the payment, it may take a long time (for example, 10 minutes) to perceive the payment success, thereby affecting the user's experience of the merchant system. Therefore, it is often impossible to both reasonably utilize the system resources of the merchant system and ensure the user's experience of the merchant system. Summary of the invention
[0004] The embodiments of the present application provide a method, apparatus, device, computer-readable storage medium, and computer program product for querying order status, which can both reasonably utilize system resources of a merchant system and ensure the user's experience of using the merchant system.
[0005] In a first aspect, an embodiment of the present application provides a method for querying order status, which is applied to a merchant system, and the method includes:
[0006] When the order is created and the payment for the order is not successful within the first preset time period, the order status of the order is determined as a target status, where the target status is any order status except successful payment;
[0007] Obtaining a target query time for the order status, the target query time being the next query time for querying the order status after determining the order status once, wherein querying the order status includes a first query phase and a second query phase, the first query phase is within a second preset time period after the order is created, the second query phase is later than the first query phase, the target query time corresponding to the first query phase is less than a first preset threshold, the target query time corresponding to the second query phase is greater than a second preset threshold, and the target query time corresponding to the second query phase increases exponentially, and the second preset threshold is greater than the first preset threshold;
[0008] When the current time of the merchant system reaches the target query time, query the order status;
[0009] When the order status is the target status, the target query time for obtaining the order status is returned to execute until the order status is payment success, or the query condition of the order status satisfies a preset stop condition.
[0010] In a possible implementation, when the order status is the target status, returning the target query time for executing the acquisition of the order status includes:
[0011] When the order status is the target status, update the query times of the order status;
[0012] The target query time for obtaining the order status includes:
[0013] Get the number of inquiries for the order status;
[0014] When the query number is less than or equal to the preset query number, obtaining the target query time corresponding to the first query stage;
[0015] When the query number is greater than the preset query number, the target query time corresponding to the second query stage is obtained.
[0016] In a possible implementation manner, the acquiring the target query time corresponding to the first query stage includes:
[0017] Obtaining a preset query interval, where the preset query interval is a preset incrementing time interval for the merchant system to query the order status in the first query phase;
[0018] The product of the preset query interval and the query number is determined as the target query time.
[0019] In a possible implementation manner, the acquiring the target query time corresponding to the second query stage includes:
[0020] Get the index query base and index query multiple;
[0021] Taking the index query cardinality as a coefficient, taking the index query multiple as a base, and taking the difference between the query number and the preset query number as an index to construct a time query model;
[0022] The target query time corresponding to the second query stage is determined by the time query model.
[0023] In a possible implementation, the time query model is as follows:
[0024] NQT = EBV × EMVQN - IQN;
[0025] Among them, NQT is the target query time, EBV is the index query base, EMV is the index query multiple, QN is the number of queries, and IQN is the preset number of queries.
[0026] In a possible implementation manner, after determining the order status of the order as the target status, the method further includes:
[0027] A scheduled task corresponding to the order is created, and the scheduled task is used to regularly determine whether the current time of the merchant system reaches the target query time.
[0028] In a second aspect, an embodiment of the present application provides an order status query device, which is applied to a merchant system, and the device includes:
[0029] A determination module, configured to determine the order status of the order as a target status when the order creation is completed and the order is not successfully paid within a first preset time period, wherein the target status is any order status except successful payment;
[0030] an acquisition module, for acquiring a target query time for the order status, wherein the target query time is the next query time for querying the order status after the order status is determined once, wherein querying the order status includes a first query phase and a second query phase, the first query phase is within a second preset time period after the order is created, the second query phase is later than the first query phase, the target query time corresponding to the first query phase is less than a first preset threshold, the target query time corresponding to the second query phase is greater than a second preset threshold, and the target query time corresponding to the second query phase increases exponentially, and the second preset threshold is greater than the first preset threshold;
[0031] A query module, configured to query the order status when the current time of the merchant system reaches the target query time;
[0032] The execution module is used to return to execute the target query time for obtaining the order status when the order status is the target status, until the order status is payment successful, or the query condition of the order status meets the preset stop condition.
[0033] In a third aspect, an embodiment of the present application provides an electronic device, the device comprising: a processor and a memory storing computer program instructions;
[0034] When the processor executes the computer program instructions, the processor implements any possible implementation method of the first aspect described above.
[0035] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, implements a method in any possible implementation method of the first aspect described above.
[0036] In a fifth aspect, an embodiment of the present application provides a computer program product. When instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes a method as any possible implementation method in the first aspect above.
[0037] In the embodiment of the present application, the query order status is divided into two stages: the first query stage and the second query stage. Among them, the first query stage is within the second preset time after the order is created, and the second query stage is later than the first query stage. That is, the first query stage can be the query stage corresponding to the initial stage of order creation, and the second query stage can be the query stage corresponding to the later stage of order creation. Since after the order is created, if the user wants to pay, there is a very high probability that the payment will be made in the initial stage of order creation. Therefore, by setting the target query time corresponding to the first query stage to be less than the first preset threshold, that is, querying the order status at a shorter time interval in the initial stage of order creation, it is possible to timely feedback to the user when the user successfully pays in the initial stage of order creation, and ensure the user's experience of using the merchant system. In the later stage of order creation, the possibility of user payment will be much reduced. Therefore, by setting the target query time corresponding to the second query stage to be greater than the second preset threshold, and the target query time corresponding to the second query stage increases exponentially, the second preset threshold is greater than the first preset threshold, that is, querying the order status at a larger time interval in the later stage of order creation, and gradually increasing the time interval for querying the order status in an exponentially increasing manner, regardless of whether the user successfully pays in the later stage of order creation, the number of queries can be reduced to avoid wasting system resources. In addition, if the user successfully pays after the order is created, feedback can also be given to the user. In this way, through the embodiment of the present application, the system resources of the merchant system can be reasonably utilized, and the user's experience of using the merchant system can be guaranteed. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0039] Figure 1 It is a flowchart of a method for querying order status provided in an embodiment of the present application;
[0040] Figure 2 It is a schematic diagram of a process for obtaining a target query time provided by an embodiment of the present application;
[0041] Figure 3 It is a schematic diagram of a flow chart of obtaining a target query time corresponding to a first query stage provided by an embodiment of the present application;
[0042] Figure 4 It is a schematic diagram of a flow chart of obtaining a target query time corresponding to the second query stage provided by an embodiment of the present application;
[0043] Figure 5 It is a flowchart of another order status query method provided in an embodiment of the present application;
[0044] Figure 6 It is a structural diagram of an order status query device provided in an embodiment of the present application;
[0045] Figure 7 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0046] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.
[0047] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0048] In addition, the acquisition, storage, use, and processing of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.
[0049] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.
[0050] As described in the background technology section, the merchant system actively queries the order status by periodically querying at preset time intervals. However, if the preset time interval is set to a smaller value in order to ensure the user's experience of the merchant system, system resources will be wasted. For example, if the order status is queried every two minutes, and the number of allowed failures is set to a larger value, such as 5,000 times, it can be guaranteed that the user completes the payment at any time within a week (10,080 minutes), and can receive feedback from the merchant system on the order in a relatively short time. However, if the user does not pay within a week, these queries are invalid queries, wasting system resources.
[0051] If the preset time is set to a larger value (e.g. 10 minutes) in order to save system resources, and the maximum number of failures allowed is 10, then after the user completes the payment, it may take 10 minutes to be perceived, and even the user may not be able to perceive the payment made after 100 minutes. Therefore, it is often impossible to both reasonably utilize the system resources of the merchant system and ensure the user experience of the merchant system.
[0052] Therefore, in order to both reasonably utilize the system resources of the merchant system and ensure the user experience of the merchant system, when the merchant system actively queries the order status, it needs to consider how to initiate the query, when to initiate the query, what to do if the query fails, whether to continue the query, and when to stop the query.
[0053] In order to solve the problems of the prior art, the embodiments of the present application provide a method, device, equipment, computer-readable storage medium and computer program product for querying order status. The method for querying order status can be applied to online payment scenarios and offline payment scenarios.
[0054] The following first introduces the order status query method provided in the embodiment of the present application.
[0055] Figure 1 A flow chart of a method for querying an order status provided by an embodiment of the present application is shown. The method for querying the order status can be executed by a server or processor corresponding to a merchant system. The merchant system can be an e-commerce platform or other consumer system involving a payment scenario. The merchant system can be connected to a third-party payment system, and after creating an order for a user, the third-party payment system is called to wait for the user to pay.
[0056] like Figure 1 As shown, the order status query method provided in the embodiment of the present application includes steps S110 to S140.
[0057] S110, when the order is created and the order is not successfully paid within the first preset time period, the order status of the order is determined as a target status, and the target status is any order status except successful payment.
[0058] Here, the first preset time length may be a preset waiting time length for the payment result. The first preset time length may be, for example, 10s, 20s, 30s, etc., which is not limited here. In addition, the order status may include a target status and a successful payment. The target status may be any one of a plurality of statuses such as payment failure, waiting for payment, and no payment result found.
[0059] As an example, after the user enters the merchant system, he can select the goods he wants to buy and place an order. After the user places the order, the merchant system can create an order for the user and pull up the checkout counter to wait for the user to pay. The user may complete the payment through the third-party payment system, or may not pay, or the payment may fail. After the user completes the payment, the third-party payment system can call the payment callback interface of the merchant system to synchronize the payment result. Among them, the call of the callback interface may succeed or fail. The payment result may be a successful payment or a failed payment. If the third-party payment system callback interface fails, or the user fails to pay or abandons payment, the merchant system cannot receive a successful payment message within the first preset time period, then the order status of the order can be determined as the target status, and an active query of the order status is initiated.
[0060] In addition, after each order is created, the merchant system can also set the order creation time, order status, next query time NQT (Next Query Time), query number QN (Query Number), and maximum allowed synchronization time MT (Max Time) (for example, 7 days) for the order. Among them, the query number can be dynamically updated, and the next query time can change dynamically with the query number.
[0061] S120, obtain the target query time (i.e., NQT) of the order status, where the target query time is the next query time for querying the order status after the order status is determined once, wherein the query on the order status includes a first query stage and a second query stage, the first query stage is within a second preset time after the order is created, the second query stage is later than the first query stage, the target query time corresponding to the first query stage is less than a first preset threshold, the target query time corresponding to the second query stage is greater than the second preset threshold, and the target query time corresponding to the second query stage increases exponentially, and the second preset threshold is greater than the first preset threshold.
[0062] Here, if the merchant system fails to successfully pay within the first preset time, if the order status of the order is determined as the target status, a target query time can be obtained. After the user queries the order status each time, if the order status is not updated and the payment is not successful (that is, the payment status is the target status), the target query time can be obtained. In addition, the merchant system can update the query count each time it actively queries the order status.
[0063] In addition, the second preset time can be used to distinguish the query stages. The second preset time can be, for example, 5 minutes. That is, the first query stage can be within 5 minutes after the order is created, and the second query stage can be 5 minutes after the order is created. Since the merchant system can set the maximum allowed synchronization time after each order is created. If the maximum allowed synchronization time is 7 days, the second query stage can be the time period from 5 minutes after the order is created and within 7 days.
[0064] In addition, the first preset threshold and the second preset threshold may be pre-set time thresholds. The first preset threshold may be, for example, 3, 4, 5, etc., and the second preset threshold may be, for example, 15, 20, 25, etc. In the first query phase, the target query time may be any time less than the first preset threshold. For example, in the first query phase, the merchant system may query once every 1 minute, once every 2 minutes, or query in an increasing time manner. If a total of 5 queries are made in the first query phase, the query times of the 5 queries may be 1 minute, 2 minutes, 3 minutes, 4 minutes, and 5 minutes, respectively. That is, for the same order, the target query time obtained by the merchant system each time may be the same or different, which is not limited here. If the target query time obtained by the merchant system each time is different, the value of the target query time may become larger and larger.
[0065] In the second query stage, since the possibility of user payment is getting lower and lower, the target query time can be increased exponentially from the second preset threshold as the starting point to avoid wasting system resources. That is, for the same order, the target query time obtained by the merchant system each time can be different and increase exponentially.
[0066] Based on this, in order to improve the rationality of determining the target query time, in some embodiments, such as Figure 2 As shown, the above S120 may specifically include the following steps:
[0067] S210, obtaining the number of inquiries for order status;
[0068] S220: When the query number is less than or equal to the preset query number, obtain a target query time corresponding to the first query stage;
[0069] S230: When the number of queries is greater than the preset number of queries, obtain a target query time corresponding to the second query stage.
[0070] Here, the preset query number may be a preset query number used to distinguish query stages. The preset query number may be, for example, 5 times. The preset query number may also be referred to as an initial query interval number (Init Query Number, IQN). The preset query number and the second preset duration may have an associated relationship.
[0071] In this way, the query phase is determined by the size relationship between the query number and the preset query number, and the target query time corresponding to the query phase is obtained, so that the rationality of determining the target query time can be improved.
[0072] Specifically, in some embodiments, Figure 3 As shown, the above S220 may specifically include the following steps:
[0073] S310, obtaining a preset query interval, where the preset query interval is a preset incrementing time interval for the merchant system to query the order status in the first query phase;
[0074] S320: Determine the product of the preset query interval and the number of queries as the target query time.
[0075] Here, the preset query interval may also be referred to as an initial query interval (Init Query Interval, IQI). The preset query interval may be 1, for example.
[0076] As an example, if QN<=IQN, the target query time can be determined by the following formula:
[0077] NQT=IQI×QN;
[0078] Among them, NQT can be the target query time, IQI can be the preset query interval, and QN can be the number of queries.
[0079] For example, if INI=1 minute and IQN=5 times, the query times corresponding to the first query stage (ie, the first 5 queries) may be 1 minute, 2 minutes, 3 minutes, 4 minutes and 5 minutes respectively.
[0080] In addition, in some embodiments, Figure 4 As shown, the above S230 may specifically include the following steps:
[0081] S410, obtaining an Exponential Base Value (EBV) and an Exponential Multiple Value (EMV);
[0082] S420, using the index query cardinality as a coefficient, the index query multiple as a base, and the difference between the query number and the preset query number as an index to construct a time query model;
[0083] S430: Determine a target query time corresponding to the second query stage through a time query model.
[0084] Here, the time query model constructed with the index query cardinality as the coefficient, the index query multiple as the base, and the difference between the query number and the preset query number as the exponent can be as follows:
[0085] NQT=EBV×EMV QN-IQN ;
[0086] Among them, NQT can be the target query time, EBV can be the index query base, EMV can be the index query multiple, QN can be the number of queries, and IQN can be the preset number of queries.
[0087] As an example, if QN>IQN, the second query phase can be entered. In the second query phase, the target query time can be determined by the above time query model. With the query times as input, the target query time can be calculated by the time query model.
[0088] For example, if IQN = 5 times, EBV = 5 minutes, and EMV = 3, the time query model can be:
[0089] NQT=5×3 QN-5 .
[0090] Thus, in the second query stage, the query times from 6 to 12 can be 15 minutes, 45 minutes, 135 minutes, 405 minutes, 1215 minutes, 3645 minutes and 10935 minutes respectively. If the query is limited to the order status within 7 days (10080 minutes), each order can be queried 11 times.
[0091] S130, when the current time of the merchant system reaches the target query time, query the order status.
[0092] The merchant system can monitor its current time. If the current time reaches the target query time, the order status can be queried. If the current time does not reach the target query time, the order status of the order can be not queried.
[0093] Based on this, in order to save system resources, in some embodiments, after the above S110, the following steps may also be included:
[0094] Create a scheduled task corresponding to the order. The scheduled task is used to periodically determine whether the current time of the merchant system reaches the target query time.
[0095] Here, when the merchant system determines that it needs to actively query the order status, it can also create a scheduled task corresponding to the order. Among them, the scheduled task can be run at a fixed time interval, such as once every 1 minute. That is, the scheduled task can determine the size relationship between the current system time and the target query time every 1 minute. If the current time reaches the target query time, the order status can be queried. If the current time does not reach the target query time, the order status of the order may not be queried.
[0096] In this way, system resources can be saved by setting up scheduled tasks instead of real-time monitoring.
[0097] S140, when the order status is the target status, return to execute the target query time for obtaining the order status until the order status is payment successful, or the query condition of the order status meets the preset stop condition.
[0098] Here, the query condition of the order status may include the query times of the order status and the creation time of the order. The preset stop condition may include the query times of the order status reaching the maximum allowed query times and the query time of the order status reaching the maximum allowed synchronization time.
[0099] As an example, if the order status shows that the user has not paid successfully, you can return to obtain the target query time for the next query and repeat the above steps until the order status is payment successful, or the number of queries for the order status reaches the maximum allowed number of queries, or the query time for the order status reaches the maximum allowed synchronization time.
[0100] In addition, as described above, when the order status is the target status, the merchant system may also update the query times of the order status.
[0101] Therefore, in order to accurately determine whether the order status needs to be queried, in some embodiments, the above S140 may specifically include:
[0102] The number of queries to update the order status when the order status is the target status.
[0103] In the embodiment of the present application, the query order status is divided into two stages: the first query stage and the second query stage. Among them, the first query stage is within the second preset time after the order is created, and the second query stage is later than the first query stage. That is, the first query stage can be the query stage corresponding to the initial stage of order creation, and the second query stage can be the query stage corresponding to the later stage of order creation. Since after the order is created, if the user wants to pay, there is a very high probability that the payment will be made in the initial stage of order creation. Therefore, by setting the target query time corresponding to the first query stage to be less than the first preset threshold, that is, querying the order status at a shorter time interval in the initial stage of order creation, it is possible to timely feedback to the user when the user successfully pays in the initial stage of order creation, and ensure the user's experience of using the merchant system. In the later stage of order creation, the possibility of user payment will be much reduced. Therefore, by setting the target query time corresponding to the second query stage to be greater than the second preset threshold, and the target query time corresponding to the second query stage increases exponentially, the second preset threshold is greater than the first preset threshold, that is, querying the order status at a larger time interval in the later stage of order creation, and gradually increasing the time interval for querying the order status in an exponentially increasing manner, regardless of whether the user successfully pays in the later stage of order creation, the number of queries can be reduced to avoid wasting system resources. In addition, if the user successfully pays after the order is created, feedback can also be given to the user. In this way, through the embodiment of the present application, the system resources of the merchant system can be reasonably utilized, and the user's experience of using the merchant system can be guaranteed.
[0104] In order to better describe the entire solution, some specific examples are given based on the above embodiments.
[0105] When a merchant system includes multiple uncompleted orders, the merchant system can actively query the order statuses corresponding to the multiple orders.
[0106] As an example, the merchant system can monitor multiple orders in sequence through a scheduled task. The target query time corresponding to multiple orders can be the same or different, which is not limited here. If it is determined through a scheduled task that the current system time reaches the target query time of a certain order, the order status of the order can be queried. On the contrary, if it is determined through a scheduled task that the current system time does not reach the target query time of the order, the order can be skipped to determine whether the current system time reaches the target query time of the next order.
[0107] In addition, when querying the order status of a certain order, if the order status is payment successful, the order can be removed from the active query sequence and no longer monitored. On the contrary, if the order status is the target status, the order can continue to be monitored in the next polling.
[0108] In addition, for each order, if the current time - order creation time >= the maximum allowed synchronization time, the order can be removed from the active query sequence and will no longer be monitored.
[0109] Based on this, in the case where a merchant system includes multiple uncompleted orders, a method for querying order status provided by an embodiment of the present application can be as follows: Figure 5 shown.
[0110] According to the order query time interval involved in this solution, the status of the order will be queried at a shorter time interval for a period of time after the order is first created, because if the user wants to make a payment, there is a very high probability that the payment will be completed during this period. If this period of time has passed, the possibility of the user paying will be greatly reduced. At this time, we gradually increase the query interval to ensure that even if the user pays after a long period of time (such as 7 days), we can update the user's status. At the same time, the number of queries is not large, which reduces system resource consumption. In this way, this solution uses a dynamic interval time to query the order status, and the time interval queries the order status according to an exponential growth mechanism, which can not only ensure a good user experience, but also ensure that system resources are not wasted.
[0111] Based on the order status query method provided in the above embodiment, the present application also provides a specific implementation of the order status query device. Please refer to the following embodiment.
[0112] like Figure 6 As shown, the order status query device 600 provided in the embodiment of the present application includes the following modules:
[0113] A determination module 610, configured to determine the order status of the order as a target status when the order is created and the order is not successfully paid within a first preset time period, wherein the target status is any order status except successful payment;
[0114] An acquisition module 620 is used to acquire a target query time for an order status, where the target query time is the next query time for querying the order status after the order status is determined once, wherein querying the order status includes a first query phase and a second query phase, the first query phase is within a second preset time after the order is created, the second query phase is later than the first query phase, the target query time corresponding to the first query phase is less than a first preset threshold, the target query time corresponding to the second query phase is greater than a second preset threshold, and the target query time corresponding to the second query phase increases exponentially, and the second preset threshold is greater than the first preset threshold;
[0115] Query module 630, used to query the order status when the current time of the merchant system reaches the target query time;
[0116] The execution module 640 is used to return to execute the target query time for obtaining the order status when the order status is the target status, until the order status is payment successful, or the query condition of the order status meets the preset stop condition.
[0117] The order status query device 600 is described in detail below, as shown below:
[0118] In some embodiments, the execution module 640 may specifically include:
[0119] The update submodule is used to update the query times of the order status when the order status is the target status.
[0120] Based on this, the acquisition module 620 may specifically include:
[0121] The first acquisition submodule is used to obtain the number of inquiries for querying order status;
[0122] A second acquisition submodule, used to acquire a target query time corresponding to the first query stage when the query number is less than or equal to the preset query number;
[0123] The third acquisition submodule is used to acquire the target query time corresponding to the second query stage when the query number is greater than the preset query number.
[0124] In some embodiments, the second acquisition submodule may specifically include:
[0125] A first acquisition unit, used to acquire a preset query interval, where the preset query interval is a preset incrementing time interval for the merchant system to query the order status in the first query phase;
[0126] The first determining unit is used to determine the product of a preset query interval and the number of queries as a target query time.
[0127] In some embodiments, the second acquisition submodule may specifically include:
[0128] A second acquisition unit, used to acquire an index query cardinality and an index query multiple;
[0129] A construction unit, used to construct a time query model with the index query cardinality as a coefficient, the index query multiple as a base, and the difference between the query number and the preset query number as an exponent;
[0130] The second determining unit is used to determine the target query time corresponding to the second query stage through the time query model.
[0131] In some embodiments, the temporal query model is as follows:
[0132] NQT=EBV×EMV QN-IQN ;
[0133] Among them, NQT is the target query time, EBV is the index query base, EMV is the index query multiple, QN is the number of queries, and IQN is the preset number of queries.
[0134] In some embodiments, the order status query device 600 may further include:
[0135] The creation module is used to create a timed task corresponding to the order after the order status of the order is determined to be the target status. The timed task is used to regularly determine whether the current time of the merchant system reaches the target query time.
[0136] In the embodiment of the present application, the query order status is divided into two stages: the first query stage and the second query stage. Among them, the first query stage is within the second preset time after the order is created, and the second query stage is later than the first query stage. That is, the first query stage can be the query stage corresponding to the initial stage of order creation, and the second query stage can be the query stage corresponding to the later stage of order creation. Since after the order is created, if the user wants to pay, there is a very high probability that the payment will be made in the initial stage of order creation. Therefore, by setting the target query time corresponding to the first query stage to be less than the first preset threshold, that is, querying the order status at a shorter time interval in the initial stage of order creation, it is possible to timely feedback to the user when the user successfully pays in the initial stage of order creation, and ensure the user's experience of using the merchant system. In the later stage of order creation, the possibility of user payment will be much reduced. Therefore, by setting the target query time corresponding to the second query stage to be greater than the second preset threshold, and the target query time corresponding to the second query stage increases exponentially, the second preset threshold is greater than the first preset threshold, that is, querying the order status at a larger time interval in the later stage of order creation, and gradually increasing the time interval for querying the order status in an exponentially increasing manner, regardless of whether the user successfully pays in the later stage of order creation, the number of queries can be reduced to avoid wasting system resources. In addition, if the user successfully pays after the order is created, feedback can also be given to the user. In this way, through the embodiment of the present application, the system resources of the merchant system can be reasonably utilized, and the user's experience of using the merchant system can be guaranteed.
[0137] Based on the order status query method provided in the above embodiment, the embodiment of the present application also provides a specific implementation of the electronic device. Figure 7 A schematic diagram of an electronic device 700 provided in an embodiment of the present application is shown.
[0138] The electronic device 700 may include a processor 710 and a memory 720 storing computer program instructions.
[0139] Specifically, the processor 710 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0140] The memory 720 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 720 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. Where appropriate, the memory 720 may include a removable or non-removable (or fixed) medium. Where appropriate, the memory 720 may be inside or outside the electronic device 700. In a particular embodiment, the memory 720 is a non-volatile solid-state memory.
[0141] The memory may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Thus, typically, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to the first aspect of the present application.
[0142] The processor 710 implements any one of the order status query methods in the above embodiments by reading and executing computer program instructions stored in the memory 720.
[0143] In one example, the electronic device 700 may further include a communication interface 730 and a bus 740. Figure 7 As shown, the processor 710, the memory 720, and the communication interface 730 are connected via a bus 740 and communicate with each other.
[0144] The communication interface 730 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0145] Bus 740 includes hardware, software or both, and the parts of electronic equipment are coupled to each other.For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 740 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the application considers any suitable bus or interconnection.
[0146] Exemplarily, the electronic device 700 may be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA).
[0147] The electronic device can execute the order status query method in the embodiment of the present application, thereby realizing the combination Figures 1 to 6 The invention discloses a method and device for querying order status.
[0148] In addition, in combination with the order status query method in the above embodiment, the embodiment of the present application can provide a computer-readable storage medium for implementation. The computer-readable storage medium stores computer program instructions; when the computer program instructions are executed by the processor, any one of the order status query methods in the above embodiment is implemented.
[0149] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.
[0150] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application-specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0151] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.
[0152] The above reference is according to the method of the embodiment of the present application, the flow chart of the device (system) and the computer program product and / or the block diagram described various aspects of the present application.It should be understood that each square box in the flow chart and / or the block diagram and the combination of each square box in the flow chart and / or the block diagram can be realized by computer program instructions.These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the realization of the function / action specified in one or more square boxes of the flow chart and / or the block diagram.Such a processor can be but is not limited to a general-purpose processor, a special-purpose processor, a special application processor or a field programmable logic circuit.It can also be understood that each square box in the block diagram and / or the flow chart and the combination of the square boxes in the block diagram and / or the flow chart can also be realized by the dedicated hardware that performs the specified function or action, or can be realized by the combination of dedicated hardware and computer instructions.
[0153] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.
Claims
1. A method for querying order status, characterized in that: Applied to a merchant system, the method comprises: When the order is created and the payment for the order is not successful within the first preset time period, the order status of the order is determined as a target status, where the target status is any order status except successful payment; Obtaining a target query time for the order status, the target query time being the next query time for querying the order status after determining the order status once, wherein querying the order status includes a first query phase and a second query phase, the first query phase is within a second preset time period after the order is created, the second query phase is later than the first query phase, the target query time corresponding to the first query phase is less than a first preset threshold, the target query time corresponding to the second query phase is greater than a second preset threshold, and the target query time corresponding to the second query phase increases exponentially, and the second preset threshold is greater than the first preset threshold; When the current time of the merchant system reaches the target query time, query the order status; When the order status is the target status, the target query time for obtaining the order status is returned to execute until the order status is payment success, or the query condition of the order status satisfies a preset stop condition.
2. The method according to claim 1, characterized in that When the order status is the target status, returning the target query time for executing the acquisition of the order status includes: When the order status is the target status, update the query times of the order status; The target query time for obtaining the order status includes: Get the number of inquiries for the order status; When the query number is less than or equal to the preset query number, obtaining the target query time corresponding to the first query stage; When the query number is greater than the preset query number, the target query time corresponding to the second query stage is obtained.
3. The method according to claim 2, characterized in that The acquiring the target query time corresponding to the first query stage includes: Obtaining a preset query interval, where the preset query interval is a preset incrementing time interval for the merchant system to query the order status in the first query phase; The product of the preset query interval and the query number is determined as the target query time.
4. The method according to claim 2, characterized in that: The acquiring the target query time corresponding to the second query stage includes: Get the index query base and index query multiple; Taking the index query cardinality as a coefficient, taking the index query multiple as a base, and taking the difference between the query number and the preset query number as an index to construct a time query model; The target query time corresponding to the second query stage is determined by the time query model.
5. The method according to claim 4, characterized in that The time query model is as follows: NQT=EBV×EMV QN-IQN ; Among them, NQT is the target query time, EBV is the index query base, EMV is the index query multiple, QN is the number of queries, and IQN is the preset number of queries.
6. The method according to any one of claims 1 to 5, characterized in that: After determining the order status of the order as the target status, the method further includes: A scheduled task corresponding to the order is created, and the scheduled task is used to regularly determine whether the current time of the merchant system reaches the target query time.
7. A device for querying order status, characterized in that: Applied to a merchant system, the device comprises: A determination module, configured to determine the order status of the order as a target status when the order creation is completed and the order is not successfully paid within a first preset time period, wherein the target status is any order status except successful payment; an acquisition module, for acquiring a target query time for the order status, wherein the target query time is the next query time for querying the order status after the order status is determined once, wherein querying the order status includes a first query phase and a second query phase, the first query phase is within a second preset time period after the order is created, the second query phase is later than the first query phase, the target query time corresponding to the first query phase is less than a first preset threshold, the target query time corresponding to the second query phase is greater than a second preset threshold, and the target query time corresponding to the second query phase increases exponentially, and the second preset threshold is greater than the first preset threshold; A query module, configured to query the order status when the current time of the merchant system reaches the target query time; The execution module is used to return to execute the target query time for obtaining the order status when the order status is the target status, until the order status is payment successful, or the query condition of the order status meets the preset stop condition.
8. An electronic device, characterized in that: The electronic device comprises: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the order status query method according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the method for querying the order status according to any one of claims 1 to 6 is implemented.
10. A computer program product, characterized in that When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the order status query method as described in any one of claims 1-6.
Citation Information
Patent Citations
Asynchronous query method and device, computer equipment and storage medium
CN110489444A
Order state query method and device and storage medium
CN113222701A
Method and device for confirming state of order to be paid based on time window
CN114418702A
Payment state acquisition method and device, computer equipment and storage medium
CN115330396A
Equipment management method and device based on short polling
CN116055568A
Cited By
Scheduling method, device and equipment for checking order payment results in batches and storage medium
CN121526255A
