Screen state switching method, system, device and medium

By establishing a wireless connection with the mobile terminal through the PCBA module, the signal strength is monitored in real time and a signal strength set is constructed. The screen state is automatically adjusted using a machine learning model, which solves the problems of cumbersome operation and insufficient security of traditional screen locking methods, and realizes intelligent screen locking control and energy saving.

CN120812166BActive Publication Date: 2026-01-27SHENZHEN WAYTRONIC ELECTRONICS CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511319164.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-16
Publication Date
2026-01-27
Estimated Expiration
2045-09-16

AI Technical Summary

Technical Problem

Traditional screen locking methods require additional user operations, which affects work efficiency and is insufficient in terms of security and convenience.

Method used

The PCBA module establishes a wireless connection with the designated mobile terminal, monitors the signal strength in real time and adds timestamps to build a signal strength set, uses a machine learning model to determine the screen state switching conditions, and automatically adjusts the lock screen state based on the mobile terminal's state and security level.

Benefits of technology

It enables a smart lock screen that requires no manual operation from the user, improving security and user experience, saving energy consumption, adapting to user behavior, and optimizing battery life.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120812166B_ABST
    Figure CN120812166B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of screen state switching, and discloses a screen state switching method, a system, a device and a medium, wherein the method comprises the following steps: establishing a stable connection with a specified mobile terminal by using a PCBA module, ensuring the reliability of information transmission, in the process of signal strength monitoring, the application of a time stamp can effectively reduce the influence of instantaneous interference on the judgment result, the system can more accurately evaluate the distance of a user, the system can intelligently and automatically switch the lock screen state by constructing a signal strength set and combining the judgment of the current screen state.The application has the beneficial effects that unnecessary manual operation is reduced, the use efficiency of a user is improved, the signal strength change of the specified mobile terminal is monitored in real time, the safety of a static terminal and the user experience are significantly improved, automatic screen locking can be realized, and energy consumption is saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of screen state switching technology, and in particular to a screen state switching method, system, device and medium. Background Technology

[0002] In the context of modern information technology, the security and convenience of computers are receiving increasing attention. Traditional screen locking methods typically rely on passwords, gestures, or fingerprints. While these methods offer some security, they suffer from numerous shortcomings in user experience and ease of use. These methods not only require users to perform additional operations, increasing their workload, but also negatively impact work efficiency to some extent. Summary of the Invention

[0003] Based on this, it is necessary to propose a screen state switching method, system, device, and medium to address the existing screen state switching problem.

[0004] A screen state switching method, applied to a static terminal, the method comprising:

[0005] A wireless connection is established between the PCBA module and the designated mobile terminal.

[0006] The signal strength of the specified mobile terminal is acquired periodically in real time, and a timestamp is added to each signal strength based on the acquisition time.

[0007] A preset number of signal strengths are selected as a signal strength set based on the timestamps of each of the signal strengths;

[0008] Obtain the current screen state of the display; wherein, the current screen state includes a locked screen state and an unlocked screen state;

[0009] Determine whether the signal strength set meets the preset switching conditions of the current screen state;

[0010] If the signal strength set satisfies the preset switching conditions of the current screen state, then the current screen state is switched.

[0011] Furthermore, the step of establishing a wireless connection between the PCBA module and the designated mobile terminal includes:

[0012] Obtain the HID service information broadcast by the specified mobile terminal;

[0013] Based on the HID service information, a connection is established with the designated mobile terminal through the PCBA module.

[0014] Further, the step of determining whether the signal strength set satisfies the preset switching conditions of the current screen state includes:

[0015] The current screen state and the signal strength set are used as inputs to the machine learning model, and the machine learning model is executed to obtain the calculation results.

[0016] The calculation result is compared with a set threshold to determine whether the preset switching conditions for the current screen state are met.

[0017] Furthermore, before the step of using the current screen state and the signal strength set as input to the machine learning model and executing the machine learning model to obtain the calculation result, the method further includes:

[0018] Obtain multiple sets of sample datasets, and the label information corresponding to each set of sample datasets; the label information includes the current screen state and the corresponding calculation result for each set of sample datasets.

[0019] Calculate the feature vector for each sample dataset. ,in This represents the q-th time point. This represents the feature vector of the i-th sample dataset. Let i represent the rate of change of signal strength between time point q and time point z, where q, z, and i are positive integers, and q > z, i ≤ n;

[0020] The multiple feature vectors are divided into training datasets and test datasets according to a preset ratio;

[0021] The training dataset and its corresponding label information are input into a preset machine learning initial model, and the preset machine learning initial model is trained according to the optimal hyperparameters.

[0022] The trained model is tested using the test dataset and its corresponding label information. When the test results meet the training requirements of the model, a machine learning model is obtained.

[0023] Furthermore, before the step of determining whether the signal strength set satisfies the preset switching conditions of the current screen state, the method further includes:

[0024] Receive the current movement status of the designated mobile terminal;

[0025] Based on the preset correspondence table between movement state and switching conditions, the preset switching conditions are obtained based on the current movement state.

[0026] Furthermore, before the step of determining whether the signal strength set satisfies the preset switching conditions of the current screen state, the method further includes:

[0027] Receive the security level sent by the designated mobile terminal;

[0028] Based on the preset security level and switching condition correspondence table, the preset switching conditions are obtained based on the security level.

[0029] A screen state switching method is applied to a PCBA module, the PCBA module being connected to a static terminal, the method comprising:

[0030] Establish a connection with a static terminal based on the Bluetooth HID protocol;

[0031] A real-time, periodic signal strength input report is sent to the static terminal.

