Business order automatic supply chain optimization method

Through subscription publishing mode and interface design optimization, the time delay, hard coding and non-automation problems of order splitting in the optimization of business order automation supply chain is solved, efficient and flexible message processing and system expansion are achieved, and the supply chain is improved. Automation capability.

CN119130583APending Publication Date: 2024-12-13HANGZHOU MIAOYI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411167336.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-23
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

The existing business order diversion logic has defects such as time delay, complex timing task management, hard-coded increase development costs, and non-automated order splitting in the process of automated supply chain optimization.

Method used

Use the subscription publishing mode to receive channel orders through the API gateway, use MQ or Redis to push messages, reduce code coupling, and support one-to-many, many-to-many message communication model, which has strong dynamic scalability, and optimize the interface mode to reduce program coupling, realizing High cohesion and low coupling design.

Benefits of technology

It improves the real-time and flexibility of message processing, reduces program coupling, simplifies code maintenance, supports rapid expansion and independent deployment, and improves system flexibility and readability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119130583A_ABST
    Figure CN119130583A_ABST
Patent Text Reader

Abstract

The invention discloses a business order automatic supply chain optimization method, and the method comprises the following steps: 1, receiving a channel order through an API gateway network interface, pushing a message through a subscription publishing mode, and carrying out the active processing of a consumer, and generating an upstream order; 2, after an upstream order is generated, pushing a message through a subscription publishing mode, and distributing the message to the upstream; and 3, adopting an interface design mode for the channel and the upstream. According to the method, the MQ subscription publishing mode and the redis subscription publishing mode work cooperatively, so that the redis subscription publishing mode can be used for better optimizing the processing result under the condition that the processing volume is not large, and the MQ subscription publishing mode can be used for publishing a large volume of subscription data when the processing volume is large; and moreover, the timeliness of automation is accelerated, the multi-upstream unified processing capability is optimized, hard codes are reduced, and the core order splitting logic can be automated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of supply chain, and in particular to a method for optimizing a business order automated supply chain. Background Art

[0002] Through the interface, the order is collected, the channel order is generated, the channel order is read through the scheduled task, and then the upstream channel is calculated according to the core algorithm, and then the upstream order of the first sequence of upstream is generated, and then the upstream order is read through the scheduled task and distributed to the upstream, and then the result is obtained through the upstream callback or active query scheduled task. If the upstream fails, the next sequence of upstream orders is generated and executed in sequence. Until success or all upstreams fail, the channel order is notified and the processing is completed.

[0003] In the cooperation with the channel side, there are often channels that want to recharge irregular amounts, or recharge large quantities, such as 13 yuan for phone bills, 28 yuan for JD E-cards, etc., or recharge two 28 yuan JD E-cards in one order.

[0004] In addition, there are still some defects in the existing business order diversion logic and the process of optimizing the automated supply chain capabilities, such as:

[0005] 1. In addition, the automation advancement process is basically all executed through scheduled tasks, which has a certain time delay;

[0006] 2. When there are different requirements for processing time, there will be multiple scheduled tasks at the same time, which is difficult to manage;

[0007] 3. When multiple scheduled tasks read orders with different requirements, there will be a lot of hard coding in the system, which will increase the familiarity cost of developers;

[0008] 4. Order splitting needs to be set up in the system in advance, and it is not automatic;

[0009] To this end, we propose a supply chain optimization method for business order automation. Summary of the invention

[0010] The purpose of the present invention is to provide a business order automation supply chain optimization method to solve the problems that need to be solved in the background technology.

[0011] To achieve the above object, the present invention provides the following technical solution: a method for optimizing a business order automated supply chain, the method comprising the following steps:

[0012] Step 1: After receiving the channel order through the API gateway network interface, push the message through the subscription publishing mode, and the consumer will actively process and generate the upstream order;

[0013] Step 2: After the upstream order is generated, push the message through the subscription publishing mode and distribute it to the upstream;

[0014] Step 3: Channels and upstream adopt interface design mode;

[0015] Step 4: Use reflection to load interfaces to reduce the degree of coupling between codes;

[0016] Step 5: The core order splitting logic is automatically split based on existing products.

