WO2021135212A1 - 订单处理 - Google Patents

订单处理 Download PDF

Info

Publication number
WO2021135212A1
WO2021135212A1 PCT/CN2020/106909 CN2020106909W WO2021135212A1 WO 2021135212 A1 WO2021135212 A1 WO 2021135212A1 CN 2020106909 W CN2020106909 W CN 2020106909W WO 2021135212 A1 WO2021135212 A1 WO 2021135212A1
Authority
WO
WIPO (PCT)
Prior art keywords
order
stage
vector
event
probability
Prior art date
Application number
PCT/CN2020/106909
Other languages
English (en)
French (fr)
Inventor
吴卓林
张涛
雷宇
Original Assignee
北京三快在线科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京三快在线科技有限公司 filed Critical 北京三快在线科技有限公司
Publication of WO2021135212A1 publication Critical patent/WO2021135212A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions
    • G06Q30/0601Electronic shopping [e-shopping]
    • G06Q30/0633Lists, e.g. purchase orders, compilation or processing
    • G06Q30/0635Processing of requisition or of purchase orders
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/067Enterprise or organisation modelling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions

Definitions

  • This application relates to the field of computer technology, in particular to order processing.
  • a takeaway order may trigger a meal loss compensation event.
  • a takeaway order will be generated. After the merchant takes the order to produce the meal, if there is no delivery person to take the order for a long time, the meal will be wasted. In this case, the merchant can apply to the platform for meal loss compensation, and the platform will compensate the merchant for a certain amount of expenses, so as to make up for the loss caused by the waste of meals.
  • the order can be processed to predict whether the order will trigger the event, so that the corresponding operation can be performed according to the predicted result.
  • the embodiments of the present application provide an order processing method, device, equipment, storage medium, and computer program product, which can improve the accuracy of the prediction result.
  • the technical solution is as follows:
  • an order processing method includes: obtaining an order to be delivered; extracting the characteristics of the order at a current stage, the current stage being the stage corresponding to the current time point in the processing flow of the order;
  • the characteristics of the current stage and the characteristics of the order in the historical stage are input into a predictive model, the predictive model is used to predict the probability of the occurrence of an event, and the historical stage is the stage corresponding to the historical time point in the processing flow of the order;
  • the prediction model processes the characteristics of the current stage and the characteristics of the historical stage based on time series to obtain the probability that the order triggers the occurrence of the event; based on the probability of the occurrence of the event, the delivery parameters of the order Make adjustments.
  • the processing of the characteristics of the current stage and the characteristics of the history stage based on the time sequence through the prediction model includes: comparing the characteristics of the current stage and the history stage in a time sequence.
  • the intermediate results corresponding to the stages are weighted.
  • said processing the characteristics of the current stage and the characteristics of the historical stage based on the time sequence through the prediction model includes: corresponding to the output layer of the prediction model according to the weight corresponding to each stage Weighted calculation is performed on the output vector of to obtain the probability of the occurrence of the event, wherein each dimension of the output vector corresponds to a stage in the processing flow of the order.
  • the characteristics of the current stage include a first vector
  • extracting the characteristics of the order in the current stage includes: obtaining the name of the item corresponding to the order; and mapping the name of the item to Vector space, get the first vector.
  • the characteristics of the current stage include a second vector. Accordingly, extracting the characteristics of the order in the current stage includes: obtaining the name of the item corresponding to the order; and mapping the name of the item to Vector space to obtain the first vector; fusion of the first vector and transaction parameters of the item to obtain the second vector, wherein the transaction parameters include one or more of sales volume or sales frequency item.
  • the selling frequency is obtained in the following manner: according to the order time point of the order, the corresponding relationship between the order time and the selling frequency of the merchant corresponding to the order is inquired to obtain the order time point The corresponding selling frequency.
  • the event includes a meal compensation event
  • the delivery parameter includes the delivery cost of the order
  • the adjustment of the delivery parameter of the order based on the probability of the occurrence of the event includes:
  • the order triggers the probability that the meal compensation event occurs, and the added value of the delivery cost is obtained, wherein the added value is positively related to the probability of the meal compensation event;
  • the delivery cost is adjusted.
  • the prediction model is trained in the following manner: obtaining a sample order, the sample order is marked with a label, and the label is used to indicate whether each stage of the sample order triggers the occurrence of the event; and extracting the The characteristics of each stage of the sample order; use the characteristics of each stage of the sample order and the label to perform model training to obtain the prediction model.
  • an order processing device in another aspect, and the device includes:
  • Obtaining module which is configured to obtain orders to be delivered
  • An extraction module configured to extract features of the order in the current stage, the current stage being the stage corresponding to the current time point in the processing flow of the order;
  • An input module configured to input the characteristics of the current stage and the characteristics of the order in the historical stage into a predictive model, the predictive model is used to predict the probability of an event occurring, and the historical stage is in the order processing flow The stage corresponding to the historical time point;
  • a processing module configured to process the characteristics of the current stage and the characteristics of the historical stage based on the time sequence through the prediction model to obtain the probability that the order triggers the occurrence of the event;
  • the scheduling module is configured to adjust the delivery parameters of the order based on the probability of the occurrence of the event.
  • the processing module is configured to perform a weighted calculation on the characteristics of the current stage and the intermediate results corresponding to the historical stage in a time sequence.
  • the processing module is configured to perform a weighted calculation on the output vector corresponding to the output layer of the prediction model according to the weight corresponding to each stage to obtain the probability of the occurrence of the event, wherein the Each dimension of the output vector corresponds to a stage in the order processing flow.
  • the features of the current stage include a first vector
  • the extraction module is configured to obtain the name of the item corresponding to the order; map the name of the item to the vector space to obtain The first vector.
  • the features of the current stage include a second vector
  • the extraction module is configured to obtain the name of the item corresponding to the order; map the name of the item to a vector space to obtain the first vector Fusion of the first vector and the transaction parameters of the item to obtain the second vector, wherein the transaction parameters include one or more of sales volume or sales frequency.
  • the selling frequency is obtained in the following manner: according to the order time point of the order, the corresponding relationship between the order time and the selling frequency of the merchant corresponding to the order is inquired to obtain the order time point The corresponding selling frequency.
  • the event includes a meal compensation event
  • the delivery resource includes the delivery cost of the order.
  • the adjustment module is configured to trigger the probability of occurrence of the meal compensation event according to the order , Obtain the added value of the distribution cost, wherein the added value is positively correlated with the probability of occurrence of the meal compensation event; and adjust the distribution cost of the order according to the added value.
  • the prediction model is trained in the following manner: obtaining a sample order, the sample order is marked with a label, and the label is used to indicate whether each stage of the sample order triggers the occurrence of the event; and extracting the The characteristics of each stage of the sample order; use the characteristics of each stage of the sample order and the label to perform model training to obtain the prediction model.
  • an electronic device in another aspect, includes one or more processors and one or more memories, and at least one instruction is stored in the one or more memories.
  • the one or more processors are loaded and executed to implement the operations performed by the above-mentioned order processing method.
  • a computer-readable storage medium is provided, and at least one instruction is stored in the storage medium, and the at least one instruction is loaded and executed by a processor to implement the operations performed by the above-mentioned order processing method.
  • a computer program product includes computer instructions.
  • the computer instructions When the computer instructions are executed by a computer, the computer executes the above-mentioned order processing method.
  • This embodiment provides a method for predicting orders using deep learning. Considering that the characteristics of the same order in different stages have the nature of time-series correlation, the characteristics of the order in the historical stage and the characteristics of the current stage are regarded as a time series, which together serve as the input of the model, so that through the model, according to the order in each stage The feature predicts the probability of an order trigger event, and then uses the probability of an order trigger event to adjust the delivery parameters of the order. Since the forecast not only considers the characteristics of the order in the current stage, but also considers the characteristics of the order in the historical stage and the timing of different stages, the accuracy of the forecast result can be improved.
  • FIG. 1 is a schematic diagram of an implementation environment of an order processing method provided by an embodiment of the present application
  • Fig. 2 is a flowchart of a model training method provided by an embodiment of the present application
  • FIG. 3 is an architecture diagram of a prediction model provided by an embodiment of the present application.
  • FIG. 4 is a flowchart of an order processing method provided by an embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of an order processing device provided by an embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of a terminal provided by an embodiment of the present application.
  • Fig. 7 is a schematic structural diagram of a server provided by an embodiment of the present application.
  • multiple in this application means two or more than two, for example, multiple data packets refer to two or more data packets.
  • the characteristics of the order at the current point of time will be obtained, and the eXtreme Gradient Boosting (XGBoost) algorithm is used to predict the probability of an order trigger event based on the characteristics of the order at the current point of time.
  • XGBoost eXtreme Gradient Boosting
  • the characteristics of an order can change over time. For example, an order may be cancelled at any stage, or received, or enter the next stage. If this method is adopted, only the characteristics of the order at the current time point will be considered, resulting in poor accuracy of the forecast results.
  • the prediction not only considers the characteristics of the order in the current stage, but also considers the characteristics of the order in the historical stage and the time sequence of different stages, so the accuracy of the prediction result can be improved.
  • Fig. 1 is a schematic diagram of an implementation environment of an order processing method provided by an embodiment of the present application.
  • the implementation environment includes: a terminal 101 and a scheduling platform 102.
  • the terminal 101 is connected to the dispatch platform 102 through a wireless network or a wired network.
  • the terminal 101 can be a smart phone, a game console, a desktop computer, a tablet computer, an e-book reader, an MP3 (Moving Picture Experts Group Audio Layer III, dynamic image expert compression standard audio layer 3) player or an MP4 (Moving Picture Experts Group Audio) player Layer IV, the dynamic image expert compresses standard audio layer 4) At least one of players and laptop computers.
  • the terminal 101 installs and runs an application program that supports the function of placing an order.
  • the application program may be a shopping application, a food delivery application, an express delivery application, and the like.
  • the terminal 101 is a terminal used by a user, and a user account is logged in an application program running in the terminal 101.
  • the scheduling platform 102 includes at least one of a server, multiple servers, a cloud computing platform, and a virtualization center.
  • the scheduling platform 102 is used to provide background services for applications.
  • the scheduling platform 102 includes: a server 1021 and a database 1022.
  • the server 1021 is used to process orders.
  • the server 1021 may be one or more.
  • there are multiple servers 1021 there are at least two servers 1021 that are used to provide different services, and/or, there are at least two servers 1021 that are used to provide the same service, such as providing the same service in a load balancing manner, this application The embodiment does not limit this.
  • the database 1022 stores a large number of orders and item data or merchant data associated with each order. When the server 1021 needs the order and data, it can access the database 1022 and read the data stored in the database 1022.
  • the processing result can be written to the database 1022, so that the processing result can be persistently stored through the database 1022.
  • the server 1021 may access the database 1022, read the characteristics of each stage of the sample order stored in the database 1022, use the sample order for model training, obtain a prediction model, and write the prediction model to the database 1022 , So that the prediction model is stored persistently through the database 1022.
  • the server 1021 can access the database 1022, read the prediction model stored in the database 1022, and use the prediction model to predict the probability of an order trigger event.
  • the number of the aforementioned terminal 101 and server 1021 may be more or less. For example, there may be only one terminal 101 and server 1021, or there are dozens or hundreds of terminals 101 and server 1021, or more. In this case, the implementation environment also includes other terminals or other servers. The embodiment of the present application does not limit the number of terminals or servers and the type of equipment.
  • Fig. 2 is a flowchart of a method for training a prediction model provided by an embodiment of the present application. Referring to Figure 2, the method includes:
  • the electronic device obtains a sample order.
  • the sample order may be an order that has gone through various stages in the work cycle.
  • the sample order can be marked with a label, and the label is used to indicate whether an event is triggered at each stage of the sample order.
  • the sample order may include a first sample order and a second sample order.
  • the first sample order is an order that triggers an event to occur
  • the second sample order is an order that does not trigger an event to occur.
  • the label of the first sample order is different from the label of the second sample order.
  • the model can learn from the first sample order what characteristics the sample order has a high probability of triggering the event, and what characteristics are learned through the second sample order
  • the sample has a low probability of triggering events, so as to dig out the rules between the characteristics of each stage of the order and the probability of triggering events.
  • the label of the sample order can indicate whether the meal loss compensation is triggered at each stage of the sample order.
  • the first sample order may be an order that triggers meal loss compensation
  • the second sample order is an order that does not trigger meal loss compensation.
  • the electronic device extracts the characteristics of each stage of the sample order.
  • the data of each stage of the sample order can be stored in the database in advance, and the electronic device can access the database to obtain the data of each stage of the sample order stored in the database, and perform feature extraction on the data of each stage to obtain each of the sample orders.
  • the characteristics of the stage can be stored in the database in advance, and the electronic device can access the database to obtain the data of each stage of the sample order stored in the database, and perform feature extraction on the data of each stage to obtain each of the sample orders.
  • the characteristics of each stage of the sample order include the first vector.
  • the first vector is used to represent the name of the item corresponding to the sample order, and the first vector may also be referred to as the feature vector of the item name or the vector representation of the item name.
  • the item corresponding to the sample order refers to the item purchased through the sample order.
  • the item corresponding to the sample order may be a meal, and the first vector may be a feature vector of the name of the meal.
  • the name of the item corresponding to the sample order can be obtained. Map the name of the item to the vector space to get the first vector.
  • the product name can be input into the word vector generation model, and the name of the article can be processed through the word vector generation model to output the first vector.
  • the word vector generation model may be a neural network model, for example, it may be a word to vector (word to vector, word2vec) model.
  • word2vec word to vector
  • other methods other than word2vec may be used to obtain the first vector, such as encoding the name of the article. This embodiment does not limit the method of extracting the first vector.
  • the article name is introduced into the prediction algorithm, so as to fully consider the influence of the article name on the occurrence of the event.
  • deep learning technology is used to represent item names in vectors, and the vectors representing item names are used for model training, so that the model can learn the rules between item names and whether events occur, and improve the accuracy of prediction.
  • the vector representation of the name of the meal can be used to let the model learn the rules between the name of the meal and whether or not the compensation for meal loss occurs, so that the model can predict more accurately. Predict the probability of occurrence of meal loss compensation.
  • the features of each stage of the sample order include a second vector, and the second vector is used to represent the fusion feature between the item name and other features other than the item name.
  • the other feature may be a feature that has a cross relationship with the name of the item, and the other feature may have a certain relationship with the name of the item.
  • the other feature may be the sales or frequency of the item, and the first vector can be compared with other features. The features are fused to obtain the second vector.
  • Method 1 The first vector can be integrated with the sales volume of the item to obtain the second vector.
  • the first vector and the sales volume of the item may be spliced to obtain the second vector, and the second vector may include the sales volume of the first vector and the item.
  • Method 2 The first vector can be integrated with the selling frequency of the item to obtain the second vector.
  • the first vector can be multiplied by the selling frequency of the item to obtain the second vector
  • the second vector can be the product of the first vector and the selling frequency of the item.
  • the third way is to merge the first vector with the sales volume of the item and the sales frequency of the item to obtain the second vector.
  • the first vector can be multiplied with the sales frequency of the item, and the product can be spliced with the sales of the item to obtain the second vector.
  • the second vector can include the product and the sales. It refers to the product of the first vector and the selling frequency of the item.
  • the second vector may be a high-dimensional vector, and the second vector may be reduced in dimension to obtain the reduced second vector, and the reduced second vector is used for model training, that is, the sample
  • the features of each stage of the order include a second vector that can be reduced in dimensionality.
  • dimensionality reduction By performing dimensionality reduction, the amount of data of the second vector can be reduced, thereby reducing the amount of calculation during training.
  • embedding word embedding
  • the characteristics of each stage of the sample order may also include a third vector, and the third vector is used to represent the merchant information corresponding to the sample order.
  • the characteristics of each stage of the sample order may also include a fourth vector.
  • the fourth vector is used to indicate the area where the merchant corresponding to the sample order is located, or the fourth vector is used to indicate the user corresponding to the sample order. The area in which it is located.
  • the characteristics of each stage of the sample order may also include a fifth vector, and the fifth vector is used to represent other real-time characteristics corresponding to the sample order.
  • the feature extraction process at each stage of the sample order may include: performing word2vec on the meal name to obtain the feature vector of the meal name. Embedding the feature vector of the meal name and the order information of the merchant to obtain the fusion feature. The combination of merchant's order information, regional characteristics and other real-time characteristics is a characteristic set. The feature vector, fusion feature and feature set of the meal name are spliced together as the feature of the sample order in one stage.
  • the electronic device uses the features and tags of each stage of the sample order to perform model training to obtain a prediction model.
  • Predictive models are used to predict the probability of occurrence of events.
  • the input parameters of the predictive model may include the characteristics of one or more stages of the order, and the output parameters of the predictive model may include the probability of occurrence of an order trigger event.
  • the input parameter of the predictive model may be a matrix, each row of the matrix represents a phase of the order, and the order of the rows in the matrix may represent the time sequence of different phases, thereby reflecting the sequence of order characteristics.
  • the input parameters of the prediction model can be a matrix of N rows. The first row represents the characteristics of the order in the first stage, and the second row represents the order in the second stage. Characteristics, and so on, the Nth row represents the characteristics of the order in the Nth stage, where N is a positive integer.
  • the achieved effect can at least include: considering that different orders may not have time series value information, and the same order has sufficient time series related information, that is, the characteristics of orders at different stages can affect each other, for example, If an order is cancelled or picked up at a certain stage, it will affect the characteristics of the order in the next stage.
  • the characteristics of each stage of the sample order for model training it is possible to dig out the law between the timing correlation information contained in the sample order and the trigger event, so that the timing correlation information contained in the order can be used to predict the trigger event in the model prediction stage. The probability.
  • Predictive models can include multiple types.
  • the predictive model may be a recursive model.
  • the predictive model can be a recurrent neural network.
  • the cyclic neural network can perform recursive operations on the time series in the order of time. Therefore, by using the cyclic neural network to predict the sequence characteristics of the order, the unique advantages of the cyclic neural network can be used to calculate the characteristics of each stage. Looking back on the characteristics of the previous stages, the recursive calculation of the characteristics of the same order at different stages in accordance with the time sequence makes the forecasting process more complete and reasonable, thereby greatly improving the accuracy of the forecast results.
  • the prediction model may include a Long Short-Term Memory (LSTM, Long Short-Term Memory) model.
  • the LSTM model can include an input layer, a hidden layer, and an output layer.
  • the input layer is used to obtain the characteristics of each stage of the order and enter the hidden layer.
  • the hidden layer may include at least one node, and each node may perform a weighted operation on the received feature and the hidden layer state of the previous node to generate a hidden layer state corresponding to the node.
  • the output layer may perform a weighted operation on the hidden layer state and combine Output.
  • model training may include a process of multiple iterations.
  • the process of each iteration may include: inputting the characteristics of each stage of the sample order into the prediction model, processing the characteristics of each stage of the sample order through the prediction model, outputting the prediction result, and passing the loss function according to the prediction result and label (loss function) Calculate the loss value.
  • the loss value represents the deviation between the prediction result and the label. The greater the deviation between the prediction result and the label, the greater the loss value.
  • the parameters of the prediction model can be adjusted according to the loss value.
  • the electronic device can detect whether the training termination condition is currently met. When the training termination condition is not met, the electronic device executes the next iteration process; when the training termination condition is met, the electronic device performs the current iteration process
  • the output of the used prediction model is the trained prediction model.
  • the training termination condition can be that the number of iterations reaches the target number or the loss function meets a preset condition, or it can be that its ability is not improved in a period of time when it is verified based on a verification data set.
  • the target number of times may be a preset number of iterations to determine the timing of the end of training and avoid wasting training resources.
  • the preset condition can be that the loss value remains unchanged or does not decrease for a period of time during the training process. At this time, the training process has reached the training effect, that is, the prediction model has the characteristics of each stage of the order to predict the occurrence of the event The function of probability.
  • the distribution of samples on a single time segment will gradually be balanced.
  • a certain weighting process can be performed on the loss function.
  • the output vector of the output layer can be extracted, the output vector and [1,1...1,1] can be cross-entropy calculated according to the dimensions, and the obtained cross-entropy can be taken as
  • the loss value calculated by the loss function is used to adjust the parameters of the model through cross entropy.
  • the sample order is regarded as a time series sample, and the characteristics of the cyclic neural network are used to define the loss function based on the effectiveness of the final recognition stage, thereby improving the relationship between the model effect and the application strategy.
  • the model training is performed by using the characteristics of the sample order at each stage together, so as to obtain a prediction model in time series, thereby ensuring that the prediction model obtained by training is more perfect and reasonable.
  • the above embodiment in FIG. 2 describes the training process of the prediction model.
  • the following describes the inference prediction process of the prediction model through the embodiment in FIG. 4. It should be understood that some steps in the inference prediction process of the prediction model may be the same as some steps in the training process of the prediction model, and the specific details can be referred to the embodiment in FIG. 2, and details are not described in the embodiment in FIG. 4.
  • Fig. 4 is a flowchart of an order processing method provided by an embodiment of the present application. Referring to Figure 4, the method includes:
  • the electronic device obtains an order to be delivered.
  • the electronic device can access the order distribution system to obtain the pending orders stored in the order distribution system.
  • the orders that enter the order distribution system in the current time period can be obtained, for example, the orders that enter the order distribution system in the first minute are collected.
  • the order distribution system is used to cache orders to be delivered.
  • the order in the order distribution system can be identified, and if the order satisfies the order-grabbing mode, the order is added to the order-grabbing system.
  • the electronic device extracts the characteristics of the order at the current stage.
  • the current stage may be the stage corresponding to the current time point in the processing flow of the order, and may be the latest processing stage of the order.
  • the characteristics of the order at the current stage may include the first vector.
  • the process of extracting the first vector may include: obtaining the name of the item corresponding to the order, mapping the name of the item to the vector space, and obtaining the first vector.
  • the word2vec method can be used to convert the name of a meal into a first vector, and the first vector is represented as a description of the name of the meal.
  • the name of the item can be used to predict the probability of an event, for example, the name of a meal can be used to predict the probability of a meal loss payment, thereby improving the accuracy of the prediction result.
  • make full use of the natural language information of meal names to achieve a more complete recognition of meal loss compensation.
  • the characteristics of the order at the current stage may include a second vector, and the second vector may represent the merged characteristics of the order by the merchant.
  • the process of extracting the second vector may include: fusing the first vector with other characteristics of the order at the current stage to obtain the second vector.
  • the other features at this current stage may be features that have a cross relationship with the item name, so as to achieve cross-dimensional feature fusion.
  • the other characteristic may be the sales volume of the item at the current stage or the sales frequency at the current stage.
  • the first vector can be fused with the transaction parameters of the item to obtain the second vector.
  • the transaction parameters may include one or more of the sales volume or the frequency of the sales, and the following methods are used as examples to illustrate.
  • Method 1 The first vector can be integrated with the sales volume of the item to obtain the second vector.
  • the first vector and the sales volume of the item at the current stage may be spliced to obtain the second vector, and the second vector may include the sales volume of the first vector and the item.
  • the sales volume of the item may be the sales volume at the time when the order is placed. For example, if an order is created at time X and Y, the vector representation of the meal name of the order can be combined with the sales at time X and Y. Among them, X and Y are positive integers.
  • the sales volume of the item may also be the sales volume when the forecast is made.
  • the way to obtain sales can include: reading the orders of the merchants selling the item in each historical time period, counting the number of orders in each historical time period, and obtaining the sales of items in each historical time period, and establishing sales and Correspondence between historical time periods, and store the correspondence between sales and historical time periods in the database.
  • the corresponding relationship between the order time and sales volume of the merchant corresponding to the order can be queried according to the order time point of the order, and the sales volume of the item corresponding to the order time point can be obtained. For example, you can determine which historical time period the order is placed in, and search for the sales volume of the item corresponding to the historical time period.
  • Method 2 The first vector can be integrated with the selling frequency of the item to obtain the second vector.
  • the first vector can be multiplied by the selling frequency of the item at the current stage to obtain the second vector.
  • the second vector can be the product of the first vector and the selling frequency of the item.
  • the selling frequency of the item may be the selling frequency at the time when the order is placed. For example, if an order is created at time X and Y, the vector representation of the meal name of the order can be combined with the selling frequency at time X and Y.
  • the selling frequency of the item may also be the selling frequency at the time of prediction.
  • the selling frequency can be obtained in the following way: read the orders of the merchants selling the item in each historical time period, and obtain the item’s price in each historical time period according to the number of orders in each historical time period and the duration of the historical time period.
  • the corresponding relationship between the selling frequency and the historical time period can be established, and the corresponding relationship between the selling frequency and the historical time period can be stored in the database.
  • the corresponding relationship between the order time and the selling frequency of the merchant corresponding to the order can be inquired according to the order time point of the order, and the selling frequency of the item corresponding to the order time point can be obtained. For example, it is possible to determine which historical time period the order time point falls into, and to find the selling frequency of the item corresponding to the historical time period.
  • the monthly takeaway orders of each merchant can be obtained, and the sales frequency of each item of each merchant can be calculated in advance.
  • the sales frequency of each item of each merchant can be calculated in advance.
  • the third way is to merge the first vector with the sales volume of the item and the sales frequency of the item to obtain the second vector.
  • the first vector can be multiplied by the sales frequency of the item in the current stage, and the product can be spliced with the sales of the item in the current stage to obtain the second vector.
  • the second vector can include The product and the sales volume.
  • the product refers to the product of the first vector and the selling frequency of the item at the current stage.
  • the sales volume of the item can similarly be the sales volume at the time when the order is placed, and the sales frequency of the item can similarly be the sales frequency at the time when the order is placed.
  • the effects achieved can at least include: because different merchants sell different meals at different frequencies, you can choose to match the name of the meal with the number of the meal delivered by the merchant. Multiply operation.
  • the core factor that the meal can instinctively be applied for but not applied for is that the merchant is too busy or the meal can be more reused, and by merging the meal vector and the amount of food sold by the merchant is different from that of the merchant.
  • the frequency of meal sales can be based on the timing problem background of the meal loss recognition problem, and the feature can be extracted through the highly coupled relationship between the meal, the merchant and the stage, so as to make full use of the coupling relationship between the merchant feature and the meal feature in the input stage, and avoid large-scale statistics The problem of obtaining cross-features.
  • the second vector may be a high-dimensional vector, and the second vector may be reduced in dimensionality to obtain the reduced second vector.
  • the reduced second vector is used for prediction, that is, the order of The features of the current stage include the second vector that can be reduced in dimensionality.
  • embedding word embedding
  • embedding can be used to reduce the dimension of the second vector.
  • the characteristics of each stage of the order may also include a third vector, and the third vector is used to represent the merchant information corresponding to the order.
  • the characteristics of each stage of the order may also include a fourth vector.
  • the fourth vector is used to indicate the area where the merchant corresponding to the order is located, or the fourth vector is used to indicate where the user corresponding to the order is located. area.
  • the characteristics of each stage of the order may also include a fifth vector, and the fifth vector is used to represent other real-time characteristics corresponding to the order.
  • the feature extraction process at each stage of the order may include: performing word2vec on the meal name to obtain the feature vector of the meal name. Embedding the feature vector of the meal name and the order information of the merchant at the current time point to obtain the fusion feature. Combine the merchant's order information at the current time point, regional features at the current time point, and other real-time features into a feature set. The feature vector, fusion feature, and feature set of the meal name are spliced together as the feature of the order at the current stage.
  • the characteristics of the order in the current stage can be persistently stored, so that if the characteristics of a new stage are generated later, the pre-stored characteristics of the previous stage can be read. For example, you can create a characteristic record for an order, and the characteristic record is used to store the characteristics of each stage of the order. After extracting the characteristics of the order in the current stage, the characteristics of the order in the current stage and the stage identifier can be written into the characteristic record.
  • the electronic device inputs the characteristics of the current stage and the characteristics of the order in the historical stage into the prediction model.
  • the historical stage is the stage corresponding to the historical time point in the processing flow of the order.
  • the process of obtaining the characteristics of the order in the historical stage may include: querying the characteristic records according to the identifier of the order to obtain the characteristics of the order in the historical stage.
  • the electronic device processes the characteristics of the current stage and the characteristics of the historical stage based on the time sequence through the predictive model, and obtains the probability of the occurrence of the order trigger event.
  • the characteristics of the current stage and the intermediate results corresponding to the historical stage can be weighted.
  • the sequence of the time can be the sequence of the stages.
  • the intermediate result may be a hidden layer state obtained by processing the features of the historical stage through the hidden layer of the prediction model after inputting the features of the historical stage into the prediction model.
  • the current stage is the third stage
  • the state is weighted to calculate the hidden state of the second stage, and then the features of the third stage and the hidden state of the second stage are weighted to calculate the hidden state of the third stage, and so on.
  • the hidden layer of the LSTM model can calculate the features of each stage in order of time, and adopt a recursive calculation method to calculate the hidden layer of the previous hidden layer. After the hidden layer state and the features of this stage are weighted and summed, the calculation continues until the features of each stage from the historical stage to the current stage are calculated in the LSTM model.
  • the LSTM model can perform recursive operations on the time series in the order of time, by using the LSTM model to predict the timing characteristics of the order, it can take advantage of the unique advantages of the LSTM model.
  • the recursive calculation of the characteristics of the same order in different stages according to the time sequence makes the forecasting process more perfect and reasonable, thereby greatly improving the accuracy of the forecast results.
  • the output vector corresponding to the output layer of the prediction model can be weighted and calculated according to the weight corresponding to each stage to obtain the probability of occurrence of the event, wherein each dimension of the output vector corresponds to the order processing flow A stage of
  • the output vector corresponding to the output layer can be (k1k2...kn)
  • k1 represents the probability of the occurrence of the first stage event
  • k2 represents the probability of the second stage event
  • kn represents the nth stage
  • the probability of occurrence of an event that is, the probability of occurrence of an event at the current stage.
  • k1 to kn can be an increasing sequence.
  • k1 represents the probability of a meal loss payment in the first stage
  • k2 represents the probability of a meal loss payment in the second stage
  • kn represents the probability of a meal loss payment in the nth stage.
  • the electronic device adjusts the delivery parameters of the order based on the probability of occurrence of the event.
  • the delivery parameters of the order may include the delivery cost of the order, the delivery method of the order, and so on.
  • the probability of the occurrence of the event can be compared with the threshold. If the probability of the occurrence of the event is greater than or equal to the threshold, the delivery parameters of the order are increased, thereby increasing the probability of the order being successfully delivered through more delivery parameters. Avoid incidents. If the probability of occurrence of the event is less than the threshold, the delivery parameters of the order can be kept unchanged.
  • Step 405 may include the following steps 1 to 2:
  • Step 1 Obtain the added value of the distribution cost according to the probability that the order triggers the meal compensation event.
  • the value-added is positively correlated with the probability of a compensation event.
  • a mapping relationship between the probability of a compensation event and the added value can be established. After the probability is predicted, the mapping relationship can be queried to obtain the added value corresponding to the probability.
  • Step 2 Adjust the delivery cost of the order according to the added value.
  • the order and the adjusted delivery cost can be released to the order pool, and the delivery personnel can check the order pool.
  • the order triggers the order-taking operation to undertake the delivery work of the order.
  • the platform can transfer the adjusted delivery cost to the delivery personnel's account. In this way, if the meal will trigger a meal loss compensation event, the more likely it is to increase the price of the meal order in the order pool, thereby encouraging the delivery staff to take the order.
  • the probability of the order being received has also been increased, thus improving the efficiency and quality of order fulfillment.
  • the meal compensation event is only an example of an event, and the event may also be other events in a time sequence scheduling scenario, such as a compensation event in a logistics transportation scenario.
  • the same method as the above steps 1 to 2 can also be used to adjust the delivery cost of the order.
  • the order can continuously produce new stage features.
  • each order can be combined. The characteristics of the stage predict the probability of an event occurring in the current stage, so that in various timing scheduling scenarios, it can provide the most suitable scheduling strategy at the moment based on the predicted results of the future.
  • This embodiment provides a method for predicting orders using deep learning. Considering that the characteristics of the same order in different stages have the nature of time-series correlation, the characteristics of the order in the historical stage and the characteristics of the current stage are regarded as a time series, which together serve as the input of the model, so that through the model, according to the order in each stage The feature predicts the probability of an order trigger event, and then uses the probability of an order trigger event to schedule the delivery parameters of the order. Since the forecast not only considers the characteristics of the order in the current stage, but also considers the characteristics of the order in the historical stage and the timing of different stages, the accuracy of the forecast result can be improved.
  • the order processing process may include multiple stages, and each stage is used to perform different processing operations on the order.
  • the order in the takeaway platform can include the user's order stage, the merchant's order stage, the rider grabbing stage, the rider delivery stage, the delivery stage, and so on.
  • the order in the logistics system can include the delivery stage, the transportation stage, the delivery stage, and the receipt. Stage and so on.
  • the time sequence correlation of the orders in different phases can be used to improve the accuracy of the prediction.
  • the takeaway delivery field Take the takeaway delivery field as an example.
  • a merchant produces a meal after receiving an order, and due to surrounding capacity factors, no one receives the waybill for a long time, causing the merchant’s meal to be wasted.
  • the takeaway platform The merchant’s expenses must be paid based on the production price of the meal.
  • the following method embodiments can be used to identify whether the order will become a meal loss in a certain period of time. If it becomes a meal loss, the price of the waybill in the order pool will be increased. If it is not a meal loss, then No operation is performed.
  • offline features such as real-time features at the time of the order and regional features corresponding to the order, merchant features, etc.
  • the time stage is used as an input feature
  • the XGBoost model is used for training.
  • the corresponding threshold is given. If it is greater than the threshold, the order price will be added; if it is less than or equal to the threshold, the order price will not be added.
  • Second, when using the XGBoost model it is difficult to use meal field features that have a great impact on meal loss.
  • the order may be cancelled at any stage, or received, or enter the next stage, so this method has great application defects.
  • a time-series recognition model can be constructed to provide a more complete and reasonable prediction model. Moreover, through deep learning technology, full use of the natural language information of the meal name can finally achieve a more complete compensation for meal loss Recognition.
  • Fig. 5 is a schematic structural diagram of an order processing device provided by an embodiment of the present application. Referring to Figure 5, the device includes:
  • the obtaining module 501 is configured to obtain orders to be delivered
  • the extraction module 502 is configured to extract the characteristics of the order at the current stage, and the current stage is the stage corresponding to the current time point in the processing flow of the order;
  • the input module 503 which is configured to input the characteristics of the current stage and the characteristics of the order in the historical stage into the prediction model, the prediction model is used to predict the probability of occurrence of the event, and the historical stage is the stage corresponding to the historical time point in the order processing flow;
  • the processing module 504 is configured to process the characteristics of the current stage and the characteristics of the historical stage based on the time sequence through the prediction model, and obtain the probability of the occurrence of an order trigger event;
  • the adjustment module 505 is configured to adjust the delivery parameters of the order based on the probability of occurrence of the event.
  • This embodiment provides a device for predicting orders using deep learning. Considering that the characteristics of the same order in different stages have the nature of time-series correlation, the characteristics of the order in the historical stage and the characteristics of the current stage are regarded as a time series, which together serve as the input of the model, so that through the model, according to the order in each stage The feature predicts the probability of an order trigger event, and then uses the probability of an order trigger event to schedule the distribution resources of the order. Since the forecast not only considers the characteristics of the order in the current stage, but also considers the characteristics of the order in the historical stage and the timing of different stages, the accuracy of the forecast result can be improved.
  • the processing module 504 is configured to perform a weighted calculation on the characteristics of the current stage and the intermediate results corresponding to the historical stage in a time sequence.
  • the characteristics of the previous stages are also reviewed, and the characteristics of the same order in different stages are calculated in accordance with the time sequence, which makes the prediction process more complete and reasonable, thereby greatly improving the accuracy of the prediction results.
  • the processing module 504 is configured to perform weighted calculation on the output vector corresponding to the output layer of the prediction model according to the weight corresponding to each stage to obtain the probability of occurrence of the event, wherein each dimension of the output vector corresponds to A stage in the processing flow of an order.
  • the features of the current stage include the first vector.
  • the extraction module 502 is configured to obtain the name of the item corresponding to the order; map the name of the item to the vector space to obtain the first vector.
  • the deep learning technology is used to represent the name of the article in a vector, so that the natural language information of the name of the article is fully used, the article name is introduced into the prediction algorithm, the accuracy of the prediction is improved, and a more complete recognition is realized.
  • the features of the current stage include the second vector
  • the extraction module 502 is configured to obtain the name of the item corresponding to the order; map the name of the item to the vector space to obtain the first vector; compare the first vector with the item
  • the transaction parameters of is merged to obtain the second vector, where the transaction parameters include one or more of sales volume or frequency of sales.
  • the selling frequency is obtained in the following manner: according to the order time point of the order, the correspondence relationship between the order time and the selling frequency of the merchant corresponding to the order is inquired, and the selling frequency corresponding to the order time point is obtained.
  • the event includes a meal compensation event
  • the distribution resource includes the distribution cost of the order.
  • the adjustment module 505 is configured to trigger the probability of occurrence of the meal compensation event according to the order, obtain the added value of the distribution cost, and increase The value is positively correlated with the probability of a compensation event; according to the added value, the order’s delivery cost is adjusted.
  • the prediction model is trained in the following ways: Obtain sample orders, the sample orders are marked with labels, and the labels are used to indicate whether each phase of the sample order triggers an event; extract the characteristics of each phase of the sample order; use the sample order Model training is performed on the features and labels of each stage to obtain a prediction model.
  • the characteristics of the order in different stages can affect each other, for example, if the order is cancelled or received at a certain stage, it will all be affected.
  • the characteristics of the order in the next phase By using the characteristics of each stage of the sample order for model training, it is possible to dig out the rules between the timing correlation information contained in the sample order and the triggering event, and use the characteristics of the sample order at each stage to perform model training together, so as to obtain
  • the prediction model on the time series ensures that the prediction model obtained by training is more perfect and reasonable, so that in the model prediction stage, the time sequence related information contained in the order can be used to accurately predict the probability of the trigger event.
  • order processing device processes an order
  • only the division of the above functional modules is used as an example.
  • the above functions can be allocated by different functional modules according to needs, i.e.
  • the internal structure of the order processing device is divided into different functional modules to complete all or part of the functions described above.
  • order processing device provided in the above embodiment and the order processing method embodiment belong to the same concept. For the specific implementation process, please refer to the method embodiment, which will not be repeated here.
  • FIG. 6 shows a structural block diagram of a terminal 600 provided by an exemplary embodiment of the present application.
  • the terminal 600 can be: a smartphone, a tablet computer, an MP3 (Moving Picture Experts Group Audio Layer III, a moving picture expert compression standard audio layer 3) player, an MP4 (Moving Picture Experts Group Audio Layer IV, a moving picture expert compressing standard audio Level 4) Players, laptops, wearable devices or desktop computers.
  • the terminal 600 may also be called user equipment, portable terminal, laptop terminal, desktop terminal and other names.
  • the terminal 600 includes: one or more processors 601 and one or more memories 602.
  • the processor 601 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and so on.
  • the processor 601 can adopt at least one hardware form among DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array, Programmable Logic Array). achieve.
  • the processor 601 may also include a main processor and a coprocessor.
  • the main processor is a processor used to process data in the awake state, also called a CPU (Central Processing Unit, central processing unit); the coprocessor is A low-power processor used to process data in the standby state.
  • the processor 601 may be integrated with a GPU (Graphics Processing Unit, image processor), and the GPU is used for rendering and drawing content that needs to be displayed on the display screen.
  • the processor 601 may further include an AI (Artificial Intelligence) processor, and the AI processor is used to process computing operations related to machine learning.
  • AI Artificial Intelligence
  • the memory 602 may include one or more computer-readable storage media, which may be non-transitory.
  • the memory 602 may also include a high-speed random access memory and a non-volatile memory, such as one or more magnetic disk storage devices and flash memory storage devices.
  • the non-transitory computer-readable storage medium in the memory 602 is used to store at least one instruction, and the at least one instruction is used to be executed by the processor 601 to implement the order processing provided in the method embodiment of the present application. method.
  • the terminal 600 may optionally further include: a peripheral device interface 603 and at least one peripheral device.
  • the processor 601, the memory 602, and the peripheral device interface 603 can be connected by a bus or a signal line.
  • Each peripheral device can be connected to the peripheral device interface 603 through a bus, a signal line, or a circuit board.
  • the peripheral device includes: at least one of a radio frequency circuit 604, a touch display screen 605, a camera component 606, an audio circuit 607, a positioning component 608, and a power supply 609.
  • the peripheral device interface 603 can be used to connect at least one peripheral device related to I/O (Input/Output) to the processor 601 and the memory 602.
  • the processor 601, the memory 602, and the peripheral device interface 603 are integrated on the same chip or circuit board; in some other embodiments, any one of the processor 601, the memory 602, and the peripheral device interface 603 or The two can be implemented on a separate chip or circuit board, which is not limited in this embodiment.
  • the radio frequency circuit 604 is used for receiving and transmitting RF (Radio Frequency, radio frequency) signals, also called electromagnetic signals.
  • the radio frequency circuit 604 communicates with a communication network and other communication devices through electromagnetic signals.
  • the radio frequency circuit 604 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals.
  • the radio frequency circuit 604 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and so on.
  • the radio frequency circuit 604 can communicate with other terminals through at least one wireless communication protocol.
  • the wireless communication protocol includes but is not limited to: World Wide Web, Metropolitan Area Network, Intranet, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area network and/or WiFi (Wireless Fidelity, wireless fidelity) network.
  • the radio frequency circuit 604 may also include a circuit related to NFC (Near Field Communication), which is not limited in this application.
  • the display screen 605 is used to display a UI (User Interface, user interface).
  • the UI can include graphics, text, icons, videos, and any combination thereof.
  • the display screen 605 also has the ability to collect touch signals on or above the surface of the display screen 605.
  • the touch signal can be input to the processor 601 as a control signal for processing.
  • the display screen 605 may also be used to provide virtual buttons and/or virtual keyboards, also called soft buttons and/or soft keyboards.
  • the display screen 605 there may be one display screen 605, which is provided with the front panel of the terminal 600; in other embodiments, there may be at least two display screens 605, which are respectively provided on different surfaces of the terminal 600 or in a folded design; In still other embodiments, the display screen 605 may be a flexible display screen, which is disposed on the curved surface or the folding surface of the terminal 600. Furthermore, the display screen 605 can also be set as a non-rectangular irregular figure, that is, a special-shaped screen.
  • the display screen 605 may be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).
  • the camera assembly 606 is used to capture images or videos.
  • the camera assembly 606 includes a front camera and a rear camera.
  • the front camera is set on the front panel of the terminal, and the rear camera is set on the back of the terminal.
  • the camera assembly 606 may also include a flash.
  • the flash can be a single-color flash or a dual-color flash. Dual color temperature flash refers to a combination of warm light flash and cold light flash, which can be used for light compensation under different color temperatures.
  • the audio circuit 607 may include a microphone and a speaker.
  • the microphone is used to collect sound waves of the user and the environment, and convert the sound waves into electrical signals and input them to the processor 601 for processing, or input to the radio frequency circuit 604 to implement voice communication. For the purpose of stereo collection or noise reduction, there may be multiple microphones, which are respectively set in different parts of the terminal 600.
  • the microphone can also be an array microphone or an omnidirectional collection microphone.
  • the speaker is used to convert the electrical signal from the processor 601 or the radio frequency circuit 604 into sound waves.
  • the speaker can be a traditional thin-film speaker or a piezoelectric ceramic speaker.
  • the speaker When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into human audible sound waves, but also convert the electrical signal into human inaudible sound waves for distance measurement and other purposes.
  • the audio circuit 607 may also include a headphone jack.
  • the positioning component 608 is used to locate the current geographic location of the terminal 600 to implement navigation or LBS (Location Based Service, location-based service).
  • the positioning component 608 may be a positioning component based on the GPS (Global Positioning System, Global Positioning System) of the United States, the Beidou system of China, or the Galileo system of Russia.
  • the power supply 609 is used to supply power to various components in the terminal 600.
  • the power source 609 may be alternating current, direct current, disposable batteries, or rechargeable batteries.
  • the rechargeable battery may be a wired rechargeable battery or a wireless rechargeable battery.
  • a wired rechargeable battery is a battery charged through a wired line
  • a wireless rechargeable battery is a battery charged through a wireless coil.
  • the rechargeable battery can also be used to support fast charging technology.
  • the terminal 600 further includes one or more sensors 610.
  • the one or more sensors 610 include, but are not limited to: an acceleration sensor 611, a gyroscope sensor 612, a pressure sensor 613, a fingerprint sensor 614, an optical sensor 615, and a proximity sensor 616.
  • the acceleration sensor 611 can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established by the terminal 600.
  • the acceleration sensor 611 can be used to detect the components of the gravitational acceleration on three coordinate axes.
  • the processor 601 may control the touch screen 605 to display the user interface in a horizontal view or a vertical view according to the gravity acceleration signal collected by the acceleration sensor 611.
  • the acceleration sensor 611 may also be used for the collection of game or user motion data.
  • the gyroscope sensor 612 can detect the body direction and rotation angle of the terminal 600, and the gyroscope sensor 612 can cooperate with the acceleration sensor 611 to collect the user's 3D actions on the terminal 600.
  • the processor 601 can implement the following functions according to the data collected by the gyroscope sensor 612: motion sensing (for example, changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.
  • the pressure sensor 613 may be disposed on the side frame of the terminal 600 and/or the lower layer of the touch screen 605.
  • the processor 601 performs left and right hand recognition or quick operation according to the holding signal collected by the pressure sensor 613.
  • the processor 601 controls the operability controls on the UI interface according to the user's pressure operation on the touch display screen 605.
  • the operability control includes at least one of a button control, a scroll bar control, an icon control, and a menu control.
  • the fingerprint sensor 614 is used to collect the user's fingerprint.
  • the processor 601 can identify the user's identity based on the fingerprint collected by the fingerprint sensor 614, or the fingerprint sensor 614 can identify the user's identity based on the collected fingerprints. When it is recognized that the user's identity is a trusted identity, the processor 601 authorizes the user to perform related sensitive operations, including unlocking the screen, viewing encrypted information, downloading software, paying, and changing settings.
  • the fingerprint sensor 614 may be provided on the front, back or side of the terminal 600. When a physical button or a manufacturer logo is provided on the terminal 600, the fingerprint sensor 614 can be integrated with the physical button or the manufacturer logo.
  • the optical sensor 615 is used to collect the ambient light intensity.
  • the processor 601 may control the display brightness of the touch screen 605 according to the ambient light intensity collected by the optical sensor 615. Specifically, when the ambient light intensity is high, the display brightness of the touch display screen 605 is increased; when the ambient light intensity is low, the display brightness of the touch display screen 605 is decreased.
  • the processor 601 may also dynamically adjust the shooting parameters of the camera assembly 606 according to the ambient light intensity collected by the optical sensor 615.
  • the proximity sensor 616 also called a distance sensor, is usually arranged on the front panel of the terminal 600.
  • the proximity sensor 616 is used to collect the distance between the user and the front of the terminal 600.
  • the processor 601 controls the touch screen 605 to switch from the on-screen state to the off-screen state; when the proximity sensor 616 detects When the distance between the user and the front of the terminal 600 gradually increases, the processor 601 controls the touch display screen 605 to switch from the rest screen state to the bright screen state.
  • FIG. 6 does not constitute a limitation on the terminal 600, and may include more or fewer components than shown in the figure, or combine certain components, or adopt different component arrangements.
  • FIG. 7 is a schematic structural diagram of a server provided by an embodiment of the present application.
  • the server 700 may have relatively large differences due to different configurations or performance, and may include one or more processors (Central Processing Units, CPU) 701 And one or more memories 702, where at least one instruction is stored in the memory 702, and the at least one instruction is loaded and executed by the processor 701 to implement the order processing method provided by each of the foregoing method embodiments.
  • the server may also have components such as a wired or wireless network interface and an input/output interface for input and output, and the server may also include other components for implementing device functions, which will not be repeated here.
  • a computer-readable storage medium such as a memory including at least one instruction, which is executable by a processor to complete the order processing method in the foregoing embodiment.
  • the computer-readable storage medium may be a read-only memory (Read-Only Memory, abbreviated as: ROM), a random access memory (Random Access Memory, abbreviated as: RAM), a CD-ROM (Compact Disc Read-Only Memory, abbreviated as: CD-ROM), magnetic tapes, floppy disks and optical data storage devices, etc.
  • a computer program product is also provided.
  • the computer program product includes computer instructions. When the computer instructions are executed by a computer, the computer executes the order processing method in the foregoing embodiment.
  • the size of the sequence number of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not correspond to the embodiments of the present application.
  • the implementation process constitutes any limitation.
  • determining B according to A does not mean that B is determined only according to A, and B can also be determined according to A and/or other information.

Landscapes

  • Business, Economics & Management (AREA)
  • Engineering & Computer Science (AREA)
  • Strategic Management (AREA)
  • Economics (AREA)
  • Human Resources & Organizations (AREA)
  • Marketing (AREA)
  • Development Economics (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Theoretical Computer Science (AREA)
  • Game Theory and Decision Science (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Operations Research (AREA)
  • Quality & Reliability (AREA)
  • Tourism & Hospitality (AREA)
  • Educational Administration (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

一种订单处理方法以及订单处理装置,利用深度学习对订单进行预测,考虑到同一个订单在不同阶段的特征具有时序关联的性质,将订单在历史阶段的特征以及当前阶段的特征视为一个时间序列,共同作为模型的输入,从而通过模型根据订单在各个阶段的特征预测出订单触发事件发生的概率,进而应用订单触发事件的概率,来调整订单的配送参数。

Description

订单处理
本申请要求于2020年01月03日提交的申请号为202010003857.4、发明名称为“订单处理方法、装置、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及计算机技术领域,特别涉及订单处理。
背景技术
在电子商务领域,当用户下了一笔订单后,订单可能会触发各种各样的事件发生。比如说,外卖配送的场景中,外卖订单可能会触发餐损赔付事件产生。具体而言,当用户在平台上点了某个餐品,会产生一笔外卖订单,商户接单生产餐品后,如果长时间没有配送人员接这笔订单,会导致餐品被浪费。这种情况下,商户可以向平台申请餐损赔付,则平台会赔付商户一定的费用,从而弥补商户由于餐品浪费造成的损失。为了提前应对订单触发餐损赔付的事件,可以对订单进行处理,预测出订单是否将要触发事件,以便根据预测结果执行对应的操作。
发明内容
本申请实施例提供了一种订单处理方法、装置、设备、存储介质及计算机程序产品,能够提高预测结果的准确性。所述技术方案如下:
一方面,提供了一种订单处理方法,所述方法包括:获取待配送的订单;提取所述订单在当前阶段的特征,所述当前阶段为订单的处理流程中当前时间点对应的阶段;将所述当前阶段的特征以及所述订单在历史阶段的特征输入预测模型,所述预测模型用于预测事件发生的概率,所述历史阶段为订单的处理流程中历史时间点对应的阶段;通过所述预测模型,基于时序对所述当前阶段的特征以及所述历史阶段的特征进行处理,得到所述订单触发所述事件发生的概率;基于所述事件发生的概率,对所述订单的配送参数进行调整。
可选地,所述通过所述预测模型,基于时序对所述当前阶段的特征以及所述历史阶段的特征进行处理,包括:按照时间的先后顺序,对所述当前阶段的特征与所述历史阶段对应的中间结果进行加权计算。
可选地,所述通过所述预测模型,基于时序对所述当前阶段的特征以及所述历史阶段的特征进行处理,包括:根据每个阶段对应的权重,对所述预测模型的输出层对应的输出向量进行加权计算,得到所述事件发生的概率,其中,所述输出向量的每个维度对应订单的处理流程中的一个阶段。
可选地,所述当前阶段的特征包括第一向量,相应地,所述提取所述订单在当前阶段的特征,包括:获取所述订单对应的物品的名称;将所述物品的名称映射至向量空间,得到第一向量。
可选地,所述当前阶段的特征包括第二向量,相应地,所述提取所述订单在当前阶段的特征,包括:获取所述订单对应的物品的名称;将所述物品的名称映射至向量空间,得到所 述第一向量;对所述第一向量与所述物品的交易参数进行融合,得到所述第二向量,其中,所述交易参数包括销量或出售频率中的一项或多项。
可选地,所述出售频率采用以下方式得到:根据所述订单的下单时间点,查询所述订单对应的商户的下单时间与出售频率之间的对应关系,得到所述下单时间点对应的所述出售频率。
可选地,所述事件包括餐品赔付事件,所述配送参数包括订单的配送费用,相应地,所述基于所述事件发生的概率,对所述订单的配送参数进行调整,包括:根据所述订单触发所述餐品赔付事件发生的概率,获取配送费用的增加值,其中,所述增加值与所述餐品赔付事件发生的概率正相关;根据所述增加值,对所述订单的配送费用进行调整。
可选地,所述预测模型采用以下方式进行训练:获取样本订单,所述样本订单标注有标签,所述标签用于指示所述样本订单的每个阶段是否触发所述事件发生;提取所述样本订单的每个阶段的特征;使用所述样本订单的每个阶段的特征以及所述标签进行模型训练,得到所述预测模型。
另一方面,提供了一种订单处理装置,所述装置包括:
获取模块,其配置为用于获取待配送的订单;
提取模块,其配置为用于提取所述订单在当前阶段的特征,所述当前阶段为订单的处理流程中当前时间点对应的阶段;
输入模块,其配置为用于将所述当前阶段的特征以及所述订单在历史阶段的特征输入预测模型,所述预测模型用于预测事件发生的概率,所述历史阶段为订单的处理流程中历史时间点对应的阶段;
处理模块,其配置为用于通过所述预测模型,基于时序对所述当前阶段的特征以及所述历史阶段的特征进行处理,得到所述订单触发所述事件发生的概率;
调度模块,其配置为用于基于所述事件发生的概率,对所述订单的配送参数进行调整。
可选地,所述处理模块,其配置为用于按照时间的先后顺序,对所述当前阶段的特征与所述历史阶段对应的中间结果进行加权计算。
可选地,所述处理模块,其配置为用于根据每个阶段对应的权重,对所述预测模型的输出层对应的输出向量进行加权计算,得到所述事件发生的概率,其中,所述输出向量的每个维度对应订单的处理流程中的一个阶段。
可选地,所述当前阶段的特征包括第一向量,相应地,所述提取模块,其配置为用于获取所述订单对应的物品的名称;将所述物品的名称映射至向量空间,得到所述第一向量。
可选地,所述当前阶段的特征包括第二向量,所述提取模块,其配置为用于获取所述订单对应的物品的名称;将所述物品的名称映射至向量空间,得到第一向量;对所述第一向量与所述物品的交易参数进行融合,得到所述第二向量,其中,所述交易参数包括销量或出售频率中的一项或多项。
可选地,所述出售频率采用以下方式得到:根据所述订单的下单时间点,查询所述订单对应的商户的下单时间与出售频率之间的对应关系,得到所述下单时间点对应的所述出售频率。
可选地,所述事件包括餐品赔付事件,所述配送资源包括订单的配送费用,相应地,所述调整模块,其配置为用于根据所述订单触发所述餐品赔付事件发生的概率,获取配送费用的增加值,其中,所述增加值与所述餐品赔付事件发生的概率正相关;根据所述增加值,对 所述订单的配送费用进行调整。
可选地,所述预测模型采用以下方式进行训练:获取样本订单,所述样本订单标注有标签,所述标签用于指示所述样本订单的每个阶段是否触发所述事件发生;提取所述样本订单的每个阶段的特征;使用所述样本订单的每个阶段的特征以及所述标签进行模型训练,得到所述预测模型。
另一方面,提供了一种电子设备,所述电子设备包括一个或多个处理器和一个或多个存储器,所述一个或多个存储器中存储有至少一条指令,所述至少一条指令由所述一个或多个处理器加载并执行以实现上述订单处理方法所执行的操作。
另一方面,提供了一种计算机可读存储介质,所述存储介质中存储有至少一条指令,所述至少一条指令由处理器加载并执行以实现上述订单处理方法所执行的操作。
另一方面,提供了一种计算机程序产品,所述计算机程序产品包括计算机指令,所述计算机指令被计算机执行时,使得所述计算机执行上述订单处理方法。
本申请实施例提供的技术方案带来的有益效果至少包括:
本实施例提供了一种利用深度学习对订单进行预测的方法。考虑到同一个订单在不同阶段的特征具有时序关联的性质,将订单在历史阶段的特征以及当前阶段的特征视为一个时间序列,共同作为模型的输入,从而通过模型,根据订单在各个阶段的特征预测出订单触发事件发生的概率,进而应用订单触发事件的概率,来对订单的配送参数进行调整。由于预测时不仅考虑了订单在当前阶段的特征,还考虑了订单在历史阶段的特征以及不同阶段的时序,因此可以提高预测结果的准确性。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本申请实施例提供的一种订单处理方法的实施环境的示意图;
图2是本申请实施例提供的一种模型训练方法的流程图;
图3是本申请实施例提供的一种预测模型的架构图;
图4是本申请实施例提供的一种订单处理方法的流程图;
图5是本申请实施例提供的一种订单处理装置的结构示意图;
图6是本申请实施例提供的一种终端的结构示意图;
图7是本申请实施例提供的一种服务器的结构示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
本申请中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本申请中的字符“/”,一般表示前后关联对象是一种“或”的关系。
本申请中术语“多个”的含义是指两个或两个以上,例如,多个数据包是指两个或两个以上的数据包。
本申请中术语“第一”“第二”等字样用于对作用和功能基本相同的相同项或相似项进行区分,应理解,“第一”、“第二”、“第n”之间不具有逻辑或时序上的依赖关系,也不对数量和执行顺序进行限定。
在一些场景中,会获取订单在当前时间点的特征,根据订单在当前时间点的特征,使用极端梯度提升(eXtreme Gradient Boosting,XGBoost)算法,预测订单触发事件发生的概率。然而,订单的特征可以随着时间的推移发生变化,比如说,订单在任一阶段均有可能被取消,或被接起,或进入下一阶段。如果采用这种方式时,会由于仅考虑了订单在当前时间点的特征,导致预测结果的准确性较差。
而下面的一些实施例中,由于预测时不仅考虑了订单在当前阶段的特征,还考虑了订单在历史阶段的特征以及不同阶段的时序,因此可以提高预测结果的准确性。
以下,示例性介绍本申请的系统架构。
图1是本申请实施例提供的一种订单处理方法的实施环境的示意图。该实施环境包括:终端101和调度平台102。终端101通过无线网络或有线网络与调度平台102相连。
终端101可以是智能手机、游戏主机、台式计算机、平板电脑、电子书阅读器、MP3(Moving Picture Experts Group Audio Layer III,动态影像专家压缩标准音频层面3)播放器或MP4(Moving Picture Experts Group Audio Layer IV,动态影像专家压缩标准音频层面4)播放器和膝上型便携计算机中的至少一种。终端101安装和运行有支持下单功能的应用程序,例如,该应用程序可以是购物应用、外卖应用、快递应用等。示例性的,终端101是用户使用的终端,终端101中运行的应用程序内登录有用户账号。
调度平台102包括一台服务器、多台服务器、云计算平台和虚拟化中心中的至少一种。调度平台102用于为应用程序提供后台服务。
可选地,调度平台102包括:服务器1021和数据库1022。服务器1021用于处理订单。服务器1021可以是一台或多台。当服务器1021是多台时,存在至少两台服务器1021用于提供不同的服务,和/或,存在至少两台服务器1021用于提供相同的服务,比如以负载均衡方式提供同一种服务,本申请实施例对此不加以限定。数据库1022存储有大量的订单以及每个订单关联的物品数据或商户数据,当服务器1021需要订单以及数据时,可以访问数据库1022,读取数据库1022存储的数据。当服务器处理完成,得到处理结果时,可以将处理结果写入至数据库1022,从而通过数据库1022对处理结果进行持久化存储。例如,在下述方法实施例中,服务器1021可以访问数据库1022,读取数据库1022存储的样本订单的每个阶段的特征,使用样本订单进行模型训练,得到预测模型,将预测模型写入至数据库1022,从而通过数据库1022对预测模型进行持久化存储。当一笔新的订单创建后,服务器1021可以访问数据库1022,读取数据库1022存储的预测模型,通过预测模型来预测订单触发事件发生的概率。
本领域技术人员可以知晓,上述终端101、服务器1021的数量可以更多或更少。比如上述终端101、服务器1021可以仅为一个,或者上述终端101、服务器1021为几十个或几百个,或者更多数量,此时上述实施环境还包括其他终端或其他服务器。本申请实施例对终端或服务器的数量和设备类型不加以限定。
以下,对本申请实施例提供的预测模型的训练流程进行介绍。
图2是本申请实施例提供的一种预测模型的训练方法的流程图。参见图2,该方法包括:
201、电子设备获取样本订单。
样本订单可以是已经历了作业周期中各个阶段的订单。样本订单可以标注有标签,标签用于指示样本订单的每个阶段是否触发事件发生。在一些可能的实施例中,样本订单可以包括第一样本订单以及第二样本订单,第一样本订单是触发了事件发生的订单,第二样本订单是未触发事件发生的订单。第一样本订单的标签和第二样本订单的标签不同。通过获取第一样本订单以及第二样本订单以进行训练,模型可以通过第一样本订单,学习出什么特征的样本订单触发事件发生的概率高,通过第二样本订单,学习出什么特征的样本触发事件发生的概率低,从而挖掘出订单每个阶段的特征与触发事件的概率之间的规律。比如说,应用在餐损赔付的场景中,样本订单的标签可以指示样本订单的每个阶段是否触发餐损赔付发生。第一样本订单可以是触发了餐损赔付的订单,第二样本订单是未触发餐损赔付的订单。
202、电子设备提取样本订单的每个阶段的特征。
样本订单的每个阶段的数据可以预先存储在数据库,电子设备可以访问数据库,得到数据库存储的样本订单的每个阶段的数据,对每个阶段的数据分别进行特征提取,得到样本订单的每个阶段的特征。
在一些实施例中,样本订单的每个阶段的特征均包括第一向量。第一向量用于表示样本订单对应的物品的名称,第一向量也可以称为物品名称的特征向量或者物品名称的向量表示。其中,样本订单对应的物品是指通过样本订单购买的物品,比如,应用在外卖配送场景中,样本订单对应的物品可以是餐品,第一向量可以是餐品名称的特征向量。
提取第一向量的方式可以包括多种。例如,可以获取样本订单对应的物品的名称。将物品的名称映射至向量空间,得到第一向量。在一种可能的实现中,可以将产品名称输入词向量生成模型,通过词向量生成模型对物品的名称进行处理,输出第一向量。其中,该词向量生成模型可以是神经网络模型,例如可以是单词至向量(word to vector,word2vec)模型。在另一些实施例中,也可以采用word2vec之外的其他方式得到第一向量,比如对物品的名称进行编码,本实施例对提取第一向量的方式不做限定。
通过上述方式,将物品名称引入到预测的算法中,从而充分考虑了物品名称对事件发生的影响。并且,利用深度学习技术,将物品名称进行向量表示,使用表征物品名称的向量来进行模型训练,使得模型可以学习出物品名称与事件是否发生之间的规律,提高预测的准确性。例如,应用在餐损赔付场景中,可以通过使用餐品名称的向量表示,让模型学习出餐品名称与是否发生餐损赔付之间的规律,从而可以在模型预测的过程中,更准确地预测出餐损赔付发生的概率。
在一些实施例中,样本订单的每个阶段的特征均包括第二向量,第二向量用于表示物品名称与物品名称之外的其他特征之间的融合特征。其中,该其他特征可以为与物品名称具有交叉关系的特征,该其他特征可以和物品名称具有一定的关联关系,比如,该其他特征可以是物品的销量或出售频率,可以对第一向量与其他特征进行融合,得到第二向量。
提取第二向量的方式可以包括多种,以下通过方式一至方式三举例说明。
方式一、可以对第一向量与物品的销量进行融合,得到第二向量。
融合的方式可以包括多种,例如,可以对第一向量与物品的销量进行拼接,得到第二向量,则第二向量可以包括第一向量与物品的销量。
方式二、可以对第一向量与物品的出售频率进行融合,得到第二向量。
融合的方式可以包括多种,例如,可以对第一向量与物品的出售频率进行相乘,得到第 二向量,则第二向量可以为第一向量与物品的出售频率之间的乘积。
方式三、可以对第一向量与物品的销量以及物品的出售频率进行融合,得到第二向量。
融合的方式可以包括多种,例如,可以对第一向量与物品的出售频率进行相乘,将乘积与物品的销量进行拼接,得到第二向量,则第二向量可以包括乘积和销量,该乘积是指第一向量与物品的出售频率之间的积。
在一些实施例中,第二向量可以是高维向量,可以对第二向量进行降维,得到降维后的第二向量,使用降维后的第二向量进行模型训练,也即是,样本订单的每个阶段的特征包括可以降维后的第二向量。通过进行降维,可以减少第二向量的数据量,从而减少训练时的计算量。其中,可以利用embedding(词嵌入)对第二向量进行降维。
在一些实施例中,样本订单的每个阶段的特征还可以均包括第三向量,第三向量用于表示样本订单对应的商户信息。
在一些实施例中,样本订单的每个阶段的特征还可以均包括第四向量,第四向量用于表示样本订单对应的商户所处的区域,或者第四向量用于表示样本订单对应的用户所处的区域。
在一些实施例中,样本订单的每个阶段的特征还可以均包括第五向量,第五向量用于表示样本订单对应的其他实时特征。
以应用预测模型来预测餐品赔付的场景为例,示例性地,参见图3,样本订单的每个阶段的特征提取过程可以包括:对餐品名称进行word2vec,得到餐名的特征向量。对餐名的特征向量与商户的订单信息进行embedding,得到融合特征。对商户的订单信息、区域特征以及其他实时特征组合为特征集合。将餐名的特征向量、融合特征以及特征集合进行拼接,作为样本订单在一个阶段的特征。
203、电子设备使用样本订单的每个阶段的特征以及标签进行模型训练,得到预测模型。
预测模型用于预测事件发生的概率。预测模型的输入参数可以包括订单的一个或多个阶段的特征,预测模型的输出参数可以包括订单触发事件发生的概率。
在一些可能的实施例中,预测模型的输入参数可以是一个矩阵,矩阵的每一行代表订单的一个阶段,矩阵中行的顺序可以代表不同阶段的时间先后顺序,从而体现订单特征的时序性。例如,参见图3,如果订单包括N个阶段,则预测模型的输入参数可以是N行的矩阵,第一行代表订单在第一个阶段的特征,第二行代表订单在第二个阶段的特征,以此类推,第N行代表订单在第N个阶段的特征,其中N为正整数。
通过上述方式,达到的效果至少可以包括:考虑到不同订单可能不存在时序价值信息,而同一个订单存在充分的时序关联信息,即,订单在不同阶段之间的特征可以互相影响,比如说,如果订单在某一阶段被取消或被接起,都将会影响订单在下一个阶段的特征。而通过使用样本订单的每个阶段的特征进行模型训练,可以挖掘出样本订单包含的时序关联信息与触发事件之间的规律,以便在模型预测阶段,利用订单包含的时序关联信息来预测触发事件的概率。
预测模型可以包括多种类型。例如,预测模型可以是递归模型。比如说,预测模型可以是循环神经网络。循环神经网络能够按照时间的先后顺序,对时间序列进行递归运算,因此通过采用循环神经网络对订单的时序特征进行预测,能够利用循环神经网络特有的优势,在计算每个阶段的特征时,还回顾以往阶段的特征,对同一个订单在不同阶段的特征按照时序进行递归运算,使得预测过程更加完善和合理,从而极大地提高预测结果的准确性。
其中,参见图3,预测模型可以包括长短期记忆(LSTM,Long Short-Term Memory)模 型。LSTM模型可以包括输入层、隐藏层以及输出层。该输入层用于获取订单的每个阶段的特征,输入隐藏层。该隐藏层可以包括至少一个节点,每个节点可以将接收的特征与上一个节点的隐层状态进行加权运算,生成该节点对应的隐层状态,该输出层可以对隐层状态进行加权运算并输出。
训练LSTM模型的方式可以包括多种。在一些实施例中,模型训练可以包括多次迭代的过程。每次迭代的过程可以包括:将样本订单的每个阶段的特征输入预测模型,通过预测模型对样本订单的每个阶段的特征进行处理,输出预测结果,根据该预测结果与标签,通过损失函数(loss function)计算损失值,损失值表示预测结果与标签之间的偏差,预测结果与标签之间的偏差越大,则损失值越大。可以根据损失值调整预测模型的参数。其中,每当迭代一次后,电子设备可以检测当前是否已经满足训练终止条件,当不满足训练终止条件时,电子设备执行下一次迭代过程;当满足训练终止条件时,电子设备将本次迭代过程所采用的预测模型输出为训练完成的预测模型。
其中,该训练终止条件可以为迭代次数达到目标次数或者损失函数满足预设条件,还可以为基于验证数据集验证时,其能力在一段时间内没有提升。其中,该目标次数可以是预先设置的迭代次数,用以确定训练结束的时机,避免对训练资源的浪费。该预设条件可以是训练过程中损失值在一段时间内不变或者不下降,此时说明训练过程已经达到了训练的效果,即预测模型具有了根据订单的每个阶段的特征来预测事件发生概率的功能。
在一些实施例中,随着时间序列的深入,单个时间片段上的样本分布会逐渐均衡。有鉴于此,可以对损失函数进行一定的加权处理,例如,可以提取输出层的输出向量,对输出向量与[1,1…1,1]依维度进行交叉熵运算,将得到的交叉熵作为损失函数计算出的损失值,通过交叉熵来调整模型的参数。后续在使用预测模型进行预测时,可以输入订单当前已经历的每个阶段上的特征,从而获取当前时间下的预测模型所预测的概率。通过该方式,将样本订单视为一个时序样本,利用循环神经网络的特点,基于最终识别阶段有效性定义损失函数,从而提升模型效果对应用策略的作用关系。
本实施例提供的方法,通过使用样本订单在每个阶段的特征一起进行模型训练,从而得出时序上的预测模型,从而保证训练得到的预测模型更完善和合理。
上述图2实施例描述了预测模型的训练过程,以下通过图4实施例介绍该预测模型的推理预测过程。应理解,预测模型的推理预测过程中的一些步骤可以和预测模型的训练过程中的一些步骤同理,其具体细节可以参见图2实施例,在图4实施例不做赘述。
图4是本申请实施例提供的一种订单处理方法的流程图。参见图4,该方法包括:
401、电子设备获取待配送的订单。
例如,电子设备可以访问订单分配系统,得到订单分配系统存储的待配送的订单。例如,可以获取当前时间段进入订单分配系统的订单,比如汇集第一分钟进入订单分配系统的订单。其中,该订单分配系统用于缓存待配送的订单。其中,可以对该订单分配系统中的订单进行识别,若订单满足抢单模式,则将订单添加至抢单系统。
402、电子设备提取订单在当前阶段的特征。
当前阶段可以为订单的处理流程中当前时间点对应的阶段,可以是订单的最新处理阶段。
在一些实施例中,订单在当前阶段的特征可以包括第一向量。其中,提取第一向量的过程可以包括:获取订单对应的物品的名称,将物品的名称映射至向量空间,得到第一向量。 例如,可以使用word2vec方法,将餐品名称转换为第一向量,则第一向量表现为餐品名称的描述。通过引入第一向量,可以利用物品名称来预测事件发生的概率,比如利用餐品名称来预测餐损赔付的概率,从而提高预测结果的准确性。并且,通过深度学习技术,充分使用餐名称的自然语言信息,以实现最终对餐损赔付更完善的识别。
在一些实施例中,订单在当前阶段的特征可以包括第二向量,第二向量可以表征商户对于该订单的融合特征。其中,提取第二向量的过程可以包括:对第一向量与订单在当前阶段的其他特征进行融合,得到第二向量。该当前阶段的其他特征可以是与物品名称具有交叉关系的特征,从而实现交叉维度的特征融合。比如,该其他特征可以是物品在当前阶段的销量或当前阶段的出售频率。
提取第二向量的方式可以包括多种,例如,可以对第一向量与物品的交易参数进行融合,得到第二向量。其中,交易参数可以包括销量或出售频率中的一项或多项,以下分别通过方式一至方式三举例说明。
方式一、可以对第一向量与物品的销量进行融合,得到第二向量。
融合的方式可以包括多种,例如,可以对第一向量与物品在当前阶段的销量进行拼接,得到第二向量,则第二向量可以包括第一向量与物品的销量。其中,该物品的销量可以是订单的下单时间点的销量。比如说,如果在X时Y刻创建了一笔订单,可以将该订单的餐品名称的向量表示与X时Y刻的销量进行融合。其中,X和Y为正整数。可选地,物品的销量也可以是进行预测时的销量。
获取销量的实现方式可以包括:读取出售该物品的商户在每个历史时间段的订单,统计每个历史时间段的订单的数量,得到每个历史时间段的物品的销量,可以建立销量与历史时间段之间的对应关系,将销量与历史时间段之间的对应关系存储至数据库。在预测过程中,可以根据订单的下单时间点,查询订单对应的商户的下单时间与销量之间的对应关系,得到下单时间点对应的物品的销量。例如,可以判断下单时间点落入哪个历史时间段,查找该历史时间段对应的物品的销量。
例如,在餐损赔付场景中,可以获取每个商户的每月的外卖订单,预先统计得出每个商户的每个物品的销量,当得到任一商户的任一物品的订单时,可以使用该商户对该物品的销量,来预测物品是否会发生损失赔付。
方式二、可以对第一向量与物品的出售频率进行融合,得到第二向量。
融合的方式可以包括多种,例如,可以对第一向量与物品在当前阶段的出售频率进行相乘,得到第二向量,则第二向量可以为第一向量与物品的出售频率之间的乘积。其中,该物品的出售频率可以是订单的下单时间点的出售频率。比如说,如果在X时Y刻创建了一笔订单,可以将该订单的餐品名称的向量表示与X时Y刻的出售频率进行融合。可选地,物品的出售频率也可以是进行预测时的出售频率。
出售频率可以采用以下方式得到:读取出售该物品的商户在每个历史时间段的订单,根据每个历史时间段的订单的数量以及历史时间段的时长,得到每个历史时间段的物品的出售频率,可以建立出售频率与历史时间段之间的对应关系,将出售频率与历史时间段之间的对应关系存储至数据库。在预测过程中,可以根据订单的下单时间点,查询订单对应的商户的下单时间与出售频率之间的对应关系,得到下单时间点对应的物品的出售频率。例如,可以判断下单时间点落入哪个历史时间段,查找该历史时间段对应的物品的出售频率。
例如,在餐损赔付场景中,可以获取每个商户的每月的外卖订单,预先统计得出每个商 户的每个物品的出售频率,当得到任一商户的任一物品的订单时,可以使用该商户对该物品的出售频率,来预测物品是否会发生损失赔付。
方式三、可以对第一向量与物品的销量以及物品的出售频率进行融合,得到第二向量。
融合的方式可以包括多种,例如,可以对第一向量与物品在当前阶段的出售频率进行相乘,将乘积与物品在当前阶段的销量进行拼接,得到第二向量,则第二向量可以包括乘积和销量,该乘积是指第一向量与物品在当前阶段的出售频率之间的积。方式三中,该物品的销量同理地可以是订单的下单时间点的销量,该物品的出售频率同理地可以是订单的下单时间点的出售频率。
以餐损赔付场景为例,通过上述方式一至方式三,达到的效果至少可以包括:由于不同商家的不同餐品的出售频率不同,可以选择将餐品名称特征与商家交付该餐品的数量进行相乘操作。基于离线调研,餐品本能被申请赔付而未被申请赔付的核心因素为商家太忙或该餐品可被更高复用,而通过融合餐品向量与商家出售餐品量与商家不同时序的餐品出售频率,可以基于餐损识别问题的时序问题背景,通过餐品与商家和阶段高度耦合关系提取特征,从而充分利用了输入阶段的商家特征与餐品特征的耦合关系,回避大规模统计获取交叉特征的问题。
在一些实施例中,第二向量可以是高维向量,可以对第二向量进行降维,得到降维后的第二向量,使用降维后的第二向量进行预测,也即是,订单的当前阶段的特征包括可以降维后的第二向量。通过进行降维,可以减少第二向量的数据量,从而减少训练时的计算量。其中,可以利用embedding(词嵌入)对第二向量进行降维。
在一些实施例中,订单的每个阶段的特征还可以均包括第三向量,第三向量用于表示订单对应的商户信息。
在一些实施例中,订单的每个阶段的特征还可以均包括第四向量,第四向量用于表示订单对应的商户所处的区域,或者第四向量用于表示订单对应的用户所处的区域。
在一些实施例中,订单的每个阶段的特征还可以均包括第五向量,第五向量用于表示订单对应的其他实时特征。
以应用预测模型来预测餐品赔付的场景为例,示例性地,参见图3,订单的每个阶段的特征提取过程可以包括:对餐品名称进行word2vec,得到餐名的特征向量。对餐名的特征向量与商户在当前时间点的订单信息进行embedding,得到融合特征。对商户在当前时间点的订单信息、在当前时间点区域特征以及其他实时特征组合为特征集合。将餐名的特征向量、融合特征以及特征集合进行拼接,作为订单在当前阶段的特征。
在一些实施例中,提取订单在当前阶段的特征后,可以对订单在当前阶段的特征进行持久化存储,以便后续如果产生新阶段的特征时,可以读取预先存储的以往阶段的特征。例如,可以为订单创建特征记录,特征记录用于存储订单的每个阶段的特征。提取订单在当前阶段的特征后,可以将订单在当前阶段的特征以及阶段标识写入特征记录中。
403、电子设备将当前阶段的特征以及订单在历史阶段的特征输入预测模型。
历史阶段为订单的处理流程中历史时间点对应的阶段。获取订单在历史阶段的特征的过程可以包括:根据订单的标识,查询特征记录,得到订单在历史阶段的特征。
404、电子设备通过预测模型,基于时序对当前阶段的特征以及历史阶段的特征进行处理,得到订单触发事件发生的概率。
在通过预测模型进行处理的过程中,可以从第2个阶段开始,按照时间的先后顺序,对 当前阶段的特征与历史阶段对应的中间结果进行加权计算。其中,该时间的先后顺序可以是阶段的先后顺序。该中间结果可以是:将历史阶段的特征输入预测模型后,通过预测模型的隐藏层对该历史阶段的特征进行处理后得到的隐层状态。例如,如果当前阶段是第3个阶段,则首先通过隐藏层对第1个阶段的特征进行处理,得到第1个阶段的隐藏状态,再对第2个阶段的特征以及第1个阶段的隐藏状态进行加权计算,得到第2个阶段的隐藏状态,再对第3个阶段的特征以及第2个阶段的隐藏状态进行加权计算,得到第3个阶段的隐藏状态,依次类推。
例如,参见图3,在通过LSTM模型进行计算的过程中,LSTM模型的隐藏层可以按照时间的先后顺序,对各个阶段的特征依次进行计算,并采用递归计算的方式,将前一个隐藏层的隐层状态与本阶段的特征进行加权求和后继续进行计算,直至历史阶段至当前阶段中每个阶段的特征在LSTM模型中均计算完成。
由于LSTM模型能够按照时间的先后顺序,对时间序列进行递归运算,因此通过采用LSTM模型对订单的时序特征进行预测,能够利用LSTM模型特有的优势,在计算每个阶段的特征时,还回顾以往阶段的特征,对同一个订单在不同阶段的特征按照时序进行递归运算,使得预测过程更加完善和合理,从而极大地提高预测结果的准确性。
在一些实施例中,可以根据每个阶段对应的权重,对预测模型的输出层对应的输出向量进行加权计算,得到事件发生的概率,其中,该输出向量的每个维度对应订单的处理流程中的一个阶段。例如,参见图3,输出层对应的输出向量可以是(k1k2……kn),k1表示第1阶段事件发生的概率,k2表示第2阶段事件发生的概率,以此类推,kn表示第n阶段事件发生的概率,即当前阶段事件发生的概率。k1至kn可以是一个递增的序列。比如说,在餐损赔付场景中,k1表示第1阶段发生餐损赔付的概率,k2表示第2阶段发生餐损赔付的概率,以此类推,kn表示第n阶段发生餐损赔付的概率。通过上述方式,可以通过模型计算后,在最终层依据阶段进行加权,从而满足餐损识别应用有效性的策略需求。
405、电子设备基于事件发生的概率,对订单的配送参数进行调整。
订单的配送参数可以包括订单的配送费用、订单的配送方式等。在一些实施例中,可以对事件发生的概率与阈值进行比较,若事件发生的概率大于或等于阈值,则增加订单的配送参数,从而通过更多的配送参数增加订单被成功配送的可能性,避免事件的发生。若事件发生的概率小于阈值,可以保持订单的配送参数不变。
以餐品赔付场景为例,预测的事件可以是餐品赔付事件,配送参数可以是订单的配送费用,步骤405可以包括以下步骤一至步骤二:
步骤一、根据订单触发餐品赔付事件发生的概率,获取配送费用的增加值。
其中,增加值与赔付事件发生的概率正相关。例如,可以建立赔付事件的概率与增加值之间的映射关系,当预测出概率后,查询该映射关系,得到概率对应的增加值。
步骤二、根据增加值,对订单的配送费用进行调整。
例如,可以计算订单的配送费用与增加值之间的和值,将和值作为调整后的配送费用,可以将订单以及调整后的配送费用发布至抢单池,配送人员可以对抢单池中的订单触发接单操作,从而承接该订单的配送工作。当配送人员对订单配送后,平台可以将调整后的配送费用转移至配送人员的账户。通过这种方式,若餐品将要触发餐损赔付事件的可能性越高,则对餐品订单在抢单池中的价格加价的越多,从而鼓励配送人员对订单进行接单。如此,可以科学、充分地调度空闲运力,提高配送资源利用率,均衡配送压力,实现配送运力的均衡。 由于订单的配送费用得到了提高,订单被接单的概率也就得到了提高,因此,提高了订单履约的效率和质量。
应理解,餐品赔付事件仅是对事件的举例,事件也可以是时序调度场景下的其他事件,比如物流运输场景中的赔付事件等。在其他时序调度场景下,也可以采用上述步骤一至步骤二同理的方式,对订单的配送费用进行调整。如此,通过根据订单触发赔付事件的概率,对订单的配送费用进行调整,随着时间的推移,订单可以不断地产生新阶段的特征,此时通过实施本实施例的方法,可以结合订单每个阶段的特征,预测当前阶段发生事件的可能性大小,从而各种时序调度的场景下,能够依据对未来的预测结果,提供当下最合适的调度策略。
本实施例提供了一种利用深度学习对订单进行预测的方法。考虑到同一个订单在不同阶段的特征具有时序关联的性质,将订单在历史阶段的特征以及当前阶段的特征视为一个时间序列,共同作为模型的输入,从而通过模型,根据订单在各个阶段的特征预测出订单触发事件发生的概率,进而应用订单触发事件的概率,来调度订单的配送参数。由于预测时不仅考虑了订单在当前阶段的特征,还考虑了订单在历史阶段的特征以及不同阶段的时序,因此可以提高预测结果的准确性。
以下,示例性介绍本申请的应用场景。
本实施例提供的方法可以应用在各种基于订单来调度资源的场景下,包括而不限于外卖平台,物流系统等。其中,订单的处理流程可以包括多个阶段,每个阶段用于对订单执行不同的处理操作。例如,外卖平台中订单可以包括用户下单阶段、商户接单阶段、骑手抢单阶段、骑手配送阶段、送达阶段等等,物流系统中订单可以包括发货阶段、运输阶段、配送阶段、签收阶段等等。本实施例中,通过依据订单在各个阶段的特征来进行预测,可以利用订单在不同阶段上的时序关联性,从而提高预测准确性。
以外卖配送领域为例,时下,常常会出现这样的场景:商家接单后生产餐品,而由于周边运力因素,长时间无人接到运单导致商家的餐品被浪费,此时,外卖平台要依据餐品的生产价格赔付商家费用。为解决该问题,可以通过下述方法实施例,识别订单在某一时间段是否会成为餐损,若成为餐损,则对该运单在抢单池中的价格进行加价,若非餐损,则不执行操作。
相关技术中,可以收集订单所在时刻的实时特征与订单所对应的区域特征商家特征等离线特征,将时间阶段作为输入特征,应用XGBoost模型进行训练。基于模型的准召表现,给出对应的阈值,若大于阈值,则对订单的抢单价格进行加钱操作,若小于或等于阈值,则不对订单的抢单价格进行加钱操作。而这样的方法至少存在三个问题。第一,由于将每一时间阶段作为识别标签放入样本中,导致在训练过程中,同一个订单将反复出现多次。在全样本空间中,每次执行判定时将依赖其当前样本分布,因此将出现巨大的样本分布污染。第二,利用XGBoost模型时,难以使用对餐损影响很大的餐品字段特征。第三,订单在任一阶段均有可能被取消,或被接起,或进入下一阶段,因此该方法有极大的应用缺陷。
而通过上述方法实施例,可以构建时序上的识别模型,从而提供更完善和合理的预测模型,并且,通过深度学习技术,充分使用餐名称的自然语言信息,能够最终实现对餐损赔付更完善的识别。
图5是本申请实施例提供的一种订单处理装置的结构示意图。参见图5,该装置包括:
获取模块501,其配置为用于获取待配送的订单;
提取模块502,其配置为用于提取订单在当前阶段的特征,当前阶段为订单的处理流程中当前时间点对应的阶段;
输入模块503,其配置为用于将当前阶段的特征以及订单在历史阶段的特征输入预测模型,预测模型用于预测事件发生的概率,历史阶段为订单的处理流程中历史时间点对应的阶段;
处理模块504,其配置为用于通过预测模型,基于时序对当前阶段的特征以及历史阶段的特征进行处理,得到订单触发事件发生的概率;
调整模块505,其配置为用于基于事件发生的概率,对订单的配送参数进行调整。
本实施例提供了一种利用深度学习对订单进行预测的装置。考虑到同一个订单在不同阶段的特征具有时序关联的性质,将订单在历史阶段的特征以及当前阶段的特征视为一个时间序列,共同作为模型的输入,从而通过模型,根据订单在各个阶段的特征预测出订单触发事件发生的概率,进而应用订单触发事件的概率,来调度订单的配送资源。由于预测时不仅考虑了订单在当前阶段的特征,还考虑了订单在历史阶段的特征以及不同阶段的时序,因此可以提高预测结果的准确性。
可选地,处理模块504,其配置为用于按照时间的先后顺序,对当前阶段的特征与历史阶段对应的中间结果进行加权计算。
通过在计算每个阶段的特征时,还回顾以往阶段的特征,对同一个订单在不同阶段的特征按照时序进行运算,使得预测过程更加完善和合理,从而极大地提高预测结果的准确性。
可选地,处理模块504,其配置为用于根据每个阶段对应的权重,对预测模型的输出层对应的输出向量进行加权计算,得到事件发生的概率,其中,输出向量的每个维度对应订单的处理流程中的一个阶段。
可选地,当前阶段的特征包括第一向量,相应地,提取模块502,其配置为用于获取订单对应的物品的名称;将物品的名称映射至向量空间,得到第一向量。
通过上述方式,利用深度学习技术,将物品名称进行向量表示,从而充分使用物品名称的自然语言信息,将物品名称引入到预测的算法中,提高预测的准确性,实现更完善的识别。
可选地,当前阶段的特征包括第二向量,提取模块502,其配置为用于获取订单对应的物品的名称;将物品的名称映射至向量空间,得到第一向量;对第一向量与物品的交易参数进行融合,得到第二向量,其中,交易参数包括销量或出售频率中的一项或多项。
可选地,出售频率采用以下方式得到:根据订单的下单时间点,查询订单对应的商户的下单时间与出售频率之间的对应关系,得到下单时间点对应的出售频率。
考虑到同一物品在不同时间的出售频率可能具有差异,通过融合表达名称的向量与对应时间的出售频率,充分利用了时间与出售频率之间的耦合关系,从而提高预测的精确性,回避大规模统计获取交叉特征的问题。
可选地,事件包括餐品赔付事件,配送资源包括订单的配送费用,相应地,调整模块505,其配置为用于根据订单触发餐品赔付事件发生的概率,获取配送费用的增加值,增加值与赔付事件发生的概率正相关;根据增加值,对订单的配送费用进行调整。
通过这种方式,若餐品将要触发餐损赔付事件的可能性越高,则对餐品订单在配送费用的增加地越多,从而鼓励配送人员对订单进行接单。如此,可以科学、充分地调度空闲运力,提高配送资源利用率,均衡配送压力,实现配送运力的均衡。由于订单的配送费用得到了提 高,订单被接单的概率也就得到了提高,因此,提高了订单履约的效率和质量。
可选地,预测模型采用以下方式进行训练:获取样本订单,样本订单标注有标签,标签用于指示样本订单的每个阶段是否触发事件发生;提取样本订单的每个阶段的特征;使用样本订单的每个阶段的特征以及标签进行模型训练,得到预测模型。
通过上述方式,考虑到同一个订单存在充分的时序关联信息,即,订单在不同阶段之间的特征可以互相影响,比如说,如果订单在某一阶段被取消或被接起,都将会影响订单在下一个阶段的特征。而通过使用样本订单的每个阶段的特征进行模型训练,可以挖掘出样本订单包含的时序关联信息与触发事件之间的规律,使用样本订单在每个阶段的特征一起进行模型训练,从而得出时序上的预测模型,从而保证训练得到的预测模型更完善和合理,以便在模型预测阶段,利用订单包含的时序关联信息来准确地预测触发事件的概率。
上述所有可选技术方案,可以采用任意结合形成本申请的可选实施例,在此不再一一赘述。
需要说明的是:上述实施例提供的订单处理装置在处理订单时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将订单处理装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的订单处理装置与订单处理方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。
上述方法实施例中的电子设备可以实现为终端。例如,图6示出了本申请一个示例性实施例提供的终端600的结构框图。该终端600可以是:智能手机、平板电脑、MP3(Moving Picture Experts Group Audio Layer III,动态影像专家压缩标准音频层面3)播放器、MP4(Moving Picture Experts Group Audio Layer IV,动态影像专家压缩标准音频层面4)播放器、笔记本电脑、可穿戴设备或台式电脑。终端600还可能被称为用户设备、便携式终端、膝上型终端、台式终端等其他名称。
通常,终端600包括有:一个或多个处理器601和一个或多个存储器602。
处理器601可以包括一个或多个处理核心,比如4核心处理器、8核心处理器等。处理器601可以采用DSP(Digital Signal Processing,数字信号处理)、FPGA(Field-Programmable Gate Array,现场可编程门阵列)、PLA(Programmable Logic Array,可编程逻辑阵列)中的至少一种硬件形式来实现。处理器601也可以包括主处理器和协处理器,主处理器是用于对在唤醒状态下的数据进行处理的处理器,也称CPU(Central Processing Unit,中央处理器);协处理器是用于对在待机状态下的数据进行处理的低功耗处理器。在一些实施例中,处理器601可以在集成有GPU(Graphics Processing Unit,图像处理器),GPU用于负责显示屏所需要显示的内容的渲染和绘制。一些实施例中,处理器601还可以包括AI(Artificial Intelligence,人工智能)处理器,该AI处理器用于处理有关机器学习的计算操作。
存储器602可以包括一个或多个计算机可读存储介质,该计算机可读存储介质可以是非暂态的。存储器602还可包括高速随机存取存储器,以及非易失性存储器,比如一个或多个磁盘存储设备、闪存存储设备。在一些实施例中,存储器602中的非暂态的计算机可读存储介质用于存储至少一条指令,该至少一条指令用于被处理器601所执行以实现本申请中方法实施例提供的订单处理方法。
在一些实施例中,终端600还可选包括有:外围设备接口603和至少一个外围设备。处 理器601、存储器602和外围设备接口603之间可以通过总线或信号线相连。各个外围设备可以通过总线、信号线或电路板与外围设备接口603相连。具体地,外围设备包括:射频电路604、触摸显示屏605、摄像头组件606、音频电路607、定位组件608和电源609中的至少一种。
外围设备接口603可被用于将I/O(Input/Output,输入/输出)相关的至少一个外围设备连接到处理器601和存储器602。在一些实施例中,处理器601、存储器602和外围设备接口603被集成在同一芯片或电路板上;在一些其他实施例中,处理器601、存储器602和外围设备接口603中的任意一个或两个可以在单独的芯片或电路板上实现,本实施例对此不加以限定。
射频电路604用于接收和发射RF(Radio Frequency,射频)信号,也称电磁信号。射频电路604通过电磁信号与通信网络以及其他通信设备进行通信。射频电路604将电信号转换为电磁信号进行发送,或者,将接收到的电磁信号转换为电信号。可选地,射频电路604包括:天线系统、RF收发器、一个或多个放大器、调谐器、振荡器、数字信号处理器、编解码芯片组、用户身份模块卡等等。射频电路604可以通过至少一种无线通信协议来与其它终端进行通信。该无线通信协议包括但不限于:万维网、城域网、内联网、各代移动通信网络(2G、3G、4G及5G)、无线局域网和/或WiFi(Wireless Fidelity,无线保真)网络。在一些实施例中,射频电路604还可以包括NFC(Near Field Communication,近距离无线通信)有关的电路,本申请对此不加以限定。
显示屏605用于显示UI(User Interface,用户界面)。该UI可以包括图形、文本、图标、视频及其它们的任意组合。当显示屏605是触摸显示屏时,显示屏605还具有采集在显示屏605的表面或表面上方的触摸信号的能力。该触摸信号可以作为控制信号输入至处理器601进行处理。此时,显示屏605还可以用于提供虚拟按钮和/或虚拟键盘,也称软按钮和/或软键盘。在一些实施例中,显示屏605可以为一个,设置终端600的前面板;在另一些实施例中,显示屏605可以为至少两个,分别设置在终端600的不同表面或呈折叠设计;在再一些实施例中,显示屏605可以是柔性显示屏,设置在终端600的弯曲表面上或折叠面上。甚至,显示屏605还可以设置成非矩形的不规则图形,也即异形屏。显示屏605可以采用LCD(Liquid Crystal Display,液晶显示屏)、OLED(Organic Light-Emitting Diode,有机发光二极管)等材质制备。
摄像头组件606用于采集图像或视频。可选地,摄像头组件606包括前置摄像头和后置摄像头。通常,前置摄像头设置在终端的前面板,后置摄像头设置在终端的背面。在一些实施例中,后置摄像头为至少两个,分别为主摄像头、景深摄像头、广角摄像头、长焦摄像头中的任意一种,以实现主摄像头和景深摄像头融合实现背景虚化功能、主摄像头和广角摄像头融合实现全景拍摄以及VR(Virtual Reality,虚拟现实)拍摄功能或者其它融合拍摄功能。在一些实施例中,摄像头组件606还可以包括闪光灯。闪光灯可以是单色温闪光灯,也可以是双色温闪光灯。双色温闪光灯是指暖光闪光灯和冷光闪光灯的组合,可以用于不同色温下的光线补偿。
音频电路607可以包括麦克风和扬声器。麦克风用于采集用户及环境的声波,并将声波转换为电信号输入至处理器601进行处理,或者输入至射频电路604以实现语音通信。出于立体声采集或降噪的目的,麦克风可以为多个,分别设置在终端600的不同部位。麦克风还可以是阵列麦克风或全向采集型麦克风。扬声器则用于将来自处理器601或射频电路604的 电信号转换为声波。扬声器可以是传统的薄膜扬声器,也可以是压电陶瓷扬声器。当扬声器是压电陶瓷扬声器时,不仅可以将电信号转换为人类可听见的声波,也可以将电信号转换为人类听不见的声波以进行测距等用途。在一些实施例中,音频电路607还可以包括耳机插孔。
定位组件608用于定位终端600的当前地理位置,以实现导航或LBS(Location Based Service,基于位置的服务)。定位组件608可以是基于美国的GPS(Global Positioning System,全球定位系统)、中国的北斗系统或俄罗斯的伽利略系统的定位组件。
电源609用于为终端600中的各个组件进行供电。电源609可以是交流电、直流电、一次性电池或可充电电池。当电源609包括可充电电池时,该可充电电池可以是有线充电电池或无线充电电池。有线充电电池是通过有线线路充电的电池,无线充电电池是通过无线线圈充电的电池。该可充电电池还可以用于支持快充技术。
在一些实施例中,终端600还包括有一个或多个传感器610。该一个或多个传感器610包括但不限于:加速度传感器611、陀螺仪传感器612、压力传感器613、指纹传感器614、光学传感器615以及接近传感器616。
加速度传感器611可以检测以终端600建立的坐标系的三个坐标轴上的加速度大小。比如,加速度传感器611可以用于检测重力加速度在三个坐标轴上的分量。处理器601可以根据加速度传感器611采集的重力加速度信号,控制触摸显示屏605以横向视图或纵向视图进行用户界面的显示。加速度传感器611还可以用于游戏或者用户的运动数据的采集。
陀螺仪传感器612可以检测终端600的机体方向及转动角度,陀螺仪传感器612可以与加速度传感器611协同采集用户对终端600的3D动作。处理器601根据陀螺仪传感器612采集的数据,可以实现如下功能:动作感应(比如根据用户的倾斜操作来改变UI)、拍摄时的图像稳定、游戏控制以及惯性导航。
压力传感器613可以设置在终端600的侧边框和/或触摸显示屏605的下层。当压力传感器613设置在终端600的侧边框时,可以检测用户对终端600的握持信号,由处理器601根据压力传感器613采集的握持信号进行左右手识别或快捷操作。当压力传感器613设置在触摸显示屏605的下层时,由处理器601根据用户对触摸显示屏605的压力操作,实现对UI界面上的可操作性控件进行控制。可操作性控件包括按钮控件、滚动条控件、图标控件、菜单控件中的至少一种。
指纹传感器614用于采集用户的指纹,由处理器601根据指纹传感器614采集到的指纹识别用户的身份,或者,由指纹传感器614根据采集到的指纹识别用户的身份。在识别出用户的身份为可信身份时,由处理器601授权该用户执行相关的敏感操作,该敏感操作包括解锁屏幕、查看加密信息、下载软件、支付及更改设置等。指纹传感器614可以被设置终端600的正面、背面或侧面。当终端600上设置有物理按键或厂商Logo时,指纹传感器614可以与物理按键或厂商Logo集成在一起。
光学传感器615用于采集环境光强度。在一个实施例中,处理器601可以根据光学传感器615采集的环境光强度,控制触摸显示屏605的显示亮度。具体地,当环境光强度较高时,调高触摸显示屏605的显示亮度;当环境光强度较低时,调低触摸显示屏605的显示亮度。在另一个实施例中,处理器601还可以根据光学传感器615采集的环境光强度,动态调整摄像头组件606的拍摄参数。
接近传感器616,也称距离传感器,通常设置在终端600的前面板。接近传感器616用于采集用户与终端600的正面之间的距离。在一个实施例中,当接近传感器616检测到用户 与终端600的正面之间的距离逐渐变小时,由处理器601控制触摸显示屏605从亮屏状态切换为息屏状态;当接近传感器616检测到用户与终端600的正面之间的距离逐渐变大时,由处理器601控制触摸显示屏605从息屏状态切换为亮屏状态。
本领域技术人员可以理解,图6中示出的结构并不构成对终端600的限定,可以包括比图示更多或更少的组件,或者组合某些组件,或者采用不同的组件布置。
上述方法实施例中的电子设备可以实现为服务器。例如,图7是本申请实施例提供的一种服务器的结构示意图,该服务器700可因配置或性能不同而产生比较大的差异,可以包括一个或一个以上处理器(Central Processing Units,CPU)701和一个或一个以上的存储器702,其中,存储器702中存储有至少一条指令,至少一条指令由处理器701加载并执行以实现上述各个方法实施例提供的订单处理方法。当然,该服务器还可以具有有线或无线网络接口以及输入输出接口等部件,以便进行输入输出,该服务器还可以包括其他用于实现设备功能的部件,在此不做赘述。
在示例性实施例中,还提供了一种计算机可读存储介质,例如包括至少一条指令的存储器,上述至少一条指令由可由处理器执行以完成上述实施例中的订单处理方法。例如,计算机可读存储介质可以是只读存储器(Read-Only Memory,简称:ROM)、随机存取存储器(Random Access Memory,简称:RAM)、只读光盘(Compact Disc Read-Only Memory,简称:CD-ROM)、磁带、软盘和光数据存储设备等。
在示例性实施例中,还提供了一种计算机程序产品,所述计算机程序产品包括计算机指令,所述计算机指令被计算机执行时,使得所述计算机执行上述实施例中的订单处理方法。
应理解,在本申请的各种实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
应理解,根据A确定B并不意味着仅仅根据A确定B,还可以根据A和/或其它信息确定B。
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,该程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。
以上描述仅为本申请的可选实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。

Claims (12)

  1. 一种订单处理方法,所述方法包括:
    获取待配送的订单;
    提取所述订单在当前阶段的特征,所述当前阶段为订单的处理流程中当前时间点对应的阶段;
    将所述当前阶段的特征以及所述订单在历史阶段的特征输入预测模型,所述预测模型用于预测事件发生的概率,所述历史阶段为订单的处理流程中历史时间点对应的阶段;
    通过所述预测模型,基于时序对所述当前阶段的特征以及所述历史阶段的特征进行处理,得到所述订单触发所述事件发生的概率;
    基于所述事件发生的概率,对所述订单的配送参数进行调整。
  2. 根据权利要求1所述的方法,所述通过所述预测模型,基于时序对所述当前阶段的特征以及所述历史阶段的特征进行处理,包括:
    按照时间的先后顺序,对所述当前阶段的特征与所述历史阶段对应的中间结果进行加权计算。
  3. 根据权利要求1所述的方法,所述通过所述预测模型,基于时序对所述当前阶段的特征以及所述历史阶段的特征进行处理,包括:
    根据每个阶段对应的权重,对所述预测模型的输出层对应的输出向量进行加权计算,得到所述事件发生的概率,其中,所述输出向量的每个维度对应订单的处理流程中的一个阶段。
  4. 根据权利要求1所述的方法,所述当前阶段的特征包括第一向量,相应地,所述提取所述订单在当前阶段的特征,包括:
    获取所述订单对应的物品的名称;
    将所述物品的名称映射至向量空间,得到所述第一向量。
  5. 根据权利要求1所述的方法,所述当前阶段的特征包括第二向量,相应地,所述提取所述订单在当前阶段的特征,包括:
    获取所述订单对应的物品的名称;
    将所述物品的名称映射至向量空间,得到第一向量;
    对所述第一向量与所述物品的交易参数进行融合,得到所述第二向量,其中,所述交易参数包括销量或出售频率中的一项或多项。
  6. 根据权利要求5所述的方法,所述出售频率采用以下方式得到:
    根据所述订单的下单时间点,查询所述订单对应的商户的下单时间与出售频率之间的对应关系,得到所述下单时间点对应的所述出售频率。
  7. 根据权利要求1所述的方法,所述事件包括餐品赔付事件,所述配送参数包括订单的 配送费用,相应地,所述基于所述事件发生的概率,对所述订单的配送参数进行调整,包括:
    根据所述订单触发所述餐品赔付事件发生的概率,获取配送费用的增加值,其中,所述增加值与所述餐品赔付事件发生的概率正相关;
    根据所述增加值,对所述订单的配送费用进行调整。
  8. 根据权利要求1所述的方法,所述预测模型采用以下方式进行训练:
    获取样本订单,所述样本订单标注有标签,所述标签用于指示所述样本订单的每个阶段是否触发所述事件发生;
    提取所述样本订单的每个阶段的特征;
    使用所述样本订单的每个阶段的特征以及所述标签进行模型训练,得到所述预测模型。
  9. 一种订单处理装置,所述装置包括:
    获取模块,其配置为用于获取待配送的订单;
    提取模块,其配置为用于提取所述订单在当前阶段的特征,所述当前阶段为订单的处理流程中当前时间点对应的阶段;
    输入模块,其配置为用于将所述当前阶段的特征以及所述订单在历史阶段的特征输入预测模型,所述预测模型用于预测事件发生的概率,所述历史阶段为订单的处理流程中历史时间点对应的阶段;
    处理模块,其配置为用于通过所述预测模型,基于时序对所述当前阶段的特征以及所述历史阶段的特征进行处理,得到所述订单触发所述事件发生的概率;
    调度模块,其配置为用于基于所述事件发生的概率,对所述订单的配送参数进行调整。
  10. 一种电子设备,所述电子设备包括一个或多个处理器和一个或多个存储器,所述一个或多个存储器中存储有至少一条指令,所述至少一条指令由所述一个或多个处理器加载并执行以实现如权利要求1至权利要求8任一项所述的订单处理方法所执行的操作。
  11. 一种计算机可读存储介质,所述存储介质中存储有至少一条指令,所述至少一条指令由处理器加载并执行以实现如权利要求1至权利要求8任一项所述的订单处理方法所执行的操作。
  12. 一种计算机程序产品,所述计算机程序产品包括计算机指令,所述计算机指令被计算机执行时,使得所述计算机执行如权利要求1至权利要求8任一项所述的订单处理方法。
PCT/CN2020/106909 2020-01-03 2020-08-04 订单处理 WO2021135212A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010003857.4A CN113077299A (zh) 2020-01-03 2020-01-03 订单处理方法、装置、设备及存储介质
CN202010003857.4 2020-01-03

Publications (1)

Publication Number Publication Date
WO2021135212A1 true WO2021135212A1 (zh) 2021-07-08

Family

ID=76608453

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/106909 WO2021135212A1 (zh) 2020-01-03 2020-08-04 订单处理

Country Status (2)

Country Link
CN (1) CN113077299A (zh)
WO (1) WO2021135212A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114066055A (zh) * 2021-11-16 2022-02-18 中交智运有限公司 一种在物流运输中车辆晚靠台预测的方法、装置和服务器
CN114663169A (zh) * 2022-05-25 2022-06-24 浙江口碑网络技术有限公司 订单数据的处理方法及装置、存储介质、计算机设备

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113743803B (zh) * 2021-09-08 2024-03-15 上海哔哩哔哩科技有限公司 对象处理方法及装置
CN113723893A (zh) * 2021-09-15 2021-11-30 北京沃东天骏信息技术有限公司 用于处理订单的方法和装置

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107730019A (zh) * 2017-09-29 2018-02-23 携程计算机技术(上海)有限公司 基于用户画像的用户挽回方法及系统
CN108345958A (zh) * 2018-01-10 2018-07-31 拉扎斯网络科技(上海)有限公司 一种订单出餐时间预测模型构建、预测方法、模型和装置
CN109615201A (zh) * 2018-11-30 2019-04-12 拉扎斯网络科技(上海)有限公司 订单分配方法、装置、电子设备和存储介质
US20190171776A1 (en) * 2017-12-01 2019-06-06 Industrial Technology Research Institute Methods, devices and non-transitory computer-readable medium for parameter optimization
CN110020827A (zh) * 2019-04-17 2019-07-16 重庆淘创科技有限公司 一种智能配送方法
CN110516997A (zh) * 2019-08-13 2019-11-29 北京三快在线科技有限公司 数据处理方法、系统、和装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107730019A (zh) * 2017-09-29 2018-02-23 携程计算机技术(上海)有限公司 基于用户画像的用户挽回方法及系统
US20190171776A1 (en) * 2017-12-01 2019-06-06 Industrial Technology Research Institute Methods, devices and non-transitory computer-readable medium for parameter optimization
CN108345958A (zh) * 2018-01-10 2018-07-31 拉扎斯网络科技(上海)有限公司 一种订单出餐时间预测模型构建、预测方法、模型和装置
CN109615201A (zh) * 2018-11-30 2019-04-12 拉扎斯网络科技(上海)有限公司 订单分配方法、装置、电子设备和存储介质
CN110020827A (zh) * 2019-04-17 2019-07-16 重庆淘创科技有限公司 一种智能配送方法
CN110516997A (zh) * 2019-08-13 2019-11-29 北京三快在线科技有限公司 数据处理方法、系统、和装置

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114066055A (zh) * 2021-11-16 2022-02-18 中交智运有限公司 一种在物流运输中车辆晚靠台预测的方法、装置和服务器
CN114663169A (zh) * 2022-05-25 2022-06-24 浙江口碑网络技术有限公司 订单数据的处理方法及装置、存储介质、计算机设备

Also Published As

Publication number Publication date
CN113077299A (zh) 2021-07-06

Similar Documents

Publication Publication Date Title
WO2021135212A1 (zh) 订单处理
CN111652678B (zh) 物品信息显示方法、装置、终端、服务器及可读存储介质
CN111080207A (zh) 订单处理方法、装置、设备及存储介质
CN109784351B (zh) 行为数据分类方法、分类模型训练方法及装置
CN111192005B (zh) 政务业务处理方法、装置、计算机设备及可读存储介质
CN112069414A (zh) 推荐模型训练方法、装置、计算机设备及存储介质
CN111737573A (zh) 资源推荐方法、装置、设备及存储介质
CN112862516A (zh) 资源投放方法、装置、电子设备及存储介质
CN111897996B (zh) 话题标签推荐方法、装置、设备及存储介质
CN110097429A (zh) 电子订单生成方法、装置、终端及存储介质
CN112116391A (zh) 多媒体资源投放方法、装置、计算机设备及存储介质
CN114331492A (zh) 媒体资源的推荐方法、装置、设备及存储介质
CN114881711A (zh) 基于请求行为进行异常分析的方法及电子设备
CN113269612A (zh) 物品推荐方法、装置、电子设备及存储介质
CN112000264B (zh) 菜品信息展示方法、装置、计算机设备及存储介质
CN110246110A (zh) 图像评估方法、装置及存储介质
WO2020181858A1 (zh) 资源转移方法、装置及存储介质
CN111931075A (zh) 一种内容推荐方法、装置、计算机设备及存储介质
CN111028071A (zh) 账单处理方法、装置、电子设备及存储介质
CN112765470B (zh) 内容推荐模型的训练方法、内容推荐方法、装置及设备
CN113486260A (zh) 互动信息的生成方法、装置、计算机设备及存储介质
CN112990964A (zh) 推荐内容资源的获取方法、装置、设备及介质
CN111652432A (zh) 用户属性信息的确定方法、装置、电子设备及存储介质
CN111709843A (zh) 一种客户画像的生成方法、装置及电子设备
CN111429106A (zh) 资源转移凭证的处理方法、服务器、电子设备及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20909511

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20909511

Country of ref document: EP

Kind code of ref document: A1