Gas station data prediction method and device based on machine learning, and terminal equipment
By combining the gas station data and machine learning model, dynamically adjust the prediction model, solve the problem of insufficient accuracy of traditional methods, and achieve more accurate resource allocation support.
Patent Information
- Application Number
- CN202411943141.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-01-28
AI Technical Summary
The existing gas station data prediction methods rely on traditional machine learning models and fail to fully explore the deep features and complex relationships of the data, resulting in insufficient prediction accuracy and affecting the accuracy of resource allocation.
By obtaining the historical data and related characteristics of the target items of the gas station, the data cluster is performed to identify the data trend. Based on machine learning, the initial prediction model is generated, and the initial prediction model is generated. To adapt to different environments and conditions.
It significantly improves the accuracy of the data prediction of gas station, provides more accurate resource allocation data support, and solves the problem of insufficient accuracy of the prediction balance index.
Smart Images

Figure CN119378761A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data prediction technology, and in particular to a gas station data prediction method, device and terminal equipment based on machine learning. Background Art
[0002] In gas station operations, the allocation of target items such as fuel and goods is crucial, which directly affects the operating efficiency and service quality of gas stations. At present, the industry generally adopts historical equilibrium index data to predict future demand and guide resource allocation. However, existing methods mainly rely on traditional machine learning models. Although these models can capture the basic patterns of data, they fail to fully explore the deep characteristics and complex associations of data. Existing models often lack effective processing mechanisms, resulting in limited prediction accuracy, which in turn affects the accuracy of subsequent resource allocation based on the prediction results. Summary of the invention
[0003] The main purpose of the embodiments of the present invention is to provide a gas station data prediction method, device and terminal device based on machine learning, aiming to solve the problem of insufficient accuracy in predicting the equilibrium index in the related technology, which in turn affects the allocation of resources.
[0004] In a first aspect, an embodiment of the present invention provides a gas station data prediction method based on machine learning, comprising:
[0005] Obtaining historical feature data corresponding to a target item at a target gas station and first related feature data corresponding to the historical feature data, wherein the historical feature data refers to a first factor affecting a target prediction equilibrium index, and the first related feature data refers to a second factor affecting the target prediction equilibrium index, wherein the target prediction equilibrium index is used to characterize the number of tradable items predicted for the target item at the target gas station;
[0006] Performing data clustering on the historical feature data to obtain a target clustering result;
[0007] Obtaining second relevant feature data corresponding to each first subclass cluster in the target clustering result from the first relevant feature data;
[0008] Performing data fitting on the first subclass cluster based on machine learning to obtain an initial prediction model;
[0009] Obtaining a target predicted time corresponding to the target item at the target gas station, and obtaining third related feature data corresponding to the target predicted time;
[0010] Obtaining a target prediction model corresponding to the target item from the initial prediction model according to the second relevant feature data and the third relevant feature data;
[0011] The target prediction time is predicted according to the target prediction model to obtain the target prediction equilibrium index corresponding to the target item at the target prediction time.
[0012] In a second aspect, an embodiment of the present invention provides a gas station data prediction device based on machine learning, comprising:
[0013] A data collection module, used to obtain historical feature data corresponding to a target item at a target gas station and first related feature data corresponding to the historical feature data, wherein the historical feature data refers to a first factor affecting a target prediction equilibrium index, and the first related feature data refers to a second factor affecting the target prediction equilibrium index, and the target prediction equilibrium index is used to characterize the number of tradable items predicted for the target item at the target gas station;
[0014] A data clustering module, used for performing data clustering on the historical feature data to obtain a target clustering result;
[0015] A data analysis module, configured to obtain second relevant feature data corresponding to each first subclass cluster in the target clustering result from the first relevant feature data;
[0016] A data fitting module, used for performing data fitting on the first subclass cluster based on machine learning to obtain an initial prediction model;
[0017] A data acquisition module, used to obtain a target prediction time corresponding to the target item of the target gas station, and obtain third related feature data corresponding to the target prediction time;
[0018] A model selection module, configured to obtain a target prediction model corresponding to the target item from the initial prediction model according to the second relevant feature data and the third relevant feature data;
[0019] The data prediction module is used to perform data prediction on the target prediction time according to the target prediction model, and obtain the target prediction equilibrium index corresponding to the target item at the target prediction time.
[0020] In a third aspect, an embodiment of the present invention further provides a terminal device, comprising a processor, a memory, a computer program stored in the memory and executable by the processor, and a data bus for realizing connection and communication between the processor and the memory, wherein when the computer program is executed by the processor, the steps of any one of the gas station data prediction methods based on machine learning provided in the specification of the present invention are implemented.
[0021] The embodiment of the present invention provides a gas station data prediction method, device and terminal device based on machine learning, the method comprising: obtaining historical feature data corresponding to a target item of a target gas station and first related feature data corresponding to the historical feature data, the historical feature data refers to a first factor affecting a target prediction equilibrium index, the first related feature data refers to a second factor affecting a target prediction equilibrium index, and the target prediction equilibrium index is used to characterize the number of tradable items predicted for the target item at the target gas station; performing data clustering on the historical feature data to obtain a target clustering result; obtaining second related feature data corresponding to each first subclass cluster in the target clustering result from the first related feature data; performing data fitting on the first subclass cluster based on machine learning to obtain an initial prediction model; obtaining a target prediction time corresponding to the target item of the target gas station, and obtaining third related feature data corresponding to the target prediction time; obtaining a target prediction model corresponding to the target item from the initial prediction model according to the second related feature data and the third related feature data; performing data prediction on the target prediction time according to the target prediction model, and obtaining a target prediction equilibrium index corresponding to the target item at the target prediction time. The method can classify similar feature data into the same subclass cluster by performing data clustering on the historical feature data. This cluster analysis helps to identify the changing trends of the target items, thereby improving the accuracy of the prediction model. Fitting the feature data of each subclass cluster based on machine learning can capture similar patterns and trends, thereby generating a more accurate initial prediction model, and then obtaining the target prediction model from the initial prediction model based on the second related feature data and the third related feature data. This dynamic adjustment enables the prediction model to adapt to different environments and condition changes, so that the target prediction time is predicted through the target prediction model, and the target prediction equilibrium index of the target item at the target prediction time is obtained. This method can significantly improve the accuracy of the equilibrium index prediction, thereby providing good data support for the subsequent resource allocation of gas stations. This method also solves the problem of insufficient accuracy in predicting the equilibrium index in related technologies, which in turn affects the allocation of resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0023] Figure 1 A flow chart of a gas station data prediction method based on machine learning provided by an embodiment of the present invention;
[0024] Figure 2A schematic diagram of the module structure of a gas station data prediction device based on machine learning provided by an embodiment of the present invention;
[0025] Figure 3 A schematic block diagram of the structure of a terminal device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0026] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0027] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.
[0028] It should be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0029] The embodiment of the present invention provides a gas station data prediction method, device and terminal device based on machine learning. The gas station data prediction method based on machine learning can be applied to a terminal device, which can be an electronic device such as a tablet computer, a laptop computer, a desktop computer, a personal digital assistant and a wearable device. The terminal device can be a server or a server cluster.
[0030] Some embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0031] Please refer to Figure 1 , Figure 1 A flow chart of a gas station data prediction method based on machine learning provided in an embodiment of the present invention.
[0032] like Figure 1 As shown, the gas station data prediction method based on machine learning includes steps S101 to S107.
[0033] Step S101, obtaining historical feature data corresponding to a target item at a target gas station and first related feature data corresponding to the historical feature data, wherein the historical feature data refers to a first factor affecting a target prediction equilibrium index, and the first related feature data refers to a second factor affecting the target prediction equilibrium index, and the target prediction equilibrium index is used to characterize the number of tradable items predicted for the target item at the target gas station.
[0034] Exemplarily, historical feature data corresponding to a target item in a target gas station is obtained from a database, where the target item may be an oil product or a non-oil product, and first related feature data corresponding to the historical feature data is obtained from the database.
[0035] For example, the historical feature data can be the number of items that have been sold for the target item at the target gas station, or the minimum number of items that are required to be dispatched for the target item at the target gas station. The historical feature data is a direct factor that affects the target prediction equilibrium index, that is, the number of items that have been sold for the target item at the historical time.
[0036] Exemplarily, the first relevant characteristic data includes, but is not limited to, competitive situation data such as oil prices and promotion information of surrounding competitors, traffic dynamics data such as public transportation flow, road congestion index, marketing-related data such as social media trends, user reviews, customer segmentation portraits, and policy change information such as license plate travel restrictions and environmental protection supervision information. The first relevant characteristic data refers to the indirect factors that affect the target prediction equilibrium index, that is, the equilibrium index corresponding to the target item in historical time changes due to the influence of the first relevant characteristic data.
[0037] Exemplarily, the target prediction equilibrium index is used to characterize the number of tradable items predicted for the target item at the target gas station, that is, the target prediction equilibrium index is used to characterize the minimum number of items predicted to be equipped for the target item at the target gas station.
[0038] Step S102: clustering the historical feature data to obtain a target clustering result.
[0039] Exemplarily, a clustering algorithm is used to perform data clustering on the historical feature data of the target item, thereby obtaining a target clustering result corresponding to the historical feature data.
[0040] In some embodiments, the data clustering of the historical feature data to obtain a target clustering result includes: calculating the local density corresponding to any first sub-feature data in the historical feature data, and determining the initial cluster center corresponding to the historical feature data according to the local density; calculating the distance information between the initial cluster center and other data in the historical feature data, and performing data clustering on the historical feature data according to the distance information and the initial cluster center to obtain an initial clustering result; determining the correlation between the second sub-feature data in each second sub-cluster in the initial clustering result and the cluster center corresponding to the second sub-cluster; adjusting the initial clustering result according to the correlation to obtain the target clustering result; wherein the local density is obtained according to the following formula:
[0041]
[0042] in, represents the local density corresponding to the i-th first sub-feature data, num represents the total data volume corresponding to the historical feature data, represents the i-th first sub-feature data, represents the j-th first sub-feature data, Represents the first sub-feature data of the i-th and the jth first sub-feature data The distance information between Indicates the preset threshold value, Indicates when Greater than or equal to hour, The corresponding function value is 1; when hour, The corresponding function value is 0, and dis indicates the distance calculation method.
[0043] For example, local density refers to the density of a certain historical feature data in its neighborhood, which is usually measured by calculating the number of other data points within a certain distance around the data point. The calculation of local density can be implemented in many ways, such as based on Euclidean distance, Manhattan distance, etc. Select any first sub-feature data from the historical feature data as the data point currently being processed, and then obtain the local density corresponding to the first sub-feature data according to the following formula:
[0044]
[0045] in, represents the local density corresponding to the first sub-feature data of the ith element, num represents the total amount of data corresponding to the historical feature data, represents the i-th first sub-feature data, represents the jth first sub-feature data, Represents the i-th first sub-feature data and the jth first sub-feature data The distance information between Indicates the preset threshold value, Indicates when Greater than or equal to hour, The corresponding function value is 1; when hour, The corresponding function value is 0, and dis represents the distance calculation method, such as Euclidean distance, Manhattan distance, etc.
[0046] Exemplarily, based on the calculated local density, data points with higher local density are selected as initial cluster centers. Data points with higher local density usually indicate that these data points are in a relatively dense area in the data set and are suitable as cluster centers. Based on the distribution of local density, multiple data points with higher local density are selected as initial cluster centers. The number of initial cluster centers usually needs to be determined based on the size and complexity of the data set.
[0047] Exemplarily, for each initial cluster center, the distance between it and other data points in the historical feature data is calculated. The distance can be calculated using common distance measurement methods such as Euclidean distance and Manhattan distance. For each data point in the historical feature data, according to the distance between it and the initial cluster center, it is assigned to the cluster to which the nearest cluster center belongs. By comparing the distance between each data point and all initial cluster centers, the cluster center with the smallest distance can be selected as the affiliation of the data point. Then, through the above allocation process, all data points in the historical feature data are assigned to the corresponding clusters to form an initial clustering result.
[0048] Exemplarily, the degree of association refers to the similarity or proximity between the data points in the cluster and the cluster center. The degree of association can be measured by calculating the distance between the data points and the cluster center. The smaller the distance, the higher the degree of association. For each second sub-cluster in the initial clustering result, the distance between each second sub-feature data and the cluster center is calculated as the degree of association. For example, the degree of association is calculated using the Euclidean distance or the Manhattan distance.
[0049] Exemplarily, the initial clustering result is adjusted according to the correlation between each second sub-feature data and the cluster center, and data points with low correlation may need to be reallocated to other clusters to optimize the clustering result to obtain the final target clustering result.
[0050] In some embodiments, the calculating the distance information between the initial cluster center and other data in the historical feature data includes: obtaining the remaining data corresponding to the exclusion of the other data from the historical feature data; calculating the first distance between the initial cluster center and the remaining data, and calculating the second distance between the other data and the remaining data; calculating the difference between the first distance and the second distance to obtain a distance difference, and determining the distance information between the initial cluster center and the other data in the historical feature data according to the distance difference; wherein the distance information is obtained according to the following formula:
[0051]
[0052] in, Represents the i-th initial cluster center and the other data mentioned in the jth The distance information between represents the tth remaining data, number represents the amount of data corresponding to the remaining data, Represents the initial cluster center The remaining data of the tth The first distance between Indicates the other data The remaining data of the tth The second distance between them, dis represents the distance calculation method.
[0053] Exemplarily, other data are excluded from the historical feature data to obtain the remaining data. For example, assuming that the initial cluster center is A, and the distance between the initial cluster center and the first sub-feature data is currently calculated, then the first sub-feature data is other data, and the remaining distance is the data corresponding to the historical feature data after excluding the first sub-feature data.
[0054] Exemplarily, a common distance measurement method such as Euclidean distance and Manhattan distance is used to calculate the first distance between the initial cluster center and the remaining data, and a common distance measurement method such as Euclidean distance and Manhattan distance is used to calculate the second distance between other data and the remaining data.
[0055] Exemplarily, the difference between the first distance and the second distance is calculated to obtain a distance difference, and the distance information between the initial cluster center and other data in the historical feature data is determined according to the distance difference using the following formula:
[0056]
[0057] in, Represents the i-th initial cluster center With the jth other data The distance information between represents the tth remaining data, number represents the amount of data corresponding to the remaining data, Represents the initial cluster center and the tth remaining data The first distance between Indicates other data and the tth remaining data The second distance between them, dis indicates the distance calculation method.
[0058] In some embodiments, the correlation between the second sub-feature data in each second sub-cluster in the initial clustering result and the cluster center corresponding to the second sub-cluster includes: obtaining the remaining cluster center corresponding to the cluster center after excluding the cluster center from the initial clustering result; calculating the third distance between the second sub-feature data and the cluster center, and calculating the fourth distance between the second sub-feature data and the remaining cluster center; determining a target kernel function, and determining the correlation according to the target kernel function combined with the third distance and the fourth distance; wherein the correlation is obtained according to the following formula:
[0059]
[0060] in, represents the correlation between the i-th second sub-feature data in the second sub-cluster and the cluster center corresponding to the second sub-cluster, count represents the number of centers corresponding to the remaining cluster centers, represents the target kernel function, represents the second sub-feature data of the i-th, represents the cluster center corresponding to the i-th second sub-feature data, represents the jth remaining cluster center, Represents the second sub-feature data of the i-th The third distance between the cluster centers corresponding to the i-th second sub-feature data, Represents the second sub-feature data of the i-th The fourth distance between the jth remaining cluster center and dis represents the distance calculation method.
[0061] Exemplarily, the cluster center corresponding to each second sub-cluster in the initial clustering result is obtained, and then the remaining cluster centers corresponding to the cluster centers after excluding the cluster centers are obtained from the initial clustering result.
[0062] For example, assuming that the initial clustering results include clusters A, B, and C, the cluster center of cluster A is A1, the cluster center of cluster B is B1, and the cluster center of cluster C is C1. When the second subcluster is cluster A, the cluster center is A1, and the remaining cluster centers are B1 and C1.
[0063] Exemplarily, the second sub-feature data in each second sub-class cluster in the initial clustering result is obtained, and then the third distance between the second sub-feature data and the class cluster center is calculated, and the fourth distance between the second sub-feature data and the remaining cluster centers is calculated using the distance calculation formula.
[0064] Exemplarily, the target kernel function is a function that maps data points to a high-dimensional space, and is used to capture the nonlinear relationship between data points. Common kernel functions include linear kernels, polynomial kernels, Gaussian kernels (RBF kernels), etc. Therefore, the correlation between the second sub-feature data in each second sub-class cluster in the initial clustering result and the cluster center corresponding to the second sub-class cluster is determined by the following formula based on the target kernel function combined with the third distance and the fourth distance:
[0065]
[0066] in, represents the correlation between the i-th second sub-feature data in the second sub-cluster and the cluster center corresponding to the second sub-cluster, count represents the number of centers corresponding to the remaining cluster centers, represents the target kernel function, represents the i-th second sub-feature data, represents the cluster center corresponding to the i-th second sub-feature data, represents the jth remaining cluster center, Represents the i-th second sub-feature data The third distance between the cluster centers corresponding to the i-th second sub-feature data, Represents the i-th second sub-feature data The fourth distance between the jth remaining cluster center and dis indicates the distance calculation method.
[0067] Exemplarily, by calculating the degree of association, the degree of association between each second sub-feature data and the cluster center of the cluster to which it belongs can be more accurately evaluated, thereby optimizing the selection of the cluster center. Then, based on the degree of association, the second sub-feature data can be more reasonably allocated to different clusters, avoiding misallocation caused by inaccurate distance calculation.
[0068] Step S103: Obtain second relevant feature data corresponding to each first subclass cluster in the target clustering result from the first relevant feature data.
[0069] Exemplarily, the second relevant feature data corresponding to the first sub-feature data of each first sub-class cluster in the target clustering result is obtained from the first relevant feature data.
[0070] Step S104: performing data fitting on the first subclass cluster based on machine learning to obtain an initial prediction model.
[0071] Exemplarily, machine learning is used to perform data fitting on the first sub-feature data involved in the first sub-class cluster to obtain an initial prediction model corresponding to each first sub-class cluster. The number of models corresponding to the initial prediction model is the same as the number of clusters corresponding to the target clustering result.
[0072] In some embodiments, the data fitting of the first subclass cluster based on machine learning to obtain the initial prediction model includes: obtaining the historical occurrence time corresponding to each third sub-feature data in the first subclass cluster from the second related feature data; determining the missing feature data corresponding to the first subclass cluster according to the historical occurrence time, and performing data prediction on the missing feature data according to the third sub-feature data and the historical occurrence time to obtain first prediction data; obtaining real feature data corresponding to the missing feature data from the historical feature data, and obtaining the third subclass cluster corresponding to the real feature data from the target clustering result; calculating the data gap between the first subclass cluster and the third subclass cluster, and adjusting the real feature data according to the data gap to obtain second prediction data corresponding to the missing feature data; calculating the difference information between the first prediction data and the second prediction data, and determining the reliability corresponding to the first prediction data according to the difference information; determining the target prediction data corresponding to the missing feature data according to the reliability; performing data fitting on the target prediction data and the first subclass cluster based on machine learning to obtain the initial prediction model.
[0073] Exemplarily, the historical occurrence time corresponding to each third sub-feature data in the first sub-class cluster is extracted from the second related feature data. The historical occurrence time refers to the specific time point when each historical feature data is generated.
[0074] Exemplarily, each third sub-feature data in the first sub-class cluster is arranged according to the historical occurrence time to obtain which time points in the first sub-class cluster lack relevant data, and then obtain the missing feature data, and then use the time series prediction method (such as ARIMA, exponential smoothing, LSTM, etc.) or the statistical method based on historical data (such as average value, linear regression, etc.). The third sub-feature data is used as the input feature, and the historical occurrence time is used as the time feature to build a prediction model and generate the first prediction data corresponding to the missing feature data.
[0075] Exemplarily, the real feature data corresponding to the missing feature data is extracted from the historical feature data, that is, the missing feature data is just not present in the first subclass cluster, but exists in the historical feature data.
[0076] Exemplarily, the data gap between the first subclass cluster and the third subclass cluster is calculated, that is, the balance index gap corresponding to different subclass clusters under different relevant information, so as to adjust the real feature data according to the data gap to obtain the second predicted data corresponding to the missing feature data.
[0077] Exemplarily, the difference information between the first prediction data and the second prediction data is calculated, for example, the absolute difference or relative difference between the first prediction data and the second prediction data is calculated, so as to set the reliability index according to the difference (for example, the smaller the difference, the higher the reliability). Thus, when the reliability is less than a preset value, the first prediction data is determined as the target prediction data corresponding to the missing feature data; when the reliability is greater than or equal to the preset value, the missing feature data is re-predicted until the corresponding target prediction data is obtained.
[0078] Exemplarily, a machine learning algorithm (such as linear regression, decision tree, random forest, XGBoost, etc.) is selected. The target prediction data and the corresponding feature data in the first subclass cluster are used as training data, and a model is constructed and fitted to ensure that the model can reflect the inherent laws of the data, thereby obtaining an initial prediction model. The initial prediction model can better capture the data features involved in the first subclass cluster and provide support for subsequent prediction tasks.
[0079] Step S105: Obtain a target predicted time corresponding to the target item of the target gas station, and obtain third related feature data corresponding to the target predicted time.
[0080] Exemplarily, the target prediction time corresponding to the target item of the target gas station is obtained according to actual demand, and the third relevant characteristic data corresponding to the target gas station at the target prediction time is determined according to the actual demand.
[0081] Step S106: Obtain a target prediction model corresponding to the target item from the initial prediction model according to the second relevant feature data and the third relevant feature data.
[0082] Exemplarily, the similarity between the second relevant feature data and the third relevant feature data is calculated, so that the initial prediction model corresponding to the second relevant feature data when the similarity is maximum is determined as the target prediction model corresponding to the equilibrium index prediction of the target item at the target prediction time.
[0083] In some embodiments, obtaining the target prediction model corresponding to the target item from the initial prediction model based on the second relevant feature data and the third relevant feature data includes: obtaining weight information corresponding to information fusion of feature information in the third relevant feature data and the feature information in the second relevant feature data; calculating the corresponding correlation distance between the second relevant feature data and the third relevant feature data under the feature information; determining the target similarity value between the second relevant feature data and the third relevant feature data by fusing the weight information according to the weight information; and obtaining the target prediction model corresponding to the target item from the initial prediction model according to the target similarity value.
[0084] Exemplarily, the weight information corresponding to the feature information in the third related feature data and the feature information in the second related feature data is obtained based on expert experience or historical experience. The weight information reflects the importance of the feature information in the information fusion. The weight information ensures that the importance of the feature information is reasonably reflected, thereby improving the accuracy and rationality of the information fusion.
[0085] Exemplarily, a distance calculation method (such as Euclidean distance, Manhattan distance, cosine similarity, etc.) is used. For each feature information, the correlation distance between the second related feature data and the third related feature data is calculated. The correlation distance reflects the difference between different feature information in the feature space, providing a basis for subsequent similarity calculation.
[0086] Exemplarily, the target similarity value between the second related feature data and the third related feature data is determined based on the related distance calculated by fusion of the weight information. For example, by weighted summation, the related distance is combined with the weight information to calculate the target similarity value, and then the target similarity value can comprehensively consider the importance of each feature information and more accurately reflect the similarity between the information.
[0087] Exemplarily, the second relevant feature data with a higher target similarity value to the third relevant feature data is screened out, so that the initial prediction model corresponding to the second relevant feature data is determined as the target prediction model corresponding to the target item at the target prediction time. The target prediction model can better reflect the characteristics of the target item under the third relevant feature data, thereby improving the accuracy and reliability of the prediction.
[0088] In some embodiments, the obtaining of the weight information corresponding to the information fusion of the feature information in the third related feature data with the feature information in the second related feature data includes: obtaining the first information entropy corresponding to each feature information in the second related feature data and the second information entropy corresponding to each feature information in the third related feature data; determining the first information variance corresponding to each feature information in the second related feature data and determining the second information variance corresponding to each feature information in the third related feature data; determining the first characterization value corresponding to the feature information in the second related feature data according to the first information entropy and the first information variance; determining the second characterization value corresponding to the feature information in the third related feature data according to the second information entropy and the second information variance; obtaining the first data corresponding to the feature information in the third related feature data, and calculating the third information entropy corresponding to the first data under the second related feature data; merging the third related feature data and the second related feature data to obtain the fourth related feature data, and calculating the fourth information entropy corresponding to the first data under the fourth related feature data; determining the weight information according to the first characterization value, the second characterization value, the third information entropy and the fourth information entropy; wherein the weight information is obtained according to the following formula:
[0089]
[0090] in, represents the weight information corresponding to the i-th feature information, represents the amount of data corresponding to the second related feature data, represents the amount of data corresponding to the fourth related feature data, represents the first characterization value, represents the second characterization value, represents the third information entropy corresponding to the i-th first data, represents the fourth information entropy corresponding to the i-th first data, a represents the minimum value that prevents the denominator from being zero, and b represents the influencing factor.
[0091] Exemplarily, the first information entropy corresponding to each feature information in the second related feature data in the historical related information is obtained, and the second information entropy corresponding to each feature information in the third related feature data in the historical related information is obtained. The first information variance corresponding to each feature information in the second related feature data in the historical related information is determined, and the second information variance corresponding to each feature information in the third related feature data in the historical related information is determined.
[0092] Exemplarily, the noise information variance of the noise data corresponding to the feature information in the historical related information is obtained, so that the first information variance and the noise information variance are summed and divided by the first information entropy to determine the first characterization value corresponding to the feature information in the second related feature data. Similarly, the second information variance and the noise information variance are summed and divided by the second information entropy to determine the second characterization value corresponding to the feature information in the third related feature data.
[0093] Exemplarily, the first data corresponding to the feature information in the third related feature data is obtained, and then the third information entropy corresponding to the first data under the second related feature data, that is, in the first subclass cluster, is calculated. The third related feature data and the second related feature data are combined to obtain the fourth related feature data, and then the fourth information entropy corresponding to the first data under the fourth related feature data is calculated.
[0094] Exemplarily, the first characterization value, the second characterization value, the third information entropy, and the fourth information entropy are fused according to the following formula to determine the weight information corresponding to the feature information:
[0095]
[0096] in, Represents the weight information corresponding to the i-th feature information, represents the amount of data corresponding to the second related feature data, represents the amount of data corresponding to the fourth related feature data, represents the first characterization value, represents the second characterization value, represents the third information entropy corresponding to the i-th first data, represents the fourth information entropy corresponding to the i-th first data, a represents the minimum value that prevents the denominator from being zero, and b represents the impact factor.
[0097] For example, the above formula considers that information with a larger amount of data has a greater impact on the weight, reflecting the contribution of the amount of data to the importance of the feature. This helps to reasonably allocate weights when the amount of data is unbalanced, ensuring that information with a larger amount of data contributes more significantly to the results, thereby significantly improving the accuracy and reliability of feature information fusion and providing stronger support for subsequent data analysis and decision-making.
[0098] Step S107: perform data prediction on the target prediction time according to the target prediction model to obtain the target prediction equilibrium index corresponding to the target item at the target prediction time.
[0099] Exemplarily, the target prediction model is used to perform data prediction on the target prediction time, so as to obtain the target prediction balance index corresponding to the target item at the target prediction time and the third related characteristic data. The target prediction balance index is used to characterize the number of tradable items predicted for the target item at the target gas station, that is, the target prediction balance index is used to characterize the minimum number of items predicted to be equipped for the target item at the target gas station.
[0100] In some embodiments, after obtaining the target predicted equilibrium index, the method further includes: calculating the mutual information of any two target items based on the historical feature data to obtain an association weight; determining the corresponding degree of association between any two target items using the historical feature data based on the association weight; obtaining associated items corresponding to the target items based on the association degree; and determining a target equilibrium scheduling result corresponding to the target gas station based on the associated items and the target predicted equilibrium index.
[0101] Exemplarily, mutual information is calculated for any two target items according to the historical feature data to obtain the association weight. For any two target items in the historical feature data, their mutual information is calculated. The larger the value of the mutual information, the stronger the correlation between the two target items. The mutual information can quantify the correlation between the two target items and provide a basis for the subsequent calculation of the correlation degree.
[0102] Exemplarily, the corresponding correlation between any two target items is determined using historical feature data according to the correlation weight. The correlation can be a direct value of the mutual information or a value after normalizing the mutual information. For all target items, the correlation between them is calculated. The larger the correlation value, the stronger the correlation between the two target items.
[0103] For example, a correlation threshold is set, such as 0.5. Items with correlation greater than the threshold are considered to be associated items of the target item. For each target item, all items with correlation greater than the threshold are found. These items are the associated items of the target item. Identifying other items that are highly correlated with the target item helps to better understand the equilibrium adjustment mode of the target item.
[0104] Exemplarily, the target balanced scheduling result corresponding to the target gas station is determined according to the associated items and the target predicted balanced index. For example, the scheduling plan of the target item is adjusted by considering the balanced index prediction of the associated items of the target item. If the predicted balanced index of a certain associated item is very high, the inventory of the target item can be increased to meet potential user needs. Then, according to the predicted balanced index of the target item and the associated items, a detailed scheduling plan for the target gas station is formulated. The scheduling plan may include inventory adjustment, replenishment time, transportation arrangement, etc. Thus, by comprehensively considering the predicted balanced index of the associated items, the scheduling result of the target gas station is optimized.
[0105] See also Figure 2 , Figure 2 A gas station data prediction device 200 based on machine learning is provided in an embodiment of the present application. The gas station data prediction device 200 based on machine learning includes a data acquisition module 201, a data clustering module 202, a data analysis module 203, a data fitting module 204, a data acquisition module 205, a model selection module 206, and a data prediction module 207. The data acquisition module 201 is used to obtain historical feature data corresponding to a target item at a target gas station and first related feature data corresponding to the historical feature data, wherein the historical feature data refers to a first factor affecting a target prediction equilibrium index, and the first related feature data refers to a second factor affecting the target prediction equilibrium index, and the target prediction equilibrium index is used to characterize the number of tradable items predicted for the target item at the target gas station; the data clustering module 202 is used to perform model selection on the historical feature data. Data clustering obtains target clustering results; a data analysis module 203 is used to obtain the second relevant feature data corresponding to each first subclass cluster in the target clustering results from the first relevant feature data; a data fitting module 204 is used to perform data fitting on the first subclass cluster based on machine learning to obtain an initial prediction model; a data acquisition module 205 is used to obtain the target prediction time corresponding to the target item of the target gas station, and obtain the third relevant feature data corresponding to the target prediction time; a model selection module 206 is used to obtain the target prediction model corresponding to the target item from the initial prediction model according to the second relevant feature data and the third relevant feature data; a data prediction module 207 is used to perform data prediction on the target prediction time according to the target prediction model, and obtain the target prediction equilibrium index corresponding to the target item at the target prediction time.
[0106] In some implementations, the data clustering module 202 performs, during the process of clustering the historical feature data to obtain a target clustering result:
[0107] Calculating the local density corresponding to any one of the first sub-feature data in the historical feature data, and determining the initial cluster center corresponding to the historical feature data according to the local density;
[0108] Calculating the distance information between the initial cluster center and other data in the historical feature data, and performing data clustering on the historical feature data according to the distance information and the initial cluster center to obtain an initial clustering result;
[0109] The correlation between the second sub-feature data in each second sub-cluster in the initial clustering result and the cluster center corresponding to the second sub-cluster;
[0110] Adjusting the initial clustering result according to the association degree to obtain the target clustering result;
[0111] Wherein, the local density is obtained according to the following formula:
[0112]
[0113] in, represents the local density corresponding to the i-th first sub-feature data, num represents the total data volume corresponding to the historical feature data, represents the i-th first sub-feature data, represents the j-th first sub-feature data, Represents the first sub-feature data of the i-th and the jth first sub-feature data The distance information between Indicates the preset threshold value, Indicates when Greater than or equal to hour, The corresponding function value is 1; when hour, The corresponding function value is 0, and dis indicates the distance calculation method.
[0114] In some implementations, the data clustering module 202 performs, during the process of calculating the distance information between the initial cluster center and other data in the historical feature data:
[0115] Obtaining the remaining data corresponding to the exclusion of the other data from the historical feature data;
[0116] Calculating a first distance between the initial cluster center and the remaining data, and calculating a second distance between the other data and the remaining data;
[0117] Calculating the difference between the first distance and the second distance to obtain a distance difference, and determining the distance information between the initial cluster center and other data in the historical feature data according to the distance difference;
[0118] The distance information is obtained according to the following formula:
[0119]
[0120] in, Represents the i-th initial cluster center and the other data mentioned in the jth The distance information between represents the tth remaining data, number represents the amount of data corresponding to the remaining data, Represents the initial cluster center The remaining data of the tth The first distance between Indicates the other data The remaining data of the tth The second distance between them, dis represents the distance calculation method.
[0121] In some implementations, the data clustering module 202 performs, during the process of calculating the degree of association between the second sub-feature data in each second sub-cluster in the initial clustering result and the cluster center corresponding to the second sub-cluster:
[0122] Obtaining the remaining cluster centers corresponding to the cluster centers after excluding the cluster centers of the clusters from the initial clustering results;
[0123] Calculating a third distance between the second sub-feature data and the cluster center of the cluster, and calculating a fourth distance between the second sub-feature data and the remaining cluster centers;
[0124] Determine a target kernel function, and determine the degree of association according to the target kernel function in combination with the third distance and the fourth distance;
[0125] The correlation degree is obtained according to the following formula:
[0126]
[0127] in, represents the correlation between the i-th second sub-feature data in the second sub-cluster and the cluster center corresponding to the second sub-cluster, count represents the number of centers corresponding to the remaining cluster centers, represents the target kernel function, represents the second sub-feature data of the i-th, represents the cluster center corresponding to the i-th second sub-feature data, represents the jth remaining cluster center, Represents the second sub-feature data of the i-th The third distance between the cluster centers corresponding to the i-th second sub-feature data, Represents the second sub-feature data of the i-th The fourth distance between the jth remaining cluster center and dis represents the distance calculation method.
[0128] In some implementations, during the process of performing data fitting on the first subclass cluster based on machine learning to obtain an initial prediction model, the data fitting module 204 executes:
[0129] Obtaining the historical occurrence time corresponding to each third sub-feature data in the first sub-class cluster from the second related feature data;
[0130] Determine the missing feature data corresponding to the first sub-class cluster according to the historical occurrence time, and perform data prediction on the missing feature data according to the third sub-feature data and the historical occurrence time to obtain first prediction data;
[0131] Obtaining real feature data corresponding to the missing feature data from the historical feature data, and obtaining a third subclass cluster corresponding to the real feature data from the target clustering result;
[0132] Calculating the data gap between the first subclass cluster and the third subclass cluster, and adjusting the real feature data according to the data gap to obtain second predicted data corresponding to the missing feature data;
[0133] Calculating difference information between the first prediction data and the second prediction data, and determining reliability corresponding to the first prediction data according to the difference information;
[0134] Determine the target prediction data corresponding to the missing feature data according to the reliability;
[0135] The initial prediction model is obtained by performing data fitting on the target prediction data and the first subclass cluster based on machine learning.
[0136] In some implementations, the model selection module 206, in the process of obtaining the target prediction model corresponding to the target item from the initial prediction model according to the second relevant feature data and the third relevant feature data, performs:
[0137] Obtaining weight information corresponding to information fusion of feature information in the third related feature data and the feature information in the second related feature data;
[0138] Calculating the correlation distances corresponding to the second correlation feature data and the third correlation feature data under the feature information;
[0139] Determine a target similarity value between the second relevant feature data and the third relevant feature data according to the weight information and fuse the weight information;
[0140] The target prediction model corresponding to the target item is obtained from the initial prediction model according to the target similarity value.
[0141] In some implementations, the model selection module 206, in the process of obtaining the weight information corresponding to information fusion of the feature information in the third related feature data and the feature information in the second related feature data, performs:
[0142] Obtaining a first information entropy corresponding to each feature information in the second related feature data and a second information entropy corresponding to each feature information in the third related feature data;
[0143] Determine a first information variance corresponding to each of the feature information in the second related feature data and determine a second information variance corresponding to each of the feature information in the third related feature data;
[0144] Determine a first representation value corresponding to the feature information in the second related feature data according to the first information entropy and the first information variance;
[0145] Determine a second representation value corresponding to the feature information in the third related feature data according to the second information entropy and the second information variance;
[0146] Obtaining first data corresponding to the feature information in the third related feature data, and calculating third information entropy corresponding to the first data under the second related feature data;
[0147] Combining the third relevant feature data and the second relevant feature data to obtain fourth relevant feature data, and calculating fourth information entropy corresponding to the first data under the fourth relevant feature data;
[0148] Determine the weight information according to the first characterization value, the second characterization value, the third information entropy and the fourth information entropy;
[0149] The weight information is obtained according to the following formula:
[0150]
[0151] in, represents the weight information corresponding to the i-th feature information, represents the amount of data corresponding to the second related feature data, represents the amount of data corresponding to the fourth related feature data, represents the first characterization value, represents the second characterization value, represents the third information entropy corresponding to the i-th first data, represents the fourth information entropy corresponding to the i-th first data, a represents the minimum value that prevents the denominator from being zero, and b represents the influencing factor.
[0152] In some implementations, after obtaining the target prediction equilibrium index, the gas station data prediction device 200 based on machine learning further performs:
[0153] Calculate the mutual information of any two target items according to the historical feature data to obtain an association weight;
[0154] Determine the corresponding degree of association between any two of the target items using the historical feature data according to the association weight;
[0155] Obtaining related items corresponding to the target item according to the degree of association;
[0156] The target equilibrium scheduling result corresponding to the target gas station is determined according to the associated items and the target predicted equilibrium index.
[0157] In some embodiments, the gas station data prediction device 200 based on machine learning can be applied to a terminal device.
[0158] It should be noted that those skilled in the art can clearly understand that, for the sake of convenience and brevity of description, the specific working process of the gas station data prediction device 200 based on machine learning described above can refer to the corresponding process in the aforementioned gas station data prediction method embodiment based on machine learning, and will not be repeated here.
[0159] See also Figure 3 , Figure 3 A schematic block diagram of the structure of a terminal device provided in an embodiment of the present invention.
[0160] like Figure 3 As shown, the terminal device 300 includes a processor 301 and a memory 302 , and the processor 301 and the memory 302 are connected via a bus 303 , such as an I2C (Inter-integrated Circuit) bus.
[0161] Specifically, the processor 301 is used to provide computing and control capabilities to support the operation of the entire terminal device. The processor 301 can be a central processing unit (CPU), and the processor 301 can also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.
[0162] Specifically, the memory 302 may be a Flash chip, a read-only memory (ROM) disk, an optical disk, a USB flash drive, or a mobile hard disk.
[0163] Those skilled in the art will understand that Figure 3 The structure shown in the figure is only a block diagram of a partial structure related to the embodiment of the present invention, and does not constitute a limitation on the terminal device to which the embodiment of the present invention is applied. The specific server may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0164] The processor is used to run a computer program stored in a memory, and implement any one of the gas station data prediction methods based on machine learning provided in an embodiment of the present invention when executing the computer program.
[0165] In one embodiment, the processor is used to run a computer program stored in the memory, and implements the following steps when executing the computer program:
[0166] Obtaining historical feature data corresponding to a target item at a target gas station and first related feature data corresponding to the historical feature data, wherein the historical feature data refers to a first factor affecting a target prediction equilibrium index, and the first related feature data refers to a second factor affecting the target prediction equilibrium index, wherein the target prediction equilibrium index is used to characterize the number of tradable items predicted for the target item at the target gas station;
[0167] Performing data clustering on the historical feature data to obtain a target clustering result;
[0168] Obtaining second relevant feature data corresponding to each first subclass cluster in the target clustering result from the first relevant feature data;
[0169] Performing data fitting on the first subclass cluster based on machine learning to obtain an initial prediction model;
[0170] Obtaining a target predicted time corresponding to the target item at the target gas station, and obtaining third related feature data corresponding to the target predicted time;
[0171] Obtaining a target prediction model corresponding to the target item from the initial prediction model according to the second relevant feature data and the third relevant feature data;
[0172] The target prediction time is predicted according to the target prediction model to obtain the target prediction equilibrium index corresponding to the target item at the target prediction time.
[0173] In some implementations, the processor 301, in the process of clustering the historical feature data to obtain a target clustering result, executes:
[0174] Calculating the local density corresponding to any one of the first sub-feature data in the historical feature data, and determining the initial cluster center corresponding to the historical feature data according to the local density;
[0175] Calculating the distance information between the initial cluster center and other data in the historical feature data, and performing data clustering on the historical feature data according to the distance information and the initial cluster center to obtain an initial clustering result;
[0176] The correlation between the second sub-feature data in each second sub-cluster in the initial clustering result and the cluster center corresponding to the second sub-cluster;
[0177] Adjusting the initial clustering result according to the association degree to obtain the target clustering result;
[0178] Wherein, the local density is obtained according to the following formula:
[0179]
[0180] in, represents the local density corresponding to the i-th first sub-feature data, num represents the total data volume corresponding to the historical feature data, represents the i-th first sub-feature data, represents the j-th first sub-feature data, Represents the first sub-feature data of the i-th and the jth first sub-feature data The distance information between Indicates the preset threshold value, Indicates when Greater than or equal to hour, The corresponding function value is 1; when hour, The corresponding function value is 0, and dis indicates the distance calculation method.
[0181] In some implementations, the processor 301, during the process of calculating the distance information between the initial cluster center and other data in the historical feature data, executes:
[0182] Obtaining the remaining data corresponding to the exclusion of the other data from the historical feature data;
[0183] Calculating a first distance between the initial cluster center and the remaining data, and calculating a second distance between the other data and the remaining data;
[0184] Calculating the difference between the first distance and the second distance to obtain a distance difference, and determining the distance information between the initial cluster center and other data in the historical feature data according to the distance difference;
[0185] The distance information is obtained according to the following formula:
[0186]
[0187] in, Represents the i-th initial cluster center and the other data mentioned in the jth The distance information between represents the tth remaining data, number represents the amount of data corresponding to the remaining data, Represents the initial cluster center The remaining data of the tth The first distance between Indicates the other data The remaining data of the tth The second distance between them, dis represents the distance calculation method.
[0188] In some implementations, the processor 301, in the process of calculating the degree of association between the second sub-feature data in each second sub-cluster in the initial clustering result and the cluster center corresponding to the second sub-cluster, executes:
[0189] Obtaining the remaining cluster centers corresponding to the cluster centers after excluding the cluster centers of the clusters from the initial clustering results;
[0190] Calculating a third distance between the second sub-feature data and the cluster center of the cluster, and calculating a fourth distance between the second sub-feature data and the remaining cluster centers;
[0191] Determine a target kernel function, and determine the degree of association according to the target kernel function in combination with the third distance and the fourth distance;
[0192] The correlation degree is obtained according to the following formula:
[0193]
[0194] in, represents the correlation between the i-th second sub-feature data in the second sub-cluster and the cluster center corresponding to the second sub-cluster, count represents the number of centers corresponding to the remaining cluster centers, represents the target kernel function, represents the second sub-feature data of the i-th, represents the cluster center corresponding to the i-th second sub-feature data, represents the jth remaining cluster center, Represents the second sub-feature data of the i-th The third distance between the cluster centers corresponding to the i-th second sub-feature data, Represents the second sub-feature data of the i-th The fourth distance between the jth remaining cluster center and dis represents the distance calculation method.
[0195] In some implementations, during the process of performing data fitting on the first subclass cluster based on machine learning to obtain an initial prediction model, the processor 301 executes:
[0196] Obtaining the historical occurrence time corresponding to each third sub-feature data in the first sub-class cluster from the second related feature data;
[0197] Determine the missing feature data corresponding to the first sub-class cluster according to the historical occurrence time, and perform data prediction on the missing feature data according to the third sub-feature data and the historical occurrence time to obtain first prediction data;
[0198] Obtaining real feature data corresponding to the missing feature data from the historical feature data, and obtaining a third subclass cluster corresponding to the real feature data from the target clustering result;
[0199] Calculating the data gap between the first subclass cluster and the third subclass cluster, and adjusting the real feature data according to the data gap to obtain second predicted data corresponding to the missing feature data;
[0200] Calculating difference information between the first prediction data and the second prediction data, and determining reliability corresponding to the first prediction data according to the difference information;
[0201] Determine the target prediction data corresponding to the missing feature data according to the reliability;
[0202] The initial prediction model is obtained by performing data fitting on the target prediction data and the first subclass cluster based on machine learning.
[0203] In some implementations, the processor 301, in the process of obtaining the target prediction model corresponding to the target item from the initial prediction model according to the second relevant feature data and the third relevant feature data, executes:
[0204] Obtaining weight information corresponding to information fusion of feature information in the third relevant feature data and the feature information in the second relevant feature data;
[0205] Calculating the correlation distances corresponding to the second correlation feature data and the third correlation feature data under the feature information;
[0206] Determine a target similarity value between the second relevant feature data and the third relevant feature data according to the weight information and fuse the weight information;
[0207] The target prediction model corresponding to the target item is obtained from the initial prediction model according to the target similarity value.
[0208] In some implementations, the processor 301, in the process of obtaining the weight information corresponding to information fusion of the feature information in the third related feature data and the feature information in the second related feature data, executes:
[0209] Obtaining a first information entropy corresponding to each feature information in the second related feature data and a second information entropy corresponding to each feature information in the third related feature data;
[0210] Determine a first information variance corresponding to each of the feature information in the second related feature data and determine a second information variance corresponding to each of the feature information in the third related feature data;
[0211] Determine a first representation value corresponding to the feature information in the second related feature data according to the first information entropy and the first information variance;
[0212] Determine a second representation value corresponding to the feature information in the third related feature data according to the second information entropy and the second information variance;
[0213] Obtaining first data corresponding to the feature information in the third related feature data, and calculating third information entropy corresponding to the first data under the second related feature data;
[0214] Combining the third relevant feature data and the second relevant feature data to obtain fourth relevant feature data, and calculating fourth information entropy corresponding to the first data under the fourth relevant feature data;
[0215] Determine the weight information according to the first characterization value, the second characterization value, the third information entropy and the fourth information entropy;
[0216] The weight information is obtained according to the following formula:
[0217]
[0218] in, represents the weight information corresponding to the i-th feature information, represents the amount of data corresponding to the second related feature data, represents the amount of data corresponding to the fourth related feature data, represents the first characterization value, represents the second characterization value, represents the third information entropy corresponding to the i-th first data, represents the fourth information entropy corresponding to the i-th first data, a represents the minimum value that prevents the denominator from being zero, and b represents the influencing factor.
[0219] In some implementations, after obtaining the target predicted equilibrium index, the processor 301 further executes:
[0220] Calculate the mutual information of any two target items according to the historical feature data to obtain an association weight;
[0221] Determine the corresponding degree of association between any two of the target items using the historical feature data according to the association weight;
[0222] Obtaining related items corresponding to the target item according to the degree of association;
[0223] The target equilibrium scheduling result corresponding to the target gas station is determined according to the associated items and the target predicted equilibrium index.
[0224] It should be noted that technical personnel in the relevant field can clearly understand that, for the convenience and conciseness of description, the specific working process of the terminal device described above can refer to the corresponding process in the aforementioned gas station data prediction method embodiment based on machine learning, and will not be repeated here.
[0225] An embodiment of the present invention also provides a storage medium for computer-readable storage, wherein the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of any one of the gas station data prediction methods based on machine learning provided in the description of the embodiment of the present invention.
[0226] The storage medium may be an internal storage unit of the terminal device described in the foregoing embodiment, such as a hard disk or memory of the terminal device. The storage medium may also be an external storage device of the terminal device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc., equipped on the terminal device.
[0227] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In a hardware embodiment, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or transient medium). As is known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those skilled in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0228] It should be understood that the term "and / or" used in the present specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, including these combinations. It should be noted that, in this article, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "including a..." does not exclude the presence of other identical elements in the process, method, article or system including the element.
[0229] The serial numbers of the embodiments of the present invention are only for description and do not represent the advantages and disadvantages of the embodiments. The above description is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A gas station data prediction method based on machine learning, characterized in that: The method comprises: Obtaining historical feature data corresponding to a target item at a target gas station and first related feature data corresponding to the historical feature data, wherein the historical feature data refers to a first factor affecting a target prediction equilibrium index, and the first related feature data refers to a second factor affecting the target prediction equilibrium index, and the target prediction equilibrium index is used to characterize the number of tradable items predicted for the target item at the target gas station; Performing data clustering on the historical feature data to obtain a target clustering result; Obtaining second relevant feature data corresponding to each first subclass cluster in the target clustering result from the first relevant feature data; Performing data fitting on the first subclass cluster based on machine learning to obtain an initial prediction model; Obtaining a target predicted time corresponding to the target item at the target gas station, and obtaining third related feature data corresponding to the target predicted time; Obtaining a target prediction model corresponding to the target item from the initial prediction model according to the second relevant feature data and the third relevant feature data; The target prediction time is predicted according to the target prediction model to obtain the target prediction equilibrium index corresponding to the target item at the target prediction time.
2. The method according to claim 1, characterized in that: The performing data clustering on the historical feature data to obtain a target clustering result includes: Calculating the local density corresponding to any one of the first sub-feature data in the historical feature data, and determining the initial cluster center corresponding to the historical feature data according to the local density; Calculating the distance information between the initial cluster center and other data in the historical feature data, and performing data clustering on the historical feature data according to the distance information and the initial cluster center to obtain an initial clustering result; The correlation between the second sub-feature data in each second sub-cluster in the initial clustering result and the cluster center corresponding to the second sub-cluster; Adjusting the initial clustering result according to the association degree to obtain the target clustering result; Wherein, the local density is obtained according to the following formula: ; in, represents the local density corresponding to the i-th first sub-feature data, num represents the total data volume corresponding to the historical feature data, represents the i-th first sub-feature data, represents the j-th first sub-feature data, Represents the first sub-feature data of the i-th and the jth first sub-feature data The distance information between Indicates the preset threshold value, Indicates when Greater than or equal to hour, The corresponding function value is 1; when hour, The corresponding function value is 0, and dis indicates the distance calculation method.
3. The method according to claim 2, characterized in that The calculating the distance information between the initial cluster center and other data in the historical feature data includes: Obtaining the remaining data corresponding to the exclusion of the other data from the historical feature data; Calculating a first distance between the initial cluster center and the remaining data, and calculating a second distance between the other data and the remaining data; Calculating the difference between the first distance and the second distance to obtain a distance difference, and determining the distance information between the initial cluster center and other data in the historical feature data according to the distance difference; The distance information is obtained according to the following formula: ; in, Represents the i-th initial cluster center and the other data mentioned in the jth The distance information between represents the tth remaining data, number represents the amount of data corresponding to the remaining data, Represents the initial cluster center The remaining data of the tth The first distance between Indicates the other data The remaining data of the tth The second distance between them, dis represents the distance calculation method.
4. The method according to claim 2, characterized in that: The correlation between the second sub-feature data in each second sub-cluster in the initial clustering result and the cluster center corresponding to the second sub-cluster includes: Obtaining the remaining cluster centers corresponding to the cluster centers after excluding the cluster centers of the clusters from the initial clustering results; Calculating a third distance between the second sub-feature data and the cluster center of the cluster, and calculating a fourth distance between the second sub-feature data and the remaining cluster centers; Determine a target kernel function, and determine the degree of association according to the target kernel function in combination with the third distance and the fourth distance; The correlation degree is obtained according to the following formula: ; in, represents the correlation between the i-th second sub-feature data in the second sub-cluster and the cluster center corresponding to the second sub-cluster, count represents the number of centers corresponding to the remaining cluster centers, represents the target kernel function, represents the second sub-feature data of the i-th, represents the cluster center corresponding to the i-th second sub-feature data, represents the jth remaining cluster center, Represents the second sub-feature data of the i-th The third distance between the cluster centers corresponding to the i-th second sub-feature data, Represents the second sub-feature data of the i-th The fourth distance between the jth remaining cluster center and dis represents the distance calculation method.
5. The method according to claim 1, characterized in that The step of performing data fitting on the first subclass cluster based on machine learning to obtain an initial prediction model includes: Obtaining the historical occurrence time corresponding to each third sub-feature data in the first sub-class cluster from the second related feature data; Determine the missing feature data corresponding to the first sub-class cluster according to the historical occurrence time, and perform data prediction on the missing feature data according to the third sub-feature data and the historical occurrence time to obtain first prediction data; Obtaining real feature data corresponding to the missing feature data from the historical feature data, and obtaining a third subclass cluster corresponding to the real feature data from the target clustering result; Calculating the data gap between the first subclass cluster and the third subclass cluster, and adjusting the real feature data according to the data gap to obtain second predicted data corresponding to the missing feature data; Calculating difference information between the first prediction data and the second prediction data, and determining reliability corresponding to the first prediction data according to the difference information; Determine the target prediction data corresponding to the missing feature data according to the reliability; The initial prediction model is obtained by performing data fitting on the target prediction data and the first subclass cluster based on machine learning.
6. The method according to claim 1, characterized in that The step of obtaining a target prediction model corresponding to the target item from the initial prediction model according to the second relevant feature data and the third relevant feature data includes: Obtaining weight information corresponding to information fusion of feature information in the third related feature data and the feature information in the second related feature data; Calculating the correlation distances corresponding to the second correlation feature data and the third correlation feature data under the feature information; Determine a target similarity value between the second relevant feature data and the third relevant feature data according to the weight information and fuse the weight information; The target prediction model corresponding to the target item is obtained from the initial prediction model according to the target similarity value.
7. The method according to claim 6, characterized in that The obtaining of the weight information corresponding to the information fusion of the feature information in the third related feature data and the feature information in the second related feature data includes: Obtaining a first information entropy corresponding to each feature information in the second related feature data and a second information entropy corresponding to each feature information in the third related feature data; Determine a first information variance corresponding to each of the feature information in the second related feature data and determine a second information variance corresponding to each of the feature information in the third related feature data; Determine a first representation value corresponding to the feature information in the second related feature data according to the first information entropy and the first information variance; Determine a second representation value corresponding to the feature information in the third related feature data according to the second information entropy and the second information variance; Obtaining first data corresponding to the feature information in the third related feature data, and calculating third information entropy corresponding to the first data under the second related feature data; Combining the third relevant feature data and the second relevant feature data to obtain fourth relevant feature data, and calculating fourth information entropy corresponding to the first data under the fourth relevant feature data; Determine the weight information according to the first characterization value, the second characterization value, the third information entropy and the fourth information entropy; The weight information is obtained according to the following formula: ; in, represents the weight information corresponding to the i-th feature information, represents the amount of data corresponding to the second related feature data, represents the amount of data corresponding to the fourth related feature data, represents the first characterization value, represents the second characterization value, represents the third information entropy corresponding to the i-th first data, represents the fourth information entropy corresponding to the i-th first data, a represents the minimum value that prevents the denominator from being zero, and b represents the influencing factor.
8. The method according to claim 1, characterized in that: After obtaining the target predicted equilibrium index, the method further includes: Calculate the mutual information of any two target items according to the historical feature data to obtain an association weight; Determine the corresponding degree of association between any two of the target items using the historical feature data according to the association weight; Obtaining related items corresponding to the target item according to the degree of association; The target equilibrium scheduling result corresponding to the target gas station is determined according to the associated items and the target predicted equilibrium index.
9. A gas station data prediction device based on machine learning, characterized in that: include: A data collection module, used to obtain historical feature data corresponding to a target item at a target gas station and first related feature data corresponding to the historical feature data, wherein the historical feature data refers to a first factor affecting a target prediction equilibrium index, and the first related feature data refers to a second factor affecting the target prediction equilibrium index, and the target prediction equilibrium index is used to characterize the number of tradable items predicted for the target item at the target gas station; A data clustering module, used for performing data clustering on the historical feature data to obtain a target clustering result; A data analysis module, configured to obtain second relevant feature data corresponding to each first subclass cluster in the target clustering result from the first relevant feature data; A data fitting module, used for performing data fitting on the first subclass cluster based on machine learning to obtain an initial prediction model; A data acquisition module, used to obtain a target prediction time corresponding to the target item of the target gas station, and obtain third related feature data corresponding to the target prediction time; A model selection module, configured to obtain a target prediction model corresponding to the target item from the initial prediction model according to the second relevant feature data and the third relevant feature data; The data prediction module is used to perform data prediction on the target prediction time according to the target prediction model, and obtain the target prediction equilibrium index corresponding to the target item at the target prediction time.
10. A terminal device, characterized in that: The terminal device includes a processor and a memory; The memory is used to store computer programs; The processor is used to execute the computer program and implement the gas station data prediction method based on machine learning as described in any one of claims 1 to 8 when executing the computer program.