[0017] There are still some defects in the existing business order diversion logic and the process of optimizing the automated supply chain capabilities, such as: 1. In the process of automated advancement, basically all are executed through scheduled tasks, and there is a certain time delay; 2. When there are different requirements for processing time, there will be multiple scheduled tasks at the same time, which is not easy to manage; 3. When multiple scheduled tasks read orders with different requirements, there will be a large amount of hard coding in the system, which increases the familiarity cost of developers; 4. Order splitting needs to be set up in the system in advance, and it is not automated. The subscription and publishing mode of the present invention is optimized, and the publisher directly returns after sending the message without waiting for the consumer to complete the processing; the decoupling is stronger, there is no direct dependency between the publisher and the subscriber, and the design idea of ​​high cohesion and low coupling is met; and it can support one-to-many and many-to-many message communication models, providing a more flexible message delivery method; publishers and subscribers can be dynamically added or deleted, and the scalability is good. Consumers can receive messages at the first time and process the corresponding messages in time; interface mode optimization: first reduce the coupling of the program, which can decouple to the maximum extent. The so-called decoupling means decoupling, which is opposite to coupling. Coupling is connection. The stronger the coupling, the closer the connection. Close connection in the program is not a good thing, because the closer the connection between two things, the more difficult it is to replace one of them, and the more difficult it is to expand functions and debug. Secondly, it is easy to expand and maintain the program. Sometimes the upstream and channels have different requirements. Each adjustment only needs to deal with their respective interface implementations. For related modules, there is no need to pay attention to the internal implementation of each interface, but only to its input and response. When the interface needs to be adjusted, only the specific implementation needs to be adjusted without affecting each other. Finally, it increases the flexibility of the program, avoids hard-coding inherent logical programs into the code, and the code is concise and readable, which can improve the code reuse rate.

[0018] As a further description of the above technical solution:

[0019] The subscription and publishing mode in step 1 and step 2 adopts the redis subscription and publishing mode.

[0020] As a further description of the above technical solution:

[0021] The subscription and publication mode in step 1 and step 2 adopts the MQ subscription and publication mode.

[0022] As a further description of the above technical solution:

[0023] The business order automation supply chain optimization method is divided into channel services, upstream services, core publishing services and settlement services.

[0024] As a further description of the above technical solution:

[0025] The upstream service is divided into multiple microservices, and the multiple microservices are independent of each other, and the microservices are independently deployed and expanded.

[0026] As a further description of the above technical solution:

[0027] The microservices allow different services to be implemented using different technology stacks, and can be iterated and innovated independently.

[0028] As a further description of the above technical solution:

[0029] The MQ subscription and publishing mode provides a background monitoring platform, on which the details of all created MQ queues can be viewed.

[0030] As a further description of the above technical solution:

[0031] The MQ queue messages in the MQ subscription and publication mode can be monitored and consumed by multiple consumers at the same time, and each MQ queue message can only be consumed once, and the load is adjusted according to the consumer capacity in the MQ subscription and publication mode.

[0032] Compared with the prior art, the present invention has the following beneficial effects:

[0033] 1. First of all, the MQ subscription and publishing mode has advantages over the redis subscription mode in terms of message reliability, consumer load balancing, message persistence, queue monitoring, etc., and when the MQ subscription and publishing mode is not needed, the redis subscription and publishing mode may be more applicable in real-time and certain specific scenarios. In the case of a small volume in the early stage, the redis subscription and publishing mode has better performance. Therefore, the MQ subscription and publishing mode and the redis subscription and publishing mode work together, so that the redis subscription and publishing mode can be used to optimize the processing results when the processing volume is not large, and the MQ subscription and publishing mode can be used to publish and process large volumes of subscription data when the processing volume is large;

[0034] 2. Optimization of subscription and publishing mode

[0035] 1) Good performance. The publisher returns directly after sending the message without waiting for the consumer to complete the processing;

[0036] 2) Strong decoupling, no direct dependency between publishers and subscribers, meeting the design concept of high cohesion and low coupling;

[0037] 3) It can support one-to-many and many-to-many message communication models, providing a more flexible message delivery method;

[0038] 4) Publishers and subscribers can be added or deleted dynamically, with good scalability;

[0039] 5) Timely processing: consumers can receive messages at the first time and process the corresponding messages in time.

[0040] 3. Interface mode optimization

[0041] 1) Reduce the coupling of the program, which can decouple to the maximum extent. Decoupling means uncoupling, which is the opposite of coupling. Coupling is connection. The stronger the coupling, the closer the connection. Tight connection in the program is not a good thing, because the closer the connection between two things, the more difficult it is to replace one of them, and the more difficult it is to expand functions and debug;

[0042] 2) Easy to expand and maintain the program; each upstream and channel sometimes has different requirements. Each adjustment only needs to deal with their respective interface implementations. For related modules, there is no need to pay attention to the internal implementation of each interface, but only to its input and response. When the interface needs to be adjusted, only the specific implementation needs to be adjusted without affecting each other.

[0043] 4. It also increases the flexibility of the program, avoiding hard-coding inherent logic programs into the code. The code is concise and readable, which can improve the code reuse rate. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 It is a schematic diagram of the principle structure of the system of the present invention;

[0045] Figure 2 It is a schematic diagram of the system flow structure of the present invention;

[0046] Figure 3 This is a schematic diagram of the core order splitting logic flow chart structure in Example 4 of the present invention. DETAILED DESCRIPTION

