A billing method and device based on user order and storage medium

By updating the unit price and status of virtual computing resource orders in real time, the problem of inaccurate billing under diverse orders is solved, and efficient and accurate billing management is achieved.

CN115147149BActive Publication Date: 2025-11-11DAWNING INFORMATION IND (BEIJING) CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210735173.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-27
Publication Date
2025-11-11
Estimated Expiration
2042-06-27

AI Technical Summary

Technical Problem

Existing technologies cannot effectively manage the billing of virtual computing resources under diverse orders, resulting in large errors and low efficiency in billing results.

Method used

By acquiring user product consumption information and updating order unit price and status in real time, we ensure timely adjustment of product price status when preset amount thresholds are reached. Combined with order time series priority execution, we achieve accurate billing management for diverse orders.

Benefits of technology

This improves the accuracy and efficiency of billing, avoids economic losses for users, and ensures the orderliness and transparency of the billing process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115147149B_ABST
    Figure CN115147149B_ABST
Patent Text Reader

Abstract

This invention discloses a billing method, apparatus, and storage medium based on user orders. The method includes: in response to obtaining consumption information of a first user for a first product, obtaining the real-time unit price of the first product, and obtaining a first order with a valid price status for the first product; updating the remaining amount of the first order according to the real-time unit price of the first product; if the remaining amount of the first order is less than or equal to a preset amount threshold, obtaining a second order with a pending price status for the first product, and setting the unit price of the first product in the second order to the real-time unit price of the first product. This invention realizes billing management for products under diverse orders, improves the accuracy and efficiency of product billing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of e-commerce technology, and in particular to a billing method, apparatus and storage medium based on user orders. Background Technology

[0002] With the rapid development of e-commerce, virtual products have come into view. However, many of these products will only incur charges after the user actually consumes them. Therefore, ensuring accurate billing for users has become particularly important.

[0003] Taking virtual computing resources in the remote cloud as an example, users purchase and pay for virtual computing resources through different types of orders. For example, order 1 purchases a certain quantity of computing resource A at a predetermined unit price; order 2 pays a certain amount for the use of computing resource A according to the dynamic unit price of the cloud platform; and order 3 pays a certain amount for the use of computing resource A at a predetermined unit price. However, none of the above three orders may be fully used. Therefore, the quantity of goods consumed by the user, the unit price of the goods, and the quantity of goods that the user can use may change in real time.

[0004] In existing technologies, billing management for users can usually only be done for a single order or a fixed unit price of goods. This cannot be applied to the billing methods for goods under the above-mentioned diversified orders. As a result, the billing results for users often have large errors, and the billing efficiency is also low. Summary of the Invention

[0005] This invention provides a billing method, apparatus, and storage medium based on user orders. After obtaining the user's consumption information for a first product, the method addresses the problem of untimely updates to the real-time unit price of the first product based on all of the user's orders involving the first product.

[0006] According to one aspect of the present invention, a billing method based on user orders is provided, comprising:

[0007] In response to obtaining the consumption information of the first user for the first product, the real-time unit price of the first product is obtained, and the first order with the price status of the first product is obtained as valid;

[0008] Update the remaining amount of the first order based on the real-time unit price of the first product;

[0009] If the remaining amount of the first order is less than or equal to a preset amount threshold, then obtain the second order whose price status of the first product is pending, and set the unit price of the first product in the second order to the real-time unit price of the first product.

[0010] After updating the remaining amount of the first order based on the real-time unit price of the first product, the method further includes: if the remaining amount of the first order is greater than a preset amount threshold, updating the consumption quantity of the first product in the first order based on the first user's consumption information of the first product; determining whether the consumption quantity of the first product is greater than or equal to the order quantity of the first product in the first order; if the consumption quantity of the first product is greater than or equal to the order quantity of the first product in the first order, then obtaining a second order with the price status of the first product as pending, and setting the unit price of the first product in the second order to the real-time unit price of the first product. This achieves effective management of ordered products in the total quantity of goods in an order, ensuring that the real-time unit price of consumed products is updated in a timely manner when the remaining amount of the order is greater than the preset amount threshold, thus improving the accuracy of user billing.

[0011] The step of obtaining a second order with the price status of the first product set to "awaiting" and setting the unit price of the first product in the second order to the real-time unit price of the first product includes: if there are multiple second orders with the price status of the first product set to "awaiting," then obtaining the target second order with the earliest order time among all the second orders; setting the unit price of the first product in the target second order to the real-time unit price of the first product. By setting the target second order with the earliest order time to the real-time unit price of the first product, the priority execution of earlier orders in the time sequence is ensured, the orderly billing of goods is ensured, and at the same time, it avoids the economic loss to users caused by earlier orders exceeding the usage period.

[0012] Before determining whether the consumption of the first product is greater than or equal to the order quantity of the first product in the first order, the process includes: determining whether the order quantity of the first product in the first order is null; determining whether the consumption of the first product is greater than or equal to the order quantity of the first product in the first order includes: if the order quantity of the first product in the first order is not null, then determining whether the consumption of the first product is greater than or equal to the order quantity of the first product in the first order. Only when the order quantity of the first product in the first order is not null can the basis for managing the order through the consumption of the product be established, thereby improving the management efficiency of ordered products in both agreed-upon unit price orders and system unit price orders.