[0032] A screen state switching system, the system being provided with a PCBA module, the system comprising:

[0033] A connection module is used to establish a wireless connection with a designated mobile terminal based on the PCBA module;

[0034] The first acquisition module is used to periodically acquire the signal strength of the specified mobile terminal in real time, and add a timestamp to each signal strength based on the acquisition time;

[0035] The selection module is used to select a preset number of signal strengths as a signal strength set based on the timestamps of each of the signal strengths.

[0036] The second acquisition module is used to acquire the current screen state of the display screen; wherein, the current screen state includes a locked screen state and an unlocked screen state;

[0037] The judgment module is used to determine whether the signal strength set meets the preset switching conditions of the current screen state;

[0038] The switching module is used to switch the current screen state if the signal strength set meets the preset switching conditions of the current screen state.

[0039] A USB flash drive device includes a PCBA module, the PCBA module including a memory and a processor, the memory storing a computer program, which, when executed by the processor, causes the processor to perform the following steps:

[0040] Establish a connection with a static terminal based on the Bluetooth HID protocol;

[0041] A real-time, periodic signal strength input report is sent to the static terminal.

[0042] A computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform the following steps:

[0043] A wireless connection is established between the PCBA module and the designated mobile terminal.

[0044] The signal strength of the specified mobile terminal is acquired periodically in real time, and a timestamp is added to each signal strength based on the acquisition time.

[0045] A preset number of signal strengths are selected as a signal strength set based on the timestamps of each of the signal strengths;

[0046] Obtain the current screen state of the display; wherein, the current screen state includes a locked screen state and an unlocked screen state;

[0047] Determine whether the signal strength set meets the preset switching conditions of the current screen state;

[0048] If the signal strength set satisfies the preset switching conditions of the current screen state, then the current screen state is switched.

[0049] The beneficial effects of this invention are as follows: Establishing a stable connection between the PCBA module and the designated mobile terminal ensures reliable information transmission. In the process monitoring of signal strength, the application of timestamps effectively reduces the impact of transient interference on the judgment results, making the system's assessment of user distance more accurate. By constructing a signal strength set and combining it with the judgment of the current screen state, the system can intelligently and automatically switch the screen lock state, thereby reducing unnecessary manual operations and improving user efficiency. By monitoring the signal strength changes of the designated mobile terminal in real time, the security and user experience of the static terminal are significantly improved, automatic screen locking can be achieved, and energy consumption is saved. Attached Figure Description

[0050] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0051] in:

[0052] Figure 1 This is an application environment diagram of a screen state switching method in one embodiment;

[0053] Figure 2 This is a flowchart of a screen state switching method in one embodiment;

[0054] Figure 3 This is a structural block diagram of a screen state switching device in one embodiment;

[0055] Figure 4This is a structural block diagram of a USB flash drive device in one embodiment. Detailed Implementation

[0056] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0057] Figure 1 This is a diagram illustrating the screen state switching application environment in one embodiment. (Refer to...) Figure 1 This screen state switching method is applied to a screen state switching system. The screen state switching system includes a mobile terminal 110 and a static terminal 120. The mobile terminal 110 and the static terminal 120 are connected via Bluetooth. Specifically, the mobile terminal 110 can be at least one of a mobile phone, tablet computer, laptop computer, etc. The static terminal 120 can be at least one of a computer, tablet computer, smart home device, etc. The mobile terminal 110 is used to provide signal strength, and the static terminal 120 is used to switch the current screen state based on the signal strength.

[0058] like Figure 2 As shown, in one embodiment, a screen state switching method is provided. This method can be applied to a static terminal or a server. If applied to a server, a signal strength set is uploaded to the server via a designated mobile terminal to determine whether the signal strength set meets the preset switching conditions for the current screen state. The determination result is then sent to the terminal to execute a switching command. This embodiment illustrates the application to a terminal. The screen state switching method specifically includes the following steps:

[0059] S1: Establish a wireless connection with the designated mobile terminal based on the PCBA module;

[0060] S2: Periodically acquire the signal strength of the specified mobile terminal in real time, and add a timestamp to each signal strength based on the acquisition time;

[0061] S3: Select a preset number of signal strengths as a signal strength set based on the timestamps of each of the signal strengths;

[0062] S4: Obtain the current screen state of the display; wherein, the current screen state includes a locked screen state and an unlocked screen state;

[0063] S5: Determine whether the signal strength set meets the preset switching conditions of the current screen state;

[0064] S6: If the signal strength set satisfies the preset switching condition of the current screen state, then switch the current screen state.

[0065] As described in step S1 above, a wireless connection is established between the PCBA module and the designated mobile terminal. The static terminal first needs to establish a wireless connection with the designated mobile terminal (such as a smartphone, tablet, or wearable smart device), specifically through near-field communication technologies such as Bluetooth or Wi-Fi. Taking a Bluetooth HID protocol connection as an example, during the pairing process, the terminal sends a Bluetooth connection request, and the designated mobile terminal responds according to its settings. After successful pairing, a persistent Bluetooth connection is established. Through the Bluetooth HID protocol, once the connection is established, the computer can receive various data from the mobile terminal, thus laying the foundation for subsequent signal strength assessment. The static terminal can specifically be a computer, smart home device, or tablet. A PCBA (Printed Circuit Board Assembly) module is a complete electronic component consisting of a printed circuit board (PCB) and electronic components soldered onto it; it can also be a USB flash drive. The initial wireless connection is established as follows: an app is installed on a designated mobile terminal. The app binds the PCBA module to the phone for the first time. The PCBA module detects the strength of the wireless signal (such as Bluetooth, Wi-Fi, broadcast, etc.) to determine the distance and records a unique identifier for the designated mobile terminal in the PCBA module for subsequent direct connection. After binding, the PCBA module automatically recognizes and connects to the designated mobile terminal. Therefore, after the designated mobile terminal connects via the app, the app can be deleted. Subsequent connections to the PCBA can be established simply by enabling the corresponding near-field communication on the designated mobile terminal. Furthermore, when a static terminal transitions from a locked to an unlocked state, a lock screen password is required. This password can be manually entered into the designated mobile terminal and then transmitted to the PCBA module via the app on the designated mobile terminal. Subsequent transitions from a locked to an unlocked state will automatically require the corresponding lock screen password.