[0047] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0048] Embodiment 1:

[0049] See also Figure 1-Figure 3 The present invention provides a technical solution: a business order automation supply chain optimization method, the business order automation supply chain optimization method comprising the following steps:

[0050] Step 1: After receiving the channel order through the API gateway network interface, push the message through the subscription publishing mode, and the consumer will actively process and generate the upstream order;

[0051] Step 2: After the upstream order is generated, push the message through the subscription publishing mode and distribute it to the upstream;

[0052] Step 3: Channels and upstream adopt interface design mode;

[0053] Step 4: Use reflection to load interfaces to reduce the degree of coupling between codes;

[0054] Step 5: The core order splitting logic is automatically split based on existing products.

[0055] Among them, the subscription and publishing mode in this method is optimized, and the publisher returns directly after sending the message without waiting for the consumer to complete the processing; the decoupling is stronger, and there is no direct dependency between the publisher and the subscriber, which meets the design idea of ​​high cohesion and low coupling; and it can support one-to-many and many-to-many message communication models, providing a more flexible message transmission method; publishers and subscribers can be added or deleted dynamically, with good scalability, and consumers can receive messages at the first time and process the corresponding messages in time; interface mode optimization: first reduce the coupling of the program, which can decouple to the maximum extent. The so-called decoupling means uncoupling, which is the opposite of coupling. Coupling is connection. The stronger the coupling, the closer the connection. Close connection in the program is not a good thing, because the closer the connection between two things, the more difficult it is to replace one of them, and the more difficult it is to expand functions and debug. Secondly, it is easy to expand and maintain the program. Sometimes the upstream and channels have different requirements. Each adjustment only needs to deal with their respective interface implementations. For related modules, there is no need to pay attention to the internal implementation of each interface, but only to its input and response. When the interface needs to be adjusted, only the specific implementation needs to be adjusted without affecting each other. Finally, it increases the flexibility of the program, avoids hard-coding inherent logical programs into the code, and the code is concise and readable, which can improve the code reuse rate.

[0056] Embodiment 2:

[0057] See also Figure 1 , Figure 2 and Figure 3 The subscription and publishing mode in step 1 and step 2 adopts the redis subscription and publishing mode.

[0058] The subscription and publication mode in step 1 and step 2 adopts the MQ subscription and publication mode.

[0059] The MQ subscription and publishing mode provides a background monitoring platform, on which the details of all created MQ queues can be viewed.

[0060] The MQ queue messages in the MQ subscription and publication mode can be monitored and consumed by multiple consumers at the same time, and each MQ queue message can only be consumed once, and the load is adjusted according to the consumer capacity in the MQ subscription and publication mode.

[0061] Among them, the Redis subscription and publishing mode may be more applicable in real-time and certain specific scenarios, because the volume is not large in the early stage, and the Redis subscription and publishing mode has better performance;

[0062] Using the MQ subscription and publishing mode to replace redis subscription and publishing has the following advantages:

[0063] 1) Message reliability: The MQ publish-subscribe model usually has a message confirmation mechanism to ensure that messages can be consumed reliably. Even if a message is published but there is no corresponding consumer, the message will be stored in the queue until a consumer consumes the message. In contrast, the Redis publish-subscribe model has no mechanism to ensure message reliability. If a message is published but there is no subscriber, the message will be lost and will not be stored in memory.

[0064] 2) Consumer load balancing: MQ queues can be monitored and consumed by multiple consumers at the same time, and each message can only be consumed once. This mechanism can adjust the load according to the consumer's consumption capacity and achieve more efficient resource utilization. Although the Redis subscription and publishing mode also supports multiple clients subscribing to the same channel, it may not be as flexible and efficient as the MQ subscription and publishing mode in terms of load balancing and message distribution;

[0065] 3) Message persistence: The MQ subscription and publishing mode supports message persistence, which means that even if the system crashes or restarts, the message will not be lost. Each message can be chosen to be persistent. This persistence has a smaller granularity and is more flexible. The Redis subscription and publishing mode focuses mainly on real-time performance, and message persistence may not be its main consideration. In addition, publishers and subscribers can be added or deleted dynamically, and the scalability is good.

[0066] 4) Queue monitoring: The MQ subscription and publishing mode usually provides a background monitoring platform, where you can see the details of all created queues, which is convenient for management and maintenance. However, the Redis subscription and publishing mode does not have a dedicated monitoring platform to monitor the status of subscription channels and messages.

[0067] 5) Performance: When publishing messages, when the data is small, the performance of the Redis subscription publishing mode may be higher than that of the MQ subscription publishing mode. However, when the data size exceeds a certain threshold (such as 10K), the performance of the Redis subscription publishing mode may decrease. Therefore, when choosing between the MQ subscription publishing mode and the Redis subscription publishing mode, it is necessary to weigh the actual data size and performance requirements, so as to synchronously combine the MQ subscription publishing mode and the Redis subscription publishing mode, and use multiple subscription information to publish.

