Order management method, system and equipment based on delay queue and medium
By adopting a delay queue-based order management method in the e-commerce system, the problems of order delay and order drops are solved, and the order process is automated and optimized, and the system performance and reliability are improved.
Patent Information
- Application Number
- CN202411434463.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2025-02-11
AI Technical Summary
In an e-commerce environment, the many-to-many communication model of third-party payment and logistics platforms leads to complex configuration and maintenance challenges, and network fluctuations and system failures often lead to order delays or order drops, affecting user experience and merchant credibility.
Using the order management method based on the delay queue, the merchant platform generates delay messages and deposits them into the delay queue, including payment period. When the payment period expires, the system obtains interface information from the event address book, notifies the merchant platform to check the order payment status, and conducts status query and delivery operations through the interfaces of the third-party payment platform and logistics platform.
Automatically process orders through delay queue technology, reduce the need for manual intervention and real-time inspections, optimize order processing processes, improve system performance and response speed, reduce configuration and maintenance costs, and enhance system flexibility and reliability.
Smart Images

Figure CN119417556A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet order management, and in particular to an order management method, system, device and medium based on a delay queue. Background Art
[0002] With the booming development of the e-commerce industry, third-party payment channels have become a key force in promoting the growth of online transactions. However, although third-party payment technology provides a convenient and secure payment environment for both parties to the transaction, it still faces many challenges in actual operation. Unforeseen factors such as network fluctuations and system failures often lead to order delays or order drops in the payment process. These problems not only seriously damage the user experience, increase user dissatisfaction and the risk of loss, but also bring unnecessary economic losses and reputation damage to merchants.
[0003] In addition, in the modern e-commerce environment, merchant platforms need to frequently interact with multiple external communication objects (such as third-party payment platforms, logistics service providers, etc.) to complete business processes such as order processing, payment verification, and logistics tracking; however, this many-to-many communication mode is often accompanied by complex configuration and maintenance challenges. Summary of the invention
[0004] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, the present invention proposes an order management method, system, device and medium based on a delay queue.
[0005] In a first aspect, the present application proposes an order management method based on a delay queue, comprising: a merchant platform obtains order information submitted by a user, generates a delay message according to the order information, the delay message includes a payment deadline, and stores the delay message in a delay queue;
[0006] An event address book is constructed based on the merchant platform, the third-party payment platform and the logistics platform. If the payment period of the delayed message expires, the interface address and security credentials of the merchant platform are obtained from the event address book, and a notification is sent to the merchant platform;
[0007] The merchant platform receives the notification, checks the payment status of the order, and if the order is not paid, obtains the interface information of the third-party payment platform from the event address book, and calls the corresponding interface to query the payment status of the order on the third-party payment platform;
[0008] If the payment status returned by the third-party payment platform is paid, the status of the order is updated to paid, and the delivery operation is triggered;
[0009] When executing the delivery operation, the interface address and security credentials of the logistics platform are obtained based on the event address book, and the delivery information is sent to the logistics platform;
[0010] If the logistics platform receives the shipping information, it generates a waybill according to the shipping information and sends the waybill to the merchant platform through an interface.
[0011] Further specifically, in the above technical solution, constructing the event address book includes: obtaining source information of system documents, configuration files and databases;
[0012] Based on the source information, using crawler technology to obtain communication information required by the event address book, the communication information including interface address, protocol type and security credentials;
[0013] Performing natural language processing on the communication information to extract key fields;
[0014] Formatting and standardizing the key fields according to preset rules to unify field names and data formats;
[0015] Verifying the processed communication information to determine whether the interface address and protocol type meet preset specification requirements;
[0016] If the interface address and protocol type do not meet the preset specification requirements, the communication information is marked.
[0017] More specifically, in the above technical solution, a risk assessment is performed based on the security credentials of the communication information, a risk score is calculated according to the complexity and validity period of the security credentials, and the security credentials with a risk score greater than a preset threshold are identified as high-risk credentials;
[0018] Obtain the communication information that fails the verification and the communication information corresponding to the high-risk credentials, and call an interface to perform connectivity and security tests;
[0019] Determining whether the communication information is available according to the results of the connectivity and security tests;
[0020] The communication information that has passed the verification is classified and organized according to the dimensions of system, service and interface, and an event address book document is generated.
[0021] More specifically, in the above technical solution, based on the event address book document, a version number and an update log are set;
[0022] Publishing the event address book document to the collaboration platform and setting access permissions according to the sensitivity of the communication information;
[0023] The collaborative platform provides online editing and message functions.
[0024] More specifically, in the above technical solution, the merchant platform obtains the order information submitted by the user, generates a delayed message according to the order information, the delayed message includes the payment deadline, and stores the delayed message in a delayed queue, specifically including:
[0025] The merchant platform receives the order information submitted by the user through the backend server;
[0026] The back-end server verifies the order information, and after verification, creates an order record in the database;
[0027] Determine the payment period of the order according to business rules;
[0028] Encapsulate the order number and payment deadline into a delayed message object, wherein the delayed message object includes a message type, a message body, and an execution time;
[0029] A delay queue is selected according to the system architecture and performance requirements, and the constructed delay message is sent to the selected delay queue.
[0030] More specifically, in the above technical solution, the merchant platform receives the notification, checks the payment status of the order, and if the order is not paid, obtains the interface information of the third-party payment platform from the event address book, and calls the corresponding interface to query the payment status of the order on the third-party payment platform, specifically including:
[0031] The merchant platform receives the notification, extracts the order number in the notification, and queries the order table to obtain the payment status field;
[0032] If the payment status field is "unpaid", obtain the interface information of the third-party payment platform, assemble the request parameters and sign;
[0033] The merchant platform sends a query request to the third-party payment platform to obtain the payment status;
[0034] If the payment status is "paid", update the corresponding payment status field in the order table and record the payment completion time.
[0035] More specifically, in the above technical solution, when executing the delivery operation, the interface address and security credentials of the logistics platform are obtained based on the event address book, and the delivery information is sent to the logistics platform, which specifically includes:
[0036] Obtain the interface address and security credential information corresponding to the logistics platform in the event address book. If the interface address and security credential information are incomplete, an error message is displayed and the delivery process is terminated.
[0037] If complete, assemble a shipping information data package including recipient information and cargo information according to relevant parameters of the shipping operation;
[0038] The shipping information data packet is encrypted and sent to the logistics platform.
[0039] In a second aspect, the present application proposes an order management system based on a delay queue, comprising:
[0040] First processing module: the merchant platform obtains the order information submitted by the user, generates a delayed message according to the order information, the delayed message includes the payment deadline, and stores the delayed message in a delayed queue;
[0041] The second processing module: construct an event address book based on the merchant platform, the third-party payment platform and the logistics platform. If the payment period of the delayed message expires, the interface address and security credentials of the merchant platform are obtained from the event address book, and a notification is sent to the merchant platform;
[0042] The third processing module: the merchant platform receives the notification, checks the payment status of the order, and if the order is not paid, obtains the interface information of the third-party payment platform from the event address book, and calls the corresponding interface to query the payment status of the order on the third-party payment platform;
[0043] Fourth processing module: if the payment status returned by the third-party payment platform is paid, the status of the order is updated to paid, and the delivery operation is triggered;
[0044] The fifth processing module: when executing the delivery operation, obtaining the interface address and security credentials of the logistics platform based on the event address book, and sending the delivery information to the logistics platform;
[0045] The sixth processing module: if the logistics platform receives the shipping information, it generates a waybill according to the shipping information, and sends the waybill to the merchant platform through an interface.
[0046] In a third aspect, the present application further proposes a terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any of the methods described above when executing the computer program.
[0047] In a fourth aspect, the present application further proposes a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method as described in any one of the above items is implemented.
[0048] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0049] The event address book records key information such as the interface address, protocol type, and security credentials of communication objects such as merchant platforms, third-party payment platforms, and logistics platforms, making it easy for the system to quickly obtain and update; when it is necessary to add new communication objects or modify the configuration of existing objects, it is only necessary to update the event address book without modifying the system code or configuring multiple scattered files, thereby improving the flexibility and maintainability of the system. By centrally managing the configuration information of communication objects, the event address book reduces the redundancy and inconsistency of configuration information and reduces the cost of configuration and maintenance; administrators can uniformly view and manage the configuration information of all communication objects in the event address book, avoiding the tedious process of configuring each system or module one by one.
[0050] Delay queue technology allows the system to temporarily store order information and automatically process it when the set payment deadline arrives, reducing the need for manual intervention and real-time inspection, thereby optimizing the order processing process. Delay queue technology can effectively alleviate the pressure on the system in high-concurrency scenarios. By delaying the processing of some tasks, the system can avoid performance bottlenecks caused by processing too many real-time requests. When the system receives a large number of orders, some order information can be stored in the delay queue to avoid instantaneous high load on the database and server, thereby improving the overall performance and response speed of the system. Delay queue technology also provides a buffer mechanism, which can ensure that order information will not be lost even when unforeseen factors such as network fluctuations and system failures occur, and can continue to be processed after the system is restored. Through the persistent storage and fault-tolerant mechanism of the delay queue, the system can better cope with various abnormal situations and ensure the integrity and reliability of order processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0052] Figure 1 It is a flowchart of an order management method based on a delay queue provided by an embodiment of the present invention;
[0053] Figure 2 It is a structural diagram of an order management system based on a delay queue provided by an embodiment of the present invention;
[0054] Figure 3 It is a schematic diagram of the structure of the terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0055] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0056] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0057] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0058] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0059] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0060] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0061] See also Figure 1The present application proposes an order management method based on a delay queue, including: S101 the merchant platform obtains the order information submitted by the user, generates a delay message according to the order information, the delay message includes a payment deadline, and stores the delay message in a delay queue; S102 an event address book is constructed based on the merchant platform, the third-party payment platform and the logistics platform. If the payment deadline of the delay message expires, the interface address and security credentials of the merchant platform are obtained from the event address book, and a notification is sent to the merchant platform; S103 the merchant platform receives the notification, checks the payment status of the order, and if the order is not paid, then The interface information of the third-party payment platform is obtained from the event address book, and the corresponding interface is called to query the payment status of the order on the third-party payment platform; S104 if the payment status returned by the third-party payment platform is paid, the status of the order is updated to paid, and the shipping operation is triggered; S105 when executing the shipping operation, the interface address and security credentials of the logistics platform are obtained based on the event address book, and the shipping information is sent to the logistics platform; S106 if the logistics platform receives the shipping information, a waybill is generated according to the shipping information, and the waybill is sent to the merchant platform through the interface.
[0062] Optionally, after receiving the waybill number, the merchant platform updates the status of the order to shipped, notifies the user via SMS or push, and displays the waybill number on the user's order details page.
[0063] When processing delayed messages and order status checks, it may be necessary to communicate with multiple platforms, such as third-party payment platforms and logistics platforms. In order to facilitate the management and maintenance of these communication objects, this application has established an event address book to record the interface address, protocol type, security credentials and other information of each platform. Through the event address book, you can quickly obtain the information of the communication object, reduce the workload of configuration and maintenance, and improve the flexibility and maintainability of the system.
[0064] Specifically, after receiving the user's order request, the merchant platform uses the MD5 algorithm to generate a message digest as the unique identifier of the delayed message based on the order amount, payment period and other information, sets the delay time to 15 minutes, and stores the message in the ordered set of Redis. The delay queue uses the time wheel algorithm to scan the ordered set every second. If the message delay time expires, the merchant's order query interface is requested through the HTTP protocol POST, passing the order number and signature and other parameters. After receiving the notification, the merchant platform first verifies the signature and then checks the order status in the MySQL database. If it is not paid, it calls Alipay's order query API and uses the RSA algorithm signature. If the transaction status returned by Alipay is TRADE_SUCCESS, the order status is updated to paid, and the logistics platform interface is called to create a delivery note, passing the order information and logistics company code in JSON format. The logistics platform generates a waybill number and returns it to the merchant platform. The merchant platform updates the order logistics information and notifies the user through the Alibaba Cloud SMS service. The SMS content contains the order number, waybill number, etc., and the serial number is returned after success.
[0065] In some embodiments, when building an event address book, it is necessary to collect and organize the communication information of each platform, including interface addresses, protocol types, security credentials, etc. This information can be obtained from system documents, configuration files, databases and other sources through automated tools or manual methods, and formatted and standardized. During the initialization process, the communication information also needs to be verified and tested to ensure the accuracy and validity of the information. After the initialization is completed, complete documents and instructions should be established to facilitate subsequent maintenance and updates.
[0066] Obtain source information of system documents, configuration files, and databases; for the source information, use crawler technology to automatically obtain the communication information required for the event address book, the communication information including interface address, protocol type, and security credentials; perform natural language processing on the communication information and extract key fields; format and standardize the key fields according to preset rules to unify field names and data formats; use regular expressions to verify the processed communication information to determine whether the interface address and protocol type meet the preset specification requirements; if the interface address and protocol type do not meet the preset specification requirements, mark the communication information.
[0067] Optionally, a machine learning algorithm is used to perform risk assessment on the security credentials of the communication information, a risk score is calculated according to the complexity and validity period of the security credentials, and the security credentials with a risk score greater than a preset threshold are identified as high-risk credentials; the communication information that fails the verification and the communication information corresponding to the high-risk credentials are obtained, and an interface is called to perform connectivity and security tests; based on the results of the connectivity and security tests, it is determined whether the communication information is available; the communication information that passes the verification is classified and sorted according to the dimensions of system, service, and interface, and an event address book document is generated;
[0068] For the event address book document, set a version number and update log; publish the event address book document to the collaborative platform, and set access permissions based on the sensitivity of the communication information; open online editing and message functions on the collaborative platform to achieve continuous maintenance and updating of the event address book document.
[0069] Specifically, the crawler script is written through Python's Scrapy framework, and the seed URL is set to the GitLab warehouse address where the system documents and configuration files are located and the database connection string. XPath parsing is used to obtain information such as interface address, protocol type, and security credentials. The BERT pre-trained model is used to perform named entity recognition on the extracted text content to extract key fields. According to the preset regular expression rules, the fields are formatted, such as unifying "http" and "https" into "HTTP", unifying "application / json" and "application / xml" into "APPLICATION / JSON", etc. The Python re module is used to verify the processed communication information to determine whether the interface address starts with "http" or "https", whether the protocol type is "HTTP", "HTTPS", "TCP", "UDP" and other common types, and mark the fields that do not meet the specifications. The LightGBM algorithm is used to model 10 features of security credentials, such as complexity, validity period, and frequency of use. A risk assessment model with an average AUC of 95 is obtained through 5-fold cross validation, and credentials with a risk score greater than 7 are marked as high risk. For communication information that fails verification and has a risk assessment score greater than 8, call Postman's API for automated testing and set the request timeout to 5 seconds. If the request fails, mark the communication information as unavailable. Classify the communication information that has passed verification according to the three dimensions of system, service, and interface, generate an event address book document in Markdown format, set the version number to "v0", and set the update log to "initialization version". Upload the generated event address book document to the designated space of the Confluence collaboration platform, and set the space access rights according to the confidentiality level of the system, such as "internal" level systems only allow internal employees to access, "confidential" level systems only allow project team members to access, etc. At the same time, open Confluence's online editing and commenting functions to facilitate system operation and maintenance personnel to continuously update and optimize the address book content.
[0070] Optionally, the communication information that has passed the verification is classified and sorted according to the dimensions of system, service and interface, including:
[0071] First, it is necessary to clarify the definitions of systems, services, and interfaces, as well as the hierarchical relationship between them. Generally, system: is the highest level of classification, representing a complete application or a set of related functions. Service: provides a set of relatively independent and functionally related interfaces within the system. A system can contain multiple services. Interface: is the specific communication point exposed by the service, defining the way to interact with the outside world. A service can contain multiple interfaces.
[0072] Secondly, create a hierarchical classification structure in the electronic document. This can be a tree diagram or a simple nested list. Top-level list: list all systems; middle-level list: under each system, list all services contained in the system; bottom-level list: under each service, list all interfaces provided by the service.
[0073] Furthermore, the communication information that has passed the verification is filled into the corresponding classification. For each communication information, it is necessary to determine which system, service, and interface it belongs to. For example, system allocation: classify the communication information into the corresponding system according to its context or identification (such as URL, keywords in the interface name); service allocation: further analyze the function or purpose of the communication information and classify it into the specific service under the corresponding system; interface allocation: finally, determine which specific interface the communication information represents and place it in the interface list under the corresponding service.
[0074] Next, after filling in all the information, carefully check whether each category is correct to ensure that there are no missing or misclassified items. If any problems are found, adjust the classification structure or the attribution of communication information in a timely manner.
[0075] Finally, organize the classification structure into an easy-to-read document format, which can be a Word document, Markdown file, or any other format. It should be noted that each system, service, and interface in the document must have a clear title or title number so that the required information can be found quickly.
[0076] In some embodiments, the merchant platform obtains the order information submitted by the user, generates a delayed message according to the order information, the delayed message includes the payment deadline, and stores the delayed message in a delayed queue. Specifically, it includes:
[0077] The user fills in the order information through the web page or mobile application, including product details, quantity, delivery address, etc., and submits the order. The backend server of the merchant platform receives the order data submitted by the user, usually through HTTP POST request; the backend verifies the received order data to ensure the integrity and validity of the data (such as product inventory, user payment ability, etc.). After the verification, the order record is created in the database and a unique order number is generated; according to the business rules (such as the default payment period, promotion period, etc.), the payment period of the order is determined, and the order number, payment period and other information are encapsulated into a delayed message object. This object usually contains necessary metadata, such as message type, message body (order details), execution time (specific time point of the payment period), etc.; according to the system architecture and performance requirements, select the appropriate delay queue technology, such as RabbitMQ's Delayed Message Plugin, Kafka combined with timestamps and scheduled tasks, Redis's Sorted Set, etc., and send the constructed delayed message to the selected delay queue. When sending, you need to specify the delay time of the message (that is, the time point of the payment deadline minus the current time); the delay queue system sorts and manages the messages according to the delay time to ensure that the messages are processed at the specified time. When the delay time of the message is reached, the delay queue sends the message to the consumer (which may be another service or component of the merchant platform).
[0078] Combining delayed messages and delayed queue technology to process order information can significantly improve the reliability and flexibility of the system. By decoupling the order processing process and optimizing resource utilization, it ensures that subsequent processing can be accurately performed even under high load or partial system failure. This mechanism not only enhances the user experience and promotes timely payment by users through accurate payment deadline reminders, but also improves business flexibility and quickly adapts to different business scenarios and needs.
[0079] In some embodiments, the merchant platform receives the notification, checks the payment status of the order, and if the order is not paid, obtains the interface information of the third-party payment platform from the event address book, and calls the corresponding interface to query the payment status of the order on the third-party payment platform, specifically including:
[0080] Receive payment status notification, extract the order number in the notification, query the order table to obtain the payment status field; if the payment status field is "unpaid", obtain the interface information of the third-party payment platform, assemble the request parameters and sign; send a query request to the third-party payment platform to obtain the payment status; if the payment status is "paid", update the corresponding payment status field in the order table and record the payment completion time.
[0081] Exemplarily, after receiving the payment status notification, the merchant platform extracts key information such as the order number from the notification information. For example, the notification information contains the order number ORDER20230610001, and the merchant platform uses the regular expression "\d{17}" to match the order number. Then, the order table t_order in the MySQL database inside the merchant platform is queried according to the order number to obtain the payment status field pay_status of the order. The order payment status field is judged. If the pay_status value is 0, indicating that it is not paid, the interface information of the third-party payment platform is obtained from the Redis cache, including the interface address, merchant number, signature key, etc. According to the interface specification of the third-party payment platform, the request parameters are assembled, where the merchant number is M202306100001, the order number is ORDER20230610001, and the signature is generated using the MD5 algorithm. Using the HTTPS protocol, a POST request is sent to the order query interface of the third-party payment platform, and the returned JSON format response data is obtained. Parse the JSON data returned by the third-party payment platform and extract the payment status field trade_state. If the payment status is "SUCCESS", indicating that payment has been made, the payment status field pay_status in the internal order table of the merchant platform is updated to 1. If the payment status returned by the third-party payment platform is "NOTPAY", indicating that payment has not been made, a text message is sent to remind the user to complete the payment as soon as possible according to business needs. If payment has not been made after more than 24 hours, the order is automatically canceled and the status field order_status in the order table is updated to -1. Throughout the process, the communication between the merchant platform and the third-party payment platform uses the HTTPS security protocol to ensure the confidentiality and integrity of data transmission. At the same time, the interface information is cached by Redis to improve system performance and response speed. When processing order status changes, the consistency and accuracy of the order status are ensured through the database transaction mechanism.
[0082] In some embodiments, when executing the delivery operation, obtaining the interface address and security credentials of the logistics platform based on the event address book, and sending the delivery information to the logistics platform specifically includes:
[0083] Obtain the interface address and security credential information of the corresponding logistics platform in the pre-configured event address book. If the interface address and security credential information are incomplete, an error message will be prompted and the delivery process will be terminated. If they are complete, assemble a delivery information data packet including necessary data fields of recipient information and cargo information according to relevant parameters of the delivery operation. Encrypt the delivery information data packet through the AES encryption algorithm, and send the encrypted delivery information data packet to the logistics platform through an HTTPS POST request. Receive the response result returned by the logistics platform. If the HTTP status code is not 200, retry a maximum of 3 times with an interval of 5 seconds.
[0084] Exemplarily, when a shipment operation triggers an event, the system will obtain the interface address and security credential information of the corresponding logistics platform from the pre-configured event address book. For example, the system can use a hash table to use the logistics platform name as the key and the interface address and security credential as the value to achieve fast search. If the interface address or security credential obtained is incomplete, the system will prompt "The logistics platform information configuration is incorrect and the shipment cannot be completed" and terminate the shipment process. If the information is complete, the system will assemble a JSON format shipment information data packet based on the relevant parameters of the shipment operation, such as the recipient's name, address, telephone number, cargo name, quantity, weight, etc. Then, the system uses the AES encryption algorithm and the configured security credential as the key to encrypt the shipment information data packet to ensure that the data will not be tampered with or leaked during transmission. After encryption, the system uses the HTTPS protocol to send the encrypted data packet to the interface address provided by the logistics platform through a POST request. If the request fails, the system will automatically retry 3 times, with an interval of 5 seconds each time. If it still fails after 3 retries, the system will prompt "The shipment information failed to be sent, please check the network connection or contact the logistics platform." If the request is successful, the system will parse the JSON format response data returned by the logistics platform, extract the waybill number, estimated arrival time and other information, and update the order status to "shipped". At the same time, it will record the delivery history, including delivery time, logistics platform, waybill number, etc., to complete the entire delivery process.
[0085] See also Figure 2 , the application also proposes an order management system based on a delay queue, including:
[0086] First processing module 201: the merchant platform obtains the order information submitted by the user, generates a delayed message according to the order information, the delayed message includes a payment deadline, and stores the delayed message in a delayed queue;
[0087] Second processing module 202: constructing an event address book based on the merchant platform, the third-party payment platform and the logistics platform, and if the payment period of the delayed message expires, obtaining the interface address and security credentials of the merchant platform from the event address book, and sending a notification to the merchant platform;
[0088] Third processing module 203: the merchant platform receives the notification, checks the payment status of the order, and if the order is not paid, obtains the interface information of the third-party payment platform from the event address book, and calls the corresponding interface to query the payment status of the order on the third-party payment platform;
[0089] Fourth processing module 204: if the payment status returned by the third-party payment platform is paid, then the status of the order is updated to paid, and the delivery operation is triggered;
[0090] Fifth processing module 205: when executing the delivery operation, obtaining the interface address and security credentials of the logistics platform based on the event address book, and sending the delivery information to the logistics platform;
[0091] Sixth processing module 206: If the logistics platform receives the shipping information, it generates a waybill according to the shipping information, and sends the waybill to the merchant platform through an interface.
[0092] It is understandable that if Figure 1 The contents of the order management method embodiment based on the delay queue shown in the embodiment are all applicable to the order management system embodiment based on the delay queue. The functions specifically implemented by the order management system embodiment based on the delay queue are similar to those in the embodiment shown in the embodiment. Figure 1 The order management method embodiment based on the delay queue shown is the same as that shown in FIG. Figure 1 The beneficial effects achieved by the embodiment of the order management method based on the delay queue shown are also the same.
[0093] It should be noted that the information interaction, execution process and other contents between the above-mentioned systems are based on the same concept as the embodiment of the method of the present invention. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0094] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the system can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0095] See also Figure 3 The embodiment of the present invention further provides a computer device 3, comprising: a memory 302 and a processor 301 and a computer program 303 stored in the memory 302. When the computer program 303 is executed on the processor 301, the order management method based on the delay queue as described in any one of the above methods is implemented.
[0096] The computer device 3 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The computer device 3 may include, but is not limited to, a processor 301 and a memory 302. Those skilled in the art will appreciate that Figure 3 It is only an example of computer device 3 and does not constitute a limitation on computer device 3. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components, for example, it may also include input and output devices, network access devices, etc.
[0097] The processor 301 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0098] In some embodiments, the memory 302 may be an internal storage unit of the computer device 3, such as a hard disk or memory of the computer device 3. In other embodiments, the memory 302 may also be an external storage device of the computer device 3, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the computer device 3. Further, the memory 302 may also include both an internal storage unit of the computer device 3 and an external storage device. The memory 302 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program, etc. The memory 302 may also be used to temporarily store data that has been output or is to be output.
[0099] An embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the delay queue-based order management method as described in any one of the above methods is implemented.
[0100] In this embodiment, if the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the camera / terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0101] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. An order management method based on a delay queue, characterized in that: include: The merchant platform obtains the order information submitted by the user, generates a delayed message according to the order information, the delayed message includes a payment deadline, and stores the delayed message in a delayed queue; An event address book is constructed based on the merchant platform, the third-party payment platform and the logistics platform. If the payment period of the delayed message expires, the interface address and security credentials of the merchant platform are obtained from the event address book, and a notification is sent to the merchant platform; The merchant platform receives the notification, checks the payment status of the order, and if the order is not paid, obtains the interface information of the third-party payment platform from the event address book, and calls the corresponding interface to query the payment status of the order on the third-party payment platform; If the payment status returned by the third-party payment platform is paid, the status of the order is updated to paid, and the delivery operation is triggered; When executing the delivery operation, the interface address and security credentials of the logistics platform are obtained based on the event address book, and the delivery information is sent to the logistics platform; If the logistics platform receives the shipping information, it generates a waybill according to the shipping information and sends the waybill to the merchant platform through an interface.
2. The order management method based on the delay queue according to claim 1 is characterized in that: Building an incident address book includes: obtaining source information of system documents, configuration files, and databases; Based on the source information, using crawler technology to obtain communication information required by the event address book, the communication information including interface address, protocol type and security credentials; Performing natural language processing on the communication information to extract key fields; Formatting and standardizing the key fields according to preset rules to unify field names and data formats; Verifying the processed communication information to determine whether the interface address and protocol type meet preset specification requirements; If the interface address and protocol type do not meet the preset specification requirements, the communication information is marked.
3. The order management method based on the delay queue according to claim 2 is characterized in that: Performing risk assessment on the security credentials of the communication information, calculating a risk score according to the complexity and validity period of the security credentials, and identifying the security credentials with a risk score greater than a preset threshold as high-risk credentials; Obtain the communication information that fails the verification and the communication information corresponding to the high-risk credentials, and call an interface to perform connectivity and security tests; Determining whether the communication information is available according to the results of the connectivity and security tests; The communication information that has passed the verification is classified and organized according to the dimensions of system, service and interface, and an event address book document is generated.
4. The order management method based on delay queue according to claim 3 is characterized in that: Based on the event address book document, set a version number and update log; Publishing the event address book document to the collaboration platform and setting access permissions according to the sensitivity of the communication information; The collaborative platform provides online editing and message functions.
5. The order management method based on delay queue according to claim 1 is characterized in that: The merchant platform obtains the order information submitted by the user, generates a delayed message according to the order information, the delayed message includes the payment deadline, and stores the delayed message in a delayed queue, specifically including: The merchant platform receives the order information submitted by the user through the backend server; The back-end server verifies the order information, and after the verification is passed, creates an order record in the database; Determine the payment period of the order according to business rules; Encapsulate the order number and payment deadline into a delayed message object, wherein the delayed message object includes a message type, a message body, and an execution time; A delay queue is selected according to the system architecture and performance requirements, and the constructed delay message is sent to the selected delay queue.
6. The order management method based on delay queue according to claim 1 is characterized in that: The merchant platform receives the notification and checks the payment status of the order. If the order is not paid, the merchant platform obtains the interface information of the third-party payment platform from the event address book and calls the corresponding interface to query the payment status of the order on the third-party payment platform, specifically including: The merchant platform receives the notification, extracts the order number in the notification, and queries the order table to obtain the payment status field; If the payment status field is "unpaid", obtain the interface information of the third-party payment platform, assemble the request parameters and sign; The merchant platform sends a query request to the third-party payment platform to obtain the payment status; If the payment status is "paid", update the corresponding payment status field in the order table and record the payment completion time.
7. The order management method based on delay queue according to claim 6 is characterized in that: When executing the delivery operation, the interface address and security credentials of the logistics platform are obtained based on the event address book, and the delivery information is sent to the logistics platform, specifically including: Obtain the interface address and security credential information corresponding to the logistics platform in the event address book. If the interface address and security credential information are incomplete, an error message is displayed and the delivery process is terminated. If complete, assemble a shipping information data package including recipient information and cargo information according to relevant parameters of the shipping operation; The shipping information data packet is encrypted and sent to the logistics platform.
8. An order management system based on a delay queue, characterized in that: include: First processing module: the merchant platform obtains the order information submitted by the user, generates a delayed message according to the order information, the delayed message includes the payment deadline, and stores the delayed message in a delayed queue; The second processing module: construct an event address book based on the merchant platform, the third-party payment platform and the logistics platform. If the payment period of the delayed message expires, the interface address and security credentials of the merchant platform are obtained from the event address book, and a notification is sent to the merchant platform; The third processing module: the merchant platform receives the notification, checks the payment status of the order, and if the order is not paid, obtains the interface information of the third-party payment platform from the event address book, and calls the corresponding interface to query the payment status of the order on the third-party payment platform; Fourth processing module: if the payment status returned by the third-party payment platform is paid, the status of the order is updated to paid, and the delivery operation is triggered; The fifth processing module: when executing the delivery operation, obtaining the interface address and security credentials of the logistics platform based on the event address book, and sending the delivery information to the logistics platform; The sixth processing module: if the logistics platform receives the shipping information, it generates a waybill according to the shipping information, and sends the waybill to the merchant platform through an interface.
9. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Delay message sending and automatic callback method, system, equipment and medium
CN122395140A