[0013] The method further includes: in response to receiving a third order from a first user, obtaining the unit price of at least one ordered item in the third order; determining whether there is a fourth order with a valid price status for the ordered item; if there is a fourth order with a valid price status for the ordered item, setting the price status of the ordered item in the third order to "waiting"; if there is no fourth order with a valid price status for the ordered item, setting the price status of the ordered item in the third order to "valid" and updating the real-time unit price of the ordered item to the unit price of the ordered item in the third order. This ensures that the real-time unit price of the ordered items in each new order is updated promptly, enabling billing management of items under diverse orders, improving the accuracy and efficiency of billing.

[0014] Before determining whether a fourth order exists with a valid price status for the ordered item, the process further includes: determining whether a purchase record for the ordered item exists; if no purchase record exists, setting the price status of the ordered item in the third order to valid, and updating the real-time unit price of the ordered item to the unit price in the third order; determining whether a fourth order exists with a valid price status for the ordered item includes: if a purchase record exists, determining whether a fourth order exists with a valid price status for the ordered item. Compared to determining whether a fourth order exists, determining whether a purchase record exists for the ordered item improves parameter matching efficiency. Furthermore, when determining whether a purchase record exists and continuing to determine whether a fourth order exists with a valid price status for the ordered item, the results of the aforementioned parameter determinations can be used to continue matching the remaining parameters without increasing the number of parameter items to be matched.

[0015] After obtaining the third order from the first user, the process further includes: obtaining the order type of the third order; wherein, the order type includes a fixed-price order, a total quantity order, and a system-priced order; if the third order is a total quantity order, the order quantity of the ordered goods in the third order is set to a null value; if the third order is a fixed-price order or a system-priced order, the order quantity of the ordered goods in the third order is set to the actual purchase quantity. For orders that do not include the order quantity, i.e., fixed-price orders and system-priced orders, setting the order quantity to a null value allows for billing management of goods in this type of order only requiring control through the remaining order amount, thus improving the billing efficiency of goods in this type of order; while for orders that include the order quantity, i.e., total quantity orders, setting the order quantity to the actual purchase quantity allows for simultaneous control through the remaining order amount and the order quantity when billing goods in this order, thus improving the accuracy of billing for goods in this type of order.

[0016] According to another aspect of the present invention, a billing device based on user orders is provided, comprising:

[0017] The consumption information acquisition module is used to respond to the acquisition of the consumption information of the first user for the first product, the acquisition of the real-time unit price of the first product, and the acquisition of the first order whose price status is valid.

[0018] The amount update execution module is used to update the remaining amount of the first order based on the real-time unit price of the first product.

[0019] The first unit price update module is used to obtain the second order whose price status of the first product is waiting if the remaining amount of the first order is less than or equal to a preset amount threshold, and set the unit price of the first product in the second order to the real-time unit price of the first product.

[0020] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0021] At least one processor; and

[0022] A memory communicatively connected to the at least one processor; wherein,

[0023] The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the user order-based billing method according to any embodiment of the present invention.

[0024] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the user order-based billing method described in any embodiment of the present invention.

[0025] The technical solution of this invention, after obtaining the consumption information of the first user for the first product, obtains the real-time unit price of the first product and the first order with the price status of the first product being valid. Then, based on the real-time unit price of the first product, it updates the remaining amount of the first order. When the remaining amount of the first order is less than or equal to a preset amount threshold, it obtains a second order with the price status of the first product being pending, so as to set the unit price of the first product in the second order as the real-time unit price of the first product. This realizes the billing management of products under diversified orders, improves the billing accuracy of products, and enhances the billing efficiency.

[0026] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0027] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0028] Figure 1 This is a flowchart of a billing method based on user orders according to Embodiment 1 of the present invention;

[0029] Figure 2 This is a flowchart of a billing method based on user orders according to Embodiment 2 of the present invention;

[0030] Figure 3 This is a flowchart of a billing method based on user orders according to Embodiment 3 of the present invention;

[0031] Figure 4 This is a flowchart of a billing method based on user orders according to Embodiment 4 of the present invention;

[0032] Figure 5 This is a schematic diagram of a billing device based on user orders according to Embodiment 5 of the present invention;

[0033] Figure 6 This is a schematic diagram of the structure of an electronic device that implements the user order-based billing method of this invention. Detailed Implementation

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

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

[0036] Example 1

[0037] Figure 1 This is a flowchart of a billing method based on user orders provided in Embodiment 1 of the present invention. This embodiment is applicable to timely updating of the real-time unit price of the first product based on all orders involving the first product after obtaining the user's consumption information for the first product. This method can be executed by a billing device based on user orders, which can be implemented in hardware and / or software. This billing device based on user orders can be configured in electronic devices such as servers, typically in servers with cloud platforms, to provide users with remote virtual computing resources. Figure 1 As shown, the method includes:

[0038] S101. In response to obtaining the consumption information of the first user for the first product, obtain the real-time unit price of the first product, and obtain the first order whose price status of the first product is valid.

[0039] When a user's product usage information is detected, the name of the product consumed by the user and the amount consumed in this instance are obtained. Taking the above technical solution as an example, when the server detects the user's uploaded or downloaded data, it can determine that the user has consumed information on a certain virtual computing resource. The real-time unit price is the billing unit price of the first product for the first user at the current moment. The user's usage fee can be calculated based on the real-time unit price and the consumption amount of the product. Specifically, a real-time unit price table can be pre-configured for each user to record the current unit price of each product purchased by the user. Each product has one and only one real-time unit price, which is determined by the unit price of the product currently in effect in a certain order. The real-time unit price table can also be used to record all products sold in the system, including products purchased by the user and products not purchased. If the order for a product does not contain a currently effective unit price, or if it is not a product purchased by the user, then the system unit price in the server is used as the real-time unit price of the product. As shown in Table 1, this is the real-time unit price table for the first user.

[0040] Table 1 Real-time unit price table for the first user

[0041] Product Name Real-time unit price Product A Price A Product B Price B Product C Price C Product D Price D Product E Price E Product F Price F

[0042] For a given product, even if a user has multiple orders and each order is usable, only one order's unit price is valid. This ensures that for each user, only one unit price for each product is currently used for billing. Specifically, a price status table can be pre-configured for each user to record the price status of each product in each order. Table 2 shows the price status table for the first user. Each record in the price status table reflects the unit price of one product in an order. If the price status is valid, it indicates that the user is currently consuming that product, and billing will be performed for this order. The unit price of the product is its real-time unit price. If the price status is "awaiting," it means that although the product is available in the current order, its price is in a "awaiting" state, meaning the price is temporarily unavailable. The user's current consumption of this product will not be billed in this order, and the real-time unit price is based on the unit prices of other orders. If the price status is "completed," it means the product in the current order has been used up, and obviously, the unit price of the product in the current order does not affect the real-time unit price. In particular, the unit prices of different products in an order may be in different price statuses. The price status table can also record the consumed quantity of each product in each order.

[0043] Table 2 Price Status Table for the First User

[0044]

[0045]

[0046] Therefore, after obtaining the consumption information of the first user for the first product, the real-time unit price of the first product and the order identifier of the first order whose price status is valid are obtained.

[0047] S102. Update the remaining amount of the first order based on the real-time unit price of the first product.

[0048] Based on the consumption information of the first product, the consumption quantity of the first product can be obtained. The consumption amount of the first product can then be determined based on the consumption quantity and the real-time unit price. Specifically, if the consumption quantity detection of the first product is based on unit data volume, that is, each time a user consumes a unit data volume of the first product, the user's consumption information for the first product is determined, and the remaining amount is updated. At this time, the real-time unit price equals the consumption amount for this transaction. Therefore, only the real-time unit price is needed to obtain the consumption amount for this transaction, and the remaining amount of the first order is updated accordingly. Specifically, an order amount table can be pre-configured for each user to record the order amount and remaining amount for each order of that user; as shown in Table 3, this is the order amount table for the first user; where the order amount is the amount paid for the order, and the remaining amount is the amount remaining after paying the user's product usage fee; order types can include orders with a fixed unit price, orders with a total product quantity, and orders with a system unit price.

[0049] Table 3: Order Amount for the First User

[0050] Order Identifier Order type Order amount Remaining amount Order 1 Agreed unit price order Amount A1 Amount B1 Order 2 Total quantity of goods in orders Amount A2 Amount B2 Order 3 System unit price order Amount A3 Amount B3

[0051] A fixed-price order is an order where the unit price of the goods purchased by the user is fixed (i.e., pre-agreed). Each item can have a different unit price, and the quantity of goods used is not fixed. The order ends when the order amount is used up. For example, a user's order is: A1 model CPU (Central Processing Unit) at 0.02 yuan / core, B1 model GPU (Graphics Processing Unit) at 1.00 yuan / card, A2 model CPU at 0.06 yuan / core, and B2 model GPU at 1.10 yuan / card, with a total order amount of 10,000 yuan.

[0052] An order for a total quantity of goods is one in which the unit price and quantity of goods purchased by the user are fixed, and each item can have a different unit price and a different quantity. Once any item reaches its corresponding quantity, it can no longer be used. For example, a user's order is: when the unit price of an A1 model CPU is 0.09 yuan / core, and the unit price of a B1 model GPU is 2.00 yuan / card, the user would purchase 10,000 A1 model CPUs and 5,000 B1 model GPUs.

[0053] A system-priced order is an order where the user only pays the order amount, without specifying the unit price of the goods or setting the quantity. The unit price of the goods purchased by the user is based on the system's unit price for that goods. When the system unit price changes, the unit price of the goods in the order also changes. The order ends when the order amount is consumed. For example, if the unit price of an A1 model CPU is 0.05 yuan / core and the unit price of a B1 model GPU is 1.20 yuan / card, the order amount is 10,000 yuan.

