Logistics signing information batch reply method and system, program product and storage medium
Through time round technology and message queue scheduling, combined with hash data structure, the problem of massive request pressure for logistics sign-up information feedback during peak periods is solved, and stable and efficient message push is achieved.
Patent Information
- Application Number
- CN202411059308.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-03
- Publication Date
- 2024-12-03
AI Technical Summary
The existing logistics sign-up information feedback method is during peak periods such as e-commerce promotions, and massive sign-up events may cause pressure on instant messaging software services, resulting in stability and reliability issues of message push.
Use time-wheel technology to schedule reply tasks, allocate reasonable start execution time and control task intervals, and use message queues to buffer and peak-cut to ensure orderly execution of tasks, and quickly obtain target group list and storage through hash data structures. Logistics order number to achieve data positioning and access efficiency.
Effectively cut peaks and valleys to avoid short-term request pressure, ensure the stability and reliability of message push, improve task execution efficiency in high concurrency, and ensure massive message push demand during peak periods such as e-commerce promotions.
Smart Images

Figure CN119067359A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of logistics technology, and in particular to a method, system, program product and storage medium for batch reply of logistics receipt information. Background Art
[0002] With the development of Internet technology, e-commerce has become an important part of modern business. As a key link in the e-commerce ecosystem, the service quality of logistics directly affects consumers' shopping experience and user satisfaction of e-commerce platforms. In order to cope with the growing demand for logistics, the logistics industry is gradually introducing intelligent technologies to improve work efficiency and service quality. As an important direction of technological innovation in the logistics industry, the intelligent customer service system integrates natural language processing (NLP), forward keywords / reverse keywords, address structured analysis and other advanced technologies to achieve automatic identification and response to user demands. These systems can handle user needs including but not limited to modifying delivery addresses, phone calls, urging couriers, intercepting couriers and returning them.
[0003] However, with the rapid development of e-commerce, logistics companies usually provide timely feedback to customer service staff after the logistics information is updated, so that customer service staff can understand the package status in time and communicate with users.
[0004] The existing logistics receipt information feedback method usually adopts the solution of instant message push. Specifically, the logistics company's system will continuously monitor the status of the logistics order number, and once the receipt event is detected, the information processing process will be triggered immediately. The system extracts key information from the receipt event, such as the receipt time, the person who signed, the logistics order number, etc., and formats this information into a preset message template. Then, the system calls the API interface of the instant messaging software (such as DingTalk) to send the formatted receipt information to the corresponding group chat, and the instant messaging software pushes the message to the customer service staff in the group in real time.
[0005] However, this instant messaging solution has some flaws. During peak logistics periods such as e-commerce promotions, a large number of sign-in events may trigger a large number of message pushes in a short period of time, which may exceed the service capacity of the instant messaging software (such as the QPS limit of the API), causing system failures and affecting the stability and reliability of message push. Summary of the invention
[0006] This application provides a method for batch reply of logistics receipt information to ensure the stability and reliability of message push.
[0007] In the first aspect, the present application provides a method for batch replying to logistics receipt information, including: obtaining a target group list; creating a reply task for each to-be-replied target in the target group list; scheduling all the reply tasks using the time wheel technology, wherein a start execution time is assigned to each reply task, and the interval between adjacent start execution times is less than a preset query rate per second; inserting all the reply tasks into the message queue in sequence according to the corresponding start execution time to form a reply task queue; when the start execution time corresponding to the current reply task is reached, according to the type of the current reply task, the corresponding preset reply template is determined, and the corresponding current reply speech is generated according to the corresponding preset reply template, and the current reply task is any of the reply tasks; the current reply speech is sent to the to-be-replied group corresponding to the current reply task.
[0008] By adopting the above technical solution, all reply tasks are scheduled using the time wheel technology, a reasonable start execution time is assigned to each reply task, and the execution time interval of adjacent tasks is controlled to be less than the preset query rate per second. This approach can effectively smooth out the peaks and valleys of the massive requests that originally burst out, and evenly distribute the requests over a period of time to avoid excessive request pressure in a short period of time. At the same time, by introducing message queues, reply tasks can be buffered and peak-smoothed, and the orderly execution of tasks can be guaranteed even in high concurrency, effectively responding to the massive message push needs during logistics peak periods such as e-commerce promotions.
[0009] In combination with some embodiments of the first aspect, in some embodiments, before the step of obtaining the target group list, the method also includes: matching the corresponding service order according to the logistics order number in the receipt information; storing the logistics order number in the service order in different databases according to different service order types, wherein the database uses a hash data structure, and the key of each hash table is composed of a combination of the service order type and the scheduled task execution time; the field of each hash table is the ID of the group to be replied; the value corresponding to each field is a list of logistics order numbers; the step of obtaining the target group list specifically includes: after the scheduled task execution time is reached, obtaining the ID of the group to be replied and the list of logistics order numbers from the database.
[0010] By adopting the above technical solution, the logistics order numbers in the service order are stored in different databases according to different service order types, and organized using a hash data structure, which can achieve fast data location and access. In the hash table, the combination of the service order type and the scheduled task execution time is used as the key, the ID of the group to be replied is used as the field, and the logistics order number list is used as the field value. This data organization method can easily obtain the target group list that needs to be replied according to the service order type and the scheduled task execution time, avoiding full table scanning and improving the efficiency of obtaining the target group.
[0011] In combination with some embodiments of the first aspect, in some embodiments, after the step of storing the logistics order number in the service order in different databases according to different service order types, the method also includes: determining the expiration time based on the storage time and the preset expiration time; when the expiration time is reached, deleting the corresponding stored data.
[0012] By adopting the above technical solution, data redundancy and waste of storage space caused by the continuous accumulation of historical data can be avoided. At the same time, the interference of expired data on query and statistics can be avoided, and the timeliness and accuracy of data can be improved.
[0013] In combination with some embodiments of the first aspect, in some embodiments, before the step of matching the corresponding service order according to the logistics order number in the receipt information, the method also includes: receiving receipt information, each of the receipt information includes a geographic location identifier and a timestamp; dividing the receipt information into different geographic area categories according to the geographic location identifier; aggregating the receipt information into different information blocks according to the timestamps in each geographic area category; using the time wheel technology to schedule all the reply tasks, wherein a start execution time is assigned to each of the reply tasks, and the interval between adjacent start execution times is less than the preset query rate per second. The step specifically includes: using the time wheel technology to schedule all the reply tasks, wherein a start execution time is assigned to each of the reply tasks, the reply tasks corresponding to the same information block are assigned continuous start execution times, and the interval between adjacent start execution times is less than the preset query rate per second.
[0014] By adopting the above technical solution, receipt information containing geographic location identifiers and timestamps is received, and the receipt information is divided into different geographic area categories according to the geographic location identifier, thereby realizing spatial division of the receipt information. Through geographic area division, the receipt information within a large range can be classified by region. In each geographic area category, the receipt information can be aggregated into different information blocks according to the timestamp, and the receipt information within a specific time period can be integrated together, which is convenient for customer service personnel to perform batch processing and analysis. In the time wheel scheduling, the reply tasks corresponding to the same information block are assigned continuous start execution times, so that the receipt information with higher relevance can be processed continuously, reducing the switching cost of customer service personnel and improving work efficiency.
[0015] In combination with some embodiments of the first aspect, in some embodiments, when the start execution time corresponding to the current reply task is reached, the corresponding preset reply template is determined according to the type of the current reply task, and the corresponding current reply script is generated according to the corresponding preset reply template. The method also includes: determining the subscriber corresponding to the current reply task according to the preset subscription list; determining the identification information of the subscriber according to the preset subscription list; and embedding the identification information in the current reply script.
[0016] By adopting the above technical solution, the subscriber's identification information is embedded into the current reply script, so that the reply script is clearly associated with a specific subscriber. By embedding the identification, customer service staff can quickly determine the target object of the reply script, without having to manually search and match from massive historical messages, which greatly improves the efficiency and accuracy of information acquisition.
[0017] In combination with some embodiments of the first aspect, in some embodiments, after the step of embedding the identification information in the current reply speech, the step also includes: determining the subscriber corresponding to the secondary reply task according to the preset subscription list, and the secondary reply task is the next reply task of the current reply task in the message queue; judging whether the subscriber corresponding to the current reply task is the same as the subscriber corresponding to the secondary reply task; if it is the same as the subscriber corresponding to the secondary reply task, determining the corresponding preset reply template according to the type of the secondary reply task, and generating the corresponding secondary reply speech according to the corresponding preset reply template; adding the current reply speech and the secondary reply speech to obtain a comprehensive reply speech; judging whether the comprehensive reply speech is greater than the maximum word limit specified by the group to be replied; if it is not greater than the maximum word limit specified by the group to be replied, sending the comprehensive reply speech to the group to be replied corresponding to the current reply task; deleting the secondary reply task in the message queue, and updating the message queue.
[0018] By adopting the above technical solution, according to the preset subscription list, it is determined whether the current reply task and the next reply task (the second reply task) correspond to the same subscriber. By comparing the subscribers, the continuous reply tasks for the same customer service staff can be identified, providing a basis for judgment for the merging of the words. If the subscribers are the same, the reply words corresponding to the second reply task are generated in advance, and they are merged with the current reply words to generate a comprehensive reply word. By merging the words, the scattered reply content can be integrated into a complete message, which reduces the number and frequency of customer service staff receiving messages and improves the coherence and readability of the information. The length of the merged comprehensive reply words is checked to ensure that it does not exceed the maximum word limit of the group to be replied. Considering the word limit during the merging process can avoid the problem of generating too long reply words and being unable to be sent, and ensure the success rate of message push. If the comprehensive reply words meet the length requirements, they are sent to the subscriber, and the merged second reply tasks are deleted from the message queue, and the queue is updated. By merging words and updating queues, unnecessary message sending can be reduced and the sending efficiency can be improved. At the same time, the dynamic adjustment of the queue can be realized to prevent queue accumulation and blocking, and ensure the stable operation of the system.
[0019] In combination with some embodiments of the first aspect, in some embodiments, after the step of determining whether the subscriber corresponding to the current reply task is the same as the subscriber corresponding to the secondary reply task, it also includes: if the subscriber corresponding to the secondary reply task is not the same, then when the start execution time corresponding to the secondary reply task is reached, the secondary reply words are sent to the pending reply group corresponding to the secondary reply task.
[0020] By adopting the above technical solution, for different continuous reply tasks of subscribers, the system no longer generates reply scripts repeatedly in rounds, but makes full use of the scripts generated in the previous round. When the execution time of the next reply task arrives, the scripts generated in the previous round are directly sent, avoiding the waste of resources for repeated script generation.
[0021] In a second aspect, the present application provides a batch reply system for logistics receipt information, which includes: one or more processors and a memory; the memory is coupled to the one or more processors, and the memory is used to store computer program code, and the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the batch reply system for logistics receipt information to execute the method described in the first aspect and any possible implementation method of the first aspect.
[0022] In the third aspect, the present application provides a computer program product comprising instructions. When the computer program product is run on a batch reply system for logistics receipt information, the batch reply system for logistics receipt information executes the method described in the first aspect and any possible implementation method of the first aspect.
[0023] In a fourth aspect, the present application provides a computer-readable storage medium comprising instructions, which, when executed on a logistics receipt information batch reply system, enables the logistics receipt information batch reply system to execute the method described in the first aspect and any possible implementation method of the first aspect.
[0024] One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages: 1. Use the time wheel technology to schedule all reply tasks, assign a reasonable start time for each reply task, and control the execution time interval of adjacent tasks to be less than the preset query rate per second. This approach can effectively smooth out the peaks and valleys of the massive requests that originally burst out, and evenly distribute the requests over a period of time to avoid excessive request pressure in a short period of time. At the same time, by introducing message queues, reply tasks can be buffered and peak-smoothed, ensuring the orderly execution of tasks even in high concurrency, and effectively responding to the massive message push needs during logistics peaks such as e-commerce promotions.
[0025] 2. The logistics order numbers in the service order are stored in different databases according to different service order types, and organized using a hash data structure to achieve fast data location and access. In the hash table, the combination of the service order type and the scheduled task execution time is used as the key, the ID of the group to be replied to is used as the field, and the list of logistics order numbers is used as the field value. This data organization method can easily obtain the target group list that needs to be replied according to the service order type and the scheduled task execution time, avoiding full table scanning and improving the efficiency of obtaining the target group.
[0026] 3. According to the preset subscription list, determine whether the current reply task and the next reply task (second reply task) correspond to the same subscriber. By comparing subscribers, continuous reply tasks for the same customer service staff can be identified, providing a basis for judgment for speech merging. If the subscribers are the same, the reply speech corresponding to the second reply task is generated in advance, and it is merged with the current reply speech to generate a comprehensive reply speech. By merging speech, the scattered reply content can be integrated into a complete message, which reduces the number and frequency of customer service staff receiving messages and improves the coherence and readability of information. Check the length of the merged comprehensive reply speech to ensure that it does not exceed the maximum word limit of the group to be replied. Considering the word limit during the merging process can avoid the problem of generating too long reply speech and failing to send, and ensure the success rate of message push. If the comprehensive reply speech meets the length requirement, it will be sent to the subscriber, and the merged second reply task will be deleted from the message queue, and the queue will be updated. By merging speech and updating queues, unnecessary message sending can be reduced and the sending efficiency can be improved. At the same time, the dynamic adjustment of the queue can be realized to prevent queue accumulation and blocking, and ensure the stable operation of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 It is a structural diagram of an applicable system architecture of the method for batch replying logistics receipt information in the embodiment of the present application; Figure 2 This is a flow chart of a method for batch replying logistics receipt information in an embodiment of the present application; Figure 3 This is another flowchart of the method for batch replying logistics receipt information in an embodiment of the present application; Figure 4 This is another flowchart of the method for batch replying logistics receipt information in an embodiment of the present application; Figure 5 It is an exemplary hardware structure diagram of the logistics receipt information batch reply system in the embodiment of the present application. DETAILED DESCRIPTION
[0028] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to be used as limitations to the present application. As used in the specification and appended claims of the present application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to also include plural expressions, unless there is a clear indication to the contrary in the context. It should also be understood that the term "and / or" used in the present application refers to and includes any or all possible combinations of one or more listed items.
[0029] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.
[0030] Figure 1 It is a structural diagram of a system architecture that can be applied to the method for batch replying logistics receipt information in the embodiment of the present application.
[0031] See also Figure 1 The logistics receipt information batch reply system is connected to multiple logistics tracking systems on one side and the corresponding systems of multiple customer service personnel on the other side.
[0032] The logistics tracking system is an information system used to track and record the logistics status of packages. When a package passes through a specific node (such as collection, sorting, transportation, delivery, etc.) during the logistics process, the logistics tracking system will scan the package, obtain its logistics status information, and record and update this information. When the package is signed for, the logistics tracking system will generate the signing information of the package and push it to the logistics signing information batch reply system.
[0033] The logistics receipt information batch reply system is an information processing and distribution platform. On the one hand, it connects multiple logistics tracking systems to receive and summarize receipt information from different logistics tracking systems; on the other hand, it connects to the corresponding systems of multiple customer service personnel to send the sorted receipt information in batches to customer service personnel. The main function of this system is to centrally process, organize and publish the scattered receipt information, so that customer service personnel can query and use it according to their needs.
[0034] The corresponding system for customer service personnel is a work platform for customer service personnel to obtain and process receipt information. Through this system, customer service personnel can easily view the receipt data published by the logistics receipt information batch reply system, and select and extract the required receipt information according to the customer needs and work tasks they are responsible for. Customer service personnel can use the obtained receipt information to promptly feedback the receipt status of the package to customers, or arrange subsequent work such as delivery and after-sales service according to the receipt situation.
[0035] The executor of this implementation is the logistics receipt information batch reply system.
[0036] The following describes the method for batch replying logistics receipt information in the embodiment of the present application in combination with the above exemplary framework diagram: See also Figure 3, which is a flow chart of a method for batch replying logistics receipt information in an embodiment of the present application.
[0037] S201, obtaining a target group list; The target group list refers to a collection of groups that need to be responded to, such as a list of logistics numbers; Obtaining the target group list is usually performed before the batch reply task starts, and is used to determine the group range that needs to be replied. In some embodiments, all receipt information needs to be replied, that is, all logistics numbers need to be replied.
[0038] S202, creating a reply task for each target to be replied in the target group list; Among them, the reply task refers to the work unit for generating and sending reply words to a specific target group. Each reply task corresponds to a target to be replied (i.e. a logistics number in the target group list).
[0039] It should be noted that, for the convenience of understanding and processing, a complete reply process is usually abstracted as a "reply task". The "task" here does not refer to a specific, detailed execution step, but represents a logical processing unit.
[0040] S203, scheduling all the reply tasks using a time wheel technology, wherein a start execution time is assigned to each reply task, and the interval between adjacent start execution times is less than a preset query rate per second; Among them, the time wheel technology is an efficient timed task scheduling algorithm that can organize and manage a large number of timed tasks according to the time dimension. The time wheel is usually composed of multiple time slots, each of which corresponds to a fixed time interval (such as 1 second). By mapping the reply task to different time slots, the timed triggering and execution of the task can be achieved. For example, a time wheel may contain 60 time slots, each of which represents 1 minute. By assigning the reply task to different time slots, the task can be executed every 1 minute.
[0041] In order to control the execution frequency of tasks, a preset query rate per second is set, which indicates the maximum number of tasks that can be executed per second. The start execution time of adjacent tasks needs to meet the query rate limit, that is, the interval between adjacent times must be greater than or equal to the inverse of the query rate.
[0042] It should be noted that in actual usage, the preset query rate per second is the QPS limit of the communication software "DingTalk".
[0043] It is worth noting that in this embodiment, in order to facilitate understanding of the working principle of the logistics receipt information batch reply method, a group of a specific communication software is selected as an example scenario. However, it should be noted that in actual applications, the message queue is usually connected to multiple different communication software at the same time, such as WeChat, DingTalk, etc., and each communication software has multiple different groups.
[0044] Although different communication software have differences in functions, protocols, interfaces, etc., their basic principles and processes are consistent when they are integrated with message queues. Moreover, the principles and processes of different groups of communication software are consistent.
[0045] Of course, when integrating different communication software, it is still necessary to adapt and optimize some details according to the characteristics of each software. For example: message format conversion: different software may support different message formats, such as plain text, Markdown, HTML, etc., and it is necessary to perform corresponding format conversion according to the requirements of the target software when generating reply words; interface adaptation: the API interface specifications provided by different software may be different, such as HTTP, WebSocket, TCP, etc., and it is necessary to implement the corresponding interface adaptation layer for each software to encapsulate the communication details with the software; concurrency control: different software may have different restrictions on the call frequency of the interface, such as a maximum of 100 times per minute. It is necessary to set a reasonable concurrency and request rate for each software to avoid triggering the software's current limiting or fuse mechanism. I will not go into details here.
[0046] Different groups of the same software have different target group lists and query rates per second, as well as different data obtained from subsequent processing. The other processes are basically similar and will not be repeated here.
[0047] S204, inserting all the reply tasks into the message queue in sequence according to the corresponding start execution time to form a reply task queue; Among them, the message queue is an asynchronous communication mechanism that can be used to pass messages or tasks between different components.
[0048] All reply tasks are inserted into the message queue in the order of their start execution time, forming an orderly reply task queue. Tasks wait in the queue for acquisition and execution, and the execution time is determined by the start execution time of the task. By using message queues, reliable task delivery, peak load shaving and valley filling can be achieved, improving the stability and performance of the system.
[0049] In some embodiments, the inserted task message sets an expiration time or a maximum number of retries to prevent the task from being stuck in the queue for a long time or repeatedly failing to execute, thereby ensuring the timeliness and reliability of the task.
[0050] S205, when the start execution time corresponding to the current reply task is reached, according to the type of the current reply task, the corresponding preset reply template is determined, and the corresponding current reply script is generated according to the corresponding preset reply template, and the current reply task is any of the reply tasks; Among them, the preset reply template refers to a pre-defined reply script template, which contains fixed contents such as the basic structure, common sentences, and format of the reply script. Different types of reply tasks may correspond to different reply templates, such as logistics status notification, promotion activity notification, etc. The reply template usually represents dynamic content in the form of placeholders. When generating specific reply scripts, the placeholders will be replaced with actual data values. For example, a logistics status notification template may contain a sentence like "Dear {customer name}, your order {order number} has been signed at {receipt time}, thank you for your purchase!", where {customer name}, {order number}, and {receipt time} are all placeholders.
[0051] In some specific embodiments, when it is detected that the start execution time of a reply task matches the current time, the task will be obtained from the message queue, and the corresponding reply template will be searched in the preset reply template library according to the type information specified in the task. After finding the matching template, the dynamic data carried in the task, such as customer information, order information, etc., will be extracted, and these data will be filled into the placeholder position of the template, and finally a complete and personalized reply script will be generated. The generated reply script will be used in the subsequent message sending link.
[0052] S206. Send the current reply words to the waiting reply group corresponding to the current reply task.
[0053] Among them, the group to be replied refers to the target group associated with the current reply task, that is, the group that needs to receive the reply script. Each reply task will specify a corresponding group to be replied when it is created to ensure that the generated reply script can be accurately sent to the required audience.
[0054] It can be seen that the time wheel technology is used to schedule all reply tasks, assign a reasonable start execution time to each reply task, and control the execution time interval of adjacent tasks to be less than the preset query rate per second. This approach can effectively smooth out the peaks and valleys of the massive requests that originally burst out, and evenly distribute the requests over a period of time to avoid excessive request pressure in a short period of time. At the same time, by introducing message queues, reply tasks can be buffered and peak-smoothed, ensuring the orderly execution of tasks even in high concurrency, and effectively responding to the massive message push needs during logistics peak periods such as e-commerce promotions.
[0055] In a specific embodiment, reference Figure 3 , Figure 3This is another flowchart of the method for batch replying logistics receipt information in an embodiment of the present application; S301, matching the corresponding service order according to the logistics order number in the receipt information; Among them, the receipt information refers to the relevant data generated when the package is signed for during the logistics process. It is sent by the above-mentioned logistics tracking system and usually includes information such as the logistics order number, receipt time, and the person who signed for it. The logistics order number is the unique identifier of each package in the logistics system, which is used to track and manage the flow status of the package. The service order refers to the work order generated by the logistics company when providing services to customers, which records the specific content, status, and related logistics order number of the service.
[0056] S302, storing the logistics order number in the service order in different databases according to different service order types, wherein the database uses a hash data structure, and the key of each hash table is composed of a combination of the service order type and the scheduled task execution time; the field of each hash table is the ID of the group to be replied; and the value corresponding to each field is a list of logistics order numbers; Among them, the service order type refers to the business type or scenario to which the service order belongs, such as ordinary express delivery, cash on delivery, door-to-door pickup, etc. Different types of service orders may have different processing procedures and data structures. The hash data structure is a storage method based on key-value pairs. The key is mapped to the corresponding storage location through a hash function to achieve efficient data insertion, deletion, and search operations. In this step, the combination of the service order type and the scheduled task execution time is used as the key of the hash table, and the logistics order numbers of the same type and execution time are stored in the same hash table. The group ID to be replied is used to identify the objects that need to receive logistics status notifications, such as customers, agents, etc.
[0057] The operation of storing service orders by type and task execution time is usually performed after matching the service order, which is used to optimize the data organization and query efficiency. Specifically, according to the type of service order, the logistics order number is stored in different hash tables according to the preset time interval (such as every hour, every day). The key of the hash table consists of the service order type and the task execution time, in the form of "TYPE_YYYY-MM-DD-HH". The value of each hash table is a dictionary with the ID of the group to be replied as a field. Each field of the dictionary corresponds to a list of logistics order numbers, which stores all logistics order numbers that need to be replied to the target at that time point. In this way, logistics order numbers of specific types and times can be quickly obtained, and grouped according to the group to be replied, which improves the efficiency of subsequent task scheduling and message sending.
[0058] It can be seen that by storing the logistics order numbers in the service order in different databases according to different service order types and organizing them using a hash data structure, fast data location and access can be achieved. In the hash table, the combination of the service order type and the scheduled task execution time is used as the key, the ID of the group to be replied to is used as the field, and the list of logistics order numbers is used as the field value. This data organization method can easily obtain the target group list that needs to be replied according to the service order type and the scheduled task execution time, avoiding full table scanning and improving the efficiency of obtaining the target group.
[0059] After step S302, either step S303 or step S309 may be executed.
[0060] S303: After the scheduled task execution time arrives, the ID of the to-be-replied group and the logistics order number list are obtained from the database.
[0061] The principle and process of this step are the same as those of step S201. For the specific steps, please refer to step S201 and will not be repeated here.
[0062] S304, creating a reply task for each target to be replied in the target group list; The principle and process of this step are the same as those of step S202. For specific steps, please refer to step S202 and will not be repeated here.
[0063] S305, scheduling all the reply tasks using the time wheel technology, wherein a start execution time is assigned to each reply task, and the interval between adjacent start execution times is less than a preset query rate per second; The principle and process of this step are the same as those of step S203. For the specific steps, please refer to step S203 and will not be repeated here.
[0064] S306, inserting all the reply tasks into the message queue in sequence according to the corresponding start execution time to form a reply task queue; The principle and process of this step are the same as those of step S204. For specific steps, please refer to step S204 and will not be repeated here.
[0065] S307, when the start execution time corresponding to the current reply task is reached, according to the type of the current reply task, the corresponding preset reply template is determined, and the corresponding current reply script is generated according to the corresponding preset reply template, and the current reply task is any of the reply tasks; The principle and process of this step are the same as those of step S205. For specific steps, please refer to step S205 and will not be repeated here.
[0066] S308. Send the current reply words to the waiting reply group corresponding to the current reply task.
[0067] The principle and process of this step are the same as those of step S206. For specific steps, please refer to step S206 and will not be repeated here.
[0068] S309, determining an expiration time according to the stored time and a preset expiration time; The storage time refers to the timestamp when the service order data is stored in the hash table, which is used to record the generation time or update time of the data. The preset expiration time is a fixed time period, which means that the data in the hash table will be automatically deleted after the time period.
[0069] In some specific embodiments, the expiration time point of the data is calculated based on the storage time of the data plus a preset expiration time.
[0070] S310: When the expiration time is reached, the corresponding stored data is deleted.
[0071] In a specific embodiment, when it is detected that the expiration time of a piece of data is equal to the current time or has expired, the deletion process will be immediately started.
[0072] In other embodiments, a lazy deletion strategy is used. When querying or writing data, the expiration time is compared. If the data is found to be expired, it is directly deleted instead of actively scanning. Optionally, a periodic batch deletion method is adopted to centrally delete expired data at regular intervals (such as every hour) to reduce the impact of deletion operations on online services. Optionally, query logic compatible with expired data is designed to automatically ignore expired but not deleted data when reading data.
[0073] It can be seen that data redundancy and waste of storage space caused by the continuous accumulation of historical data can be avoided, and the interference of expired data on query and statistics can also be avoided, thereby improving the timeliness and accuracy of data.
[0074] In actual use, as time goes by, the receipt information accumulates in the customer service group, causing a sharp increase in the number of group messages. A large amount of historical messages are mixed together, creating a huge obstacle for customer service personnel to retrieve and extract the required receipt information. The traditional message search mechanism is difficult to cope with such a large amount of data, resulting in the customer service staff being unable to quickly and accurately obtain the target information, affecting the timely handling of problems and customer experience. Therefore, in other embodiments, another method for solving the above problem is provided.
[0075] refer to Figure 4 , Figure 4 This is another flowchart of the method for batch replying logistics receipt information in an embodiment of the present application; After step S205 and before step S206, the method further includes: S401, determining the subscriber corresponding to the current reply task according to the preset subscription list; The subscription list refers to a list that records the correspondence between subscribers and the message types they are interested in. Subscribers usually refer to the corresponding systems of customer service personnel who are interested in a specific type of message and hope to obtain the message in time when it is released.
[0076] In a specific embodiment, first read the preset subscription list, which may be stored in the form of a database table, configuration file, etc. Then, analyze the message type of the current reply task, such as receipt notification, delay reminder, etc. According to the message type, find all subscribers who have subscribed to messages of this type from the subscription list to obtain a subscriber list. This list is the target recipient of the current reply task. If the list is empty, it means that no one has subscribed to this message type, and the reply task may be discarded. Through the subscription list, accurate and efficient message push can be achieved to avoid spamming and omission of messages.
[0077] S402, determining identification information of the subscriber according to the preset subscription list; Among them, identification information refers to information used to uniquely identify and locate subscribers, and common information includes user ID, device ID, phone number, email address, etc. Through identification information, reply messages can be accurately sent to specific subscribers to avoid misdelivery and leakage of messages. In the subscription list, each subscriber corresponds to one or more identification information, which is used for addressing and routing when pushing messages. For example, in an instant messaging scenario, the user's identification information may be a combination of an IM account and a device ID. When sending a message, it is necessary to find the corresponding user terminal based on this information.
[0078] In a specific embodiment, several fields are reserved for each subscriber in the subscription list table for storing different types of identification information, such as user_id, device_id, email, etc., which can be directly queried through a SELECT statement.
[0079] S403: embed the identification information in the current reply speech.
[0080] Embedding identification information means adding information that can identify and locate the target subscribers in the reply text.
[0081] It can be seen that embedding the subscriber's identification information into the current reply script establishes a clear association between the reply script and the specific subscriber. By embedding the identification, customer service staff can quickly determine the target object of the reply script without having to manually search and match from massive historical messages, which greatly improves the efficiency and accuracy of information acquisition.
[0082] In actual use, during business peaks such as e-commerce promotions, the system needs to process a large amount of logistics receipt data in a short period of time and push the corresponding receipt information to customer service personnel. However, when the amount of receipt message data exceeds the system's processing capacity, it will cause message sending to be blocked and delayed, and even cause the system to crash. In this case, the receipt information cannot be pushed in time, which seriously affects the work rhythm and service response speed of customer service personnel and damages the customer experience.
[0083] S404, determining a subscriber corresponding to a second reply task according to a preset subscription list, where the second reply task is the next reply task of the current reply task in the message queue; It should be noted that in this embodiment, the time node is after the current reply script has been generated. In the previous step S204, the message queue has been successfully obtained, and then the next task to be processed, that is, the "next reply task", is taken out from the message queue. The "next" here is relative to the currently processed task, indicating the next task in the task queue.
[0084] In a specific embodiment, check whether the message queue is empty. If it is empty, it means that there is no task to be processed at present, and you can enter the waiting state or re-query the message queue; if the message queue is not empty, take out the task object at the head of the queue, that is, the "second reply task"; remove the second reply task from the queue to ensure that the same task is not processed repeatedly.
[0085] In order to obtain the subscribers corresponding to the second reply task, the system can refer to the processing logic in step S401, which will not be repeated here.
[0086] S405, determining whether the subscriber corresponding to the current reply task is the same as the subscriber corresponding to the second reply task; S406: If the subscriber corresponding to the second reply task is not the same, jump to step S205; It should be noted that the corresponding process of the current reply task has ended, and the next "previous reply task" needs to be carried out.
[0087] S407: If the subscribers corresponding to the second reply task are the same, then according to the type of the second reply task, a corresponding preset reply template is determined, and a corresponding second reply script is generated according to the corresponding preset reply template; The principle and process of this step are the same as those of step S205. For specific steps, please refer to step S205 and will not be repeated here.
[0088] S408, adding the current reply words and the second reply words to obtain a comprehensive reply words; Addition refers to splicing two reply lines together in a certain order and format to form a complete reply message containing more information.
[0089] S409, determining whether the comprehensive reply is greater than the maximum word limit specified by the group to be replied; The maximum word limit refers to the upper limit requirement for the length of a single reply message by the reply group. For example, DingTalk may limit a single message to no more than 400 words, and WeChat may limit a single message to no more than 600 words.
[0090] S410: If the number of characters is not greater than the maximum limit specified by the group to be replied, the comprehensive reply script is sent to the group to be replied corresponding to the current reply task; The principle and process of this step are the same as those of step S206. For specific steps, please refer to step S206 and will not be repeated here.
[0091] S411, deleting the second reply task in the message queue, and updating the message queue.
[0092] In some embodiments, all subsequent elements are copied to the current position, and the queue length is reduced by 1, thereby achieving the deletion of tasks and the updating of queues, which is not limited here.
[0093] It can be seen that according to the preset subscription list, it is determined whether the current reply task and the next reply task (the second reply task) correspond to the same subscriber. By comparing subscribers, continuous reply tasks for the same customer service staff can be identified, providing a basis for judgment for speech merging. If the subscribers are the same, the reply speech corresponding to the second reply task is generated in advance, and it is merged with the current reply speech to generate a comprehensive reply speech. By merging speech, the scattered reply content can be integrated into a complete message, which reduces the number and frequency of customer service staff receiving messages and improves the coherence and readability of information. The length of the merged comprehensive reply speech is checked to ensure that it does not exceed the maximum word limit of the group to be replied. Considering the word limit during the merging process can avoid the problem of generating too long reply speech and failing to send, and ensure the success rate of message push. If the comprehensive reply speech meets the length requirement, it will be sent to the subscriber, and the merged second reply task will be deleted from the message queue, and the queue will be updated. By merging speech and updating queues, unnecessary message sending can be reduced and the sending efficiency can be improved. At the same time, the dynamic adjustment of the queue can be realized to prevent queue accumulation and blocking, and ensure the stable operation of the system.
[0094] In actual use, when replying to the current reply task in each round, the current reply script and the next reply script need to be generated in real time. This practice of repeatedly generating reply scripts in each round leads to a waste of computing resources.
[0095] S412. If the subscribers corresponding to the second reply task are different, when the start execution time corresponding to the second reply task is reached, the second reply script is sent to the waiting reply group corresponding to the second reply task.
[0096] It should be noted that a complete reply task processing flow is discussed in detail, including steps such as obtaining tasks from the task queue, querying subscribers, generating reply words, and sending messages. This flow represents the entire process of the system processing a round of reply tasks. In actual continuous operation, the complete steps will not be executed in each round of task processing. Specifically, starting from the second round of task processing, the system no longer executes step S205.
[0097] It can be seen that for different continuous reply tasks of subscribers, the system no longer generates reply scripts repeatedly in rounds, but makes full use of the scripts generated in the previous round. When the execution time of the next reply task arrives, the scripts generated in the previous round are directly sent, avoiding the waste of resources for repeated script generation.
[0098] In actual use, the logistics receipt information batch reply system will push receipt information from a wide range and different time periods to the customer service group in real time, resulting in highly fragmented information in the group. Customer service personnel need to filter and locate the receipt information related to themselves in a large amount of disorganized information. This process is very time-consuming and easy to miss important information, which seriously affects the work efficiency and service quality of customer service personnel. Therefore, in other embodiments, another method for solving the above problem is provided.
[0099] Before step S301, the following steps are also included: S1. Receive receipt information, each of which contains a geographic location identifier and a timestamp; The geographic location identifier is used to indicate the geographic location where the receipt event occurs, which can be a specific area code, etc. The timestamp records the specific time when the receipt behavior occurs, which is generally accurate to the second level.
[0100] S2. Classifying the receipt information into different geographical area categories according to the geographical location identifier; S3, aggregating the receipt information into different information blocks for the timestamps in each geographic area category; Step S307 is replaced by: using the time wheel technology to schedule all the reply tasks, wherein a start execution time is assigned to each reply task, the reply tasks corresponding to the same information block are assigned continuous start execution times, and the interval between adjacent start execution times is less than the preset query rate per second.
[0101] Insert the reply tasks corresponding to each information block into the time wheel in sequence to ensure that the tasks of the same information block occupy consecutive slots in the time wheel.
[0102] The following introduces an exemplary logistics receipt information batch reply system 500 provided in an embodiment of the present application. Figure 5 It is a schematic diagram of an exemplary hardware structure of the logistics receipt information batch reply system 500 provided in an embodiment of the present application.
[0103] In some embodiments, the logistics receipt information batch reply system 500 is a computer device or the logistics receipt information batch reply system 500 includes a computer device. The computer device includes a processor, a memory and a network interface connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data. The network interface of the computer device is used to communicate with other external terminals or servers through a network connection. In some embodiments, the network interface can be a wired network interface, and in some embodiments, the network interface can also be a wireless network interface. When the computer program is executed by the processor, the method in the embodiment of the present application is implemented.
[0104] Those skilled in the art will understand that Figure 5 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.
[0105] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
[0106] As used in the above embodiments, the term "when..." may be interpreted to mean "if..." or "after..." or "in response to determining..." or "in response to detecting...", depending on the context. Similarly, the phrases "upon determining..." or "if (the stated condition or event) is detected" may be interpreted to mean "if determining..." or "in response to determining..." or "upon detecting (the stated condition or event)" or "in response to detecting (the stated condition or event)", depending on the context.
[0107] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk), etc.
[0108] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.
Claims
1. A method for batch replying logistics receipt information, characterized in that: include: Get the target group list; Creating a reply task for each target to be replied in the target group list; All the reply tasks are scheduled using a time wheel technology, wherein a start execution time is assigned to each reply task, and the interval between adjacent start execution times is less than a preset query rate per second; Inserting all the reply tasks into the message queue in sequence according to the corresponding start execution time to form a reply task queue; When the start execution time corresponding to the current reply task is reached, the corresponding preset reply template is determined according to the type of the current reply task, and the corresponding current reply script is generated according to the corresponding preset reply template, and the current reply task is any of the reply tasks; The current reply words are sent to the waiting reply group corresponding to the current reply task.
2. The method according to claim 1, characterized in that Before the step of obtaining the target group list, the method further includes: Match the corresponding service order according to the logistics order number in the receipt information; The logistics order numbers in the service order are stored in different databases according to different service order types, wherein the database uses a hash data structure, and the key of each hash table is composed of a combination of the service order type and the scheduled task execution time; the field of each hash table is the ID of the group to be replied; and the value corresponding to each field is a list of logistics order numbers; The step of obtaining the target group list specifically includes: After the scheduled task execution time arrives, the ID of the to-be-replied group and the logistics order number list are obtained from the database.
3. The method according to claim 2, characterized in that After the step of storing the logistics order number in the service order in different databases according to different service order types, the method further includes: Determine the expiration time based on the stored time and the preset expiration time; When the expiration time is reached, the corresponding stored data is deleted.
4. The method according to claim 2, characterized in that: Before the step of matching the corresponding service order according to the logistics order number in the receipt information, the method further includes: Receive receipt information, each of which includes a geographic location identifier and a timestamp; Classifying the receipt information into different geographical area categories according to the geographical location identifier; aggregating the receipt information into different information blocks for the timestamps in each geographic area category; The step of scheduling all the reply tasks by using the time wheel technology, wherein a start execution time is assigned to each reply task, and the interval between adjacent start execution times is less than a preset query rate per second, specifically includes: All the reply tasks are scheduled using the time wheel technology, wherein a start execution time is assigned to each reply task, the reply tasks corresponding to the same information block are assigned continuous start execution times, and the interval between adjacent start execution times is less than the preset query rate per second.
5. The method according to claim 1, characterized in that After the step of determining a corresponding preset reply template according to the type of the current reply task when the start execution time corresponding to the current reply task is reached, and generating a corresponding current reply script according to the corresponding preset reply template, the method further includes: Determine the subscriber corresponding to the current reply task according to the preset subscription list; Determining identification information of the subscriber according to the preset subscription list; The identification information is embedded in the current reply speech.
6. The method according to claim 5, characterized in that After the step of embedding the identification information in the current reply speech, the step further includes: Determine a subscriber corresponding to a second reply task according to a preset subscription list, wherein the second reply task is a next reply task of the current reply task in the message queue; Determine whether the subscriber corresponding to the current reply task is the same as the subscriber corresponding to the second reply task; If the subscribers corresponding to the second reply task are the same, then according to the type of the second reply task, a corresponding preset reply template is determined, and a corresponding second reply script is generated according to the corresponding preset reply template; Adding the current reply words and the second reply words to obtain a comprehensive reply words; Determine whether the comprehensive reply is greater than the maximum word limit specified by the group to be replied; If it is not greater than the maximum word limit specified by the to-be-replied group, the comprehensive reply script is sent to the to-be-replied group corresponding to the current reply task; The second reply task is deleted from the message queue, and the message queue is updated.
7. The method according to claim 6, characterized in that After the step of determining whether the subscriber corresponding to the current reply task is the same as the subscriber corresponding to the second reply task, the method further includes: If the subscribers corresponding to the second reply task are different, when the start execution time corresponding to the second reply task is reached, the second reply script is sent to the waiting reply group corresponding to the second reply task.
8. A logistics receipt information batch reply system, characterized in that: The logistics receipt information batch reply system includes: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the logistics receipt information batch reply system to execute the method described in any one of claims 1-7.
9. A computer program product comprising instructions, characterized in that When the computer program product runs on the logistics receipt information batch reply system, the logistics receipt information batch reply system executes the method as described in any one of claims 1-7.
10. A computer-readable storage medium comprising instructions, characterized in that: When the instruction is executed on the logistics receipt information batch reply system, the logistics receipt information batch reply system executes the method as described in any one of claims 1-7.
