A wireless screen projection remote control method based on random forest optimization algorithm
By adopting a remote control method based on a random forest optimization algorithm in wireless screen projection technology, the problem of unpredictable and optimized screen projection process in the existing technology is solved, and a more stable and smooth screen projection effect is achieved.
Patent Information
- Application Number
- CN202510056066.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-14
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2045-01-14
AI Technical Summary
The existing wireless screen projection technology fails to make full use of machine learning algorithms to predict and optimize possible problems during screen projection, resulting in the inability to achieve dynamic adjustment and remote control in the face of network fluctuations and changes in equipment performance, thus unable to ensure the stability and smoothness of screen projection.
A wireless screen projection remote control method based on a random forest optimization algorithm is adopted. By obtaining network signal data, device status data and screen projection screen data, data preprocessing and feature expansion are carried out, an improved random forest model is constructed, and the model parameters are adjusted using cross-verification to realize real-time prediction and remote control of the screen projection process.
It improves the stability and response speed of the screen projection process, can effectively predict and avoid lags, delays or interrupts, and ensures that the high screen projection quality is maintained in various environments.
Smart Images

Figure CN119545075B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of wireless screen projection technology, and more specifically, to a wireless screen projection remote control method based on a random forest optimization algorithm. Background Art
[0002] Existing wireless screen projection technologies allow users to display the screen content of one device on another device in real time through a wireless network, and are widely used in conferences, education, and entertainment. These technologies usually rely on stable network connections and efficient data processing capabilities to ensure the image quality during the projection process. However, due to the complexity of the wireless network environment and differences in device performance, problems such as freezes, delays, or interruptions may occur during the projection process, affecting the user experience. Traditional screen projection technologies often lack effective prediction and control mechanisms to deal with these problems, resulting in the inability to adjust the projection parameters in time to maintain a smooth projection effect when the network fluctuates or the device performance is insufficient.
[0003] In the process of implementing the embodiments of the present invention, the inventors found that there are at least the following problems or defects in the prior art: the existing wireless screen projection technology fails to fully utilize the machine learning algorithm to predict and optimize the problems that may arise in the screen projection process, resulting in the inability to achieve dynamic adjustment and remote control when facing network fluctuations and changes in device performance, thereby unable to ensure the stability and smoothness of the screen projection. Summary of the invention
[0004] The present invention provides a wireless screen projection remote control method based on a random forest optimization algorithm, comprising: S1, acquiring network signal data, device status data and projection image data in a wireless screen projection process.
[0005] S2. Remove outliers from the data collected in S1 and standardize them according to specific rules.
[0006] S3, divide the data processed by S2 into training sets and test set , expand and optimize data features and determine the number of decision trees , maximum depth of decision tree and the number of split features Construct an improved random forest model and use cross-validation technology to adjust model parameters. The cross-validation parameters are set to , calculate the accuracy of the model on the validation set, the formula is: ;in, is the number of samples predicted correctly, is the total number of samples in the validation set, and the number of decision trees is adjusted according to the accuracy , maximum depth of decision tree and the number of split features .
[0007] S4: Input the data collected in real time and processed by S2 into the trained model to obtain the prediction result of whether the screen projection is stuck, delayed or interrupted.
[0008] S5. Generate a remote control command based on the prediction result of S4 and send it to the wireless projection device to achieve control.
[0009] Furthermore, S1 includes collecting network signal strength data during wireless screen projection. , the hardware resource usage data of the projection device and the resolution of the projection screen Frame rate and packet loss rate data.
[0010] Furthermore, the network signal strength data in S2 , its standardized formula is: ;in, is the normalized network signal strength, is the minimum value of the collected network signal strength, It is the maximum value of the collected network signal strength.
[0011] Furthermore, in the S3 feature expansion and optimization, the resolution data in the projection screen data is ; Create a new feature: ;in, is the resolution ratio feature, The preset standard resolution is used to calculate the network signal strength data. and device status data Generate differential features based on time series, assuming that the network signal strength data sequence is , differential features , if the device status data sequence is , differential features: ,in, for The network signal strength differential characteristics at each moment, for The differential features of the device state at the moment are randomly selected from the enhanced feature set when building the decision tree. features, according to the information gain of the features Select the best split point and recursively build the decision tree until the maximum depth is reached Or the number of samples in the node is less than the preset threshold , introducing adaptive weights when splitting nodes Dynamically adjust the importance of different types of features and feature selection probability: ;in, Features The information gain of Features The probability of being selected.
[0012] Furthermore, the state prediction sub-step in S4 uses the model to output the projection state prediction result, and the prediction result includes whether the projection is stuck. ,Delay or interrupt .
[0013] Furthermore, the command generation sub-step in S5 generates corresponding remote control commands according to the projection state prediction result. When the projection is predicted to be stuck and the current projection screen frame rate is When , adjust the frame rate to: ;in, is the preset adjustment factor, To adjust the frame rate, the command sending sub-step sends the generated remote control command to the wireless projection device to perform the control operation.
[0014] Furthermore, it also includes a model updating step, wherein the model updating step regularly collects new wireless projection data, adds it to the original data set, re-performs data preprocessing, improves the random forest model construction and training steps to update the improved random forest model, and the model update cycle is set to .
[0015] Furthermore, the hardware resource usage data collected in the device status data collection sub-step includes the CPU usage data of the device and memory usage data .
[0016] Furthermore, the CPU usage data in the device status data in S2 , the standardized formula is: ;in, is the normalized CPU usage, is the minimum value of CPU usage collected. The maximum value of the CPU usage collected.
[0017] Furthermore, when S3 constructs the improved random forest model, the construction of the decision tree is based on a randomly selected feature subset, and the growth process of each decision tree is independent of each other. Finally, the output result of the model is determined by a fusion strategy such as voting or averaging of multiple decision trees.
[0018] According to the above-mentioned embodiments of the present invention, at least the following beneficial effects are achieved: the wireless screen projection remote control method using the random forest optimization algorithm can improve the stability and response speed of the screen projection process. By real-time collection and analysis of network signal data, device status data, and projection screen data during the wireless screen projection process, the method can effectively predict whether the screen projection will have problems such as freezes, delays, or interruptions, and generate corresponding remote control instructions accordingly. This prediction and control mechanism enables the wireless screen projection system to adapt to different network and device states more intelligently, thereby maintaining a high screen projection quality in various environments.
[0019] In addition, this method can ensure the accuracy and robustness of the model by adjusting model parameters through cross-validation technology. In the feature expansion and optimization stage, the model's sensitivity to changes in the projection state can be enhanced by creating new features and generating differential features based on time series. This method can dynamically adjust the number of decision trees, the maximum depth, and the number of split features to adapt to different projection scenarios and needs, further improving the accuracy and efficiency of projection control. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood by reading the following detailed description with reference to the accompanying drawings, in which several embodiments of the present invention are shown by way of example and not limitation.
[0021] in: Figure 1 A schematic flow chart of a wireless screen projection remote control method based on a random forest optimization algorithm provided in one embodiment of the present invention. DETAILED DESCRIPTION
[0022] The principles and spirit of the present invention will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are provided only to enable those skilled in the art to better understand and implement the present invention, and are not intended to limit the scope of the present invention in any way. On the contrary, these embodiments are provided to make the present invention more thorough and complete, and to fully convey the scope of the present invention to those skilled in the art.
[0023] Those skilled in the art know that the embodiments of the present invention can be implemented as a system, device, apparatus, method or computer program product. Therefore, the present invention can be specifically implemented in the following forms, namely: complete hardware, complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.
[0024] It should be noted that any number of elements in the drawings is for illustration rather than limitation, and any naming is only for distinction and does not have any limiting meaning.
[0025] Reference below Figure 1 , Figure 1 The following is a flow chart of a wireless screen projection remote control method based on a random forest optimization algorithm provided by an embodiment of the present invention. Figure 1 As shown, a wireless screen projection remote control method S0 based on random forest optimization algorithm includes: S1, obtaining network signal data, device status data and projection image data during the wireless screen projection process.
[0026] S2. Remove outliers from the data collected in S1 and standardize them according to specific rules.
[0027] S3, divide the data processed by S2 into training sets and test set , expand and optimize data features and determine the number of decision trees , maximum depth of decision tree and the number of split features Construct an improved random forest model and use cross-validation technology to adjust model parameters. The cross-validation parameters are set to , calculate the accuracy of the model on the validation set: ;in, is the number of samples predicted correctly, is the total number of samples in the validation set, and the number of decision trees is adjusted according to the accuracy , maximum depth of decision tree and the number of split features .
[0028] S4: Input the data collected in real time and processed by S2 into the trained model to obtain the prediction result of whether the screen projection is stuck, delayed or interrupted.
[0029] S5. Generate a remote control command based on the prediction result of S4 and send it to the wireless projection device to achieve control.
[0030] It should be noted that this method first involves obtaining network signal data, device status data, and projection screen data during wireless projection. Here, network signal data refers to information such as signal strength during wireless projection, while device status data includes hardware resource usage, such as CPU and memory usage. Projection screen data involves parameters such as resolution, frame rate, and packet loss rate, which together determine the quality and stability of projection.
[0031] Specifically, the method requires preprocessing of the collected data, including removing outliers and standardizing according to specific rules. For example, network signal strength data can be standardized by the formula (standardized network signal strength = collected network signal strength - collected network signal strength minimum value / collected network signal strength maximum value - collected network signal strength minimum value). Such processing helps to eliminate noise in the data and provide accurate input for subsequent model training and prediction.
[0032] Preferably, after data preprocessing, the method divides the data into a training set and a test set, and constructs an improved random forest model. When constructing the model, the number of decision trees, the maximum depth, and the number of split features can be determined. For example, the number of decision trees can be set to 100, the maximum depth can be set to 10, and the number of split features can be selected based on information gain. By adjusting the model parameters through cross-validation technology, it can be ensured that the model has good generalization ability on different data sets. The cross-validation parameter can be set to 5, so that the accuracy of the model can be evaluated on 5 different data subsets, and the model parameters can be adjusted accordingly to optimize performance.
[0033] In some embodiments, S1 includes collecting network signal strength data during wireless screen projection. , the hardware resource usage data of the projection device and the resolution of the projection screen , frame rate and packet loss rate data.
[0034] It should be noted that this implementation describes in detail the data types collected during the wireless screen projection process, including network signal strength data, hardware resource usage data of the projection device, and resolution, frame rate, and packet loss rate data of the projection screen. Here, network signal strength data refers to the strength index of the wireless signal, which is a key parameter for measuring the quality of wireless connections; hardware resource usage data involves the real-time usage of key hardware such as CPU and memory; and resolution, frame rate, and packet loss rate are three important indicators for measuring the quality of projection screens.
[0035] Specifically, the network signal strength data mentioned in the implementation method can be obtained through real-time monitoring of the wireless signal receiver, and the hardware resource usage data can be obtained through the API interface provided by the operating system. For the projection screen data, the resolution data can be read through the setting interface of the projection software, the frame rate can be determined by the encoding parameters of the video stream, and the packet loss rate can be calculated by the packet loss during network transmission. The collection of these data provides a basis for subsequent data analysis and model training.
[0036] Preferably, the data collection in the implementation method can adopt a periodic sampling method, for example, data is collected once every certain time (such as 1 second) to ensure the continuity and real-time nature of the data. For the network signal strength data, a threshold can be set. When the signal strength is lower than the threshold, the system will automatically adjust the transmission parameters of the wireless screen projection to optimize the connection quality. For the hardware resource usage data, an early warning mechanism can be set. When the CPU usage exceeds 80% or the memory usage exceeds 90%, the system will prompt the user or automatically take measures to reduce the resource load. For the projection screen data, the frame rate and packet loss rate can be monitored in real time. When the frame rate is lower than the preset value or the packet loss rate exceeds a certain proportion, the system can automatically reduce the resolution or adjust the encoding parameters to keep the picture smooth. These detailed operating steps and alternatives can further improve the stability of wireless screen projection and user experience.
[0037] In some embodiments, the network signal strength data in S2 , its standardized formula is: ;in, is the normalized network signal strength, is the minimum value of the collected network signal strength, It is the maximum value of the collected network signal strength.
[0038] It should be noted that this implementation describes in detail the specific formula for standardizing network signal strength data. Here, network signal strength data refers to the original signal strength value collected during the wireless screen projection process, which is a key parameter because it directly affects the stability and quality of the screen projection. Standardization refers to converting the original data into a common scale for comparison and analysis. The standardized network signal strength is expressed as It is represented by the formula: Calculated, where is the collected network signal strength, is the minimum value of the collected network signal strength. It is the maximum value of the collected network signal strength.
[0039] Specifically, the normalization formula in the implementation method can convert the network signal strength data into a value between 0 and 1, which can more intuitively represent the position of the signal strength relative to its possible maximum and minimum values. This conversion helps to reduce the deviation caused by data of different dimensions during model training and prediction, so that the model can more accurately capture the impact of signal strength on projection quality. In practical applications, this standardization process can be implemented through programming, for example, in the data preprocessing stage, the above formula is applied to each collected signal strength value.
[0040] Preferably, the standardization process in the implementation mode can be further refined, for example, a dynamic update mechanism can be set to adapt to changes in the network environment. This means and It is not a fixed value, but is dynamically adjusted based on the data collected in the recent period. In this way, the standardization process can adapt to different network conditions more flexibly, improve the adaptability of the model and the accuracy of prediction.
[0041] Furthermore, it is also possible to consider introducing an outlier detection mechanism and cleaning the data before standardization to ensure the quality of the data input to the model. These alternatives can further improve the robustness of data processing and the performance of the model.
[0042] In some embodiments, in the S3 feature expansion and optimization, the resolution data in the projection screen data is , create a new feature: ;in, is the resolution ratio feature, The preset standard resolution is used to calculate the network signal strength data. and device status data Generate differential features based on time series, assuming that the network signal strength data sequence is , differential features , if the device status data sequence is , differential features: ;in, for The network signal strength differential characteristics at each moment, for The differential features of the device state at the moment are randomly selected from the enhanced feature set when building the decision tree. features, according to the information gain of the features Select the best split point and recursively build the decision tree until the maximum depth is reached Or the number of samples in the node is less than the preset threshold , introducing adaptive weights when splitting nodes Dynamically adjust the importance of different types of features and feature selection probability: ;in, Features The information gain of Features The probability of being selected.
[0043] It should be noted that this implementation involves creating new features for the resolution data in the projection screen data during the feature expansion and optimization stage, and generating differential features based on the time series for the network signal strength data and device status data. Here, the resolution data refers to the width and height pixel values of the projection screen, and the differential features of the time series refer to new features generated by calculating the data difference between two consecutive time points, which are used to capture the trend of data changes over time.
[0044] Specifically, the resolution ratio feature mentioned in the implementation method can be calculated by the formula: resolution ratio = current resolution / preset standard resolution, where the preset standard resolution can be 1080p (1920x1080 pixels) or other industry standard resolutions. For the time series difference feature of network signal strength data and device status data, the formula can be: To calculate, is the data value at the current moment, is the data value at the previous moment. Such differential features help the model identify dynamic changes in data and thus better predict the projection status.
[0045] Preferably, the differential feature generation in the implementation method can be further refined. For example, different time windows can be set to calculate differential features to adapt to different data change rates. In addition, sliding window technology can be introduced to capture shorter-term data trends by analyzing data within a fixed time window. When building a decision tree, a certain number of features can be randomly selected from the enhanced feature set, for example, 10 features can be selected, and the best split point can be selected based on the information gain of the features. Information gain refers to the degree to which a feature improves the predictive ability of the model, and can be used as a basis for selecting split features. When splitting nodes, adaptive weights can be introduced to dynamically adjust the importance of different types of features, where the feature selection probability can be calculated by the formula To calculate, It is a feature The information gain of is the total number of features. Such adaptive weight adjustment can make the model pay more attention to those features that have a greater impact on the prediction results.
[0046] In some embodiments, the state prediction substep in S4 uses the model to output the projection state prediction result, and the prediction result includes whether the projection is stuck. ,Delay or interrupt .
[0047] It should be noted that this implementation describes the working principle of the state prediction sub-step, which is to use the model output to predict the screen projection state, including whether the screen projection will be stuck, delayed or interrupted. Here, the state prediction sub-step refers to the model predicting the quality state of the screen projection by analyzing the data after receiving the processed data input. The screen projection state refers to three undesirable situations that may occur during the screen projection process: stuck, delayed and interrupted, which are key factors affecting the user experience.
[0048] Specifically, the model output in the implementation method refers to the result of analyzing the data collected and processed in real time through the trained random forest model. The model predicts the projection status based on the input feature data, such as network signal strength, device status, and projection screen data. The prediction result can be a probability value, indicating the possibility of freeze, delay, or interruption in the projection. For example, the model may output a probability distribution, which includes a probability of 0.3 for freeze in the projection, a probability of 0.2 for delay, and a probability of 0.1 for interruption. These probability values can help the system decide whether measures need to be taken to improve the quality of the projection.
[0049] Preferably, the prediction results in the implementation can be further refined. For example, a threshold can be set to determine the screen projection status. If the probability of screen projection freezes exceeds a preset threshold (such as 0.5), the system can automatically reduce the resolution or adjust the frame rate to reduce freezes. Similar measures can also be taken for the prediction of delays and interruptions.
[0050] Furthermore, a real-time feedback mechanism can be introduced to adjust the prediction threshold of the model according to the actual experience of the user, so that the prediction results are more in line with actual needs. These alternatives can improve the adaptability of the model and the accuracy of the prediction, thereby better optimizing the screen projection experience.
[0051] In some embodiments, the command generation sub-step in S5 generates corresponding remote control commands according to the projection state prediction result, when it is predicted that the projection will be stuck and the current projection screen frame rate is When ;in, is the preset adjustment factor, To adjust the frame rate, the command sending sub-step sends the generated remote control command to the wireless projection device to perform the control operation.
[0052] It should be noted that this implementation involves generating corresponding remote control instructions based on the prediction results and sending them to the wireless screen projection device to implement control operations. Here, remote control instructions refer to a series of operation commands automatically generated by the system based on the model prediction results, which are used to adjust the settings of the screen projection device to improve or optimize the screen projection quality. The screen projection device refers to the hardware device that performs the screen projection operation, such as a smart TV, projector or computer.
[0053] Specifically, the instruction generation sub-step in the implementation method will determine the specific control instruction according to the projection state predicted by the model. For example, if the model predicts that the projection will be stuck, and the frame rate of the current projection screen is , the system will adjust the To calculate the new frame rate ,Right now Here Is a factor less than 1 that is used to reduce the frame rate to reduce the possibility of stuttering. It will be encapsulated into control instructions and sent to the projection device for execution.
[0054] Preferably, the control instruction generation and sending process in the implementation mode can be further refined. For example, the system can set multiple levels of adjustment coefficients. , choose different value.
[0055] Furthermore, the system can also dynamically adjust based on the feedback from the device and the actual experience of the user. When sending control commands, different communication protocols can be used, such as Wi-Fi, Bluetooth, or infrared, to ensure that the commands can be accurately and quickly transmitted to the projection device. These detailed operation steps and alternatives can improve the execution efficiency of control commands and optimize the projection quality.
[0056] In some embodiments, a model updating step is also included, wherein the model updating step regularly collects new wireless projection data, adds it to the original data set, re-performs data preprocessing, improves the random forest model construction and training steps to update the improved random forest model, and the model update cycle is set to .
[0057] It should be noted that this implementation describes a model update step, which is to regularly collect new wireless projection data and add it to the original data set to update and optimize the model. Here, the model update step refers to the process of regularly retraining and adjusting the model with newly collected data in order to maintain the accuracy and adaptability of the model. Wireless projection data includes network signal data, device status data, and projection screen data, etc. These data are the basis for model training and prediction.
[0058] Specifically, the model update step in the implementation method involves data preprocessing, model building and training. In this process, the newly collected data needs to go through the same preprocessing steps as before, including removing outliers, standardization, etc., to ensure data consistency. Then, these data will be added to the original data set for retraining the model. When training the model, the same random forest algorithm as before can be used, including parameter settings such as the number of decision trees, maximum depth, and number of split features, and can also be adjusted and optimized as needed.
[0059] Preferably, the model update step in the implementation method can be further refined. For example, a specific update cycle can be set, such as updating the model once a week or a month, to ensure that the model can promptly reflect the latest projection conditions and trends. In the data preprocessing stage, an automated outlier detection and processing mechanism can be introduced to improve the efficiency and accuracy of data processing. In the model training stage, an incremental learning method can be adopted, that is, based on the original model, only the newly added data is learned to reduce the consumption of computing resources.
[0060] Furthermore, you can also consider introducing a model evaluation mechanism, such as evaluating the performance of the model through cross-validation, to ensure that the model can achieve the expected results after the update. These detailed operation steps and alternatives can improve the efficiency and effect of model updates and ensure that the model is always in the best state.
[0061] In some embodiments, the hardware resource usage data collected by the device status data collection sub-step includes the CPU usage data of the device. and memory usage data .
[0062] It should be noted that this implementation method describes in detail that the hardware resource usage data collected in the device status data collection sub-step includes the device's CPU usage data and memory occupancy data. Here, the device status data refers to a series of parameters that reflect the device's operating status, while the CPU usage data and memory occupancy data are key indicators for measuring device performance. The CPU usage data reflects the workload of the central processing unit, while the memory occupancy data shows the amount of memory currently used by the device.
[0063] Specifically, the hardware resource usage data collection in the implementation method can be implemented through the monitoring tools provided by the operating system. For example, the Windows task manager, the Linux top command or other operating system corresponding tools can be used to obtain the CPU usage and memory occupancy. These data are usually expressed in percentage form, reflecting the usage of device resources at a specific time point. In actual applications, a data collection frequency can be set, such as collecting once every minute or every hour, to obtain a continuous record of the device status.
[0064] Preferably, the hardware resource usage data collection in the implementation can be further refined. For example, a threshold can be set to identify resource usage anomalies, such as when the CPU usage exceeds 90% or the memory occupancy exceeds 80%, the system can issue a warning or automatically take measures to optimize resource allocation.
[0065] Furthermore, more complex monitoring mechanisms can be introduced, such as real-time analysis of CPU and memory usage trends, so that adjustments can be made before resource usage reaches critical values. These detailed operation steps and alternatives can improve the efficiency and accuracy of device resource management, thereby optimizing the performance and stability of wireless screen projection.
[0066] In some embodiments, the CPU usage data in the device status data in S2 , the standardized formula is; ;in, is the normalized CPU usage, is the minimum value of CPU usage collected. The maximum value of the CPU usage collected.
[0067] It should be noted that this implementation describes a specific formula for standardizing the CPU usage data in the device status data. Here, the CPU usage data refers to the percentage value that measures the busyness of the central processor within a specific period of time, which is a key indicator for evaluating device performance and resource usage. Standardization refers to converting the original data into a unified scale for comparison and analysis.
[0068] Specifically, the normalization formula in the implementation method can convert the CPU usage data into a value between 0 and 1, which can more intuitively represent the position of the CPU usage relative to its possible maximum and minimum values. This conversion helps to reduce the deviation caused by data of different dimensions during model training and prediction, so that the model can more accurately capture the impact of CPU usage on projection quality. In practical applications, this standardization process can be implemented through programming. For example, in the data preprocessing stage, the above formula is applied to each collected CPU usage value.
[0069] Preferably, the standardization process in the implementation can be further refined, for example, a dynamic update mechanism can be set to adapt to changes in device load. This means that the minimum and maximum values of CPU usage are not fixed values, but are dynamically adjusted based on data collected in the recent period of time. In this way, the standardization process can be more flexibly adapted to different device usage conditions, improving the adaptability of the model and the accuracy of prediction.
[0070] Furthermore, it is also possible to consider introducing an outlier detection mechanism and cleaning the data before standardization to ensure the quality of the data input to the model. These alternatives can further improve the robustness of data processing and the performance of the model.
[0071] In some embodiments, when the improved random forest model is constructed in S3, the construction of the decision tree is based on a randomly selected feature subset, and the growth process of each decision tree is independent of each other, and finally the output result of the model is determined by a fusion strategy such as voting or averaging of multiple decision trees.
[0072] It should be noted that this embodiment describes a method for constructing a decision tree when constructing an improved random forest model. Here, a decision tree is a commonly used classification and regression algorithm that predicts results by learning data features and decision rules. A randomly selected feature subset means that when constructing each decision tree, not all features are used, but a portion of features are randomly selected for training to increase the diversity and generalization ability of the model.
[0073] Specifically, the decision tree construction in the implementation method is based on a randomly selected feature subset, which means that when each decision tree is constructed, a portion of all available features will be randomly selected as candidate features for splitting nodes. This process can reduce the risk of overfitting and improve the robustness of the model. The growth process of each decision tree is independent, which means that they will not affect each other during construction. The output result of the final model is obtained by fusing the output results of multiple decision trees. Common fusion strategies include voting or averaging.
[0074] Preferably, the decision tree construction process in the implementation can be further refined. For example, the maximum depth of the decision tree can be set to control the complexity of the model and prevent overfitting. At the same time, a minimum sample split value can be set. When the number of samples of a node is less than this value, the node will no longer continue to split.
[0075] Furthermore, feature selection weights can be introduced so that certain important features have a higher probability of being selected during random selection. These refined operation steps and alternatives can further improve the model's predictive performance and ability to adapt to different data sets.
[0076] The above-mentioned embodiments of the present invention have the following beneficial effects: The wireless screen projection remote control method described in the present invention can improve the reliability and user experience of wireless screen projection. By comprehensively collecting data such as network signal strength, device hardware resource usage, and resolution, frame rate, and packet loss rate of the projection screen, and using the random forest optimization algorithm for analysis and prediction, the method can effectively identify problems that may occur during the projection process, and timely generate control instructions for adjustment, thereby reducing or avoiding the occurrence of projection freezes, delays, and interruptions.
[0077] In addition, this method can further improve the accuracy of prediction and the effectiveness of control instructions through feature expansion and optimization, adaptive weight adjustment, and dynamic adjustment of model parameters. By regularly collecting new wireless projection data and updating the model, this method can also adapt to changing network and device conditions and maintain long-term high efficiency and stability. These measures work together to ensure that wireless projection services can provide a smooth, high-quality visual experience in various environments.
[0078] Furthermore, the storage medium of the embodiment of the present application stores program instructions that can implement all the above methods, wherein the program instructions can be stored in the above storage medium in the form of a software product, including several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps 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 USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or terminal devices such as a computer, a server, a mobile phone, and a tablet.
[0079] The above descriptions are only some preferred embodiments of the present invention and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present invention is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above inventive concept. For example, the above features are replaced with (but not limited to) technical features with similar functions disclosed in the embodiments of the present invention.
Claims
1. A wireless screen projection remote control method based on random forest optimization algorithm, characterized in that: The following steps are involved: S1. Acquire network signal data, device status data, and projection screen data during wireless screen projection; the network signal data includes the network signal strength data collected during wireless screen projection ; Projection screen data includes the resolution of the projection screen and frame rate ; S2, remove outliers from the data collected in S1 and standardize them according to specific rules; S3, divide the data processed by S2 into training sets and test set , expand and optimize data features and determine the number of decision trees , maximum depth of decision tree and the number of split features Construct an improved random forest model and use cross-validation technology to adjust model parameters. The cross-validation parameters are set to , calculate the accuracy of the model on the validation set, the formula is: ; in, is the number of samples predicted correctly, is the total number of samples in the validation set, and the number of decision trees is adjusted according to the accuracy , maximum depth of decision tree and the number of split features ; S4, input the data collected in real time and processed by S2 into the trained model to obtain the projection prediction result; S5, generating a remote control command based on the prediction result of S4 and sending it to the wireless projection device to achieve control; wherein, Resolution of the projection screen , create new features as: ; in, is the resolution ratio feature, It is the preset standard resolution; At the same time, the network signal strength data and device status data Generate differential features based on time series, assuming that the network signal strength data sequence is , the differential characteristics of network signal strength data are: ; If the device status data sequence is , the differential characteristics are: ; in, for The differential characteristics of network signal strength at each moment, for Differential characteristics of device status at the moment, Randomly select from the enhanced feature set when building a decision tree features, according to the information gain of the features Select the best split point and recursively build the decision tree until the maximum depth is reached Or the number of samples in the node is less than the preset threshold , introducing adaptive weights when splitting nodes The importance of different types of features is dynamically adjusted, and the feature selection probability is: ; in, Features The information gain of Features The probability of being selected; In S5, a remote control instruction is generated according to the prediction result of S4 and sent to the wireless projection device to realize control, including: When the projection is predicted to freeze and the current projection frame rate is When ; in, is the preset adjustment factor, is the adjusted frame rate, A remote control command is generated based on the adjusted frame rate and sent to the wireless projection device to perform control operations.
2. According to the wireless screen projection remote control method based on random forest optimization algorithm according to claim 1, it is characterized in that: The network signal strength data , its standardized formula is: ;in, is the normalized network signal strength, is the minimum value of the collected network signal strength, It is the maximum value of the collected network signal strength.
3. According to claim 2, a wireless screen projection remote control method based on random forest optimization algorithm is characterized in that: In S4, the data collected in real time and processed by S2 is input into the trained model to obtain the projection prediction result, including whether the projection is stuck. ,Delay or interrupt .
4. According to the wireless screen projection remote control method based on random forest optimization algorithm of claim 3, it is characterized in that: It also includes the model updating steps, including: Regularly collect new network signal data, device status data, and projection screen data, add them to the original data set, and re-execute steps S2-S4. The model update cycle is .
5. According to the wireless screen projection remote control method based on random forest optimization algorithm of claim 4, it is characterized in that: The device status data includes the CPU usage data of the device and memory usage data .
6. A wireless screen projection remote control method based on random forest optimization algorithm according to claim 5, characterized in that: CPU usage data in device status data , the standardized formula is: ;in, is the normalized CPU usage, is the minimum value of CPU usage collected. The maximum value of the CPU usage collected.
7. A wireless screen projection remote control method based on random forest optimization algorithm according to claim 6, characterized in that: When constructing the improved random forest model in S3, the construction of the decision tree is based on a randomly selected feature subset, and the growth process of each decision tree is independent of each other. Finally, the output result of the model is determined by voting or averaging fusion strategy of multiple decision trees.
Citation Information
Patent Citations
Service robot movement system fault diagnosis method and device based on time sequence characteristics
CN110231156A
A method and system for resisting weak network for audio and video transmission
CN118101941A
Differential privacy federated learning method, system and device based on multi-modal data
CN118133939A
Well cementation quality analysis method based on random forest optimization
CN118171946A