[0054] S103. If the remaining amount of the first order is less than or equal to a preset amount threshold, then obtain the second order whose price status of the first product is pending, and set the unit price of the first product in the second order as the real-time unit price of the first product.

[0055] If overdraft is not allowed, the preset amount threshold can be set to 0. This means that once the current order's amount is exhausted (i.e., the remaining amount is less than or equal to 0), other orders with a waiting status will be retrieved. If a certain amount of overdraft is allowed, the preset amount threshold can be set to less than 0. This means that after the current order is completed, a certain amount of overdraft is permitted, ensuring the user can still use the first item normally even when the order amount is exhausted. Specifically, the preset amount threshold can be set to different amounts depending on the amount of the first order. For example, the larger the amount of the first order, the larger the allowed overdraft amount, and the smaller the preset amount threshold.

[0056] If the remaining amount of the first order is less than or equal to a preset threshold, it indicates that all items in the order have been used up and the order is complete. The price status of the first item in the first order is then set to "completed." A remaining amount less than 0 indicates that the user has overdrawn their account. A second order with the price status of the first item ("waiting") is then obtained, and the price status of the first item in the second order is changed to "valid." Simultaneously, the unit price of the first item in the second order is set to the real-time unit price of the first item. For example, in Table 2, for item A, the order with the price status of item A ("waiting") is order 3. The unit price of item A in order 3, i.e., price A3, is set to the real-time unit price of item A. When the first user uses item A, price A3 is used as the real-time unit price of item A. At the same time, the price A3 of item A in order 3 is changed from "waiting" to "valid." When the user uses item A again, billing is performed in order 3.

[0057] Optionally, in this embodiment of the invention, after updating the remaining amount of the first order based on the real-time unit price of the first product, the method further includes: if the remaining amount of the first order is greater than a preset amount threshold, updating the consumption amount of the first product in the first order based on the consumption information of the first user for the first product; determining whether the consumption amount of the first product is greater than or equal to the order quantity of the first product in the first order; if the consumption amount of the first product is greater than or equal to the order quantity of the first product in the first order, then obtaining a second order with the price status of the first product being pending, and setting the unit price of the first product in the second order as the real-time unit price of the first product.

[0058] Specifically, if the remaining amount of the first order is greater than a preset threshold, it indicates that the goods in that order have not been fully consumed and there are available goods. However, it cannot be guaranteed that the first good is the available good in the first order. For example, in the above-mentioned total quantity order, the CPU of model A1 is not fully used, but the GPU of model B1 is fully used. Therefore, a product order table can be pre-configured for each user to record the consumption of each product in each order of that user. As shown in Table 4, this is the product order table for the first user. Based on the consumption information of the first product by the first user this time, the consumption of the first product in the first order is updated. If the update... If the subsequent consumption value is greater than or equal to the order quantity of the first item in the first order, it is clear that the first item in the first order has been used up. Therefore, the price status of the first item in the first order is set to "completed," and the price status of the second order (which is "awaiting") is retrieved to modify the price status of the first item in the second order to "valid." At the same time, the unit price of the first item in the second order is set to the real-time unit price of the first item. This achieves effective management of the ordered items in the total order quantity, ensuring that the real-time unit price of consumed items is updated in a timely manner when the remaining amount of the order exceeds a preset threshold, thus improving the accuracy of user billing.

[0059] Table 4: First User's Product Order Table

[0060] Order Identifier Product Name unit price of goods Order Quantity consumption Order 1 Product A Price A1 null value Consumption A1 Order 1 Product B Price B1 null value Consumption B1 Order 1 Product C Price C1 null value Consumption C1 Order 2 Product A Price A2 Quantity A2 Consumption A2 Order 2 Product D Price D2 Quantity D2 Consumption D2 Order 2 Product E Price E2 Quantity E2 Consumption E2 Order 3 Product A Price A3 null value Consumption A3 Order 3 Product B Price B3 null value Consumption B3 Order 3 Product D Price D3 null value Consumption D3 Order 3 Product F Price F3 null value Consumption F3

[0061] Optionally, in this embodiment of the invention, obtaining the second order with the price status of the first product being "awaited," and setting the unit price of the first product in the second order as the real-time unit price of the first product, includes: if there are multiple second orders with the price status of the first product being "awaited," then obtaining the target second order with the earliest order time among all the second orders; setting the unit price of the first product in the target second order as the real-time unit price of the first product. By setting the target second order with the earliest order time as the real-time unit price of the first product, the priority execution of earlier orders in the time sequence is ensured, the orderliness of product billing is ensured, and at the same time, it avoids the economic loss to users caused by earlier orders exceeding the usage period.

[0062] Optionally, in this embodiment of the invention, before determining whether the consumption of the first product is greater than or equal to the order quantity of the first product in the first order, the method includes: determining whether the order quantity of the first product in the first order is null; the method of determining whether the consumption of the first product is greater than or equal to the order quantity of the first product in the first order includes: if the order quantity of the first product in the first order is not null, then determining whether the consumption of the first product is greater than or equal to the order quantity of the first product in the first order.

