Disclosure of Invention
The inventor finds that the scheme of taking the order cancelled in the prior art wastes manpower and material resources, and further causes greater loss if the order taking fails to cause the commodity to be delivered from the warehouse.
The invention aims to solve the technical problems that: how to reduce the loss of the order production process caused by the order cancellation.
According to an embodiment of the present invention, there is provided a method for processing an order, including: predicting the cancelled probability of the order according to the commodity attribute information of various commodities in the order; sequencing the orders according to the sequence of the cancelled probability of each order from small to large; the production of each order is arranged in the order of the orders.
In one embodiment, predicting a probability of cancellation of an order based on item attribute information for various items in the order comprises: respectively inputting the commodity attribute information of various commodities into a classification model to obtain cancelled probabilities of the various commodities; and determining the cancelled probability of the order according to the cancelled probabilities of various commodities contained in the order.
In one embodiment, the classification model is determined using the following method: acquiring commodity attribute information of various commodities in the historical order and the production state of the historical order as training data, wherein the production state comprises cancelled and non-cancelled; and training the classification model by using the training data to determine the classification model.
In one embodiment, training the classification model using the training data comprises: randomly selecting part of commodity attribute information of various commodities according to a preset proportion range, combining the commodity attribute information with a corresponding production state to be used as training data of a decision tree, and training the decision tree to determine the decision tree; the above process is repeated until all decision trees in the classification model are determined.
In one embodiment, the step of inputting the commodity attribute information of each commodity into the classification model to obtain the cancelled probability of each commodity comprises the following steps: selecting commodity attribute information corresponding to a decision tree in a classification model for each commodity, inputting the commodity attribute information into the decision tree model, and acquiring the classification of the commodity in the decision tree; and determining the cancelled probability of the commodity according to the classification of the commodity in each decision tree and the total number of the decision trees.
In one embodiment, the cancelled probability for an order is the sum of the cancelled probabilities for various items in the order minus the simultaneous cancelled probabilities for various items.
According to another embodiment of the present invention, there is provided an order processing apparatus including: the order probability prediction module is used for predicting the cancelled probability of the order according to the commodity attribute information of various commodities in the order; the order sequencing module is used for sequencing the orders according to the sequence of the cancelled probability of each order from small to large; and the order production arrangement module is used for arranging the production of each order according to the sequence of each order.
In one embodiment, the order probability prediction module is configured to input the commodity attribute information of each commodity into the classification model to obtain cancelled probabilities of the commodities, and determine the cancelled probability of the order according to the cancelled probabilities of the commodities included in the order.
In one embodiment, the processing apparatus further comprises: and the classification model determining module is used for acquiring commodity attribute information of various commodities in the historical orders and the production states of the historical orders as training data, wherein the production states comprise cancelled and non-cancelled states, and the training data is used for training the classification model to determine the classification model.
In one embodiment, the classification model determining module is configured to randomly select part of the commodity attribute information of each commodity according to a preset proportion range, combine the part of the commodity attribute information with the corresponding production state to serve as training data of a decision tree, train the decision tree to determine the decision tree, and repeat the above process until all the decision trees in the classification model are determined.
In one embodiment, the order probability prediction module is configured to select, for each commodity, commodity attribute information corresponding to a decision tree in the classification model and input the commodity attribute information into the decision tree model, obtain a classification of the commodity in the decision tree, and determine a cancelled probability of the commodity according to the classification of the commodity in each decision tree and a total number of the decision trees.
In one embodiment, the cancelled probability for an order is the sum of the cancelled probabilities for various items in the order minus the simultaneous cancelled probabilities for various items.
According to another embodiment of the present invention, there is provided an order processing apparatus including: a memory; and a processor coupled to the memory, the processor configured to perform a method of processing an order as in any of the preceding embodiments based on instructions stored in the memory device.
According to still another embodiment of the present invention, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method of processing an order in any of the preceding embodiments.
The invention predicts the cancelled probability of the order based on the attributes of various commodities in the order and arranges the production of the order according to the cancelled probability of each order. Orders with high cancellation probability are arranged in post-production, the production priority of the orders is reduced, the orders are probably not in the production process when being cancelled, the waste of manpower and material resources is reduced, meanwhile, the continuity of the production operation flow in the whole warehouse is guaranteed, and the production efficiency is improved.
Other features of the present invention and advantages thereof will become apparent from the following detailed description of exemplary embodiments thereof, which proceeds with reference to the accompanying drawings.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The scheme is provided for solving the problem that in the prior art, the cancelled order can only be intercepted after the order is produced, and manpower and material resources are wasted.
The order processing apparatus in the embodiment of the present invention may be implemented by various computing devices or computer systems, and is described below with reference to fig. 1 and 2.
FIG. 1 is a block diagram of one embodiment of an order processing apparatus of the present invention. As shown in fig. 1, the apparatus 10 of this embodiment includes: a memory 110 and a processor 120 coupled to the memory 110, wherein the processor 120 is configured to execute a method for processing an order according to any embodiment of the present invention based on instructions stored in the memory 110.
Memory 110 may include, for example, system memory, fixed non-volatile storage media, and the like. The system memory stores, for example, an operating system, an application program, a Boot Loader (Boot Loader), a database, and other programs.
Fig. 2 is a block diagram of another embodiment of an order processing apparatus according to the present invention. As shown in fig. 2, the apparatus 10 of this embodiment includes: the memory 110 and the processor 120 may further include an input/output interface 230, a network interface 240, a storage interface 250, and the like. These interfaces 230, 240, 250 and the connection between the memory 110 and the processor 120 may be, for example, via a bus 260. The input/output interface 230 provides a connection interface for input/output devices such as a display, a mouse, a keyboard, and a touch screen. The network interface 240 provides a connection interface for various networking devices, such as a database server or a cloud storage server. The storage interface 250 provides a connection interface for external storage devices such as an SD card and a usb disk.
The present invention provides a method for processing an order, which is described below with reference to fig. 3.
FIG. 3 is a flowchart of an embodiment of a method for processing an order according to the invention. As shown in fig. 3, the method of this embodiment includes:
step S302, predicting the cancelled probability of the order according to the commodity attribute information of various commodities in the order.
One order comprises one or more commodities, each commodity has corresponding commodity attribute information, the commodity attribute information comprises commodity identification, commodity unit price, purchase quantity, commodity category, ordering time, ordering place and the like, and further the commodity attribute information can also comprise corresponding purchasing user information, such as user identification, user credit and the like.
The user credit may be determined from the user's purchase record. The user credit rating that can be determined for a certain commodity, for example, obtaining the user's historical orders and corresponding production status, including cancelled and non-cancelled; then various commodities in the historical orders and corresponding production states thereof are extracted, and the user credit degree for the commodities is determined according to the ratio of the times of canceling the commodities to the total amount of orders. The credit rating of the user can also be evaluated overall, for example, the historical order of the user and the corresponding production state are obtained firstly, and the production state comprises cancelled and non-cancelled; and then determining the credit rating of the user according to the ratio of the cancelled amount of orders of the user history to the total amount of orders of the user.
And step S304, sequencing the orders according to the order of the cancelled probability of each order from small to large.
Step S306, the production of each order is arranged according to the sequence of each order.
The method of the above embodiment predicts the probability of being cancelled of an order based on the attributes of various items in the order, and schedules production of the order according to the probability of being cancelled of each order. Orders with high cancellation probability are arranged in post-production, the production priority of the orders is reduced, the orders are probably not in the production process when being cancelled, the waste of manpower and material resources is reduced, meanwhile, the continuity of the production operation flow in the whole warehouse is guaranteed, and the production efficiency is improved.
To address the problem of how to predict the cancellation probability of an order according to the product attribute information of various products in the order in step S302, the present invention provides the following exemplary embodiments:
preferably, commodity attribute information of various commodities in the order is extracted; respectively inputting the commodity attribute information of various commodities into a classification model to obtain cancelled probabilities of the various commodities; and determining the cancelled probability of the order according to the cancelled probabilities of various commodities contained in the order.
In one embodiment, the commodity attribute information of various commodities is divided into commodity characteristic attribute information and commodity user attribute information according to characteristics; respectively inputting the commodity characteristic attribute information of various commodities into a classification model to obtain first cancelled probabilities of the various commodities, determining second cancelled probabilities of the various commodities according to the commodity user attribute information, and carrying out weighted summation on the first cancelled probabilities and the second cancelled probabilities aiming at each commodity to obtain the cancelled probabilities of the commodities; and determining the cancelled probability of the order according to the cancelled probabilities of various commodities contained in the order. Wherein the second cancelled probability is, for example, the user credit for the commodity.
Further, the cancelled probability of the order is, for example, the sum of the cancelled probabilities of the various items in the order minus the simultaneous cancelled probabilities of the various items. The probability of canceling the commodities simultaneously is, for example, the product of the probabilities of canceling the commodities.
The classification model is, for example, a decision tree model or a naive bayes model, and the decision tree model is, for example, a random forest model or a gradient boost decision tree model. The above models are all prior art and are not described herein.
Before the classification model is used for obtaining the cancelled probabilities of various commodities, the classification model can be trained by using historical order data to obtain the classification model. Described below in conjunction with fig. 4.
FIG. 4 is a flow chart of another embodiment of the order processing method of the present invention. As shown in fig. 4, before step S302, the method may further include:
step S402, commodity attribute information of various commodities in the historical orders and production states of the historical orders are obtained as training data.
The production state includes cancelled and not cancelled. The production state may be subjected to binarization processing, for example, 0 means not canceled and 1 means canceled.
And S404, training the classification model by using the training data to determine the classification model.
Specifically, when the classification model is composed of a plurality of decision trees, part of commodity attribute information of various commodities is randomly selected according to a preset proportion range, and is combined with a corresponding production state to serve as training data of one decision tree, and the decision tree is trained to determine the decision tree; the above process is repeated until all decision trees in the classification model are determined.
After the commodity attribute information and the production state of each commodity in the historical order are extracted, the commodity attribute information and the production state can be stored according to the form of table 1.
TABLE 1
Each row in table 1 represents the product attribute information and the corresponding production status for a product. Wherein E1-Ei are independent variables, (i is a positive integer and represents the i-th type commodity attribute information), and D is a dependent variable. When the classification model is composed of a plurality of decision trees, a part of data can be extracted according to table 1 to generate a plurality of training subsets, and each training subset is used as training data of 1 decision tree. Specifically, the row data of the part representing the product attribute information in the retrieved extraction table 1 is combined with the corresponding production state to form one training subset, and the types of the product attribute information in the training subsets are, for example, different from 10% to 90% of the total types. And the data in each training subset is used for constructing a decision tree until all decision trees in the classification model are constructed, and then the classification model is obtained.
For example, for a decision tree, commodity unit prices, purchase quantities and production states of various commodities are selected to be combined to obtain training data of the decision tree; and aiming at the other decision tree, selecting ordering time, purchase quantity and production state of various commodities to be combined to obtain training data of the decision tree.
Based on the above training process, each decision tree corresponds to different commodity attribute information, so when determining the cancelled probability of a commodity, the following method can be adopted:
selecting commodity attribute information corresponding to a decision tree in a classification model for each commodity, inputting the commodity attribute information into the decision tree model, and acquiring the classification of the commodity in the decision tree; and determining the cancelled probability of the commodity according to the classification of the commodity in each decision tree and the total number of the decision trees.
After the commodity attribute information and the production state of each commodity in the order are extracted, the commodity attribute information and the production state can be stored in the form of table 2.
TABLE 2
The data of the column corresponding to each commodity in table 2 is selected for different decision trees and input into the decision trees to obtain the classification of various commodities in each decision tree, and the cancelled probability of a commodity is, for example, the number of times of being divided into cancelled classes in the classification model divided by the total number of the decision trees.
For example, in order to obtain the cancelled probability of a commodity with a commodity ID of 312341, first, for a first decision tree constructed according to two items of commodity attribute information, namely commodity unit price and purchase quantity, commodity unit price 2.15 and purchase quantity 5 of 312341 are input into the first decision tree, classification of 312341 as cancelled class is obtained, and referring to the above process, classification of 312341 in each decision tree is obtained, for example, 312341 in 40 decision trees is classified as cancelled class, 312341 in 10 trees is classified as non-cancelled class, and cancellation probability of 312341 is 80%.
The classification model can be updated by newly added historical order data every preset period.
The invention also provides an order processing device, which is described below with reference to fig. 5.
FIG. 5 is a block diagram of an embodiment of an order processing apparatus according to the present invention. As shown in fig. 5, the apparatus 50 includes:
the order probability prediction module 502 is configured to predict the cancelled probability of an order according to the commodity attribute information of each commodity in the order.
Preferably, the order probability prediction module 502 is configured to input the commodity attribute information of each commodity into the classification model respectively to obtain cancelled probabilities of each commodity, and determine the cancelled probability of the order according to the cancelled probabilities of each commodity included in the order.
Further, the order probability prediction module 502 is configured to select, for each commodity, commodity attribute information corresponding to a decision tree in the classification model and input the commodity attribute information into the decision tree model, obtain a classification of the commodity in the decision tree, and determine a cancelled probability of the commodity according to the classification of the commodity in each decision tree and the total number of the decision trees.
Preferably, the cancelled probability of the order is the sum of the cancelled probabilities of the various commodities in the order minus the simultaneous cancelled probabilities of the various commodities.
The order sorting module 504 is configured to sort the orders according to a descending order of the cancelled probability of each order.
An order production scheduling module 506 for scheduling the production of the orders according to the ordering of the orders.
In one embodiment, the processing device 50 of the order may further include:
the classification model determining module 508 is configured to obtain commodity attribute information of various commodities in the historical order and a production state of the historical order as training data, where the production state includes cancelled and non-cancelled, and train the classification model using the training data to determine the classification model.
Preferably, the classification model determining module 508 is configured to randomly select part of the commodity attribute information of each commodity according to a preset proportion range, combine the part of the commodity attribute information with the corresponding production state to serve as training data of a decision tree, train the decision tree to determine the decision tree, and repeat the above process until all the decision trees in the classification model are determined.
The present invention also provides a computer-readable storage medium, on which a computer program is stored, which program, when executed by a processor, implements the steps of the method of processing an order in any of the preceding embodiments.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable non-transitory storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.