A data processing method and apparatus
By using the estimated model in data processing to obtain estimated attribute values and error values and compensate, the problems of low data processing accuracy and efficiency in the prior art are solved, and higher data processing accuracy and efficiency are achieved.
Patent Information
- Application Number
- CN201910705176.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-08-01
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2039-08-01
AI Technical Summary
Existing data processing methods cannot accurately determine the confidence and error of estimated attribute values, resulting in limited accuracy and efficiency of data processing.
By obtaining the characteristics of the target data, input the estimated model to obtain the estimated attribute value and estimated error value, and compensate the estimated attribute value based on the estimated error value to obtain the final attribute value and process it.
Improves the accuracy of the final attribute value, making data processing more accurate and efficient.
Smart Images

Figure CN110533182B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of electronic technologies, and particularly to a data processing method and apparatus. Background Art
[0002] Currently, data processing can be seen everywhere. By processing valuable, meaningful, and highly accurate data, certain specific activities are carried out to achieve the purpose.
[0003] In the prior art, a data processing method is to train a model using the features of historical data, estimate the estimated attribute value in a certain dimension through the trained model, and process the data according to the estimated attribute value. These models generally include models such as Gradient Boosting Decision Tree (GBDT), eXtreme Gradient Boosting (XGBOOST), or neural networks.
[0004] However, only the estimated attribute value of the data is obtained through the above models, the confidence level of the estimated attribute value cannot be determined, nor can the error between the estimated attribute value and the actual attribute value be determined, thus an accurate attribute value cannot be determined. In practical applications, it is difficult to complete data processing due to the inability to obtain an accurate attribute value.
[0005] Taking food delivery ordering as an example, the time from receiving a food delivery order to the merchant completing the preparation of the meal is the merchant's supply preparation time. The merchant's supply preparation time is one of the important parameters of the distribution scheduling system. The accuracy of estimating the supply preparation time directly affects the result of order backlog and the efficiency of order assignment. The supply preparation time of the merchant varies in different time periods. Generally, the supply preparation time during off-peak hours is relatively fixed, and the supply preparation time during peak hours fluctuates greatly. Inability to accurately estimate the supply preparation time may result in the situation that when the delivery person arrives at the merchant according to the order information, the merchant has not completed the preparation of the meal, and the delivery person needs to wait for the meal to be prepared and cannot pick up the meal immediately to arrange the delivery, thus affecting the order delivery efficiency. Summary of the Invention
[0006] Embodiments of this specification provide a data processing method and apparatus to partially solve the above problems existing in the prior art.
[0007] Embodiments of this specification adopt the following technical solutions:
[0008] A data processing method provided in this specification, the method includes:
[0009] Obtain the features of the target data;
[0010] Input the features of the target data into the prediction model to obtain the predicted attribute value and the prediction error value of the target data in the specified dimension;
[0011] Compensate the predicted attribute value according to the prediction error value to obtain the final attribute value;
[0012] Process the target data according to the final attribute value.
[0013] Optionally, pre-training the prediction model includes:
[0014] Obtain the features of a number of historical data;
[0015] Input the features of the historical data into the prediction model to be trained to obtain the to-be-optimized predicted attribute value and the to-be-optimized prediction error value of the historical data in the specified dimension;
[0016] Determine the actual error value according to the to-be-optimized predicted attribute value and the actual attribute value of the historical data in the specified dimension;
[0017] Determine the loss according to the to-be-optimized prediction error value and the actual error value;
[0018] Taking minimizing the loss as the training objective, perform iterative training on the prediction model to be trained.
[0019] Optionally, the determining the loss according to the to-be-optimized prediction error value and the actual error value includes:
[0020] Determine the ratio of the square of the actual error value to the square of the to-be-optimized prediction error value;
[0021] Determine the logarithm of the square of the to-be-optimized prediction error value;
[0022] Determine the loss according to the ratio and the logarithm.
[0023] Optionally, the determining the loss according to the ratio and the logarithm includes:
[0024] Select a specified coefficient from the preset coefficients;
[0025] Determine the product of the specified coefficient and the to-be-optimized prediction error value;
[0026] Determine the sum value of the ratio, the logarithm and the product as the loss.
[0027] Optionally, the selecting a specified coefficient from the preset coefficients includes:
[0028] For each preset coefficient, determine the product of the coefficient and the to-be-optimized estimation error value as an alternative product, determine the sum value of the ratio, the logarithm, and the alternative product as an alternative loss, and use minimizing the alternative loss as the training objective to perform a specified number of iterative trainings on the to-be-trained estimation model, and determine the accuracy of the to-be-trained estimation model after training;
[0029] According to the accuracy determined for each coefficient, among the preset coefficients, select the coefficient with the highest accuracy as the specified coefficient.
[0030] Optionally, the compensating the estimated attribute value according to the estimation error value to obtain the final attribute value includes:
[0031] According to each preset error interval, determine the error interval in which the estimation error value falls;
[0032] According to the corresponding relationship between each preset error interval and each compensation weight, determine the compensation weight corresponding to the error interval in which the estimation error value falls;
[0033] According to the estimation error value and the determined compensation weight, determine the compensation value;
[0034] Determine the sum value of the compensation value and the estimated attribute value as the final attribute value.
[0035] Optionally, the target data includes: data of an order;
[0036] The attribute value of the target data in a specified dimension includes: the supply preparation time of the provider of the delivered item corresponding to the order;
[0037] The processing the target data according to the final attribute value includes:
[0038] According to the final supply preparation time of the provider of the delivered item corresponding to the order, perform scheduling and planning on the order.
[0039] This specification provides a data processing device, and the device includes:
[0040] An acquisition module, configured to acquire features of target data;
[0041] An estimation module, configured to input the features of the target data into an estimation model to obtain an estimated attribute value and an estimation error value of the target data in a specified dimension;
[0042] A compensation module, configured to compensate the estimated attribute value according to the estimation error value to obtain a final attribute value;
[0043] A processing module for processing the target data according to the final attribute value.
[0044] This specification provides a computer-readable storage medium, characterized in that the storage medium stores a computer program, and when the computer program is executed by a processor, the above data processing method is implemented.
[0045] This specification provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that when the processor executes the program, the above data processing method is implemented.
[0046] The above at least one technical solution adopted in the embodiments of this specification can achieve the following beneficial effects:
[0047] This specification first obtains the characteristics of the target data, then inputs the characteristics of the target data into a pre-trained estimation model to obtain the estimated attribute value and the estimated error value of the target data in a specified dimension, then compensates the estimated attribute value according to the estimated error value to obtain the final attribute value, and finally processes the target data according to the final attribute value. Since the data processing method provided in this specification compensates the estimated attribute value, the obtained final attribute value is closer to the actual attribute value than the prior art, effectively improving the accuracy of the final attribute value, and thus the processing of the target data according to the final attribute value is more accurate and efficient than the prior art. Description of the Drawings
[0048] The drawings described herein are used to provide a further understanding of the present application, and constitute a part of the present application. The illustrative embodiments and descriptions thereof of the present application are used to explain the present application and do not constitute an improper limitation of the present application. In the drawings:
[0049] Figure 1 It is a flowchart of the data processing method provided by the embodiments of this specification;
[0050] Figure 2 It is a flowchart of a compensation method provided by the embodiments of this specification;
[0051] Figure 3 It is a flowchart of the pre-trained estimation model provided by the embodiments of this specification;
[0052] Figure 4 It is a schematic structural diagram of a data processing device provided by the embodiments of this specification;
[0053] Figure 5 Corresponding to the embodiments of this specification Figure 1 Schematic diagram of the electronic device. Detailed Description of the Invention
[0054] To make the objectives, technical solutions, and advantages of this specification clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments of this specification and the corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, rather than all the embodiments. Based on the embodiments in this specification, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of this application.
[0055] The following will detail the technical solutions provided by each embodiment of this application in conjunction with the drawings. Figure 1 The flowchart of the data processing method provided for the embodiments of this specification may specifically include the following steps:
[0056] S100: Obtain the features of the target data.
[0057] In this specification, data processing can be applied to various scenarios. For example, in the food delivery scenario, the supply preparation time of the merchant is one of the important parameters of the delivery scheduling system. The supply preparation time refers to the time from when the merchant receives the food delivery order to when the merchant finishes making the meal. The accuracy of the supply preparation time directly affects the result of the scheduling plan and the efficiency of the order. The server needs to allocate orders to the delivery staff based on the supply preparation time, and plan tasks and delivery routes, etc.
[0058] The following will only use the food delivery scenario as an example for illustration.
[0059] The target data includes food delivery order data. The server can obtain the features of the target data, that is, obtain the features of the food delivery order data. The features of the food delivery order data include but are not limited to the order generation time, type of meal, number of meals, merchant name, order amount, delivery distance, etc. S102: Input the features of the target data into the prediction model to obtain the predicted attribute value and the predicted error value of the target data in the specified dimension.
[0060] Since there may be multiple prediction models with different functions stored in the server, in this specification, it is necessary to determine from these prediction models the prediction model for predicting the attribute value of the target data in the specified dimension. The determined prediction model has been pre-trained. The pre-training of the prediction model will be explained below.
[0061] After the server obtains the features of the target data through the above step S100, it can input the features of the target data into the prediction model. The prediction model described in this specification is used to predict the attribute value of the target data in the specified dimension. Continuing with the above example, the server can input the features of the food delivery order data into the prediction model to predict the supply preparation time in the food delivery order data.
[0062] Further, in this specification, in addition to being used to estimate the attribute value of the target data in a specified dimension, the above-mentioned estimation model can also be used to estimate the error value of the estimated attribute value output by the above-mentioned estimation model (hereinafter referred to as the estimated error value). That is, in this specification, the above-mentioned estimation model can output an estimated attribute value and an estimated error value according to the characteristics of the input target data. Among them, the estimated error value is negatively correlated with the confidence level of the estimated attribute value. Continuing with the above example, the server inputs the characteristics of the obtained takeaway order data into the estimation model, and can obtain the estimated supply preparation time and the estimated error value. The estimated error value is the error of the estimated supply preparation time. The smaller the estimated error value, the higher the confidence level of the estimated supply preparation time, and the larger the estimated error value, the lower the confidence level of the estimated supply preparation time.
[0063] S104: Compensate the estimated attribute value according to the estimated error value to obtain the final attribute value.
[0064] Through the above step S102, after the server obtains the estimated attribute value and the estimated error value output by the above-mentioned estimation model, it can compensate the estimated attribute value according to the obtained estimated error value. The confidence level and accuracy of the compensated estimated attribute value are higher. Therefore, the compensated estimated attribute value can be used as the final attribute value.
[0065] Continuing with the above example, after the server obtains the estimated supply preparation time and the estimated supply preparation time error, it can use the estimated supply preparation time error to compensate the estimated supply preparation time, and use the compensated supply preparation time as the final supply preparation time. The final supply preparation time obtained in this way has higher accuracy.
[0066] S106: Process the target data according to the final attribute value.
[0067] Through the above step S104, the server obtains the final attribute value and processes the target data. Continuing with the above example, the server obtains the final supply preparation time of the delivery item provider in the takeaway order data, and schedules and plans the takeaway order according to the final supply preparation time, assigns orders to the delivery staff, and plans tasks and delivery routes, etc.
[0068] In this specification, for the above step S104, when the above-mentioned pre-trained estimation model uses the difference between the actual attribute value and the estimated attribute value as the training target for the estimated error value, the method for compensating the estimated attribute value can be as Figure 2 shown.
[0069] Figure 2 The figure is a flowchart of a compensation method provided by an embodiment of this specification, including the following steps:
[0070] S1040: Determine the error interval in which the estimated error value falls according to each preset error interval.
[0071] Since the theoretical value range of the estimated error value is from zero to infinity, intervals can be set for the value range of the estimated error value. Also, because the estimated error value is negatively correlated with the confidence level of the estimated attribute value, when setting the error interval for the estimated error value, more intervals can be set when the value of the estimated error value is small, and fewer intervals can be set when the value of the estimated error value is large. For example, the error intervals are set as (0, 100), (101, 250), (251, 500), (501 - 1000), (1001 - ∞). Intervals can also be set according to a specified difference at intervals. For example, the error intervals are set as (0, 100), (101 - 200), (201, 300), (301 - ∞).
[0072] S1042: Determine the compensation weight corresponding to the error interval in which the estimated error value falls according to the corresponding relationship between each preset error interval and each compensation weight.
[0073] In this specification, for each of the above - divided error intervals, a corresponding compensation weight can be preset. When the value of the estimated error value is small, a smaller compensation weight can be set for the corresponding error interval. As the value of the estimated error value gradually increases, a gradually larger compensation weight can be set for the corresponding error interval. The specific method of setting the compensation weight corresponding to each error interval can be set manually according to experience, and this specification does not limit it.
[0074] S1044: Determine the compensation value according to the estimated error value and the determined compensation weight.
[0075] For the compensation weight determined in step S1042 above, determine the product of the estimated error value and the compensation weight as the compensation value.
[0076] S1046: Determine the sum value of the compensation value and the estimated attribute value as the final attribute value.
[0077] According to steps S1040 - S1044, the final attribute value is as shown in formula (1).
[0078]
[0079] In formula (1), y represents the final attribute value, represents the estimated attribute value, represents the estimated error value, represents the compensation weight corresponding to the error interval in which the estimated error value falls.
[0080] In addition, in addition to the above Figure 2In addition to the compensation method shown, the compensation method described in step S104 may also be: multiplying the estimated error value by the estimated attribute value to determine the final attribute value. The final attribute value is shown in formula (2).
[0081]
[0082] When using the above formula (2) for compensation, the above pre-trained estimation model is trained with the objective that the estimated error value is the quotient of the actual attribute value and the estimated attribute value.
[0083] Of course, the above are just two example compensation methods. In actual applications, the compensation for the estimated attribute value can also be achieved through other compensation methods (for example, directly using the sum of the estimated error value and the estimated attribute value as the final attribute value), so that the estimated attribute value is determined as the final attribute value after compensation. Any compensation method that can compensate the estimated attribute value and make the obtained final attribute value closer to the actual attribute value than the estimated attribute value is within the scope of protection of this specification.
[0084] From the above data processing process, it can be seen that in addition to being able to output the estimated attribute value, the estimation model described in this specification can also output the estimated error value used to compensate this estimated attribute value. Then the method for pre-training the above estimation model can be as Figure 3 shown.
[0085] Figure 3 It is the flowchart for pre-training the estimation model provided by the embodiment of this specification, including the following steps:
[0086] S300: Obtain the features of a number of historical data.
[0087] In this specification, obtaining the features of historical data is the same as obtaining the features of the target data in step S100, and the obtained historical data is the sample data required for training the estimation model.
[0088] S302: Input the features of the historical data into the estimation model to be trained, and obtain the estimated attribute value to be optimized and the estimated error value to be optimized for the historical data in the specified dimension.
[0089] S304: Determine the actual error value according to the estimated attribute value to be optimized and the actual attribute value of the historical data in the specified dimension.
[0090] Since the actual attribute value of the historical data in the specified dimension can be determined in advance, and this actual attribute value is the label of the sample data, the server can determine the difference between the estimated attribute value to be optimized and the actual attribute value as the actual error value.
[0091] S306: Determine the loss based on the to-be-optimized estimated error value and the actual error value.
[0092] Specifically, determine the estimated attribute value function according to the characteristics of historical data and the preset first estimated model parameters, and determine the estimated error value function according to the characteristics of historical data and the preset second estimated model parameters, as shown in formulas (3) and (4).
[0093]
[0094]
[0095] Among them, x represents the characteristics of historical data, θ represents the first estimated model parameters, and η represents the second estimated model parameters.
[0096] Through formula (3), the to-be-optimized estimated attribute value can be obtained. Through formula (4), the to-be-optimized estimated error value can be obtained.
[0097] Furthermore, according to the actual situation, the estimated attribute value in historical data may be greater than or less than the actual attribute value, so the estimated error value may be negative or positive. To determine the estimated error function, the absolute value of formula (4) can be taken.
[0098] Furthermore, determine the ratio of the square of the actual error value to the square of the to-be-optimized estimated error value; determine the logarithm of the square of the to-be-optimized estimated error value; determine the loss according to the ratio and the logarithm. The loss is as shown in formula (5).
[0099]
[0100] In formula (5), y′ represents the actual attribute value.
[0101] Furthermore, when there are several pieces of historical data, the mean value of the ratio can be used to represent. The closer the mean value of the ratio is to 1, the more accurate the estimated error value is. Determine the loss according to the mean value of the ratio and the logarithm.
[0102] S308: Take minimizing the loss as the training objective and perform iterative training on the to-be-trained estimated model.
[0103] In formula (5), the prediction model uses the difference between the actual attribute value and the predicted attribute value as the prediction error value as the training target. When the prediction error value is more accurate, the result of the ratio approaches 1. When the prediction error value gradually increases, the logarithmic value gradually increases. When the prediction error value approaches 0 (the closer to 0, the more accurate the prediction error value), the logarithmic value approaches negative infinity. Therefore, according to formula (5), when the loss approaches negative infinity, it can be determined that the prediction error value approaches 0, the predicted attribute value is closer to the actual attribute value, and the accuracy of the predicted attribute value is higher. When the loss is larger, it can be determined that the prediction error value is larger, the difference between the predicted attribute value and the actual attribute value is larger, and the accuracy of the predicted attribute value is lower.
[0104] It can be seen that by minimizing the loss as shown in formula (5) above, a prediction model can be trained to output relatively accurate predicted attribute values and prediction error values.
[0105] In addition, in the above step S306, the method for determining the loss may further include: selecting a specified coefficient from the preset coefficients; determining the product of the specified coefficient and the prediction error value to be optimized; determining the sum value of the ratio, the logarithm, and the product as the loss as shown in formula (6).
[0106]
[0107] In formula (6), λ represents the specified coefficient.
[0108] Multiple different coefficients λ can be preset in advance. When selecting the specified coefficient, for each preset coefficient, determine the product of the coefficient and the prediction error value to be optimized as the alternative product, determine the sum value of the ratio, the logarithm, and the alternative product as the alternative loss, and use minimizing the alternative loss as the training target to perform a specified number of iterative trainings on the prediction model to be trained, and determine the accuracy of the prediction model to be trained after training; according to the accuracy determined for each coefficient, select the coefficient with the highest accuracy from the preset coefficients as the specified coefficient. That is, for each preset coefficient, try to train the prediction model with the loss determined by the coefficient and the above formula (6), and determine its training effect, and finally select the coefficient with the best training effect as the specified coefficient required for determining the loss by the above formula (6).
[0109] Formula (6) adds compared to formula (5) Item one, the reason is that: the value of the logarithm gradually increases as the estimated error value increases. Since the derivative of the logarithm is negative, as the estimated error value increases, the increasing speed of the logarithm gradually decreases, and the convergence speed of the loss function gradually decreases, resulting in an insignificant effect on the iterative training of the to-be-trained estimation model. Therefore, adding the product of a specified coefficient and the to-be-optimized estimated error value as the third term of the loss can accelerate the convergence speed of the loss . Specifically, when the estimated error value approaches 0, the product of the exponential coefficient and the estimated error value also approaches 0, and the loss approaches negative infinity. When the estimated error value gradually increases, the product of the exponential coefficient and the estimated error value increases accordingly, and the convergence speed of the loss accelerates.
[0110] When performing iterative training on the to-be-trained estimation model through the above formula (5) or formula (6), the training completion conditions (i.e., the conditions for exiting the iteration) may include: the number of iterative training reaches a preset maximum number of iterations, or the accuracy of the estimation model has reached a preset accuracy, etc.
[0111] As described above, this specification provides a method for processing delivery order data. This method can be applied to the takeaway delivery scenario. The method includes: obtaining the characteristics of the delivery order data; inputting the characteristics of the delivery order data into an estimation model to obtain the estimated supply preparation time and the estimated error value of the delivery order data; compensating the estimated supply preparation time according to the estimated error value to obtain the final supply preparation time; and processing the delivery order data according to the final supply preparation time.
[0112] Furthermore, pre-training the estimation model includes: obtaining the characteristics of several historical delivery order data; inputting the characteristics of the historical delivery order data into the to-be-trained estimation model to obtain the to-be-optimized estimated supply preparation time and the to-be-optimized estimated error value of the historical delivery order data; determining the actual error value according to the to-be-optimized estimated supply preparation time and the actual supply preparation time of the historical delivery order data; determining the loss according to the to-be-optimized estimated error value and the actual error value; and performing iterative training on the to-be-trained estimation model with minimizing the loss as the training objective.
[0113] Furthermore, determining the loss according to the to-be-optimized estimated error value and the actual error value includes: determining the ratio of the square of the actual error value to the square of the to-be-optimized estimated error value; determining the logarithm of the square of the to-be-optimized estimated error value; and determining the loss according to the ratio and the logarithm.
[0114] Further, determining the loss according to the ratio and the logarithm includes: selecting a specified coefficient from each of the preset coefficients; determining the product of the specified coefficient and the estimated error value to be optimized; determining the sum value of the ratio, the logarithm, and the product as the loss.
[0115] Further, the selecting a specified coefficient from each of the preset coefficients includes: for each of the preset coefficients, determining the product of the coefficient and the estimated error value to be optimized as an alternative product, determining the sum value of the ratio, the logarithm, and the alternative product as an alternative loss, taking minimizing the alternative loss as a training objective, performing a specified number of iterative trainings on the estimated model to be trained, and determining the accuracy of the estimated model to be trained after training; according to the accuracy determined for each coefficient, selecting the coefficient with the highest accuracy from each of the preset coefficients as the specified coefficient.
[0116] Further, compensating the estimated supply preparation time according to the estimated error value to obtain the final supply preparation time includes: determining the error interval in which the estimated error value falls according to each of the preset error intervals; determining the compensation weight corresponding to the error interval in which the estimated error value falls according to the corresponding relationship between each of the preset error intervals and each compensation weight; determining a compensation value according to the estimated error value and the determined compensation weight; determining the sum value of the compensation value and the estimated supply preparation time as the final supply preparation time.
[0117] Further, the delivery order data includes: data of food delivery orders; the estimated supply preparation time of the delivery order data includes: the supply preparation time of the provider of the delivery items corresponding to the food delivery orders; processing the delivery order data according to the final supply preparation time includes: allocating the food delivery orders to a specified rider for delivery according to the final supply preparation time of the provider of the delivery items corresponding to the food delivery orders, sorting all the task points corresponding to the orders already allocated to the specified rider, and performing navigation for the specified rider according to the sorting result; wherein, the task points include a pick-up point and a delivery point.
[0118] The above is a data processing method described only by taking the food delivery scenario as an example. The above data processing method provided in this specification can also be applied to other scenarios. For example, in the scenario of reserved travel, the characteristics of travel order data are input into a pre-trained prediction model to obtain the estimated waiting time for the travel order and the estimated error value. The estimated waiting time for the travel order is compensated according to the estimated error value to obtain the final estimated waiting time for the travel order. The server then plans a reasonable departure time for the passenger based on the final estimated waiting time for the travel order, thereby avoiding the situation where the passenger and the vehicle arrive at the boarding point at different times, saving the waiting time of the passenger and the driver, and achieving the effect of efficient travel.
[0119] For another example, in the online shopping scenario, the characteristics of online shopping order data are input into a pre-trained prediction model to obtain the estimated delivery time for the online shopping order and the estimated error value. The estimated delivery time for the online shopping order is compensated according to the estimated error value to obtain the final estimated delivery time for the online shopping order. The server then plans a reasonable delivery time for the courier based on the final estimated delivery time for the online shopping order, thereby avoiding the situation of untimely delivery and improving the efficiency of courier delivery.
[0120] A data processing method provided in this specification can be applied to multiple scenarios. For the applications in different scenarios, they will not be elaborated one by one here.
[0121] Based on Figure 1 the data processing method shown, the embodiments of this specification also correspondingly provide a schematic structural diagram of a data processing device, as Figure 4 shown.
[0122] Figure 4 The following is a schematic structural diagram of a data processing device provided by the embodiments of this specification. The device includes:
[0123] An acquisition module 401, configured to acquire the characteristics of target data;
[0124] A prediction module 402, configured to input the characteristics of the target data into a prediction model to obtain the predicted attribute value and the predicted error value of the target data in a specified dimension;
[0125] A compensation module 403, configured to compensate the predicted attribute value according to the predicted error value to obtain the final attribute value;
[0126] A processing module 404, configured to process the target data according to the final attribute value.
[0127] Optionally, the device further includes:
[0128] The training module 405 is configured to pre-acquire the features of a number of historical data; input the features of the historical data into the prediction model to be trained, and obtain the to-be-optimized predicted attribute value and the to-be-optimized prediction error value of the historical data in a specified dimension; determine the actual error value according to the to-be-optimized predicted attribute value and the actual attribute value of the historical data in the specified dimension; determine the loss according to the to-be-optimized prediction error value and the actual error value; and perform iterative training on the to-be-trained prediction model with minimizing the loss as the training objective.
[0129] Optionally, the training module 405 is specifically configured to determine the ratio of the square of the actual error value to the square of the to-be-optimized prediction error value; determine the logarithm of the square of the to-be-optimized prediction error value; and determine the loss according to the ratio and the logarithm.
[0130] Optionally, the training module 405 is specifically configured to select a specified coefficient from the preset coefficients; determine the product of the specified coefficient and the to-be-optimized prediction error value; and determine the sum value of the ratio, the logarithm, and the product as the loss.
[0131] Optionally, the training module 405 is specifically configured to, for each preset coefficient, determine the product of the coefficient and the to-be-optimized prediction error value as an alternative product, determine the sum value of the ratio, the logarithm, and the alternative product as an alternative loss, perform iterative training on the to-be-trained prediction model for a specified number of times with minimizing the alternative loss as the training objective, and determine the accuracy of the to-be-trained prediction model after training; and select the coefficient with the highest accuracy from the preset coefficients as the specified coefficient according to the accuracy determined for each coefficient.
[0132] Optionally, the compensation module 403 is specifically configured to determine the error interval in which the prediction error value falls according to the preset error intervals; determine the compensation weight corresponding to the error interval in which the prediction error value falls according to the corresponding relationship between the preset error intervals and the compensation weights; determine the compensation value according to the prediction error value and the determined compensation weight; and determine the sum value of the compensation value and the predicted attribute value as the final attribute value.
[0133] Optionally, the target data includes: data of an order; and the attribute value of the target data in a specified dimension includes: the supply preparation time of the provider of the delivered item corresponding to the order.
[0134] The processing module 404 is configured to process the target data according to the final attribute value, including: performing scheduling planning on the order according to the final supply preparation time of the provider of the delivered item corresponding to the order.
[0135] The embodiments of this specification also provide a computer-readable storage medium, which stores a computer program that can be used to execute the above-mentioned Figure 1 data processing method.
[0136] Based on Figure 1 the data processing method shown, the embodiments of this specification also propose Figure 5 the corresponding Figure 1 schematic diagram of an electronic device, as Figure 5 , at the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory. Of course, it may also include other hardware required for other services. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to implement the above-mentioned Figure 1 data processing method.
[0137] Of course, in addition to the software implementation method, this specification does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc. That is to say, the execution subject of the following processing flow is not limited to each logic unit, and can also be hardware or a logic device.
[0138] In the 1990s, it was obvious to distinguish whether an improvement in a technology was a hardware improvement (e.g., improvement in circuit structures such as diodes, transistors, switches, etc.) or a software improvement (improvement in method processes). However, with the development of technology, many improvements in method processes today can be regarded as direct improvements in hardware circuit structures. Almost all designers obtain the corresponding hardware circuit structures by programming the improved method processes into the hardware circuits. Therefore, it cannot be said that an improvement in a method process cannot be implemented with a hardware entity module. For example, a Programmable Logic Device (PLD) (e.g., a Field Programmable Gate Array (FPGA)) is such an integrated circuit whose logic function is determined by the user programming the device. The designer programs by himself to "integrate" a digital system on a piece of PLD, without having to ask the chip manufacturer to design and manufacture a dedicated integrated circuit chip. Moreover, nowadays, instead of manually manufacturing integrated circuit chips, this programming is mostly implemented using "logic compiler" software, which is similar to the software compiler used in program development writing, and the original code before compilation also has to be written in a specific programming language, which is called a Hardware Description Language (HDL), and there is not only one kind of HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. Currently, the most commonly used are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also be aware that as long as the method process is slightly logically programmed with the above-mentioned several hardware description languages and programmed into the integrated circuit, it is easy to obtain the hardware circuit that implements the logical method process.
[0139] The controller can be implemented in any suitable manner. For example, the controller can take the form of, for example, a microprocessor or a processor and a computer-readable medium storing computer-readable program code (such as software or firmware) executable by the (micro)processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of the controller include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in the form of pure computer-readable program code, it is entirely possible to logically program the method steps to enable the controller to implement the same functions in the form of logic gates, switches, ASICs, programmable logic controllers, embedded microcontrollers, etc. Therefore, such a controller can be considered a hardware component, and the devices included therein for implementing various functions can also be regarded as the structures within the hardware component. Or even, the devices for implementing various functions can be regarded as either software modules for implementing the method or the structures within the hardware component.
[0140] The systems, devices, modules, or units illustrated in the above embodiments can be specifically implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer can be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or any combination of these devices.
[0141] For the convenience of description, when describing the above devices, they are described separately as various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0142] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) containing computer-usable program code.
[0143] The present invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It should be understood that each flow and / or block in the flowchart illustrations and / or block diagrams, and combinations of flows and / or blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions executed by the processor of the computer or other programmable data processing apparatus create means for implementing the functions specified in the flowchart Figure 1 for one or more of the flows and / or blocks Figure 1 and / or means for implementing the functions specified in one or more of the blocks.
[0144] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means that implement the functions specified in the flowchart Figure 1 for one or more of the flows and / or blocks Figure 1 and / or means for implementing the functions specified in one or more of the blocks.
[0145] These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, such that the instructions executed on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart Figure 1 for one or more of the flows and / or blocks Figure 1 and / or means for implementing the functions specified in one or more of the blocks.
[0146] In a typical configuration, a computing device includes one or more processors (CPUs), an input / output interface, a network interface, and memory.
[0147] The memory may include non-permanent memory in the form of computer-readable media, random access memory (RAM), and / or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM). The memory is an example of computer-readable media.
[0148] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0149] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0150] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0151] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0152] The various embodiments in this specification are described in a progressive manner. For the same or similar parts among the various embodiments, reference can be made to each other, and the differences between each embodiment and other embodiments are emphasized. In particular, for system embodiments, since they are basically similar to method embodiments, the description is relatively simple, and reference can be made to the relevant parts of the method embodiments for the relevant content.
[0153] The above is only the embodiment of this specification and is not intended to limit this specification. For those skilled in the art, various changes and modifications can be made to this specification. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this specification shall be included within the scope of the claims of this specification.
Claims
1. A data processing method, characterized in that, The method includes: Obtaining the features of the target data, where the target data includes takeaway order data; Inputting the features of the target data into a prediction model to obtain the predicted attribute value and the predicted error value of the target data in a specified dimension, where the predicted attribute value refers to the predicted supply preparation time; Compensating the predicted attribute value according to the predicted error value to obtain the final attribute value, where the final attribute value refers to the final supply preparation time; Processing the target data according to the final attribute value, where processing the target data includes scheduling and planning for takeaway orders; Among them, compensating the predicted attribute value according to the predicted error value to obtain the final attribute value includes: Determining the error interval in which the predicted error value falls according to each preset error interval; Determining the compensation weight corresponding to the error interval in which the predicted error value falls according to the corresponding relationship between each preset error interval and each compensation weight; Determining a compensation value according to the predicted error value and the determined compensation weight; Determining the sum value of the compensation value and the predicted attribute value as the final attribute value; Among them, pre-training the prediction model includes: Obtaining the features of a number of historical data; Inputting the features of the historical data into the prediction model to be trained to obtain the to-be-optimized predicted attribute value and the to-be-optimized predicted error value of the historical data in a specified dimension; Determining the actual error value according to the to-be-optimized predicted attribute value and the actual attribute value of the historical data in a specified dimension; Determining the loss according to the to-be-optimized predicted error value and the actual error value; Taking minimizing the loss as the training objective, and performing iterative training on the prediction model to be trained; Among them, determining the loss according to the to-be-optimized predicted error value and the actual error value includes: Determining the ratio of the square of the actual error value to the square of the to-be-optimized predicted error value; Determining the logarithm of the square of the to-be-optimized predicted error value; Determining the loss according to the ratio and the logarithm; Among them, determining the loss according to the ratio and the logarithm includes: Selecting a specified coefficient from each preset coefficient; Determining the product of the specified coefficient and the to-be-optimized predicted error value; Determining the sum value of the ratio, the logarithm and the product as the loss; Among them, selecting a specified coefficient from each preset coefficient includes: For each preset coefficient, determining the product of the coefficient and the to-be-optimized predicted error value as an alternative product, determining the sum value of the ratio, the logarithm and the alternative product as an alternative loss, taking minimizing the alternative loss as the training objective, performing a specified number of iterative trainings on the prediction model to be trained, and determining the accuracy of the prediction model to be trained after training; According to the accuracy determined for each coefficient, selecting the coefficient with the highest accuracy from each preset coefficient as the specified coefficient.
2. The method according to claim 1, characterized in that The target data includes: order data; The attribute value of the target data in a specified dimension includes: the supply preparation time of the delivery item provider corresponding to the order; Processing the target data according to the final attribute value includes: Schedule and plan the order according to the final supply preparation time of the provider of the delivery item corresponding to the order.
3. A data processing device, characterized in that, The device includes: An acquisition module, configured to acquire the features of target data, where the target data includes takeaway order data; An estimation module, configured to input the features of the target data into an estimation model to obtain the estimated attribute value and the estimated error value of the target data in a specified dimension, where the estimated attribute value refers to the estimated supply preparation time; A compensation module, configured to compensate the estimated attribute value according to the estimated error value to obtain the final attribute value, where the final attribute value refers to the final supply preparation time; A processing module, configured to process the target data according to the final attribute value, and the processing of the target data includes scheduling and planning the takeaway order; Wherein, the compensating the estimated attribute value according to the estimated error value to obtain the final attribute value includes: Determine the error interval in which the estimated error value falls according to each preset error interval; Determine the compensation weight corresponding to the error interval in which the estimated error value falls according to the corresponding relationship between each preset error interval and each compensation weight; Determine the compensation value according to the estimated error value and the determined compensation weight; Determine the sum value of the compensation value and the estimated attribute value as the final attribute value; Wherein, pre-training the estimation model includes: Acquire the features of a number of historical data; Input the features of the historical data into the estimation model to be trained to obtain the to-be-optimized estimated attribute value and the to-be-optimized estimated error value of the historical data in a specified dimension; Determine the actual error value according to the to-be-optimized estimated attribute value and the actual attribute value of the historical data in a specified dimension; Determine the loss according to the to-be-optimized estimated error value and the actual error value; Perform iterative training on the estimation model to be trained with the goal of minimizing the loss; Wherein, the determining the loss according to the to-be-optimized estimated error value and the actual error value includes: Determine the ratio of the square of the actual error value to the square of the to-be-optimized estimated error value; Determine the logarithm of the square of the to-be-optimized estimated error value; Determine the loss according to the ratio and the logarithm; Wherein, the determining the loss according to the ratio and the logarithm includes: Select a specified coefficient from each preset coefficient; Determine the product of the specified coefficient and the to-be-optimized estimated error value; Determine the sum value of the ratio, the logarithm and the product as the loss; Wherein, the selecting a specified coefficient from each preset coefficient includes: For each preset coefficient, determine the product of the coefficient and the to-be-optimized estimated error value as the alternative product, determine the sum value of the ratio, the logarithm and the alternative product as the alternative loss, perform a specified number of iterative trainings on the estimation model to be trained with the goal of minimizing the alternative loss, and determine the accuracy of the estimation model to be trained after training; According to the accuracy determined for each coefficient, select the coefficient with the highest accuracy from each preset coefficient as the specified coefficient.
4. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, and when the computer program is executed by a processor, the method described in any one of claims 1-2 above is implemented.
5. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the program, the method described in any one of claims 1-2 above is implemented.
Citation Information
Patent Citations
Wind power forecast method based on error correction and promotion wavelet combination forecast model
CN107230977A
Order meal supply time prediction model construction and prediction method, model and device
CN108345958A
Prediction method and prediction device
CN109754107A
Data prediction method and device
CN112598193A
Stock-up processing method and device, computer storage medium and electronic equipment
CN114549032A