Travel settlement prediction method and system of SAAS-oriented platform
By applying time series prediction methods such as Holt-Wentes seasonal model on the SAAS online ride-hailing platform, the complex and error-prone problems of traditional settlement configuration management are solved, and refined management and cost control of project implementation and migration processes are realized.
Patent Information
- Application Number
- CN202510177439.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-18
- Publication Date
- 2025-05-13
AI Technical Summary
In the multi-tenant environment of the SAAS online ride-hailing platform, the traditional settlement configuration management method is complex and error-prone. Especially when system upgrades or migrates, ensuring efficient and accurate migration of settlement configuration has become a technical problem.
Time series prediction methods such as Holt-Winters seasonal model are adopted, combined with cost optimization strategies, to achieve refined management of project implementation and migration processes. Through steps such as data preparation, exponential smoothing model, prediction, time domain adjustment factor calculation, etc., optimize the prediction model and improve the accuracy of prediction.
Accurate prediction of project implementation and migration processes, quantify the economic benefits of the plan, reduce the risk of operational errors, and improve the dual goals of cost control and efficiency improvement.
Smart Images

Figure CN119990459A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of SAAS online car-hailing, and in particular to an online car-hailing platform, and in particular to a travel settlement prediction method and system for a SAAS platform. Background Art
[0002] With the rapid rise of the sharing economy, the travel service industry has ushered in unprecedented development opportunities. Its business forms are becoming increasingly diverse, covering a variety of convenient travel modes such as online car-hailing, shared bicycles, and electric scooters. Behind these services, highly complex software as a service (SaaS) platforms are relied on for efficient operation and management. Among them, settlement configuration, as a core functional component, plays a vital role in protecting the legitimate rights and interests of all participants, maintaining the transparency of the transaction process, and promoting the sustainable and healthy development of the business.
[0003] In the traditional operation and management model, settlement configuration often needs to be adjusted and optimized manually. However, in the multi-tenant environment of the travel SaaS platform, the complexity of this process has increased significantly. Different tenants have highly differentiated requirements for settlement configuration due to their unique business models, market demands, and operation strategies. For example, in terms of commission models, tenants may adopt various methods such as ordinary commissions and tiered commissions based on amount; in terms of preferential policies, they may implement a variety of strategy combinations such as no commission exemption, no commission, reduced commission, and reduced commission and no commission. In addition, different commission models need to be associated with specific transport companies to meet the actual needs of their business operations. This highly customized settlement configuration not only increases the difficulty and complexity of management, but also greatly increases the risk of operational errors.
[0004] Especially at key points such as system upgrades or migrations, how to ensure that these highly customized settlement configurations can be efficiently and accurately migrated to the new system has become a technical problem that needs to be solved urgently. During the migration of settlement configurations, any minor error may lead to serious financial losses or even legal disputes. Therefore, it is crucial to ensure consistency and accuracy during the migration process. Although traditional manual inspection methods can detect problems to a certain extent, they are time-consuming, labor-intensive, inefficient, and difficult to achieve 100% accuracy, which cannot meet the high requirements of travel SaaS platforms for settlement configuration migration.
[0005] To this end, the present invention proposes a travel settlement prediction method and system for a SAAS platform. Summary of the invention
[0006] In view of this, the present invention hopes to provide a travel settlement prediction method and system for a SAAS platform to solve or alleviate the technical problems existing in the prior art, that is, how to develop a set of automated inspection prediction technology, and at least provide a beneficial option for this; the technical solution of the present invention is implemented as follows:
[0007] First, a travel settlement prediction method for a SAAS platform:
[0008] 1. Overview:
[0009] The present invention realizes refined management of project implementation and migration process by comprehensively using time series analysis technology and cost optimization strategy. First, advanced forecasting tools such as Holt-Winters seasonal model are used to accurately predict the implementation cost and migration cost of the project, while considering key factors such as trend and seasonality to improve the accuracy of the forecast. On this basis, by adjusting the smoothing parameters α, β, γ, etc., the forecasting model is optimized to better adapt to the actual situation of the project. At the same time, attention is paid to the use of time domain adjustment factors to ensure the comparability of cost data at different time points. Ultimately, it aims to quantify the economic benefits of the plan through the evaluation of the new implementation cost C1' and the new migration cost C2', provide a scientific basis for project decision-making, and achieve the dual goals of cost control and efficiency improvement, thereby promoting the smooth implementation and continuous optimization of the project.
[0010] (II) Technical solution:
[0011] In order to achieve the above technical objectives, the present invention selects to execute the following operation steps.
[0012] 2.1 Step S1, data preparation:
[0013] Collect historical data on implementation costs C1 and migration costs C2 in chronological order.
[0014] C1=[C11,C12,...,C1N];
[0015] C2=[C21,C22,...,C2N];
[0016] Among them, C11, C12, ..., C1N and C21, C22, ..., C2N are the historical data of implementation cost C1 and migration cost C2 in time series form respectively.
[0017] 2.2 Step S2, exponential smoothing model:
[0018] According to the characteristics of the implementation cost C1 and the migration cost C2 in the time series (characteristics are trend and seasonality), exponential smoothing is performed using the Holt-Winters seasonal model.
[0019] 3.2.1 Step S200, exponential smoothing mechanism:
[0020] The time series characteristics of the implementation cost C1 and the migration cost C2 in time are estimated using the Holt-Winters seasonal model by minimizing the mean square error MSE, using the historical data of the implementation cost C1 and the migration cost C2 for training, and estimating the smoothing parameter α of the horizontal component, the smoothing parameter β of the trend component, and the smoothing parameter γ of the seasonal component. Including:
[0021] (1) Horizontal calculation:
[0022] Among them, L t is the horizontal component at time t, y t is the observed value at time t, S t-s is the seasonal component at time ts (s is the length of the seasonal cycle), α is the smoothing parameter of the horizontal component (0≤α≤1), and L t-1 and T t-1 They are the level component and trend component at the previous time point respectively.
[0023] (2) Trend calculation: T t =β(L t -L t-1 )+(1-β)T t-1 ;
[0024] Among them, T t is the trend component at time t, and β is the smoothing parameter of the trend component (0≤β≤1).
[0025] (3) Seasonality calculation:
[0026] Among them, S t is the seasonal component at time t, and γ is the smoothing parameter of the seasonal component (0≤γ≤1).
[0027] (4) Calculate the mean square error (MSE) to guide:
[0028]
[0029] Where n is the number of observations, is the predicted value at time t, calculated by the model:
[0030]
[0031] Use the historical data of the time series of implementation cost C1 and migration cost C2 for training. When the preset number of training times is reached, find the smoothing parameter α of the horizontal component, the smoothing parameter β of the trend component, and the smoothing parameter γ of the seasonal component when the mean square error MSE is the smallest as the optimal model parameters.
[0032] 3.2.2 Step S201, perform exponential smoothing:
[0033] Apply the Holt-Winters seasonal model to the implementation cost C1 and migration cost C2 and obtain their respective forecast values.
[0034] (1) Apply the Holt-Winters seasonal model to the implementation cost C1:
[0035] (1.1) Level of implementation cost C1:
[0036] (1.2) Trend of implementation cost C1:
[0037] (1.3) Seasonality of implementation cost C1:
[0038] (1.4) Forecast of implementation cost C1:
[0039] in, and They represent the level, trend and seasonal components of the implementation cost C1 at time t. C1 , β C1 and γ C1 is the smoothing parameter corresponding to the implementation cost C1.
[0040] (2) Apply the Holt-Winters seasonal model to the migration cost C2:
[0041] (2.1) Horizontal equation of migration cost C2:
[0042] (2.2) Trend of migration cost C2:
[0043] (2.3) Seasonality of migration cost C2:
[0044] (2.4) Prediction of migration cost C2:
[0045] in, and They represent the level, trend and seasonal components of the migration cost C2 at time t. C2 , β C2 and γ C2 is the smoothing parameter corresponding to the migration cost C2.
[0046] 2.3 Step S3, make prediction:
[0047] Using the estimated model parameters and the exponential smoothing formula, the implementation cost C1 and migration cost C2 at future time points are predicted.
[0048] For the Holt-Winters seasonal model, the forecast formula involves the calculation of seasonal components, and the final output is the forecast values of implementation cost C1 and migration cost C2.
[0049] (1) Forecast of implementation cost C1:
[0050] (2) Prediction of migration cost C2:
[0051] in, and They represent the predicted values of implementation cost C1 and migration cost C2 at time point t+h respectively. and is the level component at the last estimated time point t, and is the corresponding trend component, and is the seasonal component, where m is the length of the seasonal cycle (for example, for monthly data, m is 12), and k is the number of seasons from the last full season to the forecast time point. Among them, h represents the forecast horizon, that is, the time interval from the future time point you want to predict to the present. For the Holt-Winters model, the currently estimated level component L t Add a trend component T of h time units t , and multiplied by the appropriate seasonal component to get the predicted value.
[0052] 2.4 Step S4, calculate the time domain adjustment factor T factor :
[0053] Calculate the time domain adjustment factor T factor The solution is to convert the predicted value and Compare with the cost value at a certain benchmark time point. The benchmark time point can be a specific point in the historical data, such as the actual cost value at the most recent time point, or the average value of multiple time points.
[0054] Assume that the actual cost value at the most recent time point is selected as the benchmark, denoted as and Respectively represent the actual values of the implementation cost C1 and the migration cost C2 at time point t. Then, the time domain adjustment factor T can be defined factor as follows:
[0055] For the implementation cost C1, the time domain adjustment factor T factor,C1 :
[0056] The time domain adjustment factor T for the migration cost C2 factor,CM :
[0057] 2.5 Step S5, application:
[0058] Based on the time domain adjustment factors C1 and C2, the new implementation cost C1' and the migration cost C2' are obtained:
[0059] CO′=T factor,CO ×CO;
[0060] CM'=T factor,CM ×CM;
[0061] (III) Mechanism for solving technical problems:
[0062] Time series forecasting methods such as the Holt-Winters seasonal model are used to forecast key indicators such as the equipment's operating status and failure rate. These models consider key factors such as trends and seasonality to improve the accuracy of forecasts. Smoothing parameter adjustment: By adjusting smoothing parameters such as α, β, γ, etc., the forecasting model is optimized to better adapt to the characteristics and changing patterns of equipment inspection data.
[0063] Based on the prediction results, the system can issue early warning information in real time to remind inspectors or relevant managers to pay attention to potential problems and take timely measures to avoid failures.
[0064] By integrating automated inspection technology and time series prediction technology, real-time monitoring, data analysis, anomaly identification, and prediction and early warning of target objects or areas are achieved. Its mechanism is to use advanced data collection and analysis tools, combined with time series prediction models, to conduct in-depth mining and accurate prediction of inspection data. Its principle is to capture the changing trends and seasonal laws of equipment operating status, discover potential problems in advance, provide a scientific basis for inspection work, improve inspection efficiency and accuracy, and reduce equipment failure rate.
[0065] Second, a travel settlement prediction system for SAAS platforms:
[0066] likeFigure 2 As shown, the system is used to implement the settlement prediction mentioned above, which includes:
[0067] (1) Data acquisition module: responsible for collecting data transmitted by various sensors (such as temperature sensors, humidity sensors, cameras, etc.) and drones, robots and other equipment. It provides raw data support for subsequent data analysis and prediction.
[0068] (2) Data transmission and storage module: Responsible for transmitting the collected data to the central processing unit or cloud platform in real time through the wireless transmission module, and storing and preprocessing it. This ensures the timeliness and accuracy of the data and provides a reliable data source for data analysis.
[0069] (3) Data analysis and processing module: Analyze and process the collected data using preset scripts, professional monitoring tools and related software modules to identify abnormal status or potential problems of the equipment. Provide accurate data support for the prediction module and generate inspection reports and abnormal alarms.
[0070] (4) Prediction module: Use time series prediction models (such as the Holt-Winters seasonal model) to provide prediction results of future equipment status, providing a basis for the formulation of inspection plans and maintenance decisions.
[0071] (5) Warning and notification module: Based on the results of the prediction module, early warning information is issued in real time, and the inspection personnel or relevant management personnel are notified through various means (such as SMS, email, APP push, etc.). This ensures that the inspection personnel or relevant management personnel can obtain equipment status information in a timely manner and take timely measures to avoid failures.
[0072] (6) User management module: responsible for user registration, login and permission management. Provide personalized services for different user roles to ensure the normal operation of the system.
[0073] Compared with the prior art, the present invention has the following beneficial effects:
[0074] 1. Improve inspection efficiency: The automated inspection technology of the present invention replaces the traditional manual inspection method, greatly reducing the manpower and time costs required for inspection. Real-time data collection and analysis make the inspection process faster and more accurate, and can promptly detect equipment anomalies or potential problems.
[0075] 2. Enhanced prediction accuracy: The application of the time series prediction model of the present invention, such as the Holt-Winters seasonal model, can accurately predict the operating status and failure rate of the equipment. By adjusting the smoothing parameters and optimizing the prediction model, it can better adapt to the characteristics and changing laws of the equipment inspection data, further improving the accuracy of the prediction.
[0076] 3. Improve equipment reliability: The establishment of the real-time early warning system of the present invention can issue early warning information in time before equipment failure occurs, reminding inspection personnel or relevant management personnel to take measures. It helps to avoid serious failures caused by untimely maintenance or repair of equipment, and improve the reliability and service life of equipment.
[0077] 4. Reduce maintenance costs: The automated inspection prediction technology of the present invention can detect equipment problems in advance, reducing maintenance costs and downtime caused by failures. Through predictive maintenance, maintenance plans can be reasonably arranged to avoid excessive or insufficient maintenance, further reducing maintenance costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0078] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0079] Figure 1 It is a schematic diagram of the method flow of the present invention;
[0080] Figure 2 It is a schematic diagram of the system composition of the present invention;
[0081] Figure 3 It is a schematic diagram of the data cleaning process of the present invention;
[0082] Figure 4 The figure is a schematic diagram of the execution framework of the method of the present invention. DETAILED DESCRIPTION
[0083] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the accompanying drawings. In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below;
[0084] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0085] Explanation of relevant terms:
[0086] (1) Implementation cost C1: This refers to the total cost required to implement a certain plan, project or program. It may include human, material, financial and other resource consumption. Implementation cost is an important indicator for evaluating project feasibility and economic benefits.
[0087] (2) Migration cost C2: Migration cost refers to the total cost required to migrate data, systems, applications or services from one environment to another (such as from a local server to the cloud). This includes the costs of data migration, system reconstruction, employee training, etc.
[0088] (3) Holt-Winters Seasonality Model: A time series forecasting model that is particularly suitable for time series data with seasonal fluctuations. It predicts future data points by considering three components: level (or base), trend, and seasonality. This model is widely used in the fields of retail and finance to predict sales, stock prices, etc.
[0089] (4) Smoothing parameter α: In time series forecasting models such as exponential smoothing, α is a parameter that controls the degree of influence of historical data on the current forecast value. The closer the α value is to 1, the more sensitive the model is to the most recent data; the closer the α value is to 0, the stronger the smoothing effect of the model on historical data.
[0090] (5) Smoothing parameter β of the trend component: In forecasting models that include a trend component, such as Holt-Winters, β is a parameter that controls the rate of change of the trend. It determines how the trend component adjusts over time to better adapt to changes in the data.
[0091] (6) Smoothing parameter γ of seasonal component: In forecasting models such as Holt-Winters that contain seasonal components, γ is a parameter that controls the rate of change of seasonal fluctuations. It helps the model better capture and predict seasonal patterns in the data.
[0092] (7) Trend: A trend refers to a long-term, sustained directional change in time series data. It can be upward, downward, or stable. Identifying and analyzing trends is essential for predicting future data trends.
[0093] (8) Seasonality: Seasonality refers to the periodic fluctuations in time series data caused by seasonal changes.
[0094] (9) Forecasting: Forecasting is the process of estimating future data values based on historical data and models.
[0095] (10) Time domain adjustment factor: The time domain adjustment factor is used in time series analysis to adjust the data at different time points to make them comparable.
[0096] (11) New implementation cost C1' and new migration cost C2': New implementation cost or new migration cost caused by technological progress, efficiency improvement or cost optimization after the implementation or migration of the solution. They are compared with the original implementation cost C1 and migration cost C2 to evaluate the economic benefits and improvement effects of the solution.
[0097] Embodiment 1: Figure 1 and Figure 4 As shown, this embodiment discloses an execution example of a travel settlement prediction method for a SAAS platform: In a SAAS online car-hailing platform, operation and maintenance management needs to accurately predict future implementation costs (such as server maintenance, software updates, etc.) and migration costs (such as data migration, system upgrades, etc.). By predicting these costs, the platform can better plan budgets and resources to ensure smooth operation and maintenance. First, data cleaning is performed, such as Figure 3 Then execute the following scheme.
[0098] In this embodiment, regarding step S1, data preparation:
[0099] Collect historical data on implementation costs C1 and migration costs C2 in chronological order.
[0100] C1=[C11,C12,...,C1N];
[0101] C2=[C21,C22,...,C2N];
[0102] Among them, C11, C12, ..., C1N and C21, C22, ..., C2N are the historical data of implementation cost C1 and migration cost C2 in time series form respectively.
[0103] In this embodiment, regarding step S2, exponential smoothing model: Since both the implementation cost and the migration cost may be affected by seasonal factors (such as the increase in system upgrade demand at the end of the year) and trend factors (such as the increase in server maintenance costs as the business grows), the Holt-Winters seasonal model is selected for exponential smoothing. According to the characteristics of the implementation cost C1 and the migration cost C2 in the time series (the characteristics are trend and seasonality), the Holt-Winters seasonal model is used to perform exponential smoothing.
[0104] Step S200, exponential smoothing mechanism:
[0105] The time series characteristics of the implementation cost C1 and the migration cost C2 in time are estimated using the Holt-Winters seasonal model by minimizing the mean square error MSE, using the historical data of the implementation cost C1 and the migration cost C2 for training, and estimating the smoothing parameter α of the horizontal component, the smoothing parameter β of the trend component, and the smoothing parameter γ of the seasonal component. Including:
[0106] (1) Horizontal calculation:
[0107] Among them, L t is the horizontal component at time t, y t is the observed value at time t, S t-s is the seasonal component at time ts (s is the length of the seasonal cycle), α is the smoothing parameter of the horizontal component (0≤α≤1), and L t-1 and T t-1 They are the level component and trend component at the previous time point respectively.
[0108] (2) Trend calculation: T t =β(L t -L t-1 )+(1-β)T t-1 ;
[0109] Among them, T t is the trend component at time t, and β is the smoothing parameter of the trend component (0≤β≤1).
[0110] (3) Seasonality calculation:
[0111] Among them, S t is the seasonal component at time t, and γ is the smoothing parameter of the seasonal component (0≤γ≤1).
[0112] (4) Calculate the mean square error (MSE) to guide:
[0113] Where n is the number of observations, is the predicted value at time t, calculated by the model:
[0114]
[0115] Use the historical data of the time series of implementation cost C1 and migration cost C2 for training. When the preset number of training times is reached, find the smoothing parameter α of the horizontal component, the smoothing parameter β of the trend component, and the smoothing parameter γ of the seasonal component when the mean square error MSE is the smallest as the optimal model parameters.
[0116] Step S201, perform exponential smoothing:
[0117] Apply the Holt-Winters seasonal model to the implementation cost C1 and migration cost C2 and obtain their respective forecast values.
[0118] (1) Apply the Holt-Winters seasonal model to the implementation cost C1:
[0119] (1.1) Level of implementation cost C1:
[0120] (1.2) Trend of implementation cost C1:
[0121] (1.3) Seasonality of implementation cost C1:
[0122] (1.4) Forecast of implementation cost C1:
[0123] in, and They represent the level, trend and seasonal components of the implementation cost C1 at time t. C1 , β C1 and γ C1 is the smoothing parameter corresponding to the implementation cost C1.
[0124] (2) Apply the Holt-Winters seasonal model to the migration cost C2:
[0125] (2.1) Horizontal equation of migration cost C2:
[0126] (2.2) Trend of migration cost C2:
[0127] (2.3) Seasonality of migration cost C2:
[0128] (2.4) Prediction of migration cost C2:
[0129] in, and They represent the level, trend and seasonal components of the migration cost C2 at time t. C2 , β C2 and γ C2 is the smoothing parameter corresponding to the migration cost C2.
[0130] In this embodiment, regarding step S3, a prediction is performed: using the estimated model parameters and the exponential smoothing formula, the implementation cost C1 and the migration cost C2 at a future time point (eg, the next 3 months) are predicted.
[0131] For the Holt-Winters seasonal model, the forecast formula involves the calculation of seasonal components, and the final output is the forecast values of implementation cost C1 and migration cost C2.
[0132] (1) Forecast of implementation cost C1:
[0133] (2) Prediction of migration cost C2:
[0134] in, and They represent the predicted values of implementation cost C1 and migration cost C2 at time point t+h, respectively. h is the number of forecast periods, i.e., the distance to the future time point we want to predict. and is the level component at the last estimated time point t, and is the corresponding trend component, and is the seasonal component, where m is the length of the seasonal cycle (e.g., for monthly data, m is 12), and k is the number of seasons from the last full season to the forecast time point. Among them, h represents the forecast horizon, that is, the time interval from the future time point you want to predict to the present. For the Holt-Winters model, the current estimated level component L t Add a trend component T of h time units t , and multiplied by the appropriate seasonal component to get the predicted value.
[0135] It is understandable that the automated inspection forecasting technology automatically adjusts model parameters and improves forecast accuracy by continuously monitoring and analyzing historical cost data. It can detect abnormal cost fluctuations in a timely manner and provide early warning for operation and maintenance management. Based on the Holt-Winters seasonal model, the automated inspection technology smoothes historical data through an exponential smoothing mechanism to capture trends and seasonal components. It optimizes model parameters by minimizing MSE to ensure that the forecast results are as close to the actual data as possible. It reduces manual intervention and improves forecasting efficiency. It accurately predicts future costs and provides a scientific basis for budget planning and resource allocation.
[0136] In this embodiment, regarding step S4, the time domain adjustment factor T is calculated factor :Calculate the time domain adjustment factor T factor The solution is to convert the predicted value and Compare with the cost value at a certain benchmark time point. The benchmark time point can be a specific point in the historical data, such as the actual cost value at the most recent time point, or the average value of multiple time points.
[0137] Assume that the actual cost value at the most recent time point is selected as the benchmark, denoted as and Respectively represent the actual values of the implementation cost C1 and the migration cost C2 at time point t. Then, the time domain adjustment factor T can be definedfactor as follows:
[0138] For the implementation cost C1, the time domain adjustment factor T factor,C1 :
[0139] The time domain adjustment factor T for the migration cost C2 factor,CM :
[0140] In this embodiment, regarding step S5, the following is applied:
[0141] Based on the time domain adjustment factors C1 and C2, the new implementation cost C1' and the migration cost C2' are obtained:
[0142] CO′=T factor,CO ×CO;
[0143] CM'=T factor,CM ×CM;
[0144] Based on the adjusted cost forecasts C1' and C2', formulate operation and maintenance management plans, such as budget allocation and resource scheduling.
[0145] Embodiment 2: Based on the solution provided in Embodiment 1, this embodiment further discloses the corresponding Python execution program as follows:
[0146] import numpy as np
[0147] from sklearn.model_selection import train_test_split
[0148] from sklearn.linear_model import LinearRegression
[0149] from sklearn.metrics import mean_squared_error
[0150] #data
[0151] #X is the input feature, y is the target variable
[0152] X=np.array([[1],[2],[3],[4],[5]])
[0153] y = np.array([2,3,5,7,11])
[0154] # Split the dataset into training and testing sets
[0155] X_train,X_test,y_train,y_test=train_test_split(X,y,test_size=0.2,random_state=42)
[0156] # Initial model
[0157] model=LinearRegression()
[0158] # Use the training set to train the model
[0159] model.fit(X_train,y_train)
[0160] # Use the test set to make predictions
[0161] y_pred=model.predict(X_test)
[0162] # Calculate and output mean square error
[0163] mse=mean_squared_error(y_test,y_pred)
[0164] print(f"Mean Squared Error:{mse}")
[0165] # Output the coefficients and intercept of the model
[0166] print(f"Coefficient:{model.coef_}")
[0167] print(f"Intercept:{model.intercept_}")
[0168] # Use the trained model to make new predictions
[0169] new_X = np.array([[6]])
[0170] new_pred=model.predict(new_X)
[0171] print(f"Prediction for input 6:{new_pred}")
[0172] In the above program: X is the input feature and y is the target variable. Use the train_test_split function to split the dataset into training and test sets. test_size = 0.2 means that 20% of the data will be used for testing and the rest for training.
[0173] Create a LinearRegression object, which will be used to fit the linear regression model. Use the fit method to pass in the features of the training set and the target variable to train the linear regression model.
[0174] Use the predict method to predict the test set and get the predicted value y_pred. Use mean_squared_error to calculate the mean square error (MSE) between the predicted value and the true target value, which is a common indicator for evaluating the performance of regression models.
[0175] Output the model's coefficients (coef_) and intercept (intercept_), which define the linear regression equation: y = coef_*X+intercept_. Use the trained model to make predictions for new input data.
[0176] All the above embodiments only express the implementation methods of the relevant practical applications of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be based on the attached claims.
[0177] For those skilled in the art, it can be further appreciated that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0178] At the same time, those skilled in the art can understand that all or part of the processes in all the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media provided in this application and used in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double-speed data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
Claims
1. A travel settlement prediction method for a SAAS platform, characterized in that: The steps include: S1, collects historical data of implementation cost C1 and migration cost C2 in chronological order; S2, exponential smoothing is performed using the Holt-Winters seasonal model based on the characteristics of the implementation cost C1 and the migration cost C2 in the time series; S3, using the estimated model parameters and exponential smoothing formula, forecast the implementation cost C1 and migration cost C2 at future time points; S4, the predicted value and Compare with the cost value at a certain benchmark time point and calculate the time domain adjustment factor T factor ; S5, based on the time domain adjustment factors C1 and C2, a new implementation cost C1' and an information migration cost C2' are obtained.
2. The travel settlement prediction method according to claim 1, characterized in that: The execution method of S1 includes: C1=[C11,C12,...,C1N]; C2=[C21,C22,...,C2N]; Among them, C11, C12, ..., C1N and C21, C22, ..., C2N are the historical data of implementation cost C1 and migration cost C2 in time series form respectively.
3. The travel settlement prediction method according to claim 1, characterized in that: In S2, the mechanism of the Holt-Winters seasonal model includes estimating by minimizing the mean square error MSE, training using historical data of implementation cost C1 and migration cost C2, and estimating the smoothing parameter α of its horizontal component, the smoothing parameter β of the trend component, and the smoothing parameter γ of the seasonal component.
4. The travel settlement prediction method according to claim 3, characterized in that: The calculation of the Holt-Winters seasonal model includes: Horizontal calculation: Among them, L t is the horizontal component at time t, y t is the observed value at time t, S t-s is the seasonal component at time ts, α is the smoothing parameter of the horizontal component, and L t-1 and T t-1 They are the level component and trend component at the previous time point respectively; Trend calculation: T t =β(L t -L t-1 )+(1-β)T t-1 ; Among them, T t是 The trend component at time t, β is the smoothing parameter of the trend component; Seasonality calculations: Among them, S t is the seasonal component at time t, γ is the smoothing parameter of the seasonal component; Calculate the mean square error MSE to guide: Where n is the number of observations, is the predicted value at time t, calculated by the model:
5. The travel settlement prediction method according to claim 3, characterized in that: The exponential smoothing method for the Holt-Winters seasonal model includes: Apply the Holt-Winters seasonality model to the implementation cost C1: Level of implementation cost C1: Trends in implementation costs C1: Seasonality of implementation cost C1: Forecast of implementation cost C1: in, and Respectively represent the level, trend and seasonal components of the implementation cost C1 at time t; α C1 , β C1 and γ C1 is the smoothing parameter corresponding to the implementation cost C1; Apply the Holt-Winters seasonality model to the migration cost C2: The horizontal equation of the migration cost C2 is: Trend of migration cost C2: Seasonality of migration cost C2: Prediction of migration cost C2: in, and Respectively represent the level, trend and seasonal components of the migration cost C2 at time t; α C2 , β C2 and γ C2 is the smoothing parameter corresponding to the migration cost C2.
6. The travel settlement prediction method according to claim 1, characterized in that: The execution steps of S3 include: Forecast of implementation cost C1: Forecast of migration cost C2: in, and They represent the predicted values of implementation cost C1 and migration cost C2 at time point t+h, respectively; h is the number of forecasted forward periods; and is the level component at the last estimated time point t, and is the corresponding trend component, and is the seasonal component, where m is the length of the seasonal cycle and k is the number of seasons from the last full season to the prediction time point.
7. The travel settlement prediction method according to claim 1, characterized in that: The execution step of S4 includes: assuming that the actual cost value at the most recent time point is selected as the benchmark, denoted as and Respectively represent the actual values of implementation cost C1 and migration cost C2 at time point t; time domain adjustment factor T factor as follows: For the implementation cost C1, the time domain adjustment factor T factor,C1 : The time domain adjustment factor T for the migration cost C2 factor,CM :
8. The travel settlement prediction method according to claim 1, characterized in that: Based on the time domain adjustment factors C1 and C2, the new implementation cost C1' and the migration cost C2' are obtained: WHAT′=T factor,CO ×WHAT; CM’=T factor,CM ×CM。 9. A system for implementing the travel settlement prediction method according to any one of claims 1 to 8, characterized in that: The system comprises: Data acquisition module: responsible for collecting data from various sensors; Data transmission and storage module: responsible for transmitting the collected data to the central processing unit or cloud platform in real time through the wireless transmission module, and performing storage and preprocessing; Data analysis and processing module: Analyze and process the collected data to identify abnormal status or potential problems of the equipment; Prediction module: provides prediction results of future equipment status.
10. The system according to claim 9, characterized in that: It also includes an early warning and notification module: based on the results of the prediction module, early warning information is issued in real time.