[0068] Embodiment three:

[0069] See also Figure 1 and Figure 2 , the business order automation supply chain optimization method is divided into channel services, upstream services, core publishing services and settlement services.

[0070] The upstream service is divided into multiple microservices, and the multiple microservices are independent of each other, and the microservices are independently deployed and expanded.

[0071] The microservices allow different services to be implemented using different technology stacks, and can be iterated and innovated independently.

[0072] Among them, the business order automation supply chain optimization method has the following advantages:

[0073] 1) Independent deployment and expansion of services: Each microservice is independent and can be deployed and expanded independently, which means that elastic scaling can be performed according to the actual needs of each service, improving the flexibility and response speed of the system and improving resource utilization;

[0074] 2) Technology stack flexibility: Microservices allow the use of different technology stacks to implement different services. For services with mature capabilities in the market, such as settlement, services can be purchased directly, which can avoid some development workload and reduce costs.

[0075] 3) Fault isolation: Since each microservice is independent, the failure of one service will not affect the normal operation of other services. This fault isolation feature makes the system more robust and reliable;

[0076] 4) Rapid iteration and innovation: Since each microservice is independent, it can be iterated and innovated independently, without the need to consider whether the channel adjustment will affect the core distribution and settlement capabilities.

[0077] 5) Team professionalism: The microservice design pattern splits the system into multiple small services, allowing the team to focus more on the development and maintenance of specific services, which helps improve the team's professionalism in each business.

[0078] Embodiment 4:

[0079] See also Figure 3 , the core order splitting logic in step 5 is automatically split based on existing products;

[0080] For example, the product that needs to be split is E-card 28 yuan;

[0081] Step A1: First find products with a face value less than 28 yuan, such as the following Figure 3 The products of 20 yuan, 10 yuan, 5 yuan, 3 yuan and 1 yuan;

[0082] Step A2: Select the product with the largest face value among the products, such as Figure 3 Select 20 yuan;

[0083] Step A3: Calculate 28-20=8, and then return the remaining 8 yuan to be recharged;

[0084] Step A4: Based on 8 yuan, select all products with a face value less than 8 yuan and form a new queue;

[0085] Step A5: Repeat steps A1 to A4 with 8 yuan until the remaining denomination is 0, or when there is no member in the new queue, the balance is 0 and the split is considered complete. If the balance is greater than 0 and there is no member in the queue, it is considered that the first item is 20 yuan and cannot be split completely, and 20 yuan cannot be selected to start recharging. Therefore, 20 yuan is removed from the queue, and steps A1 to A5 are repeated with 28 yuan, 10 yuan, 5 yuan, 3 yuan and 1 yuan in the queue to complete the automatic splitting of the order product.

[0086] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A business order automation supply chain optimization method, Features: The business order automation supply chain optimization method comprises the following steps: Step 1: After receiving the channel order through the API gateway network interface, push the message through the subscription publishing mode, and the consumer will actively process and generate the upstream order; Step 2: After the upstream order is generated, push the message through the subscription publishing mode and distribute it to the upstream; Step 3: Channels and upstream adopt interface design mode; Step 4: Use reflection to load interfaces to reduce the degree of coupling between codes; Step 5: The core order splitting logic is automatically split based on existing products.

2. A method for optimizing business order automation supply chain according to claim 1, Features: The subscription and publishing mode in step 1 and step 2 adopts the redis subscription and publishing mode.

3. A method for optimizing business order automation supply chain according to claim 1, Features: The subscription and publication mode in step 1 and step 2 adopts the MQ subscription and publication mode.

4. A business order automation supply chain optimization method according to claims 2 and 3, Features: The business order automation supply chain optimization method is divided into channel services, upstream services, core publishing services and settlement services.

5. A method for optimizing business order automation supply chain according to claim 3, Features: The upstream service is divided into multiple microservices, and the multiple microservices are independent of each other, and the microservices are independently deployed and expanded.

6. A method for optimizing business order automation supply chain according to claim 5, Features: The microservices allow different services to be implemented using different technology stacks, and can be iterated and innovated independently.

7. A method for optimizing business order automation supply chain according to claim 3, Features: The MQ subscription and publishing mode provides a background monitoring platform, on which the details of all created MQ queues can be viewed.

8. A method for optimizing business order automation supply chain according to claim 7, Features: The MQ queue messages in the MQ subscription and publication mode can be monitored and consumed by multiple consumers at the same time, and each MQ queue message can only be consumed once, and the load is adjusted according to the consumer capacity in the MQ subscription and publication mode.