[0063] Specifically, the first order may not contain the actual quantity of goods ordered. For example, in the aforementioned orders with agreed-upon unit prices and system-based unit prices, no order quantity for any of the goods is set, meaning the order quantity is set to an empty value. For orders of this type, it is not possible to determine the quantity based on whether the consumption of the goods is greater than or equal to the order quantity; the order can only be managed through the remaining amount. Only if the order quantity of the first item in the first order is not an empty value can the order be managed through the consumption of the goods, thus achieving timely management of the ordered goods in orders with agreed-upon unit prices and system-based unit prices.

[0064] The technical solution of this invention, after obtaining the consumption information of the first user for the first product, obtains the real-time unit price of the first product and the first order with the price status of the first product being valid. Then, based on the real-time unit price of the first product, it updates the remaining amount of the first order. When the remaining amount of the first order is less than or equal to a preset amount threshold, it obtains a second order with the price status of the first product being pending, so as to set the unit price of the first product in the second order as the real-time unit price of the first product. This realizes the billing management of products under diversified orders, improves the billing accuracy of products, and enhances the billing efficiency.

[0065] Example 2

[0066] Figure 2 This is a flowchart of a billing method based on user orders provided in Embodiment 2 of the present invention. This embodiment, based on the above embodiments, specifies the method for obtaining the real-time unit price of the first product. For example... Figure 2 As shown, the method includes:

[0067] S201. Obtain the consumption information of the first user for the first product; execute S202.

[0068] S202, Obtain the real-time unit price of the first product; Execute S203.

[0069] S203, Obtain the first order where the price status of the first product is valid; Execute S204.

[0070] S204. Update the remaining amount of the first order based on the real-time unit price of the first product; execute S205.

[0071] S205. Determine whether the remaining amount of the first order is greater than the preset amount threshold; if not, proceed to S206; if yes, proceed to S210.

[0072] S206. Set the price status of the first item in the first order to "completed"; execute S207.

[0073] S207. Determine if there is a second order for the first product whose price status is pending; if yes, execute S208; if no, execute S213.

[0074] S208. Set the price status of the target second order with the earliest order time to valid; execute S209.

[0075] S209. Set the unit price of the first item in the target second order to the real-time unit price of the first item; execute S214.

[0076] S210. Based on the consumption information of the first user for the first product, update the consumption amount of the first product in the first order; execute S211.

[0077] S211. Determine whether the consumption limit of the first product in the first order is empty; if not, execute S212; if yes, execute S214.

[0078] If the consumption limit of the first item in the first order is empty, and the remaining amount of the first order is greater than the preset amount threshold, it means that the first item in the first order can continue to be used, and the real-time unit price of the first item remains unchanged, that is, the unit price of the first item in the first order can continue to be used.

[0079] S212. Determine whether the consumption of the first product is greater than or equal to the order quantity of the first product in the first order; if yes, execute S206; if no, execute S214.

[0080] If the consumption of the first item is less than the order quantity of the first item in the first order, it means that the first item in the first order can continue to be used, and the real-time unit price of the first item remains unchanged, that is, the unit price of the first item in the first order continues to be used.

[0081] S213. Set the system unit price of the first product to the real-time unit price of the first product; execute S214.

[0082] S214, End.

[0083] The technical solution of this invention, after obtaining the consumption information of the first user for the first product, obtains the real-time unit price of the first product and the first order with the price status of the first product being valid. Then, based on the real-time unit price of the first product, it updates the remaining amount of the first order. When the remaining amount of the first order is greater than a preset amount threshold and the consumption of the first product is greater than or equal to the order quantity of the first product in the first order, it obtains a second order with the price status of the first product being pending, and sets the unit price of the first product in the second order as the real-time unit price of the first product. This achieves effective management of the ordered products in the total quantity of the order, ensuring that when the remaining amount of the order is greater than the preset amount threshold, the real-time unit price of the consumed products is updated in a timely manner, thus improving the accuracy of user billing.

[0084] Example 3

[0085] Figure 3 This is a flowchart of a billing method based on user orders provided in Embodiment 3 of the present invention. This embodiment is a specific embodiment based on the above technical solution. In this embodiment, a new order from the first user, i.e., the third order, is obtained. The method specifically includes:

[0086] S301. In response to obtaining the third order from the first user, obtain the unit price of at least one ordered item in the third order.

[0087] S302. Determine if there is a fourth order where the price status of the ordered goods is valid; if yes, proceed to S303; if no, proceed to S304.

[0088] S303. Set the price status of the ordered goods in the third order to "wait";

[0089] S304. Set the price status of the ordered goods in the third order to valid, and update the real-time unit price of the ordered goods to the unit price of the ordered goods in the third order.