[0066] As described in step S2 above, the signal strength with the designated mobile terminal is acquired periodically in real time, and a timestamp is added to each signal strength based on the acquisition time. This enables periodic monitoring of Bluetooth signal strength. The computer periodically queries the signal strength with the designated mobile terminal at fixed time intervals. Signal strength is an important indicator of the quality of wireless communication between two devices, usually expressed as RSSI (Received Signal Strength Indicator) value. To improve the timeliness of data processing, each signal strength acquisition is accompanied by a timestamp, which records changes in the signal. This timestamp helps with subsequent analysis, especially when it is necessary to examine the trend of signal strength changes over time in later steps. Furthermore, by acquiring signal strength periodically, the system can more accurately determine the user's distance and status, thereby enabling automatic switching of screen states.

[0067] As described in step S3 above, a preset number of signal strengths are selected as a signal strength set based on the timestamps of each signal strength. Using the collected signal strength data and timestamps, data filtering and set construction are performed. Based on a preset number (e.g., the past 10 signal strength values), the system selects signal strength values ​​from historical records and constructs a signal strength set. The main purpose of this process is to avoid misjudgments caused by instantaneous signal fluctuations through the analysis of a certain number of signal strengths. By selecting the signal strength with the most recent timestamp, the system can ensure a more accurate judgment of the user's state. This collection method can effectively reflect the overall trend of signal changes within a specific time period, providing a valid basis for subsequent state judgments. The effective implementation of this step directly relates to the accuracy and intelligence of subsequent screen lock state judgments.

[0068] As described in step S4 above, the current screen state of the display screen is obtained; wherein, the current screen state includes a locked screen state and an unlocked screen state. The computer system needs to monitor its screen state in real time to determine whether it is currently in a "locked screen state" or an "unlocked screen state." This state monitoring can be obtained directly through the system API, or through user operations and interactions. A locked screen state means that the user cannot directly access the functions of the static terminal and authentication is required to unlock it, while an unlocked screen state means that the user can freely operate the static terminal. Accurately obtaining the current screen state provides basic information for determining whether subsequent signal strength sets meet the switching conditions, thus providing a basis for the automated control of the screen state switching system.

[0069] As described in step S5 above, it is determined whether the signal strength set meets the preset switching conditions for the current screen state. The system determines whether to switch the screen lock state based on the signal strength set established in the previous steps. First, this requires pre-setting certain switching conditions. For example, when the signal strength is below a certain threshold (indicating the user is far from the computer), the system will make an automatic screen lock decision based on the threshold. Conversely, if the detected signal strength is consistently above a certain value, it indicates the user is approaching the computer, and the system can be determined to be in an "unlocked state." This judgment process is the core of the screen state switching system and is directly related to the system's responsiveness and accuracy. By analyzing and judging the signal strength set, the system can intelligently adapt to user behavior, improve computer security and convenience, and effectively avoid accidental or missed screen locks.

[0070] As described in step S6 above, if the signal strength set meets the preset switching conditions for the current screen state, the current screen state is switched. If it is determined that the current signal strength set meets the preset switching conditions, that is, it is confirmed that the user's position or state has changed significantly, then the screen lock or unlock operation will be performed. This process can be called through the corresponding API of the operating system to intervene in the computer's screen lock state. If the conditions for automatic screen lock are met, the system will quickly switch to the screen lock state to protect the user's data security; if the conditions are not met, the current state will be retained. This intelligent screen lock mechanism not only reduces the frequency of manual operation by the user and improves security, but also conforms to the user's operating habits and provides a more user-friendly experience. The screen state switching method realizes an efficient and automatic workflow, ensuring the security of user data and devices. Modern displays, especially high-brightness, high-resolution or OLED / AMOLED screens, are one of the most power-consuming components in the entire computer system, often far exceeding the CPU's power consumption. When the system automatically locks the screen, the display is usually set to turn off or enter an ultra-low power sleep state (such as the OSD backlight being turned off). When the screen is off, its power consumption can drop dramatically from tens or even hundreds of watts (for high-brightness large screens) to typically only 1-3 watts or even lower. For laptop users, this directly translates to longer battery life. Furthermore, in the locked state, most non-essential user applications and services are paused or restricted, reducing unnecessary CPU calculations and storage accesses, further saving energy.

[0071] In one embodiment, step S1, which establishes a wireless connection between the PCBA module and the designated mobile terminal, includes:

[0072] S101: Obtain the HID service information broadcast by the designated mobile terminal;

[0073] S102: Based on the HID service information, establish a connection with the designated mobile terminal through the PCBA module.

