Express number generation method and device, terminal equipment and storage medium
By using the database to verify candidate response results in the express order number generation system, the data loss problem caused by asynchronous synchronization of distributed cache is solved, the stability and reliability of express order number generation is improved, and the high order volume scenarios are ensured. Performance requirements.
Patent Information
- Application Number
- CN202310873338.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-17
- Publication Date
- 2025-01-17
AI Technical Summary
In the scenario of tens of millions of daily orders, data may be lost due to the asynchronous synchronization between the nodes of the distributed cache, resulting in duplication of express order numbers, resulting in poor reliability of express order numbers.
By receiving the user's number picking request, determining the number picking mode according to the service type, and generating candidate response results based on the number picking mode and the required order quantity, the historical electronic page list data stored in the database are used for verification to ensure that the candidate response results are not repeated , and store the successful verification results in distributed cache and database to prevent duplicate problems caused by data loss.
It improves the stability and reliability of express order number generation, meets the performance requirements of high order quantity scenarios, avoids the duplication of order numbers caused by data loss in distributed caches, and ensures the uniqueness and consistency of express order number.
Smart Images

Figure CN119323385A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer application technology, and in particular to a method, device, terminal device and storage medium for generating an express delivery number. Background Art
[0002] In recent years, with the rapid development of the logistics industry, the method of generating express delivery numbers has also undergone rapid development. Initially, express delivery numbers were assigned manually, usually a combination of numbers or letters. However, with the growth of express delivery business and the advancement of automation technology, the way of generating express delivery numbers has also changed, from the introduction of barcodes to automatic generation and complex processes. These developments have enabled the express delivery industry to process and track packages more efficiently and accurately, providing better service quality.
[0003] In related technologies, distributed cache technology can usually be used to achieve automation and data services in the express delivery industry, such as express order placement, logistics data synchronization, etc. However, in the current scenario of tens of millions of orders placed per day, data loss may occur due to asynchronous synchronization between distributed cache nodes, resulting in duplicate express numbers. Therefore, the method of using distributed cache to generate express numbers has poor reliability. Summary of the invention
[0004] The embodiments of the present application provide a method, apparatus, terminal device and storage medium for generating express delivery numbers, which can solve the problem that in the current scenario of tens of millions of orders per day, data loss may occur due to asynchronous synchronization between nodes of the distributed cache, resulting in duplicate express delivery numbers and poor reliability.
[0005] In the first aspect, an embodiment of the present application provides a method for generating an express delivery number, comprising: receiving a current number picking request sent by a current user, wherein the current number picking request includes a current user identifier, a current business type, and a current quantity of orders required; determining a number picking mode according to the current business type; generating a candidate response result corresponding to the current number picking request according to the number picking mode and the current quantity of orders required; verifying the candidate response result according to historical electronic waybill data stored in a database; when the candidate response result is verified successfully, determining the candidate response result as a target response result, and returning the target response result to the current user according to the current user identifier, and then storing the target response result in a distributed cache and persistently storing it in the database.
[0006] In a possible implementation of the first aspect, the above-mentioned number taking mode includes at least one of a first number taking mode, a second number taking mode, a third number taking mode and a fourth number taking mode, wherein the first number taking mode refers to a number taking mode only, the second number taking mode is a number taking and order quantity deduction mode, the third number taking mode is a number taking, order quantity deduction and remaining order quantity verification mode, and the fourth number taking mode is an order quantity deduction mode.
[0007] Optionally, in another possible implementation of the first aspect, generating a candidate response result corresponding to the current number taking request according to the number taking mode and the current demand order quantity includes:
[0008] When the number-taking mode is the first number-taking mode, a candidate electronic waybill is generated according to the current demand order quantity, and each candidate electronic waybill is used as a candidate response result, wherein the number of candidate electronic waybills is the current demand order quantity;
[0009] When the number-taking mode is the second number-taking mode, the remaining number of orders corresponding to the current user is obtained according to the current user identifier, and the remaining number of orders is deducted according to the current demand number of orders, and a candidate electronic waybill is generated according to the current demand number of orders, and each candidate electronic waybill is used as a candidate response result;
[0010] When the number-taking mode is the third number-taking mode, the remaining order quantity corresponding to the current user is obtained according to the current user identifier, and when the remaining order quantity is greater than or equal to the current demand order quantity, the remaining order quantity is deducted according to the current demand order quantity, and a candidate electronic waybill is generated according to the current demand order quantity, and each candidate electronic waybill is used as a candidate response result;
[0011] When the number taking mode is the fourth number taking mode, the remaining order quantity corresponding to the current user is obtained according to the current user identifier, and when the remaining order quantity is greater than or equal to the current demand order quantity, the remaining order quantity is deducted according to the current demand order quantity, and the remaining order quantity after deduction is used as the candidate response result.
[0012] Optionally, in another possible implementation of the first aspect, the historical electronic waybill data includes multiple historical electronic waybills, and accordingly, the verifying the candidate response result according to the historical electronic waybill data stored in the database includes:
[0013] When the number-taking mode is the first number-taking mode, the second number-taking mode or the third number-taking mode, determining whether each candidate electronic waybill is repeated with any historical electronic waybill;
[0014] When each candidate electronic waybill is not repeated with the historical electronic waybill, it is determined that the candidate response result verification is successful;
[0015] When there is a candidate electronic waybill that is repeated with any historical electronic waybill, it is determined that the candidate response result verification fails.
[0016] Optionally, in another possible implementation manner of the first aspect, the candidate electronic waybill includes a creation time and a candidate order number corresponding to the candidate electronic waybill, and the historical electronic waybill includes a creation time and a historical order number corresponding to the historical electronic waybill. Accordingly, the above-mentioned determination of whether each candidate electronic waybill is repeated with any historical electronic waybill includes:
[0017] When the creation time and candidate order number corresponding to the candidate electronic waybill are different from the creation time and historical order number corresponding to each historical electronic waybill, it is determined that each candidate electronic waybill is not repeated with the historical electronic waybill;
[0018] When the creation time and candidate order number corresponding to any candidate electronic waybill are the same as the creation time and historical order number corresponding to any historical electronic waybill, it is determined that there is a candidate electronic waybill that is repeated with any historical electronic waybill.
[0019] Optionally, in another possible implementation manner of the first aspect, the number of candidate electronic waybills that are repeated with the historical electronic waybills is N, where N is a positive integer. Accordingly, when there is a candidate electronic waybill that is repeated with any historical electronic waybill, after determining that the candidate response result verification fails, the method further includes:
[0020] Regenerate N candidate electronic waybills until none of the candidate electronic waybills are repeated with the historical electronic waybills;
[0021] The candidate response result verification is confirmed to be successful.
[0022] Optionally, in another possible implementation of the first aspect, before determining the number acquisition mode according to the current service type, the method further includes:
[0023] Get the request sequence number corresponding to the current number acquisition request;
[0024] It is determined that the request sequence number corresponding to the current number acquisition request is different from the request sequence numbers corresponding to each historical number acquisition request, wherein the historical number acquisition request refers to the number acquisition request obtained before the current number acquisition request.
[0025] Optionally, in yet another possible implementation of the first aspect, including:
[0026] The distributed cache is monitored according to preset monitoring indicators, wherein the preset monitoring indicators include at least one of the following indicators: the number segment balance corresponding to each service type, the operating status of the distributed cache, and the remaining number of orders corresponding to each user.
[0027] Optionally, in yet another possible implementation of the first aspect, the preset monitoring indicator includes a number segment margin corresponding to each of the service types. Accordingly, the monitoring of the distributed cache according to the preset monitoring indicator includes:
[0028] Obtain the number segment margin corresponding to each service type from the distributed cache;
[0029] When the number segment balance corresponding to any service type is insufficient, a number segment balance insufficient reminder message is generated and sent.
[0030] Optionally, in yet another possible implementation of the first aspect, the preset monitoring indicator includes an operating state of the distributed cache. Accordingly, the monitoring of the distributed cache according to the preset monitoring indicator includes:
[0031] Get the running status of the distributed cache;
[0032] When an abnormality occurs in the running state of the distributed cache, an abnormal running state reminder message is generated and sent.
[0033] Optionally, in yet another possible implementation of the first aspect, the preset monitoring indicator includes the remaining number of orders corresponding to each user. Accordingly, the monitoring of the distributed cache according to the preset monitoring indicator includes:
[0034] Get the remaining order quantity corresponding to each user from the distributed cache;
[0035] When the remaining order quantity corresponding to any user is less than a preset threshold, a reminder message of insufficient remaining order quantity is sent to any user.
[0036] Optionally, in yet another possible implementation of the first aspect, the preset monitoring indicator includes the remaining number of orders corresponding to each user. Accordingly, the monitoring of the distributed cache according to the preset monitoring indicator includes:
[0037] Get the remaining orders of each user in the distributed cache and the remaining orders in the database;
[0038] When the remaining order quantity of any user in the distributed cache does not match the remaining order quantity in the database, a remaining order quantity abnormality reminder message is sent to any user.
[0039] Optionally, in yet another possible implementation of the first aspect, when the remaining order quantity of any user in the distributed cache and the remaining order quantity in the database do not match, after sending the remaining order quantity abnormality reminder information to any user, the method further includes:
[0040] Suspend the acceptance of number application;
[0041] Write the remaining orders of any user in the database into the distributed cache;
[0042] Restart accepting number application.
[0043] In the second aspect, an embodiment of the present application provides a device for generating an express delivery number, including: a receiving module, used to receive a current number picking request sent by a current user, wherein the current number picking request includes a current user identifier, a current business type and a current required order quantity; a first determination module, used to determine a number picking mode according to the current business type; a generation module, used to generate a candidate response result corresponding to the current number picking request according to the number picking mode and the current required order quantity; a verification module, used to verify the candidate response result according to historical electronic waybill data stored in a database; a storage module, used to determine the candidate response result as a target response result when the candidate response result is verified successfully, and return the target response result to the current user according to the current user identifier, and then store the target response result in a distributed cache and persistently store it in the database.
[0044] In a possible implementation of the second aspect, the above-mentioned number taking mode includes at least one of a first number taking mode, a second number taking mode, a third number taking mode and a fourth number taking mode, wherein the first number taking mode refers to a number taking mode only, the second number taking mode is a number taking and order quantity deduction mode, the third number taking mode is a number taking, order quantity deduction and remaining order quantity verification mode, and the fourth number taking mode is an order quantity deduction mode.
[0045] Optionally, in another possible implementation of the second aspect, the generating module includes:
[0046] A first generating unit is used to generate a candidate electronic waybill according to the current demand order quantity when the number taking mode is the first number taking mode, and use each candidate electronic waybill as a candidate response result, wherein the number of candidate electronic waybills is the current demand order quantity;
[0047] A second generating unit is used to obtain the remaining order quantity corresponding to the current user according to the current user identifier when the number taking mode is the second number taking mode, deduct the remaining order quantity according to the current demand order quantity, and generate candidate electronic waybills according to the current demand order quantity, and use each candidate electronic waybill as a candidate response result;
[0048] A third generating unit is used to obtain the remaining order quantity corresponding to the current user according to the current user identifier when the number taking mode is the third number taking mode, and when the remaining order quantity is greater than or equal to the current demand order quantity, deduct the remaining order quantity according to the current demand order quantity, and generate candidate electronic waybills according to the current demand order quantity, and use each candidate electronic waybill as a candidate response result;
[0049] The first deduction unit is used to obtain the remaining order quantity corresponding to the current user according to the current user identifier when the number taking mode is the fourth number taking mode, and when the remaining order quantity is greater than or equal to the current demand order quantity, deduct the remaining order quantity according to the current demand order quantity, and use the remaining order quantity after deduction as the candidate response result.
[0050] Optionally, in another possible implementation of the second aspect, the historical electronic waybill data includes a plurality of historical electronic waybills, and accordingly, the verification module includes:
[0051] A first judgment unit is used to judge whether each candidate electronic waybill is repeated with any historical electronic waybill when the number-taking mode is the first number-taking mode, the second number-taking mode or the third number-taking mode;
[0052] A first determination unit is used to determine that the candidate response result verification is successful when each candidate electronic waybill is not repeated with the historical electronic waybill;
[0053] The second determining unit is used to determine that the candidate response result verification fails when there is a candidate electronic waybill that is repeated with any historical electronic waybill.
[0054] Optionally, in another possible implementation manner of the second aspect, the candidate electronic waybill includes a creation time and a candidate order number corresponding to the candidate electronic waybill, and the historical electronic waybill includes a creation time and a historical order number corresponding to the historical electronic waybill. Accordingly, the first judgment unit is specifically used to:
[0055] When the creation time and candidate order number corresponding to the candidate electronic waybill are different from the creation time and historical order number corresponding to each historical electronic waybill, it is determined that each candidate electronic waybill is not repeated with the historical electronic waybill;
[0056] When the creation time and candidate order number corresponding to any candidate electronic waybill are the same as the creation time and historical order number corresponding to any historical electronic waybill, it is determined that there is a candidate electronic waybill that is repeated with any historical electronic waybill.
[0057] Optionally, in another possible implementation of the second aspect, the number of candidate electronic waybills that are repeated with the historical electronic waybills is N, where N is a positive integer. Accordingly, the verification module further includes:
[0058] A fourth generating unit is used to regenerate N candidate electronic waybills until each candidate electronic waybill is not repeated with a historical electronic waybill;
[0059] The third determining unit is used to determine whether the candidate response result verification is successful.
[0060] Optionally, in another possible implementation manner of the second aspect, the apparatus further includes:
[0061] The acquisition module is used to obtain the request sequence number corresponding to the current number acquisition request;
[0062] The second determination module is used to determine that the request sequence number corresponding to the current number acquisition request is different from the request sequence numbers corresponding to each historical number acquisition request, wherein the historical number acquisition request refers to the number acquisition request obtained before the current number acquisition request.
[0063] Optionally, in yet another possible implementation of the second aspect, the apparatus includes:
[0064] The monitoring module is used to monitor the distributed cache according to preset monitoring indicators, wherein the preset monitoring indicators include at least one of the following indicators: the number segment balance corresponding to each service type, the operating status of the distributed cache, and the remaining order quantity corresponding to each user.
[0065] Optionally, in yet another possible implementation of the second aspect, the preset monitoring indicator includes a number segment margin corresponding to each of the service types, and accordingly, the monitoring module includes:
[0066] A first acquisition unit, used to acquire the number segment remainder corresponding to each service type from the distributed cache;
[0067] The first sending unit is used to generate and send a reminder message of insufficient segment balance when the segment balance corresponding to any service type is insufficient.
[0068] Optionally, in yet another possible implementation of the second aspect, the preset monitoring indicator includes an operating state of the distributed cache, and accordingly, the monitoring module includes:
[0069] A second acquisition unit, used to acquire the running status of the distributed cache;
[0070] The second sending unit is used to generate and send operation status abnormality reminder information when an abnormality occurs in the operation status of the distributed cache.
[0071] Optionally, in yet another possible implementation of the second aspect, the preset monitoring indicator includes the remaining number of orders corresponding to each user, and accordingly, the monitoring module includes:
[0072] A third acquisition unit is used to acquire the remaining order quantity corresponding to each user from the distributed cache;
[0073] The third sending unit is used to send a reminder message of insufficient remaining orders to any user when the remaining order quantity corresponding to any user is less than a preset threshold.
[0074] Optionally, in yet another possible implementation of the second aspect, the preset monitoring indicator includes the remaining number of orders corresponding to each user, and accordingly, the monitoring module includes:
[0075] A fourth acquisition unit, used to acquire the remaining orders of each user in the distributed cache and the remaining orders in the database;
[0076] The fourth sending unit is used to send a remaining order quantity abnormal reminder message to any user when the remaining order quantity of any user in the distributed cache and the remaining order quantity in the database do not match.
[0077] Optionally, in yet another possible implementation of the second aspect, the monitoring module further includes:
[0078] A pause unit, used to pause receiving number taking applications;
[0079] A writing unit is used to write the remaining orders of any user in the database into the distributed cache;
[0080] The receiving unit is used to restart receiving number-taking applications.
[0081] In a third aspect, an embodiment of the present application provides a terminal device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method for generating an express delivery number as described above when executing the computer program.
[0082] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored, characterized in that when the computer program is executed by a processor, the method for generating an express delivery number as described above is implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0083] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0084] Figure 1 It is a flowchart of a method for generating a courier number provided in an embodiment of the present application;
[0085] Figure 2 It is a flowchart of a method for generating a courier number provided in another embodiment of the present application;
[0086] Figure 3 It is a flowchart of a method for generating a courier number provided in yet another embodiment of the present application;
[0087] Figure 4 It is a flowchart of a method for generating a courier number provided in another embodiment of the present application;
[0088] Figure 5 It is a flowchart of a method for generating a courier number provided in another embodiment of the present application;
[0089] Figure 6 It is a flowchart of a method for generating a courier number provided in another embodiment of the present application;
[0090] Figure 7 It is a flowchart of a method for generating a courier number provided in another embodiment of the present application;
[0091] Figure 8 It is a structural schematic diagram of a device for generating a courier number provided in an embodiment of the present application;
[0092] Fig. 9 It is a schematic diagram of the structure of the terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0093] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0094] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0095] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0096] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0097] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0098] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0099] The following is a detailed description of the method, device, terminal device and storage medium for generating the express delivery number provided in the present application with reference to the accompanying drawings.
[0100] Figure 1 A flow chart of a method for generating an express delivery number provided in an embodiment of the present application is shown.
[0101] Step 101, receiving a current number acquisition request sent by a current user, wherein the current number acquisition request includes a current user identifier, a current service type, and a current demand order quantity.
[0102] It should be noted that the method for generating the express delivery number of the embodiment of the present application can be executed by the device for generating the express delivery number of the embodiment of the present application. The device for generating the express delivery number of the embodiment of the present application can be configured in any terminal device to execute the method for generating the express delivery number of the embodiment of the present application.
[0103] The number acquisition request may refer to a request sent by a user to a server to obtain a courier number when applying for a courier number.
[0104] Among them, the user identifier may refer to an identifier used to distinguish and identify different user information. One user corresponds to one user identifier. For example, the user identifier may be the user's category, name, mobile phone number, or the account ID of the user to which the user sends a number acquisition request.
[0105] The business type may refer to a specific business or service category that a user needs to handle.
[0106] For example, the business type can be different business types such as Cainiao orders, international orders, package pickup numbers, and return forwarding orders.
[0107] The demand order quantity may refer to the number of express delivery numbers required by the user.
[0108] In an embodiment of the present application, a user can send a number taking request. After receiving the number taking request currently sent by the user, the current user identifier, current service type and current demand order quantity contained in the current number taking request are also received. The number taking mode of the current number taking request is judged based on the above-obtained information.
[0109] Step 102, determining the number acquisition mode according to the current service type.
[0110] Among them, the number collection mode may refer to different processing modes after receiving a request for generating an express delivery number.
[0111] For example, the number-picking mode can be to pick up the express order number but not deduct the order quantity, to pick up the express order number and deduct the order quantity at the same time, to pick up the express order number and deduct the order quantity and verify whether the order quantity is sufficient, to not pick up the express order number but deduct the order quantity, etc.
[0112] In an embodiment of the present application, the current service type can be obtained after receiving the user's current number acquisition request, and the number acquisition mode corresponding to the current service type can be determined by analyzing the current service type to generate a candidate response object corresponding to the current number acquisition request and verify it.
[0113] Step 103: Generate candidate response results corresponding to the current number-taking request according to the number-taking mode and the current demand order quantity.
[0114] Among them, the candidate response result may refer to a response result to be verified that is generated based on the current number-taking mode and the current demand order quantity.
[0115] In an embodiment of the present application, the number picking mode and the current required order quantity can be first obtained according to the current number picking request, and then candidate response results can be generated according to the number picking mode and the current required order quantity, so as to verify and compare the historical electronic waybills stored in the database with the above candidate response results.
[0116] Step 104, verify the candidate response results according to the historical electronic waybill data stored in the database.
[0117] In the embodiment of the present application, the generated historical electronic waybill data can be persistently stored in the database, and the historical waybill data in the database can be used to verify the current candidate response result to prevent the current candidate response result from having duplicate numbers and other problems. Therefore, after obtaining the candidate response result corresponding to the current number-taking request, the historical waybill data stored in the database can be used to verify the candidate response result to determine whether the candidate response result is successfully verified, thereby improving the stability of the express number generation and also improving the reliability of the express number generation.
[0118] Step 105, when the candidate response result verification succeeds, the candidate response result is determined as the target response result, and the target response result is returned to the current user according to the current user identifier, and then the target response result is stored in the distributed cache and persistently stored in the database.
[0119] The target response result may refer to a candidate response result that has been verified and successfully verified.
[0120] Among them, distributed cache can refer to a system that caches data on multiple nodes to improve data access speed and scalability. For example, Redis system, Memcached system, Hazelcast system, Apache Ignite system and Couchbase system are all distributed cache systems.
[0121] Among them, persistent storage can refer to a mechanism or technology for storing data in a computer system for a long time, which can ensure that the data can be retained and restored after the system is restarted, power outage or application is closed.
[0122] It should be noted that in a computer system, data is usually stored in memory, but the data in the memory is volatile, which means that it will be lost when the system is powered off or restarted. In order to avoid data loss, the data needs to be persistently stored in non-volatile media, such as a hard disk, a solid-state drive (SSD) or a database, etc. The database can use a relational database, such as a MySQL database and an Oracle database, or a NoSQL database, which is not limited in the embodiments of the present application.
[0123] In an embodiment of the present application, when the candidate response result is successfully verified, the above candidate response result can be used as the target response result, and then the target response result can be returned to the user according to the user identifier, and finally the target response result can be stored in the distributed cache and the database, thereby ultimately realizing the generation of the express delivery number.
[0124] It should be noted that storing the successfully verified target response results in the distributed cache can prevent the distributed cache from generating duplicate historical electronic waybill data that is stored in itself during normal operation, thereby preventing the problem of high duplication of response results generated by the distributed cache and historical electronic waybill data in the database, which not only meets the demand for high order volume, but also ensures the efficiency and reliability of express delivery number generation; and persistently storing the successfully verified target response results in the database can verify the candidate response results generated by the distributed cache through the historical electronic waybill data in the database when data loss occurs in the distributed cache, thereby avoiding the problem of duplicate express delivery number caused by abnormal situations such as data loss in the distributed cache, and ensuring the stability and reliability of express delivery number generation.
[0125] The method for generating the express delivery number provided in the present application determines the number picking mode according to the current business type when receiving the current number picking request sent by the current user, and generates a candidate response result corresponding to the current number picking request according to the number picking mode and the current demand order quantity, and then verifies the candidate response result according to the historical electronic waybill data stored in the database. When the candidate response result verification is successful, the candidate response result is determined as the target response result, and the target response result is returned to the current user according to the current user identifier, and then the target response result is stored in the distributed cache and persistently stored in the database. Thus, the performance requirements of the high order volume scenario are met through the distributed cache, the stability of the generation of the express delivery number is improved, and the express data generated in the distributed cache is persistently stored through the database, and the response result generated in real time by the distributed cache is verified using the persistent data in the database, thereby not only improving the stability of the generation of the express delivery number, but also improving the reliability of the generation of the express delivery number.
[0126] In a possible implementation form of the present application, because different business types can correspond to different number-taking modes, the response results corresponding to different number-taking modes may also be different, thereby making the express delivery number generation method of the present application applicable to a wider range of businesses and having better practicality and versatility.
[0127] Combine the following Figure 2 , the method for generating the express delivery number provided in the embodiment of the present application is further explained.
[0128] Figure 2 A flow chart of another method for generating an express delivery number provided in an embodiment of the present application is shown.
[0129] Step 201, receiving a current number acquisition request sent by a current user, wherein the current number acquisition request includes a current user identifier, a current service type, and a current demand order quantity.
[0130] The specific implementation process and principle of the above step 201 can refer to the detailed description of the above embodiment, which will not be repeated here.
[0131] Step 202, determine the number taking mode according to the current business type, the number taking mode includes at least one of a first number taking mode, a second number taking mode, a third number taking mode and a fourth number taking mode, wherein the first number taking mode refers to a number taking mode only, the second number taking mode is a number taking and order quantity deduction mode, the third number taking mode is a number taking, order quantity deduction and remaining order quantity verification mode, and the fourth number taking mode is an order quantity deduction mode.
[0132] For example, the first number-taking mode refers to a number-taking mode only. For example, when a user forwards or returns a package, the order quantity will not be deducted, and only the order number will be generated, because the order quantity deduction has already been performed when forwarding or returning the package; the second number-taking mode is a number-taking and order quantity deduction mode. For example, a user completes an order on the platform and selects the express delivery option. After the platform system receives the order, it will generate an express number for the order, and at the same time deduct the corresponding order quantity from the total order quantity in the system, indicating that the order has occupied an express number. The platform system will return the generated express number to the user together with the order-related information so that the user can view the logistics tracking information on the platform. The user can use the express number to track the logistics status of the goods in real time on the express company's official website, mobile application or other query platform. In the process of the user obtaining the express number by placing an order, the system will deduct the corresponding order quantity to ensure that each order can obtain a unique express number, but will not verify the remaining order quantity. Instead, the corresponding order quantity will be deducted when the order number is generated. This can quickly provide users with express delivery numbers and enable them to easily track logistics information; the third number-taking mode is a number-taking, deducting order quantity and verifying remaining order quantity mode. For example, in an express franchise outlet, when a user sends a number-taking request, an express delivery number will be generated, and the remaining order quantity will be deducted, and then the remaining order quantity will be verified. Because in the franchise outlets, express delivery orders need to be purchased, so in order to prevent the remaining express delivery numbers from being negative, it is necessary to verify the remaining express delivery numbers; the fourth number-taking mode is an order quantity deduction mode. For example, when conducting a large-scale online order business, the user submits a number-taking request for a large-scale online order. After receiving the number-taking request, it will be verified and processed according to the business type. The system will deduct the balance in the system according to the uploaded order quantity to ensure the remaining available order quantity.
[0133] In the embodiment of the present application, the number picking mode can be determined by identifying different business types, and by analyzing different number picking modes, the candidate response results corresponding to the different number picking modes can be determined.
[0134] Step 203, when the number taking mode is the first number taking mode, a candidate electronic waybill is generated according to the current demand order quantity, and each candidate electronic waybill is used as a candidate response result, wherein the number of candidate electronic waybills is the current demand order quantity.
[0135] In the embodiment of the present application, because the number taking mode is the first number taking mode, that is, the number taking mode only, a candidate electronic waybill is generated according to the current demand order quantity, and the candidate electronic waybill is further used as a candidate response result, so as to verify the candidate response result of the first number taking mode.
[0136] Step 204, when the number taking mode is the second number taking mode, obtain the remaining order quantity corresponding to the current user according to the current user identifier, deduct the remaining order quantity according to the current demand order quantity, and generate candidate electronic waybills according to the current demand order quantity, and use each candidate electronic waybill as a candidate response result.
[0137] In the embodiment of the present application, because the number taking mode is the second number taking mode, that is, the number taking and order quantity deduction mode, the remaining order quantity corresponding to the current user is obtained according to the current user identifier, and the remaining order quantity is deducted according to the current demand order quantity, and the candidate electronic waybill is generated according to the current demand order quantity, and the candidate electronic waybill is further used as the candidate response result, so as to verify the candidate response result of the second number taking mode.
[0138] Step 205, when the number taking mode is the third number taking mode, obtain the remaining order quantity corresponding to the current user according to the current user identifier, and when the remaining order quantity is greater than or equal to the current demanded order quantity, deduct the remaining order quantity according to the current demanded order quantity, and generate candidate electronic waybills according to the current demanded order quantity, and use each candidate electronic waybill as a candidate response result.
[0139] In an embodiment of the present application, because the number taking mode is the third number taking mode, that is, the number taking, deducting order quantity and verifying remaining order quantity mode, the remaining order quantity corresponding to the current user is obtained according to the current user identifier, and when the remaining order quantity is greater than or equal to the current required order quantity, the remaining order quantity is deducted according to the current required order quantity, and a candidate electronic waybill is generated according to the current required order quantity, and the candidate electronic waybill is further used as a candidate response result, thereby verifying the candidate response result of the third number taking mode.
[0140] Step 206, when the number taking mode is the fourth number taking mode, obtain the remaining order quantity corresponding to the current user according to the current user identifier, and when the remaining order quantity is greater than or equal to the current demand order quantity, deduct the remaining order quantity according to the current demand order quantity, and use the remaining order quantity after deduction as the candidate response result.
[0141] In the embodiment of the present application, because the number taking mode is the fourth number taking mode, that is, the order quantity deduction mode, the remaining order quantity corresponding to the current user is obtained according to the current user identifier, and when the remaining order quantity is greater than or equal to the current demand order quantity, the remaining order quantity is deducted according to the current demand order quantity, and the remaining order quantity after deduction is used as the candidate response result, thereby verifying the candidate response result of the fourth number taking mode.
[0142] Step 207, verifying the candidate response results according to the historical electronic manifest data stored in the database.
[0143] Step 208, when the candidate response result verification succeeds, the candidate response result is determined as the target response result, and the target response result is returned to the current user according to the current user identifier, and then the target response result is stored in the distributed cache and persistently stored in the database.
[0144] The specific implementation process and principle of the above steps 207-208 can refer to the detailed description of the above embodiment, which will not be repeated here.
[0145] The method for generating the express delivery number provided in the present application first determines the number picking mode according to the current business type in the current number picking request, and generates different candidate response results according to different number picking modes, and then verifies the candidate response results according to the historical electronic waybill data stored in the database. When the candidate response result verification is successful, the candidate response result is determined as the target response result, and the target response result is returned to the current user according to the current user identifier, and then the target response result is stored in the distributed cache and persistently stored in the database. Therefore, by generating different response results and verifying the response results when the number picking mode is different, not only the reliability and stability of the generation of the express delivery number is improved, but also the applicable business scope of the generation of the express delivery number is further improved, and the versatility and practicality are better.
[0146] In one possible implementation form of the present application, the candidate response results can be verified through the historical electronic waybills stored in the database to determine whether there are candidate electronic waybills in the candidate response results that are repeated with the historical electronic waybills, so as to ensure that the generated express delivery number is not repeated.
[0147] Combine the following Figure 3 , the method for generating the express delivery number provided in the embodiment of the present application is further explained.
[0148] Figure 3 A flow chart of another method for generating an express delivery number provided in an embodiment of the present application is shown.
[0149] Step 301, receiving a current number acquisition request sent by a current user, wherein the current number acquisition request includes a current user identifier, a current service type, and a current demand order quantity.
[0150] Step 302, determine the number acquisition mode according to the current service type.
[0151] Step 303: Generate candidate response results corresponding to the current number-taking request according to the number-taking mode and the current demand order quantity.
[0152] The specific implementation process and principle of the above steps 301-303 can be referred to the detailed description of the above embodiment, which will not be repeated here.
[0153] Step 304, when the number-taking mode is the first number-taking mode, the second number-taking mode or the third number-taking mode, determine whether each candidate electronic waybill is the same as any historical electronic waybill.
[0154] It should be noted that the criterion for determining whether a candidate electronic waybill is a duplicate of a historical electronic waybill may be the repetition of any information contained in the electronic waybill, for example, the creation time in the candidate electronic waybill is the same as the creation time of the historical electronic waybill, the creation place in the candidate electronic waybill is the same as the creation place of the historical electronic waybill, etc. The embodiments of the present application do not limit this.
[0155] In an embodiment of the present application, when the number taking mode is the first, second, or third number taking mode, a candidate electronic waybill can be generated for each number taking mode, and then the candidate electronic waybill can be compared with the historical electronic waybill to determine whether there are any candidate electronic waybills that are duplicated with the historical electronic waybill.
[0156] Step 305: When each candidate electronic waybill is not repeated with the historical electronic waybill, it is determined that the candidate response result verification is successful.
[0157] In an embodiment of the present application, after verifying the candidate electronic waybill with the historical electronic waybill, if it is found that there is no duplication between the candidate electronic waybill and any historical electronic waybill, it is determined that the candidate response result corresponding to the candidate electronic waybill has been successfully verified.
[0158] Step 306: When there is a candidate electronic waybill that is repeated with any historical electronic waybill, it is determined that the candidate response result verification fails.
[0159] In an embodiment of the present application, after verifying the candidate electronic waybill with the historical electronic waybill, if it is found that the candidate electronic waybill is repeated with any historical electronic waybill, it is determined that the candidate response result corresponding to the candidate electronic waybill has failed verification.
[0160] Step 307, regenerate N candidate electronic waybills until none of the candidate electronic waybills are repeated with the historical electronic waybills.
[0161] In an embodiment of the present application, when the verification of the candidate response result corresponding to the candidate electronic waybill fails, a subsequent electronic waybill is regenerated, and the regenerated candidate electronic waybill is further proofread with any historical electronic waybill until the regenerated candidate electronic waybill and the historical electronic waybill are not repeated. This ensures that the target response result corresponding to the number-taking request will be generated after receiving the user's number-taking request.
[0162] Step 308: Determine whether the candidate response result verification is successful.
[0163] In an embodiment of the present application, when the regenerated candidate electronic waybill does not duplicate the historical electronic waybill, it can be determined that the candidate response result corresponding to the candidate electronic waybill has been successfully verified.
[0164] The method for generating the express delivery number provided in the present application determines the number picking mode according to the current business type in the current number picking request, and then generates the candidate response result corresponding to the current number picking request according to the number picking mode and the current demand order quantity, and then when the number picking mode is the first number picking mode, the second number picking mode or the third number picking mode, it is determined whether each candidate electronic waybill is repeated with any historical electronic waybill, and when each candidate electronic waybill is not repeated with any historical electronic waybill, it is determined that the candidate response result verification is successful, and when there is a candidate electronic waybill that is repeated with any historical electronic waybill, it is determined that the candidate response result verification fails, and then N candidate electronic waybills are regenerated until each candidate electronic waybill is not repeated with the historical electronic waybill, and finally it is determined that the candidate response result verification is successful. Thus, the generated electronic waybill is verified by the data persistently stored in the database, so that the problem of duplicate numbers caused by the asynchronous data of the distributed cache can be prevented when the electronic waybill is generated, thereby further improving the reliability of the generation of the express delivery number.
[0165] In one possible implementation form of the present application, the creation time and candidate order number corresponding to the candidate electronic waybill can be compared with the creation time and historical order number corresponding to each historical electronic waybill to determine whether the order number of the subsequent electronic waybill is repeated, so as to improve verification efficiency.
[0166] Combine the following Figure 4 , the method for generating the express delivery number provided in the embodiment of the present application is further explained.
[0167] Figure 4 A flow chart of another method for generating an express delivery number provided in an embodiment of the present application is shown.
[0168] Step 401, receiving a current number acquisition request sent by a current user, wherein the current number acquisition request includes a current user identifier, a current service type, and a current demand order quantity.
[0169] Step 402, determine the number acquisition mode according to the current service type.
[0170] Step 403: Generate candidate response results corresponding to the current number-taking request according to the number-taking mode and the current demand order quantity.
[0171] The specific implementation process and principle of the above steps 401-403 can be referred to the detailed description of the above embodiment, which will not be repeated here.
[0172] Step 404, when the number picking mode is the first number picking mode, the second number picking mode or the third number picking mode, when the creation time and candidate order number corresponding to the candidate electronic waybill are different from the creation time and historical order number corresponding to each historical electronic waybill, determine that each candidate electronic waybill is not repeated with the historical electronic waybill.
[0173] Step 405, when the number taking mode is the first number taking mode, the second number taking mode or the third number taking mode, when the creation time and candidate order number corresponding to any candidate electronic waybill are the same as the creation time and historical order number corresponding to any historical electronic waybill, it is determined that there is a candidate electronic waybill that is repeated with any historical electronic waybill.
[0174] In an embodiment of the present application, when the number picking mode is not the first, second, or third number picking mode, the creation time and the candidate order number in the candidate electronic waybill can be determined and compared with the creation time and the historical order number in each historical electronic waybill. If the creation time and the candidate order number in the candidate electronic waybill are different from the creation time and the historical order number in each historical electronic waybill, it can be determined that each candidate electronic waybill is not repeated with the historical electronic waybill; if the creation time and the candidate order number in the candidate electronic waybill are the same as the creation time and the historical order number in any historical electronic waybill, it can be determined that there is a candidate electronic waybill that is repeated with any historical electronic waybill. Therefore, the creation time and the order number contained in the electronic waybill can be used to determine whether there is a repetition between the candidate electronic waybill and the historical electronic waybill, and the candidate response results can be verified more quickly and accurately.
[0175] It should be noted that when comparing the candidate electronic waybill with the historical electronic waybill to see if they are duplicates, it includes but is not limited to the creation time and order number in the electronic waybill, and may also be other data or data combinations in the electronic waybill, such as the creation location of the electronic waybill, the creation location and creation time of the electronic waybill, the order number, creation time and creation location of the electronic waybill, etc. The embodiments of the present application are not limited to this.
[0176] Step 406: When each candidate electronic waybill is not repeated with the historical electronic waybill, it is determined that the candidate response result verification is successful.
[0177] Step 407: When there is a candidate electronic waybill that is repeated with any historical electronic waybill, it is determined that the candidate response result verification fails.
[0178] Step 408, when the candidate response result verification succeeds, the candidate response result is determined as the target response result, and the target response result is returned to the current user according to the current user identifier, and then the target response result is stored in the distributed cache and persistently stored in the database.
[0179] The specific implementation process and principle of the above steps 406-408 can be referred to the detailed description of the above embodiment, which will not be repeated here.
[0180] The method for generating the express delivery number provided in the present application compares the creation time and candidate number in the candidate electronic waybill with the creation time and historical number in the historical electronic waybill, thereby determining whether the candidate electronic waybill is repeated with any historical electronic waybill, and further determining whether the candidate response result is successfully verified. Thus, by comparing the creation time and candidate number in the candidate electronic waybill with the creation time and historical number in the historical electronic waybill, the candidate response result can be verified more quickly and accurately, thereby further improving the reliability of the generation of the express delivery number and improving the verification efficiency.
[0181] In a possible implementation form of the present application, the number-taking request sent by the user can also be verified through idempotency protection, thereby avoiding repeated responses to the same number-taking request raised by the user and wasting system resources.
[0182] Combine the following Figure 5 , the method for generating the express delivery number provided in the embodiment of the present application is further explained.
[0183] Figure 5 A flow chart of another method for generating an express delivery number provided in an embodiment of the present application is shown.
[0184] Step 501, receiving a current number acquisition request sent by a current user, wherein the current number acquisition request includes a current user identifier, a current service type, and a current demand order quantity.
[0185] The specific implementation process and principle of the above step 501 can refer to the detailed description of the above embodiment, which will not be repeated here.
[0186] Step 502, obtaining the request sequence number corresponding to the current number acquisition request.
[0187] The request serial number may refer to a unique serial number used to identify and track number acquisition requests.
[0188] It should be noted that the request sequence number can be any unique identifier, such as a randomly generated string, number, timestamp, etc. Its generation method is related to the specific application scenario.
[0189] For example, suppose there is a communication process between a client and a server based on the HTTP protocol. The client sends a request to obtain a number to the server. The request contains a unique request sequence number. The request is as follows:
[0190] GET / api / users HTTP / 1.1
[0191] Host:example.com
[0192] User-Agent:Mozilla / 5.0
[0193] Request-ID:123456789
[0194] In the above example, the Request-ID header field in the number-retrieval request is used to carry the request sequence number, which is set to 123456789 here.
[0195] In an embodiment of the present application, after receiving the current number taking request, the request sequence number corresponding to the current number taking request can be obtained, and further verified based on the request sequence number of the current number taking request and the request sequence numbers corresponding to each historical number taking request.
[0196] Step 503: determine that the request sequence number corresponding to the current number acquisition request is different from the request sequence numbers corresponding to each historical number acquisition request.
[0197] The historical number-taking request may refer to the number-taking request obtained before the current number-taking request.
[0198] As a possible implementation method, when the request sequence number corresponding to the current number acquisition request is the same as the request sequence number corresponding to each historical number acquisition request, information indicating that the current number acquisition request response has failed may be sent to the user.
[0199] In an embodiment of the present application, the request serial number corresponding to the current number taking request can be compared with the request serial numbers corresponding to each historical number taking request. When the request serial number corresponding to the current number taking request is different from the request serial numbers corresponding to each historical number taking request, the uniqueness of the current number taking request can be determined. Furthermore, the number taking mode can be determined based on the current number taking request.
[0200] Step 504, determine the number acquisition mode according to the current service type.
[0201] Step 505: Generate candidate response results corresponding to the current number-taking request according to the number-taking mode and the current demand order quantity.
[0202] Step 506, verify the candidate response results according to the historical electronic manifest data stored in the database.
[0203] Step 507, when the candidate response result verification succeeds, the candidate response result is determined as the target response result, and the target response result is returned to the current user according to the current user identifier, and then the target response result is stored in the distributed cache and persistently stored in the database.
[0204] The specific implementation process and principle of the above steps 504-507 can be referred to the detailed description of the above embodiment, which will not be repeated here.
[0205] The method for generating the express delivery number provided by the present application obtains the request sequence number corresponding to the current number-taking request, and when it is determined that the request sequence number corresponding to the current number-taking request is different from the request sequence numbers corresponding to each historical number-taking request, determines the number-taking mode according to the current business type, and then generates a candidate response result corresponding to the current number-taking request according to the number-taking mode and the current demand order quantity, and then verifies the candidate response result according to the historical electronic waybill data stored in the database, and finally determines the candidate response result as the target response result when the candidate response result verification succeeds, and returns the target response result to the current user according to the current user identifier, and then stores the target response result in the distributed cache and persistently stores it in the database. Thus, by verifying the uniqueness of the request sequence number of the number-taking request, it is avoided to respond to the same number-taking request multiple times, thereby not only further improving the reliability of the generation of the express delivery number, but also avoiding the waste of system resources.
[0206] In a possible implementation form of the present application, the distributed cache may also be tested to ensure the stability of the distributed cache.
[0207] Combine the following Figure 6 , the method for generating the express delivery number provided in the embodiment of the present application is further explained.
[0208] Figure 6 A flow chart of another method for generating an express delivery number provided in an embodiment of the present application is shown.
[0209] Step 601, receiving a current number acquisition request sent by a current user, wherein the current number acquisition request includes a current user identifier, a current service type, and a current demand order quantity.
[0210] Step 602, determine the number acquisition mode according to the current service type.
[0211] Step 603: Generate candidate response results corresponding to the current number-taking request according to the number-taking mode and the current demand order quantity.
[0212] Step 604, verify the candidate response results according to the historical electronic manifest data stored in the database.
[0213] Step 605, when the candidate response result verification succeeds, the candidate response result is determined as the target response result, and the target response result is returned to the current user according to the current user identifier, and then the target response result is stored in the distributed cache and persistently stored in the database.
[0214] The specific implementation process and principle of the above steps 601-605 can refer to the detailed description of the above embodiment, which will not be repeated here.
[0215] Step 606: monitor the distributed cache according to preset monitoring indicators.
[0216] Among them, the preset monitoring indicators may include at least one of the following indicators: the number segment balance corresponding to each service type, the operating status of the distributed cache, and the remaining number of orders corresponding to each user.
[0217] It should be noted that the number segment corresponding to each service type may mean that different service types may correspond to a different number segment. For example, when the service type is a forwarding order, the corresponding number segment is 110, and when the service type is a large network order, the corresponding number segment is 120.
[0218] It should be noted that the operating status of the distributed cache includes but is not limited to abnormalities, such as cache node status, cache hit rate, cache usage, request volume and throughput, and data distribution.
[0219] In an embodiment of the present application, the normal operation of the distributed cache can be ensured by monitoring the number segment balance corresponding to each service type, the operating status of the distributed cache, and the remaining orders corresponding to each user.
[0220] Further, in a possible implementation of the embodiment of the present application, when the preset monitoring indicator includes the number segment margin corresponding to each service type, the above step 606 may include:
[0221] The number segment balance corresponding to each service type is obtained from the distributed cache, and when the number segment balance corresponding to any service type is insufficient, a number segment balance insufficient reminder message is generated and sent.
[0222] As a possible implementation method, the determination of insufficient number segment balance can be made by presetting a threshold. When the number segment balance is less than the threshold, it is determined that the current number segment balance is insufficient. Alternatively, when the usage duration of the current number segment balance is less than the preset duration, it is determined that the current number segment balance is insufficient. The embodiments of the present application do not limit this.
[0223] It should be noted that when the number segment balance corresponding to any business type is insufficient, the generated number segment balance insufficient reminder information will be sent to the express service maintenance personnel or the next-level branch service center.
[0224] In an embodiment of the present application, the segment capacity corresponding to each business type in the distributed cache can be monitored. When the segment capacity is insufficient, a segment balance insufficient reminder message is generated and sent, so that the segment balance corresponding to each business type can be grasped in real time to ensure the normal generation of express delivery numbers and prevent emergencies.
[0225] Further, in a possible implementation of the embodiment of the present application, when the preset monitoring indicator includes the running status of the distributed cache, the above step 606 may include:
[0226] Get the running status of the distributed cache, and when an abnormality occurs in the running status of the distributed cache, generate and send running status abnormality reminder information.
[0227] It should be noted that when the running status of the distributed cache is abnormal, it may be that the cache node is down, the cache hit rate is reduced, the cache capacity is insufficient, the request response time is extended, there are data consistency issues, and the cache is lost or wrong.
[0228] In an embodiment of the present application, the operating status of the distributed cache can be monitored. When the operating status of the distributed cache is abnormal, a reminder message of the abnormal operating status is sent to the server maintenance personnel. By monitoring the operating status of the distributed cache, the process of generating express delivery numbers can be guaranteed to be normal, and the distributed cache can be maintained in a timely and effective manner.
[0229] Further, in a possible implementation of the embodiment of the present application, when the preset monitoring indicator includes the remaining number of orders corresponding to each user, the above step 606 may include:
[0230] The remaining order quantity corresponding to each user is obtained from the distributed cache. When the remaining order quantity corresponding to any user is less than the preset threshold, a reminder message of insufficient remaining order quantity is sent to any user.
[0231] In an embodiment of the present application, the remaining number of orders corresponding to each user in the distributed cache can be monitored. When the remaining number of orders is less than a preset threshold, a reminder message that the remaining number of orders is insufficient is sent. This can promptly inform the user of the insufficient number of orders and replenish the number of orders in advance to ensure the normal operation of the express order number generation.
[0232] Further, in a possible implementation of the embodiment of the present application, when the preset monitoring indicator includes the remaining number of orders corresponding to each user, the above step 606 may include:
[0233] Obtain the remaining order quantity of each user in the distributed cache and the remaining order quantity in the database. When the remaining order quantity of any user in the distributed cache and the remaining order quantity in the database do not match, send a remaining order quantity abnormal reminder message to any user.
[0234] As a possible implementation method, there may be the following situations where the remaining order quantity of any user in the distributed cache and the remaining order quantity in the database do not match: first, the remaining order quantity in the distributed cache is different from the remaining order quantity in the database; second, the difference between the remaining order quantity in the distributed cache and the remaining order quantity in the database is less than a preset threshold, etc. This application does not limit this.
[0235] In an embodiment of the present application, the remaining order quantity of each user in the distributed cache can be obtained first, and then the remaining order quantity of each user in the database can be obtained. When the remaining order quantity in the distributed cache does not match the remaining order quantity in the database, an abnormal remaining order quantity reminder message is sent to the user. Thus, by comparing the remaining order quantity in the database, it is determined whether the remaining order quantity in the distributed cache is normal, thereby avoiding the problem of poor reliability of storing the remaining order quantity in the distributed cache.
[0236] The method for generating the express number provided by the present application can monitor the distributed cache according to the preset monitoring indicators, so as to send an abnormal reminder message when any preset monitoring indicator is abnormal. Therefore, by monitoring the distributed cache, not only the stability of the distributed cache is improved, but also the user's remaining order quantity is guaranteed to be sufficient, further improving the reliability and stability of the generation of the express number.
[0237] In a possible implementation form of the present application, when an abnormality is found after the distributed cache is detected, a disaster recovery program can be used to ensure the stability and reliability of the distributed cache operation.
[0238] Combine the following Figure 7 , the method for generating the express delivery number provided in the embodiment of the present application is further explained.
[0239] Figure 7A flow chart of another method for generating an express delivery number provided in an embodiment of the present application is shown.
[0240] Step 701, receiving a current number acquisition request sent by a current user, wherein the current number acquisition request includes a current user identifier, a current service type, and a current demand order quantity.
[0241] Step 702, determine the number acquisition mode according to the current service type.
[0242] Step 703: Generate candidate response results corresponding to the current number-taking request according to the number-taking mode and the current demand order quantity.
[0243] Step 704, verify the candidate response results according to the historical electronic manifest data stored in the database.
[0244] Step 705, when the candidate response result verification succeeds, the candidate response result is determined as the target response result, and the target response result is returned to the current user according to the current user identifier, and then the target response result is stored in the distributed cache and persistently stored in the database.
[0245] Step 706, obtaining the remaining orders of each user in the distributed cache and the remaining orders in the database.
[0246] Step 707: When the remaining order quantity of any user in the distributed cache and the remaining order quantity in the database do not match, a remaining order quantity abnormality reminder message is sent to any user.
[0247] The specific implementation process and principle of the above steps 701-707 can be referred to the detailed description of the above embodiment, which will not be repeated here.
[0248] Step 708, suspend receiving number acquisition applications.
[0249] In an embodiment of the present application, when an abnormal reminder message of the remaining number of orders is received, the acceptance of number-taking applications is suspended to perform subsequent disaster recovery procedures.
[0250] Step 709: Write the remaining orders of any user in the database into the distributed cache.
[0251] It should be noted that because the distributed cache will lose the data of the remaining order quantity in the distributed cache in the event of master-slave server switching, distributed cache memory eviction, failure, and RDB file damage, the remaining order quantity in the database can be obtained, and then the required order quantity can be subtracted from the remaining order quantity to obtain the real-time remaining order quantity, and then the real-time remaining order quantity obtained from the database can be written into the distributed cache, so as to accurately restore the user's remaining order quantity in the distributed cache.
[0252] In an embodiment of the present application, after suspending the number-taking application, the remaining number of orders in the database can be written into the distributed cache to regain the remaining number of orders lost in the distributed cache.
[0253] Step 710, restart receiving number acquisition applications.
[0254] In an embodiment of the present application, after the remaining number of orders in the distributed cache is restored, number-taking applications sent by users can continue to be received.
[0255] The method for generating express delivery number provided by the present application obtains the remaining number of orders in the distributed cache and the remaining number of orders in the database of each user. When the remaining number of orders in the distributed cache and the remaining number of orders in the database of any user do not match, a remaining number abnormality reminder message is sent to any user, and then the acceptance of number collection applications is suspended, and the remaining number of orders in the database of any user is written into the distributed cache, and finally the acceptance of number collection applications is restarted. Therefore, when the remaining number of orders in the distributed cache is abnormal, the stability and reliability of the distributed cache operation can be guaranteed through the disaster recovery program, and the reliability of the generation of express delivery number is further improved.
[0256] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0257] Corresponding to the method for generating the express delivery number in the above embodiment, Figure 8 A structural block diagram of a device for generating an express delivery number provided in an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.
[0258] Reference Figure 8 , the device 800 comprises:
[0259] The receiving module 801 is used to receive the current number-taking request sent by the current user, wherein the current number-taking request includes the current user identifier, the current service type and the current demand order quantity;
[0260] The first determination module 802 is used to determine the number acquisition mode according to the current service type;
[0261] A generating module 803 is used to generate a candidate response result corresponding to the current number-taking request according to the number-taking mode and the current demand order quantity;
[0262] Verification module 804, used to verify the candidate response results according to the historical electronic waybill data stored in the database;
[0263] The storage module 805 is used to determine the candidate response result as the target response result when the candidate response result verification is successful, and return the target response result to the current user according to the current user identifier, and then store the target response result in the distributed cache and persistently store it in the database.
[0264] In actual use, the device for generating the express delivery number provided in the embodiment of the present application can be configured in any terminal device to execute the aforementioned method for generating the express delivery number.
[0265] The device for generating the express delivery number provided in the present application receives the current number-taking request sent by the current user, determines the number-taking mode according to the current business type, and generates a candidate response result corresponding to the current number-taking request according to the number-taking mode and the current demand order quantity, and then verifies the candidate response result according to the historical electronic waybill data stored in the database. When the candidate response result verification is successful, the candidate response result is determined as the target response result, and the target response result is returned to the current user according to the current user identifier, and then the target response result is stored in the distributed cache and persistently stored in the database. Thus, the performance requirements of the high order volume scenario are met through the distributed cache, the stability of the generation of the express delivery number is improved, and the express data generated in the distributed cache is persistently stored through the database, and the response result generated in real time by the distributed cache is verified using the persistent data in the database, thereby not only improving the stability of the generation of the express delivery number, but also improving the reliability of the generation of the express delivery number.
[0266] In a possible implementation of an embodiment of the present application, the above-mentioned number taking mode includes at least one of a first number taking mode, a second number taking mode, a third number taking mode and a fourth number taking mode, wherein the first number taking mode refers to a number taking mode only, the second number taking mode is a number taking and order quantity deduction mode, the third number taking mode is a number taking, order quantity deduction and remaining order quantity verification mode, and the fourth number taking mode is an order quantity deduction mode.
[0267] Furthermore, in another possible implementation of the embodiment of the present application, the generating module 803 includes:
[0268] A first generating unit is used to generate a candidate electronic waybill according to the current demand order quantity when the number taking mode is the first number taking mode, and use each candidate electronic waybill as a candidate response result, wherein the number of candidate electronic waybills is the current demand order quantity;
[0269] A second generating unit is used to obtain the remaining order quantity corresponding to the current user according to the current user identifier when the number taking mode is the second number taking mode, deduct the remaining order quantity according to the current demand order quantity, and generate candidate electronic waybills according to the current demand order quantity, and use each candidate electronic waybill as a candidate response result;
[0270] A third generating unit is used to obtain the remaining order quantity corresponding to the current user according to the current user identifier when the number taking mode is the third number taking mode, and when the remaining order quantity is greater than or equal to the current demand order quantity, deduct the remaining order quantity according to the current demand order quantity, and generate candidate electronic waybills according to the current demand order quantity, and use each candidate electronic waybill as a candidate response result;
[0271] The first deduction unit is used to obtain the remaining order quantity corresponding to the current user according to the current user identifier when the number taking mode is the fourth number taking mode, and when the remaining order quantity is greater than or equal to the current demand order quantity, deduct the remaining order quantity according to the current demand order quantity, and use the remaining order quantity after deduction as the candidate response result.
[0272] Furthermore, in another possible implementation of the embodiment of the present application, the historical electronic waybill data includes multiple historical electronic waybills. Accordingly, the verification module 804 includes:
[0273] A first judgment unit is used to judge whether each candidate electronic waybill is repeated with any historical electronic waybill when the number-taking mode is the first number-taking mode, the second number-taking mode or the third number-taking mode;
[0274] A first determination unit is used to determine that the candidate response result verification is successful when each candidate electronic waybill is not repeated with the historical electronic waybill;
[0275] The second determining unit is used to determine that the candidate response result verification fails when there is a candidate electronic waybill that is repeated with any historical electronic waybill.
[0276] Further, in another possible implementation of the embodiment of the present application, the candidate electronic waybill includes the creation time and candidate order number corresponding to the candidate electronic waybill, and the historical electronic waybill includes the creation time and historical order number corresponding to the historical electronic waybill. Accordingly, the first judgment unit is specifically used to:
[0277] When the creation time and candidate order number corresponding to the candidate electronic waybill are different from the creation time and historical order number corresponding to each historical electronic waybill, it is determined that each candidate electronic waybill is not repeated with the historical electronic waybill;
[0278] When the creation time and candidate order number corresponding to any candidate electronic waybill are the same as the creation time and historical order number corresponding to any historical electronic waybill, it is determined that there is a candidate electronic waybill that is repeated with any historical electronic waybill.
[0279] Further, in another possible implementation of the embodiment of the present application, the number of candidate electronic waybills that are repeated with the historical electronic waybills is N, where N is a positive integer. Accordingly, the verification module 804 further includes:
[0280] A fourth generating unit is used to regenerate N candidate electronic waybills until each candidate electronic waybill is not repeated with a historical electronic waybill;
[0281] The third determining unit is used to determine whether the candidate response result verification is successful.
[0282] Furthermore, in another possible implementation of the embodiment of the present application, the apparatus 800 further includes:
[0283] The acquisition module 806 is used to obtain the request sequence number corresponding to the current number acquisition request;
[0284] The second determination module 807 is used to determine that the request sequence number corresponding to the current number acquisition request is different from the request sequence numbers corresponding to each historical number acquisition request, wherein the historical number acquisition request refers to the number acquisition request obtained before the current number acquisition request.
[0285] Furthermore, in another possible implementation of the embodiment of the present application, the apparatus 800 includes:
[0286] The monitoring module 808 is used to monitor the distributed cache according to preset monitoring indicators.
[0287] Furthermore, in another possible implementation of the embodiment of the present application, the above-mentioned preset monitoring indicators include at least one of the following indicators: the number segment balance corresponding to each service type, the operating status of the distributed cache, and the remaining order quantity corresponding to each user.
[0288] Further, in another possible implementation of the embodiment of the present application, the preset monitoring indicator includes the number segment margin corresponding to each service type. Accordingly, the monitoring module 808 includes:
[0289] A first acquisition unit, used to acquire the number segment remainder corresponding to each service type from the distributed cache;
[0290] The first sending unit is used to generate and send a reminder message of insufficient segment balance when the segment balance corresponding to any service type is insufficient.
[0291] Furthermore, in another possible implementation of the embodiment of the present application, the preset monitoring indicator includes the running status of the distributed cache. Accordingly, the monitoring module 808 includes:
[0292] A second acquisition unit, used to acquire the running status of the distributed cache;
[0293] The second sending unit is used to generate and send operation status abnormality reminder information when an abnormality occurs in the operation status of the distributed cache.
[0294] Furthermore, in another possible implementation of the embodiment of the present application, the preset monitoring indicator includes the remaining number of orders corresponding to each user. Accordingly, the monitoring module 808 includes:
[0295] A third acquisition unit is used to acquire the remaining order quantity corresponding to each user from the distributed cache;
[0296] The third sending unit is used to send a reminder message of insufficient remaining orders to any user when the remaining order quantity corresponding to any user is less than a preset threshold.
[0297] Furthermore, in another possible implementation of the embodiment of the present application, the preset monitoring indicator includes the remaining number of orders corresponding to each user. Accordingly, the monitoring module 808 includes:
[0298] A fourth acquisition unit, used to acquire the remaining orders of each user in the distributed cache and the remaining orders in the database;
[0299] The fourth sending unit is used to send a remaining order quantity abnormal reminder message to any user when the remaining order quantity of any user in the distributed cache and the remaining order quantity in the database do not match.
[0300] Furthermore, in another possible implementation of the embodiment of the present application, the monitoring module 807 further includes:
[0301] The first startup unit is used to start the disaster recovery program.
[0302] Furthermore, in another possible implementation of the embodiment of the present application, the first starting unit is specifically used to:
[0303] Suspend the acceptance of number application;
[0304] Write the remaining orders of any user in the database into the distributed cache;
[0305] Restart accepting number application.
[0306] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0307] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0308] In order to implement the above embodiments, the present application also proposes a terminal device.
[0309] Fig. 9 A schematic diagram of the structure of a terminal device according to an embodiment of the present application.
[0310] like Fig. 9 As shown, the terminal device 200 includes:
[0311] A memory 210 and at least one processor 220, a bus 230 connecting different components (including the memory 210 and the processor 220), the memory 210 stores a computer program, and when the processor 220 executes the program, the method for generating the express delivery number described in the embodiment of the present application is implemented.
[0312] Bus 230 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus and Peripheral Component Interconnect (PCI) bus.
[0313] The terminal device 200 typically includes a variety of electronic device readable media, which can be any available media that can be accessed by the terminal device 200, including volatile and non-volatile media, removable and non-removable media.
[0314] The memory 210 may also include computer system readable media in the form of volatile memory, such as random access memory (RAM) 240 and / or cache memory 250. The terminal device 200 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 260 may be used to read and write non-removable, non-volatile magnetic media ( Fig. 9 not shown, usually called a "hard drive"). Although Fig. 9 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical medium) may be provided. In these cases, each drive may be connected to bus 230 via one or more data medium interfaces. Memory 210 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present application.
[0315] A program / utility 280 having a set (at least one) of program modules 270 may be stored, for example, in the memory 210, such program modules 270 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 270 generally perform the functions and / or methods of the embodiments described herein.
[0316] The terminal device 200 can also communicate with one or more external devices 290 (e.g., keyboard, pointing device, display 291, etc.), and can also communicate with one or more devices that enable users to interact with the terminal device 200, and / or communicate with any device that enables the terminal device 200 to communicate with one or more other computing devices (e.g., network card, modem, etc.). This communication can be carried out through an input / output (I / O) interface 292. In addition, the terminal device 200 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN) and / or public network, such as the Internet) through a network adapter 293. As shown in the figure, the network adapter 293 communicates with other modules of the terminal device 200 through a bus 230. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the terminal device 200, including but not limited to: microcode, device driver, redundant processing unit, external disk drive array, RAID system, tape drive, and data backup storage system, etc.
[0317] The processor 220 executes various functional applications and data processing by running the programs stored in the memory 210 .
[0318] It should be noted that the implementation process and technical principles of the terminal device of this embodiment refer to the aforementioned explanation of the method for generating the express delivery number of the embodiment of the present application, and will not be repeated here.
[0319] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0320] An embodiment of the present application provides a computer program product. When the computer program product runs on a terminal device, the terminal device can implement the steps in the above-mentioned method embodiments when executing the computer program product.
[0321] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the camera / terminal device, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0322] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0323] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0324] In the embodiments provided in the present application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0325] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0326] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A method for generating a courier number, characterized in that: include: Receive a current number-taking request sent by a current user, wherein the current number-taking request includes a current user identifier, a current service type, and a current demand order quantity; Determine a number acquisition mode according to the current service type; Generate a candidate response result corresponding to the current number-taking request according to the number-taking mode and the current demand order quantity; Verifying the candidate response result according to the historical electronic manifest data stored in the database; When the candidate response result is successfully verified, the candidate response result is determined as the target response result, and the target response result is returned to the current user according to the current user identifier, and then the target response result is stored in the distributed cache and persistently stored in the database.
2. The method according to claim 1, characterized in that The number taking mode includes at least one of a first number taking mode, a second number taking mode, a third number taking mode and a fourth number taking mode, wherein the first number taking mode refers to a number taking only mode, the second number taking mode is a number taking and order quantity deduction mode, the third number taking mode is a number taking, order quantity deduction and remaining order quantity verification mode, and the fourth number taking mode is an order quantity deduction mode.
3. The method according to claim 2, characterized in that The generating, according to the number taking mode and the current demand order quantity, a candidate response result corresponding to the current number taking request includes: When the number-taking mode is the first number-taking mode, a candidate electronic waybill is generated according to the current required order quantity, and each of the candidate electronic waybill is used as the candidate response result, wherein the number of the candidate electronic waybill is the current required order quantity; When the number-taking mode is the second number-taking mode, the remaining order quantity corresponding to the current user is obtained according to the current user identifier, and the remaining order quantity is deducted according to the current required order quantity, and the candidate electronic waybills are generated according to the current required order quantity, and each of the candidate electronic waybills is used as the candidate response result; When the number-taking mode is the third number-taking mode, the remaining order quantity corresponding to the current user is obtained according to the current user identifier, and when the remaining order quantity is greater than or equal to the current required order quantity, the remaining order quantity is deducted according to the current required order quantity, and the candidate electronic waybills are generated according to the current required order quantity, and each of the candidate electronic waybills is used as the candidate response result; When the number taking mode is the fourth number taking mode, the remaining order quantity corresponding to the current user is obtained according to the current user identifier, and when the remaining order quantity is greater than or equal to the current demand order quantity, the remaining order quantity is deducted according to the current demand order quantity, and the remaining order quantity after deduction is used as the candidate response result.
4. The method according to claim 3, characterized in that The historical electronic waybill data includes a plurality of the historical electronic waybill data, and the verifying the candidate response result according to the historical electronic waybill data stored in the database includes: When the number-taking mode is the first number-taking mode, the second number-taking mode or the third number-taking mode, determining whether each of the candidate electronic waybills is repeated with any of the historical electronic waybills; When none of the candidate electronic waybills are repeated with the historical electronic waybills, determining that the candidate response result verification is successful; When there is a candidate electronic waybill that is repeated with any of the historical electronic waybills, it is determined that the candidate response result verification fails.
5. The method according to claim 4, characterized in that The candidate electronic waybill includes the creation time and candidate order number corresponding to the candidate electronic waybill, the historical electronic waybill includes the creation time and historical order number corresponding to the historical electronic waybill, and the determining whether each of the candidate electronic waybill is repeated with any of the historical electronic waybills includes: When the creation time and the candidate order number corresponding to the candidate electronic waybill are different from the creation time and the historical order number corresponding to each of the historical electronic waybills, it is determined that each of the candidate electronic waybills is not repeated with the historical electronic waybills; When the creation time and the candidate order number corresponding to any candidate electronic waybill are the same as the creation time and the historical order number corresponding to any historical electronic waybill, it is determined that there is a candidate electronic waybill that is repeated with any historical electronic waybill.
6. The method according to claim 4, characterized in that The number of the candidate electronic waybills that are repeated with the historical electronic waybills is N, where N is a positive integer. When there is a candidate electronic waybills that are repeated with any of the historical electronic waybills, after determining that the candidate response result verification fails, the method further includes: Regenerate N candidate electronic waybills until none of the candidate electronic waybills is repeated with the historical electronic waybills; It is determined that the candidate response result verification is successful.
7. The method according to claim 1, characterized in that Before determining the number acquisition mode according to the current service type, the method further includes: Obtaining the request sequence number corresponding to the current number acquisition request; It is determined that the request sequence number corresponding to the current number acquisition request is different from the request sequence numbers corresponding to each historical number acquisition request, wherein the historical number acquisition request refers to the number acquisition request obtained before the current number acquisition request.
8. The method according to any one of claims 1 to 7, characterized in that: Also includes: The distributed cache is monitored according to preset monitoring indicators, wherein the preset monitoring indicators include at least one of the following indicators: the number segment balance corresponding to each service type, the operating status of the distributed cache, and the remaining order quantity corresponding to each user.
9. The method according to claim 8, characterized in that The preset monitoring indicator includes the number segment margin corresponding to each of the service types, and the monitoring of the distributed cache according to the preset monitoring indicator includes: Obtaining the number segment remainder corresponding to each of the service types from the distributed cache; When the number segment balance corresponding to any of the service types is insufficient, a number segment balance insufficient reminder message is generated and sent.
10. The method according to claim 8, characterized in that The preset monitoring indicator includes the running state of the distributed cache, and the monitoring of the distributed cache according to the preset monitoring indicator includes: Obtaining the running status of the distributed cache; When an abnormality occurs in the running state of the distributed cache, the running state abnormality reminder information is generated and sent.
11. The method according to claim 8, characterized in that The preset monitoring indicator includes the remaining number of orders corresponding to each of the users, and the monitoring of the distributed cache according to the preset monitoring indicator includes: Obtaining the remaining order quantity corresponding to each of the users from the distributed cache; When the remaining order quantity corresponding to any user is less than a preset threshold, a reminder message of insufficient remaining order quantity is sent to the user.
12. The method according to claim 8, characterized in that The preset monitoring indicator includes the remaining number of orders corresponding to each of the users, and the monitoring of the distributed cache according to the preset monitoring indicator includes: Obtaining the remaining number of orders of each of the users in the distributed cache and the remaining number of orders in the database; When the remaining order quantity of any user in the distributed cache and the remaining order quantity in the database do not match, a remaining order quantity abnormality reminder message is sent to the any user.
13. The method according to claim 12, characterized in that When the remaining order quantity of any user in the distributed cache does not match the remaining order quantity in the database, after sending the remaining order quantity abnormality reminder information to any user, the method further includes: Suspend the acceptance of number application; Writing the remaining order quantity of any one of the users in the database into the distributed cache; Restart receiving the number-taking application.
14. A device for generating a courier number, characterized in that: include: A receiving module, used to receive a current number-taking request sent by a current user, wherein the current number-taking request includes a current user identifier, a current service type, and a current demand order quantity; A first determination module, used to determine a number acquisition mode according to the current service type; A generating module, used for generating a candidate response result corresponding to the current number taking request according to the number taking mode and the current demand order quantity; A verification module, used to verify the candidate response result according to the historical electronic waybill data stored in the database; The storage module is used to determine the candidate response result as the target response result when the candidate response result is successfully verified, and return the target response result to the current user according to the current user identifier, and then store the target response result in the distributed cache and persistently store it in the database.
15. A terminal device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 13 is implemented.
16. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 13 is implemented.