[0090] Taking the above technical solution as an example, if a fourth order with a valid price status is obtained from the price status table of the first user, it indicates that the billing for the ordered product is currently being executed in the fourth order, and the third order, as an order that has not yet started the billing operation, is waiting in the queue for the fourth order to complete its billing. If a fourth order with a valid price status is not obtained, it can also be determined that there are no other orders with a waiting price status for the ordered product in the price status table. The reason is that, as described in the above technical solution, if the billing for an order with a valid price status is completed, an order will be selected from the other orders with a waiting price status as a replacement valid order, that is, the price status of the replacement order will be changed from waiting to valid. Therefore, if a fourth order with a valid price status is not obtained, it also indicates that there are no other orders with a waiting price status. The price status of the ordered product in the third order can be directly set to valid, and the real-time unit price of the ordered product can be updated to the unit price of the ordered product in the third order.

[0091] Optionally, in this embodiment of the invention, before determining whether there is a fourth order with a valid price status for the ordered goods, the method further includes: determining whether there is a purchase record for the ordered goods; if there is no purchase record for the ordered goods, then setting the price status of the ordered goods in the third order to valid, and updating the real-time unit price of the ordered goods to the unit price of the ordered goods in the third order; determining whether there is a fourth order with a valid price status for the ordered goods includes: if there is a purchase record for the ordered goods, then determining whether there is a fourth order with a valid price status for the ordered goods.

[0092] Specifically, determining whether a fourth order with a valid price status exists for the ordered product requires matching multiple parameters in the data table. Taking the price status table in the above technical solution as an example, it is necessary to confirm the existence of the fourth order through the order identifier, product name, and price status. However, to determine whether a purchase record exists for the ordered product, only one parameter needs to be matched, namely, whether the product name contains the product name. Compared to determining whether a fourth order exists, determining whether a purchase record exists for the ordered product improves parameter matching efficiency. Therefore, when it is determined that no purchase record exists for the ordered product, the price status of the ordered product in the third order can be directly set to valid, and the real-time unit price of the ordered product can be updated to the unit price of the ordered product. When it is determined that a purchase record exists for the ordered product, and it is necessary to continue to determine whether a fourth order with a valid price status exists for the ordered product, the judgment result of the aforementioned product name parameter can be used to continue matching the remaining parameters (i.e., order identifier and price status), without increasing the number of parameter matching items.

[0093] Optionally, in this embodiment of the invention, after obtaining the third order from the first user, the method further includes: obtaining the order type of the third order; wherein the order type includes a fixed-price order, a total quantity order, and a system-priced order; if the third order is a total quantity order, the order quantity of the ordered goods in the third order is set to a null value; if the third order is a fixed-price order or a system-priced order, the order quantity of the ordered goods in the third order is set to the actual purchase quantity.

[0094] Specifically, depending on the order type, it can be determined whether the order includes the quantity of goods ordered. For orders that do not include the quantity of goods ordered, i.e., orders with agreed unit price and system unit price, the quantity of goods ordered is set to a null value. When managing the billing of goods in this order, only the remaining amount of the order needs to be controlled, improving the billing efficiency of goods in this order. On the other hand, for orders that include the quantity of goods ordered, i.e., orders with a total quantity of goods, the quantity of goods ordered is set to the actual quantity purchased. When managing the billing of goods in this order, both the remaining amount of the order and the quantity of goods ordered are controlled simultaneously, improving the accuracy of billing of goods in this order.

[0095] The technical solution of this invention, in response to obtaining a third order from a first user, obtains the unit price of at least one ordered item in the third order, and determines whether there is a fourth order with a valid price status for the ordered item. If there is, the price status of the ordered item in the third order is set to "waiting"; if not, the price status of the ordered item in the third order is set to "valid," and the real-time unit price of the ordered item is updated to the unit price of the ordered item in the third order. This ensures that the real-time unit price of the ordered item in each new order is updated in a timely manner, realizing billing management for items under diversified orders, improving the accuracy of billing, and enhancing billing efficiency.

[0096] Example 4

[0097] Figure 4 This is a flowchart of a billing method based on user orders provided in Embodiment 4 of the present invention. Based on the above technical solution, this embodiment specifies the method for obtaining the real-time unit price of the first product. The method specifically includes:

[0098] S401. In response to obtaining the third order from the first user, obtain the unit price of at least one ordered item in the third order, and the order type of the third order; wherein, the order type includes a fixed unit price order, a total quantity order, and a system unit price order; if the third order is a fixed unit price order or a system unit price order, execute S402; if the third order is a total quantity order, execute S403.

[0099] S402. Set the quantity of the ordered goods in the third order to an empty value; execute S404.

[0100] S403. Set the order quantity of the goods ordered in the third order to the actual purchase quantity; execute S404.

[0101] S404. Determine if there is a purchase record for the ordered goods; if yes, proceed to S405; if no, proceed to S407.

[0102] S405. Determine if there is a fourth order with a valid price status for the ordered goods; if yes, proceed to S406; if no, proceed to S407.

[0103] S406. Set the price status of the ordered goods in the third order to pending; execute S409.

[0104] S407. Set the price status of the ordered goods in the third order to be valid; execute S408.

[0105] S408. Update the real-time unit price of the ordered goods to the unit price of the ordered goods in the third order; execute S409.

[0106] S409, End.

