A processing method and device for order refund
Patent Information
- Application Number
- CN202510443576.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-09
- Publication Date
- 2026-10-16
AI Technical Summary
[0002]在现有的电商系统中,针对利用减免优惠进行付款并生成的订单,是由商家为用户支付减免优惠部分的费用的,当订单在未完成时发起退款请求时,用户可以第一时间获取到退款,但考虑到订单在途途中的风险,商家则无法及时获取到退款,而需要在订单完成后由商家主动发起退款流程,时效性较差
[0022] One embodiment of the above invention has the following advantages or beneficial effects: when an order is not completed, the order code and refund information can be stored in the cache to effectively store the order refund request. After the order is completed, the cache can be queried to determine whether an order refund request was initiated when the order was not completed, and the refund result for the first user can be automatically generated based on the refund information, eliminating the need for the first user to actively initiate the refund process.
Smart Images

Figure CN122928333A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a method and apparatus for processing order refunds. Background Technology
[0002] In existing e-commerce systems, for orders paid for using discounts or coupons, the merchant pays the discounted portion for the user. When a refund request is initiated before the order is completed, the user can receive the refund immediately. However, considering the risks of the order being in transit, the merchant cannot receive the refund in a timely manner and must initiate the refund process after the order is completed, which is not very efficient. Summary of the Invention
[0003] In view of this, embodiments of the present invention provide a method and apparatus for processing order refunds. When an order is not completed, the order code and refund information are stored in a cache to effectively store the order refund request. After the order is completed, the cache is queried to determine whether an order refund request was initiated when the order was not completed. The refund result for the first user is automatically generated based on the refund information, eliminating the need for the first user to actively initiate the refund process.
[0004] To achieve the above objectives, according to one aspect of the present invention, a method for processing order refunds is provided.
[0005] An order refund processing method according to an embodiment of the present invention includes: generating a first refund task for a first user corresponding to an order refund request; wherein the first refund task includes an order code and refund information; in response to the order code not existing in the order database, storing the order code and the refund information in a cache; wherein the order database is used to store completed order codes; monitoring the completion status of the order corresponding to the order code in real time; in response to the completion status being updated to completed, querying whether the order code exists in the cache; in response to the order code existing in the order database, generating a supplementary refund result for the first user based on the refund information.
[0006] Optionally, the step of storing the order code and the refund information in a preset cache in response to the order code not existing in the order database includes: determining the order type of the order based on the order code in response to the order code not existing in the order database; and storing the order code and the refund information in a preset cache if the order type is a preset order type.
[0007] Optionally, generating the refund result for the first user based on the refund information includes: in response to the presence of multiple refund information corresponding to the order code, merging the multiple refund information to generate total refund information; and generating the refund result for the first user based on the total refund information.
[0008] Optionally, in response to the completion status being completed, the method further includes: storing the order code in the order database to update the order database in real time; and, after generating the refund result for the first user based on the refund information, the method further includes: updating the cache based on the refund result.
[0009] Optionally, generating the refund result for the first user based on the total refund information includes: assembling and generating a second refund task based on the order code and the total refund information; and processing the second refund task based on the updated order database to obtain the refund result for the first user.
[0010] Optionally, updating the cache based on the refund result includes: in response to the refund result indicating a successful refund, deleting cached data corresponding to one or more refund information items corresponding to the refund result from the cache.
[0011] Optionally, generating the first refund task for the first user corresponding to the order refund request includes: determining the generation time of the order refund request; in response to the time difference between the generation time and the current time reaching a preset time threshold, generating the first refund task for the first user corresponding to the order refund request, and placing the first refund task into a message queue.
[0012] To achieve the above objectives, according to another aspect of the present invention, an order refund processing apparatus is provided.
[0013] An order refund processing device according to an embodiment of the present invention includes:
[0014] A generation module is used to generate a first refund task for the first user corresponding to the order refund request; wherein, the first refund task includes an order code and refund information;
[0015] A storage module is configured to, in response to the order code not existing in the order database, store the order code and the refund information in a cache; wherein, the order database is used to store completed order codes;
[0016] The monitoring module is used to monitor the completion status of the order corresponding to the order code in real time.
[0017] The result module is used to, in response to the completion status being updated to "completed," query whether the order code exists in the cache; and, in response to the order code existing in the order database, generate a refund result for the first user based on the refund information.
[0018] To achieve the above objectives, according to another aspect of the present invention, an electronic device for processing order refunds is provided.
[0019] An electronic processing device for processing order refunds according to an embodiment of the present invention includes: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement an order refund processing method according to an embodiment of the present invention.
[0020] To achieve the above objectives, according to another aspect of the present invention, a computer-readable storage medium is provided.
[0021] An embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements an order refund processing method according to an embodiment of the present invention.
[0022] One embodiment of the above invention has the following advantages or beneficial effects: when an order is not completed, the order code and refund information can be stored in the cache to effectively store the order refund request. After the order is completed, the cache can be queried to determine whether an order refund request was initiated when the order was not completed, and the refund result for the first user can be automatically generated based on the refund information, eliminating the need for the first user to actively initiate the refund process.
[0023] The further effects of the aforementioned unconventional alternative methods will be explained below in conjunction with specific implementation methods. Attached Figure Description
[0024] The accompanying drawings are provided to better understand the invention and are not intended to unduly limit the scope of the invention. Wherein:
[0025] Figure 1 This is a schematic diagram of the main process of the order refund processing method according to an embodiment of the present invention;
[0026] Figure 2 This is a flowchart illustrating an application scenario according to an embodiment of the present invention;
[0027] Figure 3 It is a flowchart based on the conventional order refund process in existing technology;
[0028] Figure 4 This is a flowchart illustrating the order refund process according to an embodiment of the present invention;
[0029] Figure 5 This is a schematic diagram of the main process for storing order codes and refund information according to an embodiment of the present invention;
[0030] Figure 6 This is a schematic diagram of the main process for assembling the second refund task and generating the supplementary refund result according to an embodiment of the present invention;
[0031] Figure 7 This is a schematic diagram of the main process for generating the first refund task according to an embodiment of the present invention;
[0032] Figure 8 This is a schematic diagram of the main modules of an order refund processing device according to an embodiment of the present invention;
[0033] Figure 9 This is an exemplary system architecture diagram in which embodiments of the present invention can be applied;
[0034] Figure 10 This is a schematic diagram of the structure of a computer system suitable for implementing terminal devices or servers of the present invention. Detailed Implementation
[0035] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention, including various details to aid understanding. These details should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0036] It should be noted that, unless otherwise specified, the embodiments of the present invention and the technical features thereof can be combined with each other.
[0037] It should be noted that the collection, gathering, updating, analysis, processing, use, transmission, and storage of user personal information involved in this disclosed technical solution all comply with relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. Necessary measures are taken to prevent unauthorized access to user personal information data and to safeguard user personal information security, network security, and national security.
[0038] Figure 1 This is a schematic diagram of the main steps of an order refund processing method according to an embodiment of the present invention.
[0039] like Figure 1 As shown, the order refund processing method of this invention mainly includes the following steps:
[0040] Step S101: Generate a first refund task for the first user corresponding to the order refund request; wherein, the first refund task includes the order code and refund information;
[0041] Step S102: In response to the order code not existing in the order database, the order code and refund information are stored in the cache accordingly; wherein, the order database is used to store completed order codes;
[0042] Step S103: Monitor the completion status of the order corresponding to the order code in real time;
[0043] Step S104: In response to the completion status being updated to "completed", check if the order code exists in the cache; in response to the order code existing in the order database, generate the refund result for the first user based on the refund information.
[0044] In practical applications, merchants cannot proactively initiate order refund requests; instead, the user who purchased the goods (hereinafter referred to as the second user) must initiate the refund request. However, in the discount / reduction scenario addressed in this invention, the merchant actually pays for the discounted portion of the price to the user. Therefore, in this case, upon receiving an order refund request, a refund needs to be issued not only to the second user (the user who purchased the goods) but also to the first user (the merchant). Thus, this invention primarily addresses how to quickly refund the first user after the second user has initiated an order refund request.
[0045] Specifically, in e-commerce platforms, various promotional activities are currently offered to attract second users to place orders, such as interest-free installment payments. This means that after placing an order, the second user uses a loan from their installment account to pay for the goods, and the merchant needs to pay the interest on the loan on behalf of the second user to achieve interest-free payment. In this case, since the second user does not actually pay for the goods but pays based on the loan from their installment account, after the second user initiates a refund request, it is not necessary to refund the second user; only the loan from the second user in the installment account needs to be cancelled. However, the interest paid by the first user needs to be refunded. Besides the above-mentioned installment payment scenario, there are other scenarios where the first user pays. For example, when the first user issues a discount coupon, the discount amount for the second user is actually paid by the first user. Therefore, after the second user initiates a refund request, the first user also needs to be refunded. It is understood that this embodiment of the invention does not limit the method by which the first user pays for the goods, but only the refund process after payment.
[0046] The following is based on Figure 2 The application scenarios of the present invention will be specifically described using examples, such as... Figure 2As shown, during the order generation stage, the second user and the first user jointly pay to generate the order. During the order processing, upon receiving a refund request initiated by the second user, the server refunds both the second user and the first user based on the refund request. The part handling the second user's refund request is not considered a key aspect of this invention and will not be elaborated upon. The refund processing method provided by this invention refers to the specific process of refunding a portion of the payment made by the first user after receiving a refund request from the second user.
[0047] Order refund requests typically include the order code to be refunded, the specific items to be refunded, the quantity of items to be refunded, the refund time, and the first user corresponding to the refund. Therefore, based on a second user's order refund request, the corresponding first user, order code, and refund information can be directly obtained. The refund information may include: the specific items to be refunded, the quantity of items to be refunded, and the refund time.
[0048] For step S102, if the order code does not exist in the order database, it means the order is not yet completed and may be in the outbound or logistics transportation stage. It should be noted that although the second user initiates a refund request at this time, the goods are still in transit and are at risk of loss or abnormality. Therefore, in existing technology, returns are not possible; the received refund request can only be discarded, and the user is prompted to re-initiate the refund request after the order is completed. However, in this application, to improve the user's refund experience, the order code and refund information are pre-stored in a cache, and a notification message indicating successful processing of the refund request is sent to both the second and first users. This eliminates the need for the second or first user to trigger the refund process repeatedly; instead, the refund can be automatically triggered by monitoring the order's completion status.
[0049] In one optional embodiment, step S102 may specifically include: in response to the order code not existing in the order database, determining the order type of the order based on the order code; if the order type is a preset order type, storing the order code and refund information in a preset cache.
[0050] The order type indicates the promotional activity to which the order belongs. Preset order types may include: interest-free installment payments, instant discounts, etc. Through the above process, the order refund processing flow provided by this embodiment of the invention can be activated during specific promotional activities. For orders where the first user did not participate in payment, no refund is required for the first user.
[0051] In a further optional embodiment, in response to the order completion status being "completed", not only can the refund process be triggered, but the order code also needs to be stored in the order database to update the order database in real time.
[0052] The following is based on Figure 3 and Figure 4 A comparison is made between the conventional order refund process and the refund process implemented in this embodiment of the invention by setting a cache, to illustrate the differences between this invention and the prior art. For example... Figure 3 As shown, in a conventional order refund process, the refund request is initiated only after the order is completed. That is, after the order is completed, the interest-free amount and principal are settled, and the settlement result and the corresponding order data are stored in the order database. Therefore, upon receiving an order refund request, the settlement result can be retrieved from the order database to trigger the refund process for the first user, thus realizing the order refund for the first user. However, if the order is not completed, since the conventional order refund process cannot be triggered, the order refund request is directly discarded, resulting in the inability to promptly refund the first user. In this embodiment of the invention, as... Figure 4 As shown, when no positive data is found in the order database, the order refund request is not discarded. Instead, the order code and refund information corresponding to the order refund request are stored in the cache. After the order is completed, the refund process for the first user in step S104 is retried by searching the cache. In an optional embodiment, after receiving an order refund request, it can be determined whether it is a pre-sales scenario or an after-sales scenario, and the order refund can be processed in the after-sales scenario.
[0053] In an optional embodiment, there may be a situation where a second user wants to request refunds for different items in the order, and therefore submits multiple order refund requests. In this case, step S104 can be as follows: Figure 5 As shown, it includes:
[0054] Step S501: In response to the fact that there are multiple refund information corresponding to the order code, merge the multiple refund information to generate total refund information;
[0055] Step S502: Generate the refund result for the first user based on the total refund information.
[0056] Since refund information includes both the refunded item and its quantity, multiple refund requests submitted for the same order code may result in different refund items and quantities, meaning there may be multiple different refund requests. To maximize refund efficiency, step S501 above merges these multiple refund requests and processes the refund based on the total refund information, generating a supplementary refund result.
[0057] However, in the actual refund process, there may be situations where multiple order refund requests are submitted repeatedly, that is, the refunded goods and the quantity of refunded goods included in multiple order refund requests are actually the same, indicating that the second user has repeatedly performed the operation, resulting in the submission of multiple order refund requests. In an optional embodiment, before the above step S501, it may also include: deduplicating multiple refund information and performing subsequent step S501 processing based on the deduplicated refund information.
[0058] Specifically, the process of generating the refund result in step 104 may also include: assembling and generating a second refund task based on the order code and total refund information; processing the second refund task based on the updated order database to obtain the refund result for the first user.
[0059] The first refund task can be understood as the refund task generated based on the initial order refund request, while the second refund task is initiated again based on the total refund information after the first refund task fails (i.e., the order code and refund information are stored in the cache). For example, with... Figure 6 The process of assembling the second refund task and generating the supplementary refund result will be explained in detail using the example above. Specifically, Figure 6 The process shown is Figure 4 The detailed process of searching the cache and triggering the first user's refund process is only illustrated for cases existing in the cache. For example... Figure 6 As shown, after the second refund task is generated, it is re-executed. Figure 4 The processing flow of the first refund task is to trigger the refund process of the first user again. The specific amount in the second refund task can be generated based on multiple first refund tasks.
[0060] Additionally, the process of generating the first refund task can be as follows: Figure 7 As shown, it includes:
[0061] Step S701: Determine the time when the order refund request was generated;
[0062] Step S702: In response to the time difference between the generation time and the current time reaching a preset time threshold, generate the first refund task for the first user corresponding to the order refund request, and put the first refund task into the message queue.
[0063] Using a message queue to process the first refund task allows for asynchronous processing of multiple first refund tasks. Specifically, the number of transactions per second (TPS) in the message queue can be set according to actual needs, such as 200, to prevent excessive pressure on the refund system that processes subsequent refunds.
[0064] In a further optional embodiment, after generating the refund result for the first user based on the refund information in step S104, the method further includes updating the cache based on the refund result. It is understood that since the cache actually stores the order codes and refund information corresponding to order refund requests that were not processed in a timely manner, it is necessary to update the cache promptly based on the refund result after the refund is completed to avoid duplicate processing. Specifically, in an optional embodiment, in response to the refund result indicating a successful refund, cache data corresponding to one or more refund information items corresponding to the refund result is deleted from the cache. If the refund result indicates a refund failure, step S104 can be repeated to improve the success rate of the refund, or the process can jump to other exception handling procedures for exception handling; this invention does not specifically limit this approach.
[0065] According to the order refund processing method of this invention, a refund can be processed promptly for the first user corresponding to the order refund request based on the second user's order refund request. Specifically, when the order is not completed, the order code and refund information can be stored in a cache to effectively store the order refund request. After the order is completed, the cache can be queried to determine whether to initiate an order refund request when the order is not completed, and the refund result for the first user can be automatically generated based on the refund information.
[0066] Figure 8 This is a schematic diagram of the main modules of an order refund processing device according to an embodiment of the present invention.
[0067] like Figure 8 As shown, the order refund processing device 800 of this embodiment includes:
[0068] The generation module 801 is used to generate a first refund task for the first user corresponding to the order refund request; wherein, the first refund task includes an order code and refund information;
[0069] Storage module 802 is configured to, in response to the order code not existing in the order database, store the order code and the refund information in a cache; wherein, the order database is used to store completed order codes;
[0070] The monitoring module 803 is used to monitor the completion status of the order corresponding to the order code in real time;
[0071] Result module 804 is used to query whether the order code exists in the cache in response to the completion status being updated to completed; and to generate a refund result for the first user based on the refund information in response to the order code existing in the order database.
[0072] In an optional embodiment of the present invention, the storage module 802 is further configured to, in response to the order code not existing in the order database, determine the order type of the order based on the order code; and if the order type is a preset order type, store the order code and the refund information in a preset cache.
[0073] In an optional embodiment of the present invention, the result module 804 is further configured to, in response to the presence of multiple refund information corresponding to the order code, merge the multiple refund information to generate total refund information; and generate a supplementary refund result for the first user based on the total refund information.
[0074] In an optional embodiment of the present invention, the storage module 802 is further configured to, in response to the completion status being completed, store the order code in the order database to update the order database in real time; and, after generating the refund result for the first user based on the refund information, update the cache based on the refund result.
[0075] In an optional embodiment of the present invention, the result module 804 is further configured to assemble and generate a second refund task based on the order code and the total refund information;
[0076] The second refund task is processed based on the updated order database to obtain the refund result for the first user.
[0077] In an optional embodiment of the present invention, the storage module 802 is further configured to, in response to the refund result indicating a successful refund, delete cached data corresponding to one or more refund information items corresponding to the refund result from the cache.
[0078] In an optional embodiment of the present invention, the generation module 801 is further configured to: determine the generation time of the order refund request; in response to the time difference between the generation time and the current time reaching a preset time threshold, generate a first refund task for the first user corresponding to the order refund request, and put the first refund task into a message queue.
[0079] According to an embodiment of the present invention, the order refund processing apparatus can promptly process a refund for the first user corresponding to the order refund request based on the second user's order refund request. Specifically, when the order is not completed, the order refund request can be effectively stored by storing the order code and refund information in a cache. After the order is completed, the cache can be queried to determine whether to initiate an order refund request when the order is not completed, and the refund result for the first user can be automatically generated based on the refund information.
[0080] Figure 9An exemplary system architecture 900 is shown that can be applied to the order refund processing method or the order refund processing apparatus according to embodiments of the present invention.
[0081] like Figure 9 As shown, system architecture 900 may include terminal devices 901, 902, and 903, network 904, and server 905. Network 904 is used as a medium to provide a communication link between terminal devices 901, 902, and 903 and server 905. Network 904 may include various connection types, such as wired or wireless communication links or fiber optic cables, etc.
[0082] Users can use terminal devices 901, 902, and 903 to interact with server 905 via network 904 to receive or send data. Various communication client applications can be installed on terminal devices 901, 902, and 903, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, and social media platforms.
[0083] Terminal devices 901, 902, and 903 can be various electronic devices with displays that support web browsing, including but not limited to smartphones, tablets, laptops, and desktop computers.
[0084] Server 905 can be a server providing various services, such as a back-end management server supporting order refund requests sent by users using terminal devices 901, 902, and 903. The back-end management server can analyze and process the received order refund requests and other data, and feed back the processing results (such as refund results) to the terminal devices.
[0085] It should be noted that the order refund processing method provided in this embodiment of the invention is generally executed by server 905, and correspondingly, the order refund processing device is generally set in server 905.
[0086] It should be understood that Figure 9 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0087] The following is for reference. Figure 10 It shows a schematic diagram of the structure of a computer system 1000 suitable for implementing a terminal device of the present invention. Figure 10 The terminal device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.
[0088] like Figure 10As shown, the computer system 1000 includes a central processing unit (CPU) 1001, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 1002 or programs loaded from storage section 1008 into random access memory (RAM) 1003. The RAM 1003 also stores various programs and data required for the operation of the system 1000. The CPU 1001, ROM 1002, and RAM 1003 are interconnected via a bus 1004. An input / output (I / O) first interface 1005 is also connected to the bus 1004.
[0089] The following components are connected to the I / O first interface 1005: an input section 1006 including a keyboard, mouse, etc.; an output section 1007 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 1008 including a hard disk, etc.; and a communication section 1009 including a network first interface card such as a LAN card, modem, etc. The communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the I / O first interface 1005 as needed. A removable medium 1011, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 1010 as needed so that computer programs read from it can be installed into the storage section 1008 as needed.
[0090] In particular, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 1009, and / or installed from removable medium 1011. When the computer program is executed by central processing unit (CPU) 1001, it performs the functions defined above in the system of this invention.
[0091] It should be noted that the computer-readable medium shown in this invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0092] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0093] The modules described in the embodiments of the present invention can be implemented in software or hardware. The described modules can also be housed in a processor; for example, a processor can be described as including a generation module, a storage module, a listening module, and a result module. The names of these modules do not necessarily limit the module itself; for example, the generation module can also be described as "a module that generates a first refund task for a first user corresponding to an order refund request."
[0094] In another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs, which, when executed by the device, cause the device to include: generating a first refund task for a first user corresponding to an order refund request; wherein the first refund task includes an order code and refund information; in response to the order code not existing in the order database, storing the order code and the refund information in a cache; wherein the order database is used to store completed order codes; monitoring the completion status of the order corresponding to the order code in real time; in response to the completion status being updated to completed, querying whether the order code exists in the cache; and in response to the order code existing in the order database, generating a refund result for the first user based on the refund information.
[0095] According to the technical solution of the present invention, when an order is not completed, the order code and refund information can be stored in a cache to effectively store the order refund request. After the order is completed, the cache can be queried to determine whether an order refund request was initiated when the order was not completed, and the refund result for the first user can be automatically generated based on the refund information, eliminating the need for the first user to actively initiate the refund process.
[0096] 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 occur depending on 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 method for processing order refunds, characterized in that, include: Generate a first refund task for the first user corresponding to the order refund request; wherein, the first refund task includes the order code and refund information; In response to the order code not existing in the order database, the order code and the refund information are stored in the cache accordingly; wherein, the order database is used to store completed order codes; Monitor the completion status of the order corresponding to the order code in real time; In response to the completion status being updated to "completed", the system checks whether the order code exists in the cache; in response to the order code existing in the order database, the system generates a refund result for the first user based on the refund information.
2. The method according to claim 1, characterized in that, The step of responding to the order code not existing in the order database by storing the order code and the refund information in a preset cache includes: In response to the order code not existing in the order database, the order type of the order is determined based on the order code; If the order type is a preset order type, the order code and the refund information are stored in a preset cache.
3. The method according to claim 1, characterized in that, The step of generating the refund result for the first user based on the refund information includes: In response to the presence of multiple refund information corresponding to the order code, the multiple refund information are merged to generate total refund information; The refund result for the first user is generated based on the total refund information.
4. The method according to claim 1, characterized in that, In response to the completion status being "completed", the method further includes: storing the order code in the order database to update the order database in real time; Furthermore, after generating the refund result for the first user based on the refund information, the method further includes: updating the cache based on the refund result.
5. The method according to claim 4, characterized in that, The step of generating the refund result for the first user based on the total refund information includes: Based on the order code and the total refund information, assemble and generate a second refund task; The second refund task is processed based on the updated order database to obtain the refund result for the first user.
6. The method according to claim 4, characterized in that, The step of updating the cache based on the refund result includes: In response to the refund result indicating a successful refund, cached data corresponding to one or more refund information items associated with the refund result is deleted from the cache.
7. The method according to claim 1, characterized in that, The generation of the first refund task for the first user corresponding to the order refund request includes: Determine the time when the order refund request was generated; In response to the time difference between the generation time and the current time reaching a preset time threshold, a first refund task corresponding to the first user of the order refund request is generated, and the first refund task is placed in the message queue.
8. An order refund processing device, characterized in that, include: A generation module is used to generate a first refund task for the first user corresponding to the order refund request; wherein, the first refund task includes an order code and refund information; A storage module is configured to, in response to the order code not existing in the order database, store the order code and the refund information in a cache; wherein, the order database is used to store completed order codes; The monitoring module is used to monitor the completion status of the order corresponding to the order code in real time. The result module is used to query whether the order code exists in the cache in response to the completion status being updated to "completed"; and to generate a refund result for the first user based on the refund information in response to the order code existing in the order database.
9. An electronic device for processing order refunds, characterized in that, include: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-7.
10. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-7.
11. A computer program product comprising a computer program that, when executed by a processor, implements the method as described in any one of claims 1-7.