[0074] As described in step S101 above, the static terminal actively scans via the Bluetooth module to obtain service information broadcast by all nearby mobile terminals supporting the Bluetooth HID protocol. Bluetooth HID (Human Interface Device) service information typically includes the device name, device type, supported functions, and current signal strength. The system needs to initiate a Bluetooth scan request and receive broadcast data packets from the mobile terminal. The service information contained in these packets has a standardized format, facilitating interpretation and processing between devices. Obtaining HID service information not only allows the system to confirm whether the target mobile terminal supports the Bluetooth HID protocol but also provides necessary parameters for subsequent connection steps. This process is usually real-time and may require repeated scanning to ensure the device is in the appropriate state for connection. To ensure a smooth user experience, the system immediately displays a list of connectable devices after obtaining valid HID service information, allowing the user to select and connect.

[0075] As described in step S102 above, a connection is established with the designated mobile terminal through the PCBA module based on the HID service information. Upon successfully obtaining the HID service information of the target mobile terminal, the static terminal will establish an actual connection with the mobile terminal through the PCBA module using the Bluetooth HID protocol. This connection process involves defining connection parameters and sending a connection request, including device address, service UUID, pairing request, and other information. During this process, the system will also perform authentication to ensure the security of the end-to-end connection. This pairing process may include PIN code input to ensure that only authorized user devices can connect. After successfully establishing a connection, the static terminal will enter a "pairing state" and maintain a stable data transmission channel with the mobile terminal. In the Bluetooth HID protocol architecture, the connection method can be either active (static terminal initiates connection) or passive (mobile terminal initiates connection). The specific connection behavior depends on the user interface and system design. During connection establishment, the system will also perform signal strength evaluation to ensure good connection quality. Once the connection is successful, the computer can begin receiving various signal data from the mobile terminal, providing data support for subsequent screen lock status monitoring and intelligent control.

[0076] In one embodiment, step S5, which determines whether the signal strength set satisfies the preset switching conditions of the current screen state, includes:

[0077] S501: Using the current screen state and the signal strength set as input to the machine learning model, execute the machine learning model to obtain the calculation result;

[0078] S502: Compare the calculation result with the set threshold to determine whether the preset switching conditions of the current screen state are met.

[0079] As described in step S501 above, the current screen state and the signal strength set are used as inputs to the machine learning model, and the machine learning model is executed to obtain the calculation result. The current screen state (including locked and unlocked states) and the signal strength set are used as input data and fed into a pre-trained machine learning model. Machine learning models are typically trained on past datasets and can make intelligent decisions through feature extraction and pattern recognition. The current screen state and signal strength set are used as feature values, and the model analyzes these features to determine the user's behavior patterns. The machine learning model can take various forms, such as decision trees, support vector machines, and neural networks. The key to this process is the accuracy and applicability of the model, because only through accurate learning and training can the model effectively understand the information conveyed by the input features and generate meaningful outputs. After the machine learning model completes its calculation, the system outputs a calculation result, usually a numerical or classification result, representing whether the current screen state should be switched. The advantage of this process is that it can dynamically adapt to the user's usage habits; for example, in certain situations (such as rapid fluctuations in signal strength), the user may enter and exit the locked screen state more frequently in a short period of time. The application of machine learning models enables the system to gradually optimize its judgment logic through historical data, thereby improving the flexibility and accuracy of screen state switching.

[0080] As described in step S502 above, the calculation result is compared with a set threshold to determine whether the preset switching conditions for the current screen state are met. After obtaining the calculation result, this result is further analyzed, i.e., compared with the preset threshold. The selection of the set threshold is usually based on past data analysis and user experience optimization, with the aim of determining whether the lock screen state should be switched under specific conditions. The threshold can be a fixed value or dynamically adjusted according to user usage patterns. It should be noted that different lock screen states can have the same set threshold. For example, the threshold can be set to 10. This is because the value before calculating the result can be processed into an absolute value. Generally, before calculating the absolute value, the current screen state is a locked screen state, and the calculated value that satisfies the switching conditions is generally a negative number. Therefore, the corresponding set threshold should be a negative number. Only when the calculated value is less than the threshold will the state switch be performed. If it is processed into an absolute value, the same judgment method can be satisfied, that is, the final calculated value only needs to be greater than the threshold to be judged as satisfied. By comparing the calculation result with the threshold, the system can quickly determine whether the preset switching conditions for the current screen state are met. For example, if calculations indicate that the user is far enough from the computer and the signal strength is below a set threshold, the system can decide to automatically lock the screen; otherwise, it will remain unlocked. This comparison process is crucial because it not only provides the basis for switching but also offers users a more adaptive and intelligent interactive experience. Furthermore, in certain implementations, the system can use the comparison results to record historical data, continuously optimizing the set threshold and the parameters of the machine learning model. This cyclical feedback mechanism improves the responsiveness and accuracy of the screen state switching system, ensuring that the system always meets the user's actual needs.

[0081] In one embodiment, before step S501, which uses the current screen state and the signal strength set as input to a machine learning model and executes the machine learning model to obtain a calculation result, the method further includes:

[0082] S5001: Obtain multiple sets of sample datasets, and the label information corresponding to each set of sample datasets; the label information includes the current screen state and the corresponding calculation result for each set of sample datasets;

[0083] S5002: Calculate the feature vector for each sample dataset. ,in This represents the q-th time point. This represents the feature vector of the i-th sample dataset. Let i represent the rate of change of signal strength between time point q and time point z, where q, z, and i are positive integers, and q > z, i ≤ n;

[0084] S5003: Divide the multiple feature vectors into a training dataset and a test dataset according to a preset ratio;

[0085] S5004: Input the training dataset and the corresponding label information of the training dataset into the preset machine learning initial model, and train the preset machine learning initial model according to the optimal hyperparameters;

