Gas station customer loyalty model training method and device and gas station customer loyalty model application method and device
By constructing a characteristic data set and linear regression model of the dimensions of gas stations, gas customers, and vehicles, the accuracy of gas station customer loyalty assessment is solved, and market loyalty assessment is achieved in the absence of competitor data, which improves the effectiveness of marketing strategies.
Patent Information
- Application Number
- CN202510272936.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-07
- Publication Date
- 2025-08-08
AI Technical Summary
It is difficult for the prior art to accurately evaluate the market loyalty of gas station customers, especially in the absence of competitor data, and traditional evaluation methods cannot reflect the loyalty of customers in the market.
By constructing a characteristic data set of gas stations, gas customers, and vehicle dimensions, combining a linear regression model, using customer refueling amount and freight vehicle trajectory data, customer loyalty scores are generated, and the gas station customer loyalty model is trained to achieve accurate assessment of customer loyalty.
Without competitor data, it can accurately reflect customer loyalty in the market and help gas stations adjust their marketing strategies to increase oil sales.
Smart Images

Figure CN120448802A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of machine learning technology, and in particular to a gas station customer loyalty model training method, application method, and device. Background Art
[0002] With the rapid development of the logistics industry, the demand for refueling for freight vehicles is increasing, and competition among gas stations is intensifying. In this application scenario, gas station managers need an effective method to evaluate and improve customer loyalty in order to maintain their competitive advantage.
[0003] In related technologies, customer loyalty assessments typically rely on aggregated statistical metrics, such as churn rate, customer retention rate, daily active users, weekly active users, monthly active users, and time interval between purchases. While these metrics can provide a macro overview of customer behavior, they struggle to accurately assess individual customer loyalty. Furthermore, while existing RFM user stratification models (R: time interval to last purchase, F: frequency of purchase, M: amount spent) can stratify customers based on their spending behavior at gas stations, such assessments are often limited to data from a single gas station, lack comparisons with competitors, and fail to accurately reflect customer loyalty within the market. Summary of the Invention
[0004] The embodiments of this application provide a gas station customer loyalty model training method, application method, and apparatus. To provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is provided below. This summary is not intended to be a comprehensive review, identify key or important elements, or delineate the scope of protection for these embodiments. Its sole purpose is to present some concepts in a simplified form, serving as a prelude to the detailed description that follows.
[0005] In a first aspect, an embodiment of the present application provides a method for training a gas station customer loyalty model, the method comprising:
[0006] Determine the station to be analyzed and the multiple competitor gas stations corresponding to the station;
[0007] Generate each customer's loyalty score to this station based on the collected customer refueling amount information and each competitor's gas station;
[0008] Determine the refueling stop details of each freight vehicle in the collected vehicle data based on the collected trajectory data of the freight vehicle and the refueling station fences included in the refueling station information;
[0009] Based on the refueling stop details of each freight vehicle, a feature dataset of gas stations, refueling customers, and vehicles is constructed;
[0010] By using the customer ID, each customer's loyalty score to the station is associated with the feature data sets of the gas station, refueling customer, and vehicle dimensions to obtain feature data and target data;
[0011] Preprocess the feature data to obtain model training data;
[0012] Create a linear regression model and train it based on the model training data to obtain the loyalty score of each customer predicted by the model. Calculate the model loss value based on each customer's loyalty score to this station and the loyalty score of each customer predicted by the model. When the model loss value reaches the minimum, the pre-trained gas station customer loyalty model is obtained.
[0013] Optionally, determine the station to be analyzed and multiple competitor gas stations corresponding to the station, including:
[0014] Collect gas station information and determine the station to be analyzed;
[0015] From the gas station information, obtain the first latitude and longitude of the current station and the second latitude and longitude of each first gas station within the preset range of the current station;
[0016] Calculating the straight-line distance between the current station and each first gas station based on the first longitude and latitude and the second longitude and latitude, selecting first gas stations whose straight-line distance is less than or equal to a preset maximum navigation distance, and obtaining a plurality of second gas stations;
[0017] The actual navigation distance between the station and each second gas station is calculated, and the second gas stations whose actual navigation distance is less than or equal to the preset maximum navigation distance are screened out to obtain multiple competitor gas stations corresponding to the station.
[0018] Optionally, based on the collected customer fuel amount information and each competitor's fuel station information, generate each customer's loyalty score for this station, including:
[0019] From the collected customer refueling amount information, count each customer's multiple first refueling amounts at the station, and each customer's multiple second refueling amounts at each competitor's gas station;
[0020] Calculate the ratio of the preset maximum loyalty score to the maximum gas payment amount at the local station and the competitor gas station to obtain the loyalty score per dollar spent by each customer. The maximum gas payment amount at the local station and the competitor gas station is the sum of the maximum value among the multiple first gas payment amounts and the maximum value among the multiple second gas payment amounts.
[0021] Calculate the product of each customer's loyalty score per dollar spent and the total amount of the first refueling to obtain each customer's loyalty score for this site.
[0022] Optionally, based on the collected trajectory data of the freight vehicles and the gas station fences included in the gas station information, the refueling stop details of each freight vehicle in the collected vehicle data are determined, including:
[0023] From the collected trajectory data of freight vehicles, the trajectory points with a speed of 0 in the collected vehicle data are filtered out, and the trajectory points with a time difference between the two preceding and following trajectory points equal to the preset trajectory reporting time interval are aggregated to obtain the stop details of each freight vehicle;
[0024] The stop details of each truck are associated with the gas station fence included in the gas station information to obtain the original stop details of each freight vehicle inside and outside the gas station;
[0025] Sort the stops according to their stop times in the original stop details to determine the inbound and outbound stops for each freight vehicle;
[0026] Obtain the stop points of each freight vehicle at the gas station based on the stop start time of each freight vehicle's inbound stop point and the outbound stop end time of each freight vehicle's outbound stop point;
[0027] From the stops of each freight vehicle at the gas station, filter out stops that are not within the range of the preset minimum and maximum refueling time;
[0028] The remaining stops after filtering are grouped according to their inbound stop start time and outbound stop end time, and the stop with the longest stop time is selected as the refueling stop details for each freight vehicle.
[0029] Optionally, based on the refueling stop details of each freight vehicle, construct a feature dataset for gas stations, refueling customers, and vehicles, including:
[0030] Associate the refueling stop details of each freight vehicle with the refueling customer ID data;
[0031] Based on the associated data, calculate the number of times each customer's vehicle refuels at this station and the number of times each customer's vehicle refuels at a competitor's gas station;
[0032] The number of refueling times at this station and the number of refueling times at competitors for each customer's vehicle are cumulatively summed to obtain the total number of refueling times at this station and competitors for each customer;
[0033] Calculate the first driving distance of each customer's car to the next gas station after refueling at this station;
[0034] Get the actual fuel consumption of each vehicle for each customer;
[0035] The first theoretical fuel consumption of each customer after refueling at the station is obtained by multiplying and summing the first driving distance corresponding to each vehicle of each customer and the actual fuel consumption of each vehicle of each customer;
[0036] Calculate the second driving distance of each customer's car to the next gas station after refueling at a competitor gas station;
[0037] The second theoretical fuel consumption of each customer after refueling at the competitor's gas station is obtained by multiplying the second driving distance corresponding to each customer's vehicle by the actual fuel consumption of each customer's vehicle and summing them up.
[0038] The first theoretical fuel consumption and the second theoretical fuel consumption of each customer are cumulatively added and calculated to obtain the theoretical fuel consumption of each customer after refueling at the current station and the competitor station;
[0039] Group by gas station ID and obtain the maximum theoretical fuel consumption of each customer after refueling at this station and the competitor's gas station, which is used as the maximum theoretical fuel consumption record;
[0040] Determine the total number of refueling times for each customer at this station and competitors corresponding to the maximum theoretical fuel consumption record, and obtain the maximum number of refueling times for the vehicle;
[0041] Based on the maximum theoretical fuel consumption record and the maximum number of refueling times of a vehicle, a feature dataset of gas stations, refueling customers, and vehicles is constructed.
[0042] Optionally, based on the maximum theoretical fuel consumption record and the maximum number of refueling times of a vehicle, a feature dataset is constructed for gas stations, refueling customers, and vehicles, including:
[0043] Based on the associated data, the number of times each freight vehicle refuels at this station and the total number of times each freight vehicle refuels at this station and competitors are counted respectively;
[0044] Based on the number of refueling times of each freight vehicle at this station and the total number of refueling times of each freight vehicle at this station and competitors, calculate the comparison value of the number of refueling times of this station and the comparison value of the number of refueling times of this station and competitors;
[0045] Determine the total distance traveled by each freight vehicle from this station to the next gas station, and obtain the total distance traveled from this station to the next gas station;
[0046] The fuel consumption of each freight vehicle is multiplied by the total distance traveled from this station to the next gas station to obtain the theoretical fuel consumption after refueling at this station;
[0047] Calculate the ratio between the theoretical fuel consumption after refueling at this station and the maximum theoretical fuel consumption record to obtain the theoretical fuel consumption comparison value after refueling at this station;
[0048] Sum the total distance traveled by each freight vehicle from this station to the next gas station and the total distance traveled by each freight vehicle from the competitor's gas station to the next gas station to obtain the total distance traveled from this station and the competitor's station to the next gas station;
[0049] The fuel consumption of each freight vehicle is multiplied by the total distance traveled from the current station and the competitor station to the next gas station to obtain the theoretical fuel consumption of each freight vehicle after refueling at the current station and the competitor station.
[0050] Calculate the ratio of the theoretical fuel consumption after refueling at the current station and the competitor's station to the maximum theoretical fuel consumption record for each freight vehicle, and obtain the theoretical fuel consumption comparison value after refueling at the current station and the competitor's station;
[0051] The number of refueling at this station, the comparison value of the number of refueling at this station, the total number of refueling at this station and the competitor's station for each freight vehicle, the comparison value of the number of refueling at this station and the competitor's station, vehicle fuel consumption, fuel type, the total distance traveled from this station to the next gas station, the total distance traveled from this station and the competitor's station to the next gas station, the theoretical fuel consumption after refueling at this station, the comparison value of the theoretical fuel consumption after refueling at this station, the theoretical fuel consumption after refueling at this station for each freight vehicle and the competitor's station, and the comparison value of the theoretical fuel consumption after refueling at this station and the competitor's station are used as feature data sets in the gas station, refueling customer, and vehicle dimensions.
[0052] Optionally, based on the number of refueling times of each freight vehicle at this station and the total number of refueling times at this station and competitors, calculate the comparison value of the number of refueling times at this station and the comparison value of the number of refueling times at this station and competitors, including:
[0053] Calculate the ratio between the number of refueling times of each freight vehicle at this station and the maximum number of refueling times of the vehicle to obtain the comparison value of the number of refueling times at this station;
[0054] Based on the associated data, calculate the number of times each freight vehicle refuels at competitor gas stations;
[0055] The number of times each freight vehicle refuels at this station and at a competitor's gas station is summed to obtain the total number of times each freight vehicle refuels at this station and at competitors;
[0056] Calculate the ratio of the total number of refueling times of each freight vehicle at this station and competitors to the maximum number of refueling times of the vehicle to obtain the comparison value of the number of refueling times of this station and competitors.
[0057] Optionally, preprocess the associated data, including:
[0058] The fuel type in the associated data is converted into a one-hot vector, and all parameters except the fuel type in the associated data are feature scaled and normalized to between 0 and 1 to obtain the final feature data used for training.
[0059] The feature data used for training is grouped according to gas station ID and customer ID to obtain feature data sets of multiple freight vehicles;
[0060] The feature data sets of multiple freight vehicles are used as model training data.
[0061] In a second aspect, an embodiment of the present application provides a model application method, the method comprising:
[0062] Obtain target freight vehicle trajectory data and customer data;
[0063] Based on the target freight vehicle's trajectory data and customer data, a feature dataset is constructed for the gas stations, refueling customers, and vehicles to be analyzed.
[0064] The feature data set of the gas station, refueling customers, and vehicle dimensions to be analyzed is input into a pre-trained gas station customer loyalty model to predict each customer's loyalty score to the gas station; the pre-trained gas station customer loyalty model is trained by the gas station customer loyalty model training method of any one of claims 1-8.
[0065] In a third aspect, an embodiment of the present application provides a gas station customer loyalty model training device, the device comprising:
[0066] The first determination module is used to determine the station to be analyzed and multiple competitor gas stations corresponding to the station;
[0067] The first generation module is used to generate each customer's loyalty score to the station based on the collected customer refueling amount information and each competitor gas station;
[0068] a second determining module for determining refueling stop details for each freight vehicle in the collected vehicle data based on the collected trajectory data and vehicle data of the freight vehicle and the refueling station fences included in the refueling station information;
[0069] A construction module is used to construct a feature dataset of gas stations, refueling customers, and vehicles based on the refueling stop details of each freight vehicle;
[0070] The association module uses the customer ID to associate each customer's loyalty score to the station with the feature data sets of the gas station, refueling customer, and vehicle dimensions to obtain feature data and target data;
[0071] The preprocessing module is used to preprocess the feature data to obtain model training data;
[0072] The training module is used to create a linear regression model and train the linear regression model based on the model training data to obtain the loyalty score of each customer predicted by the model. The model loss value is calculated based on each customer's loyalty score to this station and the loyalty score of each customer predicted by the model. When the model loss value reaches the minimum, the pre-trained gas station customer loyalty model is obtained.
[0073] The technical solutions provided by the embodiments of the present application may have the following beneficial effects:
[0074] In an embodiment of the present application, by analyzing the user's vehicle data and trajectory data, a feature data set of gas station, refueling customer, and vehicle dimensions can be constructed. When competitor data cannot be obtained, the feature data set can be used to analyze the relevant refueling information that characterizes this station and competitor gas stations. Combined with the pre-trained gas station customer loyalty model, it can accurately reflect the customer's loyalty in the market. Gas stations can adjust their marketing strategies based on customer loyalty, thereby increasing oil product sales.
[0075] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0076] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0077] Figure 1 This is a flow chart of a gas station customer loyalty model training method provided in an embodiment of the present application;
[0078] Figure 2 This is a flow chart of a model application method provided in an embodiment of the present application;
[0079] Figure 3 This is a structural diagram of a gas station customer loyalty model training device provided in an embodiment of the present application;
[0080] Figure 4 This is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0081] The following description and the drawings sufficiently illustrate specific embodiments of the application to enable those skilled in the art to practice them.
[0082] It should be clear that the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0083] When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are merely examples of devices and methods consistent with certain aspects of the present application, as detailed in the appended claims.
[0084] In the description of this application, it should be understood that the terms "first", "second", etc. are used for descriptive purposes only and should not be understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meanings of the above terms in this application can be understood according to specific circumstances. In addition, in the description of this application, unless otherwise specified, "multiple" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship.
[0085] This application provides a gas station customer loyalty model training method, application method, and device to address the problems existing in the above-mentioned related technical issues. In an embodiment of this application, by analyzing the user's vehicle data and trajectory data, a feature data set can be constructed for gas stations, refueling customers, and vehicle dimensions. When competitor data is unavailable, the feature data set can be used to analyze relevant refueling information that characterizes the gas station and competitor gas stations. Combined with a pre-trained gas station customer loyalty model, it can accurately reflect customer loyalty in the market. Gas stations can adjust their marketing strategies based on customer loyalty, thereby increasing oil product sales. The following uses an exemplary embodiment to explain this in detail.
[0086] This application provides a gas station customer loyalty model training method, application method and device to solve the problems existing in the above-mentioned related technical problems. Figure 1 -Attached Figure 2 This article details the gas station customer loyalty model training method provided in the embodiments of this application. This method can be implemented using a computer program and run on a gas station customer loyalty model training device based on the von Neumann architecture. This computer program can be integrated into an application or run as a standalone tool application.
[0087] See Figure 1 , provides a flow chart of a method for training a gas station customer loyalty model in accordance with an embodiment of the present application. Figure 1 As shown, the method of the embodiment of the present application may include the following steps:
[0088] S101, determining the station to be analyzed and multiple competitor gas stations corresponding to the station;
[0089] Here, this station refers to the specific gas station for which customer loyalty analysis is being conducted. Competitor gas stations refer to other gas stations that compete with this station and attract the same customer base.
[0090] In some embodiments of the present application, the specific process of determining the station to be analyzed and the multiple competitor gas stations corresponding to the station includes: collecting gas station information and determining the station to be analyzed; obtaining the first longitude and latitude of the station and the second longitude and latitude of each first gas station within the preset range of the station from the gas station information; calculating the straight-line distance between the station and each first gas station based on the first longitude and longitude and the second longitude and longitude, screening out the first gas stations whose straight-line distance is less than or equal to the preset maximum navigation distance, and obtaining multiple second gas stations; calculating the actual navigation distance between the station and each second gas station, screening out the second gas stations whose actual navigation distance is less than or equal to the preset maximum navigation distance, and obtaining multiple competitor gas stations corresponding to the station.
[0091] Gas station information includes the gas station ID, longitude, latitude, and perimeter fence. The first longitude and latitude refer to the location of the station. The second longitude and latitude refer to the location of potential competitor gas stations. The straight-line distance is the shortest distance between the station and a competitor, disregarding roads and terrain. The preset maximum navigation distance and preset range are set thresholds. The actual navigation distance is the distance between the station and the competitor, calculated based on actual roads and traffic regulations.
[0092] In some embodiments, a preset maximum navigation distance can be determined based on gas station requirements, and the straight-line distance between this station and other gas stations can be calculated using the longitude and latitude of the station, and gas stations with a straight-line distance less than or equal to the preset maximum navigation distance can be filtered out. Then, the navigation distance between this station and the filtered gas stations is calculated to be less than or equal to the preset maximum navigation distance, thereby obtaining multiple competitor gas stations.
[0093] For example, suppose there is a gas station X located in the northern part of the city, which serves as the local station for analysis. First, we need to collect the geographic location information of gas station X, including its longitude and latitude coordinates. We then retrieve the longitude and latitude coordinates of all gas stations in the northern part of the city from the gas station information database. These gas stations may be potential competitors of gas station X. Based on the longitude and latitude of gas station X and those of each potential competitor, we calculate the straight-line distance between them. Assuming a preset maximum navigation distance of 5 kilometers, we filter out all gas stations with a straight-line distance of 5 kilometers or less from gas station X. We then calculate the actual navigation distance between gas station X and each of these filtered gas stations. This actual navigation distance takes into account factors such as roads, traffic regulations, and terrain. We then filter out gas stations with an actual navigation distance of 5 kilometers or less. These gas stations are considered competitors of gas station X.
[0094] S102, generating a loyalty score for each customer to the gas station based on the collected customer refueling amount information and each competitor gas station;
[0095] The total amount of gas paid by a customer includes the customer ID, gas station ID, and total amount of gas paid. The loyalty score is a quantitative indicator used to measure the customer's loyalty to the station.
[0096] In some embodiments of the present application, the specific process of generating each customer's loyalty score to this station based on the collected customer refueling amount information and each competitor gas station includes: counting each customer's multiple first refueling amounts at this station and each customer's multiple second refueling amounts at each competitor gas station from the collected customer refueling amount information; calculating the ratio of the preset maximum loyalty score to the maximum refueling amount of this station and the competitor gas station to obtain the loyalty score corresponding to each customer's per yuan, and the maximum refueling amount of this station and the competitor gas station is the sum of the maximum value of the multiple first refueling amounts and the maximum value of the multiple second refueling amounts; calculating the product of the loyalty score corresponding to each customer's per yuan and the sum of the first refueling amounts to obtain the loyalty score of each customer to this station.
[0097] The first total refueling amount refers to the total amount of refueling spent by the customer at this station (the primary station being analyzed). The second total refueling amount refers to the total amount of refueling spent by the customer at competitor stations. The preset maximum loyalty score is a set value representing the highest possible customer loyalty score for a gas station, such as 100 or 10 points.
[0098] In some embodiments, a preset maximum loyalty score is determined. The customer ID is grouped, and the total amount of gas spent by each customer at the station and at competing gas stations is tallied from the collected total gas amount information. The loyalty score per dollar is calculated as: the preset maximum loyalty score / the maximum total gas amount spent at the station and at competing gas stations. The preset maximum loyalty score is assigned based on user needs and can be 10 or 100. The maximum total gas amount spent at the station and at competing gas stations refers to the maximum total gas amount spent at the station and at competing gas stations when the user has filled up at both the station and the competing gas station. This value is the maximum total gas amount spent at the station and at competing gas stations. Each customer's loyalty score for the station is calculated as: the loyalty score per dollar × the customer's total gas amount spent at the station.
[0099] S103, determining the refueling stop details of each freight vehicle in the collected vehicle data based on the collected trajectory data of the freight vehicle and the refueling station fences included in the refueling station information;
[0100] In some embodiments of the present application, the specific process of determining the refueling stop details of each freight vehicle in the collected vehicle data based on the collected trajectory data of the freight vehicle and the gas station fence included in the gas station information includes: filtering the trajectory points with a speed of 0 in the trajectory data of each freight vehicle in the collected vehicle data, and aggregating the trajectory points with a time difference between the two previous and next trajectory points equal to the preset trajectory reporting time interval to obtain the stop details of each freight vehicle; associating the stop details of each freight vehicle with the gas station fence included in the gas station information to obtain the original stop details of each freight vehicle inside and outside the gas station. ; Sort each stop point according to the stop time of each stop point in the original stop details to determine the entry stop point and exit stop point of each freight vehicle; obtain the stop points of each freight vehicle in the gas station according to the stop start time of the entry stop point and the exit stop end time of each freight vehicle; from the stop points of each freight vehicle in the gas station, filter out the stop points that are not within the range of the minimum and maximum values of the preset refueling time; group the remaining stop points after filtering according to the entry stop start time to the exit stop end time of the remaining stop points, and select the stop point with the longest stop time as the refueling stop details of each freight vehicle.
[0101] Freight vehicle trajectory data includes longitude, latitude, time, speed, and vehicle ID. A track point is a single record in the trajectory data. A track point with a speed of zero indicates a track record where the vehicle stopped at a certain point in time. The preset trajectory reporting interval is a system-set interval used to determine whether track points should be merged. If the time difference between two track points is equal to this interval, they may be merged. Stop details are processed records containing detailed information such as the time and location of vehicle stops. The gas station fence is a virtual boundary that defines the geographical scope of a gas station to determine whether a vehicle is within the gas station. The original stop details are the vehicle's stop details before being associated with the gas station fence information. Entry stops are stops where the vehicle enters the gas station and are determined by stop time. Exit stops are stops where the vehicle leaves the gas station and are also determined by stop time. Stops within the gas station are all stops made by the vehicle within the gas station, determined based on the entry and exit stops. The preset refueling duration is the minimum and maximum refueling time set by the system, which is used to filter out unreasonable stops. The refueling details are the detailed information of the stops that have been screened and determined to be refueling activities, including the start and end times of refueling.
[0102] In some embodiments, the collected vehicle data is filtered out of the trajectory data of each freight vehicle with a speed of 0. The continuous trajectory points (the time difference between the two points in the time sequence is equal to the trajectory reporting time interval) are then aggregated to calculate the stop details of each truck vehicle, including: vehicle ID, stop center longitude, stop center dimension, stop start time, stop end time, and stop duration. The stop details of each truck vehicle are left-linked with the gas station fence included in the gas station information to obtain the original stop details of each freight vehicle inside and outside the gas station. The stop points are sorted according to the stop time of each stop point in the original stop details to determine entry and exit stops. Entry stop: The previous stop is outside the gas station and the next stop is inside the gas station. Exit stop: The previous stop is inside the gas station and the next stop is outside the gas station. Based on the judged entry and exit stop times, the stop points of each freight vehicle in the gas station are determined, and then the stop points whose stop duration is not within the range of the minimum to maximum refueling time (the minimum and maximum refueling times are obtained according to the gas station requirements) are filtered out. The remaining stop points after filtering are grouped according to the entry stop start time to the exit stop end time of the remaining stop points after filtering, and the stop point with the longest stop duration is selected as the vehicle's refueling stop in the gas station. The vehicle's refueling stop in the gas station is used as the vehicle's refueling details, including: vehicle ID, gas station ID, gas station longitude, gas station latitude, refueling start time (refueling stop start time), and refueling end time (refueling stop end time).
[0103] S104: Based on the refueling stop details of each freight vehicle, a feature dataset of the refueling station, refueling customer, and vehicle dimensions is constructed;
[0104] In some embodiments of the present application, the specific process of constructing a feature data set in gas station, refueling customer, and vehicle dimensions based on the refueling stop details of each freight vehicle includes: associating the refueling stop details of each freight vehicle with the refueling customer ID data; calculating the number of refueling times of each vehicle of each customer at the local station and the number of refueling times of each vehicle of each customer at competitor gas stations based on the associated data; accumulating and summing the number of refueling times of each vehicle of each customer at the local station and the number of refueling times of each vehicle of each customer at competitor gas stations to obtain the total number of refueling times of each customer at the local station and competitor gas stations; calculating the first driving distance of each vehicle of each customer from refueling at the local station to the next gas station; obtaining the actual fuel consumption of each vehicle of each customer; producting the first driving distance corresponding to each vehicle of each customer with the actual fuel consumption of each vehicle of each customer and summing them to obtain the first theoretical fuel consumption of each customer after refueling at the local station; Calculate the second driving distance of each customer's vehicle from refueling at a competitor's gas station to the next gas station; product the second driving distance corresponding to each customer's vehicle with the actual fuel consumption of each customer's vehicle and sum them to obtain the second theoretical fuel consumption of each customer after refueling at a competitor's gas station; cumulatively add the first theoretical fuel consumption corresponding to each customer with the second theoretical fuel consumption to obtain the theoretical fuel consumption of each customer after refueling at this station and the competitor's station; group by each gas station ID to obtain the data with the maximum theoretical fuel consumption after refueling at this station and the competitor's gas station for each customer as the maximum theoretical fuel consumption record; determine the total number of refueling times at this station and the competitor for each customer corresponding to the maximum theoretical fuel consumption record to obtain the maximum number of refueling times for the vehicle; based on the maximum theoretical fuel consumption record and the maximum number of refueling times for the vehicle, construct a feature data set of gas station, refueling customer, and vehicle dimensions.
[0105] It should be noted that after associating the refueling stop details of freight vehicles with the refueling customer ID data, it can be understood as binding the refueling records of each customer and each vehicle with the customer identity information corresponding to the refueling stop details of the vehicle, so as to analyze the refueling behavior of each customer.
[0106] Among them, the total number of refueling times for each customer at this station and competitors reflects the customer's total refueling frequency at all relevant gas stations.
[0107] For example, when calculating the total number of refueling times for each customer at this station and competitors, first calculate the number of refueling times for each customer's vehicle at this station, which are N1,...,Nn (n is the number of the customer's vehicles), then count the number of refueling times for each customer's vehicle at competitors' gas stations, which are M1,...,Mn (n is the number of the customer's vehicles), and finally add up the number of refueling times for each customer's vehicle at this station and competitors' gas stations to obtain the total number of refueling times for each customer at this station and competitors, that is, SNM=N1+...+Nn+M1+...+Mn.
[0108] For example, to calculate the first theoretical fuel consumption for each customer's vehicle after refueling at this station, we first calculate the first distance traveled by each vehicle from this station to the next gas station, S1,...,Sn (n is the number of the customer's vehicles). Assuming a vehicle has two refueling stops at this station, the distances traveled to the downstream gas stations are 500 km and 700 km, respectively. The total distance traveled by this vehicle from this station to the next gas station is 1200 km. We then obtain each vehicle's actual fuel consumption data (e.g., liters of fuel per kilometer), O1,...,On (n is the number of the customer's vehicles). We then multiply the first distance traveled by the actual fuel consumption to obtain the theoretical fuel consumption for each customer's vehicle after refueling at this station. The sum of all these multiplication results yields the theoretical fuel consumption for each customer after refueling at this station. This represents the theoretical fuel consumption calculated based on the vehicle's actual fuel consumption after refueling at this station: L1 = S1*O1,...,Ln = Sn*On (n is the number of the customer's vehicles, L1...Ln is the theoretical fuel consumption of each vehicle after refueling at this station).
[0109] For example, to calculate the second theoretical fuel consumption of each customer's vehicle after refueling at a competitor gas station, calculate the second driving distance from each vehicle to the next gas station after refueling at the competitor gas station, D1,...,Dn, respectively (n is the number of the customer's vehicles). Multiply the second driving distance by the actual fuel consumption and sum them to obtain the theoretical fuel consumption of each customer after refueling at the competitor gas station: Q1 = D1*O1,...,Qn = Dn*On (n is the number of the customer's vehicles, and D1...Dn is the theoretical fuel consumption of each vehicle after refueling at the competitor gas station).
[0110] At this time, the theoretical fuel consumption of each customer after refueling at the station and the competitor's station can be SLQ=L1+...+Ln+Q1+...+Qn.
[0111] For example, when calculating the maximum theoretical fuel consumption record and the maximum number of refueling times for a vehicle, group them by gas station ID and filter out the data of the maximum theoretical fuel consumption for each customer after refueling at this station and the competitor's gas station. Based on the maximum theoretical fuel consumption record SLQmax, determine the corresponding "maximum number of refueling times for the vehicle", that is, the total number of refueling times SNMmax of the customer at this station and the competitor's gas station under this record.
[0112] In some embodiments of the present application, the specific process of constructing a feature data set of gas station, refueling customer, and vehicle dimensions based on the maximum theoretical fuel consumption record and the maximum number of refueling times of the vehicle includes: according to the associated data, counting the number of refueling times of each freight vehicle at this station and the total number of refueling times of each freight vehicle at this station and competitors respectively; calculating the refueling number comparison value of this station and the refueling number comparison value of this station and competitors based on the number of refueling times of each freight vehicle at this station and the total number of refueling times of each freight vehicle at this station and competitors; determining the total distance traveled from this station to the next gas station for each freight vehicle to obtain the total distance traveled from this station to the next gas station; producting the vehicle fuel consumption of each freight vehicle with the total distance traveled from this station to the next gas station to obtain the theoretical fuel consumption after refueling at this station; calculating the ratio between the theoretical fuel consumption after refueling at this station and the maximum theoretical fuel consumption record to obtain the theoretical fuel consumption comparison value after refueling at this station; and comparing the total distance traveled from this station to the next gas station for each freight vehicle to the total distance traveled from the competitor gas station to the next gas station. The total distance is summed up to obtain the total distance traveled from this station and the competitor's station to the next gas station; the vehicle fuel consumption of each freight vehicle is multiplied by the total distance traveled from this station and the competitor's station to the next gas station to obtain the theoretical fuel consumption of each freight vehicle after refueling at this station and the competitor's station; the ratio between the theoretical fuel consumption of each freight vehicle after refueling at this station and the competitor's station and the maximum record of theoretical fuel consumption is calculated to obtain the comparison value of the theoretical fuel consumption after refueling at this station and the competitor's station; the number of refueling at this station, the comparison value of the number of refueling at this station, the total number of refueling at this station and the competitor for each freight vehicle, the comparison value of the number of refueling at this station and the competitor, vehicle fuel consumption, fuel type, the total distance traveled from this station to the next gas station, the total distance traveled from this station and the competitor's station to the next gas station, the theoretical fuel consumption after refueling at this station, the comparison value of the theoretical fuel consumption after refueling at this station, the theoretical fuel consumption after refueling at this station and the competitor's station for each freight vehicle, and the comparison value of the theoretical fuel consumption after refueling at this station and the competitor's station are used as feature data sets of gas station, refueling customer, and vehicle dimensions.
[0113] The number of refueling stops at this station is N, and the total distance traveled by each freight vehicle from this station to the next refueling station is S. For example, if a vehicle refuels twice from this station and travels 500 km and 700 km to the downstream refueling station, the total distance traveled by the vehicle after refueling at this station to the next refueling station is 1200 km. The vehicle's fuel consumption, obtained from the collected vehicle information, is O. The theoretical fuel consumption after refueling at this station is L = S * O. The theoretical fuel consumption comparison value after refueling at this station is L / SLQmax.
[0114] Among them, the total distance traveled by each freight vehicle from this station to the next gas station is D, the total distance traveled by each freight vehicle from the competitor gas station to the next gas station is S, and the total distance traveled from this station and the competitor station to the next gas station is SD=S+D.
[0115] Among them, the vehicle fuel consumption of each freight vehicle is O, and the total driving distance from this station and the competitor station to the next gas station is SD. At this time, the theoretical fuel consumption of each freight vehicle after refueling at this station and the competitor station is LQ=SD×O.
[0116] Among them, when calculating the comparison value of the theoretical fuel consumption after refueling at this station and the competitor's station, the theoretical fuel consumption of each freight vehicle after refueling at this station and the competitor's station is LQ, and the maximum theoretical fuel consumption is recorded as SLQmax. At this time, the comparison value of the theoretical fuel consumption after refueling at this station and the competitor's station = LQ / SLQmax.
[0117] In some embodiments of the present application, the specific process of calculating the refueling number comparison value of this station and the refueling number comparison value of this station and competitors based on the number of refueling times of each freight vehicle at this station and the total number of refueling times of this station and competitors includes: calculating the ratio between the number of refueling times of each freight vehicle at this station and the maximum number of refueling times of the vehicle to obtain the refueling number comparison value of this station; calculating the number of refueling times of each freight vehicle at competitor gas stations based on associated data; summing the number of refueling times of each freight vehicle at this station and the number of refueling times of competitor gas stations to obtain the total number of refueling times of this station and competitors for each freight vehicle; calculating the ratio between the total number of refueling times of this station and competitors for each freight vehicle and the maximum number of refueling times of the vehicle to obtain the refueling number comparison value of this station and competitors.
[0118] Among them, the number of times each freight vehicle refuels at this station is N, and the maximum number of times a vehicle refuels is SNMmax. At this time, the comparison value of the number of times refueled at this station = N / SNMmax.
[0119] Among them, the number of times each freight vehicle refuels at the competitor's gas station is M, and the maximum number of times a vehicle refuels is SNMmax. At this time, the comparison value of the number of times this station refuels and the competitor's refueling = (N+M) / SNMmax.
[0120] S105 , using the customer ID, associate each customer's loyalty score to the station with the feature data sets of the gas station, gas customer, and vehicle dimensions to obtain feature data and target data;
[0121] Among them, feature data (such as number of refueling, fuel consumption, distance, etc.) is the input of the model, and target data (loyalty score) is the output that the model needs to predict or explain.
[0122] In some embodiments of the present application, a multidimensional dataset (gas station, refueling customer, and vehicle dimensions) is constructed, including the following features: number of refueling visits at this station, comparison value of the number of refueling visits at this station, total number of refueling visits at this station and competitors, comparison value of the number of refueling visits at this station and competitors, vehicle fuel consumption, fuel type, total distance traveled from this station to the next gas station, theoretical fuel consumption after refueling at this station, comparison value of theoretical fuel consumption after refueling at this station, theoretical fuel consumption after refueling at this station and competitors, and comparison value of theoretical fuel consumption after refueling at this station and competitors. These feature data reflect customers' refueling behavior and preferences. Each customer's loyalty score for this gas station is calculated. For example: Customer A's loyalty score is 80 points (out of 100). Customer B's loyalty score is 60 points. Customer C's loyalty score is 90 points. The loyalty score is the target data, used to measure customer loyalty to the gas station. Each customer's loyalty score is associated with the feature dataset. The specific steps are as follows: Extract customer ID: Extract each customer's unique identifier (customer ID) from the feature dataset. Matching Loyalty Scores: Based on the customer ID, each customer's loyalty score is matched with the corresponding record in the feature dataset. This ultimately yields a complete dataset of the same dimension, including feature data and target data.
[0123] S106, preprocessing the feature data to obtain model training data;
[0124] In some embodiments of the present application, the specific process of preprocessing the feature data includes: converting the fuel type in the associated data into one-hot vector data, and performing feature scaling on other parameters in the associated data except the fuel type so that they are normalized to between 0 and 1, thereby obtaining the feature data ultimately used for training; grouping the feature data ultimately used for training according to gas station ID and customer ID to obtain feature data sets of multiple freight vehicles; and using the feature data sets of multiple freight vehicles as model training data.
[0125] S107, creating a linear regression model, and training the linear regression model based on the model training data to obtain the loyalty score of each customer predicted by the model, and calculating the model loss value based on each customer's loyalty score to the station and the loyalty score of each customer predicted by the model. When the model loss value reaches the minimum, a pre-trained gas station customer loyalty model is obtained.
[0126] Among them, the expression of the linear regression model is:
[0127] is the predicted user loyalty score, n: is the number of features, x k : is the kth feature, θ l : is the lth model parameter, v: is the number of vehicles of the customer, which is expressed as follows after vectorization: θ: is the parameter vector of the model, θ T : is the transposed vector of θ.
[0128] Among them, the MSE (mean square error) cost function of the linear regression model is:
[0129]
[0130] In some embodiments, a linear regression model is trained using model training data to find the optimal model parameters, the model is evaluated using the MSE cost function, the generalization ability of the model is evaluated, the difference between the predicted results and the actual results is analyzed, the possible sources of error are found, the model parameters are adjusted based on the verification results, and the model training process is continued. When the cost function reaches a minimum, the model training is completed, and the trained model is used to predict new data to improve the accuracy of the prediction.
[0131] In an embodiment of the present application, by analyzing the user's vehicle data and trajectory data, a feature data set of gas station, refueling customer, and vehicle dimensions can be constructed. When competitor data cannot be obtained, the relevant refueling information characterizing this station and competitor gas stations can be analyzed through this feature data set. Combined with the pre-trained gas station customer loyalty model, it can accurately reflect the customer's loyalty in the market. Gas stations can adjust their marketing strategies based on customer loyalty, thereby increasing oil product sales.
[0132] See Figure 2 , provides a flow chart of a model application method for the embodiment of this application. Figure 2 As shown, the method of the embodiment of the present application may include the following steps:
[0133] S201, obtaining trajectory data and vehicle data of a target freight vehicle;
[0134] S202, constructing a feature dataset of gas stations, gas customers, and vehicles to be analyzed based on the target freight vehicle's trajectory data and vehicle data;
[0135] It should be noted that the feature datasets for gas stations, refueling customers, and vehicle dimensions to be analyzed in the model application scenario are consistent with the feature dataset generation process during the model training process and will not be repeated here.
[0136] S203: Input the feature data set of the gas station, refueling customer, and vehicle dimensions to be analyzed into a pre-trained gas station customer loyalty model to predict each customer's loyalty score to the gas station; the pre-trained gas station customer loyalty model is trained using a gas station customer loyalty model training method.
[0137] Among them, the feature data set of the gas station, refueling customer, and vehicle dimensions to be analyzed is a data set that includes feature data collected from the three dimensions of gas station, refueling customer, and vehicle.
[0138] In some embodiments of the present application, trajectory data of target freight vehicles is collected, including information such as the vehicle's route, stops, time, etc. At the same time, we also collect vehicle data, such as vehicle model, fuel type, etc. Based on the collected trajectory data and vehicle data, a feature dataset is constructed. This dataset may include information such as the vehicle's refueling frequency, refueling amount, mileage, vehicle type, etc. The constructed feature dataset is input into a pre-trained gas station customer loyalty model. The model will output a loyalty score for each customer. These scores can help gas stations understand the driver's loyalty to the gas station, so as to formulate corresponding incentives or service improvement plans.
[0139] In an embodiment of the present application, by analyzing the user's vehicle data and trajectory data, a feature data set of gas station, refueling customer, and vehicle dimensions can be constructed. When competitor data cannot be obtained, the feature data set can be used to analyze the relevant refueling information that characterizes this station and competitor gas stations. Combined with the pre-trained gas station customer loyalty model, it can accurately reflect the customer's loyalty in the market. Gas stations can adjust their marketing strategies based on customer loyalty, thereby increasing oil product sales.
[0140] The following are device embodiments of the present application, which can be used to implement the method embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments of the present application.
[0141] See Figure 3 , which shows a schematic diagram of the structure of a gas station customer loyalty model training device provided by an exemplary embodiment of the present application. The gas station customer loyalty model training device can be implemented as all or part of an electronic device through software, hardware, or a combination of both. The device includes a private dataset, a general model deployed for federated learning, and a local model. The general model is a model shared by all clients, and the local model is trained for local services. The device 1 includes a first determination module 10, a first generation module 20, a second determination module 30, a construction module 40, an association module 50, a preprocessing module 60, and a training module 70.
[0142] A first determination module 10 is used to determine the station to be analyzed and multiple competitor gas stations corresponding to the station;
[0143] The first generating module 20 is used to generate a loyalty score of each customer to the gas station based on the collected customer refueling amount information and each competitor gas station;
[0144] A second determining module 30 is configured to determine the refueling stop details of each freight vehicle in the collected vehicle data based on the collected trajectory data and vehicle data of the freight vehicle and the refueling station fences included in the refueling station information;
[0145] A construction module 40 is used to construct a feature dataset of gas station, gas customer, and vehicle dimensions based on the refueling stop details of each freight vehicle;
[0146] The association module 50 associates each customer's loyalty score to the station with the feature data sets of the gas station, gas customer, and vehicle dimensions through the customer ID to obtain feature data and target data;
[0147] A preprocessing module 60 is used to preprocess the feature data to obtain model training data;
[0148] The training module 70 is used to create a linear regression model and train the linear regression model based on the model training data to obtain the loyalty score of each customer predicted by the model. The model loss value is calculated based on each customer's loyalty score to the station and the loyalty score of each customer predicted by the model. When the model loss value reaches the minimum, a pre-trained gas station customer loyalty model is obtained.
[0149] It should be noted that the aforementioned embodiments of the gas station customer loyalty model training device, when implementing the gas station customer loyalty model training method, only illustrate the division of the aforementioned functional modules. In actual applications, the aforementioned functions can be assigned to different functional modules as needed, i.e., the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. Furthermore, the aforementioned embodiments of the gas station customer loyalty model training device and the gas station customer loyalty model training method embodiment are based on the same concept. The implementation process is detailed in the method embodiment and will not be further described here.
[0150] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0151] In an embodiment of the present application, by analyzing the user's vehicle data and trajectory data, a feature data set of gas station, refueling customer, and vehicle dimensions can be constructed. When competitor data cannot be obtained, the feature data set can be used to analyze the relevant refueling information that characterizes this station and competitor gas stations. Combined with the pre-trained gas station customer loyalty model, it can accurately reflect the customer's loyalty in the market. Gas stations can adjust their marketing strategies based on customer loyalty, thereby increasing oil product sales.
[0152] The present application also provides a computer-readable medium having program instructions stored thereon, which, when executed by a processor, implement the gas station customer loyalty model training method provided by the above-mentioned various method embodiments.
[0153] The present application also provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the gas station customer loyalty model training method of each of the above method embodiments.
[0154] See Figure 4 , is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 4 As shown, the electronic device 1000 may include: at least one processor 1001 , at least one network interface 1004 , a user interface 1003 , a memory 1005 , and at least one communication bus 1002 .
[0155] The communication bus 1002 is used to implement the connection and communication between these components.
[0156] The user interface 1003 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 1003 may also include a standard wired interface and a wireless interface.
[0157] The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0158] The processor 1001 may include one or more processing cores. The processor 1001 utilizes various interfaces and circuits to connect the various components within the entire electronic device 1000. By running or executing instructions, programs, code sets, or instruction sets stored in the memory 1005, and calling data stored in the memory 1005, the processor 1001 performs various functions of the electronic device 1000 and processes data. Optionally, the processor 1001 may be implemented in the form of at least one hardware component selected from the group consisting of a digital signal processing (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA). The processor 1001 may integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. The CPU primarily processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; and the modem is responsible for handling wireless communications. It is understood that the modem may not be integrated into the processor 1001 and may be implemented separately on a single chip.
[0159] Among them, the memory 1005 may include a random access memory (RAM) or a read-only memory (Read-Only Memory). Optionally, the memory 1005 includes a non-transitory computer-readable storage medium. The memory 1005 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 1005 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 1005 may also be optionally at least one storage system located away from the aforementioned processor 1001. As Figure 4 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a gas station customer loyalty model training application.
[0160] exist Figure 4In the electronic device 1000 shown, the user interface 1003 is mainly used to provide an input interface for the user and obtain user input data; and the processor 1001 can be used to call the gas station customer loyalty model training application stored in the memory 1005 and specifically perform the following operations:
[0161] Determine the station to be analyzed and the multiple competitor gas stations corresponding to the station;
[0162] Generate each customer's loyalty score to this station based on the collected customer refueling amount information and each competitor's gas station;
[0163] Determine the refueling stop details of each freight vehicle in the collected vehicle data based on the collected trajectory data of the freight vehicle and the refueling station fences included in the refueling station information;
[0164] Based on the refueling stop details of each freight vehicle, a feature dataset of gas stations, refueling customers, and vehicles is constructed;
[0165] By using the customer ID, each customer's loyalty score to the station is associated with the feature data sets of the gas station, refueling customer, and vehicle dimensions to obtain feature data and target data;
[0166] Preprocess the feature data to obtain model training data;
[0167] Create a linear regression model and train it based on the model training data to obtain the loyalty score of each customer predicted by the model. Calculate the model loss value based on each customer's loyalty score to this station and the loyalty score of each customer predicted by the model. When the model loss value reaches the minimum, the pre-trained gas station customer loyalty model is obtained.
[0168] In one embodiment, when determining the station to be analyzed and the multiple competitor gas stations corresponding to the station, the processor 1001 specifically performs the following operations:
[0169] Collect gas station information and determine the station to be analyzed;
[0170] From the gas station information, obtain the first latitude and longitude of the current station and the second latitude and longitude of each first gas station within the preset range of the current station;
[0171] Calculating the straight-line distance between the current station and each first gas station based on the first longitude and latitude and the second longitude and latitude, selecting first gas stations whose straight-line distance is less than or equal to a preset maximum navigation distance, and obtaining a plurality of second gas stations;
[0172] The actual navigation distance between the station and each second gas station is calculated, and the second gas stations whose actual navigation distance is less than or equal to the preset maximum navigation distance are screened out to obtain multiple competitor gas stations corresponding to the station.
[0173] In one embodiment, when the processor 1001 generates each customer's loyalty score for the gas station based on the collected customer refueling amount information and each competitor gas station, the processor 1001 specifically performs the following operations:
[0174] From the collected customer refueling amount information, count each customer's multiple first refueling amounts at the station, and each customer's multiple second refueling amounts at each competitor's gas station;
[0175] Calculate the ratio of the preset maximum loyalty score to the maximum gas payment amount at the local station and the competitor gas station to obtain the loyalty score per dollar spent by each customer. The maximum gas payment amount at the local station and the competitor gas station is the sum of the maximum value among the multiple first gas payment amounts and the maximum value among the multiple second gas payment amounts.
[0176] Calculate the product of each customer's loyalty score per dollar spent and the total amount of the first refueling to obtain each customer's loyalty score for this site.
[0177] In one embodiment, when determining the refueling stop details of each freight vehicle in the collected vehicle data based on the collected trajectory data of the freight vehicle and the refueling station fences included in the refueling station information, the processor 1001 specifically performs the following operations:
[0178] From the collected trajectory data of freight vehicles, the trajectory points with a speed of 0 in the collected vehicle data are filtered out, and the trajectory points with a time difference between the two preceding and following trajectory points equal to the preset trajectory reporting time interval are aggregated to obtain the stop details of each freight vehicle;
[0179] The stop details of each truck are associated with the gas station fence included in the gas station information to obtain the original stop details of each freight vehicle inside and outside the gas station;
[0180] Sort the stops according to their stop times in the original stop details to determine the inbound and outbound stops for each freight vehicle;
[0181] Obtain the stop points of each freight vehicle at the gas station based on the stop start time of each freight vehicle's inbound stop point and the outbound stop end time of each freight vehicle's outbound stop point;
[0182] From the stops of each freight vehicle at the gas station, filter out stops that are not within the range of the preset minimum and maximum refueling time;
[0183] The remaining stops after filtering are grouped according to their inbound stop start time and outbound stop end time, and the stop with the longest stop time is selected as the refueling stop details for each freight vehicle.
[0184] In one embodiment, when constructing a feature dataset of gas station, gas customer, and vehicle dimensions based on the refueling stop details of each freight vehicle, the processor 1001 specifically performs the following operations:
[0185] Associate the refueling stop details of each freight vehicle with the refueling customer ID data;
[0186] Based on the associated data, calculate the number of times each customer's vehicle refuels at this station and the number of times each customer's vehicle refuels at a competitor's gas station;
[0187] The number of refueling times at this station and the number of refueling times at competitors for each customer's vehicle are cumulatively summed to obtain the total number of refueling times at this station and competitors for each customer;
[0188] Calculate the first driving distance of each customer's car to the next gas station after refueling at this station;
[0189] Get the actual fuel consumption of each vehicle for each customer;
[0190] The first theoretical fuel consumption of each customer after refueling at the station is obtained by multiplying the first driving distance corresponding to each vehicle of each customer by the actual fuel consumption of each vehicle of each customer and summing them up;
[0191] Calculate the second driving distance of each customer's car to the next gas station after refueling at a competitor gas station;
[0192] The second theoretical fuel consumption of each customer after refueling at the competitor's gas station is obtained by multiplying the second driving distance corresponding to each customer's vehicle by the actual fuel consumption of each customer's vehicle and summing them up.
[0193] The first theoretical fuel consumption and the second theoretical fuel consumption corresponding to each customer are cumulatively added and calculated to obtain the theoretical fuel consumption of each customer after refueling at the station and the competitor station;
[0194] Group by gas station ID and obtain the maximum theoretical fuel consumption of each customer after refueling at this station and the competitor's gas station, which is used as the maximum theoretical fuel consumption record;
[0195] Determine the total number of refueling times for each customer at this station and competitors corresponding to the maximum theoretical fuel consumption record, and obtain the maximum number of refueling times for the vehicle;
[0196] Based on the maximum theoretical fuel consumption record and the maximum number of refueling times of a vehicle, a feature dataset of gas stations, refueling customers, and vehicles is constructed.
[0197] In one embodiment, when constructing a feature dataset of gas station, refueling customer, and vehicle dimensions based on the maximum theoretical fuel consumption record and the maximum number of refueling times of the vehicle, the processor 1001 specifically performs the following operations:
[0198] Based on the associated data, the number of times each freight vehicle refuels at this station and the total number of times each freight vehicle refuels at this station and competitors are counted respectively;
[0199] Based on the number of refueling times of each freight vehicle at this station and the total number of refueling times of each freight vehicle at this station and competitors, calculate the comparison value of the number of refueling times of this station and the comparison value of the number of refueling times of this station and competitors;
[0200] Determine the total distance traveled by each freight vehicle from this station to the next gas station, and obtain the total distance traveled from this station to the next gas station;
[0201] The fuel consumption of each freight vehicle is multiplied by the total distance traveled from this station to the next gas station to obtain the theoretical fuel consumption after refueling at this station;
[0202] Calculate the ratio between the theoretical fuel consumption after refueling at this station and the maximum theoretical fuel consumption record to obtain the theoretical fuel consumption comparison value after refueling at this station;
[0203] Sum the total distance traveled by each freight vehicle from this station to the next gas station and the total distance traveled by each freight vehicle from the competitor's gas station to the next gas station to obtain the total distance traveled from this station and the competitor's station to the next gas station;
[0204] The fuel consumption of each freight vehicle is multiplied by the total distance traveled from the current station and the competitor station to the next gas station to obtain the theoretical fuel consumption of each freight vehicle after refueling at the current station and the competitor station.
[0205] Calculate the ratio of the theoretical fuel consumption after refueling at the current station and the competitor's station to the maximum theoretical fuel consumption record for each freight vehicle, and obtain the theoretical fuel consumption comparison value after refueling at the current station and the competitor's station;
[0206] The number of refueling at this station, the comparison value of the number of refueling at this station, the total number of refueling at this station and the competitor's station for each freight vehicle, the comparison value of the number of refueling at this station and the competitor's station, vehicle fuel consumption, fuel type, the total distance traveled from this station to the next gas station, the total distance traveled from this station and the competitor's station to the next gas station, the theoretical fuel consumption after refueling at this station, the comparison value of the theoretical fuel consumption after refueling at this station, the theoretical fuel consumption after refueling at this station for each freight vehicle and the competitor's station, and the comparison value of the theoretical fuel consumption after refueling at this station and the competitor's station are used as feature data sets in the gas station, refueling customer, and vehicle dimensions.
[0207] In one embodiment, when the processor 1001 calculates the comparison value of the number of refueling times at the station and the comparison value of the number of refueling times at the station and the number of refueling times at competitors based on the number of refueling times of each freight vehicle at the station, the processor 1001 specifically performs the following operations:
[0208] Calculate the ratio between the number of refueling times of each freight vehicle at this station and the maximum number of refueling times of the vehicle to obtain the comparison value of the number of refueling times at this station;
[0209] Based on the associated data, calculate the number of times each freight vehicle refuels at competitor gas stations;
[0210] The number of times each freight vehicle refuels at this station and at a competitor's gas station is summed to obtain the total number of times each freight vehicle refuels at this station and at competitors;
[0211] Calculate the ratio of the total number of refueling times of each freight vehicle at this station and competitors to the maximum number of refueling times of the vehicle to obtain the comparison value of the number of refueling times of this station and competitors.
[0212] In one embodiment, when pre-processing the associated data, the processor 1001 specifically performs the following operations:
[0213] The fuel type in the associated data is converted into a one-hot vector, and all parameters except the fuel type in the associated data are feature scaled and normalized to between 0 and 1 to obtain the final feature data used for training.
[0214] The feature data used for training is grouped according to gas station ID and customer ID to obtain feature data sets of multiple freight vehicles;
[0215] The feature data sets of multiple freight vehicles are used as model training data.
[0216] In an embodiment of the present application, by analyzing the user's vehicle data and trajectory data, a feature data set of gas station, refueling customer, and vehicle dimensions can be constructed. When competitor data cannot be obtained, the feature data set can be used to analyze the relevant refueling information that characterizes this station and competitor gas stations. Combined with the pre-trained gas station customer loyalty model, it can accurately reflect the customer's loyalty in the market. Gas stations can adjust their marketing strategies based on customer loyalty, thereby increasing oil product sales.
[0217] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing related hardware through a computer program. The program for training a gas station customer loyalty model can be stored in a computer-readable storage medium. When executed, the program can include the processes in the above-described method embodiments. The storage medium can be a magnetic disk, an optical disk, a read-only memory, or a random access memory.
[0218] The above disclosure is only a preferred embodiment of the present application, and certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. A gas station customer loyalty model training method, characterized in that: The method comprises: Determine the station to be analyzed and multiple competitor gas stations corresponding to the station; Generate a loyalty score for each customer to the competitor gas station based on the collected customer gas payment information and each competitor gas station; Determine the refueling stop details of each freight vehicle in the collected vehicle data based on the collected trajectory data of the freight vehicle and the refueling station fences included in the refueling station information; Based on the refueling stop details of each freight vehicle, a feature dataset of refueling station, refueling customer, and vehicle dimensions is constructed; By using the customer ID, each customer's loyalty score to the station is associated with the feature data sets of the gas station, gas customer, and vehicle dimensions to obtain feature data and target data; Preprocess the feature data to obtain model training data; A linear regression model is created and trained based on the model training data to obtain a loyalty score for each customer predicted by the model. A model loss value is calculated based on the loyalty score of each customer to the station and the loyalty score of each customer predicted by the model. When the model loss value reaches a minimum, a pre-trained gas station customer loyalty model is obtained.
2. The method according to claim 1, characterized in that The determining of the station to be analyzed and the plurality of competitor gas stations corresponding to the station includes: Collect gas station information and determine the station to be analyzed; Obtaining, from the gas station information, the first latitude and longitude of the current station and the second latitude and longitude of each first gas station within a preset range of the current station; calculating, based on the first longitude and latitude and the second longitude and latitude, a straight-line distance between the current station and each of the first gas stations, and selecting first gas stations whose straight-line distance is less than or equal to a preset maximum navigation distance, to obtain a plurality of second gas stations; The actual navigation distance between the station and each second gas station is calculated, and the second gas stations whose actual navigation distance is less than or equal to the preset maximum navigation distance are screened out to obtain multiple competitor gas stations corresponding to the station.
3. The method according to claim 1, characterized in that The method generates a loyalty score for each customer to the station based on the collected customer refueling amount information and each competitor's gas station, including: From the collected customer refueling amount information, counting multiple first refueling amounts of each customer at the station, and multiple second refueling amounts of each customer at each competitor's gas station; Calculating the ratio of the preset maximum loyalty score to the maximum gas payment amount of the local station and the competitor gas station to obtain the loyalty score corresponding to each yuan spent by each customer, wherein the maximum gas payment amount of the local station and the competitor gas station is the sum of the maximum value of the multiple first gas payment amounts and the maximum value of the multiple second gas payment amounts; The product of the loyalty score corresponding to each yuan of each customer and the total of the first refueling amount is calculated to obtain the loyalty score of each customer to the station.
4. The method according to claim 1, wherein Based on the collected trajectory data of freight vehicles and the gas station fences included in the gas station information, the refueling stop details of each freight vehicle in the collected vehicle data are determined, including: From the collected trajectory data of freight vehicles, the trajectory points with a speed of 0 in the collected vehicle data are filtered out, and the trajectory points with a time difference between the two preceding and following trajectory points equal to the preset trajectory reporting time interval are aggregated to obtain the stop details of each freight vehicle; The stop details of each truck are associated with the gas station fence included in the gas station information to obtain the original stop details of each freight vehicle inside and outside the gas station; Sort the stops according to their stop times in the original stop details, and determine the inbound and outbound stops for each freight vehicle; Obtain the stop points of each freight vehicle in the gas station according to the stop start time of the inbound stop point and the outbound stop end time of the outbound stop point of each freight vehicle; Filtering, from the stop points of each freight vehicle at the gas station, the stop points that are not within the range of the minimum and maximum values of the preset refueling time; The remaining stops after filtering are grouped according to their inbound stop start time and outbound stop end time, and the stop with the longest stop time is selected as the refueling stop details for each freight vehicle.
5. The method according to claim 1, wherein According to the refueling stop details of each freight vehicle, a feature dataset of the refueling station, refueling customer, and vehicle dimensions is constructed, including: Associating the refueling stop details of each freight vehicle with the refueling customer ID data; Based on the associated data, the number of times each vehicle of each customer refuels at the local station and the number of times each vehicle of each customer refuels at the competitor's gas station are calculated respectively; The number of refueling times at the local station and the number of refueling times at the competitor corresponding to each vehicle of each customer are cumulatively summed to obtain the total number of refueling times at the local station and the competitor for each customer; Calculate the first driving distance of each vehicle of each customer to the next gas station after refueling at the said station; Get the actual fuel consumption of each vehicle for each customer; Producting the first driving distance corresponding to each vehicle of each customer with the actual fuel consumption of each vehicle of each customer and summing the two products to obtain a first theoretical fuel consumption of each customer after refueling at the station; Calculate the second driving distance of each vehicle of each customer to the next gas station after refueling at the competitor gas station; Producting the second driving distance corresponding to each vehicle of each customer with the actual fuel consumption of each vehicle of each customer and summing the two products to obtain a second theoretical fuel consumption of each customer after refueling at the competitor's gas station; Accumulating and summing the first theoretical fuel consumption and the second theoretical fuel consumption corresponding to each customer to obtain the theoretical fuel consumption of each customer after refueling at the current station and the competitor station; Group by gas station ID and obtain the maximum theoretical fuel consumption of each customer after refueling at this station and the competitor's gas station, which is used as the maximum theoretical fuel consumption record; Determine the total number of refueling times of each customer at the current station and competitors corresponding to the maximum theoretical fuel consumption record, and obtain the maximum number of refueling times for the vehicle; Based on the maximum theoretical fuel consumption record and the maximum number of refueling times of the vehicle, a feature dataset of gas station, refueling customer, and vehicle dimensions is constructed.
6. The method according to claim 5, characterized in that The feature datasets of the gas station, refueling customer, and vehicle dimensions are constructed based on the maximum theoretical fuel consumption record and the maximum number of refueling times of the vehicle, including: According to the associated data, the number of times each freight vehicle refuels at the station and the total number of times each freight vehicle refuels at the station and competitors are counted respectively; Calculate the comparison value of the number of refueling at the station and the comparison value of the number of refueling at the station and the number of refueling at the competitor based on the number of refueling times of each freight vehicle at the station and the total number of refueling times of each freight vehicle at the station and the competitor; Determine the total distance traveled by each freight vehicle from this station to the next gas station, and obtain the total distance traveled from this station to the next gas station; Product the fuel consumption of each freight vehicle by the total distance traveled from the station to the next gas station to obtain the theoretical fuel consumption after refueling at the station; Calculate the ratio between the theoretical fuel consumption after refueling at this station and the maximum theoretical fuel consumption record to obtain the theoretical fuel consumption comparison value after refueling at this station; Sum the total distance traveled by each freight vehicle from this station to the next gas station and the total distance traveled by each freight vehicle from the competitor's gas station to the next gas station to obtain the total distance traveled from this station and the competitor's station to the next gas station; The fuel consumption of each freight vehicle is multiplied by the total distance traveled from the current station and the competitor station to the next gas station to obtain the theoretical fuel consumption of each freight vehicle after refueling at the current station and the competitor station; Calculate the ratio of the theoretical fuel consumption after refueling at the current station and the competitor's station to the maximum theoretical fuel consumption record for each freight vehicle, and obtain the theoretical fuel consumption comparison value after refueling at the current station and the competitor's station; The number of refueling at this station, the comparison value of the number of refueling at this station, the total number of refueling at this station and the competitor's station for each freight vehicle, the comparison value of the number of refueling at this station and the competitor's station, vehicle fuel consumption, fuel type, the total distance traveled from this station to the next gas station, the total distance traveled from this station and the competitor's station to the next gas station, the theoretical fuel consumption after refueling at this station, the comparison value of the theoretical fuel consumption after refueling at this station, the theoretical fuel consumption after refueling at this station for each freight vehicle and the competitor's station, and the comparison value of the theoretical fuel consumption after refueling at this station and the competitor's station are used as feature data sets in the gas station, refueling customer, and vehicle dimensions.
7. The method according to claim 6, characterized in that The calculation of the comparison value of the number of refueling times at the station and the comparison value of the number of refueling times at the station and the number of refueling times at the competitor based on the number of refueling times of each freight vehicle at the station includes: Calculating the ratio between the number of times each freight vehicle refuels at the station and the maximum number of times the vehicle refuels, to obtain a comparison value of the number of times refueled at the station; Calculating the number of times each freight vehicle refuels at the competitor's gas station based on the associated data; The number of times each freight vehicle refuels at the local station and the number of times each freight vehicle refuels at the competitor's gas station is summed to obtain the total number of times each freight vehicle refuels at the local station and the competitor's gas station; The ratio of the total number of refueling times of the freight vehicle at the station and the competitors to the maximum number of refueling times of the vehicle is calculated to obtain a comparison value of the number of refueling times of the freight vehicle at the station and the competitors.
8. The method according to claim 1, characterized in that The preprocessing of the associated data includes: The fuel type in the associated data is converted into a one-hot vector, and all parameters except the fuel type in the associated data are feature scaled and normalized to between 0 and 1 to obtain the final feature data used for training. The feature data used for training is grouped according to gas station ID and customer ID to obtain feature data sets of multiple freight vehicles; The feature data sets of multiple freight vehicles are used as model training data.
9. A model application method, characterized in that: The method comprises: Obtain target freight vehicle trajectory data and customer data; Based on the trajectory data and customer data of the target freight vehicle, a feature dataset of the gas station, gas customer, and vehicle dimensions to be analyzed is constructed; The feature data set of the gas station, refueling customers, and vehicle dimensions to be analyzed is input into a pre-trained gas station customer loyalty model to predict each customer's loyalty score to the gas station; the pre-trained gas station customer loyalty model is trained using the gas station customer loyalty model training method described in any one of claims 1-8.
10. A gas station customer loyalty model training device, characterized in that: The device comprises: A first determination module is used to determine a station to be analyzed and a plurality of competitor gas stations corresponding to the station; The first generating module is used to generate a loyalty score of each customer to the gas station based on the collected customer refueling amount information and each competitor gas station; a second determining module for determining refueling stop details for each freight vehicle in the collected vehicle data based on the collected trajectory data and vehicle data of the freight vehicle and the refueling station fences included in the refueling station information; A construction module is used to construct a feature dataset of gas station, refueling customer, and vehicle dimensions based on the refueling stop details of each freight vehicle; The association module associates each customer's loyalty score to the station with the feature data sets of the gas station, gas customer, and vehicle dimensions through the customer ID to obtain feature data and target data; The preprocessing module is used to preprocess the feature data to obtain model training data; The training module is used to create a linear regression model and train the linear regression model based on the model training data to obtain the loyalty score of each customer predicted by the model, calculate the model loss value based on the loyalty score of each customer to the station and the loyalty score of each customer predicted by the model, and obtain the pre-trained gas station customer loyalty model when the model loss value reaches the minimum.