[0107] The technical solution of this invention, in response to obtaining a third order from a first user, obtains the unit price of at least one ordered item in the third order, and determines whether there is a fourth order with a valid price status for the ordered item. If there is, the price status of the ordered item in the third order is set to "waiting"; if not, the price status of the ordered item in the third order is set to "valid," and the real-time unit price of the ordered item is updated to the unit price of the ordered item in the third order. This ensures that the real-time unit price of the ordered item in each new order is updated in a timely manner, realizing billing management for items under diversified orders, improving the accuracy of billing, and enhancing billing efficiency.

[0108] Example 5

[0109] Figure 5 This is a schematic diagram of a billing device based on user orders provided in Embodiment 5 of the present invention. Figure 5 As shown, the device includes:

[0110] The consumption information acquisition module 501 is used to respond to the acquisition of the consumption information of the first user on the first product, the acquisition of the real-time unit price of the first product, and the acquisition of the first order whose price status is valid.

[0111] The amount update execution module 502 is used to update the remaining amount of the first order based on the real-time unit price of the first product.

[0112] The first unit price update module 503 is used to obtain the second order whose price status of the first product is waiting if the remaining amount of the first order is less than or equal to a preset amount threshold, and set the unit price of the first product in the second order as the real-time unit price of the first product.

[0113] The technical solution of this invention, after obtaining the consumption information of the first user for the first product, obtains the real-time unit price of the first product and the first order with the price status of the first product being valid. Then, based on the real-time unit price of the first product, it updates the remaining amount of the first order. When the remaining amount of the first order is less than or equal to a preset amount threshold, it obtains a second order with the price status of the first product being pending, so as to set the unit price of the first product in the second order as the real-time unit price of the first product. This realizes the billing management of products under diversified orders, improves the billing accuracy of products, and enhances the billing efficiency.

[0114] Optionally, the billing device based on user orders also includes:

[0115] The consumption update module is used to update the consumption of the first product in the first order based on the consumption information of the first user for the first product if the remaining amount of the first order is greater than a preset amount threshold.

[0116] The consumption determination module is used to determine whether the consumption of the first product is greater than or equal to the order quantity of the first product in the first order.

[0117] The second unit price update module is used to obtain the second order with the price status of the first product being "waiting" if the consumption of the first product is greater than or equal to the order quantity of the first product in the first order, and set the unit price of the first product in the second order to the real-time unit price of the first product.

[0118] Optionally, the first unit price update module and / or the second unit price update module are specifically used to, if there are multiple second orders with the price status of the first product being "waiting", obtain the target second order with the earliest order time among the second orders; and set the unit price of the first product in the target second order as the real-time unit price of the first product.

[0119] Optionally, the billing device based on user orders also includes:

[0120] The order quantity determination module is used to determine whether the order quantity of the first product in the first order is empty.

[0121] The consumption determination module is specifically used to determine whether the consumption of the first product is greater than or equal to the order quantity of the first product in the first order if the order quantity of the first product in the first order is not null.

[0122] Optionally, the billing device based on user orders also includes:

[0123] The new order acquisition module is used to acquire the unit price of at least one ordered item in the third order in response to acquiring the third order from the first user.

[0124] The price status determination module is used to determine whether there is a fourth order for the ordered goods whose price status is valid.

[0125] The price status setting module is used to set the price status of the ordered product in the third order to "waiting" if there is a fourth order with a valid price status; otherwise, it sets the price status of the ordered product in the third order to "valid" and updates the real-time unit price of the ordered product to the unit price of the ordered product in the third order.

[0126] Optionally, the billing device based on user orders also includes:

[0127] The purchase record determination module is used to determine whether there is a purchase record for the ordered goods;

[0128] The third unit price update module is used to set the price status of the ordered product in the third order to valid if there is no purchase record for the ordered product, and to update the real-time unit price of the ordered product to the unit price of the ordered product in the third order.

[0129] The price status determination module is specifically used to determine whether there is a fourth order with a valid price status for the ordered product if a purchase record for the ordered product exists.

[0130] Optionally, the billing device based on user orders also includes:

[0131] The order type acquisition module is used to acquire the order type of the third order; wherein, the order type includes the agreed unit price order, the total quantity of goods order, and the system unit price order;

[0132] The order quantity setting module is used to set the order quantity of the ordered goods in the third order to a null value if the third order is an order for the total quantity of goods; and to set the order quantity of the ordered goods in the third order to the actual purchase quantity if the third order is an order for a fixed unit price or a system unit price.

[0133] The billing device based on user orders provided in the embodiments of the present invention can execute the billing method based on user orders provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of executing the method.

[0134] Example 6

[0135] Figure 6 A schematic diagram of an electronic device 10 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0136] like Figure 6 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0137] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0138] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as a billing method based on user orders.

[0139] In some embodiments, the user order-based billing method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the user order-based billing method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the user order-based billing method by any other suitable means (e.g., by means of firmware).

