Site resource scheduling method and device, equipment and storage medium
By monitoring site resource status and predicting service traffic in real time, and dynamically adjusting network resources and loads, the challenges of multi-site layout and resource scheduling in the Internet of Vehicles cloud platform are solved, and stable and efficient network services are achieved.
Patent Information
- Application Number
- CN202311464928.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-06
- Publication Date
- 2025-05-06
AI Technical Summary
In the Internet of Vehicles cloud platform, in order to provide stable and efficient services, multi-site layout strategies and refined resource monitoring and dynamic scheduling are needed, especially when the traffic of the site access point continues to increase, real-time and effective scheduling is required in a timely and effective manner.
By monitoring the resource status information of the current site in real time, including resource usage data and historical network data, the trained request prediction model predicts the expected service traffic of the current site in the future, and dynamically adjusts the network resources and/or network load of the corresponding access point of the site when the expected service traffic is greater than the traffic threshold.
It realizes the prediction of expected service traffic for the site in the future based on the resource status information collected in real time, and dynamically schedules when the traffic exceeds the threshold, thus providing stable and efficient network services for networked vehicles.
Smart Images

Figure CN119945993A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to, but is not limited to, the field of resource scheduling technology, and in particular to a site resource scheduling method, device, equipment, and storage medium. Background Art
[0002] In the Internet of Vehicles cloud platform solution, in order to provide more stable and efficient services, a multi-site layout strategy is required. The various sites are distributed in different geographical areas across the country, and each site can scale up and down according to traffic, ensuring the normal operation of services while maximizing economic benefits.
[0003] However, in order to ensure that connected vehicles are provided with stable and efficient network services, refined resource monitoring and dynamic scheduling are also needed. In particular, when the traffic at site access points continues to increase, real-time and effective scheduling is required in a timely manner. Summary of the invention
[0004] In view of this, embodiments of the present application at least provide a site resource scheduling method, apparatus, device, and storage medium.
[0005] The technical solution of the embodiment of the present application is implemented as follows:
[0006] In a first aspect, an embodiment of the present application provides a site resource scheduling method, the method comprising:
[0007] Real-time monitoring of resource status information of the current site; wherein the resource status information includes at least resource usage data and historical network data; based on the historical network data, predicting the expected service traffic of the current site in a first time period after the current moment through a trained request prediction model; wherein the request prediction model is trained using a feature sequence sample set for traffic prediction of the current site in a preset time period; in response to the expected service traffic being greater than a traffic threshold, dynamically adjusting the network resources and / or network load of the access point corresponding to the current site.
[0008] In a second aspect, an embodiment of the present application provides a site resource scheduling device, the device comprising:
[0009] An information monitoring module, used to monitor the resource status information of the current site in real time; wherein the resource status information at least includes resource usage data and historical network data;
[0010] A traffic prediction module, configured to predict the expected service traffic of the current site within a first time period after the current moment based on the historical network data and using a trained request prediction model; wherein the request prediction model is trained using a feature sequence sample set for traffic prediction of the current site within a preset time period;
[0011] The resource scheduling module is used to dynamically adjust the network resources and / or network load of the access point corresponding to the current site in response to the expected service traffic being greater than the traffic threshold.
[0012] In a third aspect, an embodiment of the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program that can be executed on the processor, and when the processor executes the program, some or all of the steps in the above method are implemented.
[0013] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which implements some or all of the steps in the above method when executed by a processor.
[0014] In an embodiment of the present application, first, the resource status information of the current site is monitored in real time; wherein, the resource status information includes at least resource usage data and historical network data; then, based on the historical network data, the expected service traffic of the current site in the first time period after the current moment is predicted through a trained request prediction model; wherein, the request prediction model is trained using a feature sequence sample set for traffic prediction of the current site in a preset time period; finally, in response to the expected service traffic being greater than a traffic threshold, the network resources and / or network load of the access point corresponding to the current site are dynamically adjusted; in this way, the expected service traffic of the current site in a future period of time is predicted based on the resource status information collected in real time, and the site resources are dynamically scheduled when the expected service traffic is greater than the traffic threshold, thereby providing stable and efficient network services for networked vehicles through refined resource monitoring and dynamic scheduling.
[0015] It should be understood that the above general description and the following detailed description are merely exemplary and explanatory, and are not intended to limit the technical solutions of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and are used together with the specification to illustrate the technical solution of the present application.
[0017] Figure 1 A schematic diagram of a flow chart of a site resource scheduling method provided in an embodiment of the present application;
[0018] Figure 2 A flowchart of another site resource scheduling method provided in an embodiment of the present application;
[0019] Figure 3 A flowchart of another site resource scheduling method provided in an embodiment of the present application;
[0020] Figure 4 A system block diagram of a site resource scheduling method provided in an embodiment of the present application;
[0021] Figure 5 A schematic diagram of the structure of the traffic prediction model provided in the embodiment of the present application;
[0022] Figure 6 A schematic diagram of a method for splitting a data set of time series data provided in an embodiment of the present application;
[0023] Figure 7 A schematic diagram of the structure of a site resource scheduling device provided in an embodiment of the present application;
[0024] Figure 8 A hardware entity diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0025] In order to make the purpose, technical solutions and advantages of the present application clearer, the technical solutions of the present application are further elaborated in detail below in conjunction with the drawings and embodiments. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.
[0026] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0027] The terms "first / second / third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It is understandable that "first / second / third" can be interchanged with a specific order or sequence where permitted so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0028] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing this application and are not intended to limit this application.
[0029] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are described first. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.
[0030] The embodiment of the present application provides a site resource scheduling method, which can be executed by a processor of a computer device. The computer device may refer to a server, a laptop, a tablet computer, a desktop computer, a smart TV, a set-top box, a mobile device (such as a mobile phone, a portable video player, a personal digital assistant, a dedicated messaging device, a portable gaming device), or other device with site resource scheduling capabilities. Figure 1 An optional flow chart of a site resource scheduling method provided in an embodiment of the present application, such as Figure 1 As shown, the method includes the following steps S110 to S130:
[0031] Step S110, obtaining and monitoring the resource status information of the current site in real time.
[0032] Here, the resource status information includes at least resource usage data and historical network data; wherein the resource usage data includes but is not limited to the utilization rate of the central processing unit (CPU), the memory usage, the network bandwidth usage, etc.; the historical network data may be the network traffic requested or accessed by the load vehicles connected to the current site.
[0033] In implementation, a resource monitor may be deployed within the site, and resource usage data and historical network data of the current site may be collected through the resource monitor.
[0034] Step S120: Based on the historical network data, the expected service traffic of the current site in a first time period after the current moment is predicted by using the trained request prediction model.
[0035] Here, the first time period is a future time period after the current moment, for example, 5 to 10 minutes in the future. The real-time monitored historical network data is input into the trained request prediction model to obtain the expected service traffic predicted by the model.
[0036] The request prediction model is trained using a feature sequence sample set for traffic prediction at the current site within a preset time period; wherein the preset time period is a past period of time earlier than the current period, such as the past year or the past quarter; the feature sequence sample set is time-based sequence feature data, such as API access data within a year, API popularity within a quarter, etc.
[0037] Step S130: In response to the expected service traffic being greater than a traffic threshold, dynamically adjusting network resources and / or network load of an access point corresponding to the current site.
[0038] Here, the traffic threshold is a pre-set threshold, which can be determined based on the maximum network traffic of the current site based on historical statistics, or based on the available resources of the current site, and the embodiments of the present application are not limited to this.
[0039] In some implementations, when the resources of the primary access point in the current site cannot meet the expected service traffic, the resources of the secondary access point in the current site are expanded through the scheduler, and more service traffic is allocated to the secondary access point through DNS scheduling; in some implementations, when the expected service traffic is greater than the maximum network traffic of the current site, that is, the resources of the two sites in the current site cannot meet the expected service traffic, the network load of the current site is controlled to be connected to other sites.
[0040] In an embodiment of the present application, first, the resource status information of the current site is monitored in real time; wherein, the resource status information includes at least resource usage data and historical network data; then, based on the historical network data, the expected service traffic of the current site in the first time period after the current moment is predicted through a trained request prediction model; wherein, the request prediction model is trained using a feature sequence sample set for traffic prediction of the current site in a preset time period; finally, in response to the expected service traffic being greater than a traffic threshold, the network resources and / or network load of the access point corresponding to the current site are dynamically adjusted; in this way, the expected service traffic of the current site in a future period of time is predicted based on the resource status information collected in real time, and the site resources are dynamically scheduled when the expected service traffic is greater than the traffic threshold, thereby providing stable and efficient network services for networked vehicles through refined resource monitoring and dynamic scheduling.
[0041] In some embodiments, the request prediction model includes an encoder and a decoder, and the above step S120 "based on the historical network data, using the trained request prediction model to predict the expected service traffic of the current site in the first time period after the current moment" may include the following steps S121 to S123:
[0042] Step S121, performing data preprocessing on the historical network data to extract time series data.
[0043] Here, the process of data preprocessing involves creating and processing features that can better represent potential problems, thereby improving the performance of the request prediction model. For example, it can be a feature engineering step on the data, that is, using a series of engineering methods to filter out better data features from the original collected historical network data.
[0044] The time series data includes but is not limited to at least one of the following features: API visits, day of the week, annual autocorrelation and quarterly autocorrelation (used to capture cyclical changes in traffic at the annual and quarterly levels), API popularity (this feature represents the popularity of the API, that is, the scale of API visits), and lagged comprehensive access traffic (this is a lagged feature that represents the total visits over a period of time in the past).
[0045] The above steps are intended to create a richer and more representative feature set so that the request prediction model can better learn and predict API traffic.
[0046] Step S122, encoding the time series data through the encoder to obtain flow feature code.
[0047] Here, the main task of the encoder is to receive and process the input and convert it into a traffic feature encoding, which is an internal representation that can capture the key information in the time series data.
[0048] In some embodiments, cuDNN GRU (Gated Recurrent Unit) can be used as an encoder. cuDNN is a GPU acceleration library developed by NVIDIA for deep neural networks, which can greatly improve the operation speed of GRU. Compared with native Tensorflow RNNCells, cuDNN works 5 to 10 times faster, which enables the traffic prediction model to process large amounts of time series data more efficiently.
[0049] Step S123, predicting the traffic feature code through the decoder and performing linear transformation on the prediction result to obtain the expected service traffic of the current site in the first time period.
[0050] Here, we can use TF GRUBlockCell as the decoder, which is wrapped in the tf.while_loop() construct. This means that the decoder works in a loop, and at each step it gets the intermediate prediction result from the previous step and uses it as the input feature of the current step. This mechanism enables the decoder to take into account the information of the previous step at each step of generating the feature sequence, thereby generating more accurate predictions.
[0051] In the above embodiment, the historical network data is preprocessed and time series data is extracted, so that the traffic prediction model can better process the time series data and effectively predict the traffic of the Internet of Vehicles service. The model structure including the encoder and the decoder can maintain high accuracy while also having high computational efficiency.
[0052] In some embodiments, the current site includes a primary access point and a secondary access point. Figure 2 An optional flow chart of a site resource scheduling method provided in an embodiment of the present application, such as Figure 2 As shown, the method includes the following steps S210 to S240:
[0053] Step S210: monitor the resource status information of the current site in real time.
[0054] Here, the resource status information at least includes resource usage data and historical network data.
[0055] Step S220: Based on the historical network data, the expected service traffic of the current site in a first time period after the current moment is predicted by using the trained request prediction model.
[0056] Here, the request prediction model is trained using a feature sequence sample set for traffic prediction at the current site within a preset time period.
[0057] Here, the above steps S210 to S220 correspond to the above steps S110 to S120 respectively, and the specific implementation of the above steps S110 to S120 may be referred to during implementation.
[0058] Step S230: When the network resources corresponding to the expected service flow are greater than the remaining resources of the primary access point, the network resources of the secondary access point are expanded.
[0059] Here, usually, the resources of the primary access point and the secondary access point in a site are pre-deployed, and the resources of the primary access point are much greater than the resources of the secondary access point. The network resources corresponding to the expected service flow are greater than the remaining resources of the primary access point, indicating that the primary access point of the current site can no longer meet the demand, so the resources of the secondary access point can be expanded to meet more service flow.
[0060] In implementation, the resources in the cloud service provider can be used to expand the capacity of the secondary access points in the current site.
[0061] Step S240: dynamically allocating the expected service traffic to the secondary access points according to a preset ratio through DNS scheduling.
[0062] Here, the preset ratio may be an empirical value determined using historical data, and may be adjusted according to actual conditions. It should be noted that the current site originally deployed has more primary access point resources and fewer secondary access point resources, and most of the service traffic is dispatched to the resources corresponding to the primary access point. After the secondary access point resources are expanded, more service traffic can be dynamically allocated to the secondary access point.
[0063] It should be noted that DNS scheduling redirects user requests to other service nodes, namely secondary access points, within the current site by changing DNS records. When the resources of the primary access point cannot meet the demand, the traffic of the primary access point can be switched to other normally operating secondary access points by changing the DNS records, thereby ensuring service continuity and high availability.
[0064] In the above embodiment, when the network resources corresponding to the expected service traffic are greater than the remaining resources of the primary access point, the resources of the secondary access point are expanded, and fast and flexible network traffic switching is achieved through DNS scheduling, ensuring that the vehicle can obtain stable and efficient networking services under any circumstances.
[0065] In some embodiments, Figure 3 An optional flow chart of a site resource scheduling method provided in an embodiment of the present application, such as Figure 3 As shown, the method includes the following steps S310 to S330:
[0066] Step S310: monitor the resource status information of the current site in real time.
[0067] Here, the resource status information at least includes resource usage data and historical network data.
[0068] Step S320: Based on the historical network data, the expected service traffic of the current site in a first time period after the current moment is predicted by using the trained request prediction model.
[0069] Here, the request prediction model is trained using a feature sequence sample set for traffic prediction at the current site within a preset time period.
[0070] Here, the above steps S310 to S320 correspond to the above steps S110 to S120 respectively, and the specific implementation of the above steps S110 to S120 may be referred to during implementation.
[0071] Step S330, when the network resources required for the expected service flow are greater than the remaining resources of the current site and the expected service flow continues to increase, determine the target vehicle within the range of the current site.
[0072] Here, the target vehicle is a vehicle that will be active in the second time period after the current moment. The active time of all vehicles within the current site range can be predicted by model training, and then the target vehicle that will be active in the second time period can be determined. The second time period can be within the next 5 to 10 minutes, which is determined according to actual conditions, and the embodiment of the present application does not limit this.
[0073] When the resources of the current site cannot meet the demand corresponding to the expected service traffic, the embodiment of the present application triggers reverse scheduling for the target vehicle that is about to access the current site, aiming to reduce the network load of the current site to ensure the stable operation of the vehicle network.
[0074] Step S340, controlling the target vehicle to access the candidate site.
[0075] Here, the candidate site and the current site are located in the same city, and the remaining resources of the candidate site are greater than the remaining resources of the current site.
[0076] It should be noted that the embodiment of the present application is applied to the multi-site mode of the Internet of Vehicles platform and supports the dual-active mode in the same city, that is, two sites are set up in the same city, and they can back up each other. Under normal circumstances, both sites provide services to the outside world and can share loads, thereby improving the processing capacity and efficiency of the system. When a site fails, another site can take over all services to ensure uninterrupted services.
[0077] In the above embodiment, when the resources of the two access points in the current site are unable to meet the demand and the expected service traffic predicted by the traffic prediction model will continue to increase, the load resources of the current site can be predicted and reversely controlled to guide new vehicle data to other candidate sites with lower loads to reduce the network load of the current site. This achieves dynamic scheduling of the site's load resources and can ensure that stable and efficient network services are provided to networked vehicles accessing the current site.
[0078] In some embodiments, the above step S340 is further implemented by the following steps: sending a remote configuration instruction to the target vehicle so that the target vehicle accesses the candidate site; wherein the remote configuration instruction is used to modify the access point name accessed by the target vehicle to the access point name corresponding to the candidate site.
[0079] Here, the remote configuration instruction is used to modify the access point name to which the target vehicle is connected to to the access point name (APN) corresponding to the candidate site. The APN name refers to a network access technology, which is the access point name used when connecting to a data network, and is usually provided by a service provider. For example, in China Mobile's network, the APN name can be cmnet or cmwap.
[0080] It should be noted that each vehicle's SIM card package is configured with multiple APNs, and each APN can access different Internet of Vehicles cloud platform sites. Different access points have different access ranges and access methods, that is, the APN determines what kind of network the vehicle accesses through which access method.
[0081] In some implementations, the “determining a target vehicle within the current site range” in the above step S330 includes the following steps S331 to S333:
[0082] Step S331, obtaining vehicle activity status data of all vehicles within the current site range.
[0083] Here, the vehicle activity status data of each vehicle itself can be collected by deploying a vehicle activity monitor.
[0084] Step S332: Based on the vehicle activity status data, active time prediction is performed on all the vehicles using a trained vehicle activity prediction model.
[0085] Here, the vehicle activity prediction model is obtained by training a model constructed by at least two decision trees using feature data extracted from online status samples of the vehicle.
[0086] Step S333: determining the target vehicle that will be active in the second time period based on the prediction result.
[0087] Here, the model is used to predict the active time of all vehicles within the current site range, and then the target vehicles that meet the active conditions in the second time period are screened out.
[0088] In some embodiments, the vehicle activity status data includes at least the following data: vehicle identification number, online date and time, online status, daily online times, weekly online times, average online time in the past 7 days, and average online time in the past 30 days.
[0089] Here, the vehicle activity status data can be organized into the following format:
[0090] vehicle_id,date_time,online_status,time_of_day,day_of_week,avg_online_last_7_days,avg_online_last_30_days
[0091] {1,2023-05-13 00:00:00,1,0,0,0.5,0.6
[0092] 1,2023-05-13 00:05:00,1,1,0,0.5,0.6
[0093] 1,2023-05-13 00:10:00,0,2,0,0.5,0.6
[0094] 1,2023-05-13 00:15:00,0,3,0,0.5,0.6 ...
[0096] 2,2023-05-13 00:00:00,0,0,0,0.3,0.4
[0097] 2,2023-05-13 00:05:00,0,1,0,0.3,0.4
[0098] 2,2023-05-13 00:10:00,1,2,0,0.3,0.4
[0099] ...}
[0100] In some embodiments, the vehicle activity prediction model is trained through the following process: obtaining a vehicle online status data sample; processing the vehicle online status data sample through each decision tree to obtain a corresponding first prediction result; determining a target loss based on the sum of the first prediction results corresponding to each of the at least two decision trees; and optimizing and updating the parameters of the at least two decision trees using the target loss until a preset number of iterations is reached to obtain the trained vehicle activity prediction model.
[0101] In the implementation, the prediction of whether the vehicle will be active in the second time period is modeled as a binary classification problem (running or not running) using the XGBoost algorithm (eXtreme Gradient Boosting). XGBoost is an ensemble learning algorithm based on the gradient boosting method. Its core idea is to create a more powerful and accurate prediction model by combining multiple simple base learners (usually decision trees). One possible way is to store the vehicle's online status sample data in the Hadoop cluster and directly model and predict through the Spark-XGBoost library.
[0102] The site resource scheduling method is described below in conjunction with a specific embodiment. However, it should be noted that the specific embodiment is only for better illustrating the present application and does not constitute an improper limitation on the present application.
[0103] Figure 4 A system block diagram of a site resource scheduling method provided in an embodiment of the present application, such as Figure 4As shown in the figure, in order to provide more stable and efficient services, a multi-site layout strategy is adopted in the Internet of Vehicles cloud platform. The sites are distributed in different geographical areas across the country. Each site can scale up and down according to the traffic, maximizing economic benefits while ensuring the normal operation of the service. When selecting the geographical location of the site, the following factors are mainly considered: First, considering the user distribution and driving path, the area with the most users is selected as the site location. Second, considering the stability and speed of data transmission, the area with complete network infrastructure is selected as the site location.
[0104] Inside each station, there is a dispatch center responsible for monitoring and dispatching resources within the station and synchronizing the load index of each dispatch center. The dispatch center includes a resource monitor 41, a real-time request predictor 42, a vehicle activity monitor 43, a resource scheduler 44 and a reverse control scheduler 45.
[0105] The resource monitor 41 is responsible for collecting the resource usage of the site, such as CPU usage, memory usage, network bandwidth usage, etc. This information is used to update the request prediction model and real-time resource scheduling.
[0106] The real-time request predictor 42 predicts the expected service flow of the site in the next 5 to 10 minutes based on the data provided by the resource monitor 41 through the request prediction model 401. If the predicted flow exceeds the set threshold, the real-time request predictor 42 will notify the resource scheduler 44.
[0107] The vehicle activity monitor 43 load collects vehicle online status data, such as vehicle number, date and time, online status (0 / 1), daily online times, weekly online times, average online time in the past 7 days, average online time in the past 30 days, etc. These data are used to provide to the vehicle activity prediction model 402, and the vehicle activity prediction model 402 predicts the target vehicle that will be started in the next 5 to 10 minutes.
[0108] The resource scheduler 44 dynamically adjusts the resources of the access points (including the primary access point and the secondary access point) in the current site according to the prediction results of the real-time request predictor 42. If the resources of the primary access point can no longer meet the demand, the scheduler will expand the resources of the secondary access point and allocate more network traffic to the secondary access point through DNS scheduling. If the resources of both access points can no longer meet the demand, and the traffic predicted by the real-time request predictor 42 will continue to increase, the resource scheduler 44 will notify the reverse control scheduler 45 to perform reverse control.
[0109] The main task of the reverse control scheduler 45 is to reduce the network load of the site. After receiving the reverse control request from the resource scheduler 44, the reverse control scheduler 45 will send a remote configuration instruction to the target vehicle to modify the APN accessed by the target vehicle so that the target vehicle can access other candidate sites with lighter loads, where the target vehicle is predicted by the vehicle activity prediction model 402.
[0110] Based on the multi-site layout strategy deployed in the Internet of Vehicles cloud platform, through the two prediction algorithms of vehicle active time prediction and vehicle service flow prediction, the corresponding scheduling mode is combined to access different sites, which can realize load prediction reverse control and multi-site elastic scaling.
[0111] The first prediction algorithm: prediction of vehicle active time, that is, the vehicle activity prediction model obtained by modeling with the XGBoost algorithm, predicts whether the vehicle will be active after a certain period of time and determines the target vehicle.
[0112] In implementation, the prediction of whether a vehicle will be active in 5 minutes can be modeled as a binary classification problem (running or not running) using the XGBoost algorithm. XGBoost (eXtreme Gradient Boosting) is an ensemble learning algorithm based on the gradient boosting method. Its core idea is to create a more powerful and accurate prediction model by combining multiple simple base learners (usually decision trees). XGBoost introduces a series of optimizations and improvements based on the boosting tree model, with higher prediction performance and speed.
[0113] Using the XGBoost algorithm, the prediction scores of each individual decision tree are added together to get . . . , an important fact is that the two trees try to complement each other. Mathematically, the vehicle activity prediction model can be written as the following example in formula (1):
[0114]
[0115] in, is the output of the vehicle activity prediction model, x i is the input data, which represents the vehicle status data corresponding to the i-th vehicle, f k (x i ) is the learning result of the kth decision tree, K is the number of trees, f is a function in the function space F, representing the abstract structure of the tree, and F is the set of possible classification and regression trees (CART). The objective function of the above vehicle activity prediction model is given by the following formula (2):
[0116]
[0117] Among them, the first is the loss function, y i is the actual output result for the i-th sample,
[0118] is the output result of the activity prediction model for the i-th sample vehicle, n is the number of samples; the second term is the regularization parameter.
[0119] The second prediction algorithm is: prediction of Internet of Vehicles service traffic, that is, in the real-time request predictor 42, based on the data provided by the resource monitor 41, predicting the network traffic of the current site in the future period of time, that is, the expected service traffic.
[0120] To predict the traffic of Internet of Vehicles services, there are two main sources of information: local features and global features. Local features are specific patterns and trends observed in a short period of time, including autoregressive models, moving average models, and periodic models; global features are traffic patterns observed over a longer period of time. These patterns can be captured through the global autocorrelation graph: annual autocorrelation, correlation within the cycle. To predict the traffic of Internet of Vehicles services, it is necessary to make full use of information from both local and global features, and combine different statistical models such as autoregressive models, moving average models, and periodic models to accurately predict future traffic.
[0121] Feature engineering is an extremely important step in machine learning, which involves creating and processing features that can better represent the underlying problem, thereby improving the performance of the model. The following are some of the features used when dealing with the task of traffic prediction for connected vehicle services:
[0122] API visits: This is the target variable, which represents the number of visits to each API at a specific time. Since the original number of visits may be unevenly distributed, the log1p() function can be used to transform it so that the distribution of the number of visits is closer to a normal distribution rather than a skewed one. After this processing, the learning effect of the request prediction model is usually better.
[0123] Day of the week: This is a temporal feature that captures weekly periodicity. For example, there may be some APIs that have higher traffic on weekdays and lower traffic on weekends. By adding this feature, the request prediction model can learn this periodic pattern.
[0124] Annual autocorrelation and quarterly autocorrelation: These two features are used to capture the cyclical changes in traffic at the annual and quarterly levels. For example, some APIs may have particularly high traffic at the end of the year or the end of the quarter. The request prediction model can learn this cyclical change through these features.
[0125] API popularity: This feature represents the popularity of the API, that is, the scale of API visits. High-popularity and low-popularity APIs may have different traffic change patterns. For example, popular APIs may have more visit peaks. Through this feature, the traffic prediction model is required to learn the traffic patterns of APIs with different popularity.
[0126] Lagged comprehensive visit traffic: This is a lagged feature that represents the total visits over a period of time. This feature can help the request prediction model capture short-term trends and patterns in traffic.
[0127] Through the above feature engineering steps, a richer and more representative feature set can be created, enabling the traffic prediction model to better learn and predict API traffic.
[0128] Feature preprocessing is an essential step in machine learning. It can transform raw data into a form that the model can better understand. When predicting the traffic of Internet of Vehicles services, the following feature preprocessing can be performed:
[0129] Feature normalization: To eliminate the impact of magnitude differences between different features on the model, all features (including those obtained through one-hot encoding) are normalized to zero mean and unit variance. In this process, each API access series is normalized independently.
[0130] Feature stretching: For time-independent features, such as autocorrelation, country, etc., they are "stretched" to the length of the time series. That is, these features are repeated so that they have values at each time point. This is achieved by using the tf.tile() function in TensorFlow.
[0131] Random sample sampling: During model training, random fixed-length samples are sampled from the original time series. For example, if the original time series is 600 days long and a 200-day sample is used for training, a point will be randomly selected from the first 400 days as the start of the sample. This approach can be used as an effective data augmentation mechanism because the training code randomly selects the starting point of each time series at each step, thus generating an endless and almost non-repeating stream of data.
[0132] In general, the above feature preprocessing not only eliminates the magnitude differences between different features, making the model easier to learn, but also increases the diversity of training data through random sample sampling, which helps to improve the generalization ability of the model.
[0133] When predicting the traffic volume of Internet of Vehicles services, the Recurrent Neural Network (RNN) Seq2Seq (sequence to sequence) model can be used for prediction. Seq2Seq uses RNN units, generally Long Short-Term Memory (LSTM) and Gate Recurrent Unit (GRU). This model can generate another sequence based on a given sequence through a specific generation method, and the two sequences can be of different lengths. This structure is also called an encoder-decoder model.
[0134] In some embodiments, Figure 5 As shown, the traffic prediction model provided in the embodiment of the present application is composed of two parts: an encoder 51 and a decoder 52. The functions and structures of the two parts are as follows:
[0135] Encoder 51: The main task of encoder 51 is to receive and process the input time series data 501, and convert it into a traffic feature code, i.e., an internal representation, which can capture the key information in the input sequence. In the traffic prediction model provided in the embodiment of the present application, an n-layer cuDNN GRU (Gated Recurrent Unit) can be used as an encoder, and the input of the i-th layer GRU is X i , i is a natural number between 1 and n. cuDNN is a GPU acceleration library that can greatly improve the operation speed of GRU. Compared with native Tesorflow RNNCells, cuDNN works 5 to 10 times faster, which enables the model to process large amounts of time series data more efficiently.
[0136] Decoder 52: The task of decoder 52 is to receive the internal representation generated by the encoder, make predictions based on it, and output the prediction value 503. In the traffic prediction model provided in the embodiment of the present application, TF GRUBlockCell is used as a decoder, which is wrapped in a tf.while_loop() structure. This means that decoder 52 will work in a loop, and each step will obtain the intermediate prediction result (Y 1 , Y 2 , Y n-1 ) and use it as the input feature of the current step. This mechanism enables the decoder to take into account the information of the previous step at each step of the generated sequence, thereby generating more accurate predictions.
[0137] This encoder-decoder structural design enables the traffic prediction model to better process time series data and effectively predict the traffic of Internet of Vehicles services. In particular, the use of cuDNN GRU as an encoder allows the traffic prediction model to maintain high accuracy while also having high computational efficiency.
[0138] When dealing with long time series, LSTM or GRU are very commonly used models, which can effectively capture the dependencies in time series. However, when the sequence length exceeds a certain range (about 100 to 300 items), LSTM / GRU will begin to forget the earliest information. This is because in the structure of RNN, information needs to be transmitted at each time step, which causes the earlier information to be diluted after multiple transmissions.
[0139] In some embodiments, the long time series of the input traffic prediction model are processed using the attention mechanism and completely removing the attention mechanism. The attention mechanism allows the model to pay attention to the entire input sequence at each time step, so that earlier useful information can be brought to the current RNN unit. Another method is to completely remove the attention mechanism and only obtain some important data points from the past (such as one year, half a year, or one quarter ago) and use them as additional inputs to the encoder and decoder. This method works surprisingly well and even slightly exceeds the attention mechanism in terms of prediction quality.
[0140] This may be because, when processing long time series, data from certain specific time points in the past (such as one year, half a year, or one quarter ago) may contain more useful information for the current situation, and this information is easier to capture and learn by the model. Although the use of the attention mechanism allows the model to see the entire input sequence, in actual operation, the model may be disturbed by some less important information, thus affecting its prediction performance.
[0141] During the model training and validation process of the traffic prediction model, some specific strategies and techniques can be used to optimize model performance and improve training efficiency:
[0142] In some embodiments, the COCOB optimizer is used for model training. The COCOB optimizer is an optimizer that attempts to predict the best learning rate at each training step, which eliminates the need to manually adjust the learning rate. Compared to traditional momentum-based optimizers, COCOB converges faster. In other embodiments, gradient clipping technology can also be combined to prevent gradient explosion problems during training and ensure the stability of the model.
[0143] In some embodiments, when processing time series data, one often encounters the problem of how to split the dataset into a training set and a validation set. Figure 6As shown, the left side shows the forward split method, which refers to performing the training process 601 and the validation process 602 on different time ranges of the complete data set, and the time range of the data set used in the validation process 602 is moved forward by a prediction interval relative to the time range of the data set used in the training process 601. This method can ensure that the model encounters new data that has not been seen in the training process during the validation process, thereby better evaluating the generalization ability of the model; the right side shows the side-by-side split method, which is a traditional machine learning data set splitting method. The data set is divided into strictly independent parts, one part is only used for the training process 603, and the other part is only used for the validation process 604.
[0144] In the above embodiment, the traffic prediction model obtained by the above training and verification strategy can maintain high performance while improving the training efficiency and model stability. At the same time, by adopting the forward splitting method, the prediction ability of the model can be evaluated more accurately.
[0145] In some embodiments, when dealing with noisy input data, a variety of strategies can be adopted to reduce model variance and improve model stability and performance:
[0146] Multiple training and saving checkpoints: Since the same model trained on different random seeds may have different performance, or even performance divergence on some "unlucky" seeds, you can choose to train 3 models on different seeds and save the checkpoints of each model. This allows subsequent strategies to reconcile the prediction results of different models and reduce model variance.
[0147] Select the best training region: Since we don't know which training step is best for predicting the future, we can't use the early stopping strategy directly. Instead, we choose a rough training region where the model may have trained well enough but may not have started to overfit. We save 10 checkpoints from every 100 steps in this region, which provides more candidate models for subsequent predictions.
[0148] Stochastic Gradient Descent (SGD) averaging, also known as Asynchronous Stochastic Gradient Descent (ASGD): ASGD is a well-known method for reducing variance and improving model performance. It smoothes the model's predictions by calculating a moving average of the model weights during training. This method is well supported in Tensorflow and can be easily applied to traffic prediction models.
[0149] Weighted average prediction: Using the above strategy, 30 checkpoints were obtained, and then the average model weight calculated by ASGD was used for prediction, and the prediction results of these 30 checkpoints were averaged. This combination method works well in reducing model variance and improving model performance.
[0150] In the above embodiments, these strategies can reduce the variance of the traffic prediction model and improve the performance of the traffic prediction model in noisy input data.
[0151] Since the performance of the model depends largely on the selection of hyperparameters, including the number of neural network layers, the depth of the layers, the type of activation function, the ratio of dropout, etc. Manually adjusting these parameters is a complex and time-consuming task. Therefore, in some embodiments, the SMAC3 package can be selected to automate this process for the traffic prediction model to perform efficient hyperparameter search.
[0152] Through the above algorithm, accurate prediction of Internet of Vehicles service traffic can be achieved.
[0153] The site resource scheduling method provided in the embodiment of the present application is based on the multi-site mode of the Internet of Vehicles platform and the same-city active-active mode within the site. Through refined resource monitoring and dynamic scheduling, it provides stable and efficient network services for networked vehicles.
[0154] Based on the foregoing embodiments, an embodiment of the present application provides a site resource scheduling device, which includes the modules included and the sub-modules included in each module, which can be implemented by a processor in a computer device; of course, it can also be implemented by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP) or a field programmable gate array (FPGA), etc.
[0155] Figure 7 A schematic diagram of the structure of a site resource scheduling device provided in an embodiment of the present application is shown in FIG. Figure 7 As shown, the site resource scheduling device 700 includes: an information monitoring module 710, a traffic prediction module 720 and a resource scheduling module 730, wherein:
[0156] The information monitoring module 710 is used to monitor the resource status information of the current site in real time; wherein the resource status information at least includes resource usage data and historical network data;
[0157] The traffic prediction module 720 is used to predict the expected service traffic of the current site in a first time period after the current moment based on the historical network data by using a trained request prediction model; wherein the request prediction model is trained using a feature sequence sample set for traffic prediction of the current site in a preset time period;
[0158] The resource scheduling module 730 is configured to dynamically adjust the network resources and / or network load of the access point corresponding to the current site in response to the expected service traffic being greater than a traffic threshold.
[0159] In some possible embodiments, the request prediction model includes an encoder and a decoder, and the traffic prediction module 720 includes: a data preprocessing submodule, used to perform data preprocessing on the historical network data and extract time series data; a feature encoding submodule, used to encode the time series data through the encoder to obtain traffic feature coding; a traffic prediction submodule, used to predict the traffic feature coding through the decoder and perform linear transformation on the prediction result to obtain the expected service traffic of the current site in the first time period.
[0160] In some possible embodiments, the current site includes a primary access point and a secondary access point, and the resource scheduling module 730 includes: an expansion submodule, configured to expand the network resources of the secondary access point when the network resources corresponding to the expected service traffic are greater than the remaining resources of the primary access point; and a resource allocation submodule, configured to dynamically allocate the expected service traffic to the secondary access point according to a preset ratio through DNS scheduling.
[0161] In some possible embodiments, the resource scheduling module 730 includes: a determination submodule, used to determine the target vehicle within the range of the current site when the network resources required for the expected service traffic are greater than the remaining resources of the current site and the expected service traffic continues to increase; wherein the target vehicle is a vehicle that will be active within a second time period after the current moment; and a reverse control submodule, used to control the target vehicle to access a candidate site; wherein the candidate site and the current site are located in the same city, and the remaining resources of the candidate site are greater than the remaining resources of the current site.
[0162] In some possible embodiments, the determination submodule includes: a state acquisition unit, used to acquire vehicle activity state data of all vehicles within the current site range; an activity prediction unit, used to predict the active time of all vehicles based on the vehicle activity state data through a trained vehicle activity prediction model; wherein the vehicle activity prediction model is obtained by training a model built by at least two decision trees using feature data extracted from online state samples of the vehicle; and a target determination unit, used to determine the target vehicle that will be active in the second time period based on the prediction result.
[0163] In some possible embodiments, the reverse control submodule is further used to send a remote configuration instruction to the target vehicle so that the target vehicle accesses the candidate site; wherein the remote configuration instruction is used to modify the access point name accessed by the target vehicle to the access point name corresponding to the candidate site.
[0164] In some possible embodiments, the vehicle activity status data includes at least the following data: vehicle identification number, online date and time, online status, daily online times, weekly online times, average online time in the past 7 days, and average online time in the past 30 days.
[0165] The description of the above device embodiment is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiment. For technical details not disclosed in the device embodiment of the present application, please refer to the description of the method embodiment of the present application for understanding.
[0166] It should be noted that in the embodiments of the present application, if the above-mentioned site resource scheduling method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application can be essentially or partly reflected in the form of a software product that contributes to the relevant technology. The software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a disk or an optical disk. In this way, the embodiments of the present application are not limited to any specific hardware, software or firmware, or any combination of hardware, software, and firmware.
[0167] An embodiment of the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, some or all of the steps in the above method are implemented.
[0168] The embodiment of the present application provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, some or all of the steps in the above method are implemented. The computer-readable storage medium can be transient or non-transient.
[0169] An embodiment of the present application provides a computer program, including a computer-readable code. When the computer-readable code is run in a computer device, a processor in the computer device executes some or all of the steps for implementing the above method.
[0170] The embodiment of the present application provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and when the computer program is read and executed by a computer, some or all of the steps in the above method are implemented. The computer program product can be implemented specifically by hardware, software or a combination thereof. In some embodiments, the computer program product is specifically embodied as a computer storage medium, and in other embodiments, the computer program product is specifically embodied as a software product, such as a software development kit (SDK) and the like.
[0171] It should be noted here that the description of the various embodiments above tends to emphasize the differences between the various embodiments, and the same or similar aspects can be referenced to each other. The description of the above device, storage medium, computer program and computer program product embodiments is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. For technical details not disclosed in the embodiments of the device, storage medium, computer program and computer program product of this application, please refer to the description of the method embodiment of this application for understanding.
[0172] It should be noted that Figure 8 A schematic diagram of a hardware entity of a computer device in an embodiment of the present application is shown in FIG. Figure 8 As shown, the hardware entity of the computer device 800 includes: a processor 801, a communication interface 802 and a memory 803, wherein:
[0173] Processor 801 generally controls the overall operation of computer device 800 .
[0174] The communication interface 802 enables the computer device to communicate with other terminals or servers through a network.
[0175] The memory 803 is configured to store instructions and applications executable by the processor 801, and can also cache data to be processed or processed by the processor 801 and each module in the computer device 800 (for example, image data, audio data, voice communication data, and video communication data), which can be implemented by flash memory (FLASH) or random access memory (Random Access Memory, RAM). Data transmission can be performed between the processor 801, the communication interface 802, and the memory 803 through the bus 804.
[0176] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the size of the serial number of each step / process mentioned above does not mean the order of execution, and the execution order of each step / process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application. The serial numbers of the embodiments of the present application mentioned above are for description only and do not represent the advantages and disadvantages of the embodiments.
[0177] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0178] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0179] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0180] In addition, all functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may be a separate unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0181] A person skilled in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM), magnetic disks or optical disks, etc., various media that can store program codes.
[0182] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can essentially or in other words, the part that contributes to the relevant technology can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks, or optical disks.
[0183] The above is only an implementation method of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.
Claims
1. A site resource scheduling method, characterized in that: The method comprises: Real-time monitoring of resource status information of the current site; wherein the resource status information at least includes resource usage data and historical network data; Based on the historical network data, predict the expected service traffic of the current site in a first time period after the current moment through a trained request prediction model; wherein the request prediction model is trained using a feature sequence sample set for traffic prediction of the current site in a preset time period; In response to the expected service traffic being greater than a traffic threshold, the network resources and / or network load of the access point corresponding to the current site are dynamically adjusted.
2. The method according to claim 1, characterized in that The request prediction model includes an encoder and a decoder. The method of predicting the expected service traffic of the current site within a first time period after the current moment based on the historical network data and using the trained request prediction model includes: Performing data preprocessing on the historical network data to extract time series data; Encoding the time series data by the encoder to obtain a flow feature code; The decoder predicts the traffic feature code and performs linear transformation on the prediction result to obtain the expected service traffic of the current site in the first time period.
3. The method according to claim 1 or 2, characterized in that: The current site includes a primary access point and a secondary access point, and in response to the expected service traffic being greater than a traffic threshold, dynamically adjusting network resources of the access point corresponding to the current site includes: When the network resources corresponding to the expected service traffic are greater than the remaining resources of the primary access point, expanding the network resources of the secondary access point; The expected service traffic is dynamically allocated to the secondary access point according to a preset ratio through domain name system DNS scheduling.
4. The method according to claim 1 or 2, characterized in that: In response to the expected service traffic being greater than a traffic threshold, dynamically adjusting a network load of an access point corresponding to the current site includes: When the network resources required by the expected service flow are greater than the remaining resources of the current site and the expected service flow continues to increase, determining a target vehicle within the range of the current site; wherein the target vehicle is a vehicle that will be active within a second time period after the current moment; Controlling the target vehicle to access a candidate site; wherein the candidate site and the current site are located in the same city, and the remaining resources of the candidate site are greater than the remaining resources of the current site.
5. The method according to claim 4, characterized in that Determining the target vehicle within the current site range includes: Obtaining vehicle activity status data of all vehicles within the current site range; Based on the vehicle activity state data, active time prediction is performed on all the vehicles using a trained vehicle activity prediction model; wherein the vehicle activity prediction model is obtained by training a model constructed by at least two decision trees using feature data extracted from online state samples of the vehicles; Based on the prediction result, the target vehicle that will be active in the second time period is determined.
6. The method according to claim 4, characterized in that The controlling the target vehicle to access the candidate site includes: A remote configuration instruction is sent to the target vehicle so that the target vehicle accesses the candidate site; wherein the remote configuration instruction is used to modify the access point name accessed by the target vehicle to the access point name corresponding to the candidate site.
7. The method according to claim 5, characterized in that The vehicle activity status data includes at least the following data: Vehicle number, online date and time, online status, daily online times, weekly online times, average online time in the past 7 days, and average online time in the past 30 days.
8. A site resource scheduling device, characterized in that: The device comprises: An information monitoring module, used to monitor the resource status information of the current site in real time; wherein the resource status information at least includes resource usage data and historical network data; A traffic prediction module, configured to predict the expected service traffic of the current site within a first time period after the current moment based on the historical network data and using a trained request prediction model; wherein the request prediction model is trained using a feature sequence sample set for traffic prediction of the current site within a preset time period; The resource scheduling module is used to dynamically adjust the network resources and / or network load of the access point corresponding to the current site in response to the expected service traffic being greater than the traffic threshold.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, wherein: When the processor executes the program, the steps in the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps in the method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Resource processing method and device for large model, and electronic equipment
CN121029384A
Resource dynamic adaptation scheduling system based on total site
CN121919005A