Virtual resource compensation method, device, equipment and computer storage medium
Patent Information
- Application Number
- CN202310011909.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-05
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2043-01-05
AI Technical Summary
[0004]鉴于上述问题,本发明实施例提供了一种虚拟资源补偿方法、装置、设备以及计算机存储介质,用于解决现有技术中存在的成功支付消息未能够实时更新或丢失时,无法及时实现虚拟资源补偿,导致用户的虚拟资源使用体验不佳的问题
[0039]本发明实施例通过当检测到对虚拟资源的订单支付请求时,根据下单用户的历史虚拟资源使用行为、订单处理系统的系统访问量和订单支付方式的历史支付响应时长确定所述下单用户的临时虚拟资源使用时长;所述订单支付请求中包括所述下单用户的信息、订单处理系统的信息以及所述订单支付方式;根据所述临时资源使用时长对所述下单用户进行虚拟资源的使用权限的下发,从而能够在用户的订单支付结果未能够实时更新或丢失时,根据用户的历史虚拟使用历史虚拟资源使用行为、订单处理系统的系统访问量和订单支付方式的历史支付响应时长合理地确定在确认时延期间为用户补偿的临时资源使用时长,解决了用户下单付款后不能及时使用其所购买的虚拟资源的痛点,能够解决现有技术中在支付确认消息未能及时同步时,无法及时实现用户的虚拟资源补偿,导致用户的虚拟资源使用体验不佳的问题。
Smart Images