[0140] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0141] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0142] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0143] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0144] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0145] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0146] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0147] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A billing method based on user orders, characterized in that, include: In response to obtaining the consumption information of the first user for the first product, the real-time unit price of the first product is obtained, and the first order with the price status of the first product is obtained as valid; The step of obtaining the real-time unit price of the first product and obtaining the first order with the price status of the first product as valid includes: obtaining the real-time unit price of the first product through the real-time unit price table of the first user, and obtaining the first order with the price status of the first product as valid through the price status table of the first user; wherein, the real-time unit price table and the price status table are associated through product names, and the real-time unit price of each product in the real-time unit price table comes from the orders with the price status of the corresponding product as valid in the price status table; Update the remaining amount of the first order based on the real-time unit price of the first product; The step of updating the remaining amount of the first order based on the real-time unit price of the first product includes: updating the remaining amount of the first order in the first user's order amount table based on the real-time unit price of the first product; wherein the order amount table and the price status table are associated through an order identifier; If the remaining amount of the first order is less than or equal to a preset amount threshold, then obtain the second order whose price status of the first product is pending, and set the unit price of the first product in the second order to the real-time unit price of the first product.

2. The method according to claim 1, characterized in that, After updating the remaining amount of the first order based on the real-time unit price of the first product, the method further includes: If the remaining amount of the first order is greater than the preset amount threshold, the consumption amount of the first product in the first order is updated according to the consumption information of the first user on the first product. Determine whether the consumption of the first product is greater than or equal to the order quantity of the first product in the first order; If the consumption of the first product is greater than or equal to the order quantity of the first product in the first order, then obtain the second order whose price status of the first product is pending, and set the unit price of the first product in the second order to the real-time unit price of the first product.

3. The method according to claim 1 or 2, characterized in that, The step of obtaining a second order where the price status of the first product is "awaiting" and setting the unit price of the first product in the second order to the real-time unit price of the first product includes: If there are multiple second orders with the price status of the first product being "waiting", then obtain the target second order with the earliest order time among all the second orders; Set the unit price of the first product in the target second order to the real-time unit price of the first product.

4. The method according to claim 2, characterized in that, Before determining whether the consumption of the first product is greater than or equal to the order quantity of the first product in the first order, the process includes: Determine whether the order quantity of the first product in the first order is null; The step of determining whether the consumption of the first product is greater than or equal to the order quantity of the first product in the first order includes: If the order quantity of the first product in the first order is not empty, then determine whether the consumption of the first product is greater than or equal to the order quantity of the first product in the first order.

5. The method according to claim 1, characterized in that, The method further includes: In response to receiving the third order from the first user, obtain the unit price of at least one ordered item in the third order; Determine if there exists a fourth order where the price status of the ordered goods is valid; If there is a fourth order where the price status of the ordered goods is valid, then the price status of the ordered goods in the third order will be set to pending. If there is no fourth order with a valid price status for the ordered product, then the price status of the ordered product in the third order is set to valid, and the real-time unit price of the ordered product is updated to the unit price of the ordered product in the third order.

6. The method according to claim 5, characterized in that, Before determining whether there is a fourth order with a valid price status for the ordered goods, the process also includes: Determine if a purchase record exists for the ordered goods; If there is no purchase record for the ordered product, the price status of the ordered product in the third order will be set to valid, and the real-time unit price of the ordered product will be updated to the unit price of the ordered product in the third order. The determination of whether there is a fourth order with a valid price status for the ordered goods includes: If a purchase record for the ordered item exists, then determine whether there is a fourth order for the ordered item with a valid price status.

7. The method according to claim 5 or 6, characterized in that, After obtaining the third order from the first user, it also includes: Obtain the order type of the third order; wherein, the order type includes the agreed unit price order, the total quantity of goods order, and the system unit price order; If the third order is an order for the total quantity of goods, then the order quantity of the ordered goods in the third order will be set to a null value; If the third order is a pre-agreed unit price order or a system unit price order, then the order quantity of the ordered goods in the third order will be set to the actual purchase quantity.

8. A billing device based on user orders, characterized in that, include: The consumption information acquisition module is used to respond to the acquisition of the consumption information of the first user for the first product, the acquisition of the real-time unit price of the first product, and the acquisition of the first order whose price status is valid. The consumption information acquisition module is specifically used to obtain the real-time unit price of the first product through the real-time unit price table of the first user, and to obtain the first order in which the price status of the first product is valid through the price status table of the first user; wherein, the real-time unit price table and the price status table are associated through product names, and the real-time unit price of each product in the real-time unit price table comes from the order in which the price status of the corresponding product is valid in the price status table. The amount update execution module is used to update the remaining amount of the first order based on the real-time unit price of the first product. The amount update execution module is specifically used to update the remaining amount of the first order in the first user's order amount table according to the real-time unit price of the first product; wherein, the order amount table and the price status table are associated through an order identifier; The first unit price update module is used to obtain the second order whose price status of the first product is waiting if the remaining amount of the first order is less than or equal to a preset amount threshold, and set the unit price of the first product in the second order to the real-time unit price of the first product.

9. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor to enable the at least one processor to perform the user order-based billing method according to any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed by a processor, implement the billing method based on any one of claims 1-7.

Citation Information

Patent Citations

  • Charging method and system of prepaid service

    CN101540986A