A freight containerization method based on user behavior habits
Through the freight boxing method based on user behavior habits, using historical waybill data and geohash encoding to process location data, the traditional method solves problems such as high development costs and functional conflicts when facing the increase in business volume and the needs of multiple business departments, and realizes adaptive adjustment and efficient boxing application.
Patent Information
- Application Number
- CN202411907188.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2044-12-24
AI Technical Summary
When facing the increase in business volume and the needs of multiple business departments, the traditional freight container method has problems such as high development costs, functional conflicts, relying on personal abilities and inability to meet personalized needs.
The freight boxing method based on user behavior habits is adopted. By using historical waybill data, the waybill features are extracted and grouped, the feature weight coefficient is calculated, and the position data is processed using geohash encoding, the position weight two-dimensional matrix is established, and the model is adaptively adjusted to adapt to new constraints.
This method uses daily behavior learning, optimizes data models, adaptive adjustments to accommodate more constraints, reduces development costs, adapts to the needs of different business departments, reduces labor and expense costs, and improves the efficiency of boxing applications.
Smart Images

Figure CN119358975B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a freight container packing method based on user behavior habits. Background Art
[0002] At present, the traditional freight container packing method relies on various constraints, such as: mileage saving, empty mileage, packing time, container condition, etc. However, with the continuous increase in business volume and the continuous enrichment of business scenarios, the traditional container packing method has the following technical difficulties:
[0003] 1. Currently, due to the increase in business volume, new hard constraints continue to emerge, and development costs are high in the short term.
[0004] 2. Different business departments have different definitions of the same constraint, resulting in functional conflicts. The traditional box-building method cannot be compatible with the business of multiple departments at the same time.
[0005] 3. Different individuals have different behavioral habits and different abilities to apply multiple constraints. The success of the traditional box-building method depends heavily on personal ability and understanding of the business.
[0006] 4. As the business capabilities of the same person deepen, the traditional box-packing method can no longer meet personal needs. In fact, manual box-packing is more effective than the traditional box-packing method. The traditional box-packing method cannot save manpower and cost. Summary of the invention
[0007] The purpose of the present invention is to solve the above problems and to propose a freight container method based on user behavior habits.
[0008] In order to achieve the above purpose, the following technical solutions are adopted:
[0009] A method for packing a freight container based on user behavior habits comprises the following steps:
[0010] S1: The historical waybill dataset WaybillArray[W1(I1O1),W2(I2O2),…,W n (I n O n )] and store it in the database, and then access the database through the asynchronous data synchronization service to obtain the historical waybill data set of the specified user User;
[0011] The asynchronous data synchronization service for waybills is a Python program deployed on the server;
[0012] The database is a MySQL database deployed on the server;
[0013] The WaybillArray is an array of historical waybill data;
[0014] Among them, the W 1~ W n Represents different waybill numbers, the I 1~ I n Represents the import order corresponding to the waybill number, O 1~ O n Represents the export order corresponding to the waybill number.
[0015] S2: Use the data obtained in S1 to extract and group the waybill features in WaybillArray to obtain the number of waybills with the same features and their feature values;
[0016] The data is a historical waybill data set;
[0017] S3: Calculate the weight coefficient of the waybill feature;
[0018] S4: Use the data obtained in S1 to extract the locations in the waybill in WaybillArray, encode and group the unpacking and repacking location points therein, and obtain the longitude and latitude code FT of the waybill and the number of occurrences of the same code Q;
[0019] The data is a historical waybill data set;
[0020] The encoding adopts geohash algorithm;
[0021] S5: The location point data is changed into a location weight two-dimensional matrix, a location weight two-dimensional matrix is created, the encoded waybill groups are traversed, and based on the longitude and latitude codes FT obtained after geohash encoding and the number of times the code appears Q, a corresponding relationship between the longitude and latitude codes FT and the number of times Q appears is established and the two-dimensional matrix is updated;
[0022] S6: Repeat steps S1 to S5, record and continuously update the feature weight coefficients and the position weight two-dimensional matrix;
[0023] S7: Export the updated feature weight coefficients and position weight two-dimensional matrix from the database to the feature weight and position matrix model.
[0024] Preferably, the user's method of use includes the following steps:
[0025] K1: According to the user's username, the corresponding data is extracted from the feature weight and position matrix model and imported into the data model;
[0026] K2: Extract data from the order pool and import it into the data model;
[0027] K3: Match the data in the order pool with the data in the feature weight and position matrix model through the data model to calculate the optimal matching result;
[0028] K4: Feedback the best matching results to the user.
[0029] Preferably, in step S2, the waybill features in the historical waybill array are extracted and grouped by a feature extraction algorithm and a classification algorithm to obtain waybill feature values. Waybills with the same features are divided into 1 group, which can be divided into m groups in total. After grouping, the number of waybills and feature values in each group are counted and mapped in the corresponding waybill group, wherein the number of waybills is distributed in [P1, P2, ..., P m ] interval, the range of the waybill characteristic value is (X1, X2, X3, ..., X n ).
[0030] Preferably, in step S3, the formula for calculating the similarity of the waybill features is:
[0031]
[0032] Where: A is the feature similarity, P is the number of waybills with the same feature, W is the weight coefficient of a certain feature, and X is the feature value.
[0033] Furthermore, when used for training the model, the default similarity of the waybills that have been matched in the past is 100%, that is, A=1, and the known X is substituted to calculate P and W; in the application process, A is a variable value, but P and W become known data. The closer the calculated value of A is to 100%, the higher the matching degree is. The specific calculation process is:
[0034] 1=P1(W1X1+W2X2+…+W n X n ) / (P1+P2+…+P m )
[0035] …
[0036] 1=P m (W1X1+W2X2+…+W n X n ) / (P1+P2+…+P m ).
[0037] During the application process, A is a changing value, but P and W become known data. The closer the calculated value of A is to 100%, the higher the matching degree is.
[0038] Preferably, in step S4, the historical waybill data is traversed, and the geohash.encode function is used to convert the longitude and latitude of the import and export orders in the waybill data into geohash codes. The encoded waybills are grouped based on the geohash code string prefix, and the waybills with the same code are grouped into one group, which can be divided into m groups in total. After the grouping is completed, the number of occurrences of the code in each group is counted and mapped in the corresponding group. The number of occurrences of the same code is [Q1, Q2, ..., Q m ].
[0039] Since the longitude and latitude of similar locations have the same encoding results after geohash encoding, the waybills are grouped according to the prefix of the string data after geohash encoding, and the waybills with the same prefix encoding are grouped together.
[0040] Preferably, in step S5, a two-dimensional matrix of position weights is created, the encoded waybill groups are traversed, and based on the longitude and latitude codes FT obtained after geohash encoding and the number of times the code appears Q, a corresponding relationship between the longitude and latitude codes FT and the number of times Q appears is established and the two-dimensional matrix is updated. The two-dimensional matrix is [G1[F1T1,Q1],…,G m [F m T m ,Q m ]], where G1~G m Represents the two-dimensional matrix number, F1T1~F m T m For longitude and latitude codes, Q1~Q m The number of times the same code appears.
[0041] Preferably, step K3 includes the following sub-steps:
[0042] K31: The user matches the export orders OutOrder1...OutOrdern according to the import order InOrder, calculates the similarity of the waybill features and sorts them to obtain the feature sorting group FeatureSort;
[0043] K32: The user matches the export orders OutOrder1...OutOrdern according to the import order InOrder, calculates the position similarity and sorts them, and obtains the position sorting group PositionSort;
[0044] K33: Merge the feature sorting group and the position sorting group to obtain the matching result.
[0045] Preferably, in step K31, the order data in the data model is traversed, InOrder and OutOrder1...OutOrdern are extracted, and the feature similarity is calculated. The larger the A value is, the higher the similarity with the waybill features of the user's history is. The feature sorting group FeatureSort[Am(InOrder, OutOrderm),...,An(InOrder, OutOrdern)] is obtained by sorting from high to low. The calculation formula is:
[0046] A1=W1*InOrder(X1)+W2*InOrder(X2)+...+W m
[0047] *InOrder(X m )+...+W m+1 OutOrder1(X m+1 )+...
[0048] +W n *OutOrder1(X n ) ......
[0049] A n =W1*InOrder(X1)+W2*InOrder(X2)+...+W m
[0050] *InOrder(X m )+...+W m+1 OutOrdern(X m+1 )+...
[0051] +W n *OutOrdern(X n )
[0052] Among them, A is the feature similarity, W is the feature weight coefficient, X is the feature value, InOrder is the import order, and OutOrder is the export order.
[0053] Preferably, in step K32, the order data in the data model is traversed, the location information of InOrder and OutOrder1...OutOrdern is extracted, and geohash encoding is performed, and F is searched in the two-dimensional matrix of location weights. m T m If it is not found, then Q = 0, if it is found, then the corresponding Q = Q m , the obtained position similarities are sorted from high to low to obtain the position sorting group PositionSort[Q m =Q m, ..., Q p =0], where Q m =Q m Represents, the maximum position similarity value is to find the corresponding Q m .
[0054] Preferably, in step K33, the merging formula of the best matching results is:
[0055] Sort m =A m *Q m / (Q1+Q2+...+Q n ).
[0056] Among them, A m is the feature similarity, Q m is the position similarity, Q1~Q n It is the sum of the corresponding weights of export orders in the two-dimensional matrix of position weights.
[0057] Compared with the prior art, the beneficial effects of the present invention are as follows: the method continuously learns and optimizes the data model from the actual operation of the user through daily behavior learning, and can adaptively adjust the model to accommodate more new constraints. Moreover, the method mainly relies on the learning and optimization of user behavior data, rather than hard-coded rules or algorithms, and does not conflict with the traditional box-fitting method, so high development costs can be avoided; the method standardizes the different definitions of the same constraint by different business departments by constructing a unified data model, so as to adapt to the needs of different business departments; by analyzing the historical behavior data of the user, the personal behavior habits and business capabilities of each user can be understood; and because the system can automatically learn and optimize the data model, it can help users better apply multiple constraints, even if their understanding of the business is limited; through automated and intelligent box-fitting solution recommendations, the method can significantly reduce the time and cost of manual processing of box-fitting. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1 This is a schematic diagram of a model training method for a freight container based on user behavior habits in Example 1 of the present invention;
[0059] Figure 2 This is a user usage diagram of a freight box packing method based on user behavior habits in Example 1 of the present invention;
[0060] Figure 3 This is a schematic diagram of calculating the optimal matching result of a freight box packing method based on user behavior habits in Example 1 of the present invention; DETAILED DESCRIPTION
[0061] Hereinafter, a method for packing a freight container based on user behavior habits of the present invention will be described in detail with reference to the accompanying drawings.
[0062] like Figure 1 As shown, a method for packing a freight container based on user behavior habits includes the following steps:
[0063] S1: The historical waybill dataset WaybillArray[W1(I1O1),W2(I2O2),…,W n (I n O n )] and store it in the database, and then access the database through the asynchronous data synchronization service to obtain the historical waybill data set of the specified user User;
[0064] The asynchronous data synchronization service for waybills is a Python program deployed on the server;
[0065] The database is a MySQL database deployed on the server;
[0066] The WaybillArray is an array of historical waybill data;
[0067] Among them, the W 1~ W n Represents different waybill numbers, the I 1~ I n Represents the import order corresponding to the waybill number, O 1~ O n Represents the export order corresponding to the waybill number.
[0068] S2: Use the data obtained in S1 to extract and group the waybill features in WaybillArray to obtain the number of waybills with the same features and their feature values;
[0069] The data is a historical waybill data set;
[0070] S3: Calculate the weight coefficient of the waybill feature;
[0071] S4: Using the data obtained in S1, extract the locations in the waybill in WaybillArray, and encode and group the unpacking and repacking location points therein;
[0072] The data is a historical waybill data set;
[0073] The encoding adopts geohash algorithm;
[0074] S5: The location point data is changed into a location weight two-dimensional matrix, a location weight two-dimensional matrix is created, the encoded waybill groups are traversed, and based on the longitude and latitude codes FT obtained after geohash encoding and the number of times the code appears Q, a corresponding relationship between the longitude and latitude codes FT and the number of times Q appears is established and the two-dimensional matrix is updated;
[0075] S6: Repeat steps S1 to S5, record and continuously update the feature weight coefficients and the position weight two-dimensional matrix;
[0076] S7: Export the updated feature weight coefficients and position weight two-dimensional matrix from the database to the feature weight and position matrix model.
[0077] like Figure 2 As shown, the user's method of use includes the following steps:
[0078] K1: According to the user's username, the corresponding data is extracted from the feature weight and position matrix model and imported into the data model;
[0079] K2: Extract data from the order pool and import it into the data model;
[0080] K3: Match the data in the order pool with the data in the feature weight and position matrix model through the data model to calculate the optimal matching result;
[0081] K4: Feedback the best matching result to the user. Figure 1 , Figure 2 , Figure 3 As shown, feature weight and position matrix model training.
[0082] like Figure 3 As shown, step K3 includes the following sub-steps:
[0083] K31: The user matches the export orders OutOrder1...OutOrdern according to the import order InOrder, calculates the similarity of the waybill features and sorts them to obtain the feature sorting group FeatureSort;
[0084] K32: The user matches the export orders OutOrder1...OutOrdern according to the import order InOrder, calculates the position similarity and sorts them, and obtains the position sorting group PositionSort;
[0085] K33: Merge the feature sorting group and the position sorting group to obtain the matching result.
[0086] In this embodiment, combined with Figure 1 , Figure 2 , Figure 3 As shown, feature weight and position matrix model training:
[0087] The historical waybill dataset is obtained through the traditional box nesting method and stored in the MySQL database. Then the system sets up and starts to execute the scheduled task. The MySQL database is accessed through the waybill asynchronous data synchronization service to obtain the historical waybill dataset of the specified user. The acquired historical waybill data is used to extract the waybill features using the BoW algorithm and group them using the python-scikit-learn tool. Waybills with the same features are grouped together. After the waybill features are grouped, the waybill feature weight coefficient is calculated based on the number of waybills in each group and the waybill feature range using the formula. Then the location in the waybill is extracted, and the unpacking and repacking location points are geohash encoded and grouped. Waybills with the same code are grouped together. Based on the location information and geohash encoding, a two-dimensional matrix of location weights is constructed, and the location similarity is calculated. The calculated feature weight coefficient and location similarity matrix coefficient are saved in the database, and the feature weight and location matrix model are imported. The scheduled task is completed and then repeated daily.
[0088] User use:
[0089] The system uses Python's third-party library numpy to import the data of the feature weight coefficient and the position weight two-dimensional matrix into the current data calculation model. Then the system extracts the import order and export order data that the user currently needs to match from the order pool, and matches the outbound orders OutOrder1...OutOrdern according to the import order InOrder. The feature weight coefficient calculated for each possible export order in the order pool is used by the feature weight and position matrix model. The feature similarity between them is calculated by combining the feature values of the import order and the export order. InOrder and OutOrder1...OutOrdern are extracted to calculate the feature similarity. The larger the A value, the higher the similarity with the historical waybill features of the user. The feature sorting group FeatureSort[Am(InOrder, OutOrderm),...,An(InOrder, OutOrdern)] is obtained by sorting from high to low. The system will also match the outbound orders OutOrder1...OutOrdern according to the import order InOrder, use geohash coding to encode the location information, and find the corresponding location weight in the location weight two-dimensional matrix of the feature weight and position matrix model. Find F in the location weight two-dimensional matrix. m T m If it is not found, then Q = 0, if it is found, then the corresponding Q = Q m , the obtained position similarities are sorted from high to low to obtain the position sorting group PositionSort[Q m =Qm , ..., Q p =0], where Q m =Q m Represents, the maximum position similarity value is to find the corresponding Q m ,Finally, the waybill feature group and the waybill location are combined to obtain the matching result, and then the matching result is fed back to the user.
[0090] The above description is only a preferred example of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have other optimization schemes and additional functions. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for packing freight containers based on user behavior habits, characterized by: The training of the model consists of the following steps: S1. Use the traditional container nesting method to create the historical waybill dataset WaybillArray[W1(I1O1),W2(I2O2),…,W n (I n O n )] and store it in the database, and then access the database through the asynchronous data synchronization service to obtain the historical waybill data set of the specified user User; The database is a MySQL database deployed on the server; The asynchronous data synchronization service for waybills is a Python program deployed on the server; The WaybillArray is an array of historical waybill data; Among them, the W 1~ W n Represents different waybill numbers, the I 1~ I n Represents the import order corresponding to the waybill number, O 1~ O n Represents the export order corresponding to the waybill number; S2. Using the data obtained in S1, extract and group the waybill features in WaybillArray to obtain the number P of waybills with the same features and the feature value X; The acquired data is a historical waybill data set; S3, calculating the weight coefficient of the waybill feature; In step S3, the formula for calculating the weight coefficient of the waybill feature is: Where: A is the feature similarity, P is the number of waybills with the same feature, W is the weight coefficient of a feature, and X is the feature value; S4. Use the data obtained in S1 to extract the locations in the waybill in WaybillArray, encode and group the unpacking and repacking location points therein, and obtain the longitude and latitude code FT of the waybill and the number of occurrences of the same code Q; The data is a historical waybill data set; The encoding adopts geohash algorithm; S5. The location point data is changed into a location weight two-dimensional matrix. A location weight two-dimensional matrix is created. The encoded waybill groups are traversed. Based on the longitude and latitude codes FT obtained after geohash encoding and the number of times the code appears Q, a corresponding relationship between the longitude and latitude codes FT and the number of times Q appears is established and the two-dimensional matrix is updated. S6, repeating steps S1 to S5, continuously recording and updating the feature weight coefficient and the position weight two-dimensional matrix; S7, importing the updated feature weight coefficient and position weight two-dimensional matrix from the database into the feature weight and position matrix model; The user's usage method includes the following steps: K1. According to the user's username, the corresponding data is extracted from the feature weight and position matrix model and imported into the data model; The corresponding data is a two-dimensional matrix of feature weight coefficients and position weights of the waybill; The data model is a calculation model used to calculate the optimal matching result; K2. Extract the data from the order pool and import it into the data model; The data in the order pool is the order data to be packed, which is stored in the order database; K3, match the data in the order pool with the data in the feature weight and position matrix model through the data model, and calculate the optimal matching result; K4. Feedback the best matching results to the user; Step K3 includes the following sub-steps: K31. The user matches the outbound orders OutOrder1...OutOrdern according to the import order InOrder, calculates the similarity of the waybill features and sorts them to obtain the feature sorting group FeatureSort; K32. The user matches the outbound orders OutOrder1...OutOrdern according to the import order InOrder, calculates the position similarity and sorts them to obtain the position sorting group PositionSort; K33. Merge the feature sorting group and the position sorting group to obtain the matching result.
2. The method for packing a freight container based on user behavior habits according to claim 1, characterized in that: In step S2, the waybill features in the historical waybill array are extracted by the Bow algorithm to obtain the waybill feature values, and the features are grouped using the python-scikit-learn tool. Waybills with the same features are divided into 1 group, and a total of k groups are divided. After grouping, the number of waybills and feature values in each group are counted and mapped in the corresponding waybill group, where the number of waybills is distributed in the interval [P1, P2, ..., Pk], and the range of waybill feature values is (X1, X2, X3, ..., Xn).
3. The method for packing a freight container based on user behavior habits according to claim 1, characterized in that: In step S4, the historical waybill data is traversed, and the geohash.encode function is used to convert the longitude and latitude of the import and export orders in the waybill data into geohash codes. The encoded waybill is grouped based on the prefix of the geohash code string. Waybills with the same code are grouped into one group, which can be divided into m groups in total. After the grouping is completed, the number of occurrences of the code in each group is counted and mapped in the corresponding group. The number of times the same code appears is [Q1, Q2, ..., Q m ].
4. The method for packing a freight container based on user behavior habits as claimed in claim 3, characterized in that: In step S5, the two-dimensional matrix is [G1[F1T1,Q1],…,G m [F m T m ,Q m ]], where G1~G m Represents the two-dimensional matrix number, F1T1~F m T m For longitude and latitude codes, Q1~Q m The number of times the same code appears.
5. The method for packing a freight container based on user behavior habits according to claim 1, characterized in that: In step K31, InOrder and OutOrder1...OutOrdern are extracted, and feature similarity is calculated. The larger the A value is, the higher the similarity is with the waybill features of the user's history. The feature sorting group FeatureSort[Am(InOrder, OutOrderm),...,An(InOrder, OutOrdern)] is obtained by sorting from high to low. The calculation formula is: A1=W1*InOrder(X1)+W2*InOrder(X2)+...+W m *InOrder(X m )+...+W m+1 OutOrder1(X m+1 )+... +W n *OutOrder1(X n ) ...... A n =W1*InOrder(X1)+W2*InOrder(X2)+...+W m *InOrder(X m )+...+W m+1 OutOrdern(X m+1 )+... +W n *OutOrdern(X n ) Where A is the feature similarity, W is a feature weight coefficient, and X is the feature value.
6. The method for packing a freight container based on user behavior habits as claimed in claim 1, characterized in that: In step K32, the position information of InOrder and OutOrder1...OutOrdern is extracted and geohash encoded, and FmTm is searched in the position weight two-dimensional matrix. If it is not found, Q=0, if it is found, the corresponding Q=Qm, and the obtained position similarity is sorted from high to low to obtain the position sorting group PositionSort[Qm=Qm,...,Qp=0], where Qm=Qm represents that the maximum position similarity value is the corresponding Qm found.
7. The method for packing a freight container based on user behavior habits as claimed in claim 1, characterized in that: In step K3, merge the formula: Sort m =A m *Q m / (Q1+Q2+...+Q n ) Among them, A m is the feature similarity, Q m is the position similarity, Q1~Q n It is the sum of the corresponding weights of export orders in the two-dimensional matrix of position weights.
Citation Information
Patent Citations
Method for realizing coupling calculation of tritium transport models in different dimensions based on Matlab / Simulink
CN112949120A
Intelligent box splicing method, system and equipment based on machine learning
CN117422372A