Logistics state updating method and device, computer equipment and readable storage medium
By pre-cacheing logistics messages to the message queue and using its consumption mechanism to update the logistics order status, the problem of high pressure on the express query system is solved, and the efficiency and timeliness of logistics status update are improved.
Patent Information
- Application Number
- CN202411170574.3
- 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
When the order volume is large, the query pressure of the express query system increases, resulting in low logistics status update efficiency and may cause logistics information backlog of logistics orders.
By pre-cache the logistics messages pushed by the express query system to the message queue, use the consumption mechanism of the message queue to obtain the express order number and logistics progress information, update the logistics order status in the logistics micro-server, and send the updated status to the e-commerce Platform, avoid frequent calls to the query interface of the express query system.
It reduces the query pressure of the express query system, improves the efficiency of update of logistics status, ensures timely processing of logistics messages, avoids message backlog, and improves the timeliness of update of logistics status.
Smart Images

Figure CN119127895A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of logistics data processing, and in particular to a logistics status updating method, device, computer equipment and computer-readable storage medium. Background Art
[0002] With the gradual promotion of e-commerce platforms, the number of orders is increasing day by day, and the number of logistics orders is also increasing. At present, the express order number is mainly used to call the query interface of the express query system to query the logistics status of the corresponding order, so as to update the logistics status of the logistics order of the e-commerce platform. However, when the order volume is large, the number of calls to the query interface of the express query system also increases, resulting in greater query pressure on the express query system, which in turn leads to low efficiency in updating the logistics status. Summary of the invention
[0003] The present application provides a logistics status updating method, device, computer equipment and computer-readable storage medium, which can reduce the query pressure of the express query system and improve the updating efficiency of the logistics status.
[0004] In a first aspect, the present application provides a logistics status updating method, the method comprising:
[0005] Consume the logistics message in the message queue, and obtain the first express number and the first logistics progress information corresponding to the current consumption message, wherein the message queue has at least one logistics message pushed by the express query system in a pre-cached state, and the logistics message carries the corresponding express number and the corresponding logistics progress information;
[0006] According to the first express order number and the first logistics progress information, the logistics status of the target logistics order associated with the first express order number in the logistics microservice end is updated to obtain the updated logistics status of the target logistics order;
[0007] The updated logistics status of the target logistics order is sent to the e-commerce platform of the target logistics order.
[0008] In a second aspect, the present application provides a logistics status updating device, the logistics status updating device comprising:
[0009] An acquisition unit is used to consume the logistics message of the message queue, and acquire the first express number corresponding to the current consumption message and the first logistics progress information corresponding to the current consumption message, wherein the message queue is pre-cached with at least one logistics message pushed by the express query system, and the logistics message carries the corresponding express number and the corresponding logistics progress information;
[0010] An updating unit, configured to update the logistics status of the target logistics order associated with the first express number in the logistics microservice end according to the first express number and the first logistics progress information, and obtain the updated logistics status of the target logistics order;
[0011] A sending unit is used to send the updated logistics status of the target logistics order to the e-commerce platform of the target logistics order.
[0012] In a third aspect, the present application also provides a computer device, comprising a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and implement the logistics status update method when executing the computer program.
[0013] In a fourth aspect, the present application also provides a computer-readable storage medium on which a computer program is stored, and the computer program is loaded by a processor to execute the logistics status updating method.
[0014] This application consumes by pre-caching a message queue with at least one logistics message pushed by the express query system, and updates the logistics status of the target logistics order associated with the first express number in the logistics microservice end according to the first express number corresponding to the current consumption message and the first logistics progress information corresponding to the current consumption message, and after obtaining the updated logistics status of the target logistics order, the updated logistics status of the target logistics order is sent to the e-commerce platform of the target logistics order; on the one hand, since there is no need to use the express number to call the query interface of the express query system to query the logistics status of the corresponding order, the problem of increasing the call volume of the query interface of the express query system due to the large number of query orders can be avoided, thereby reducing the query pressure of the express query system and improving the update efficiency of the logistics status. On the other hand, since new logistics messages will be pushed to the message queue in time when there are new logistics messages, according to the fast processing characteristics of the message queue, it will not cause the problem of excessive backlog of logistics messages of logistics orders, thereby also improving the update timeliness of the logistics status to a certain extent. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0016] Figure 1 It is a structural schematic block diagram of a logistics status updating system provided in an embodiment of the present application;
[0017] Figure 2This is a flow chart of a logistics status updating method provided in an embodiment of the present application;
[0018] Figure 3 This is a schematic diagram illustrating the overall process of updating the logistics status in the embodiment of the present application;
[0019] Figure 4 This is a flowchart of an embodiment of step 204 in the embodiment of the present application;
[0020] Figure 5 is another embodiment flow chart of step 204 in the embodiment of the present application;
[0021] Figure 6 It is a schematic diagram of the structure of an embodiment of a logistics status updating device provided in an embodiment of the present application;
[0022] Figure 7 It is a schematic block diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0023] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0024] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.
[0025] In the description of the embodiments of the present application, it should be understood that the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.
[0026] In order to enable any person skilled in the art to implement and use the present application, the following description is provided. In the following description, details are listed for the purpose of explanation. It should be understood that those of ordinary skill in the art can recognize that the present application can also be implemented without using these specific details. In other examples, the known process will not be elaborated in detail to avoid unnecessary details that make the description of the present application embodiment obscure. Therefore, the present application is not intended to be limited to the embodiments shown, but is consistent with the widest range of principles and features disclosed in accordance with the embodiments of the present application.
[0027] Embodiments of the present application provide a logistics status updating method, apparatus, computer equipment, and computer-readable storage medium.
[0028] The execution subject of the logistics status updating method of the embodiment of the present application may be the logistics status updating device provided in the embodiment of the present application, or the computer device provided in the embodiment of the present application, or Figure 1 The logistics microservice end in the logistics status update system shown, wherein the logistics status update device can be implemented in hardware or software.
[0029] Some embodiments of the present application are described in detail below in conjunction with the accompanying drawings. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0030] Figure 1 It is a structural schematic block diagram of a logistics status updating system provided in an embodiment of the present application.
[0031] like Figure 1 As shown, the logistics status update system 100 includes an express query system 101, a logistics microservice end 102 and an e-commerce platform 103.
[0032] Among them, the express query system 101 is used to receive the logistics progress information of the logistics order, and push the progress information and the express order number of the logistics order to the message queue to form the logistics message of the message queue.
[0033] Among them, the logistics microservice end 102 can be used to consume logistics messages in the message queue, update the logistics status of each logistics order in the logistics microservice end; and send the updated logistics status to the e-commerce platform of the logistics order, so that the e-commerce platform can update the logistics status of the corresponding logistics order in time.
[0034] Among them, the e-commerce platform 103 can be, for example, shopping software, shopping mini-programs, etc. The shopping software can be shopping software for physical products (such as daily necessities) or virtual products (such as services); similarly, the shopping mini-program can also be a shopping mini-program for physical products (such as daily necessities) or virtual products (such as services).
[0035] Those skilled in the art will understand that Figure 1 The structure shown in is merely a block diagram of a portion of the structure related to the embodiment of the present application, and does not constitute a limitation on the logistics status update system in the embodiment of the present application.
[0036] The following will Figure 1 The logistics microservice end shown in is used as an example as the execution subject of the logistics status update method, and the logistics status update method provided in the embodiment of the present application is described in detail. For the sake of simplicity and convenience of description, the execution subject will be omitted in the subsequent method embodiments. Figure 1 The scenario is only used to explain the logistics status update method provided in the embodiment of the present application, but does not constitute a limitation on the application scenario of the logistics status update method provided in the embodiment of the present application.
[0037] See also Figure 2 , Figure 2 201 to 203, wherein:
[0038] 201. Consume the logistics message in the message queue, and obtain the first express order number corresponding to the current consumption message and the first logistics progress information corresponding to the current consumption message.
[0039] The message queue pre-buffers at least one logistics message pushed by the express query system, and the logistics message carries the corresponding express order number and the corresponding logistics progress information. A message queue (MQ) is a container for storing messages during the transmission process of the messages.
[0040] Please refer to Figure 3 and Figure 4 In this embodiment, the express query system acts as the message producer of the message queue and the logistics microservice end acts as the message consumer of the message queue; each time a new logistics order arrives at the station, it will be notified to the express query system; after the express query system receives the logistics order arrival notification, it will generate a logistics message for each logistics order and add it to the message queue; thus, at least one logistics message pushed by the express query system can be pre-cached in the message queue.
[0041] The logistics microservice end can consume the message queue to continuously update the logistics status of the logistics order to ensure the timeliness of the update of the logistics status of the logistics order. Figure 3 As shown, the logistics microservice end can be a single consumer thread, that is, the logistics microservice end uses a consumer node to read logistics messages from the message queue for consumption. In other embodiments, such as Figure 4As shown, in order to improve the speed of logistics status update and ensure the timeliness of logistics status update, the logistics microservice end can set up multiple consumption threads, that is, the logistics microservice end uses multiple consumption nodes to read logistics messages from the message queue for consumption. By consuming the logistics messages of the message queue at the same time through multiple consumption nodes, the consumption speed of the logistics messages of the message queue can be improved, thereby improving the overall logistics status update speed.
[0042] Among them, the current consumption message refers to the logistics message currently read by the logistics microservice from the message queue.
[0043] Among them, the first express delivery number is the express delivery number carried by the current consumption message.
[0044] Among them, the logistics progress information is used to indicate the current arrival site, site arrival time and other information of the logistics order.
[0045] Among them, the first logistics progress information is the logistics progress information carried by the current consumption message.
[0046] There are many ways to consume the message queue in step 201, illustratively including:
[0047] (1) The logistics microservice end is a single consumption thread, and the current consumption message can be consumed directly through the consumption node of the logistics microservice end to obtain the first express order number corresponding to the current consumption message and the first logistics progress information corresponding to the current consumption message.
[0048] (2) The logistics microservice end includes multiple consumption threads, that is, multiple consumption nodes consume the logistics messages in the message queue at the same time. At this time, in step 201, an idle consumption node is called to consume the current consumption message in the message queue to obtain the first express order number corresponding to the current consumption message and the first logistics progress information corresponding to the current consumption message.
[0049] Furthermore, in order to ensure that the express query system can push the logistics progress information of the logistics order to the message queue to form the logistics message of the logistics order, the logistics microservice end will also obtain the order information of the target logistics order sent by the e-commerce platform, wherein the order information includes the first express number associated with the target logistics order; and send the order information to the express query system, so that after receiving the first logistics progress information of the first express number, the express query system pushes the first express number and the first logistics progress information to the message queue.
[0050] 202. According to the first express order number and the first logistics progress information, the logistics status of the target logistics order associated with the first express order number in the logistics microservice end is updated to obtain the updated logistics status of the target logistics order.
[0051] In step 202, there are multiple ways to "update the logistics status of the target logistics order corresponding to the express number in the logistics microservice end according to the first express number and the first logistics progress information to obtain the updated logistics status of the target logistics order", which include, for example:
[0052] (1) The logistics data sheets of all logistics orders are recorded in the same logistics record table. In this case, step 202 may include the following steps 2021A to 2022A:
[0053] 2021A. Query the logistics data sheet of the target logistics order associated with the first express number from the logistics record table of the logistics microservice end.
[0054] Among them, the logistics data sheet of the target logistics order is used to record the logistics status of the target logistics order.
[0055] 2022A. Based on the first logistics progress information, the logistics data sheet of the target logistics order in the logistics record table is updated to obtain the updated logistics status of the target logistics order.
[0056] (2) In order to improve the storage and reading efficiency of the logistics data sheet, the logistics data sheets of the logistics orders are recorded in different logistics record tables according to different order creation times of the logistics orders. In this case, step 202 may include the following steps 2021B to 2024B:
[0057] 2021B. Obtain the first creation time of the target logistics order associated with the first express delivery number.
[0058] Among them, the target logistics order refers to the logistics order associated with the first express order number. For example, taking the logistics order as a shopping order on an e-commerce platform as an example, assuming that users 1, 2, and 3 purchase goods 1, goods 2, and goods 3 on the e-commerce platform respectively, the corresponding logistics orders A, logistics order B, and logistics order C are generated respectively, wherein: the shopping order for user 1 to purchase goods 1 on the e-commerce platform is logistics order A, the shopping order for user 2 to purchase goods 2 on the e-commerce platform is logistics order B, and the shopping order for user 3 to purchase goods 3 on the e-commerce platform is logistics order C. The express order numbers corresponding to logistics order A, logistics order B, and logistics order C are A123, B123, and C123 respectively. If the first express order number corresponding to the current consumption message in step 201 is "A123", the target logistics order associated with the first express order number is logistics order A. If the first express order number corresponding to the current consumption message in step 201 is "B123", the target logistics order associated with the first express order number is logistics order B. If the first express order number corresponding to the current consumption message in step 201 is "C123", the target logistics order associated with the first express order number is logistics order C.
[0059] The first creation time refers to the creation time of the target logistics order. For example, assuming that the first express order number corresponding to the current consumption message in step 201 is "A123", the target logistics order associated with the first express order number is logistics order A. If the order time of the goods in logistics order A is 9:00 on January 1, 2023, the first creation time is 9:00 on January 1, 2023.
[0060] 2022B. Based on the first creation time and the record time range of each logistics record table in the logistics microservice end, determine the logistics record table to be checked for the target logistics order.
[0061] Exemplarily, first, based on the first creation time and the record time range of each logistics record table in the logistics microservice end, determine whether there is a record time range in which the first creation time falls in the record time range of each logistics record table; if there is no record time range in which the first creation time falls in the record time range of each logistics record table, create a new logistics record table as the logistics record table to be checked, and determine the record time range of the logistics record table to be checked based on the preset sub-table storage rules, and create a logistics data sheet for the target logistics order in the target logistics record table (the detailed implementation process can refer to the relevant instructions of steps A1 to A4, which will not be repeated here); if there is a record time range in which the first creation time falls in the record time range of each logistics record table, the logistics record table corresponding to the record time range in which the first creation time falls is used as the logistics record table to be checked.
[0062] For example, taking the sub-table storage rule that the logistics data sheets of the same day are stored in the same logistics record table as an example, assuming that the logistics microservice includes 10 logistics record tables, the recording time ranges of logistics record tables 1, 2, 3, ..., 10 are respectively: 0:00-24:00 on January 1, 2023, 0:00-24:00 on January 2, 2023, 0:00-24:00 on January 3, 2023, ..., 0:00-24:00 on January 10, 2023. If the first creation time is 10:00 on January 10, 2023, logistics record table 10 can be used as the logistics record table to be checked for the target logistics order.
[0063] For example, if the first creation time is 10:00 on January 12, 2023, a new logistics record table (such as logistics record table 12) can be created as the logistics record table to be checked for the target logistics order, and based on the preset sub-table storage rules, the record time range of the logistics record table to be checked (12) is determined to be 0:00-24:00 on January 12, 2023.
[0064] 2023B. Based on the first express delivery number, query the logistics data sheet of the target logistics order from the logistics record table to be checked.
[0065] 2024B. Based on the first logistics progress information, the logistics data sheet of the target logistics order in the logistics record table to be checked is updated to obtain the updated logistics status of the target logistics order.
[0066] Exemplarily, in steps 2023B to 2024B, first, it is detected whether there is a logistics data sheet associated with the first express order number in the logistics record table to be checked. If so, the logistics data sheet associated with the first express order number in the logistics record table to be checked is used as the logistics data sheet of the target logistics order; then, based on the first logistics progress information, the logistics data sheet of the target logistics order in the logistics record table to be checked is updated to obtain the updated logistics status of the target logistics order.
[0067] If it does not exist, a new logistics data sheet is created in the logistics record table to be checked as the logistics data sheet of the target logistics order, and the first logistics progress information is added to the new logistics data sheet, so as to update the logistics data sheet of the target logistics order in the logistics record table to be checked and obtain the updated logistics status of the target logistics order.
[0068] Furthermore, after "updating the logistics data sheet of the target logistics order in the logistics record table to be checked based on the first logistics progress information to obtain the updated logistics status of the target logistics order", that is, after the first logistics progress information is successfully updated to the logistics microservice end, that is, after the current consumption message in the message queue is successfully consumed, in order to avoid repeated consumption, the current consumption message is deleted from the message queue. That is, the method also includes: when the current consumption message in the message queue is consumed successfully, sending a success notification to the express query system, so that the express query system deletes the current consumption message from the message queue after receiving the success notification.
[0069] In order to speed up the query speed of the logistics data sheet of the logistics microservice end, that is, the storage speed, the logistics data sheet in the logistics microservice end is stored in a separate table according to the order creation time (for example, the separate table storage rule is that the logistics data sheets of the same day are stored in the same logistics record table; for example, the separate table storage rule is that the logistics data sheets of the same week are stored in the same logistics record table). Exemplarily, the logistics data sheet of the logistics order can be established in the logistics microservice end with reference to the following steps A1 to A4.
[0070] A1. Obtain the second creation time of the logistics order to be recorded.
[0071] The logistics order to be recorded refers to a logistics order for which a corresponding logistics data sheet has not been created in the logistics microservice end. For example, in step 2022B, if the recording time range of each logistics record table does not include the recording time range in which the first creation time falls, the target logistics order can be used as the logistics order to be recorded, and the logistics data sheet of the target logistics order can be created in the logistics microservice end in accordance with steps A1 to A4.
[0072] The second creation time refers to the creation time of the logistics order to be recorded.
[0073] A2. Obtain the recording time range of each logistics record table in the logistics microservice end.
[0074] For example, taking the sub-table storage rule that the logistics data sheets of the same day are stored in the same logistics record table, it is assumed that the logistics microservice includes 10 logistics record tables, and the recording time ranges of logistics record tables 1, 2, 3, ..., 10 are: January 1, 2023 0:00-24:00, January 2, 2023 0:00-24:00, January 3, 2023 0:00-24:00, ..., January 10, 2023 0:00-24:00.
[0075] A3. Based on the second creation time and the recording time range of each logistics record table, and based on each logistics record table of the logistics microservice end, determine the target logistics record table of the logistics order to be recorded.
[0076] Exemplarily, first, based on the second creation time and the record time range of each logistics record table in the logistics microservice end, determine whether there is a record time range in which the second creation time falls within the record time range of each logistics record table; if there is no record time range in which the second creation time falls within the record time range of each logistics record table, create a new logistics record table as the target logistics record table, and determine the record time range of the target logistics record table based on the preset sub-table storage rules; if there is a record time range in which the second creation time falls within the record time range of each logistics record table, the logistics record table corresponding to the record time range in which the second creation time falls is used as the target logistics record table.
[0077] For ease of understanding, the above step A2 example is continued. For example, taking the sub-table storage rule that the logistics data sheets of the same day are stored in the same logistics record table as an example, assuming that the second creation time of the logistics order to be recorded is 9:00 on January 1, 2023, since the second creation time (9:00 on January 1, 2023) falls within the recording time range of logistics record table 1 (such as 0:00-24:00 on January 1, 2023), logistics record table 1 can be used as the target logistics record table for the logistics order to be recorded.
[0078] For another example, assuming that the second creation time of the logistics order to be recorded is 18:00 on January 11, 2023, since the recording time ranges of logistics record tables 1, 2, 3, …, 10 are respectively: 0:00-24:00 on January 1, 2023, 0:00-24:00 on January 2, 2023, 0:00-24:00 on January 3, 2023, …, 0:00-24:00 on January 10, 2023, there is no recording time range falling within the second creation time (18:00 on January 11, 2023) in the recording time range of each logistics record table. Therefore, a new logistics record table (such as logistics record table 11) is created as the target logistics record table for the logistics order to be recorded, and the recording time range of the target logistics record table is determined to be 0:00-24:00 on January 11, 2023 based on the preset sub-table storage rule.
[0079] A4. Create a logistics data sheet for the logistics order to be recorded in the target logistics record table.
[0080] The logistics data sheet is used to record the logistics status of the logistics order. For example, the logistics data sheet of the logistics order to be recorded is used to record the arrival site, arrival time, etc. of the logistics order to be recorded.
[0081] 203. Send the updated logistics status of the target logistics order to the e-commerce platform of the target logistics order.
[0082] Exemplarily, the logistics microservice sends the updated logistics status of the target logistics order to the e-commerce platform of the target logistics order, so that the e-commerce platform updates the logistics status of the target logistics order and maintains the timeliness of the logistics status of the target logistics order in the e-commerce platform.
[0083] Furthermore, in order to reduce data storage space, after the logistics status of the logistics order in the e-commerce platform is updated, the corresponding logistics data sheet in the logistics microservice end can be deleted in time. That is, the method also includes: when the logistics status of the target logistics order in the e-commerce platform is updated, the logistics data sheet of the target logistics order is deleted from the logistics record table to be checked. Among them, the completion of the logistics status update of the logistics order in the e-commerce platform means that the logistics status of the logistics order in the e-commerce platform has been updated to signed for.
[0084] Furthermore, in order to effectively reduce the generation of abnormal logistics orders and to more effectively ensure the accuracy of the logistics status, on the one hand, a repeated subscription mechanism can be used to consume the logistics messages in the message queue. On the other hand, when the logistics status update is abnormal (such as when the number of subscriptions to the current consumption message is greater than the preset number threshold, that is, when the number of consumption failures of the current consumption message is greater than the preset number threshold), the abnormal logistics order can be displayed in the logistics microservice end, and an email can be sent to the relevant person in charge of the abnormal logistics order to handle the abnormal logistics order in a timely manner. For example, when the first logistics progress information fails to be updated to the logistics microservice end, it is determined that the current consumption message consumption has failed, and the current consumption message is consumed again; when the number of consumption failures of the current consumption message is greater than the preset number threshold, the target logistics order is used as an abnormal logistics order; and the abnormal logistics order is displayed in the logistics microservice end. Among them, when the first logistics progress information fails to be updated to the logistics microservice end, that is, the current consumption message in the message queue fails to be consumed.
[0085] Exemplarily, in order to avoid the current consumption message needing to be repeatedly consumed due to some special reasons, and thus re-consuming the current consumption message will cause other logistics messages in the message queue to be not updated in time, "re-consuming the current consumption message" can specifically include: sending a failure notification of the failure of consuming the current consumption message to the express query system, so that the express query system pushes the current consumption message to the message queue again after receiving the failure notification to obtain an updated message queue; consuming the current consumption message in the updated message queue. In this way, when the current consumption message in the message queue is repeatedly subscribed, it will not affect the consumption of other logistics messages in the message queue, thereby improving the update speed of the logistics status while improving the accuracy of the logistics status.
[0086] Furthermore, in order to improve the update speed of the logistics status, the logistics microservice end includes multiple consumption threads (i.e., multiple consumption nodes), wherein the consumption nodes are used to consume the logistics messages in the message queue, on the one hand, in order to avoid the waste of consumption nodes; on the other hand, in order to improve the timeliness of the consumption of logistics messages and to improve the update speed of the logistics status of the logistics orders of the e-commerce platform, the consumption nodes of the logistics microservice end can also be dynamically opened or closed according to the data volume of the logistics messages to be consumed in the message queue. That is, the method can further include: based on the amount of messages to be consumed, the preset maximum allocation of the consumption node, and the preset minimum allocation of the consumption node, determine the maximum node demand of the message queue and the minimum node demand of the message queue; based on the maximum node demand, the minimum node demand, and the node open amount of the logistics microservice end, open or close the consumption node of the logistics microservice end.
[0087] The amount of messages to be consumed refers to the amount of logistics messages to be consumed in the message queue.
[0088] Among them, the minimum node demand refers to the minimum number of consumer nodes required for the amount of messages to be consumed according to the preset maximum allocation of the consumer node. That is: minimum node demand = amount of messages to be consumed / preset maximum allocation. For example, taking the example of each consumer node allocating a maximum of 10 logistics messages, when the amount of messages to be consumed is 100, the minimum number of consumer nodes required for the amount of messages to be consumed (i.e., the minimum node demand) is: 100 / 10=10.
[0089] Among them, the maximum node demand refers to the number of consumer nodes required at most for the amount of messages to be consumed according to the preset minimum allocation of the consumer node. That is: the maximum node demand = the amount of messages to be consumed / the preset minimum allocation. For example, taking the example of allocating at least 5 logistics messages to each consumer node, when the amount of messages to be consumed is 100, the maximum number of consumer nodes required for the amount of messages to be consumed (i.e. the maximum node demand) is: 100 / 5=20.
[0090] Among them, the preset maximum allocation quantity of the consumption node refers to the maximum number of logistics messages in the message queue waiting to be allocated to the consumption node.
[0091] Among them, the preset minimum allocation quantity of the consumption node refers to the minimum number of logistics messages in the message queue waiting to be allocated to the consumption node.
[0092] For example, based on the amount of messages to be consumed (such as 100), the preset maximum allocation amount of the consumption node (such as 10), and the preset minimum allocation amount of the consumption node (such as 5), the maximum node demand of the message queue (such as the maximum node demand = the amount of messages to be consumed / the preset minimum allocation amount = 100 / 5 = 20) and the minimum node demand of the message queue (such as the minimum node demand = the amount of messages to be consumed / the preset maximum allocation amount = 100 / 10 = 10) are determined; based on the maximum node demand, the minimum node demand, and the number of nodes already opened on the logistics microservice end (such as 15), since the number of nodes already opened on the logistics microservice end (such as 15) is greater than the minimum node demand and the number of nodes already opened on the logistics microservice end (such as 15) is less than the maximum node demand, it meets the condition that the minimum node demand ≤ the number of nodes already opened on the logistics microservice end (such as 15) ≤ the maximum node demand (20), so the consumption node remains unchanged.
[0093] For another example, based on the amount of messages to be consumed (such as 100), the preset maximum allocation of the consumer node (such as 10), and the preset minimum allocation of the consumer node (such as 5), the maximum node demand of the message queue (such as the maximum node demand = the amount of messages to be consumed / the preset minimum allocation = 100 / 5 = 20) and the minimum node demand of the message queue (such as the minimum node demand = the amount of messages to be consumed / the preset maximum allocation = 100 / 10 = 10) are determined; based on the maximum node demand, the minimum node demand, and the preset minimum allocation of the consumer node (such as 5), the maximum node demand of the message queue (such as the maximum node demand = the amount of messages to be consumed / the preset maximum allocation = 100 / 10 = 10) is determined. And the number of nodes that have been turned on at the logistics microservice end (such as 23). Since the number of nodes that have been turned on at the logistics microservice end (such as 23)> the maximum node demand (such as 20), it does not meet the minimum node demand (such as 5) ≤ the number of nodes that have been turned on at the logistics microservice end ≤ the maximum node demand (such as 20), and therefore the consumption node at the logistics microservice end is closed, so that the consumption nodes turned on in the logistics microservice end meet the minimum node demand (such as 5) ≤ the number of consumption nodes turned on in the logistics microservice end ≤ the maximum node demand (20), thereby avoiding waste of consumption nodes.
[0094] For another example, based on the amount of messages to be consumed (such as 100), the preset maximum allocation of the consumption node (such as 10), and the preset minimum allocation of the consumption node (such as 5), the maximum node demand of the message queue (such as the maximum node demand = the amount of messages to be consumed / the preset minimum allocation = 100 / 5 = 20) and the minimum node demand of the message queue (such as the minimum node demand = the amount of messages to be consumed / the preset maximum allocation = 100 / 10 = 10) are determined; based on the maximum node demand, the minimum node demand, and the node demand of the logistics microservice end The node has been opened (such as 3). Since the node has been opened (such as 3) of the logistics microservice end is less than the minimum node demand (such as 5), it does not meet the minimum node demand (such as 5) ≤ the node has been opened of the logistics microservice end ≤ the maximum node demand (20). Therefore, the consumption node of the logistics microservice end is opened, so that the consumption node opened in the logistics microservice end meets the minimum node demand (such as 5) ≤ the consumption node opened in the logistics microservice end ≤ the maximum node demand (20), thereby ensuring the timeliness of the consumption of logistics messages and improving the update speed of the logistics status of the logistics orders of the e-commerce platform.
[0095] In order to better understand the embodiments of the present application, the following takes the express query system as the Express 100 system as an example to introduce the detailed process of updating the logistics status. Figure 5 As shown in the figure, the process of updating the logistics status can be specifically as follows:
[0096] 1. The e-commerce platform sends the order information of the logistics order to the logistics microservice end, and the logistics microservice end sends the order information of the logistics order to the Express 100 system, so that after receiving the logistics progress information of the express order number carried in the order information of the logistics order, the Express 100 system pushes the corresponding express order number and the corresponding logistics progress information as a logistics message to the message queue. (Refer to Figure 5 (as shown in the "Logistics arrival", "Notify Express 100 system to update logistics progress", and "Push MQ messages" sections)
[0097] 2. The logistics microservice consumes the logistics messages in the message queue. When the current consumption message is consumed successfully, the logistics status of the target logistics order associated with the first express order number in the logistics microservice is updated to obtain the updated logistics status of the target logistics order. (Refer to Figure 5 (as shown in the "Logistics Microservice End Consumption MQ Message" and "Update Logistics Progress" sections)
[0098] 3. The logistics microservice pushes the updated logistics status of the target logistics order to the e-commerce platform, and pushes the updated logistics status of the target logistics order to the mini program user bound to the target logistics order. (Refer to Figure 5 (as shown in the "Push reminder messages to e-commerce platform and mini program users" section)
[0099] As a result, users and managers of e-commerce platforms (such as merchant managers of logistics orders) do not need to manually enter the express order number in the express query system to query the logistics status of the logistics order. Furthermore, when the logistics order volume is large, there is no need to frequently call the query interface of the express query system to query the logistics status, thereby reducing the frequency of calling the query interface of the express query system and improving the availability of the express query system.
[0100] 4. If the consumption of the current consumption message in step 2 fails, the logistics microservice end sends a failure notification of the failure of the current consumption message to the Express 100 system, so that the Express 100 system will re-push the current consumption message to the message queue after receiving the failure notification, and obtain the updated message queue; thereby re-subscribing to the current consumption message. (Refer to Figure 5 )
[0101] 5. When the number of failed consumption of the current consumption message exceeds the preset number threshold, the target logistics order is regarded as an abnormal logistics order, and the abnormal logistics order is displayed in the logistics microservice end, and an email notification is sent to the relevant person in charge of the abnormal logistics order to handle the abnormal logistics order in time. (Reference Figure 5 (as shown in the "Too many failures", "Generate abnormal logistics orders", "Display abnormal logistics orders and send email notifications" section)
[0102] 6. Furthermore, in order to effectively reduce the generation of abnormal logistics orders, when there are abnormal logistics orders, the management personnel of the e-commerce platform (such as the merchant administrator of the logistics order) can also manually enter the first express number in the Express 100 system, and call the query interface of the Express 100 system to query the logistics progress information corresponding to the first express number; then, the logistics progress information corresponding to the first express number is imported into the logistics microservice end to update the logistics status of the target logistics order in the logistics microservice end, and the updated logistics status of the target logistics order. (Reference Figure 5 (as shown in the "Merchant Administrator", "Manually Import Logistics", "Logistics Microservice Import Tasks", and "Update Logistics Progress" sections)
[0103] From the above content, it can be seen that by consuming the message queue that pre-caches at least one logistics message pushed by the express query system, according to the first express order number corresponding to the current consumption message and the first logistics progress information corresponding to the current consumption message, the logistics status of the target logistics order associated with the first express order number in the logistics microservice end is updated, and after obtaining the updated logistics status of the target logistics order, the updated logistics status of the target logistics order is sent to the e-commerce platform of the target logistics order; on the one hand, since there is no need to use the express order number to call the query interface of the express query system to query the logistics status of the corresponding order, the problem of increasing the call volume of the query interface of the express query system due to the large number of query orders can be avoided, thereby reducing the query pressure of the express query system and improving the update efficiency of the logistics status. On the other hand, since new logistics messages will be pushed to the message queue in time when there are new logistics messages, according to the fast processing characteristics of the message queue, it will not cause the problem of excessive backlog of logistics messages of logistics orders, thereby improving the timeliness of updating the logistics status to a certain extent.
[0104] In addition, in order to better implement the logistics status updating method in the embodiment of the present application, on the basis of the logistics status updating method, a logistics status updating device is also provided in the embodiment of the present application, such as Figure 6 FIG. 1 is a schematic diagram of a structure of a logistics status updating device according to an embodiment of the present application. The logistics status updating device 600 includes:
[0105] The acquisition unit 601 is used to consume the logistics message of the message queue, and obtain the first express number corresponding to the current consumption message and the first logistics progress information corresponding to the current consumption message, wherein the message queue is pre-cached with at least one logistics message pushed by the express query system, and the logistics message carries the corresponding express number and the corresponding logistics progress information;
[0106] An updating unit 602 is used to update the logistics status of the target logistics order associated with the first express number in the logistics microservice end according to the first express number and the first logistics progress information, so as to obtain the updated logistics status of the target logistics order;
[0107] The sending unit 603 is used to send the updated logistics status of the target logistics order to the e-commerce platform of the target logistics order.
[0108] In some embodiments, the updating unit 602 is specifically configured to:
[0109] Obtain the first creation time of the target logistics order associated with the first express delivery number;
[0110] Determine the logistics record table to be checked for the target logistics order based on the first creation time and the record time range of each logistics record table in the logistics microservice end;
[0111] Based on the first express delivery number, querying the logistics data sheet of the target logistics order from the to-be-queried logistics record table;
[0112] Based on the first logistics progress information, the logistics data sheet of the target logistics order in the to-be-checked logistics record table is updated to obtain an updated logistics status of the target logistics order.
[0113] In some embodiments, the logistics status updating device 600 further includes a creation unit (not shown in the figure), and the creation unit is specifically used to:
[0114] Get the second creation time of the logistics order to be recorded;
[0115] Obtain the recording time range of each logistics record table in the logistics microservice end;
[0116] Based on the second creation time and the recording time range of each logistics record table, and based on each logistics record table of the logistics microservice end, determine the target logistics record table of the logistics order to be recorded;
[0117] In the target logistics record table, a logistics data sheet of the logistics order to be recorded is created, wherein the logistics data sheet is used to record the logistics status of the logistics order.
[0118] In some embodiments, the updating unit 602 is specifically configured to:
[0119] When the logistics status of the target logistics order in the e-commerce platform is updated, the logistics data sheet of the target logistics order is deleted from the logistics record table to be checked.
[0120] In some embodiments, the updating unit 602 is specifically configured to:
[0121] When the first logistics progress information fails to be updated to the logistics microservice end, it is determined that the current consumption message consumption fails, and the current consumption message is consumed again;
[0122] When the number of failed consumption of the current consumption message is greater than a preset number threshold, the target logistics order is regarded as an abnormal logistics order;
[0123] The abnormal logistics order is displayed in the logistics microservice end.
[0124] In some embodiments, the updating unit 602 is specifically configured to:
[0125] Sending a failure notification of failure of consumption of the current consumption message to the express query system, so that the express query system pushes the current consumption message to the message queue again after receiving the failure notification to obtain an updated message queue;
[0126] The currently consumed message in the updated message queue is consumed.
[0127] In some embodiments, the logistics microservice end includes a plurality of consumption nodes, and the consumption nodes are used to consume the logistics messages of the message queue. The logistics status updating device 600 also includes a switch unit (not shown in the figure), and the switch unit is specifically used to:
[0128] Obtain the amount of messages to be consumed in the message queue;
[0129] Determine the minimum node requirement of the message queue and the maximum node requirement of the message queue based on the amount of messages to be consumed, the preset maximum allocation amount of the consumer node, and the preset minimum allocation amount of the consumer node;
[0130] Based on the minimum demand of the node, the maximum demand of the node, and the number of nodes that have been turned on at the logistics microservice end, the consumption node of the logistics microservice end is turned on or off.
[0131] In some embodiments, the updating unit 602 is specifically configured to:
[0132] When the current consumption message in the message queue is consumed successfully, a success notification is sent to the express query system, so that the express query system deletes the current consumption message from the message queue after receiving the success notification.
[0133] In specific implementation, the above units can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities. The specific implementation of the above units can refer to the previous logistics status update method embodiment, which will not be repeated here.
[0134] See also Figure 7 , Figure 7 A schematic block diagram of the structure of a computer device provided in an embodiment of the present application. The computer device may be a server.
[0135] like Figure 7 As shown, the computer device includes a processor, a memory, and a network interface connected via a system bus, wherein the memory may include a non-volatile storage medium and an internal memory.
[0136] The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions, and when the program instructions are executed, the processor can execute any one of the logistics status update methods.
[0137] The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.
[0138] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the processor can execute any logistics status update method.
[0139] The network interface is used for network communication, such as sending assigned tasks, etc. Those skilled in the art will appreciate that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0140] It should be understood that the processor may be a central processing unit (CPU), and the processor may also be 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. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0141] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:
[0142] Consume the logistics message of the message queue, obtain the first express number and the first logistics progress information corresponding to the current consumption message, wherein the message queue pre-caches at least one logistics message pushed by the express query system, and the logistics message carries the corresponding express number and the corresponding logistics progress information; according to the first express number and the first logistics progress information, update the logistics status of the target logistics order associated with the first express number in the logistics microservice end, and obtain the updated logistics status of the target logistics order; send the updated logistics status of the target logistics order to the e-commerce platform of the target logistics order.
[0143] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:
[0144] Obtain a first creation time of a target logistics order associated with the first express delivery number; determine a to-be-checked logistics record table for the target logistics order based on the first creation time and the record time range of each logistics record table in the logistics microservice end; query a logistics data sheet of the target logistics order from the to-be-checked logistics record table based on the first express delivery number; update the logistics data sheet of the target logistics order in the to-be-checked logistics record table based on the first logistics progress information to obtain an updated logistics status of the target logistics order.
[0145] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:
[0146] Obtain a second creation time of the logistics order to be recorded; obtain a recording time range of each logistics record table in the logistics microservice end; based on the second creation time and the recording time range of each logistics record table, based on each logistics record table of the logistics microservice end, determine a target logistics record table for the logistics order to be recorded; in the target logistics record table, create a logistics data sheet for the logistics order to be recorded, wherein the logistics data sheet is used to record the logistics status of the logistics order.
[0147] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:
[0148] When the logistics status of the target logistics order in the e-commerce platform is updated, the logistics data sheet of the target logistics order is deleted from the logistics record table to be checked.
[0149] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:
[0150] When the first logistics progress information fails to be updated to the logistics microservice end, it is determined that the current consumption message has failed, and the current consumption message is consumed again; when the number of consumption failures of the current consumption message is greater than a preset number threshold, the target logistics order is treated as an abnormal logistics order; and the abnormal logistics order is displayed in the logistics microservice end.
[0151] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:
[0152] A failure notification of failure in consuming the current consumption message is sent to the express query system, so that the express query system pushes the current consumption message to the message queue again after receiving the failure notification to obtain an updated message queue; and consumes the current consumption message in the updated message queue.
[0153] In one embodiment, the logistics microservice end includes a plurality of consumption nodes, the consumption nodes are used to consume the logistics messages of the message queue, and the processor is used to run a computer program stored in a memory to implement the following steps:
[0154] Obtain the amount of messages to be consumed in the message queue; determine the minimum node demand of the message queue and the maximum node demand of the message queue based on the amount of messages to be consumed, the preset maximum allocation amount of the consumption node, and the preset minimum allocation amount of the consumption node; turn on or off the consumption node of the logistics microservice end based on the minimum node demand, the maximum node demand, and the amount of nodes that have been turned on at the logistics microservice end.
[0155] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:
[0156] When the current consumption message in the message queue is consumed successfully, a success notification is sent to the express query system, so that the express query system deletes the current consumption message from the message queue after receiving the success notification.
[0157] A person of ordinary skill in the art will appreciate that all or part of the steps in the above-mentioned logistics status update method may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0158] To this end, an embodiment of the present application provides a computer-readable storage medium, in which multiple computer programs are stored. The computer programs can be loaded by a processor to execute any logistics status update method provided in the embodiment of the present application.
[0159] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0160] In the above-mentioned logistics status updating device and computer-readable storage medium embodiments, the description of each embodiment has its own emphasis. For the parts not described in detail in a certain embodiment, reference can be made to the relevant description of other embodiments. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process and beneficial effects of the logistics status updating device, computer-readable storage medium and its corresponding units described above can refer to the description of the logistics status updating method in the above embodiment, and will not be repeated here.
[0161] The above is a detailed introduction to a logistics status updating method, device, computer equipment and computer-readable storage medium provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the ideas of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A logistics status updating method, characterized in that: The method comprises: Consume the logistics message in the message queue, and obtain the first express number and the first logistics progress information corresponding to the current consumption message, wherein the message queue has at least one logistics message pushed by the express query system in a pre-cached state, and the logistics message carries the corresponding express number and the corresponding logistics progress information; According to the first express order number and the first logistics progress information, the logistics status of the target logistics order associated with the first express order number in the logistics microservice end is updated to obtain the updated logistics status of the target logistics order; The updated logistics status of the target logistics order is sent to the e-commerce platform of the target logistics order.
2. The logistics status updating method according to claim 1, characterized in that: The updating of the logistics status of the target logistics order associated with the first express number in the logistics microservice end according to the first express number and the first logistics progress information to obtain the updated logistics status of the target logistics order includes: Obtain the first creation time of the target logistics order associated with the first express delivery number; Determine the logistics record table to be checked for the target logistics order based on the first creation time and the record time range of each logistics record table in the logistics microservice end; Based on the first express delivery number, querying the logistics data sheet of the target logistics order from the to-be-queried logistics record table; Based on the first logistics progress information, the logistics data sheet of the target logistics order in the to-be-checked logistics record table is updated to obtain an updated logistics status of the target logistics order.
3. The logistics status updating method according to claim 2, characterized in that: The method further comprises: Get the second creation time of the logistics order to be recorded; Obtain the recording time range of each logistics record table in the logistics microservice end; Based on the second creation time and the recording time range of each logistics record table, and based on each logistics record table of the logistics microservice end, determine the target logistics record table of the logistics order to be recorded; In the target logistics record table, a logistics data sheet of the logistics order to be recorded is created, wherein the logistics data sheet is used to record the logistics status of the logistics order.
4. The logistics status updating method according to claim 2, characterized in that: The method further comprises: When the logistics status of the target logistics order in the e-commerce platform is updated, the logistics data sheet of the target logistics order is deleted from the logistics record table to be checked.
5. The logistics status updating method according to claim 1, characterized in that: The method further comprises: When the first logistics progress information fails to be updated to the logistics microservice end, it is determined that the current consumption message consumption fails, and the current consumption message is consumed again; When the number of failed consumption of the current consumption message is greater than a preset number threshold, the target logistics order is regarded as an abnormal logistics order; The abnormal logistics order is displayed in the logistics microservice end.
6. The logistics status updating method according to claim 5, characterized in that: The re-consuming the currently consumed message includes: Sending a failure notification of failure of consumption of the current consumption message to the express query system, so that the express query system pushes the current consumption message to the message queue again after receiving the failure notification to obtain an updated message queue; The currently consumed message in the updated message queue is consumed.
7. The logistics status updating method according to claim 1, characterized in that: The logistics microservice end includes a plurality of consumption nodes, and the consumption nodes are used to consume the logistics messages of the message queue. The method further includes: Obtain the amount of messages to be consumed in the message queue; Determine the minimum node requirement of the message queue and the maximum node requirement of the message queue based on the amount of messages to be consumed, the preset maximum allocation amount of the consumer node, and the preset minimum allocation amount of the consumer node; Based on the minimum demand of the node, the maximum demand of the node, and the number of nodes that have been turned on at the logistics microservice end, the consumption node of the logistics microservice end is turned on or off.
8. A logistics status updating device, characterized in that: The logistics status updating device comprises: An acquisition unit is used to consume the logistics message of the message queue, and acquire the first express number corresponding to the current consumption message and the first logistics progress information corresponding to the current consumption message, wherein the message queue is pre-cached with at least one logistics message pushed by the express query system, and the logistics message carries the corresponding express number and the corresponding logistics progress information; An updating unit, configured to update the logistics status of the target logistics order associated with the first express number in the logistics microservice end according to the first express number and the first logistics progress information, and obtain the updated logistics status of the target logistics order; A sending unit is used to send the updated logistics status of the target logistics order to the e-commerce platform of the target logistics order.
9. A computer device, characterized in that: The computer device includes a memory and a processor; The memory is used to store computer programs; The processor is used to execute the computer program and implement the logistics status updating method as described in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program is loaded by a processor to execute the logistics status updating method described in any one of claims 1 to 7.
Citation Information
Patent Citations
Logistics track pushing method and device, equipment and storage medium
CN114528458A
Waybill batch delivery method and device, equipment and medium
CN116523590A
Distribution management method, server and system
CN116862332A