[0086] S5005: The trained model is tested using the test dataset and the corresponding label information of the test dataset. When the test results meet the training requirements of the model, a machine learning model is obtained.

[0087] As described in step S5001 above, multiple sets of sample datasets are acquired, along with corresponding label information for each set. The label information includes the current screen state and corresponding calculation results for each set of sample datasets. These sample datasets are obtained through actual user behavior or simulated scenarios, covering different usage contexts and environments. Each set of sample datasets is associated with corresponding label information. This label information includes the current screen state (e.g., "locked" or "unlocked") and the state switching results calculated based on signal strength and other relevant factors. Valid sample datasets can include data from multiple users in different created environments, ensuring the model's generalization ability so that it can operate normally on different users and devices. This preparation step lays a solid foundation for subsequent feature vector extraction and model training, thereby improving the effectiveness and practicality of machine learning.

[0088] As described in step S5002 above, feature extraction is performed on each sample dataset to calculate a feature vector. The feature vector is an important concept in machine learning, transforming raw data into a numerical representation that can be used for model training. Signal strength variation is a crucial factor in determining whether a user is near the device. However, a single RSSI (Received Signal Strength Indication) value is affected by various environmental factors, such as physical obstacles, interference sources, and user movement. Relying solely on the signal strength at the current time point can lead to misjudgments; for example, a user may be near the device but incorrectly judged as being far away due to brief signal interference, resulting in unnecessary screen locking. To address this issue, correlating the signal strength at the current time point with the signal strength over the previous q time points provides a more comprehensive picture of signal strength variation. This method not only helps smooth out the impact of instantaneous signal fluctuations but also captures the trend of signal strength over time. By analyzing historical signal data over a period of time, the rate of signal change can be extracted, and these variation characteristics can be combined to make a more accurate judgment of the current screen lock status.

[0089] As described in step S5003 above, the multiple feature vectors are divided into training and testing datasets according to a preset ratio. The system needs to partition the calculated feature vectors into training and testing datasets. This process is typically performed according to a preset ratio; for example, a common partitioning method is to use 70%-80% of the data for training and the remaining 20%-30% for testing. The training dataset is used to train the machine learning model, enabling it to learn how to generate corresponding output results from input features, while the testing dataset is used to evaluate the performance and generalization ability of the trained model. The process of partitioning the feature vectors is a crucial step in ensuring model effectiveness, as the training and testing datasets should be relatively independent to avoid overfitting caused by the model acquiring information from the training process during testing. The testing dataset helps determine the model's performance on unseen new data, evaluating the model's accuracy and robustness by comparing the model's predictions with the actual labels. Through effective data partitioning, the system ensures the comprehensiveness of model training and the reliability of the results, providing data support for subsequent model optimization and tuning.

[0090] As described in step S5004 above, the training dataset and its corresponding label information are input into a preset initial machine learning model, and the preset initial machine learning model is trained according to the optimal hyperparameters. The type of machine learning model selected depends on the specific application requirements; for example, it could be a Support Vector Machine (SVM), Random Forest, or Neural Network. By inputting training data, the model will begin to learn the relationship between features and labels. During training, the model will be tuned according to the preset optimal hyperparameters. Hyperparameters include the learning rate, regularization parameters, and the depth of the decision tree, which significantly affect the model's learning efficiency and prediction accuracy. The optimal hyperparameter training method can be any one of grid search, cross-validation, random search, or Bayesian optimization. After multiple rounds of iterative training, the model adjusts its parameters to reduce prediction errors, enabling the final model to more accurately understand input features and better adapt to different user behaviors. This process is crucial for the success of machine learning applications, ensuring that the model has sufficient capability and flexibility to cope with various input scenarios.

[0091] As described in step S5005 above, the trained model is tested using the test dataset and its corresponding label information. When the detection results meet the training requirements of the model, a machine learning model is obtained. The previously divided test dataset is used to evaluate and test the trained machine learning model. By inputting feature vectors from the test dataset, the model outputs its prediction results. The model's prediction results are then compared with the actual labels in the test dataset to evaluate the model's accuracy and performance. If the detection results meet preset performance requirements, such as prediction accuracy, recall, or F1 score, it indicates that the model's learning outcomes based on the training data are effective and can be applied in practice. If the model's performance does not meet the requirements, further adjustments may be needed, including modifying hyperparameters, selecting different machine learning algorithms, or even adding more training data. Through this feedback mechanism, the system can continuously optimize the learning model, ensuring that the final generated machine learning model has high recognition capabilities and accuracy, and can be successfully applied to subsequent screen state switching judgments, thereby achieving efficient user experience and security management.

[0092] In one embodiment, before step S5 of determining whether the signal strength set satisfies the preset switching condition of the current screen state, the method further includes:

[0093] S401: Receive the current mobility status of the designated mobile terminal;

[0094] S402: According to the preset correspondence table between movement state and switching condition, obtain the preset switching condition based on the current movement state.

[0095] As described in step S401 above, the current movement state of the designated mobile terminal is received. It is necessary to obtain the user's current movement state from the designated mobile terminal. This state information is crucial for screen state switching decisions because it provides insight into the user's activity, such as whether the user is stationary, moving, or in another state. Mobile terminals typically monitor and determine the user's movement state using built-in sensors (such as accelerometers, gyroscopes, GPS, etc.) and then send this information to the static terminal. Specific types of current movement states include "stationary," "walking," and "running." The system receives and updates this state information at fixed time intervals to ensure that decisions are based on the latest user behavior. After obtaining the current movement state, the system can make corresponding decisions based on different usage scenarios. By integrating the current movement state, the lock screen system can establish a more intelligent interaction, thereby improving the user experience while meeting security requirements. Effective movement state tracking can reduce unnecessary screen locking actions, provide a smoother user experience, and create a more comfortable operating environment for the user.

