Flow control method and device, electronic equipment and storage medium
By implementing the flow control method in the data exchange system, the problem of WMS system handling burst flow pressure during peak periods is solved, and the system stability and processing capacity are ensured through current limiting operations, which improves the business success rate.
Patent Information
- Application Number
- CN202310693967.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-12
- Publication Date
- 2024-12-13
AI Technical Summary
The existing warehouse management system (WMS) software is difficult to handle a large number of sudden business requests in a short period of time, resulting in system stability problems, especially during peak periods such as major promotions, which affects production in warehouses.
By implementing the flow control method in the data exchange system, receiving service requests and writing them to the target message channel, determining whether current limiting operations are required. If necessary, write back the task to be sent back to any message channel until current limiting is not required Operation to ensure the stability of service traffic and the processing capabilities of downstream WMS systems.
It effectively alleviates the pressure of downstream WMS systems for burst traffic processing, improves the success rate of service traffic processing, and ensures the stability of the warehouse management system.
Smart Images

Figure CN119135615A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of warehousing technology, and in particular to a flow control method, device, electronic device and computer storage medium. Background Art
[0002] Currently, there are many commercial warehouse management system (WMS) software to support certain warehouse production scenarios; since WMS software is fixed and suitable, while the production process and managed goods of warehouses vary greatly, it is difficult for existing WMS software to support a variety of production scenarios. To solve the above problems, it is usually necessary to use a combination of multiple versions of WMS software, including self-developed WMS software, outsourced WMS software, third-party WMS software, etc.; however, for each version of WMS, how to ensure the stability of WMS in scenarios with sudden traffic such as receiving a large number of requests in a short period of time is an urgent problem to be solved. Summary of the invention
[0003] Embodiments of the present application provide a flow control method, device, electronic device, and computer storage medium.
[0004] The technical solution of the embodiment of the present application is implemented as follows:
[0005] The present application provides a flow control method, which is applied to a data exchange system including multiple message channels. The method includes:
[0006] receiving a service request, and writing the service request into a target message channel; the target message channel is one of the multiple message channels;
[0007] After receiving an operation of pulling a task to be issued from the target message channel, determining whether it is necessary to perform a flow limiting operation on the task to be issued; the task to be issued includes a business flow corresponding to the business request;
[0008] In the case where a flow limiting operation needs to be performed on the task to be sent, the task to be sent is written back to any message channel, and the previous step is performed again until a flow limiting operation is no longer needed on the task to be sent.
[0009] In some embodiments, the method further comprises:
[0010] When there is no need to perform a flow limiting operation on the task to be issued, a issuing request is sent to the service interface of the WMS to complete the issuing of the task to be issued.
[0011] In some embodiments, before determining whether it is necessary to perform a flow limiting operation on the task to be issued, the method further includes:
[0012] Acquire a plurality of predetermined clusters; each cluster includes a plurality of warehouses, each warehouse has a corresponding warehouse identifier, and the warehouse identifier includes a warehouse code and a business type;
[0013] Receiving a current limiting threshold set for each cluster;
[0014] Associating the warehouse identifier of each warehouse in each cluster with the current limiting threshold to obtain an association relationship;
[0015] The association relationship is saved in a configuration library.
[0016] In some embodiments, obtaining a predetermined plurality of clusters includes:
[0017] Obtain a pre-generated warehouse list; the warehouse list includes multiple warehouses, each warehouse has a corresponding warehouse identifier, and the warehouse identifier also includes a WMS version type and interface information;
[0018] The warehouse identifiers of the plurality of warehouses are traversed, and a plurality of version lists are obtained according to the WMS version type of each traversed warehouse; each version list includes a plurality of warehouses with the same WMS version type;
[0019] The warehouse identifier of each version list in the multiple version lists is traversed, and multiple clusters are obtained according to the interface information of each traversed warehouse; each cluster includes a number of warehouses with the same interface information.
[0020] In some embodiments, the task to be issued includes a service identifier corresponding to the service request, and the service identifier includes at least one of a target service type and a target warehouse code; and the determining whether to perform a flow limiting operation on the task to be issued includes:
[0021] Determine whether a target current limiting threshold corresponding to the service identifier is found in the configuration library;
[0022] When the target current limiting threshold corresponding to the service identifier is found, it is determined whether a current limiting operation needs to be performed on the task to be issued based on the target current limiting threshold.
[0023] In some embodiments, judging whether it is necessary to perform a flow limiting operation on the task to be issued based on the target flow limiting threshold includes:
[0024] Determine the flow value corresponding to the task to be issued; and determine whether it is necessary to perform a flow limiting operation on the task to be issued based on a comparison result between the flow value and the target flow limiting threshold.
[0025] In some embodiments, before writing the service request to the target message channel, the method further includes:
[0026] Obtaining a service identifier corresponding to the service request;
[0027] Searching for target routing information corresponding to the service identifier in a configuration library;
[0028] Based on the found target routing information, a target message channel corresponding to the service identifier is determined.
[0029] The embodiment of the present application provides a flow control device, which is applied to a data exchange system including multiple message channels. The device includes a receiving module, a writing module, a judging module and a flow limiting module, wherein:
[0030] A receiving module, used for receiving a service request;
[0031] A writing module, used for writing the service request into a target message channel; the target channel is one of the multiple message channels;
[0032] A judgment module, configured to judge whether it is necessary to perform a flow limiting operation on the task to be issued after receiving an operation of pulling the task to be issued from the target message channel; the task to be issued includes the business flow corresponding to the business request;
[0033] The current limiting module is used to write the task to be sent back to any message channel when it is necessary to perform a current limiting operation on the task to be sent, and execute the previous step again until it is no longer necessary to perform a current limiting operation on the task to be sent.
[0034] An embodiment of the present application provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the flow control method provided by one or more of the aforementioned technical solutions when executing the program.
[0035] An embodiment of the present application provides a computer storage medium, which stores a computer program; after the computer program is executed, it can implement the flow control method provided by one or more of the above-mentioned technical solutions.
[0036] An embodiment of the present application provides a flow control method, device, electronic device and computer storage medium, the method is applied to a data exchange system including multiple message channels, the method comprising: receiving a business request, writing the business request to a target message channel; the target channel is one of the multiple message channels; after receiving an operation of pulling a task to be sent from the target message channel, determining whether it is necessary to perform a flow limiting operation on the task to be sent; the task to be sent includes the business flow corresponding to the business request; if it is necessary to perform a flow limiting operation on the task to be sent, writing the task to be sent back to any message channel, and executing the previous step again until it is no longer necessary to perform a flow limiting operation on the task to be sent.
[0037] It can be seen that in the embodiment of the present application, since the data exchange system includes multiple message channels, when the data exchange system receives a large number of sudden business requests, each business request can be written into the corresponding message channel to implement diversion control and ensure the stability of business traffic; in addition, if it is determined that a flow limiting operation is required for the task to be issued, the task to be issued will be written back to any message channel. In this way, a certain amount of time can be reserved for the downstream WMS system to process burst traffic, effectively alleviating the processing pressure of the downstream WMS system for burst traffic and improving the success rate of business traffic processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 A flow chart of a flow control method according to an embodiment of the present application;
[0039] Figure 2A A schematic diagram of a data exchange system interacting with an embodiment of the present application;
[0040] Figure 2B A schematic diagram of a structure for interacting with another data exchange system according to an embodiment of the present application;
[0041] Figure 2C A schematic diagram of a WMS version cluster according to an embodiment of the present application;
[0042] Figure 3A A schematic diagram of setting a current limiting threshold according to an embodiment of the present application;
[0043] Figure 3B A schematic diagram of a relationship between a cluster and a warehouse according to an embodiment of the present application;
[0044] Figure 4 A flowchart of determining multiple sets of clusters according to an embodiment of the present application;
[0045] Figure 5 A flow chart of another flow control method according to an embodiment of the present application;
[0046] Figure 6 A schematic diagram of the structure of a flow control device according to an embodiment of the present application;
[0047] Figure 7 A schematic diagram of the structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0048] The technical solution in this application will be clearly and completely described below in conjunction with the drawings in this application.
[0049] The present application will be further described in detail below in conjunction with the accompanying drawings and Examples. It should be understood that the embodiments provided herein are only used to explain the present application and are not intended to limit the present application. In addition, the embodiments provided below are partial embodiments for implementing the present application, rather than providing all embodiments for implementing the present application. In the absence of conflict, the technical solutions recorded in the present application can be implemented in any combination.
[0050] It should be noted that, in the present application, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a method or device including a series of elements includes not only the elements explicitly stated, but also other elements not explicitly listed, or also includes elements inherent to the implementation of the method or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the presence of other related elements (such as steps in the method or units in the device, for example, a unit may be a part of a processor, a part of a program or software, etc.) in the method or device including the element.
[0051] The term "and / or" herein is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C can represent including any one or more elements selected from the set consisting of A, B, and C.
[0052] In the related technology, there are multiple order management systems (OMS) upstream and multiple versions of WMS systems downstream. With the continuous increase in the number of warehouses, the amount of business data reaches tens of millions or even hundreds of millions every day. In order to support so much business data, the WMS system needs to deploy multiple clusters for different versions of the WMS system, and each cluster is used to serve a different number of warehouses. When the big promotion comes, the increase in order flow will put great pressure on the WMS cluster. In extreme cases, it will directly overwhelm the WMS system and affect the normal business production of on-site production personnel. Especially for warehouses with open businesses, the stability of the warehouse system is extremely high. If there is a system problem, it will affect the production in the warehouse and will cause claims. At present, the WMS system has no good solution to control sudden traffic, and sudden traffic can only be resisted. On-site production personnel often report system jams.
[0053] In view of the above technical problems, the following embodiments are proposed.
[0054] In some embodiments of the present application, the flow control method can be implemented using a processor in a flow control device, and the above-mentioned processor can be at least one of an application-specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a CPU, a controller, a microcontroller, and a microprocessor.
[0055] Figure 1 A flow chart of a flow control method according to an embodiment of the present application is shown in FIG. Figure 1 As shown, the process may include:
[0056] Step 100: Receive a service request and write the service request to a target message channel.
[0057] In the embodiment of the present application, the flow control method can be applied to a data exchange system, which may include multiple message channels, and the target message channel is one of the multiple message channels. Here, the number of message channels included in the data exchange system can be set according to actual conditions, and the embodiment of the present application does not limit this.
[0058] For example, the data exchange system is also called a data conversion center, see Figure 2A The data exchange system 11 is located between the upstream system 10 and the downstream WMS system 12 and is used for data interaction with the upstream system 10 and the downstream WMS system 12.
[0059] See also Figure 2B , the upstream system may include OMS, basic data system and procurement system, etc.; the downstream WMS system may include multiple different versions of WMS systems, corresponding Figure 2B For the first version of WMS, the second version of WMS, large-piece WMS and other WMS, N clusters can be deployed for each version of the WMS system, and each cluster is used to serve a different number of warehouses. Taking the first version of WMS as an example, the N clusters deployed in this version system correspond to Figure 2B The first version WMS cluster 1 to the first version WMS cluster N in.
[0060] Figure 2C This is a schematic diagram of a WMS version cluster of an embodiment of the present application, see Figure 2C , respectively showing the different clusters corresponding to the first version WMS, the second version WMS3, the third version WMS and the fourth version WMS, and each set of clusters includes corresponding business receiving capabilities (sales outbound order interface, purchase inbound order interface, internal configuration inbound order interface, etc.).
[0061] It should be noted that different clusters contain different interface information of business receiving capabilities. The data exchange system has no concept of clusters when opening a warehouse, because the cluster of each warehouse will change, and it may also involve the splitting and merging of clusters. Therefore, it is necessary to dynamically integrate multiple warehouses periodically to determine the relationship between each cluster and warehouse. This will be explained in detail later.
[0062] In an embodiment of the present application, a data exchange system receives a business request issued by an upstream system; here, the type of the business request is related to the upstream system. For example, if the business request is issued by the OMS in the upstream system, the business request is an order-related request. If the business request is issued by the procurement system in the upstream system, the business request is a procurement-related request.
[0063] Exemplarily, the data exchange system also includes a receiving service; here, the receiving service may at least include: a HyperText Transfer Protocol (HTTP) receiving service and a Transmission Control Protocol (TCP) receiving service; exemplarily, when the business request is a request based on the HTTP protocol, the business request issued by the upstream system can be received through the HTTP receiving service; when the business request is a request based on the TCP protocol, the business request issued by the upstream system can be received through the TCP receiving service.
[0064] In some embodiments, before writing the business request to the target message channel, the above method may also include: obtaining a business identifier corresponding to the business request; searching for target routing information corresponding to the business identifier in the configuration library; and determining the target message channel corresponding to the business identifier based on the found target routing information.
[0065] In the embodiment of the present application, after the receiving service receives the business request sent by the upstream system, the business request is parsed and processed to obtain the business identifier corresponding to the business request.
[0066] Here, the business identifier may include at least one of a target business type and a target warehouse code; exemplarily, when the business request is an order-related request, the target business type may be a customer outbound delivery note; when the business request is a purchase-related request, the target business type may be a purchase inbound delivery note; the target warehouse code indicates the code of the warehouse corresponding to the business request, which may be represented by at least one of numbers or letters.
[0067] Exemplarily, the configuration library may be located in the cache of the data exchange system, and the configuration library pre-stores the association relationship between the routing information of each message channel in multiple message channels and the corresponding business identifier; after the receiving service obtains the business identifier corresponding to the business request, the target routing information corresponding to the business identifier may be searched in the configuration library; then, based on the found target routing information, the target message channel corresponding to the business identifier is determined to write the business request to the target message channel. Here, the target message channel is used to store business requests, and the type of the target message channel is not limited; for example, it may be a database type, or a message topic type, etc.
[0068] It can be understood that by searching for routing information corresponding to the business identifier in the configuration library, business requests with different warehouse codes and different business types can be written to the corresponding message channels, thereby achieving diversion control of business data and ensuring the stability of business data.
[0069] Step 101: after receiving an operation of pulling a task to be sent from a target message channel, it is determined whether a flow limiting operation needs to be performed on the task to be sent.
[0070] In an embodiment of the present application, the data exchange system also includes a downlink service; after the business request is written into the target message channel according to the above steps, if it is necessary to consume the tasks to be sent in the target message channel, the downlink service can be used to pull the tasks to be sent from the target message channel. At this time, the data exchange system can receive the operation of the downlink service pulling the tasks to be sent from the target message channel; here, the tasks to be sent can include the business traffic and business identifier corresponding to the business request.
[0071] In some embodiments, after receiving an operation to pull a task to be issued from a target message channel, determining whether it is necessary to perform a flow limiting operation on the task to be issued may include: determining whether a target flow limiting threshold corresponding to the business identifier is found in the configuration library; if the target flow limiting threshold corresponding to the business identifier is found, determining whether it is necessary to perform a flow limiting operation on the task to be issued based on the target flow limiting threshold.
[0072] Exemplarily, the configuration library pre-stores the association between different business identifiers and corresponding current limiting thresholds; the data exchange system also includes a current limiting service; after the downlink service obtains the business identifier corresponding to the task to be issued, the business identifier is sent to the current limiting service for current limiting determination, that is, the current limiting service determines whether the target current limiting threshold corresponding to the business identifier is found in the configuration library; if so, based on the target current limiting threshold, it continues to determine whether it is necessary to perform current limiting operations on the task to be issued; if not, it means that it is not necessary to perform current limiting operations on the task to be issued.
[0073] In some embodiments, based on the target current limiting threshold, determining whether current limiting operation is required for the task to be issued may include: determining the flow value corresponding to the task to be issued; and determining whether current limiting operation is required for the task to be issued based on the comparison result between the flow value and the target current limiting threshold.
[0074] Exemplarily, the data exchange system also includes a computing service. After the flow limiting service finds the target flow limiting threshold corresponding to the business identifier, it requests the computing service to calculate the business flow included in the task to be issued, obtains the flow value corresponding to the task to be issued and feeds it back to the flow limiting service; the flow limiting service compares the flow value with the target flow limiting threshold, obtains a comparison result, and feeds back the comparison result to the downlink service; if the comparison result is that the flow value is greater than the target flow limiting threshold, it means that the flow limiting operation needs to be performed on the task to be issued; conversely, if the comparison result is that the flow value is less than or equal to the target flow limiting threshold, it means that the flow limiting operation does not need to be performed on the task to be issued.
[0075] Step 102: When it is necessary to perform a flow control operation on the task to be sent, the task to be sent is written back to any message channel, and the previous step is performed again until it is no longer necessary to perform a flow control operation on the task to be sent.
[0076] Exemplarily, any message channel can be the original target message channel or any other message channel; for example, in the case where the data exchange system includes message channel A, message channel B, message channel C and message channel D, if the target message channel is message channel A, then any message channel can be message channel A or one of message channel B, message channel C and message channel D.
[0077] In an embodiment of the present application, after the task to be dispatched is written back to any message channel, the previous step is executed again, that is, after the operation of the downlink service pulling the task to be dispatched from the message channel is received again, the current limiting service is used to determine whether it is necessary to perform current limiting operations on the task to be dispatched, and then the judgment result is fed back to the downlink service; until it is no longer necessary to perform current limiting operations on the task to be dispatched; the specific implementation has been explained in the above steps and will not be repeated here.
[0078] In some embodiments, the above method may further include: sending a sending request to the service interface of the WMS to complete the sending of the task to be sent, when there is no need to perform a flow limiting operation on the task to be sent.
[0079] Exemplarily, the WMS may be a WMS system of one of the versions included in the downstream WMS system, and the WMS service interface may be a related interface included in the corresponding type cluster in the WMS system of this version, which is responsible for the transmission of business traffic between the downlink service and the corresponding type cluster of the WMS system of this version; here, the cluster type and the service interface may be determined according to the business identifier included in the task to be issued. It can be understood that after the service interface receives the request to issue and completes the issuance of the task to be issued, this process ends.
[0080] The embodiment of the present application provides a flow control method, which is applied to a data exchange system including multiple message channels, and the method includes: receiving a business request, writing the business request to a target message channel; the target channel is one of the message channels among the multiple message channels; after receiving an operation of pulling a task to be issued from the target message channel, determining whether it is necessary to perform a flow limiting operation on the task to be issued; the task to be issued includes the business flow corresponding to the business request; in the case where it is necessary to perform a flow limiting operation on the task to be issued, writing the task to be issued back to any message channel, and executing the previous step again until it is not necessary to perform a flow limiting operation on the task to be issued. It can be seen that in the embodiment of the present application, since the data exchange system includes multiple message channels, when the data exchange system receives a large number of sudden business requests, each business request can be written into the corresponding message channel to realize diversion control and ensure the stability of the business flow; in addition, if it is determined that a flow limiting operation needs to be performed on the task to be issued, the task to be issued is written back to any message channel, in this way, a certain amount of time can be reserved for the downstream WMS system to process the sudden flow, effectively alleviating the processing pressure of the downstream WMS system for the sudden flow, and improving the success rate of business flow processing.
[0081] In some embodiments, before determining whether it is necessary to perform flow limiting operations on the tasks to be issued, the above method may also include: obtaining a predetermined plurality of clusters; receiving flow limiting thresholds set for each cluster; associating the warehouse identifiers of each warehouse in each cluster with the flow limiting thresholds to obtain an association relationship; and saving the association relationship in a configuration library.
[0082] In an embodiment of the present application, each cluster includes several warehouses, which are used to provide services to several warehouses; each warehouse has a corresponding warehouse identifier, and the warehouse identifier may include at least a warehouse code, a business type, a WMS version type, and interface information; it should be noted that the WMS version type and interface information of each warehouse in each cluster are the same.
[0083] Exemplarily, each cluster has a corresponding cluster code and cluster name, and the administrator can set a corresponding current limiting threshold for each cluster, that is, the current limiting thresholds corresponding to each warehouse in the same cluster are the same; in this way, the data exchange system can receive the current limiting threshold set for each cluster; by associating the warehouse identification and current limiting threshold of each warehouse in each cluster, the association relationship can be obtained, and the association relationship can be saved in the configuration library.
[0084] Here, the current limit threshold can be a current limit threshold per minute or per second. Figure 3AFor clusters with cluster code L and cluster name T, the current limit threshold is set to 5000. Here, the values of L and T are both integers greater than 0. If we take every minute as an example, the current limit threshold of 5000 means that the number of business requests received by the cluster per minute should not exceed 5000. Figure 3B , which shows the relationship between clusters and warehouses. It can be seen that the cluster with cluster code L includes warehouse codes of multiple different warehouses (corresponding to T1 to T5 in the figure).
[0085] It can be understood that for multiple predetermined clusters, the configuration library stores the association between the warehouse identification and the flow limiting threshold of each warehouse in each cluster. Since the warehouse identification includes the warehouse code and the business type, the configuration library is equivalent to storing the flow limiting thresholds corresponding to different warehouse codes and business types, that is, the association between different business identifications and corresponding flow limiting thresholds; therefore, after subsequently receiving the operation of pulling the task to be issued from the target message channel, the corresponding target flow limiting threshold can be searched in the configuration library according to the business identification corresponding to the task to be issued, and the flow limiting judgment can be performed. This process has been explained in the above steps and will not be repeated here.
[0086] In some embodiments, obtaining a predetermined plurality of sets of clusters may include: obtaining a pre-generated warehouse list; traversing the warehouse identifiers of a plurality of warehouses, and obtaining a plurality of version lists according to the WMS version type of each traversed warehouse; traversing the warehouse identifiers of each version list in the plurality of version lists, and obtaining a plurality of sets of clusters according to the interface information of each traversed warehouse.
[0087] Here, each version list includes several warehouses with the same WMS version type; each cluster includes several warehouses with the same interface information; wherein the interface information may include interface type, interface method, interface address and other interface-related information. Exemplarily, the interface type may be a message queue (MQ) interface, HTTP interface, JSF interface or data interface.
[0088] Exemplarily, a pre-generated warehouse list may be obtained in a database, and the warehouse list may include multiple warehouses. Here, the multiple warehouses may be all warehouses that can be managed by the downstream WMS system.
[0089] Exemplarily, multiple sets of clusters can be periodically determined based on a set duration; here, there is no limitation on the setting of the set duration, for example, it can be every hour or every day, etc.; in one embodiment, timing can be performed by a timer, and when the timing duration reaches the set duration, the cluster is determined.
[0090] Combine the following Figure 4 , the process of determining multiple sets of clusters is described, and the process may include the following steps:
[0091] Step 200: Get the warehouse list.
[0092] Exemplarily, the warehouse list may be obtained from a database.
[0093] Step 201: Traverse the warehouse list.
[0094] Exemplarily, when the timing duration of the timer reaches the set duration, the warehouse identifiers of multiple warehouses in the warehouse list may be traversed in sequence.
[0095] Step 202: Determine whether there is an untraversed warehouse identifier. If yes, execute step 203 and step 201 in sequence, otherwise execute step 204.
[0096] Exemplarily, each time the warehouse identifiers of multiple warehouses in the warehouse list are traversed, it is determined whether there is an untraversed warehouse identifier.
[0097] Step 203: Add to the version list according to the WMS version type.
[0098] Exemplarily, when there are untraversed warehouse identifiers, the warehouse is added to the version list of the corresponding type according to the WMS version type of the currently traversed warehouse; and step 201 is executed again to continue traversing the warehouse identifiers of the remaining warehouses in the warehouse list until the warehouse identifiers of all warehouses in the warehouse list are traversed. At this time, multiple version lists can be obtained.
[0099] Step 204: Traverse the version list.
[0100] Exemplarily, after the warehouse identifiers of all warehouses in the warehouse list are traversed, the warehouse identifiers of several warehouses in each version list are then traversed.
[0101] Step 205: Determine whether there is an untraversed warehouse identifier. If yes, execute step 206 and step 204 in sequence, otherwise execute step 207.
[0102] Exemplarily, each time the warehouse identifiers of several warehouses in the version list are traversed, it is determined whether there is a warehouse identifier that has not been traversed.
[0103] Step 205: Add to the cluster according to the interface information.
[0104] Exemplarily, in the case where there are untraversed warehouse identifiers, the warehouse is added to the corresponding type of cluster based on the interface information of the currently traversed warehouse; and step 204 is executed again to continue traversing the warehouse identifiers of the remaining warehouses in the version list; it should be noted that after the warehouse identifiers of all warehouses in the current version list are traversed, the next version list is traversed according to the above steps until all version lists are traversed. At this time, multiple sets of clusters can be obtained.
[0105] Step 207: Update the cluster to the database.
[0106] Exemplarily, after all version lists are traversed, the obtained multiple sets of clusters may be updated to the database.
[0107] Step 208: Update the cluster to the cache.
[0108] Exemplarily, after the obtained multiple sets of clusters are updated to the database, the obtained multiple sets of clusters may also be updated to the cache, and the current process ends.
[0109] Here, according to Figure 4 As can be seen from the flow, the cluster determination process mainly includes the following steps: first, the warehouse list is divided according to the WMS version type of the warehouse to obtain various version lists; then, each version list is divided according to the interface information of the warehouse to obtain multiple sets of clusters, and finally the flow control of these clusters is realized.
[0110] In order to better reflect the purpose of the present application, further explanation is given based on the above embodiments of the present application.
[0111] Figure 5 Flow chart of another flow control method according to an embodiment of the present application, such as Figure 5 As shown, the process may include:
[0112] Step 300: Receive a service request.
[0113] Exemplarily, the receiving service receives a business request sent by an upstream system.
[0114] Step 301: Obtain target routing information.
[0115] Exemplarily, after the receiving service receives the service request sent by the upstream system, it obtains the service identifier corresponding to the service request, and searches for the corresponding target routing information in the configuration library according to the service identifier.
[0116] Step 302: Write to the target message channel.
[0117] Exemplarily, the target message channel can be determined based on the target routing information found in the configuration library, and then the service request can be written to the target message channel; here, the target message channel can be one of message channel A, message channel B, message channel C and message channel D.
[0118] Step 303: Pull the tasks to be sent.
[0119] Exemplarily, the tasks to be sent can be pulled from the target message channel through the downlink service.
[0120] Step 304: Current limiting determination.
[0121] Exemplarily, after obtaining the service identifier corresponding to the task to be sent, the downlink service sends the service identifier to the current limiting service for current limiting determination.
[0122] Step 305: Obtain the target current limiting threshold.
[0123] Exemplarily, after obtaining the service identifier, the current limiting service searches for the corresponding target current limiting threshold in the configuration library according to the service identifier.
[0124] Step 306: Obtain flow value.
[0125] Exemplarily, after obtaining the target current limiting threshold, the current limiting service requests the computing service to calculate the business traffic included in the task to be sent, obtains the traffic value corresponding to the task to be sent and feeds it back to the current limiting service. At this time, the current limiting service can obtain the traffic value; then, the current limiting service compares the traffic value with the target current limiting threshold, and feeds back the comparison result to the downlink service.
[0126] Step 307: Business request write-back.
[0127] Exemplarily, if the downlink service determines, based on the comparison result, that a flow limiting operation needs to be performed on the task to be sent, the service request is written back to any message channel.
[0128] Step 308: The service request is issued.
[0129] For example, if the downstream service determines, based on the comparison result, that there is no need to perform a flow limiting operation on the task to be sent, the service request is sent to a cluster of the corresponding type of the downstream WMS system for corresponding service processing.
[0130] It should be noted that step 307 and step 308 are two optional steps.
[0131] It can be seen that when the embodiment of the present application determines that a flow limiting operation needs to be performed on a task to be sent, the task to be sent will be written back to any message channel. In this way, a certain amount of time can be reserved for the downstream WMS system to handle burst traffic, thereby ensuring the stability of the service of the downstream WMS system and reducing the impact on on-site production.
[0132] Figure 6 A schematic diagram of the structure of a flow control device according to an embodiment of the present application is used for Figure 1 The specific implementation of the method, such as Figure 6 As shown, the device includes: a receiving module 400, a writing module 401, a judging module 402 and a current limiting module 403, wherein:
[0133] The receiving module 400 is used to receive a service request;
[0134] A writing module 401 is used to write the service request into a target message channel; the target message channel is one of the multiple message channels;
[0135] The judgment module 402 is used to judge whether it is necessary to perform a flow limiting operation on the task to be issued after receiving the operation of pulling the task to be issued from the target message channel; the task to be issued includes the business flow corresponding to the business request;
[0136] The current limiting module 403 is used to write the task to be sent back to any message channel when a current limiting operation needs to be performed on the task to be sent, and execute the previous step again until the current limiting operation is no longer needed for the task to be sent.
[0137] In some embodiments, the device further includes a sending module, wherein the sending module is configured to:
[0138] When there is no need to perform a flow limiting operation on the task to be issued, a issuing request is sent to the service interface of the WMS to complete the issuing of the task to be issued.
[0139] In some embodiments, the device further comprises a storage module, wherein the storage module is configured to:
[0140] Before determining whether it is necessary to perform a flow limiting operation on the task to be issued, a plurality of predetermined clusters are obtained; each cluster includes a plurality of warehouses, each warehouse has a corresponding warehouse identifier, and the warehouse identifier includes a warehouse code and a business type;
[0141] Receiving a current limiting threshold set for each cluster;
[0142] Associating the warehouse identifier of each warehouse in each cluster with the current limiting threshold to obtain an association relationship;
[0143] The association relationship is saved in a configuration library.
[0144] In some embodiments, the storage module is further used to:
[0145] Obtain a pre-generated warehouse list; the warehouse list includes multiple warehouses, each warehouse has a corresponding warehouse identifier, and the warehouse identifier also includes a WMS version type and interface information;
[0146] The warehouse identifiers of the plurality of warehouses are traversed, and a plurality of version lists are obtained according to the WMS version type of each traversed warehouse; each version list includes a plurality of warehouses with the same WMS version type;
[0147] The warehouse identifier of each version list in the multiple version lists is traversed, and multiple clusters are obtained according to the interface information of each traversed warehouse; each cluster includes a number of warehouses with the same interface information.
[0148] In some embodiments, the task to be issued includes a service identifier corresponding to the service request, and the service identifier includes at least one of a target service type and a target warehouse code; the judgment module 402 is further used to:
[0149] Determine whether a target current limiting threshold corresponding to the service identifier is found in the configuration library;
[0150] When the target current limiting threshold corresponding to the service identifier is found, it is determined whether a current limiting operation needs to be performed on the task to be issued based on the target current limiting threshold.
[0151] In some embodiments, the determination module 402 is further configured to:
[0152] Determine the flow value corresponding to the task to be issued;
[0153] According to the comparison result between the flow value and the target flow limiting threshold, it is determined whether a flow limiting operation needs to be performed on the task to be issued.
[0154] In some embodiments, the apparatus further comprises a determining module, wherein the determining module is configured to:
[0155] Before writing the service request into the target message channel, obtaining a service identifier corresponding to the service request;
[0156] Searching for target routing information corresponding to the service identifier in a configuration library;
[0157] Based on the found target routing information, a target message channel corresponding to the service identifier is determined.
[0158] In actual applications, the above-mentioned receiving module 400, writing module 401, judgment module 402, current limiting module 403, sending module, saving module and determination module can all be implemented by a processor located in an electronic device, and the processor can be at least one of ASIC, DSP, DSPD, PLD, FPGA, CPU, controller, microcontroller, and microprocessor.
[0159] In addition, each functional module in this embodiment can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or software functional modules.
[0160] If the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment is essentially or the part that contributes to the relevant technology or the whole or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of the method of this embodiment. The aforementioned storage medium includes: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, and other media that can store program codes.
[0161] Specifically, the computer program instructions corresponding to a flow control method in this embodiment can be stored on a storage medium such as a CD, a hard disk, or a USB flash drive. When the computer program instructions corresponding to a flow control method in the storage medium are read or executed by an electronic device, any flow control method in the aforementioned embodiments is implemented.
[0162] Based on the same technical concept as the above embodiments, see Figure 7 The embodiment of the present application further provides an electronic device 500, which may include: a memory 501 and a processor 502; wherein,
[0163] Memory 501, used for storing computer programs and data;
[0164] The processor 502 is used to execute the computer program stored in the memory to implement any flow control method of the foregoing embodiments.
[0165] In practical applications, the memory 501 may be a volatile memory, such as RAM; or a non-volatile memory, such as ROM, flash memory, hard disk drive (HDD) or solid-state drive (SSD); or a combination of the above types of memory, and provide instructions and data to the processor 502.
[0166] The processor 502 may be at least one of ASIC, DSP, DSPD, PLD, FPGA, CPU, controller, microcontroller, and microprocessor. It is understandable that for different flow control devices, the electronic device used to implement the processor function may also be other, which is not specifically limited in the embodiments of the present application.
[0167] In some embodiments, the functions or modules included in the device provided in the embodiments of the present application can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments. For the sake of brevity, it will not be repeated here.
[0168] The above description of various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other, and for the sake of brevity, they will not be repeated herein.
[0169] The methods disclosed in the various method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.
[0170] The features disclosed in the various product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.
[0171] The features disclosed in the various method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.
[0172] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of hardware embodiments, software embodiments, or embodiments in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) that contain computer-usable program code.
[0173] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0174] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0175] The above are only preferred embodiments of the present application and are not intended to limit the protection scope of the present application.
Claims
1. A flow control method, characterized in that: Applied to a data exchange system including multiple message channels, the method comprises: receiving a service request, and writing the service request into a target message channel; the target message channel is one of the multiple message channels; After receiving an operation of pulling a task to be issued from the target message channel, determining whether it is necessary to perform a flow limiting operation on the task to be issued; the task to be issued includes a business flow corresponding to the business request; In the case where a flow limiting operation needs to be performed on the task to be sent, the task to be sent is written back to any message channel, and the previous step is performed again until a flow limiting operation is no longer needed on the task to be sent.
2. The method according to claim 1, characterized in that The method further comprises: When there is no need to perform flow limiting operation on the tasks to be issued, a issuing request is sent to the service interface of the warehouse management system WMS to complete the issuing of the tasks to be issued.
3. The method according to claim 1, characterized in that Before determining whether it is necessary to perform a flow limiting operation on the task to be issued, the method further includes: Acquire a plurality of predetermined clusters; each cluster includes a plurality of warehouses, each warehouse has a corresponding warehouse identifier, and the warehouse identifier includes a warehouse code and a business type; Receiving a current limiting threshold set for each cluster; Associating the warehouse identifier of each warehouse in each cluster with the current limiting threshold to obtain an association relationship; The association relationship is stored in a configuration repository.
4. The method according to claim 3, characterized in that The obtaining of a plurality of predetermined clusters includes: Obtain a pre-generated warehouse list; the warehouse list includes multiple warehouses, each warehouse has a corresponding warehouse identifier, and the warehouse identifier also includes a WMS version type and interface information; The warehouse identifiers of the plurality of warehouses are traversed, and a plurality of version lists are obtained according to the WMS version type of each traversed warehouse; each version list includes a plurality of warehouses with the same WMS version type; The warehouse identifier of each version list in the multiple version lists is traversed, and multiple clusters are obtained according to the interface information of each traversed warehouse; each cluster includes a number of warehouses with the same interface information.
5. The method according to claim 3, characterized in that: The task to be issued includes a service identifier corresponding to the service request, and the service identifier includes at least one of a target service type and a target warehouse code; and the determining whether a flow limiting operation needs to be performed on the task to be issued includes: Determine whether a target current limiting threshold corresponding to the service identifier is found in the configuration library; When the target current limiting threshold corresponding to the service identifier is found, it is determined whether a current limiting operation needs to be performed on the task to be issued based on the target current limiting threshold.
6. The method according to claim 5, characterized in that The determining whether it is necessary to perform a flow limiting operation on the task to be issued based on the target flow limiting threshold includes: Determine the flow value corresponding to the task to be issued; According to the comparison result between the flow value and the target flow limiting threshold, it is determined whether a flow limiting operation needs to be performed on the task to be issued.
7. The method according to claim 1, characterized in that Before writing the service request to the target message channel, the method further includes: Obtaining a service identifier corresponding to the service request; Searching for target routing information corresponding to the service identifier in a configuration library; Based on the found target routing information, a target message channel corresponding to the service identifier is determined.
8. A flow control device, characterized in that: Applied to a data exchange system including multiple message channels, the method comprises: A receiving module, used for receiving a service request; A writing module, used for writing the service request into a target message channel; the target channel is one of the multiple message channels; A judgment module, configured to judge whether it is necessary to perform a flow limiting operation on the task to be issued after receiving an operation of pulling the task to be issued from the target message channel; the task to be issued includes the business flow corresponding to the business request; The current limiting module is used to write the task to be sent back to any message channel when it is necessary to perform a current limiting operation on the task to be sent, and execute the previous step again until it is no longer necessary to perform a current limiting operation on the task to be sent.
9. An electronic device, characterized in that: The device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, and the method according to any one of claims 1 to 7 is implemented when the processor executes the program.
10. A computer storage medium having a computer program stored thereon, 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.
