Express delivery handover code generation method and device based on dynamic binding, equipment and medium
By generating a unique handover code identifier through an intelligent prediction model and dynamic hashing, and combining the greedy algorithm to optimize task allocation and image enhancement model to process QR codes, the problems of static binding, low efficiency and insufficient security of the express handover code system are solved, and efficient and secure handover code generation and identification are achieved.
Patent Information
- Application Number
- CN202510786953.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-13
- Publication Date
- 2025-09-19
AI Technical Summary
The existing express delivery code system has problems such as static binding, low efficiency, insufficient security and waste of resources.
An intelligent prediction model is used to predict the demand for handover codes, dynamic hashing is used to generate unique and irreversible handover code identifiers, and a greedy algorithm is used to optimize printing task allocation. The image enhancement model is used to process QR codes to achieve anti-blurring and anti-occlusion.
It improves the security and efficiency of handover code generation, reduces resource waste, increases the recognition rate of QR codes, and improves delivery efficiency during peak hours.
Smart Images

Figure CN120671705A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of logistics management, and in particular to a method, device, system and medium for generating an express delivery handover code based on dynamic binding. Background Art
[0002] As business continues to expand, the traditional express delivery handover code system has the following limitations: static binding, where the handover code is fixedly associated with the waybill number and cannot dynamically adapt to the courier's needs; low efficiency, frequent manual operations, and a lack of intelligent prediction and automated scheduling; insufficient security, where the handover code generation and transmission process is unencrypted, posing a risk of information leakage; and waste of resources, where printing task allocation does not take real-time load into consideration. Summary of the Invention
[0003] The main purpose of the present invention is to solve the technical problems of static binding, low efficiency, insufficient security and waste of resources in the express code system in the prior art.
[0004] A first aspect of the present invention provides a method for generating an express delivery handover code based on dynamic binding, comprising: Based on the couriers' historical data, an intelligent forecasting model is used to predict the demand for handover codes in the target grid within a preset time period in the future; Based on the predicted demand for handover codes for the target grid within a preset future time period, a dynamic hash generation algorithm is used to generate a unique and irreversible handover code identifier based on the courier's identity information and timestamp. The intelligent prediction model predicts the handover code demand of the target grid within a preset time period in the future based on time series analysis and random forest model.
[0005] Optionally, in a first implementation of the first aspect of the present invention, the method of using an intelligent prediction model to predict the demand for handover codes within a future preset time period based on the courier's historical data includes: Obtain historical data on couriers, including the frequency of handover code usage, regional distribution, and time period distribution patterns; Preprocessing the acquired historical data of the couriers to obtain preprocessed historical data; Based on the pre-processed historical data, the ARIMA model is used to fit the periodicity of demand changes and predict the demand for handover codes within a preset period in the future; Divide the target area into grid cells that meet preset requirements and label the divided grid cells, including order density, hotspot markers, and demand time windows; Based on the labeling information of the grid cells and the predicted handover code demand within a future preset time period, a random forest regression model is used to predict the handover code demand for each grid cell within the future preset time period.
[0006] Optionally, in a second implementation of the first aspect of the present invention, preprocessing the acquired courier historical data to obtain the preprocessed historical data includes: Obtain historical data on couriers, including: frequency of handover code usage, regional distribution, and time period distribution patterns; Performing anomaly elimination processing on the acquired historical data of the courier to obtain the historical data of the courier after the anomaly elimination processing; The historical data of the couriers after the abnormalities are eliminated are processed with gap filling to obtain the historical data of the couriers after gap filling.
[0007] Optionally, in a third implementation of the first aspect of the present invention, generating a unique and irreversible handover code identifier using a dynamic hash generation algorithm based on the predicted handover code demand of the target grid within a preset future time period and the courier identity information and timestamp includes: Build a triple identity anchor based on the courier's unique ID, desensitized mobile phone number, and device fingerprint; The millisecond-accurate UTC timestamp is used as a dynamic factor and combined with the triple identity anchor to generate the string to be hashed. The string to be hashed is generated using the SHA-256 algorithm to generate an initial hash value; Obtain the target grid code based on the courier's real-time positioning, and convert the obtained target grid code into a salt value; Insert the salt value into the initial hash value and perform a second round of SHA-256 operation on the initial hash value with the inserted salt value to generate the final identifier; The device fingerprint includes: generating a device fingerprint through the terminal MAC address and SIM card IMSI code.
[0008] Optionally, in a fourth implementation of the first aspect of the present invention, the method further includes: Get the millisecond timestamp and zone salt value based on the generated final identifier; Calculate the remaining delivery time based on the obtained millisecond timestamp; determine the priority of the printing task based on the remaining delivery time; Determine the printer in the corresponding grid area based on the regional salt value, and obtain the real-time status, task queue length, remaining amount of thermal paper, and historical printing efficiency of the printer in the grid area; Task allocation is optimized through a greedy algorithm based on the printing task priority, the real-time status of the printers in the corresponding grid area, the task queue length, the remaining amount of thermal paper, and the historical printing efficiency.
[0009] Optionally, in a fifth implementation of the first aspect of the present invention, the method further includes: Generate a QR code based on the generated final identifier; Based on the image enhancement model, the generated QR code is subjected to anti-blurring and anti-occlusion processing to obtain the processed QR code.
[0010] Optionally, in a sixth implementation of the first aspect of the present invention, performing anti-blurring and anti-occlusion processing on the generated QR code based on the image enhancement model to obtain the processed QR code includes: Constructing a training data set, wherein the training data set includes: a printing defect data set, an environmental interference data set, and a medium difference data set; Preprocess the constructed training dataset, including: Code point features are extracted through CNN, and histogram equalization and edge sharpening are performed on low-contrast images to obtain the preprocessed training dataset; Repair the damaged areas in the training dataset by generating an adversarial network to obtain the preprocessed training dataset; The image enhancement model is trained using the preprocessed training data set to obtain a trained image enhancement model; Use the trained image enhancement model to perform anti-blurring and anti-occlusion processing on the generated QR code to obtain the processed QR code; Scan the printed QR code. When the recognition rate is lower than the preset value, reprinting is triggered and the current defect sample is fed back into the training set to achieve continuous evolution of the image enhancement model.
[0011] A second aspect of the present invention provides a device for generating an express delivery code based on dynamic binding, comprising: The handover code demand acquisition module is used to predict the handover code demand of the target grid within a preset time period in the future based on the courier's historical data using an intelligent prediction model; The handover code identifier generation module is used to generate a unique and irreversible handover code identifier using a dynamic hash generation algorithm based on the predicted handover code demand of the target grid within a preset future time period and the courier's identity information and timestamp; The intelligent prediction model predicts the handover code demand of the target grid within a preset time period in the future based on time series analysis and random forest model.
[0012] Optionally, in a first implementation of the second aspect of the present invention, the handover code requirement acquisition module includes: The historical data acquisition submodule is used to obtain the courier's historical data, including the frequency of use of the handover code, regional distribution, and time period distribution patterns; A preprocessing submodule is used to preprocess the acquired courier historical data to obtain preprocessed historical data; The handover code demand prediction submodule is used to use the ARIMA model to fit the periodicity of demand changes based on preprocessed historical data and predict the handover code demand within a preset period in the future; The labeling submodule is used to divide the target area into grid units that meet the preset requirements and label the divided grid units, including order density, hot spot signs and demand time windows; The grid unit handover code demand prediction submodule is used to predict the handover code demand of each grid unit in a future preset time period based on the annotation information of the grid unit and the predicted handover code demand in the future preset time period, using a random forest regression model.
[0013] Optionally, in a second implementation of the second aspect of the present invention, the preprocessing submodule includes: Obtain historical data on couriers, including: frequency of handover code usage, regional distribution, and time period distribution patterns; Performing anomaly elimination processing on the acquired historical data of the courier to obtain the historical data of the courier after the anomaly elimination processing; The historical data of the couriers after the abnormalities are eliminated are processed with gap filling to obtain the historical data of the couriers after gap filling.
[0014] Optionally, in a third implementation of the second aspect of the present invention, the handover code identifier generation module includes: The triple identity anchor construction submodule is used to construct a triple identity anchor based on the courier's unique ID, the desensitized mobile phone number, and the device fingerprint; The submodule for generating the string to be hashed is used to use the UTC timestamp accurate to the millisecond level as a dynamic factor and combine it with the triple identity anchor to generate the string to be hashed; The initial hash value generation submodule is used to generate the initial hash value of the hash string using the SHA-256 algorithm; The salt value generation submodule is used to obtain the target grid code based on the courier's real-time location and convert the obtained target grid code into a salt value; The identifier generation submodule is used to insert the salt value into the initial hash value and perform a second round of SHA-256 operation on the initial hash value with the inserted salt value to generate the final identifier; The device fingerprint includes: generating a device fingerprint through the terminal MAC address and SIM card IMSI code.
[0015] Optionally, in a fourth implementation of the second aspect of the present invention, the apparatus further comprises: a task allocation module, configured to optimize task allocation by a greedy algorithm based on print task priority, real-time status of printers in a corresponding grid area, task queue length, remaining amount of thermal paper, and historical printing efficiency; The task allocation module includes: A print task priority determination submodule is used to obtain a millisecond timestamp and a regional salt value based on the generated final identifier; calculate the remaining delivery time based on the obtained millisecond timestamp; and determine the print task priority based on the remaining delivery time; The printer status acquisition submodule is used to determine the printer in the corresponding grid area according to the regional salt value, and obtain the real-time status, task queue length, remaining amount of thermal paper and historical printing efficiency of the printer in the grid area; The task allocation submodule is used to optimize task allocation through a greedy algorithm based on the printing task priority, the real-time status of the printer in the corresponding grid area, the task queue length, the remaining amount of thermal paper, and the historical printing efficiency.
[0016] Optionally, in the fifth implementation of the second aspect of the present invention, the device also includes: a QR code generation module, used to generate a QR code based on the generated final identifier; and perform anti-blurring and anti-occlusion processing on the generated QR code based on the image enhancement model to obtain a processed QR code.
[0017] Optionally, in a sixth implementation of the second aspect of the present invention, performing anti-blurring and anti-occlusion processing on the generated QR code based on the image enhancement model to obtain the processed QR code includes: Constructing a training data set, wherein the training data set includes: a printing defect data set, an environmental interference data set, and a medium difference data set; Preprocess the constructed training dataset, including: Code point features are extracted through CNN, and histogram equalization and edge sharpening are performed on low-contrast images to obtain the preprocessed training dataset; Repair the damaged areas in the training dataset by generating an adversarial network to obtain the preprocessed training dataset; Used to train the image enhancement model using the preprocessed training data set to obtain a trained image enhancement model; Used to perform anti-blurring and anti-occlusion processing on the generated QR code using the trained image enhancement model to obtain a processed QR code; Scan the printed QR code. When the recognition rate is lower than the preset value, the current defect sample is fed back to the training set to achieve continuous evolution of the image enhancement model.
[0018] A third aspect of the present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the above-mentioned method for generating an express delivery handover code based on dynamic binding.
[0019] A fourth aspect of the present invention provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the steps of the above-mentioned method for generating an express delivery code based on dynamic binding are implemented.
[0020] Compared with the prior art, the present invention has the following beneficial effects: 1. This invention generates a unique identifier through triple identity anchors and millisecond-level timestamps, ensuring that each handover code is strongly associated with a specific courier, time, and geographic location. A double-round SHA-256 algorithm combined with a regional salt value is then used to generate an irreversible handover code identifier. Even if the data is leaked, the original information cannot be reversed, significantly enhancing data security. 2. The present invention integrates the ARIMA model to capture periodic patterns and the random forest regression analysis of gridded regional characteristics to achieve high-precision prediction of handover code demand and reduce the problem of redundant or insufficient backup codes; 3. This invention dynamically allocates printing tasks based on a greedy algorithm, comprehensively considering printer status, queue length, and remaining consumables, controlling the average waiting time to within 20 seconds and improving delivery efficiency during peak hours by more than 30%; 4. This invention uses a CNN+GAN model to pre-process the QR code, making it anti-blurring and anti-occlusion before printing, and improving the recognition rate to over 98%. At the same time, the training data set covers the defects of different printing media such as thermal paper and coated paper, ensuring that the generated QR code can be stably recognized in various physical environments. 5. The present invention uses a real-time quality inspection feedback mechanism to feed back samples that failed to be identified into the training set, so that the image enhancement model can adapt to new interference scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Other features, objects and advantages of the present invention will become more apparent upon reading the detailed description of non-limiting embodiments with reference to the following drawings: Figure 1 This is a first flow chart of a method for generating an express handover code based on dynamic binding provided by an embodiment of the present invention.
[0022] Figure 2 This is a second flow chart of the method for generating an express handover code based on dynamic binding provided by an embodiment of the present invention.
[0023] Figure 3This is a third flow chart of the method for generating an express handover code based on dynamic binding provided by an embodiment of the present invention.
[0024] Figure 4 This is a fourth flow chart of the method for generating an express handover code based on dynamic binding provided by an embodiment of the present invention.
[0025] Figure 5 A flow chart of a device for generating an express handover code based on dynamic binding provided by an embodiment of the present invention.
[0026] Figure 6 A schematic structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0027] Embodiments of the present invention provide a method, apparatus, device, and medium for generating express delivery handover codes based on dynamic binding. The method includes: using an intelligent prediction model to predict the demand for handover codes for target grids within a preset future time period based on the courier's historical data; generating a unique and irreversible handover code identifier using a dynamic hash generation algorithm based on the courier's identity information and timestamp, based on the predicted demand for handover codes for the target grid within the preset future time period; and using a time series analysis and random forest model to predict the demand for handover codes for the target grid within the preset future time period. This method solves the technical problems of static binding, low efficiency, insufficient security, and resource waste in existing express delivery code systems.
[0028] The terms "first," "second," "third," "fourth," and so on (if any) in the description and claims of the present invention and in the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments described herein can be implemented in an order other than that shown or described herein. In addition, the terms "including" or "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus that includes a series of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, product, or apparatus.
[0029] For ease of understanding, the specific process of the embodiment of the present invention is described below. Figure 1 In the first embodiment of the method for generating an express handover code based on dynamic binding in the embodiment of the present invention, the method includes: 101. Based on the courier's historical data, an intelligent forecasting model is used to predict the demand for handover codes in the target grid within a preset time period in the future; In this embodiment, an intelligent prediction model is constructed; wherein, the intelligent prediction model predicts the handover code demand of the target grid within a preset time period in the future based on time series analysis and random forest model; Obtain historical data on couriers, including the frequency of handover code usage, regional distribution, and time period distribution patterns; Preprocess the acquired courier historical data, including outlier elimination and missing fill processing, to obtain preprocessed historical data; Based on the pre-processed historical data, the ARIMA model is used to fit the periodicity of demand changes and predict the demand for handover codes within a preset period in the future; Divide the target area into grid cells that meet preset requirements and label the divided grid cells, including order density, hotspot markers, and demand time windows; Based on the labeling information of the grid cells and the predicted handover code demand within a future preset time period, a random forest regression model is used to predict the handover code demand for each grid cell within the future preset time period.
[0030] 102. Based on the predicted demand for handover codes for the target grid within a preset future time period, a unique and irreversible handover code identifier is generated using a dynamic hash generation algorithm based on the courier's identity information and timestamp; In this embodiment, a triple identity anchor is constructed based on the courier’s unique ID, the desensitized mobile phone number, and the device fingerprint; The millisecond-accurate UTC timestamp is used as a dynamic factor and combined with the triple identity anchor to generate the string to be hashed. The string to be hashed is generated using the SHA-256 algorithm to generate an initial hash value; Obtain the target grid code based on the courier's real-time positioning, and convert the obtained target grid code into a salt value; Insert the salt value into the initial hash value and perform a second round of SHA-256 operation on the initial hash value with the inserted salt value to generate the final identifier; The device fingerprint includes: generating a device fingerprint through the terminal MAC address and SIM card IMSI code.
[0031] See also Figure 2 The second embodiment of the method for generating an express handover code based on dynamic binding in the embodiment of the present invention includes: 201. Based on the courier's historical data, an intelligent prediction model is used to predict the demand for handover codes in the target grid within a preset time period in the future; In this example, courier historical data is cleaned across multiple dimensions to remove abnormal operation records, such as those generated by accidental touches and test data. Core features such as effective usage frequency, regional delivery hotspots, such as differences between office buildings and communities, and time distribution patterns, such as the delivery peak between 8 and 10 a.m., are retained. This data is then combined with external variables for modeling. Cyclical analysis: Using the ARIMA model to capture the cyclical patterns of courier data, such as the predominance of corporate deliveries on weekdays and a surge in e-commerce deliveries on weekends, allows identification of peaks and troughs in demand within a 24-hour period. Spatial correlation: Random forests are used to analyze regional order density, dividing the city into 100m x 100m grid cells and labeling the dynamic weights of high-demand grid cells; Flexible reserve strategy: Backup codes are generated based on "basic reserve + dynamic supplementation." The base reserve is 110% of the historical average for the same period. For special scenarios such as promotional events and areas with heavy rain warnings, a 30%-50% emergency reserve is automatically added. Reserve codes are stored by "region-time period-type" to ensure they can be dispatched to target outlets within 3 minutes.
[0032] 202. Based on the predicted demand for handover codes for the target grid within a preset future time period, a unique and irreversible handover code identifier is generated using a dynamic hash generation algorithm according to the courier's identity information and timestamp; In this embodiment, a triple identity anchor is constructed using "work ID + mobile phone number + device fingerprint". This triple identity anchor is combined with a millisecond-accurate UTC timestamp as a dynamic factor and a double-round hash operation is performed using the SHA-256 algorithm. Initial hash: Concatenate the identity information and timestamp to generate a 64-bit string; Regional salt injection: Based on the administrative district code of the courier's current location (e.g., "010" represents Chaoyang District), a 4-bit salt is inserted into the 15th bit of the initial hash value to form a 128-bit final identifier. On this basis, an anti-duplication mechanism is set up: when the same work number applies for the handover code of the same area within 1 minute, the SMS verification code will be automatically triggered for secondary verification; the generated identifier contains a 2-digit version number (such as V01, V02), which supports cross-version compatible identification during system upgrades, ensuring that historical handover codes can still be traced and verified within 3 years.
[0033] 203. Based on the printing task priority, the real-time status of the printer in the corresponding grid area, the task queue length, the remaining amount of thermal paper and the historical printing efficiency, the task allocation is optimized through a greedy algorithm.
[0034] In this embodiment, a millisecond timestamp and a regional salt value are obtained based on the generated final identifier; a remaining delivery time is calculated based on the obtained millisecond timestamp; and a priority of the print task is determined based on the remaining delivery time. Determine the printer in the corresponding grid area based on the regional salt value, and obtain the real-time status, task queue length, remaining amount of thermal paper, and historical printing efficiency of the printer in the grid area; Task allocation is optimized through a greedy algorithm based on the printing task priority, the real-time status of the printers in the corresponding grid area, the task queue length, the remaining amount of thermal paper, and the historical printing efficiency.
[0035] See also Figure 3 The third embodiment of the method for generating an express handover code based on dynamic binding in the embodiment of the present invention includes: 301. Based on the courier's historical data, an intelligent prediction model is used to predict the demand for handover codes in the target grid within a preset time period in the future; 302. Based on the predicted demand for handover codes for the target grid within a preset future time period, a unique and irreversible handover code identifier is generated using a dynamic hash generation algorithm according to the courier's identity information and timestamp; 303. Optimize task allocation using a greedy algorithm based on print task priority, real-time status of printers in the corresponding grid area, task queue length, remaining amount of thermal paper, and historical printing efficiency; In this embodiment, the printer status data is collected in real time through IoT sensors at a frequency of 5 seconds, and a scheduling model with five core indicators is constructed: Device status: Idle (0-20% load), Medium (21%-70%), Busy (71%-100%), set different priority coefficients; Task urgency: Based on the estimated delivery time of the order, tasks with a remaining time of less than 30 minutes are marked as urgent and their weight is increased by 40%; Consumables remaining: When the thermal paper / ink level is less than 20%, "protective scheduling" is triggered, automatically rejecting new tasks and queueing them for paper replacement; Geographic proximity: Prioritizes printers within 30 meters, using Bluetooth beacons to locate device locations in real time. Historical efficiency: record the average single-page printing time of each printer and dynamically adjust task allocation trends; When using the greedy algorithm, a "load balancing threshold" is added. When the length of a printer's task queue exceeds 15 items, subsequent tasks are automatically diverted to the next best device, ensuring that the average waiting time in peak scenarios is controlled within 20 seconds while avoiding excessive device idleness.
[0036] 304. Generate a QR code based on the generated final identifier; perform anti-blurring and anti-occlusion processing on the generated QR code based on the image enhancement model to obtain a processed QR code; In this embodiment, a training data set is constructed, and the training data set includes: a printing defect data set, an environmental interference data set, and a medium difference data set; Preprocess the constructed training dataset, including: Code point features are extracted through CNN, and histogram equalization and edge sharpening are performed on low-contrast images to obtain the preprocessed training dataset; Repair the damaged areas in the training dataset by generating an adversarial network to obtain the preprocessed training dataset; The image enhancement model is trained using the preprocessed training data set to obtain a trained image enhancement model; Use the trained image enhancement model to perform anti-blurring and anti-occlusion processing on the generated QR code to obtain the processed QR code; Scan the printed QR code. When the recognition rate is lower than the preset value, the current defect sample is fed back to the training set to achieve continuous evolution of the image enhancement model.
[0037] See also Figure 4 The fourth embodiment of the method for generating an express handover code based on dynamic binding in the embodiment of the present invention includes: 401. Based on the courier's historical data, an intelligent prediction model is used to predict the demand for handover codes in the target grid within a preset time period in the future; 402. Based on the predicted demand for handover codes for the target grid within a preset future time period, a unique and irreversible handover code identifier is generated using a dynamic hash generation algorithm according to the courier's identity information and timestamp; 403. Optimize task allocation using a greedy algorithm based on print task priority, real-time status of printers in the corresponding grid area, task queue length, remaining amount of thermal paper, and historical printing efficiency; 404. Generate a QR code based on the generated final identifier; perform anti-blurring and anti-occlusion processing on the generated QR code based on the image enhancement model to obtain a processed QR code; In this embodiment, a training data set is constructed; the training data set includes: Print defect dataset: broken needles (missing lines), blurred ink, and ghosting edges; Environmental interference dataset: rain stains (simulating humid scenes), tape occlusion (a common problem in package packaging), and crease (bending during transportation); Media difference dataset: thermal paper (easy to fade), coated paper (highly reflective), recycled paper (rough fibers); the model uses a dual process of "pre-processing enhancement + post-processing restoration": Preprocess the constructed training dataset, including: Code point features are extracted through CNN, and histogram equalization and edge sharpening are performed on low-contrast images to obtain the preprocessed training dataset; By generating adversarial networks to repair damaged areas in the training dataset, the occlusion area For 30% of the QR codes, the missing parts are predicted by the grayscale values of adjacent modules, and the damaged areas in the training dataset are repaired using the predicted missing parts to obtain the preprocessed training dataset. The image enhancement model is trained using the preprocessed training data set to obtain a trained image enhancement model; Use the trained image enhancement model to perform anti-blurring and anti-occlusion processing on the generated QR code to obtain the processed QR code; The integrated real-time quality inspection camera is used to scan the printed QR code at 300dpi accuracy. When the recognition rate is less than 98%, reprinting is automatically triggered, and the current defect sample is fed back into the training set to achieve continuous evolution of the image enhancement model.
[0038] 405. Reinforcement learning consumables optimization: using Q-learning algorithm to analyze historical consumables usage data, dynamically adjust printing density and ink usage, and maximize consumables savings; In this embodiment, a consumables optimization space containing multiple state variables is constructed, including: Task attributes: document type (customer copy / logistics copy), print size (A4 / label paper), color mode (monochrome / color); Equipment parameters: nozzle aperture, ink viscosity, paper weight; Historical data: Average consumables consumption and best / worst case parameters for similar tasks over the past seven days; the Q-learning algorithm generates a policy library containing more than 500 parameter sets by simulating printing strategies in different scenarios: Ordinary customer contact: Using 0.9 times the standard density, ink usage is reduced by 15%, and the measured recognition rate only drops by 1.2%; Archive logistics: Automatically enable 1.1x density to ensure clear identification within three years; the system sets a consumable cost threshold. When the printing cost of a single ticket exceeds the historical average by 10%, it automatically switches to economy mode and generates a weekly report to analyze abnormal consumption nodes (such as ink waste caused by aging of a certain model of printer nozzle) to assist in equipment maintenance decision-making.
[0039] The above describes the method for generating an express handover code based on dynamic binding in an embodiment of the present invention. The following describes the device for generating an express handover code based on dynamic binding in an embodiment of the present invention. Figure 5 In one embodiment of the present invention, a device for generating an express handover code based on dynamic binding includes: The handover code demand acquisition module 501 is used to predict the handover code demand of the target grid within a preset time period in the future based on the courier's historical data using an intelligent prediction model; In this embodiment, the handover code requirement acquisition module 501 includes: The historical data acquisition submodule 5011 is used to obtain the courier's historical data, including the frequency of use of the handover code, regional distribution, and time period distribution pattern; The pre-processing submodule 5012 is used to pre-process the acquired courier historical data, including abnormal elimination and missing filling, to obtain pre-processed historical data; The handover code demand prediction submodule 5013 is used to use the ARIMA model to fit the periodicity of demand changes based on the pre-processed historical data and predict the handover code demand in a preset time period in the future; The labeling submodule 5014 is used to divide the target area into grid units that meet preset requirements and label the divided grid units, including order density, hot spot marks and demand time windows; The grid unit handover code demand prediction submodule 5015 is used to predict the handover code demand of each grid unit in the future preset time period using a random forest regression model based on the grid unit's labeling information and the predicted handover code demand in the future preset time period.
[0040] The handover code identifier generation module 502 is configured to generate a unique and irreversible handover code identifier using a dynamic hash generation algorithm based on the predicted handover code demand of the target grid within a preset future time period and the courier's identity information and timestamp; In this embodiment, the handover code identifier generating module 502 includes: The triple identity anchor construction submodule 5021 is used to construct a triple identity anchor based on the courier's unique ID, the desensitized mobile phone number, and the device fingerprint; The submodule 5022 for generating a character string to be hashed is used to use a UTC timestamp accurate to the millisecond level as a dynamic factor and combine it with a triple identity anchor to generate a character string to be hashed; The initial hash value generation submodule 5023 is used to generate an initial hash value of the hash string using the SHA-256 algorithm; The salt value generating submodule 5024 is used to obtain the target grid code according to the courier's real-time positioning and convert the obtained target grid code into a salt value; The identifier generation submodule 5025 is used to insert a salt value into the initial hash value and perform a second round of SHA-256 operation on the initial hash value with the inserted salt value to generate a final identifier; The device fingerprint includes: generating a device fingerprint through the terminal MAC address and SIM card IMSI code.
[0041] The task allocation module 503 is configured to optimize task allocation using a greedy algorithm based on the print task priority, the real-time status of the printers in the corresponding grid area, the task queue length, the remaining amount of thermal paper, and the historical printing efficiency; In this embodiment, the task allocation module 503 includes: The print task priority determination submodule 5031 is configured to obtain a millisecond timestamp and a regional salt value based on the generated final identifier; calculate the remaining delivery time based on the obtained millisecond timestamp; and determine the print task priority based on the remaining delivery time. The printer status acquisition submodule 5032 is used to determine the printer in the corresponding grid area according to the regional salt value, and obtain the real-time status, task queue length, remaining amount of thermal paper, and historical printing efficiency of the printer in the grid area; The task allocation submodule 5033 is used to optimize task allocation through a greedy algorithm based on the printing task priority, the real-time status of the printers in the corresponding grid area, the task queue length, the remaining amount of thermal paper, and the historical printing efficiency.
[0042] The QR code generation module 504 is configured to generate a QR code based on the generated final identifier; and perform anti-blurring and anti-occlusion processing on the generated QR code based on an image enhancement model to obtain a processed QR code.
[0043] In this embodiment, the QR code generation module 504 includes: Constructing a training data set, wherein the training data set includes: a printing defect data set, an environmental interference data set, and a medium difference data set; Preprocess the constructed training dataset, including: Code point features are extracted through CNN, and histogram equalization and edge sharpening are performed on low-contrast images to obtain the preprocessed training dataset; Repair the damaged areas in the training dataset by generating an adversarial network to obtain the preprocessed training dataset; Used to train the image enhancement model using the preprocessed training data set to obtain a trained image enhancement model; Used to perform anti-blurring and anti-occlusion processing on the generated QR code using the trained image enhancement model to obtain a processed QR code; Scan the printed QR code. When the recognition rate is lower than the preset value, reprinting is triggered and the current defect sample is fed back into the training set to achieve continuous evolution of the image enhancement model.
[0044] above Figure 5The express handover code generation device based on dynamic binding in the embodiment of the present invention is described in detail from the perspective of modular functional entities. The electronic device in the embodiment of the present invention is described in detail from the perspective of hardware processing.
[0045] Figure 6 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. The electronic device 700 may vary significantly due to different configurations or performance, and may include one or more processors (central processing units, CPUs) 710 (for example, one or more processors), a memory 720, and one or more storage media 730 (for example, one or more mass storage devices) storing application programs 733 or data 732. The memory 720 and storage medium 730 may be either transient or persistent storage. The program stored in the storage medium 730 may include one or more modules (not shown), each of which may include a series of instruction operations on the electronic device 700. Furthermore, the processor 710 may be configured to communicate with the storage medium 730 to execute the series of instruction operations in the storage medium 730 on the electronic device 700.
[0046] The electronic device 700 may further include one or more power supplies 740, one or more wired or wireless network interfaces 750, one or more input and output interfaces 750, and / or one or more operating systems 731, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. It will be understood by those skilled in the art that Figure 6 The illustrated electronic device structure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0047] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. The computer-readable storage medium stores instructions that, when executed on a computer, cause the computer to execute the steps of a method for generating an express delivery handover code based on dynamic binding.
[0048] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described systems, devices, and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0049] If the integrated unit is implemented as 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 technical solution of the present invention, or the portion that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes various media that can store program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0050] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that the technical solutions described in the above embodiments can still be modified, or some of the technical features thereof can be replaced by equivalents. However, these 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 invention.
Claims
1. A method for generating an express delivery code based on dynamic binding, characterized in that: include: Based on the couriers' historical data, an intelligent forecasting model is used to predict the demand for handover codes in the target grid within a preset time period in the future; Based on the predicted demand for handover codes for the target grid within a preset future time period, a dynamic hash generation algorithm is used to generate a unique and irreversible handover code identifier based on the courier's identity information and timestamp. The intelligent prediction model predicts the handover code demand of the target grid within a preset time period in the future based on time series analysis and random forest model.
2. The method for generating an express handover code based on dynamic binding according to claim 1, characterized in that: The method of using an intelligent prediction model based on the courier's historical data to predict the demand for handover codes within a preset time period in the future includes: Obtain historical data on couriers, including the frequency of handover code usage, regional distribution, and time period distribution patterns; Preprocessing the acquired historical data of the couriers to obtain preprocessed historical data; Based on the pre-processed historical data, the ARIMA model is used to fit the periodicity of demand changes and predict the demand for handover codes within a preset period in the future; Divide the target area into grid cells that meet preset requirements and label the divided grid cells, including order density, hotspot markers, and demand time windows; Based on the labeling information of the grid cells and the predicted handover code demand within a future preset time period, a random forest regression model is used to predict the handover code demand for each grid cell within the future preset time period.
3. The method for generating an express handover code based on dynamic binding according to claim 2, characterized in that: The preprocessing of the acquired historical data of the courier to obtain the preprocessed historical data includes: Obtain historical data on couriers, including: frequency of handover code usage, regional distribution, and time period distribution patterns; Performing anomaly elimination processing on the acquired historical data of the courier to obtain the historical data of the courier after the anomaly elimination processing; The historical data of the couriers after the abnormalities are eliminated are processed with gap filling to obtain the historical data of the couriers after gap filling.
4. The method for generating an express handover code based on dynamic binding according to claim 1, characterized in that: The method generates a unique and irreversible handover code identifier using a dynamic hash generation algorithm based on the predicted handover code demand of the target grid within a preset future time period and the courier identity information and timestamp, including: Build a triple identity anchor based on the courier's unique ID, desensitized mobile phone number, and device fingerprint; The millisecond-accurate UTC timestamp is used as a dynamic factor and combined with the triple identity anchor to generate the string to be hashed. The string to be hashed is generated using the SHA-256 algorithm to generate an initial hash value; Obtain the target grid code based on the courier's real-time positioning, and convert the obtained target grid code into a salt value; Insert the salt value into the initial hash value and perform a second round of SHA-256 operation on the initial hash value with the inserted salt value to generate the final identifier; The device fingerprint includes: generating a device fingerprint through the terminal MAC address and SIM card IMSI code.
5. The method for generating an express handover code based on dynamic binding according to claim 1, characterized in that: The method further comprises: Get the millisecond timestamp and zone salt value based on the generated final identifier; Calculate the remaining delivery time based on the obtained millisecond timestamp; determine the priority of the printing task based on the remaining delivery time; Determine the printer in the corresponding grid area based on the regional salt value, and obtain the real-time status, task queue length, remaining amount of thermal paper, and historical printing efficiency of the printer in the grid area; Task allocation is optimized through a greedy algorithm based on the printing task priority, the real-time status of the printers in the corresponding grid area, the task queue length, the remaining amount of thermal paper, and the historical printing efficiency.
6. The method for generating an express handover code based on dynamic binding according to claim 1, characterized in that: The method further comprises: Generate a QR code based on the generated final identifier; Based on the image enhancement model, the generated QR code is subjected to anti-blurring and anti-occlusion processing to obtain the processed QR code.
7. The method for generating an express delivery handover code based on dynamic binding according to claim 6, characterized in that: The anti-blurring and anti-occlusion processing is performed on the generated QR code based on the image enhancement model to obtain the processed QR code, including: Constructing a training data set, wherein the training data set includes: a printing defect data set, an environmental interference data set, and a medium difference data set; Preprocess the constructed training dataset, including: Code point features are extracted through CNN, and histogram equalization and edge sharpening are performed on low-contrast images to obtain the preprocessed training dataset; Repair the damaged areas in the training dataset by generating an adversarial network to obtain the preprocessed training dataset; The image enhancement model is trained using the preprocessed training data set to obtain a trained image enhancement model; Use the trained image enhancement model to perform anti-blurring and anti-occlusion processing on the generated QR code to obtain the processed QR code; Scan the printed QR code. When the recognition rate is lower than the preset value, reprinting is triggered and the current defect sample is fed back into the training set to achieve continuous evolution of the image enhancement model.
8. A device for generating an express delivery code based on dynamic binding, characterized in that: include: The handover code demand acquisition module is used to predict the handover code demand of the target grid within a preset time period in the future based on the courier's historical data using an intelligent prediction model; The handover code identifier generation module is used to generate a unique and irreversible handover code identifier using a dynamic hash generation algorithm based on the predicted handover code demand of the target grid within a preset future time period and the courier's identity information and timestamp; The intelligent prediction model predicts the handover code demand of the target grid within a preset time period in the future based on time series analysis and random forest model.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method for generating an express handover code based on dynamic binding according to any one of claims 1 to 7 are implemented.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the computer program is executed by a processor, the steps of the method for generating an express handover code based on dynamic binding according to any one of claims 1 to 7 are implemented.