[0096] As described in step S402 above, preset switching conditions are obtained based on the current movement state according to a preset movement state and switching condition correspondence table. Based on the current movement state information received from the mobile terminal, the corresponding preset switching conditions are searched and extracted. This process relies on a predefined "movement state and switching condition correspondence table," which contains strategies for screen lock state switching under different movement states. For example, for the "driving" state, the system may need to set a higher signal strength threshold to ensure the user is not accidentally locked while driving; while for the "stationary" state, the system can use stricter conditions to make screen locking faster. The design of this correspondence table is an important component of the intelligent screen lock system. By presetting different movement states and switching conditions, the system can intelligently adjust the screen lock strategy according to the user's real-time behavior, thereby adapting to user needs in different scenarios. This technological flexibility greatly enhances the system's applicability, providing personalized solutions for different environments and users. By comprehensively considering the user's movement status and signal strength, this judgment process is more comprehensive, effective, and accurate, achieving true screen state switching. In this way, users can enjoy a safe and convenient experience in various dynamic scenarios.

[0097] In one embodiment, before step S5 of determining whether the signal strength set satisfies the preset switching condition of the current screen state, the method further includes:

[0098] S411: Receive the security level sent by the designated mobile terminal;

[0099] S412: According to the preset security level and switching condition correspondence table, obtain the preset switching conditions based on the security level.

[0100] As described in steps S411-S412 above, security level information is received from a designated mobile terminal. This security level can be calculated and evaluated by the mobile device based on various factors such as user settings, device status, location, and current activity scenario. The designated mobile terminal transmits the security level information to the static terminal. Security levels generally include multiple tiers, such as "high," "medium," and "low," reflecting the user's security needs and risk assessment. The introduction of security levels helps enhance the security and flexibility of the screen state switching system. After receiving the security level information, the system can adopt different screen-locking strategies according to different levels. For example, at a high security level, the system may lower the signal strength threshold and quickly lock the screen; while at a low security level, the system can handle the screen-locking state more leniently, providing greater convenience. In this way, the system achieves personalized responses to user needs, ensuring that user efficiency and user experience are improved without compromising security. In one embodiment, the corresponding preset switching conditions can also be obtained from a preset "Movement State and Switching Condition Correspondence Table" based on the received current movement state and security level. This correspondence table is designed for different movement states and security levels, ensuring that the system can flexibly adjust the screen-locking strategy in different contexts. For example, in a high-security environment and when the user is stationary, a signal strength of at least -60dBm is required to maintain an unlocked screen; while in a "walking" state, the signal strength threshold needs to be reduced to -70dBm. Through this dynamic adjustment mechanism, the system can adapt to the user's real-time status and security needs, providing a more intelligent and user-friendly interactive experience. Therefore, by combining the current movement status, security level, and preset switching conditions, the system achieves more precise and effective screen lock control, ensuring security while avoiding unnecessary interference. In some embodiments, if the static terminal is a smart light, the light can be brightened when the signal strength is high and automatically dimmed when the signal strength is low, thus intelligently adjusting the light's brightness. If it is an air conditioner, the temperature can be lowered when the signal strength is high and automatically raised when the signal strength is low, thus intelligently adjusting the air conditioner's temperature to achieve energy saving.

[0101] The present invention also provides a screen state switching method, applied to a PCBA module, wherein the PCBA module is connected to a static terminal, the method comprising:

[0102] S001: Establishes a connection with a static terminal based on the Bluetooth HID protocol;

[0103] S002: Input report of signal strength sent to the static terminal in real time and periodically.

[0104] As described in steps S001-S022 above, the designated mobile terminal (such as a smartphone or tablet) first needs to establish a connection with the static terminal based on the Bluetooth HID protocol. This process typically begins in the mobile terminal's Bluetooth settings interface, where the user selects the static terminal to connect and initiates a pairing request. Upon receiving this request, the static terminal needs to authenticate itself to ensure connection security. During the connection process, the mobile terminal broadcasts its HID service information, including device ID, supported functions, device type, etc., which helps the static terminal identify and confirm the legitimacy of the connection. Once the connection is successfully established, Bluetooth creates a stable data channel, allowing bidirectional communication between the mobile terminal and the static terminal. During this process, the pairing information of both parties is also recorded for faster future connections. The key to establishing a Bluetooth HID connection is ensuring stability and security; device interoperability is also crucial. After a successful connection, the mobile terminal can perform subsequent signal transmission and screen lock control functions, laying the foundation for screen state switching. Through the established Bluetooth HID connection, the mobile terminal begins to periodically send signal strength input reports to the static terminal in real time. This input report typically includes the RSSI (Received Signal Strength Indicator) value sent by the mobile terminal, representing the wireless signal quality between the mobile and stationary terminals. The interval for periodic transmission can be set according to actual needs, such as every second or every two seconds, to ensure real-time signal updates. The purpose of sending signal strength reports is to allow the stationary terminal to dynamically monitor the distance between the user and the device, enabling accurate decisions when determining the screen lock state. When the signal strength value is high, it indicates that the user is close to the stationary terminal, and the system can decide to keep the screen unlocked; conversely, when the signal gradually weakens and reaches a preset threshold, the system may automatically switch to the screen lock state, thus ensuring data security. During transmission, changes in signal strength can provide data support for subsequent machine learning algorithms, such as for analyzing user behavior patterns and improving the accuracy of screen lock decisions.