Figure CN116362729B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of Internet technology, specifically to a virtual resource compensation method, apparatus, device, and computer storage medium. Background Technology
[0002] In virtual resource management, actual payment systems often span multiple systems, mostly third-party systems, and the complex network environment can easily lead to the loss of success notification messages. Furthermore, if a significant delay occurs in payment due to issues with the payment module or the third-party system, the system may be unable to confirm the payment result in real time. Consequently, because the system does not receive timely confirmation from the payment platform, it cannot issue the purchased resources to the user. This results in a deterioration in the user's experience as their purchased resource usage rights cannot be promptly realized after payment.
[0003] Existing virtual resource management solutions typically only address scenarios involving successful payments. For example, when a user purchases a reading membership, the system checks the user's virtual resources after a preset timeframe following payment confirmation. If the virtual resources haven't arrived, it promptly reissues them as compensation. However, existing technologies cannot provide timely virtual resource compensation when successful payment messages are not updated in real time or are lost, resulting in a poor user experience. Summary of the Invention
[0004] In view of the above problems, embodiments of the present invention provide a virtual resource compensation method, apparatus, device, and computer storage medium to solve the problem in the prior art that when successful payment messages are not updated in real time or are lost, virtual resource compensation cannot be realized in a timely manner, resulting in a poor user experience of virtual resources.
[0005] According to one aspect of the present invention, a virtual resource compensation method is provided, the method comprising:
[0006] When a payment request for virtual resources is detected, the temporary virtual resource usage duration of the ordering user is determined based on the ordering user's historical virtual resource usage behavior, the system access volume of the order processing system, and the historical payment response time of the order payment method; the order payment request includes the ordering user's information, the order processing system's information, and the order payment method;
[0007] The user who placed the order is granted access to virtual resources based on the duration of the temporary resource usage.
[0008] In an alternative approach, the method further includes:
[0009] The frequency of the ordering user's use of non-temporary virtual resources within the historical time interval is determined based on the historical virtual resource usage behavior.
[0010] The current number of users accessing the order processing system and the historical success rate of virtual resource distribution are determined based on the system access volume.
[0011] The payment response time threshold corresponding to the order payment method is determined based on the historical payment duration.
[0012] The duration of use of the temporary resource is determined based on the usage frequency, current access volume, virtual resource issuance success rate, and payment response time threshold.
[0013] In an alternative approach, the method further includes:
[0014] The splitting granularity is determined based on the current access volume and the virtual resource delivery success rate.
[0015] The payment response time threshold is divided into multiple selectable response time intervals based on the granularity of the division.
[0016] The duration of use of the temporary resource is determined based on the optional response duration range and the usage frequency.
[0017] In an alternative approach, the method further includes:
[0018] Obtain the historical virtual resource usage frequency of all users in the order processing system;
[0019] Based on the granularity of the splitting, all user historical access frequencies are divided into multiple selectable usage frequency ranges;
[0020] The target usage frequency range is determined from the selectable usage frequency range based on the usage frequency of the user who placed the order.
[0021] The target response duration interval is determined from the optional response duration intervals based on the target usage frequency interval and the degree of matching between each optional response duration interval; the degree of matching is determined based on the relative order of the target usage frequency intervals among all optional usage frequency intervals.
[0022] The duration of temporary resource usage is determined based on the length of the target response duration interval.
[0023] In an alternative approach, the method further includes:
[0024] The temporary virtual resources corresponding to the usage duration of the temporary resources are distributed to the ordering user, and the remaining duration of the temporary virtual resources of the ordering user is detected.
[0025] When it is detected that the remaining duration of the temporary virtual resource is less than the preset remaining duration threshold, the payment result corresponding to the order payment request is obtained;
[0026] The duration of temporary resource usage is updated based on the payment result.
[0027] In an alternative approach, the method further includes:
[0028] When the payment result is determined to be in progress, the duration of temporary resource usage is compared with the threshold of temporary resource usage corresponding to the order payment method;
[0029] When it is determined that the duration of temporary resource usage is less than or equal to the threshold for temporary resource usage, the duration of temporary resource usage is extended.
[0030] In an alternative approach, the method further includes:
[0031] When the payment result is determined to be successful, the temporary virtual resources of the ordering user are replaced with the formal virtual resources requested by the order payment request;
[0032] When the payment result is determined to be a payment failure, the temporary virtual resources are reclaimed.
[0033] According to another aspect of the present invention, a virtual resource compensation device is provided, comprising:
[0034] The determination module is used to determine the temporary virtual resource usage duration of the ordering user when an order payment request for virtual resources is detected, based on the ordering user's historical virtual resource usage behavior, the system access volume of the order processing system, and the historical payment response time of the order payment method; the order payment request includes the ordering user's information, the order processing system's information, and the order payment method;
[0035] The distribution module is used to distribute virtual resource usage permissions to the ordering user based on the temporary resource usage duration.
[0036] According to another aspect of the present invention, a virtual resource compensation device is provided, comprising: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other through the communication bus;
[0037] The memory is used to store at least one executable instruction that causes the processor to perform the operation of the virtual resource compensation method as described in any of the foregoing embodiments.
[0038] According to another aspect of the present invention, a computer-readable storage medium is provided, the storage medium storing at least one executable instruction that causes a virtual resource compensation device to perform the operation of the virtual resource compensation method described in any of the foregoing embodiments.
[0039] This invention addresses the pain point of users not being able to use their purchased virtual resources promptly after placing an order payment request. It determines the temporary virtual resource usage duration for the ordering user based on their historical virtual resource usage behavior, the system traffic of the order processing system, and the historical payment response time of the order payment method when such a request is detected. The order payment request includes information about the ordering user, the order processing system, and the order payment method. The invention then issues the temporary virtual resource usage permission to the ordering user based on the temporary usage duration. This solves the problem of users not being able to use their purchased virtual resources promptly after placing an order and making payment, and addresses the issue of poor user experience caused by the inability to promptly compensate users for virtual resources when payment confirmation messages are not synchronized in a timely manner.
[0040] The above description is merely an overview of the technical solutions of the embodiments of the present invention. In order to better understand the technical means of the embodiments of the present invention and to implement them in accordance with the contents of the specification, and to make the above and other objects, features and advantages of the embodiments of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description
[0041] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:
[0042] Figure 1 A flowchart illustrating the virtual resource compensation method provided in an embodiment of the present invention is shown;
[0043] Figure 2 A flowchart illustrating a virtual resource compensation method according to another embodiment of the present invention is shown.
[0044] Figure 3 A schematic diagram illustrating the frequency of use in a virtual resource compensation method provided in another embodiment of the present invention is shown;
[0045] Figure 4 This diagram illustrates the historical payment response time of a virtual resource compensation method provided in another embodiment of the present invention.
[0046] Figure 5 A schematic diagram of the structure of the virtual resource compensation device provided in an embodiment of the present invention is shown;
[0047] Figure 6 A schematic diagram of the structure of the virtual resource compensation device provided in an embodiment of the present invention is shown. Detailed Implementation
[0048] Exemplary embodiments of the invention will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be implemented in various forms and should not be limited to the embodiments set forth herein.
[0049] Before describing the embodiments of the present invention, the prior art and its problems will be further explained:
[0050] Virtual resource compensation refers to a compensation method that can quickly identify delivery problems and improve user experience. Specifically, it addresses situations where a user purchases a product but the product is not delivered on time due to system issues, thereby improving the user experience and preventing user complaints.
[0051] Existing compensation schemes generally only address scenarios with successful payments, such as when a user purchases a reading membership. After successful payment, the Kafka producer puts the order and payment information into the Kafka queue, and the Kafka client consumes the data after a delay, such as checking the user's virtual resources after 5 minutes. If the user's virtual resources have not been credited, the virtual resources are promptly reissued, and an anomaly alarm is reported for manual compensation.
[0052] Existing technical solutions only address situations where a successful payment notification is received, but the virtual resources haven't arrived in time. However, actual payment systems often cross systems, frequently involving third-party systems, and the complex network environment makes it easier for successful notification messages to be lost. Secondly, if there's a significant delay in payment due to issues with the payment module or third-party systems, the arrival time of virtual resources will also increase. Users who have completed payment may find their virtual resources delayed, leading to a poor user experience and, in severe cases, user complaints. Therefore, existing virtual resource compensation methods are susceptible to technical issues in order processing systems and payment platforms, such as network failures, system overload, or abnormal API calls, which can prevent timely updates to payment success results. Consequently, the system cannot promptly verify payment results and grant users access to the corresponding paid virtual resources, resulting in users being unable to use their paid resources in a timely manner, thus impacting user experience.
[0053] Figure 1A flowchart of a virtual resource compensation method provided in an embodiment of the present invention is shown. This method is executed by a computer processing device. The computer processing device may include a mobile phone, a laptop computer, etc. Figure 1 As shown, the method includes the following steps:
[0054] Step 10: When an order payment request for virtual resources is detected, the temporary virtual resource usage duration of the ordering user is determined based on the ordering user's historical virtual resource usage behavior, the system access volume of the order processing system, and the historical payment response time of the order payment method; the order payment request includes the ordering user's information, the order processing system's information, and the order payment method.
[0055] In one embodiment of the present invention, virtual resources may be multimedia resources such as e-books, music, and videos, or vouchers, resource download coupons, and discount coupons. An order payment request is a request from a user to pay for an order after placing it. After successful payment, the user has the right to use the purchased virtual resources for the specific duration and type they purchased.
[0056] Historical virtual resource usage behavior includes the frequency of use of temporary and non-temporary virtual resources by users within a preset historical time interval. Temporary virtual resources may be compensation provided to users as a result of system-side delays in the issuance of paid permissions due to system-side reasons. Non-temporary virtual resources are those that users can use after paying. The order processing system, for example, is the reading platform when the order payment request is for purchasing an e-book membership. Historical payment response time refers to the payment response time of the payment platform within a preset historical time interval.
[0057] To ensure that the duration of temporary resource usage can compensate for user experience while guaranteeing the system's virtual resources, a suitable duration of temporary resource usage can be determined by comprehensively considering two factors: the historical resource usage of the ordering user, and the historical response speed and payment result confirmation latency of the system and payment platform.
[0058] Specifically, we can first count the frequency of users using virtual resources other than temporary virtual resources in the recent period, and calculate the user behavior value by weighting by the number of days. Then, we can record the payment response time of each payment method in the past month and the default maximum response time threshold of each payment method. Subsequently, we can collect and record the current access traffic TPS value of the current order placed in the system and the success rate of the payment result query initiated by each payment method when the temporary virtual resource expires. Finally, we can dynamically calculate the duration of the temporary virtual resource based on the information obtained.
[0059] Therefore, in another embodiment of the present invention, step 10 further includes step 101:
[0060] Step 1011: Determine the frequency of the ordering user's use of non-temporary virtual resources within the historical time interval based on the historical virtual resource usage behavior.
[0061] Specifically, non-temporary virtual resources can include virtual resources such as viewing vouchers and resource downloads that require users to successfully pay for them before they can use them. Usage frequency can be obtained by statistically analyzing the historical time of a user's use of non-temporary virtual resources.
[0062] Optionally, considering that user behavior may evolve over time, the frequency of use can be weighted according to the time of historical behavior. The closer the behavior is to the present, the greater its weight and the greater its impact on the calculation of the user's temporary resource usage time.
[0063] Step 1012: Determine the current number of users accessing the order processing system and the historical success rate of virtual resource distribution based on the system access volume.
[0064] Specifically, the TPS value of the current orders is collected and recorded from the system's access volume as the current number of users accessing the system. It should be noted that the historical virtual resource distribution success rate refers to the success rate of the system's invocation of payment result queries to the platforms corresponding to each payment method when the temporary virtual resources compensated to users expire within a historical time period.
[0065] Step 1013: Determine the payment response time threshold corresponding to the order payment method based on the historical payment duration.
[0066] Specifically, the payment response time threshold is determined based on the distribution of historical payment durations. In particular, the maximum value among historical payment durations can be determined as the payment response time threshold.
[0067] Step 1014: Determine the usage duration of the temporary resource based on the usage frequency, current access volume, virtual resource issuance success rate, and payment response time threshold.
[0068] In one embodiment of the present invention, the distribution of payment confirmation delay times for all historical users is determined based on the current access volume and the success rate of virtual resource delivery. Specifically, this means determining what percentage of users' payments are confirmed within what delay period (e.g., 20% of payments are completed within 150 seconds, while 100% are completed within 3600 seconds). Based on this distribution, the payment response time threshold is divided into multiple response time intervals, each corresponding to a latency severity level. The latency severity level matched to a user is then determined based on their usage frequency. The duration of temporary resource usage is determined based on the length of the response time interval corresponding to that latency severity level. Specifically, the importance of a user is determined based on their usage frequency; the higher the importance, the lower the latency severity, thus matching usage frequency with response time intervals.
[0069] Therefore, in another embodiment of the present invention, step 1014 further includes:
[0070] Step 1015: Determine the splitting granularity based on the current access volume and the virtual resource distribution success rate.
[0071] Specifically, the granularity of user and payment duration splitting is set based on the current access traffic. A higher TPS and more failed queries require less granularity, while a lower TPS and more successful queries require more granularity. For example, if the current order volume is large, triggering many payment result queries and nearing system limits, the granularity should be 1. Conversely, if the current order volume is small and network conditions are good, resulting in few payment result queries, the maximum granularity of 10 can be set.
[0072] Step 1016: Divide the payment response time threshold into multiple selectable response time intervals according to the division granularity.
[0073] Specifically, based on the granularity obtained in the previous step, the response time is divided into segments according to its duration. For example, if the current granularity is 10, the payment response time is divided into 10 parts. If 10% of payments are completed within 125 seconds, then the temporary virtual resource duration for Level 1 is 125 seconds; if 20% of payments are completed within 150 seconds, then the temporary virtual resource duration for Level 2 is 150 seconds; and so on, until 100% of payments are completed within 3600 seconds. In the extreme case, if the granularity is 1, then the user's virtual resource duration is 3600 seconds.
[0074] Step 1017: Determine the usage duration of the temporary resource based on the optional response duration range and the usage frequency.
[0075] Specifically, the latency severity level matched to a user is determined based on the user's usage frequency, and the duration of temporary resource usage is determined based on the length of the response time interval corresponding to that latency severity level. In other words, the importance of a user is determined based on their usage frequency; the greater the importance, the lower the latency severity level, thus matching usage frequency with the response time interval.
[0076] Therefore, in another embodiment of the present invention, step 1017 further includes:
[0077] Step 1018: Obtain the historical virtual resource usage frequency of all users in the order processing system.
[0078] Obtain the frequency of virtual resource usage for each historical user in the order processing system.
[0079] Step 1019: Divide all the historical access frequencies of all users into multiple selectable usage frequency ranges according to the splitting granularity.
[0080] Based on the granularity of the segmentation obtained in the preceding steps, all users are divided into multiple levels according to their access frequency. For example, if the current granularity is 10, all users are divided into 10 levels based on the usage frequency of each user in the preceding steps, meaning that one optional usage frequency range corresponds to one user level. If the current granularity is 1, then there will be only one user level, and all users will have the same level.
[0081] Step 1020: Determine the target usage frequency range from the selectable usage frequency range based on the usage frequency of the user who placed the order.
[0082] The target usage frequency range is determined by the range of available usage frequencies in which the user who placed the order falls. This allows for the classification of users based on usage frequency, and the allocation of corresponding temporary resource usage time based on the user level.
[0083] Step 1021: Determine the target response duration interval from the optional response duration intervals based on the matching degree of the target usage frequency interval and each of the optional response duration intervals; the matching degree is determined based on the relative order of the target usage frequency intervals among all the optional usage frequency intervals.
[0084] Specifically, the higher the frequency of a user's use, the lower the matching payment response time level; conversely, the lower the frequency of a user's use, the higher the matching payment response time level.
[0085] Step 1022: Determine the duration of temporary resource usage based on the length of the target response duration interval.
[0086] The length of the target response time interval is determined as the duration of temporary resource usage. For example, if the target response time interval is 80-120s, then the duration of temporary resource usage is 120s.
[0087] This invention provides a method for calculating and distributing temporary virtual resources based on user data and payment system response time. This allows users to briefly enjoy virtual resources after placing an order, meaning users are unaware of payment time. This achieves seamless integration of purchasing and using virtual resources, thereby improving the user experience. Furthermore, since the duration of virtual resources is calculated in real time, dynamic optimization and control of the duration of temporary virtual resources are achieved, avoiding the issuance of invalid virtual resources and the loss of virtual resource assets.
[0088] Step 20: Grant virtual resource usage permissions to the ordering user based on the temporary resource usage duration.
[0089] In one embodiment of the present invention, the right to use temporary resources with a usage duration equal to the duration of temporary resource usage is granted to the user who placed the order, so that the user can use the temporary resources while the system confirms the payment result of the order. This ensures that the user's resource usage experience is not affected by the delay or error of the payment result confirmation, and allows the user to enjoy some virtual resources briefly after placing an order, thus solving the problem of decreased user experience due to waiting.
[0090] Furthermore, considering that temporary resources are merely a temporary substitute for the formal resources ordered by the user to ensure that the user experience is not affected by delays or loss of payment success messages during the payment confirmation process, the usage rights of temporary resources can be promptly replaced with formal permissions based on the remaining duration of the temporary resource usage and the order payment result. Specifically, when updating temporary resources to formal resources, the usage rights of temporary resources can be revoked or converted to formal virtual resources based on whether a payment success confirmation message has been received. Alternatively, if no payment success confirmation message has been received, the usage time of temporary resources can be extended based on whether the remaining duration of the temporary resource is less than a preset threshold and whether the cumulative temporary resource usage time of the user's current pending order exceeds the temporary resource usage time threshold corresponding to the order's payment method.
[0091] Specifically, step 20 also includes:
[0092] Step 201: Distribute the temporary virtual resources corresponding to the temporary resource usage duration to the ordering user, and detect the remaining duration of the temporary virtual resources for the ordering user.
[0093] In one embodiment of the present invention, while waiting for the system and payment platform to confirm the order payment result, the user who placed the order can enjoy temporary virtual resources with a duration equal to the usage time of temporary resources. This solves the problem of decreased user experience caused by system confirmation delays. Furthermore, after the temporary virtual resources are distributed to the user, the remaining duration of the distributed temporary virtual resources is monitored in real time to update the duration of the temporary resources or convert them into permanent resources in a timely manner, ensuring the user experience and preventing the abuse of the system's virtual resources.
[0094] Step 202: When it is detected that the remaining duration of the temporary virtual resource is less than the preset remaining duration threshold, obtain the payment result corresponding to the order payment request.
[0095] Specifically, when it is detected that the remaining time of a user's temporary resource usage permission is lower than the remaining time threshold, the payment result confirmation request is added to the Kafka queue according to the order payment method corresponding to the order payment request. This allows the Kafka queue to call the payment result query interface of the payment system corresponding to the order payment method to query the order payment status after receiving the request, and to determine the payment result based on the result returned by the Kafka queue.
[0096] Step 203: Update the usage duration of the temporary resources based on the payment result.
[0097] In one embodiment of the present invention, when the payment result is successful, the resource usage permission type of the user who placed the order is converted to the formal resource type that was ordered and successfully paid for.
[0098] When a payment fails or a payment success message is not received, the cause of failure is determined to be either subjective factors on the user's side or technical reasons on the system and payment platform side. If the payment failure is caused by subjective factors on the user's side, the user's temporary resource usage rights are revoked. Conversely, if the payment failure or payment success message is not received due to technical failures on the system and payment platform side, the temporary usage time is adaptively extended based on the remaining time and the average response time of the payment platform for the current order, so as to ensure the user experience while ensuring that the system's virtual resources are not wasted.
[0099] Therefore, in another embodiment of the present invention, step 203 further includes:
[0100] Step 204: When the payment result is determined to be in progress, the temporary resource usage duration is compared with the temporary resource usage duration threshold corresponding to the order payment method.
[0101] Specifically, a payment result may include situations such as a query API call timeout or a payment confirmation message. The temporary resource usage duration threshold represents the maximum temporary resource usage duration that the order payment method can typically provide. The longer the payment response time of an order payment method, the higher its corresponding temporary resource usage duration threshold.
[0102] Step 205: When it is determined that the usage duration of the temporary resource is less than or equal to the usage duration threshold of the temporary resource, the usage duration of the temporary resource is extended.
[0103] Specifically, the duration of temporary resource usage can be extended by a specific value to ensure that users' temporary resource usage is not affected and that they receive the compensation they deserve for their resource usage rights, provided that there are no subjective reasons on the user's side that cause the payment confirmation delay.
[0104] Optionally, step 203 further includes:
[0105] Step 206: When the payment result is determined to be successful, the temporary virtual resources of the ordering user are replaced with the formal virtual resources requested by the order payment request.
[0106] Once the payment result is confirmed as successful, the official virtual resources paid for by the ordering user will be promptly issued to them, allowing them to enjoy the normal resource experience they require.
[0107] Step 207: When the payment result is determined to be a payment failure, the temporary virtual resources are reclaimed.
[0108] When the payment result is determined to be a payment failure, temporary virtual resources should be promptly reclaimed to protect the system's virtual resources.
[0109] In another embodiment of the present invention, the process of performing virtual resource compensation can also refer to Figure 4 .
[0110] like Figure 4 As shown, step 1: The user places an order to purchase a reading membership through the reading app using a certain payment method.
[0111] Step 2: The order system calls the intelligent analysis system to obtain the duration of temporary virtual resources.
[0112] The aforementioned intelligent analysis system primarily makes decisions based on user behavior, current user access traffic, and response times of various payment methods to determine the optimal duration of temporary virtual resources, as detailed below:
[0113] This counts the frequency with which users utilize virtual resources other than temporary virtual resources (such as viewing vouchers, downloads, etc.) within a recent period. Figure 3 As shown. To ensure the data's correlation with time as much as possible, the following method can be used to obtain it:
[0114] The number of times the above-mentioned function interfaces were accessed on that day can be counted as C. x Here, x represents the number of days since the current day. For example, if the download interface was accessed 15 times on day t-1, then t represents the current day and t-1 represents the previous day. Redis can be used to accumulate the count for each day.
[0115] Each interface of t-10 also has a corresponding number of times C. 10 Let's assume the value is 10.
[0116] Similarly, the t-100 value is 6. The closer to the current time t, the higher the weight of the ttl value, because the user access records closer to the current time are more valuable for reference.
[0117] The TTL weighting factor W is calculated using the following function. x ,
[0118]
[0119] Where x is the number of past days from t, t is the current day, and when x = 1, the weight factor is fixed at 1, that is, W1 = 1.
[0120] For example, the weighting factor of t-10
[0121] t-100 weighting factor
[0122] Calculate C based on weighting factors for each past day x weight value Where x represents the number of days in the past since t.
[0123] For example, the weight value for day t-1 is K1 = 1 / (1 + 1 / 10 + 1 / 50) = 25 / 28.
[0124] The weight value for t-10 days is K. 10 = (1 / 10) / (1 / 10+1 / 50+1) = 5 / 56.
[0125] The weight of t-100 days is K 100 = (1 / 50) / (1 / 10+1 / 50+1) = 1 / 56.
[0126] Calculate the number of calls C per day t. a =∑C x *K x *100=100*(15*25 / 28+10*5 / 56+6*1 / 56)=1439, thus obtaining the user behavior value C. aThe value is 1439.
[0127] As users continuously increase the number of API accesses and accesses each day, the C value of user access to the API is dynamically adjusted. With the increase in access time and the increase in the number of samples selected, the number of accesses obtained for the day will also be more accurate.
[0128] Get payment response time:
[0129] like Figure 4 As shown, the payment response time for each payment method over the past month is recorded in a discrete graph, where the horizontal axis represents the number of days, the vertical axis represents the payment response time, and the green line represents the maximum threshold for that payment method.
[0130] The default maximum response time thresholds for each payment method can be found in Table 1.
[0131]
[0132] Table 1. Correspondence between payment methods and payment response time thresholds
[0133] Get the current system access traffic (TPS):
[0134] Collect and record the TPS value of current orders placed in the system and the success rate of initiating payment result queries for each payment method when temporary virtual resources expire.
[0135] Calculate the duration of temporary virtual resources:
[0136] First, determine if the user placing the order is on a blacklist: if so, the duration of the virtual resources issued is 0, meaning no temporary virtual resources are issued. To prevent users from exploiting loopholes, when a user is issued temporary virtual resources and the number of consecutive unsuccessful payments exceeds a certain threshold, they are added to the blacklist. The user is removed from the blacklist when a successful payment is made.
[0137] The granularity of user and payment duration settings is based on current access traffic. Higher TPS and more failed queries require less granularity, while lower TPS and more successful queries require more granularity. For example, if the current order volume is large, triggering many payment result queries and nearing system limits, the granularity should be 1. Conversely, if the current order volume is small and network conditions are good, resulting in few payment result queries, the maximum granularity of 10 can be set.
[0138] Based on the granularity obtained in the previous step, the response time is divided into segments based on duration. For example, if the current granularity is 10, the payment response time is divided into 10 parts. If 10% of payments are completed within 125 seconds, the temporary virtual resource duration for Level 1 is 125 seconds; if 20% of payments are completed within 150 seconds, the temporary virtual resource duration for Level 2 is 150 seconds; and so on, until 100% of payments are completed within 3600 seconds. In the extreme case, if the granularity is 1, the user's virtual resource duration is 3600 seconds.
[0139] Based on the granularity of the previous step, the system is divided into multiple levels according to the user access frequency of all users who placed orders in the past. For example, if the current granularity is 10, based on C calculated in the first step... x Divide users into 10 levels. If the current granularity of the division is 1, then there will be only one user level, and all users will have the same level. User C x The higher the value, the lower the matching payment response time level; conversely, the lower the value, the lower the user's C. x The lower the value, the higher the matching payment response time level.
[0140] Optionally, to avoid a surge in queries due to all temporary virtual resources acquired in the previous step expiring at the same time, a random bias value 'a' needs to be added to the duration of the temporary virtual resources acquired in the previous step. Additionally, a fixed bias value 'b' for query lead time needs to be added to offset any deviation in queries initiated before the remaining duration of the temporary virtual resources.
[0141] Step 3: The intelligent analysis system first calculates the appropriate duration of temporary virtual resources in real time based on the user's behavior trajectory, system access volume, and the statistical response time of the payment system.
[0142] Step 4: The order system uses the suggested duration returned by the intelligent analysis system to send temporary virtual resources to the user for the specified duration and sends a success message to the front end. The front end launches the payment SDK, the user initiates payment, and if the payment system successfully deducts the payment, the front end sends a payment success message to the user. Since temporary virtual resources have already been sent to the user, the user can now start reading or listening to audiobooks. Once the backend receives the payment system's billing confirmation notification, the order system modifies the user's temporary virtual resources into official virtual resources and sends the user other official virtual resources, such as monthly passes or viewing vouchers. If the payment system fails to deduct the payment, the front end sends the user the reason for the payment failure. At the same time, the backend receives the payment system's billing confirmation failure notification and the order system reclaims the user's temporary virtual resources. If the user cancels the payment, the front end sends a notifyCancel message to the backend, and the backend order system closes the order and reclaims the temporary virtual resources.
[0143] Step 5: When the order system detects that the remaining time of the user's temporary virtual resources is lower than the given threshold, the system will send the request to the corresponding Kafka queue according to the payment method.
[0144] Step 6: The Kakfa consumption service detects the request, performs flow control checks, and then calls the corresponding payment system's payment result query interface to check the order's payment status. If the return result is successful, the order system modifies the user's temporary virtual resources to official virtual resources and simultaneously issues other official virtual resources to the user, such as monthly passes or viewing vouchers. If the return result is payment failure, the order system reclaims the user's temporary virtual resources. If the interface call times out or returns "payment in progress," the intelligent analysis system is called to obtain the duration of the temporary virtual resources. If the cumulative duration of the returned temporary virtual resources does not exceed the duration threshold of the corresponding payment method, the user's temporary virtual resources are extended for the specified duration. If the cumulative duration of the returned temporary virtual resources exceeds the duration threshold of the corresponding payment method, the remaining temporary virtual resources are reclaimed, the order is closed, and a monitoring report is submitted.
[0145] This invention addresses the pain point of users not being able to use their purchased virtual resources promptly after placing an order payment request. It determines the temporary virtual resource usage duration for the ordering user based on their historical virtual resource usage behavior, the system traffic of the order processing system, and the historical payment response time of the order payment method when such a request is detected. The order payment request includes information about the ordering user, the order processing system, and the order payment method. The invention then issues the temporary virtual resource usage permission to the ordering user based on the temporary usage duration. This solves the problem of users not being able to use their purchased virtual resources promptly after placing an order and making payment, and addresses the issue of poor user experience caused by the inability to promptly compensate users for virtual resources when payment confirmation messages are not synchronized in a timely manner.
[0146] Figure 5 A schematic diagram of the structure of the virtual resource compensation device provided in an embodiment of the present invention is shown. Figure 5 As shown, the device 30 includes: a determination module 301 and a distribution module 302.
[0147] The determining module 301 is used to determine the temporary virtual resource usage duration of the ordering user when an order payment request for virtual resources is detected, based on the ordering user's historical virtual resource usage behavior, the system access volume of the order processing system, and the historical payment response time of the order payment method; the order payment request includes the ordering user's information, the order processing system's information, and the order payment method;
[0148] The distribution module 302 is used to distribute virtual resource usage permissions to the ordering user based on the temporary resource usage duration.
[0149] The operation process of the virtual resource compensation device provided in this embodiment of the invention is largely the same as that of the aforementioned method embodiment, and will not be described again.
[0150] The virtual resource compensation device provided in this invention determines the temporary virtual resource usage duration for the ordering user when a payment request for virtual resources is detected, based on the user's historical virtual resource usage behavior, the system access volume of the order processing system, and the historical payment response time of the order payment method. The payment request includes the user's information, the order processing system's information, and the order payment method. The device then issues virtual resource usage permissions to the user based on the temporary resource usage duration. This addresses the pain point of users not being able to use their purchased virtual resources promptly after placing an order and making payment. It also solves the problem in existing technologies where timely virtual resource compensation is not possible when payment confirmation messages are not synchronized in a timely manner, resulting in a poor user experience.
[0151] Figure 6 The diagram shows a structural schematic of a virtual resource compensation device provided in an embodiment of the present invention. The specific implementation of the virtual resource compensation device is not limited by the specific embodiments of the present invention.
[0152] like Figure 6 As shown, the virtual resource compensation device may include: a processor 402, a communications interface 404, a memory 406, and a communications bus 408.
[0153] The processor 402, communication interface 404, and memory 406 communicate with each other via communication bus 408. Communication interface 404 is used to communicate with other network elements such as clients or other servers. The processor 402 executes program 410, specifically performing the relevant steps described above in the virtual resource compensation method embodiment.
[0154] Specifically, program 410 may include program code, which includes computer-executable instructions.
[0155] Processor 402 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention. The virtual resource compensation device includes one or more processors, which may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.
[0156] Memory 406 is used to store program 410. Memory 406 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.
[0157] Specifically, program 410 can be called by processor 402 to cause the virtual resource compensation device to perform the following operations:
[0158] When a payment request for virtual resources is detected, the temporary virtual resource usage duration of the ordering user is determined based on the ordering user's historical virtual resource usage behavior, the system access volume of the order processing system, and the historical payment response time of the order payment method; the order payment request includes the ordering user's information, the order processing system's information, and the order payment method;
[0159] The user who placed the order is granted access to virtual resources based on the duration of the temporary resource usage.
[0160] The operation process of the virtual resource compensation device provided in this embodiment of the invention is largely the same as that of the aforementioned method embodiment, and will not be repeated here.
[0161] The virtual resource compensation device provided in this invention determines the temporary virtual resource usage duration for the ordering user when a payment request for virtual resources is detected, based on the user's historical virtual resource usage behavior, the system access volume of the order processing system, and the historical payment response time of the payment method. The payment request includes the user's information, the order processing system's information, and the payment method. The device then issues virtual resource usage permissions to the user based on the temporary usage duration. This addresses the pain point of users not being able to use their purchased virtual resources promptly after placing an order and making payment. It also solves the problem in existing technologies where timely virtual resource compensation is not possible when payment confirmation messages are not synchronized in a timely manner, resulting in a poor user experience.
[0162] This invention provides a computer-readable storage medium storing at least one executable instruction that, when executed on a virtual resource compensation device, causes the virtual resource compensation device to perform the virtual resource compensation method in any of the above method embodiments.
[0163] Specifically, the executable instructions can be used to cause the virtual resource compensation device to perform the following operations:
[0164] When a payment request for virtual resources is detected, the temporary virtual resource usage duration of the ordering user is determined based on the ordering user's historical virtual resource usage behavior, the system access volume of the order processing system, and the historical payment response time of the order payment method; the order payment request includes the ordering user's information, the order processing system's information, and the order payment method;
[0165] The user who placed the order is granted access to virtual resources based on the duration of the temporary resource usage.
[0166] The operation process of the computer-readable storage medium provided in this embodiment of the invention is largely the same as that of the aforementioned method embodiments, and will not be described again.
[0167] The computer-readable storage medium provided in this invention determines the temporary virtual resource usage duration for a user who places an order when a payment request for virtual resources is detected, based on the user's historical virtual resource usage behavior, the system access volume of the order processing system, and the historical payment response time of the order payment method. The order payment request includes information about the user, the order processing system, and the order payment method. The user is granted virtual resource usage rights based on the temporary resource usage duration. This allows for the reasonable determination of temporary resource usage duration to compensate the user during the confirmation delay period when the user's order payment result is not updated in real time or is lost. This solves the pain point of users not being able to use their purchased virtual resources promptly after placing an order and making payment. It also addresses the problem in existing technologies where timely virtual resource compensation is not possible when payment confirmation messages are not synchronized in a timely manner, resulting in a poor user experience.
[0168] This invention provides a virtual resource compensation device for executing the above-described virtual resource compensation method.
[0169] This invention provides a computer program that can be invoked by a processor to cause a virtual resource compensation device to execute the virtual resource compensation method in any of the above method embodiments.
[0170] This invention provides a computer program product, which includes a computer program stored on a computer-readable storage medium. The computer program includes program instructions, which, when executed on a computer, cause the computer to perform the virtual resource compensation method in any of the above method embodiments.
[0171] The algorithms or displays provided herein are not inherently related to any particular computer, virtual system, or other device. Various general-purpose systems can also be used in conjunction with the teachings herein. The required structure for constructing such systems is apparent from the above description. Furthermore, the embodiments of the present invention are not directed to any particular programming language. It should be understood that the content of the invention described herein can be implemented using various programming languages, and the above description of specific languages is for the purpose of disclosing the best mode of implementation of the invention.
[0172] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.
[0173] Similarly, it should be understood that, in order to streamline the invention and aid in understanding one or more of the various aspects of the invention, features of the embodiments of the invention are sometimes grouped together in a single embodiment, figure, or description thereof in the above description of exemplary embodiments of the invention. However, this disclosure should not be construed as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim.
[0174] Those skilled in the art will understand that modules in the device of the embodiments can be adaptively changed and placed in one or more devices different from that embodiment. Modules, units, or components in the embodiments can be combined into a single module, unit, or component, and can be divided into multiple sub-modules, sub-units, or sub-components. Except where at least some of such features and / or processes or units are mutually exclusive, any combination can be used to combine all features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all processes or units of any method or device so disclosed. Unless expressly stated otherwise, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) may be replaced by an alternative feature that serves the same, equivalent, or similar purpose.
[0175] It should be noted that the above embodiments are illustrative of the invention and not restrictive, and that those skilled in the art can devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses should not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names. The steps in the above embodiments, unless otherwise specified, should not be construed as limiting the order of execution.
Claims
1. A virtual resource compensation method, characterized in that, The method includes: When a payment request for virtual resources is detected, the temporary virtual resource usage duration for the ordering user is determined based on the ordering user's historical virtual resource usage behavior, the system access volume of the order processing system, and the historical payment response time of the order payment method. The order payment request includes information about the ordering user, information about the order processing system, and the order payment method. Specifically, the frequency of the ordering user's use of non-temporary virtual resources within a historical time interval is determined based on the historical virtual resource usage behavior; the current number of users accessing the order processing system and the historical virtual resource issuance success rate are determined based on the system access volume; a payment response time threshold corresponding to the order payment method is determined based on the historical payment response time; and the temporary virtual resource usage duration is determined based on the usage frequency, the current number of users accessing the system, the historical virtual resource issuance success rate, and the payment response time threshold. The user who placed the order is granted access to the virtual resources based on the duration of the temporary virtual resource usage.
2. The method according to claim 1, characterized in that, The step of determining the usage duration of the temporary virtual resource based on the usage frequency, current number of users accessing the site, historical virtual resource issuance success rate, and payment response time threshold further includes: The splitting granularity is determined based on the current number of accessing users and the historical virtual resource distribution success rate. The payment response time threshold is divided into multiple selectable response time intervals based on the specified granularity; each response time interval corresponds to a latency severity level. The duration of use of the temporary virtual resource is determined based on the optional response duration range and the frequency of use.
3. The method according to claim 2, characterized in that, The step of determining the usage duration of the temporary virtual resource based on the optional response duration range and the usage frequency further includes: Obtain the historical virtual resource usage frequency of all users in the order processing system; Based on the stated granularity, the historical virtual resource usage frequency of all users is divided into multiple selectable usage frequency ranges; The target usage frequency range is determined from the selectable usage frequency range based on the usage frequency of the user who placed the order. The target response duration interval is determined from the optional response duration intervals based on the target usage frequency interval and the degree of matching between each optional response duration interval; the degree of matching is determined based on the relative order of the target usage frequency interval among all optional usage frequency intervals; wherein, the usage frequency of the ordering user determines the importance of the user, and the greater the importance of the user, the lower the severity of the latency. The duration of use of the temporary virtual resource is determined based on the length of the target response duration interval.
4. The method according to claim 1, characterized in that, The step of granting virtual resource usage permissions to the ordering user based on the temporary virtual resource usage duration further includes: The temporary virtual resources corresponding to the usage duration of the temporary virtual resources are distributed to the ordering user, and the remaining duration of the temporary virtual resources of the ordering user is detected. When it is detected that the remaining duration of the temporary virtual resource is less than the preset remaining duration threshold, the payment result corresponding to the order payment request is obtained; The usage duration of the temporary virtual resource is updated based on the payment result.
5. The method according to claim 4, characterized in that, The step of updating the usage duration of the temporary virtual resource based on the payment result further includes: When the payment result is determined to be in progress, the usage duration of the temporary virtual resource is compared with the temporary virtual resource usage duration threshold corresponding to the order payment method; When it is determined that the usage duration of the temporary virtual resource is less than or equal to the usage duration threshold of the temporary virtual resource, the usage duration of the temporary virtual resource is extended.
6. The method according to claim 4, characterized in that, The step of updating the usage duration of the temporary virtual resource based on the payment result further includes: When the payment result is determined to be successful, the temporary virtual resources of the ordering user are replaced with the formal virtual resources requested by the order payment request; When the payment result is determined to be a payment failure, the temporary virtual resources are reclaimed.
7. A virtual resource compensation device, characterized in that, The device includes: A determination module is used to, when a payment request for virtual resources is detected, determine the temporary virtual resource usage duration of the ordering user based on the ordering user's historical virtual resource usage behavior, the system access volume of the order processing system, and the historical payment response time of the order payment method. The order payment request includes information about the ordering user, information about the order processing system, and the order payment method. Specifically, the module determines the frequency of the ordering user's use of non-temporary virtual resources within a historical time interval based on the historical virtual resource usage behavior; it determines the current number of users accessing the order processing system and the historical virtual resource issuance success rate based on the system access volume; it determines a payment response time threshold corresponding to the order payment method based on the historical payment response time; and it determines the temporary virtual resource usage duration based on the usage frequency, the current number of users accessing the system, the historical virtual resource issuance success rate, and the payment response time threshold. The distribution module is used to distribute the access rights of the virtual resources to the ordering user based on the usage duration of the temporary virtual resources.
8. A virtual resource compensation device, characterized in that, include: The processor, memory, communication interface, and communication bus are provided, wherein the processor, memory, and communication interface communicate with each other via the communication bus. The memory is used to store at least one executable instruction that causes the processor to perform the operation of the virtual resource compensation method as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The storage medium stores at least one executable instruction, which, when executed on the virtual resource compensation device, causes the virtual resource compensation device to perform the operation of the virtual resource compensation method as described in any one of claims 1-6.
Citation Information
Patent Citations
Method for quickly playing video and device, server and terminal thereof
CN105915950A
Routing and processing of payment transactions
US10002348B1