Intelligent marketing cost estimation method based on attention mechanism
By building a neural network model based on attention mechanism, extracting and utilizing the features in marketing data, the shortcomings of traditional methods in dealing with complex relationships and high-dimensional features are solved, and more accurate intelligent marketing cost estimates and resource optimization are achieved.
Patent Information
- Application Number
- CN202510165261.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-14
- Publication Date
- 2025-05-27
AI Technical Summary
Traditional intelligent marketing cost estimation methods are insufficient in dealing with complex nonlinear relationships and high-dimensional features, making it difficult to effectively evaluate the cost of marketing activities and optimize resource allocation.
A neural network model based on attention mechanism is adopted, and order data is obtained and preprocessed from the database, driver characteristics, environmental characteristics and activity characteristics are extracted, and a neural network model based on attention mechanism is constructed to conduct intelligent marketing cost estimates.
By dynamically adjusting the weights of different input features, the model can better capture potential patterns in the data, improve the accuracy of prediction of driver individual timing performance, and help optimize the resource allocation of marketing activities.
Smart Images

Figure CN120047173A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data mining, and more specifically, to an intelligent marketing cost estimation method based on the attention mechanism. Background Art
[0002] In the modern business environment, intelligent marketing has become the key for enterprises to gain competitive advantages. With the development of big data and artificial intelligence technologies, how to effectively evaluate the costs of marketing activities and optimize resource allocation has become a research hotspot. Traditional cost estimation methods often rely on classical statistical models such as linear regression, and these methods are insufficient in dealing with complex non-linear relationships and high-dimensional features. Therefore, advanced methods based on deep learning have gradually attracted attention, especially the introduction of the attention mechanism, which provides new ideas for intelligent marketing cost estimation.
[0003] The attention mechanism originated from the field of natural language processing and aims to enhance the model's attention to important information. In marketing data, there are often a large amount of irrelevant or redundant information, and using the attention mechanism can help the model focus on the features that have the most impact on cost estimation. This mechanism can dynamically adjust the weights of different input features, enabling the model to better capture the potential patterns in the data. Summary of the Invention
[0004] In view of the technical problems existing in the prior art, the present invention provides an intelligent marketing cost estimation method based on the attention mechanism to solve the problems raised in the above background art.
[0005] The technical solution of the present invention to solve the above technical problems is as follows: An intelligent marketing cost estimation method based on the attention mechanism specifically includes the following steps:
[0006] Step 101: Obtain all order data within the past 180 days from the database, and preprocess the obtained data to extract driver features, environmental features, and activity features;
[0007] Step 102: According to the extracted features, obtain the activity matrix participated by the driver and the order completion volume of the next day, and construct a neural network model based on the attention mechanism;
[0008] Step 103: Extract the feature information of the current day, substitute it into the neural network model, obtain the expected order completion volume of each driver, and perform intelligent marketing cost estimation according to the predicted order completion volume and the cost function.
[0009] In a preferred embodiment, in step 101, to obtain all order data within the past 180 days from the database and preprocess the obtained data to extract driver features, environmental features, and activity features, the specific steps are as follows:
[0010] Step A1, Data Collection: Extract all order data sets of the past 180 days from the database, including order basic information, driver information, and activity information, and preprocess the obtained data to eliminate dirty data, duplicate data, and missing values to ensure data quality;
[0011] Step A2, Feature Extraction: Extract features from the preprocessed data, including driver features, environmental features, and activity feature extraction, which further includes the following steps:
[0012] Step A201, The driver features include the order completion volume feature, the average service score of the driver, and the number of days the driver is on duty. The specific calculation formulas are as follows:
[0013]
[0014] where Q driver,i is the historical order completion volume of driver i in the past m days, O i,k is the number of orders completed by driver i on the kth day, S driver,i is the average service score of driver i, R ij is the score of the jth order of driver i, N i is the total number of orders of driver i, T driver,i is the average driving duration of driver i, H i,j is the driving duration of driver i on the jth order;
[0015] Step A202, The environmental features include the historical sequence of the number of on-duty drivers within 14 days in the tenant of the city where the driver belongs, which is Q driver_count =[C k |k∈1,2,...,14] and the historical sequence of the order originator's order placement, which is Q orders =[O k |k∈1,2,...,14], where C k represents the number of on-duty drivers on the kth day, and O k represents the order volume on the kth day;
[0016] Step A203, The activity features include the number of days of the activity L activity , the number of drivers participating in the activity P num and the reward rule feature. The matrix R activity formed by the rules of the activities involved by the driver includes reward strategies and activity types. The specific calculation formulas are as follows:
[0017] L activity =T end -T start
[0018] R activity= [r 1 , r 2 ,..., r α
[0019] where L activity represents the number of active days, T end and T start are the end and start times of the activity respectively, P num is the number of drivers participating in the activity, r α represents the α-th activity rule.
[0020] In a preferred embodiment, in step 102, according to the extracted features, an activity matrix participated by the driver and the order completion volume of the next day are obtained, and a neural network model based on the attention mechanism is constructed. The specific steps are as follows:
[0021] Step B1, neural network model construction: According to the extracted features, generate an activity matrix A i (t + 1) participated by the driver, which reflects the performance and participation of different drivers in specific activities. Among them, A i (t + 1) represents the activity matrix participated by driver i on the next day. The driver features, environmental features, and activity matrix are used as input feature vectors, expressed as: The output is the predicted order completion volume of each driver on the next day, expressed as: Q expected (i, t + 1) = f(X i (t), A i (t + 1)); where X i (t) represents the feature information of the driver, A i (t + 1) represents the activity matrix, Q expected (i, t + 1) is the predicted order completion volume of driver i on the next day, Q driver is the order completion volume feature, S driver is the average service score of the driver, T driver is the number of days the driver has been on duty, Q driver_count = [C k |k ∈ 1, 2,..., 14] and Q orders = [O k |k ∈ 1, 2,..., 14] are respectively the historical sequences of the number of drivers on duty within 14 days and the historical sequences of the order main order placement within the tenant of the city where the driver belongs. L activity is the duration of the activity, P num is the number of drivers participating in the activity, R activity is the reward rule feature matrix;
[0022] Step B2. Model training: Divide the order dataset into a training set, a validation set, and a test set. Use the training set to train the neural network model, and use a loss function to evaluate the difference between the predicted value and the actual completed order volume for model training. The loss function is where V represents the total number of samples, Q pred (h) represents the prediction result of the model for the h-th sample, and Q actual (h) represents the actual completed order volume of the h-th sample.
[0023] In a preferred embodiment, in step 103, extract the feature information of the current day, substitute it into the neural network model, obtain the expected completed order volume of each driver, and perform intelligent marketing cost estimation according to the predicted completed order volume and the cost function. The specific steps are as follows:
[0024] Step C1. Extract the expected completed order volume Q expected (i) of each driver from the model output. According to business requirements, set a cost function, which includes fixed costs, variable costs, and incentive costs related to the completed order volume. The specific calculation formula is: C i = C fixed + C variable + C incentive (Q expected (i)), where C i is the cost function of driver i, C fixed represents the fixed cost related to the marketing activity, C variable = c 1 · L activity represents the variable cost related to the driver's participation and completion of the activity, c 1 is the unit variable cost, L activity represents the number of days of the activity, C incentive (Q expected (i)) = c 2 · Q expected (i) is the incentive cost related to the completed order volume, and c 2 is the incentive cost per order;
[0025] Step C2. Use the cost function defined in Step C1 to calculate the marketing cost of each driver, and sum up the costs of all drivers to obtain the estimated cost of the overall marketing activity. The specific calculation formula is as follows:
[0026]
[0027] where C total is the overall estimated cost, z represents the total number of drivers participating in the activity, C fixed represents the fixed cost, and c 1 is the unit variable cost, c2 is the cost per single incentive, L activity represents the number of days of the activity, Q expected (i) represents the expected number of completed orders of driver i.
[0028] The beneficial effects of the present invention are as follows: All order data within the past 180 days are obtained from the database, and the obtained data is preprocessed to extract driver features, environmental features, and activity features. According to the extracted features, the activity matrix participated by the driver and the number of completed orders on the next day are obtained, and a neural network model based on the attention mechanism is constructed. The order data set is divided into a training set, a validation set, and a test set. The neural network model is trained using the training set. The target driver group is selected, and the feature information of the current day is extracted and substituted into the trained neural network model to obtain the expected number of completed orders of each driver on the next day. The rewards that each driver should obtain are calculated according to the expected number of completed orders and the activity rules, and all the rewards are accumulated to obtain the estimated cost of the entire marketing activity. The present invention reflects the stimulation of the activity to the driver through the attention mechanism, makes predictions based on the temporal performance of individual drivers, and the predicted values are more in line with the individual conditions of the drivers, which is beneficial for activity configurators to select new drivers to form activities. Description of the Drawings
[0029] Figure 1 is the flowchart of the method of the present invention. Detailed Embodiments
[0030] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of the present application.
[0031] In the description of the present application, the terms "first" and "second" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of the described features. In the description of the present application, "a plurality" means two or more, unless otherwise specifically defined.
[0032] In the description of the present application, the term "for example" is used to mean "serving as an example, illustration, or explanation". Any embodiment described in the present application as "for example" is not necessarily to be construed as more preferred or advantageous than other embodiments. The following description is given to enable any person skilled in the art to implement and use the present invention. In the following description, details are set forth for purposes of explanation. It should be understood that those of ordinary skill in the art can recognize that the present invention can be implemented without using these specific details. In other instances, well-known structures and processes are not elaborated in detail to avoid obscuring the description of the present invention with unnecessary details. Therefore, the present invention is not intended to be limited to the embodiments shown, but is to be accorded the widest scope consistent with the principles and features disclosed in the present application.
[0033] Embodiment 1
[0034] This embodiment provides a method for predicting intelligent marketing costs based on the attention mechanism as shown in Figure 1 and specifically includes the following steps:
[0035] Step 101: Obtain all order data within the past 180 days from the database, and preprocess the obtained data to extract driver features, environmental features, and activity features;
[0036] Step 102: According to the extracted features, obtain the activity matrix participated by the driver and the order completion volume of the next day, and construct a neural network model based on the attention mechanism;
[0037] Step 103: Extract the feature information of the current day, substitute it into the neural network model, obtain the expected order completion volume of each driver, and perform intelligent marketing cost prediction according to the predicted order completion volume and the cost function.
[0038] Preferably, in step 101, all order data within the past 180 days are obtained from the database, and the obtained data are preprocessed to ensure the uniqueness of each record in the dataset, and driver features, environmental features, and activity features are extracted, which can improve the reliability of analysis and model training. The specific steps are as follows:
[0039] Step A1: Data collection: Extract all order datasets within the past 180 days from the database, including order basic information, driver information, and activity information, and preprocess the obtained data to eliminate dirty data, duplicate data, and missing values to ensure data quality;
[0040] Step A2: Feature extraction: Perform feature extraction on the preprocessed data, including extraction of driver features, environmental features, and activity features, and further includes the following steps:
[0041] Step A201: The driver features include the order completion volume feature, the average service score of the driver, and the number of days the driver has been on duty. The specific calculation formulas are as follows:
[0042]
[0043] Among them, Q driver,i is the historical order completion volume of driver i in the past m days, O i,k is the number of orders completed by driver i on the k-th day, S driver,i is the average service score of driver i, R ij is the score of the j-th order of driver i, N i is the total number of orders of driver i, T driver,i is the average driving duration of driver i, H i,j is the driving duration of driver i on the j-th order;
[0044] Step A202: The environmental features include the historical sequence of the number of drivers on duty within 14 days in the tenant of the city where the driver belongs, which is Q driver_count =[C k |k∈1,2,...,14] and the historical sequence of the order main single order placement, which is Q orders =[O k |k∈1,2,...,14]. Among them, C k represents the number of drivers on duty on the k-th day, and O k represents the order volume on the k-th day;
[0045] Step A203: The activity features include the number of days of the activity L activity , the number of drivers participating in the activity P num and the reward rule feature. The matrix R activity composed of the rules of the activities involved by the driver, including the reward strategy and the activity type. The specific calculation formulas are as follows:
[0046] L activity =T end -T start
[0047] R activity =[r 1 ,r 2 ,...,r α
[0048] Among them, L activity represents the number of days of the activity, T end and T start are the end and start times of the activity respectively, P num is the number of drivers participating in the activity, and r α represents the α-th activity rule.
[0049] Preferably, in step 102, according to the extracted features, an activity matrix participated by the driver and the order completion volume of the next day are obtained, and a neural network model based on the attention mechanism is constructed, which can provide personalized activity participation suggestions for the driver, enhance the driver's participation willingness and satisfaction, and improve the order completion volume. The specific steps are as follows:
[0050] Step B1, neural network model construction: According to the extracted features, generate an activity matrix A i (t + 1) reflecting the performance and participation of different drivers in specific activities, where A i (t + 1) represents the activity matrix participated by driver i on the next day. Taking the driver features, environmental features, and activity matrix as input feature vectors, it is expressed as: X = [Q driver , S driver , T driver , Q driver_count , Q orders , L activity , P num , R activity . The output is the prediction of the order completion volume of each driver on the next day, expressed as: Q expected (i, t + 1) = f(X i (t), A i (t + 1)); where X i (t) represents the feature information of the driver, A i (t + 1) represents the activity matrix, Q expected (i, t + 1) is the predicted order completion volume of driver i on the next day, Q driver is the order completion volume feature, S driver is the average service score of the driver, T driver is the number of days the driver has been on duty, Q driver_count = [C k |k ∈ 1, 2,..., 14] and Q orders = [O k |k ∈ 1, 2,..., 14] are respectively the historical sequences of the number of drivers on duty within 14 days and the historical sequences of the order main order sending within the tenant of the driver's city, L activity is the duration of the activity, P num is the number of drivers participating in the activity, and R activity is the reward rule feature matrix;
[0051] Step B2, model training: Divide the order data set into a training set, a validation set, and a test set. Use the training set to train the neural network model, and use the loss function to evaluate the difference between the predicted value and the actual order completion volume for model training. The loss function is Among them, V represents the total number of samples, and Q pred(h) represents the prediction result of the model degree for the h-th sample, Q actual (h) represents the actual completed order volume of the h-th sample.
[0052] Preferably, in step 103, extract the feature information of the day, substitute it into the neural network model to obtain the expected completed order volume of each driver, and estimate the intelligent marketing cost according to the predicted completed order volume and the cost function. By extracting features daily, the changes in the market and operation environment can be reflected in real time, improving the flexibility and timeliness of decision-making. The specific steps are as follows:
[0053] Step C1: Extract the expected completed order volume Q expected (i) of each driver from the model output. According to business requirements, set a cost function, which includes fixed costs, variable costs, and incentive costs related to the completed order volume. The specific calculation formula is: C i = C fixed + C variable + C incentive (Q expected (i)), where C i is the cost function of driver i, C fixed represents the fixed cost related to the marketing activity, C variable = c 1 ·L activity represents the variable cost related to the driver's participation and completion of the activity, c 1 is the unit variable cost, L activity represents the number of days of the activity, C incentive (Q expected (i)) = c 2 ·Q expected (i) is the incentive cost related to the completed order volume, c 2 is the incentive cost per order;
[0054] Step C2: Use the cost function defined in step C1 to calculate the marketing cost of each driver and summarize the costs of all drivers to obtain the estimated cost of the overall marketing activity. Based on the expected performance of the drivers, more targeted marketing activities can be designed to improve the satisfaction of drivers and customers. The specific calculation formula is as follows:
[0055]
[0056] Among them, C total is the overall estimated cost, z represents the total number of drivers participating in the activity, C fixed represents the fixed cost, c 1 is the unit variable cost, c 2 is the incentive cost per order, L activity represents the number of days of the activity, Q expected(i) represents the expected number of completed orders for driver i.
[0057] Embodiment 2
[0058] This embodiment provides an intelligent marketing cost estimation method based on the attention mechanism as Figure 1 shown, which specifically includes the following steps:
[0059] Step 101: Obtain all order data within the past 180 days from the database, and preprocess the obtained data to extract driver features, environmental features, and activity features;
[0060] Further, in step 101, to obtain all order data within the past 180 days from the database and preprocess the obtained data to extract driver features, environmental features, and activity features, the specific steps are as follows:
[0061] Step A1: Data collection: Extract all order data sets within the past 180 days from the database, including order basic information, driver information, and activity information, and preprocess the obtained data to eliminate dirty data, duplicate data, and missing values to ensure data quality;
[0062] Step A2: Feature extraction: Perform feature extraction on the preprocessed data, including driver feature extraction, environmental feature extraction, and activity feature extraction, which further includes the following steps:
[0063] Step A201: The driver features include the number of completed order features, the average service score of the driver, and the number of days the driver is on duty. The specific calculation formulas are as follows:
[0064]
[0065] Where Q driver,i is the historical number of completed orders of driver i within the past m days, O i,k is the number of orders completed by driver i on the kth day, S driver,i is the average service score of driver i, R ij is the score of the jth order of driver i, N i is the total number of orders of driver i, T driver,i is the average driving duration of driver i, H i,j is the driving duration of driver i on the jth order;
[0066] Step A202: The environmental features include the historical sequence of the number of on-duty drivers within 14 days in the tenant area of the city where the driver belongs, which is Q driver_count =[C k |k∈1,2,...,14] and the historical sequence of the order main order placement, which is Q orders =[O k|k ∈ 1, 2, ..., 14], where C k represents the number of drivers on duty on the k-th day, and O k represents the number of orders on the k-th day;
[0067] Step A203: The activity characteristics include the number of days of the activity L activity , the number of drivers participating in the activity P num and the reward rule characteristics. The matrix R activity formed by the rules of the activities involved by the drivers, including the reward strategy and the activity type, and the specific calculation formula is as follows:
[0068] L activity = T end - T start
[0069] R activity = [r 1 , r 2 , ..., r α
[0070] where L activity represents the number of days of the activity, T end and T start are the end and start times of the activity respectively, P num is the number of drivers participating in the activity, and r α represents the α-th activity rule.
[0071] Step 102: According to the extracted features, obtain the activity matrix participated by the driver and the number of completed orders on the next day, and construct a neural network model based on the attention mechanism;
[0072] Furthermore, in the said Step 102, according to the extracted features, obtain the activity matrix participated by the driver and the number of completed orders on the next day, and construct a neural network model based on the attention mechanism. The specific steps are as follows:
[0073] Step B1: Neural network model construction: According to the extracted features, generate the activity matrix A i (t + 1) participated by the driver, which reflects the performance and participation of different drivers in specific activities. Among them, A i (t + 1) represents the activity matrix participated by driver i on the next day. The driver features, environmental features, and activity matrix are used as input feature vectors, which are expressed as: The output is the prediction of the number of completed orders for each driver on the next day, which is expressed as: Q expected (i, t + 1) = f(X i (t), A i (t + 1)); where X i (t) represents the feature information of the driver, and A i (t + 1) represents the activity matrix, Q expected (i, t + 1) is the predicted number of completed orders for driver i on the next day, Q driver is the feature of the number of completed orders, S driver is the average service score of the driver, T driver is the number of days the driver has been on duty, Q driver_count = [C k | k ∈ 1, 2,..., 14] and Q orders = [O k | k ∈ 1, 2,..., 14] are respectively the historical sequence of the number of drivers on duty within 14 days and the historical sequence of the number of orders placed by the main senders of orders in the tenant of the city where the driver belongs, L activity is the duration of the activity, P num is the number of drivers participating in the activity, R activity is the reward rule feature matrix;
[0074] Step B2, Model training: Divide the order data set into a training set, a validation set and a test set, use the training set to train the neural network model, and use the loss function to evaluate the difference between the predicted value and the actual number of completed orders for model training. The loss function is where V represents the total number of samples, Q pred (h) represents the prediction result of the model for the h-th sample, Q actual (h) represents the actual number of completed orders of the h-th sample.
[0075] Step 103, Extract the feature information of the day, substitute it into the neural network model, obtain the expected number of completed orders for each driver, and perform intelligent marketing cost estimation according to the predicted number of completed orders and the cost function;
[0076] Further, in the said Step 103, extract the feature information of the day, substitute it into the neural network model, obtain the expected number of completed orders for each driver, and perform intelligent marketing cost estimation according to the predicted number of completed orders and the cost function. The specific steps are as follows:
[0077] Step C1, Extract the expected number of completed orders Q expected (i) of each driver from the model output. According to the business requirements, set a cost function, and the function includes fixed cost, variable cost and incentive cost related to the number of completed orders. The specific calculation formula is: C i = C fixed + C variable + C incentive (Q expected (i)), where C i is the cost function of driver i, C fixed represents the fixed cost related to the marketing activity, C variable = c 1 · Lactivity Represents the variable cost associated with the driver's participation and completion of activities, c 1 Is the unit variable cost, L activity Represents the number of days of the activity, C incentive (Q expected (i)) = c 2 ·Q expected (i) is the incentive cost associated with the number of completed orders, c 2 Is the incentive cost per order;
[0078] Step C2: Using the cost function defined in Step C1, calculate the marketing cost for each driver and sum up the costs of all drivers to obtain the estimated cost of the overall marketing activity. The specific calculation formula is as follows:
[0079]
[0080] Where, C total Is the overall estimated cost, z represents the total number of drivers participating in the activity, C fixed Represents the fixed cost, c 1 Is the unit variable cost, c 2 Is the incentive cost per order, L activity Represents the number of days of the activity, Q expected (i) represents the expected number of completed orders of driver i.
[0081] It should be noted that in the above embodiments, the descriptions of each embodiment have their own focuses. For the parts not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0082] Those skilled in the art should understand that the embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can adopt 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.
[0083] The present invention is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as the combination of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to the processors of general-purpose computers, special-purpose computers, embedded computers, or other programmable data processing devices to generate a machine, such that the instructions executed by the processors of the computer or other programmable data processing devices generate for implementing in the processFigure 1 one process or multiple processes and / or blocks Figure 1 means for the functions specified in one block or multiple blocks.
[0084] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured article including an instruction means, and the instruction means implements the processes Figure 1 one process or multiple processes and / or blocks Figure 1 the functions specified in one block or multiple blocks.
[0085] These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process. Thus, the instructions executed on the computer or other programmable device provide means for implementing the processes Figure 1 one process or multiple processes and / or blocks Figure 1 the steps of the functions specified in one block or multiple blocks.
[0086] Although the preferred embodiments of the present invention have been described, those skilled in the art can make additional changes and modifications once they learn the basic creative concepts. Therefore, the appended claims are intended to be construed as including the preferred embodiments and all changes and modifications falling within the scope of the present invention.
[0087] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention is also intended to include these modifications and variations.
Claims
1. An intelligent marketing cost estimation method based on attention mechanism, characterized in that: The specific steps include: Step 101: Obtain all order data in the past 180 days from the database, and pre-process the obtained data to extract driver characteristics, environmental characteristics, and activity characteristics; Step 102: Based on the extracted features, the activity matrix of the driver and the number of orders completed on the next day are obtained, and a neural network model based on the attention mechanism is constructed; Step 103: Extract the feature information of the day and substitute it into the neural network model to obtain the expected number of orders completed by each driver, and perform intelligent marketing cost estimation based on the predicted number of orders completed and the cost function.
2. The intelligent marketing cost estimation method based on the attention mechanism according to claim 1 is characterized by: In step 101, all order data in the past 180 days are obtained from the database, and the obtained data is preprocessed to extract driver characteristics, environmental characteristics and activity characteristics. The specific steps are as follows: Step A1, data collection: extract all order data sets from the past 180 days from the database, including basic order information, driver information, and activity information, and pre-process the acquired data to remove dirty data, duplicate data, and missing values to ensure data quality; Step A2, feature extraction: feature extraction is performed on the preprocessed data, including driver features, environmental features and activity features. The driver features include the number of completed orders, the average service score of the driver and the number of days the driver is out. The specific calculation formula is as follows: Among them, Q driver,i is the number of orders completed by driver i in the past m days, O i,k is the number of orders completed by driver i on day k, S driver,i is the average service rating of driver i, R ij is the score of driver i’s j-th order, N i is the total number of orders for driver i, T driver,i is the average driving time of driver i, H i,j is the driving time of driver i on the jth order.
3. According to claim 2, the intelligent marketing cost estimation method based on the attention mechanism is characterized in that: In the feature extraction of step A2, the environmental features include the historical sequence of the number of drivers dispatched within the tenant of the city to which the driver belongs within 14 days, Q driver_count =[C k |k∈1,2,...,14] and the order master order history sequence is Q orders =[O k |k∈1,2,...,14], where C k represents the number of drivers dispatched on the kth day, O k represents the order quantity on the kth day.
4. According to claim 2, the intelligent marketing cost estimation method based on the attention mechanism is characterized in that: In the feature extraction step A2, the activity features include the number of days of activity L activity , the number of drivers participating in the activity P num As well as the reward rule features, the matrix R consisting of the rules of the activities involved by the driver activity , including reward strategy and activity type. The specific calculation formula is as follows: L activity =T end -T start R activity =[r1,r2,...,r α ] Among them, L activity Indicates the number of days of activity, T end and T start are the end and start time of the activity, respectively, num is the number of drivers participating in the activity, r α Represents the αth activity rule.
5. According to claim 1, the intelligent marketing cost estimation method based on the attention mechanism is characterized in that: In step 102, based on the extracted features, the activity matrix of the driver and the number of orders completed on the next day are obtained, and a neural network model based on the attention mechanism is constructed. The specific steps are as follows: Step B1: Neural network model construction: Generate the activity matrix A including the driver’s participation based on the extracted features i (t+1), reflects the performance and participation of different drivers in specific activities, where A i (t+1) represents the activity matrix that driver i participates in on the next day. The driver characteristics, environmental characteristics and activity matrix are used as input feature vectors and expressed as: The output is the predicted number of orders completed by each driver on the next day, expressed as: Q expected (i,t+1)=f(X i (t),A i (t+1)); where X i (t) represents the characteristic information of the driver, A i (t+1) represents the activity matrix, Q expected (i,t+1) is the predicted number of orders completed by driver i on the next day, Q driver is the number of completed orders feature, S driver is the average service rating of the drivers, T driver is the number of days the driver is on duty, Q driver_count =[C k |k∈1,2,...,14] and Q orders =[O k |k∈1,2,...,14] are the historical sequence of the number of drivers dispatched within 14 days in the tenant city to which the driver belongs and the historical sequence of the main order. activity is the duration of the activity, P num is the number of drivers participating in the activity, R activity is the reward rule feature matrix; Step B2, model training: Divide the order data set into training set, validation set and test set, use the training set to train the neural network model, and use the loss function to evaluate the difference between the predicted value and the actual order quantity for model training.
6. According to claim 5, the intelligent marketing cost estimation method based on the attention mechanism is characterized in that: In the model training of step B2, a loss function is used to evaluate the difference between the predicted value and the actual number of completed orders to perform model training. The loss function is Among them, V represents the total number of samples, Q pred (h) represents the prediction result of the model for the hth sample, Q actual (h) represents the actual number of completed orders for the hth sample.
7. The intelligent marketing cost estimation method based on the attention mechanism according to claim 1 is characterized in that: In step 103, the characteristic information of the day is extracted and substituted into the neural network model to obtain the expected number of orders completed by each driver. Based on the predicted number of orders completed and the cost function, intelligent marketing cost estimation is performed. The specific steps are as follows: Step C1: Extract each driver’s expected order volume Q from the model output expected (i) According to business needs, a cost function is set, which includes fixed costs, variable costs and incentive costs related to the number of completed orders. The specific calculation formula is: C i =C fixed +C variable +C incentive (Q expected (i)), where C i is the cost function of driver i, C fixed represents the fixed costs associated with marketing activities, C variable =c1·L activity represents the variable cost associated with the driver's participation and completion of the activity, c1 is the unit variable cost, L activity Indicates the number of days of activity, C incentive (Q expected (i)) = c2·Q expected (i) is the incentive cost related to the number of completed orders, and c2 is the incentive cost per order; Step C2: Calculate the marketing cost of each driver using the cost function defined in step C1, and summarize the costs of all drivers to obtain the estimated cost of the overall marketing activity. The specific calculation formula is as follows: Among them, C total is the total estimated cost, z represents the total number of drivers participating in the activity, C fixed represents fixed cost, c1 is unit variable cost, c2 is incentive cost per order, L activity Indicates the number of days of activity, Q expected (i) represents the expected number of orders completed by driver i.