[0105] Reference Figure 3 The present invention also provides a screen state switching system, the system being provided with a PCBA module, the system comprising:

[0106] Connection module 902 is used to establish a wireless connection with a designated mobile terminal based on the PCBA module;

[0107] The first acquisition module 904 is used to periodically acquire the signal strength of the specified mobile terminal in real time, and add a timestamp to each signal strength based on the acquisition time.

[0108] The selection module 906 is used to select a preset number of signal strengths as a signal strength set based on the timestamps of each of the signal strengths.

[0109] The second acquisition module 908 is used to acquire the current screen state of the display screen; wherein, the current screen state includes a locked screen state and an unlocked screen state;

[0110] The judgment module 910 is used to determine whether the signal strength set meets the preset switching conditions of the current screen state;

[0111] The switching module 912 is used to switch the current screen state if the signal strength set meets the preset switching conditions of the current screen state.

[0112] In one embodiment, the connection module 902 includes:

[0113] The HID service information acquisition submodule acquires the HID service information broadcast by the specified mobile terminal.

[0114] A designated mobile terminal connection submodule is used to establish a connection with the designated mobile terminal through the PCBA module based on the HID service information.

[0115] In one embodiment, the determination module 910 includes:

[0116] The input submodule is used to take the current screen state and the signal strength set as input to the machine learning model, and execute the machine learning model to obtain the calculation result;

[0117] The comparison submodule is used to compare the calculation result with a set threshold to determine whether the preset switching conditions of the current screen state are met.

[0118] In one embodiment, the determining module 910 further includes:

[0119] The sample dataset acquisition submodule is used to acquire multiple sets of sample datasets and the label information corresponding to each set of sample datasets; the label information includes the current screen state and the corresponding calculation result for each set of sample datasets.

[0120] The feature vector calculation submodule is used to calculate the feature vector for each set of sample datasets. ,in This represents the q-th time point. This represents the feature vector of the i-th sample dataset. Let i represent the rate of change of signal strength between time point q and time point z, where q, z, and i are positive integers, and q > z, i ≤ n;

[0121] The feature vector partitioning submodule is used to divide the multiple feature vectors into a training dataset and a test dataset according to a preset ratio;

[0122] The training data input submodule is used to input the training dataset and the corresponding label information of the training dataset into the preset machine learning initial model, and train the preset machine learning initial model according to the optimal hyperparameters;

[0123] The detection submodule is used to detect the trained model using the test dataset and the corresponding label information of the test dataset. When the detection result meets the training requirements of the model, a machine learning model is obtained.

[0124] In one embodiment, the screen state switching system further includes:

[0125] The current mobility status receiving module is used to receive the current mobility status of the specified mobile terminal;

[0126] The preset switching condition first acquisition module is used to acquire preset switching conditions based on the current movement state according to a preset movement state and switching condition correspondence table.

[0127] In one embodiment, the screen state switching system further includes:

[0128] A security level acquisition module is used to receive the security level sent by the designated mobile terminal;

[0129] The second module for obtaining preset switching conditions is used to obtain preset switching conditions based on the preset security level and the corresponding table of security levels and switching conditions.

[0130] Figure 4 An internal structural diagram of a USB flash drive device in one embodiment is shown. The USB flash drive device integrates the PCBA module and includes a processor, memory, and network interface connected via a system bus. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium of the USB flash drive device stores an operating system and may also store a computer program. When executed by the processor, this computer program enables the processor to implement a screen state switching method. The internal memory may also store a computer program, which, when executed by the processor, enables the processor to implement the screen state switching method. Those skilled in the art will understand that… Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the USB flash drive device to which the present application is applied. A specific USB flash drive device may include more or fewer components than those shown in the figure, or may combine certain components, or may have different component arrangements.

[0131] In one embodiment, a USB flash drive device is provided, including a PCBA module. The PCBA module includes a memory and a processor. The memory stores a computer program, which, when executed by the processor, causes the processor to perform the following steps:

[0132] Establish a connection with a static terminal based on the Bluetooth HID protocol;

[0133] A real-time, periodic signal strength input report is sent to the static terminal.

[0134] By establishing a stable connection with the designated mobile terminal using the PCBA module, reliable information transmission is ensured. During signal strength monitoring, the application of timestamps effectively reduces the impact of transient interference on the judgment results, making the system's assessment of user distance more accurate. By constructing a signal strength set and combining it with the judgment of the current screen state, the system can intelligently and automatically switch the screen lock state, thereby reducing unnecessary manual operations and improving user efficiency. By monitoring the signal strength changes of the designated mobile terminal in real time, the security and user experience of the static terminal are significantly improved, enabling automatic screen locking and saving energy consumption.

[0135] In one embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, causes the processor to perform the following steps:

[0136] A wireless connection is established between the PCBA module and the designated mobile terminal.

[0137] The signal strength of the specified mobile terminal is acquired periodically in real time, and a timestamp is added to each signal strength based on the acquisition time.

[0138] A preset number of signal strengths are selected as a signal strength set based on the timestamps of each of the signal strengths;

[0139] Obtain the current screen state of the display; wherein, the current screen state includes a locked screen state and an unlocked screen state;

[0140] Determine whether the signal strength set meets the preset switching conditions of the current screen state;

[0141] If the signal strength set satisfies the preset switching conditions of the current screen state, then the current screen state is switched.

[0142] By establishing a stable connection with the designated mobile terminal using the PCBA module, reliable information transmission is ensured. During signal strength monitoring, the application of timestamps effectively reduces the impact of transient interference on the judgment results, making the system's assessment of user distance more accurate. By constructing a signal strength set and combining it with the judgment of the current screen state, the system can intelligently and automatically switch the screen lock state, thereby reducing unnecessary manual operations and improving user efficiency. By monitoring the signal strength changes of the designated mobile terminal in real time, the security and user experience of the static terminal are significantly improved, enabling automatic screen locking and saving energy consumption.

[0143] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.

[0144] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0145] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A screen state switching method, applied to a static terminal, wherein the static terminal is equipped with a PCBA module, characterized in that, The method includes: A wireless connection is established between the PCBA module and the designated mobile terminal. The PCBA module periodically acquires the signal strength of the specified mobile terminal in real time, and adds a timestamp to each signal strength based on the acquisition time. A preset number of signal strengths are selected as a signal strength set based on the timestamps of each of the signal strengths; Obtain the current screen state of the display; wherein, the current screen state includes a locked screen state and an unlocked screen state; Determine whether the signal strength set meets the preset switching conditions of the current screen state; If the signal strength set satisfies the preset switching condition of the current screen state, then the current screen state is switched. The step of determining whether the signal strength set meets the preset switching conditions of the current screen state includes: Obtain multiple sets of sample datasets, and the label information corresponding to each set of sample datasets; the label information includes the current screen state and the corresponding calculation result for each set of sample datasets. Calculate the feature vector for each sample dataset. ,in This represents the q-th time point. This represents the feature vector of the i-th sample dataset. Let i represent the rate of change of signal strength between time point q and time point z, where q, z, and i are positive integers, and q > z, i ≤ n; The multiple feature vectors are divided into training datasets and test datasets according to a preset ratio; The training dataset and its corresponding label information are input into a preset machine learning initial model, and the preset machine learning initial model is trained according to the optimal hyperparameters. The trained model is tested using the test dataset and the corresponding label information of the test dataset. When the test results meet the training requirements of the model, a machine learning model is obtained. The current screen state and the signal strength set are used as inputs to the machine learning model, and the machine learning model is executed to obtain the calculation results. The calculation result is compared with a set threshold to determine whether the preset switching conditions of the current screen state are met. Before the step of determining whether the signal strength set meets the preset switching conditions of the current screen state, the method further includes: Receive the current movement status of the designated mobile terminal; wherein the designated mobile terminal acquires the user's current movement status based on built-in sensors, and the current movement status includes stationary, walking, and running; Based on the preset correspondence table between movement state and switching conditions, the preset switching conditions are obtained based on the current movement state.

2. The screen state switching method according to claim 1, characterized in that, The step of establishing a wireless connection between the PCBA module and the designated mobile terminal includes: Obtain the HID service information broadcast by the specified mobile terminal; Based on the HID service information, a connection is established with the designated mobile terminal through the PCBA module.

3. The screen state switching method according to claim 1, characterized in that, Before the step of determining whether the signal strength set meets the preset switching conditions of the current screen state, the method further includes: Receive the security level sent by the designated mobile terminal; Based on the preset security level and switching condition correspondence table, the preset switching conditions are obtained based on the security level.

4. A screen state switching system, characterized in that, The system is equipped with a PCBA module, and the system includes: A connection module is used to establish a wireless connection with a designated mobile terminal based on the PCBA module; The first acquisition module is used to periodically acquire the signal strength of the specified mobile terminal in real time, and add a timestamp to each signal strength based on the acquisition time; The selection module is used to select a preset number of signal strengths as a signal strength set based on the timestamps of each of the signal strengths. The second acquisition module is used to acquire the current screen state of the display screen; wherein, the current screen state includes a locked screen state and an unlocked screen state; The judgment module is used to determine whether the signal strength set meets the preset switching conditions of the current screen state; A switching module is used to switch the current screen state if the signal strength set satisfies the preset switching conditions of the current screen state. The judgment module includes: The sample dataset acquisition submodule is used to acquire multiple sets of sample datasets and the label information corresponding to each set of sample datasets; the label information includes the current screen state and the corresponding calculation result for each set of sample datasets. The feature vector calculation submodule is used to calculate the feature vector for each set of sample datasets. ,in This represents the q-th time point. This represents the feature vector of the i-th sample dataset. Let i represent the rate of change of signal strength between time point q and time point z, where q, z, and i are positive integers, and q > z, i ≤ n; The feature vector partitioning submodule is used to divide the multiple feature vectors into a training dataset and a test dataset according to a preset ratio; The training data input submodule is used to input the training dataset and the corresponding label information of the training dataset into the preset machine learning initial model, and train the preset machine learning initial model according to the optimal hyperparameters; The detection submodule is used to detect the trained model using the test dataset and the corresponding label information of the test dataset. When the detection result meets the training requirements of the model, a machine learning model is obtained. The input submodule is used to take the current screen state and the signal strength set as input to the machine learning model, and execute the machine learning model to obtain the calculation result; The comparison submodule is used to compare the calculation result with a set threshold to determine whether the preset switching conditions of the current screen state are met. A current mobility status receiving module is used to receive the current mobility status of the designated mobile terminal; wherein, the designated mobile terminal obtains the user's current mobility status based on built-in sensors, and the current mobility status includes stationary, walking, and running; The preset switching condition first acquisition module is used to acquire preset switching conditions based on the current movement state according to a preset movement state and switching condition correspondence table.

5. A computer-readable storage medium, characterized in that, The device stores a computer program that, when executed by a processor, causes the processor to perform the steps of the screen state switching method as described in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Method and device for switching state of electronic equipment

    CN104978544A