Portable wireless radio frequency switching method and system, medium and program product
By using a portable wireless radio frequency switching method, low-power standby is achieved through signal scanning and secure communication connections. This solves the problems of cumbersome frequency band switching operations and high energy consumption in radio frequency equipment, reduces equipment costs, and improves security and reliability.
Patent Information
- Application Number
- CN202511791857.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-01
- Publication Date
- 2026-03-06
AI Technical Summary
Existing radio frequency equipment requires physical contact or disassembly of the device casing when switching frequency bands, which makes operation cumbersome and prone to damage. At the same time, it is difficult to meet the ultra-low power consumption and long battery life requirements of portable devices, increasing the static power consumption and usage costs of the equipment.
A portable wireless radio frequency switching method is adopted. By scanning the signal within a preset frequency band, the radio frequency signal strength value is obtained, the device to be switched is woken up and a secure communication connection is established. Encrypted radio frequency configuration data is transmitted and stored. After the data writing is completed, the device to be switched automatically returns to a deep sleep state and only activates the radio frequency module and processor when a wake-up command is received.
It achieves low-power standby, reduces device energy consumption, improves communication security and data transmission reliability, reduces energy waste, and lowers device operating costs.
Smart Images

Figure CN121619639A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of transmission, and in particular relates to a portable wireless radio frequency switching method, system, medium and program product. Background Technology
[0002] With the widespread application of radio frequency (RF) technology, the demand for frequency band switching in RF equipment is increasing. However, existing RF equipment generally lacks external switching ports after production, which means that frequency band switching often requires physical contact or disassembling the equipment casing. This method is not only cumbersome but also prone to damaging the equipment, and it also brings many inconveniences to equipment management and maintenance.
[0003] In related technologies, a wired interface-based RF parameter configuration device can be used. This device establishes a physical connection with the RF equipment via a dedicated cable and adjusts the operating parameters of the RF equipment through configuration software. While this method avoids disassembling the device casing, it still requires a dedicated configuration interface on the device, and a stable physical connection needs to be established during the configuration process.
[0004] However, neither physical disassembly nor wired configuration can meet the core requirements of modern portable / IoT devices for ultra-low power consumption and long battery life. In order to respond to configuration requests, devices often struggle to enter a true deep sleep mode, resulting in high static power consumption, energy waste, and increased operating costs. Summary of the Invention
[0005] This application provides a portable wireless radio frequency switching method, system, medium, and program product for achieving low-power standby while maintaining a certain power to monitor configuration requests, thereby reducing energy waste and lowering the cost of using the equipment.
[0006] In a first aspect, this application provides a portable wireless radio frequency handover method applied to a system, the system including a handover device and a device to be handoverdone. The method includes: the handover device scanning a signal within a preset frequency band to obtain the radio frequency signal strength value of the device to be handoverdone; if the distance between the handover device and the device to be handoverdone is determined to be no greater than a preset distance threshold based on the radio frequency signal strength value, the handover device sending a wake-up command and a handshake request to the device to be handoverdone, which is in a deep sleep state and maintaining low-power monitoring, the wake-up command being used to wake up the radio frequency module and processor of the device to be handoverdone; the handshake request between the handover device and the woken-up device to establish a secure communication connection, the handshake request including two-way authentication; after the secure communication connection is established, the handover device sending encrypted radio frequency configuration data to the device to be handoverdone, the device to be handoverdone writing the received encrypted radio frequency configuration data into a non-volatile memory; after the device to be handoverdone completes writing the encrypted radio frequency configuration data, it sending an acknowledgment signal to the handover device and automatically switching to a deep sleep state and maintaining low-power monitoring.
[0007] By adopting the above technical solutions, the device to be switched employs a deep sleep and low-power monitoring mode, activating the RF module and processor only upon receiving a wake-up command, thus reducing the power consumption of the device to be switched. The two-way authentication handshake mechanism enhances the security of both communicating parties, preventing unauthorized access by devices. Encrypted transmission and storage of RF configuration data further improves data security, preventing theft or tampering of configuration information. After completing data writing, the device to be switched automatically returns to a deep sleep state and maintains low-power monitoring, ensuring the reliable completion of the switching operation. While maintaining a certain power to monitor configuration requests, it achieves low-power standby, thereby reducing energy waste and lowering the operating costs of the equipment.
[0008] In some embodiments of the first aspect, before obtaining the radio frequency signal strength value of the device to be switched, the method further includes: the switching device calculating the current moving velocity vector based on acceleration data and the current orientation angle based on angular velocity data; the switching device determining a fan-shaped detection area based on the moving velocity vector and the orientation angle, wherein the fan-shaped detection area has the current position of the switching device as the vertex, the direction of the moving velocity vector as the axis of symmetry, a preset detection radius as the radius, and a preset detection angle as the opening angle; the switching device obtaining the azimuth angle and signal strength of each radio frequency signal source within the fan-shaped detection area; based on the azimuth angle and signal strength, the switching device calculating the angular interval and signal strength difference between adjacent radio frequency signal sources, and determining radio frequency signal sources with an angular interval greater than a preset angle threshold and a signal strength difference greater than a preset strength threshold as distinguishable devices to be switched; the switching device adjusting the beam direction to the azimuth angle of the radio frequency signal source with the strongest signal strength according to the number and distribution of distinguishable devices to be switched, and adjusting the preset distance threshold to be less than the minimum distance between adjacent distinguishable devices to be switched.
[0009] By adopting the above technical solution, a fan-shaped detection area is constructed using the acceleration and angular velocity data of the switching device, and the scanning direction is determined by the moving velocity vector, thereby improving the detection efficiency of the target device. Based on the azimuth angle and signal strength, the angular spacing and signal strength difference between adjacent radio frequency signal sources are calculated, allowing for the differentiation of multiple densely distributed devices to be switched. Dynamically adjusting the beam direction to the location of the radio frequency source with the strongest signal, and adjusting the distance threshold according to the actual distribution of distinguishable devices, improves signal reception quality, reduces invalid scanning range, lowers signal interference, enhances communication reliability, and optimizes system resource utilization efficiency.
[0010] In conjunction with some embodiments of the first aspect, in some embodiments, the switching device adjusts the beam direction to the azimuth angle of the radio frequency signal source with the strongest signal strength according to the number and distribution location of the distinguishable devices to be switched. Specifically, this includes: the switching device dividing the fan-shaped detection area into multiple fan-shaped sub-regions, each fan-shaped sub-region having an opening angle smaller than a preset detection angle; the switching device calculating the number of distinguishable devices to be switched and the distribution location of each distinguishable device to be switched within each fan-shaped sub-region; the switching device selecting the fan-shaped sub-region with the largest number of distinguishable devices to be switched as the target detection area; the switching device narrowing the beam width within the target detection area, rescanning and acquiring the signal strength of each radio frequency signal source, and selecting the azimuth angle of the radio frequency signal source with the strongest signal strength as the final beam direction.
[0011] By adopting the above technical solution, the sector detection area is subdivided into multiple sub-regions, and the number and distribution of distinguishable devices to be switched are counted separately, enabling the system to more accurately locate densely populated areas of devices. Within the target detection area, rescanning by reducing the beamwidth improves spatial resolution, allowing the system to more accurately identify target devices in environments with densely distributed multiple devices. This improves spatial multiplexing efficiency, reduces mutual interference between adjacent devices, enhances the stability of the communication link, and reduces energy consumption during the scanning process.
[0012] In some embodiments, in conjunction with the first aspect, the method further includes: when it is determined that the fluctuation range of the radio frequency signal strength value of the device to be switched exceeds a preset threshold within a preset time period, the switching device sends a status query command to the device to be switched; when the switching device does not receive a response to the status query command from the device to be switched within a first preset time period, it determines that the device to be switched is in a temporary disconnection state; the switching device determines the communication cycle of the device to be switched based on the historical communication records of the device to be switched; the switching device calculates the next communicable time point of the device to be switched based on the communication cycle and the current time; at the communicable time point, the switching device divides the encrypted radio frequency configuration data into multiple data segments according to a preset length; the switching device sends each data segment sequentially, and waits for the receiving confirmation information returned by the device to be switched after each data segment is sent; if no receiving confirmation information is received within a second preset time period, the switching device retransmits the current data segment.
[0013] By employing the above technical solutions, the system monitors fluctuations in radio frequency signal strength to determine the communication link status and proactively initiates status queries when anomalies are detected, enabling timely identification of communication problems. Analysis of historical communication records reveals communication patterns of devices to be switched, predicting the next reconnection point and improving reconnection efficiency. The use of segmented data transmission and acknowledgment mechanisms ensures data transmission integrity and reliability even during temporary disconnections, guaranteeing accurate transmission of configuration data even under unstable communication conditions, thus enhancing the system's adaptability and reliability in complex environments.
[0014] In conjunction with some embodiments of the first aspect, in some embodiments, the switching device determines the communication cycle of the device to be switched based on the historical communication records of the device to be switched, specifically including: extracting the timestamp of the most recent preset communication from the historical communication records; calculating the time interval between two adjacent communications to obtain a time interval sample; performing cluster analysis on the time interval sample to obtain the time interval value in the largest sample set; and determining the time interval value in the largest sample set as the communication cycle of the device to be switched.
[0015] By employing the above technical solution, the timestamps of the most recent preset communications are extracted from historical communication records. Interval samples of adjacent communications are calculated and clustered, and the time interval value in the largest sample set is used as the communication cycle. Because the most recent communication records are used, the time interval samples have strong timeliness and better reflect the current operating status of the device to be switched. Identifying the largest sample set through clustering analysis can filter out abnormal communication intervals caused by temporary anomalies, improving the accuracy of communication cycle prediction. Accurate communication cycle prediction helps the switching device transmit data at the appropriate time, reducing invalid data transmission attempts, lowering energy consumption, and improving work efficiency and stability.
[0016] In conjunction with some embodiments of the first aspect, in some embodiments, after calculating the next communicable time point of the device to be switched, the method further includes: determining a forward preset duration and a backward preset duration of the communicable time point; within the time range determined by the forward preset duration and the backward preset duration, detecting the signal sent by the device to be switched according to a preset detection interval; if the signal strength of the detected signal is greater than a third preset threshold, then determining the moment when the signal is detected as the actual communicable time point; the switching device dividing the encrypted radio frequency configuration data into multiple data segments according to a preset length at the actual communicable time point; if no signal with a signal strength greater than the third preset threshold is detected, then performing the step of the switching device dividing the encrypted radio frequency configuration data into multiple data segments according to a preset length at the communicable time point.
[0017] By adopting the above technical solution, a dynamic communication time window mechanism is established by setting a detection time range before and after the predicted communication time point and performing signal detection at preset intervals. When the detected signal strength exceeds the threshold, the system can promptly capture the optimal communication opportunity, ensuring data transmission occurs at a time with good signal quality. If a sufficiently strong signal is not detected, the system will perform segmented data transmission at the originally scheduled time. This mechanism can adapt to fluctuations in the actual operating status of the device to be switched, improving the success rate of communication. The combination of dynamic detection and threshold judgment avoids data transmission at times with poor signal quality, reduces data transmission errors and retransmissions, improves communication efficiency, and also reduces system energy consumption.
[0018] In conjunction with some embodiments of the first aspect, in some embodiments, determining the forward preset duration and the backward preset duration of the communicable time point specifically includes: based on the communicable time point, setting the forward preset duration to a third preset duration before the communicable time point; and setting the backward preset duration to a fourth preset duration after the communicable time point, wherein the third preset duration is longer than the fourth preset duration.
[0019] By adopting the above technical solution, an asymmetric detection window design with a forward preset duration longer than a backward preset duration allows the system to prioritize detecting communication opportunities of the device to be switched earlier during communication time detection. This asymmetric detection mechanism takes into account clock drift that may occur in actual communication, as well as the possibility of the device to be switched waking up prematurely. The longer forward detection duration provides a larger buffer, increasing the probability of capturing the device to be switched entering an active state earlier than expected. The shorter backward detection duration reduces invalid detection time after the expected time point, preventing the system from continuing to consume energy for detection when the device to be switched has missed its active window.
[0020] In a second aspect, embodiments of this application provide a portable wireless radio frequency switching system, which includes: one or more processors and a memory; the memory is coupled to one or more processors, and the memory is used to store computer program code, the computer program code including computer instructions, and the one or more processors call the computer instructions to cause the system to perform the method described in the first aspect and any possible implementation thereof.
[0021] Thirdly, embodiments of this application provide a computer-readable storage medium including instructions that, when executed on a system, cause the system to perform the method described in the first aspect and any possible implementation thereof.
[0022] Fourthly, embodiments of this application provide a computer program product that, when run on a system, causes the system to execute the method described in any possible implementation of the first aspect.
[0023] One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages: 1. This application provides a portable wireless radio frequency handover method. The device to be switched adopts a deep sleep and low-power listening mode, activating the radio frequency module and processor only upon receiving a wake-up command, thus reducing the power consumption of the device to be switched. A two-way authentication handshake mechanism improves the security of both communicating parties, preventing unauthorized access by devices. Encrypted transmission and storage of radio frequency configuration data further enhance data security, preventing configuration information from being stolen or tampered with. After completing data writing, the device to be switched automatically returns to a deep sleep state and maintains low-power listening, ensuring the reliable completion of the handover operation. While maintaining a certain power to monitor configuration requests, low-power standby is achieved, thereby reducing energy waste and lowering the operating cost of the device.
[0024] 2. This application provides a portable wireless radio frequency handover method. It monitors fluctuations in radio frequency signal strength to determine the communication link status and proactively initiates status queries when an anomaly is detected, enabling the system to promptly identify communication problems. By analyzing the communication patterns of the device to be handed over based on historical communication records, the method predicts the next reconnection time, improving reconnection efficiency. Employing a data segmentation transmission and acknowledgment mechanism, it ensures the integrity and reliability of data transmission even in temporary disconnection states. It also ensures the accurate transmission of configuration data even under unstable communication conditions, improving the system's adaptability and reliability in complex environments.
[0025] 3. This application provides a portable wireless radio frequency handover method. It sets a detection time range before and after the predicted communication time point and performs signal detection at preset intervals, establishing a dynamic communication time window mechanism. When the detected signal strength exceeds a threshold, it can promptly capture the optimal communication opportunity, ensuring data transmission occurs at a time with good signal quality. If a sufficiently strong signal is not detected, the system will perform segmented data transmission at the originally scheduled time. This mechanism can adapt to fluctuations in the actual operating state of the device to be switched, improving the communication success rate. The combination of dynamic detection and threshold judgment avoids data transmission at times with poor signal quality, reducing data transmission errors and retransmissions, improving communication efficiency, and also reducing system energy consumption. Attached Figure Description
[0026] Figure 1 This is a flowchart illustrating a portable wireless radio frequency switching method in an embodiment of this application.
[0027] Figure 2 This is another flowchart illustrating a portable wireless radio frequency switching method in an embodiment of this application.
[0028] Figure 3 This is a schematic diagram of the physical device structure of a portable wireless radio frequency switching system provided in an embodiment of this application. Detailed Implementation
[0029] The terminology used in the following embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used in the specification and appended claims of this application, the singular expressions “a,” “an,” “the,” “the,” “the,” and “this” are intended to include the plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this application refers to any or all possible combinations including one or more of the listed items.
[0030] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.
[0031] The following example is used in conjunction with Figure 1 The present application describes a portable wireless radio frequency switching method in its embodiments: Please refer to Figure 1 This is a flowchart illustrating a portable wireless radio frequency switching method in an embodiment of this application.
[0032] S101. The switching device performs signal scanning within a preset frequency band range to obtain the radio frequency signal strength value of the device to be switched. The preset frequency band range refers to a pre-defined range of radio frequencies, determined based on the operating frequency characteristics of the device to be switched, such as the 2.4GHz band, 5GHz band, or other ISM bands. Signal scanning refers to the switching device using its RF receiving module to detect electromagnetic signals at various frequency points or channels within the preset frequency band range. RF signal strength values are typically expressed in RSSI (Received Signal Strength Indicator), usually in dBm (decibels per milliwatt). Even in deep sleep mode, the device to be switched periodically transmits low-power beacon signals containing device identification information; the switching device obtains the RF signal strength value by detecting these beacon signals. The specific values of the preset frequency band range can be adjusted according to the actual application scenario and device characteristics, and are not limited here. The signal scanning time interval and scanning accuracy can also be configured according to actual needs, and are not limited here.
[0033] The first specific method to achieve this step is to use spectrum scanning technology. The switching device is equipped with a wideband RF receiver and a spectrum analysis module, which performs frequency domain analysis on the received RF signal using the Fast Fourier Transform (FFT) algorithm. The specific implementation process includes: first, the RF front-end amplifies the weak signal received by the antenna using a low-noise amplifier (LNA); then, a mixer down-converts the RF signal to an intermediate frequency (IF); next, an analog-to-digital converter (ADC) samples and digitizes the IF signal; finally, a digital signal processor (DSP) performs FFT operations to calculate the power spectral density at each frequency point, thereby obtaining the signal strength value at each frequency. The second specific method is to use channel scanning technology. The switching device sequentially switches operating frequencies according to a predetermined channel list, staying on each channel for a certain period of time (e.g., 10-50 milliseconds) to detect the signal strength on that channel. The specific implementation process includes: the radio frequency transceiver sets the local oscillator frequency according to the channel list; on each channel, the beacon frame sent by the device to be switched is identified by the packet detection algorithm; the RSSI value of the beacon frame is extracted and the corresponding device identifier is recorded; after all channels are scanned, the strongest signal strength value of each device to be switched is summarized.
[0034] S102. If the distance between the switching device and the device to be switched is determined to be no greater than a preset distance threshold based on the radio frequency signal strength value, the switching device sends a wake-up command and a handshake request to the device to be switched, which is in a deep sleep state and maintains low-power listening. The wake-up command is used to wake up the RF module and processor of the device to be switched. The preset distance threshold refers to the maximum physical distance between the switching device and the device to be switched, which is set according to the security requirements and communication reliability requirements of the application scenario, such as 1 meter, 3 meters, or 5 meters. Deep sleep state means that the main processor and most peripheral modules of the device to be switched are in a powered-off state, with only the minimum power wake-up circuit operating. Low-power monitoring means that the RF receiver of the device to be switched uses an intermittent operating mode, periodically turning on briefly to detect whether a wake-up command is available. The wake-up command is a control frame with a specific format, containing a predefined wake-up code and the target device identifier. The handshake request is an initialization message used to establish a communication connection, containing the identity information and connection parameters of the switching device. The conversion formula for determining the distance based on the RF signal strength value can use a path loss model or an empirical formula; the specific conversion method is not limited here. The specific format and encoding method of the wake-up command can be defined according to the communication protocol and are not limited here.
[0035] The first specific method to achieve this step is to use RSSI distance estimation combined with directional wake-up technology. The switching device calculates the estimated distance to the device to be switched using the path loss formula based on the received RSSI value: d = 10^((A-RSSI) / (10*n)), where d is the distance, A is the reference signal strength at 1 meter, and n is the path loss exponent. When the calculated distance is less than a preset distance threshold, the switching device constructs a wake-up frame, which includes a 16-bit synchronization header, an 8-bit wake-up code, a 32-bit target device address, and a 16-bit CRC checksum. The wake-up frame is sent with increased transmission power to ensure reliable reception by the device to be switched, which is in a low-power listening state. The second specific method is to use a multi-level wake-up mechanism. The switching device first sends a low-power pre-wake-up signal, which only contains a simple wake-up trigger code; after the low-power listening circuit of the device to be switched detects the pre-wake-up signal, it activates the full function of the RF receiver; then the switching device sends a data frame containing a complete wake-up command and a handshake request.
[0036] S103. The switching device and the woken-up switching device perform a handshake request to establish a secure communication connection; The handshake request includes two-way authentication. A secure communication connection refers to a data transmission channel protected by encryption and authentication mechanisms, preventing data eavesdropping, tampering, and replay attacks. Two-way authentication refers to the process by which the switching device and the device to be switched verify each other's identity, ensuring that both communicating devices are legitimate and authorized. The handshake process typically involves multiple message exchange rounds, each containing specific authentication information and key negotiation parameters. Authentication can be based on pre-shared keys, digital certificates, or other cryptographic credentials. The specific implementation of the handshake protocol can use standard security protocols such as TLS, DTLS, or custom lightweight protocols; this is not limited here. The strength and complexity of authentication can be adjusted according to security requirements; this is not limited here either.
[0037] The first specific method to implement this step is to use a challenge-response authentication mechanism based on a pre-shared key. The handshake process consists of four phases: In the first phase, the switching device generates a random number R1 and sends it to the device to be switched; in the second phase, the device to be switched generates a random number R2, calculates the response value H1=HMAC(PSK, R1||R2||DeviceID2) using the pre-shared key PSK, and sends R2 and H1 to the switching device; in the third phase, the switching device verifies the correctness of H1, calculates the response value H2=HMAC(PSK, R2||R1||DeviceID1), and sends it to the device to be switched; in the fourth phase, the device to be switched verifies the correctness of H2, and both parties derive the session key SK=KDF(PSK, R1||R2) based on the PSK and the exchanged random number. The second specific method is to use a key negotiation mechanism based on elliptic curve cryptography. The switching device and the device to be switched each generate a temporary key pair (private key d, public key Q=dG); both parties exchange public keys and verify the validity of the public keys; the shared key K=d1Q2=d2*Q1 is calculated using the ECDH algorithm; a session key is generated based on the shared key and the device identifier to complete the establishment of a secure communication connection.
[0038] S104. After the secure communication connection is established, the switching device will send encrypted radio frequency configuration data to the device to be switched. After a secure communication connection is established, the step of the switching device sending encrypted radio frequency configuration data to the device to be switched ensures secure transmission of configuration information. Encrypted radio frequency configuration data refers to radio frequency parameter configuration information processed by an encryption algorithm. This configuration information includes, but is not limited to, operating frequency, transmit power, modulation scheme, channel bandwidth, frequency hopping sequence, and communication protocol parameters. The encryption process uses the session key negotiated in step S103 to ensure data confidentiality. Data transmission adopts a packet transmission method, with each data packet containing a sequence number, data payload, and integrity check value. Before sending data, the switching device performs integrity protection on the configuration data by adding a Message Authentication Code (MAC) or digital signature. The choice of encryption algorithm can be determined based on security requirements and device computing power, such as AES or ChaCha20, and is not limited here. The size of the data packets and the transmission rate can be dynamically adjusted according to channel conditions, and are not limited here.
[0039] The first specific method to implement this step is to use the AES-GCM authentication and encryption mode. The switching device first serializes the RF configuration data into binary format; then it generates a 96-bit initialization vector (IV), encrypts the data using the session key and the IV through the AES-GCM algorithm, and generates a 128-bit authentication tag; the IV, ciphertext, and authentication tag are encapsulated into a transmission frame, the frame format including a frame header (containing frame type and length), an IV field, a ciphertext field, and an authentication tag field; it is sent frame by frame through the established secure communication connection, waiting for confirmation after each frame is sent, thus achieving reliable transmission. The second specific method is to use stream cipher combined with forward error correction coding. The switching device uses the ChaCha20 stream cipher algorithm to generate a keystream, performs an XOR operation between the configuration data and the keystream to obtain the ciphertext; Reed-Solomon (RS) error correction coding is applied to the ciphertext to add redundancy information to improve transmission reliability; the encoded data is divided into fixed-length transmission units, each with a CRC32 checksum; an adaptive rate control mechanism is used to adjust the transmission rate and the redundancy of the error correction coding according to the channel quality.
[0040] A potential new technical challenge during the transmission of encrypted RF configuration data is the efficiency of transmitting large amounts of configuration information. To address this, the handover device employs a differential configuration update mechanism. Specifically, the handover device maintains configuration version information for the device to be switched over. Before sending configuration data, it queries the current configuration version of the device to be switched over. Based on the version information, the handover device calculates the difference between the current configuration and the target configuration, generating incremental configuration data. This incremental data is compressed using a compression algorithm to reduce the amount of data transmitted. During transmission, the handover device first sends the configuration version identifier and the compressed incremental data. After receiving the data, the handover device recovers the complete configuration information through decompression and incremental merging algorithms. This approach significantly reduces the amount of data that needs to be transmitted and improves the efficiency of configuration updates.
[0041] S105. The device to be switched writes the received encrypted radio frequency configuration data into a non-volatile memory; The device to be switched writes the received encrypted RF configuration data into non-volatile memory. This step ensures the persistent storage of configuration information. Non-volatile memory refers to storage media whose data is not lost after power failure, such as flash memory, EEPROM, or ferroelectric RAM. The writing process includes data decryption, integrity verification, storage address allocation, and the actual write operation. The device to be switched first decrypts the received encrypted data using the session key, and then verifies the integrity and authenticity of the data. After successful verification, the storage location is determined according to the type and importance of the configuration data, and the write operation is performed. To ensure data reliability, redundant storage or error detection and correction mechanisms are typically used. The specific type and capacity of the non-volatile memory can be selected according to the device requirements and are not limited here. The granularity and method of the write operation can be byte-level, page-level, or block-level, and are not limited here.
[0042] The first specific method to implement this step is to adopt a dual-backup storage mechanism. The device to be switched divides two independent configuration storage areas, A and B, in non-volatile memory. After receiving and decrypting the configuration data, it first calculates the CRC32 checksum of the data. The configuration data and checksum are written to storage area A. After writing, the data is read back and the checksum is verified. After successful verification, the same data is written to storage area B as a backup. The configuration version number, timestamp, and validity flag are recorded at the beginning of each storage area. When the device starts up, it reads the data from both areas and selects the configuration with the newer version number and correct verification to load. The second specific method is to adopt an incremental write and transactional update mechanism. The device to be switched maintains a metadata table for the configuration data, recording the storage address and version information of each configuration item. When receiving a new configuration, the new data is first written to a temporary buffer. By comparing the old and new configurations, the configuration items that need to be updated are identified. A transactional write method is used: first, the new data is written, then the metadata table is updated, and finally, a commit flag is set. If the write process is interrupted, the device can determine whether the update is complete based on the commit flag after restarting, ensuring configuration consistency.
[0043] A potential new technical challenge during configuration data writing is the lifespan issue caused by memory write count limitations. To address this, the device to be switched over implements a wear leveling algorithm. Specifically, the device maintains a write count statistics table for each block of memory and prioritizes blocks with fewer write counts when allocating storage addresses. For frequently updated configuration items, a circular buffer is used to store multiple versions of configuration data at different physical addresses. When the write count of a storage block approaches a threshold, the valid data in that block is migrated to blocks with fewer write counts. Through this dynamic storage management strategy, write operations are evenly distributed, extending the lifespan of the non-volatile memory.
[0044] S106. After the device to be switched completes the writing of the encrypted radio frequency configuration data, it sends an acknowledgment signal to the switching device and automatically switches to deep sleep state and maintains low-power listening.
[0045] After the device to be switched completes the writing of encrypted RF configuration data, the process of sending an acknowledgment signal to the switching device, automatically switching to deep sleep mode, and maintaining low-power listening implements the confirmation mechanism and power management for configuration updates. The acknowledgment signal is a feedback message sent by the device to be switched to the switching device, indicating that the configuration data has been successfully received and written to memory. This signal typically includes information such as the operation result status code, configuration version number, and device identifier. Automatic switching to deep sleep mode ensures that the device immediately enters low-power mode after completing the configuration update, reducing energy consumption; low-power listening is typically a deep sleep mode. Maintaining low-power listening allows the device to still respond to subsequent wake-up requests, achieving a balance between power consumption and responsiveness. The acknowledgment signal is sent after the data writing is complete and verified successfully, ensuring the reliability of the configuration. The automatic switching time delay can be set according to application requirements and is not limited here. The low-power listening period and duty cycle can be dynamically adjusted and are not limited here.
[0046] The first specific method to implement this step is to adopt a multi-level confirmation and gradual sleep mechanism. After the device to be switched completes the data writing, it first sends an initial confirmation signal, including the basic status of the write operation; then it performs configuration verification, reads the configuration data in the memory and performs integrity verification; after successful verification, it sends a detailed confirmation signal, including the configuration version number, checksum and next wake-up window information; after sending the confirmation signal, the device performs a 3-second delay, during which it maintains normal receiving status to handle possible retransmission requests; after the delay ends, it gradually shuts down peripheral modules, and finally puts the main processor into deep sleep; the RF module switches to low-power listening mode with a period of 100 milliseconds and an active time window of 5 milliseconds. The second specific method is to adopt a state machine-controlled intelligent sleep strategy. The device to be switched maintains a state machine, including four states: active, acknowledged, transition, and sleep. After completing data writing, it enters the acknowledged state, constructs and sends an acknowledgement frame containing a timestamp and sequence number. A timer is used to control the state transition. After the acknowledgement frame is sent, a 10-second transition timer is started. During the transition period, if a response is received from the device to be switched, the timer is reset. After the timer expires, it automatically enters the sleep state and is configured with low-power listening parameters: the listening interval is dynamically adjusted according to the historical wake-up frequency, ranging from 50 to 500 milliseconds.
[0047] A potential new technical problem during the transition to deep sleep mode is communication interruption due to improper timing of the state transition. To address this, the device to be switched performs a communication link quality assessment before sending an acknowledgment signal. Specifically, before sending an acknowledgment signal, the device to be switched first sends a link test frame and waits for a response from the switching device. The current link quality is assessed based on the received signal strength and error rate of the response frame. When the link quality falls below a threshold, the device to be switched extends the hold time of the active state and increases the transmit power of the acknowledgment signal or adopts a more reliable modulation scheme. The acknowledgment signal uses a transmission mechanism with Automatic Repeat Request (ARQ) to ensure reliable reception by the switching device. Only after receiving an explicit release command from the switching device or a retransmission timeout occurs does the device to be switched perform a state transition, entering deep sleep and low-power listening mode.
[0048] In the above embodiments, the device to be switched adopts a deep sleep and low-power monitoring mode, activating the RF module and processor only upon receiving a wake-up command, thus reducing the power consumption of the device to be switched. The two-way authentication handshake mechanism improves the security of both communicating parties, preventing unauthorized access by devices. Encrypted transmission and storage of RF configuration data further enhances data security, preventing configuration information from being stolen or tampered with. After completing data writing, the device to be switched automatically returns to a deep sleep state and maintains low-power monitoring, ensuring the reliable completion of the switching operation. While maintaining a certain power to monitor configuration requests, low-power standby is achieved, thereby reducing energy waste and lowering the operating cost of the device.
[0049] Furthermore, the above embodiment describes communication between a switching device and a device to be switched. However, in practical applications, there may be multiple devices to be switched. The switching device calculates the current velocity vector based on acceleration data and the current orientation angle based on angular velocity data. Acceleration data is typically provided by a three-axis accelerometer, containing acceleration components in the X, Y, and Z directions, with units of m / s². The velocity vector is a three-dimensional velocity vector obtained by integrating the acceleration data over time, representing the device's speed and direction in space. Angular velocity data is provided by a three-axis gyroscope sensor, representing the device's rotational speed around the three axes, with units of rad / s or ° / s. The current orientation angle is the device's spatial attitude obtained by integrating the angular velocity data and combining it with the initial attitude, typically represented by Euler angles (pitch, roll, yaw) or quaternions. The calculation process needs to consider the effects of sensor noise, zero bias, and drift. The integration time window and sampling frequency can be adjusted according to application requirements and are not limited here. The definition and transformation method of the coordinate system can be selected according to the specific implementation and are not limited here.
[0050] The first specific approach to implementing this calculation is to use a Kalman filter fusion algorithm. The switching device acquires acceleration and angular velocity data at a frequency of 100Hz; the raw data is preprocessed, including outlier removal and low-pass filtering; a state-space model is established, with the state vector containing position, velocity, attitude angle, and sensor bias; the acceleration and angular velocity data are fused using an extended Kalman filter (EKF), the prediction step updates the state using kinematic equations, and the update step corrects the predicted values using measurement data; the velocity vector is directly obtained from the velocity component of the state vector, and the orientation angle is extracted from the attitude angle component. The second specific approach is to use a complementary filtering algorithm. The acceleration data is transformed from the device coordinate system to the world coordinate system; the velocity is calculated using the trapezoidal integral method: v(t) = v(t-1) + 0.5*(a(t) + a(t-1))*Δt; a high-pass filter is used to process the angular velocity data to remove low-frequency drift; the angle change is calculated by integration: θ(t) = θ(t-1) + ω(t)*Δt; the tilt angle calculated from the acceleration data is used to correct the integral angle using the complementary filtering formula: θ_final = α*θ_gyro + (1-α)*θ_acc, where α is the filtering coefficient.
[0051] The switching device determines a sector-shaped detection area based on the movement velocity vector and orientation angle. The sector-shaped detection area has the current position of the switching device as its vertex, the direction of the movement velocity vector as its axis of symmetry, a preset detection radius as its radius, and a preset detection angle as its opening angle. The sector-shaped detection area is a sector in three-dimensional space, and its geometric features are defined by multiple parameters. The current position, as the vertex of the sector, is typically obtained through GPS, UWB, or other positioning technologies. The direction of the movement velocity vector determines the direction of the sector's principal axis, reflecting the device's movement trend. The preset detection radius defines the maximum scanning distance range, such as 10 meters, 20 meters, or 50 meters, determined based on the RF module's transmit power and receive sensitivity. The preset detection angle is the opening angle of the sector, representing the scanning angle range, such as 30°, 60°, or 90°. The construction of the sector-shaped detection area takes into account the device's movement characteristics, improving the targeting specificity of the target search. The specific values of the detection radius and detection angle can be dynamically adjusted according to the application scenario and are not limited here. The height range of the sector-shaped area can be set according to the 3D scanning requirements and is not limited here.
[0052] The first specific method for determining the sector detection area is a geometric calculation method based on a spherical coordinate system. The switching device first normalizes the moving velocity vector to obtain a unit direction vector d; a local coordinate system is established with the device's current position as the origin, with the z-axis pointing due north and the x-axis pointing due east; the projection angle φ (azimuth angle) of the direction vector d onto the horizontal plane and the angle θ (pitch angle) with the horizontal plane are calculated; the parametric equations of the sector boundary are constructed: boundary point P = r*(sin(θ±Δθ / 2)*cos(φ±Δφ / 2), sin(θ±Δθ / 2)*sin(φ±Δφ / 2), cos(θ±Δθ / 2)), where r is the detection radius, and Δθ and Δφ are the components of the detection angle in the vertical and horizontal directions, respectively; the sector boundary point set is generated by discretizing the parameters, forming a digital representation of the detection area. The second specific method is to construct the detection area using a ray tracing algorithm. A central ray is emitted from the device position along the direction of the moving speed vector; a set of scanning rays is generated with the central ray as the axis and according to a preset angular step size (such as 1° or 2°); the direction of each ray is calculated using the Rodriguez rotation formula: v'=v*cos(α)+(k×v)*sin(α)+k*(k·v)*(1-cos(α)), where v is the direction of the central ray, k is the rotation axis, and α is the rotation angle; the endpoints of all rays at the preset detection radius are connected to form the outer boundary of the fan-shaped detection area; the detection area is spatially indexed, and an octree or KD tree structure is established to accelerate subsequent spatial query operations.
[0053] The switching equipment acquires the azimuth and signal strength of each radio frequency (RF) signal source within the sector detection area. RF signal sources refer to devices that transmit radio signals, including the device to be switched and other potential interference sources. Azimuth is the angle between the direction from the switching equipment position to the signal source position and a reference direction (usually true north or the device's orientation), measured in degrees or radians. Signal strength represents the power level of the received RF signal, typically measured in RSSI values or dBm. The acquisition process involves multiple stages, including antenna scanning, signal acquisition, and parameter estimation. The switching equipment needs to perform a systematic scan within the sector area to ensure no signal source is missed. The measurement accuracy of the azimuth and the dynamic range of the signal strength are determined by hardware capabilities and are not limited here. The temporal and spatial resolution of the scan can be adjusted according to real-time requirements and are not limited here.
[0054] The first specific method for acquiring signal source information is to use phased array antenna scanning technology. The switching equipment is equipped with a phased array antenna system consisting of multiple antenna elements; by adjusting the phase delay of each antenna element, a beam pointing in a specific direction is formed; according to a predetermined scanning strategy, the beam is scanned in a step-by-step manner within a fan-shaped detection area, with a step angle of 1 / 3 of the beamwidth; at each beam direction, the receiver acquires the signal and performs a fast Fourier transform to extract the power spectrum of each frequency component; the signal source is identified using an energy detection algorithm, and a valid signal is determined when the power at a certain frequency exceeds the noise floor by more than 3 dB; the beam pointing angle corresponding to each signal source is recorded as the azimuth angle, and the peak power spectrum is recorded as the signal strength; a single-pulse angle measurement technique is used to improve the accuracy of the azimuth angle measurement, and the signal source direction is accurately estimated by comparing the signal strength ratio of adjacent beams. The second specific method is to use a rotating directional antenna scanning method. The switching device uses a high-gain directional antenna, which is controlled by a stepper motor to rotate in the horizontal plane. The antenna scans within a sector detection area at a constant angular velocity while continuously acquiring received signals. Software-defined radio (SDR) technology is used to perform real-time spectrum analysis on the received signals. Signal features, including center frequency, bandwidth, and modulation scheme, are extracted using time-frequency analysis algorithms. The detected signals are correlated with the antenna's real-time azimuth angle to establish a signal source azimuth database. For measurements of the same signal source at different azimuth angles, a weighted average algorithm is used to improve positioning accuracy. Data fusion from multiple scans eliminates random interference and improves the reliability of signal source detection.
[0055] Based on azimuth and signal strength, the switching device calculates the angular interval and signal strength difference between adjacent radio frequency (RF) signal sources. RF signal sources with both an angular interval greater than a preset angular threshold and a signal strength difference greater than a preset strength threshold are identified as distinguishable devices to be switched. The angular interval refers to the absolute value of the difference in azimuth angles between two RF signal sources, reflecting their spatial separation. The signal strength difference is the absolute value of the difference in RSSI or power values between two signal sources, representing their differences in signal characteristics. The preset angular threshold is the standard for determining whether two signal sources are spatially separable, such as 5°, 10°, or 15°, depending on the antenna's beamwidth and angular resolution. The preset strength threshold is the standard for determining whether two signal sources are distinguishable in terms of power, such as 3dB, 6dB, or 10dB, depending on the receiver's dynamic range and signal processing capabilities. Distinguished devices to be switched refer to target devices that can be independently identified and communicated with by the switching device. The calculation process requires pairwise comparisons of all detected signal sources. The specific values of the thresholds can be adjusted according to system performance requirements and are not limited here.
[0056] The first specific method for determining distinguishable devices is to use a clustering analysis algorithm. The switching device represents all detected RF signal sources as two-dimensional feature vectors (azimuth angle, signal strength); it employs the DBSCAN density clustering algorithm, setting the neighborhood radius ε and the minimum number of points MinPts parameters; for each signal source point, it calculates the number of other points within its ε-neighborhood, defined as: d = sqrt((Δθ / θ_threshold)² + (ΔP / P_threshold)²) < ε, where Δθ is the angular interval and ΔP is the intensity difference; points meeting the density requirements are clustered into one class, with the center point of each class considered a distinguishable device; boundary points and noise points are assigned through secondary verification; the azimuth angle and signal strength of each cluster center are output as feature parameters for distinguishing the devices to be switched. The second specific method is based on graph theory-based connected component analysis. Construct a signal source relationship graph, with each signal source as a node in the graph; when the angular interval between two signal sources is less than a preset angular threshold and the signal strength difference is less than a preset strength threshold, establish an edge between the corresponding nodes; use the depth-first search (DFS) algorithm to traverse the graph and identify all connected components; each connected component represents a group of mutually interfering and indistinguishable signal sources; select the node with the strongest signal in each connected component as a representative signal source; determine the representative signal sources of each connected component as distinguishable devices to be switched; record the azimuth angle, signal strength, and the number of signal sources it represents for each distinguishable device.
[0057] The switching device adjusts its beam direction to the azimuth angle of the strongest radio frequency signal source based on the number and distribution of distinguishable devices to be switched, and adjusts the preset distance threshold to be less than the minimum distance between adjacent distinguishable devices to be switched. This step achieves precise target selection and communication parameter optimization in multi-device environments. The number of distinguishable devices to be switched reflects the device density in a specific area, while the distribution describes the relative spatial relationship of each device. Beam direction adjustment is achieved by changing the main lobe direction of the antenna system's radiation pattern, aligning it with the target with the strongest signal to obtain the best communication link quality. The dynamic adjustment of the preset distance threshold is based on the spatial spacing between devices, ensuring accurate selection of the target device in densely populated environments without mistakenly connecting to neighboring devices. The minimum distance between adjacent distinguishable devices to be switched is obtained by analyzing their spatial coordinates or by distance estimation based on signal characteristics. This step, through the synergistic effect of multiple sub-steps, achieves a progressive optimization process from coarse scanning to precise positioning. The response time and accuracy of beam adjustment depend on the hardware capabilities of the antenna system and are not limited here. The distance threshold adjustment strategy can be customized according to the specific application scenario requirements and is not limited here.
[0058] The first specific method to achieve this step is to employ hierarchical scanning and adaptive beam control technology. The switching device first uses a wide-beam antenna to perform a preliminary scan of the entire sector detection area, acquiring rough location information of all RF signal sources within the area. Based on the preliminary scan results, the sector area is divided into multiple sub-regions according to preset rules, with each sub-region having an angle range of 15° to 20°. Within each sub-region, the number of distinguishable devices to be switched is counted, and their centroid positions are calculated as representative positions for that region. After selecting the sub-region with the largest number of devices, the device switches to a narrow-beam mode, reducing the beamwidth to below 5°. A fine scan is then performed within the selected sub-region, with a scan step of 1°, pausing for 50 milliseconds at each angular position to accurately measure signal strength. By comparing the signal strength values at each angle, the azimuth angle of the strongest signal is determined, and the antenna main lobe is locked in that direction. Simultaneously, based on the device distribution information obtained from the fine scan, the minimum distance between adjacent devices is calculated, and the communication distance threshold is set to 70% to 80% of this minimum distance. The second specific method is based on intelligent region selection and parameter optimization methods using machine learning. The switching device uses a pre-trained neural network model to process scan data. The model's input includes features such as the number of devices in each sub-region, average signal strength, and signal strength variance. The neural network outputs a priority score for each sub-region, comprehensively considering device density, signal quality, and spatial distribution uniformity. The sub-region with the highest score is selected as the target region, and then a reinforcement learning algorithm is used to dynamically adjust beam parameters. The state space of the reinforcement learning agent includes the current beamwidth, pointing angle, and received signal strength, while the action space includes beamwidth adjustment and angle fine-tuning. By maximizing the cumulative reward (defined as the weighted difference between signal strength and interference level), the agent learns the optimal beam control strategy. Based on the learned strategy, the system automatically adjusts the beam direction to the strongest signal source and adaptively sets the distance threshold according to environmental characteristics.
[0059] A potential new technical challenge during this process is the device detection blind spot at the sub-region boundaries. To address this, a mechanism of overlapping sub-region division and boundary fusion detection is employed for device switching. Specifically, when dividing the fan-shaped sub-regions, a 10% to 20% angular overlap is set between adjacent sub-regions to ensure that devices at the boundaries are covered by at least two sub-regions. When counting the number of devices in each sub-region, devices appearing in the overlapping areas are weighted and counted based on their signal strength ratios across different sub-regions. After selecting the target detection area, the scanning density is increased at the boundaries of that area and its adjacent areas, using a smaller angular step (e.g., 0.5°) for supplementary scanning. Through a boundary fusion algorithm, the results of the main area and the supplementary boundary scans are comprehensively analyzed to construct a complete device distribution map. This mechanism eliminates detection blind spots caused by region division, ensuring that all distinguishable devices can be accurately detected and located.
[0060] The switching device divides the sector detection area into multiple sector sub-regions, each with an opening angle smaller than a preset detection angle. This sub-step improves the spatial resolution of the detection through spatial subdivision. A sector sub-region is a uniform or non-uniform division of the original sector detection area in the angular dimension. Each sub-region maintains the same radial depth but covers a smaller angular range. The preset detection angle is the total opening angle of the original sector area; the design of the sub-region opening angle needs to balance detection accuracy and computational complexity. The division process can use uniform division at fixed angular intervals or adaptive division based on preliminary scan results. The number of sub-regions is typically chosen to be 4 to 8; too many will increase processing latency, while too few will fail to effectively distinguish densely populated areas. Each sub-region needs to have its start angle, end angle, and center angle clearly defined for subsequent scan control and data correlation. The selection of the division strategy is based on factors such as antenna beamwidth, expected device density, and real-time requirements. Besides the standard sector shape, the sub-region shape can be designed into other geometric shapes as needed; this is not limited here.
[0061] The switching equipment calculates the number of distinguishable devices to be switched and their distribution locations within each sector sub-region. This sub-step enables quantitative analysis of regional characteristics. Device count is performed by iterating through all identified distinguishable devices and determining whether their azimuth angles fall within the angular range of a specific sub-region. The calculation of distribution locations includes not only azimuth information but also estimation of relative distances based on signal strength, constructing a two-dimensional or three-dimensional spatial distribution map. For each sub-region, a device list needs to be maintained, recording key information such as the device's identifier, azimuth angle, and signal strength. The analysis of distribution characteristics also includes calculating the angular interval distribution between devices and the statistical characteristics of signal strength distribution. These quantitative indicators provide a basis for subsequent region selection decisions. The calculation process needs to consider measurement errors and uncertainties; probabilistic statistical methods can be used to improve the reliability of the results.
[0062] The device switching selection process identifies the sector-shaped sub-region with the largest number of devices to be switched as the target detection area. This sub-step determines the key scanning area based on the principle of maximizing device density. The selection process first compares the device counts of each sub-region. When multiple sub-regions have the same number of devices, secondary judgment criteria can be introduced, such as average signal strength, signal stability, or spatial distribution uniformity. Determining the target detection area means that subsequent fine scanning and communication resources will be concentrated in this area, improving system efficiency. This selection strategy is suitable for scenarios with uneven device distribution and can quickly locate densely populated areas. The time complexity of the selection algorithm is O(n), where n is the number of sub-regions, ensuring real-time performance. In some special cases, such as when all sub-regions have zero or equal numbers of devices, a preset default strategy is required, such as selecting the central sub-region or random selection.
[0063] The switching device narrows the beamwidth within the target detection area, rescans and acquires the signal strength of each radio frequency (RF) signal source, and selects the azimuth angle of the RF signal source with the strongest signal strength as the final beam direction. This sub-step achieves precise target localization through fine scanning. Beamwidth reduction is achieved by adjusting the excitation distribution of the antenna array or changing the physical aperture; a typical narrow beamwidth can reach 3° to 5°, a significant improvement compared to the wide beamwidth of the initial scan (e.g., 30°). Rescanning uses smaller angular steps and longer dwell times, such as scanning in 0.5° steps and sampling for 100 milliseconds at each location, to obtain more accurate signal strength measurements. Signal strength measurement needs to consider the effects of multipath propagation and channel fading; averaging or taking the median of multiple measurements can improve stability. The selection of the strongest signal source considers not only instantaneous signal strength but also signal stability and historical trends. After determining the final beam direction, the antenna system locks onto that direction, providing optimal link conditions for subsequent data transmission. This two-stage scanning strategy (coarse scanning + fine scanning) effectively balances the trade-off between scanning time and positioning accuracy.
[0064] In the above embodiments, a fan-shaped detection area is constructed using the acceleration and angular velocity data of the switching device, and the scanning direction is determined by the moving velocity vector, thereby improving the detection efficiency of the target device. Based on the azimuth angle and signal strength, the angular spacing and signal strength difference between adjacent radio frequency signal sources are calculated, allowing for the differentiation of multiple densely distributed devices to be switched. Dynamically adjusting the beam direction to the location of the radio frequency source with the strongest signal, and adjusting the distance threshold according to the actual distribution of distinguishable devices, improves signal reception quality, reduces invalid scanning range, lowers signal interference, improves communication reliability, and optimizes system resource utilization efficiency.
[0065] The above embodiments describe a technical solution for how a switching device constructs a fan-shaped detection area using acceleration and angular velocity data, and identifies and distinguishes multiple devices to be switched within that area. This solution solves the problem of device identification and communication in scenarios with densely distributed multiple devices. However, in practical applications, devices to be switched may experience signal fluctuations or temporary disconnections for various reasons. To address this, this application also provides another embodiment to solve the data transmission problem when communication between devices to be switched is unstable. This embodiment analyzes the historical communication records of the devices to be switched, predicts their communication patterns, and improves communication reliability by employing dynamic time windows and segmented transmission. The following is a detailed explanation... Figure 2 Another portable wireless radio frequency switching method in the embodiments of this application is described below: Please refer to Figure 2 This is another flowchart illustrating a portable wireless radio frequency switching method in an embodiment of this application.
[0066] S201. If it is determined that the fluctuation range of the radio frequency signal strength value of the device to be switched exceeds the preset threshold within a preset time period, the switching device sends a status query command to the device to be switched. When the fluctuation range of the RF signal strength value of the device to be switched exceeds a preset threshold within a preset time period, the step of the switching device sending a status query command to the device to be switched enables real-time monitoring and anomaly detection of the communication link quality. The fluctuation range of the RF signal strength value refers to the difference between the maximum and minimum signal strength values, or the standard deviation of the signal strength, within the preset time period, reflecting the signal stability. The preset time period is an observation window used to evaluate signal stability, such as 5 seconds, 10 seconds, or 30 seconds, determined based on the communication environment and device characteristics. The preset threshold is the standard for judging whether the signal fluctuation is abnormal, such as 6dB, 10dB, or 15dB. The setting of this threshold needs to consider the distinction between normal channel fading and abnormal fluctuations. The status query command is a special control frame containing information such as query type, timestamp, and sequence number, used to request the device to be switched to report its current operating status. The fluctuation range can be calculated using peak-to-peak value, variance, or other statistical indicators, which are not limited here. The specific values of the preset time period and preset threshold can be dynamically adjusted according to the application scenario, which are not limited here.
[0067] The first specific method to implement this step is to use a sliding window statistical analysis method. The switching device maintains a fixed-length signal strength buffer, continuously recording the received RSSI values at a sampling rate of 100Hz; a sliding window with a length of 1000 sampling points (corresponding to 10 seconds) is used, and the window position is updated every 100 milliseconds; within each window, the statistical characteristics of the signal strength are calculated: maximum value, minimum value, average value, and standard deviation; the fluctuation amplitude is defined as: Fluctuation = max(RSSI) - min(RSSI) + 2*σ, where σ is the standard deviation; when the fluctuation amplitude exceeds a preset 15dB threshold, anomaly detection is triggered; a status query frame is constructed, containing a 16-bit frame header, an 8-bit query type (0x01 indicates link status query), a 32-bit timestamp, and a 16-bit CRC checksum; the query frame is sent through the current communication link, and a response timer is started. The second specific method is an anomaly detection method based on joint time-frequency domain analysis. The received signal is subjected to a Short Time Fourier Transform (STFT) with a window length of 256 sampling points and an overlap rate of 50%. The energy value of each time-frequency block is calculated to construct a time-frequency energy matrix. The energy change rate of adjacent time windows is calculated in the time domain: ΔE(t)=|E(t)-E(t-1)| / E(t-1). The concentration of energy distribution is analyzed in the frequency domain, and the spectral entropy is calculated: H=-Σp(f)*log(p(f)). When the energy change rate exceeds 30% or the spectral entropy changes abruptly beyond the threshold, it is judged as an abnormal fluctuation. A status query command containing an anomaly type identifier is generated and sent using a high-priority queue.
[0068] S202. When the switching device does not receive a response to the status query command from the device to be switched within a first preset time period, it is determined that the device to be switched is in a temporary disconnection state. When the switching device does not receive a response to the status query command from the device to be switched within a first preset time period, the step of determining that the device to be switched is in a temporary disconnection state establishes a device status determination method based on a timeout mechanism. The first preset time period is the timeout period for waiting for a response, set according to the round-trip time (RTT) and processing latency under normal circumstances, such as 500 milliseconds, 1 second, or 2 seconds. A temporary disconnection state refers to a brief communication interruption caused by channel conditions deterioration, device movement, obstruction, or other reasons, which is different from device shutdown or permanent offline. The lack of a response may be caused by various reasons, including lost query commands, lost response frames, or abnormal device processing. The determination mechanism needs to consider retransmission and acknowledgment to avoid misjudgment due to a single packet loss. The setting of the first preset time period needs to balance the response waiting time and system response speed. The accuracy of the timeout determination directly affects the effectiveness of subsequent processing strategies. The specific value of the first preset time period can be adjusted according to network latency characteristics and is not limited here. The conditions for determining a temporary disconnection may include multiple failed queries and other factors, which are not limited here.
[0069] The first specific method to implement this step is to adopt an adaptive timeout and retransmission mechanism. When the switching device sends a status query command, it records the sending timestamp T_send; based on historical RTT measurements, it calculates the smoothed RTT using the Exponentially Weighted Moving Average (EWMA) algorithm: RTT_smooth = α * RTT_current + (1-α) * RTT_smooth_prev, where α = 0.125; it calculates the timeout RTO = RTT_smooth + 4 * RTT_deviation, where RTT_deviation is the standard deviation of the RTT; it sets the first preset duration to max(RTO, 500ms) to ensure the minimum timeout is not less than 500 milliseconds; it starts a timer to wait for a response, and if a timeout occurs, it performs an initial retransmission, doubling the timeout period during retransmission; if no response is received after 3 retransmissions (4 transmissions in total), it is determined to be a temporary disconnection; it records the disconnection timestamp and the signal strength of the last successful communication. The second specific method is a fast detection method based on multi-channel parallel querying. The switching device simultaneously sends status query commands on both the primary and backup communication channels; it sets an independent response timer for each channel with a timeout of 1 second; during the waiting period, it continuously monitors the signal activity of all channels and detects possible response frame preambles; it employs a combination of energy detection and correlation detection to improve the detection probability of weak response signals; if any channel receives a valid response, it immediately cancels the waiting for other channels and determines that the device is normal; if all channels time out, it performs a fast channel scan to search for device signals in adjacent channels; if the scan is unsuccessful, it is ultimately determined to be in a temporary disconnection state.
[0070] S203. The switching device determines the communication cycle of the device to be switched based on the historical communication records of the device to be switched. The switching device determines the communication cycle of the device to be switched based on its historical communication records. This process includes: extracting the timestamp of the most recent preset communication from the historical records; calculating the time interval between two adjacent communications to obtain a time interval sample; performing cluster analysis on the time interval sample to obtain the time interval value in the largest sample set; and determining the time interval value in the largest sample set as the communication cycle of the device to be switched. The historical communication records contain information on all communication events of the device to be switched over a past period, including communication time, duration, and data type. The communication cycle refers to the time interval at which the device to be switched periodically conducts communication activities; it may be a fixed cycle or a cycle with a certain regularity. Determining the communication cycle involves techniques such as time series analysis, pattern recognition, and statistical inference. The time span of the historical records needs to be long enough to capture periodic features, but not too long to avoid including outdated information. Identifying the communication cycle is crucial for predicting the device's next communication time. The analysis algorithm needs to be able to handle practical problems such as irregular sampling, missing data, and noise interference. The storage format and precision of the historical records can be determined based on system resource limitations and are not limited here. The type of communication cycle can be a single cycle or multiple cycles superimposed, and is not limited here.
[0071] The first specific method to implement this step is to use a frequency domain analysis method based on Fast Fourier Transform (FFT). The switching device converts historical communication events into time-series signals, assigning a value of 1 when communication occurs and 0 when no communication occurs; interpolation is performed on the time series to generate signals with equally spaced sampling intervals of 1 second; a Hanning window function is applied to reduce spectral leakage, with the window length chosen to be 1 / 4 of the data length; an FFT is performed to obtain the spectrum, and the power spectral density PSD = |FFT(x)|² is calculated; significant peaks are searched in the spectrum, with the peak detection threshold set to 3 times the average power; the frequency corresponding to the most significant peak is converted into a time period: T = 1 / f; the identified period is verified by inverse FFT, and the correlation coefficient between the reconstructed signal and the original signal is calculated; if the correlation coefficient is greater than 0.7, the period is confirmed as a valid communication period. The second specific method is to use autocorrelation function analysis combined with machine learning. Construct a time interval sequence of communication events and calculate the time difference between all adjacent communications; calculate the autocorrelation function of the time interval sequence: R(τ)=Σ(x(t)*x(t+τ)) / N; find the local maxima of the autocorrelation function, which correspond to possible periods; group the time intervals using the K-means clustering algorithm, with the K value determined by the silhouette coefficient; train a Hidden Markov Model (HMM), where states correspond to different communication modes and observations are time intervals; decode the most probable state sequence using the Viterbi algorithm and extract the periods corresponding to the dominant states; evaluate the accuracy of period prediction through cross-validation and select the period value with the smallest error.
[0072] S204. The switching device calculates the next communicable time point for the device to be switched based on the communication cycle and the current time. The next communicable point in time refers to the expected time when the device to be switched will initiate communication again, calculated based on the identified communication cycle and the time of the most recent successful communication. The calculation process needs to consider factors such as the start phase of the cycle, possible phase shifts, and clock drift. The current time is usually obtained from the system's real-time clock (RTC), and a certain level of time accuracy needs to be ensured. The accuracy of the prediction depends on the stability of the communication cycle and the representativeness of historical data. For devices with multiple communication cycles, the superposition effect of each cycle needs to be considered. The calculation result typically includes a time point estimate and the corresponding uncertainty range. The time accuracy can be in the range of seconds, milliseconds, or higher, determined according to application requirements; no limitation is made here. The prediction algorithm can be a simple linear extrapolation or a complex nonlinear model; no limitation is made here.
[0073] The first specific method to implement this step is to use a phase-locked prediction algorithm. The switching device first determines the timestamp T_last of the most recent successful communication; calculates the time difference from T_last to the current time T_now: ΔT = T_now - T_last; calculates the number of complete cycles that have elapsed: N = floor(ΔT / T_period); calculates the current phase: φ = (ΔT%T_period) / T_period; predicts the next communication time: T_next = T_now + T_period * (1 - φ); considering clock drift, a drift compensation factor is introduced: T_next_corrected = T_next + drift_rate * (T_next - T_last); the drift rate is obtained by fitting the deviation between historical communication times and the ideal cycle time using the least squares method; the predicted time and 95% confidence interval are output: [T_next - 2σ, T_next + 2σ], where σ is the standard deviation of the historical prediction error. The second specific method is a composite prediction method based on multi-cycle superposition. Identify all significant communication cycles {T1, T2, ..., T} of the device. n} and its phase {φ1, φ2, ..., φ n}; Calculate the next communication time independently for each period: t_i = T_now + T_i * (1 - φᵢ); Construct a time probability density function, with each period contributing a Gaussian distribution: p(t) = Σwᵢ * N(t; μᵢ, σᵢ²); The weight wᵢ is determined based on the significance of that period in historical data; Find the time corresponding to the maximum value of the probability density function through numerical integration as the predicted value; Calculate the cumulative distribution function to determine the time interval containing 90% probability; If multiple peak probabilities are similar, output multiple possible communication time points.
[0074] S205. Determine the forward preset duration and the backward preset duration for the communicable time point; The forward and backward preset durations for determining the communicable time point are specifically defined as follows: based on the communicable time point, the forward preset duration is set to the third preset duration before the communicable time point; the backward preset duration is set to the fourth preset duration after the communicable time point, with the third preset duration being longer than the fourth preset duration. The forward preset duration refers to the length of time before detection begins before the predicted communicable time point, used to capture communication that may occur earlier. The backward preset duration refers to the length of time after the predicted time point, used to capture communication that may occur later. This asymmetric time window design is based on the statistical characteristics of communication behavior; typically, devices are more likely to delay communication than to communicate earlier. The specific values of the third and fourth preset durations need to be determined comprehensively based on prediction accuracy, device characteristics, and power consumption requirements. The total length of the time window directly affects the reliability of detection and energy consumption. The forward duration is usually set longer to provide a greater safety margin. The window parameters can be fixed values or dynamically adjusted according to prediction confidence; this is not limited here. The unit of duration can be seconds, milliseconds, or other time units; this is not limited here.
[0075] The first specific way to achieve this step is through an adaptive window setting method based on statistical distribution. The system analyzes the distribution of historical prediction errors by switching devices, calculating the mean μ_error and standard deviation σ_error. Prediction errors are categorized into two types: early (negative error) and late (positive error), and statistically analyzed separately. The 95th percentile for early communication is calculated as: t_early_95 = μ_early - 1.645 * σ_early; the 95th percentile for late communication is calculated as: t_late_95 = μ_late + 1.645 * σ_late; the forward preset duration is set to: T_pre = |t_early_95| * 1.2, increasing the safety margin by 20%; the backward preset duration is set to: T_post = t_late_95 * 0.8, moderately reduced to save energy; minimum window limits are implemented: T_pre_min = max(T_period * 0.05, 1 second), T_post_min = max(T_period * 0.02, 0.5 seconds); the window size is dynamically adjusted based on the current prediction confidence, expanding the window when the confidence is low. The second specific approach is a window optimization method based on machine learning. A training dataset containing prediction time, actual communication time, and environmental factors is collected; feature vectors are extracted, including periodic stability indicators, signal quality history, and time periods (e.g., working / non-working hours); two independent regression models are trained to predict the optimal forward and backward durations, respectively; a random forest algorithm is used, with the weighted sum of detection success rate and energy consumption as the optimization objective; after the model outputs the base window length, adjustments are made based on real-time conditions; if recent predictions are consistently too early, the forward duration is increased: T_pre = T_pre_base * (1 + adjustment_factor); if continuous detection failures occur, the windows in both directions are temporarily expanded until a stable prediction is re-established.
[0076] S206. Within the time range determined by the forward preset duration and the backward preset duration, detect the signal sent by the device to be switched according to the preset detection interval; The preset detection interval refers to the time interval between two adjacent signal detections, determining the detection's temporal resolution and power consumption level. The detection process includes periodic wake-up of the RF receiver, signal sampling, feature extraction, and signal identification. The time range is determined by both forward and backward preset durations, forming a continuous detection window. Signal detection not only identifies the presence of a signal but also confirms whether the signal source is the target device to be switched. The detection interval setting needs to strike a balance between detection reliability and power consumption. Shorter intervals increase detection probability but increase power consumption, while longer intervals save energy but may miss brief communication opportunities. The detection interval can be a fixed value or vary according to time position; this is not limited here. Detection methods can include energy detection, matched filtering, or other techniques; this is not limited here.
[0077] The first specific approach to implementing this step is to employ an adaptive interval segmented detection strategy. The detection window is divided into three regions: a core region with a 5% cycle length before and after the prediction time point, a general region, and an edge region. The core region uses dense detection with an interval of 10 milliseconds to ensure no communication opportunities are missed. The general region uses standard detection with an interval of 50 milliseconds to balance power consumption and reliability. The edge region uses sparse detection with an interval of 200 milliseconds to maintain only basic monitoring. During each detection, the receiver performs signal sampling and processing for 5 milliseconds. An energy detector is used to calculate the average power of the received signal, with a threshold set to twice the noise power. When the detected energy exceeds the threshold, a signal identification process is initiated to extract the preamble or device identifier. Related calculations are used to verify whether the signal originates from the target device to be switched. The results and timestamps of each detection are recorded for subsequent analysis and optimization. The second specific approach is a sparse detection method based on compressed sensing. Taking advantage of the sparsity of the signal from the device to be switched, a sub-Nyquist sampling rate is used for detection. A random detection mode is designed, randomly selecting detection times within the detection window with an average interval of 100 milliseconds. At each detection time, a wideband receiver is used to quickly scan multiple channels. A compressed sensing reconstruction algorithm is used to recover signal information from sparse sampling. An orthogonal matching pursuit (OMP) algorithm is used to identify the time-frequency position of the signal. The detection accuracy is improved through multiple iterations, with the number of iterations adaptively adjusted according to the signal strength. A time series of detection results is established, and a sliding window is used to determine whether a stable signal has been captured.
[0078] S207. If the signal strength of the detected signal is greater than the third preset threshold, the time when the signal is detected shall be determined as the actual communication time point. The third preset threshold is a standard for judging whether the signal is strong enough to support reliable communication, usually set 10-20 dB above the receiver sensitivity, such as -70 dBm or -60 dBm. Signal strength measurement needs to consider instantaneous fluctuations, typically using the average or median value over a short period. Determining the actual communicable point depends not only on signal strength but also implicitly on signal stability requirements. Recording this moment is crucial for subsequent data transmission timing and communication cycle learning. The confirmation mechanism needs to be robust enough to avoid misinterpreting brief signal spikes as stable communication opportunities. The third preset threshold can be dynamically adjusted based on environmental noise levels and link budget; it is not limited here. The measurement method and unit for signal strength can be selected based on the specific implementation; it is not limited here.
[0079] S208. The switching device divides the encrypted radio frequency configuration data into multiple data segments of preset length at the actual communicable time point; The preset length is the size of each data segment, taking into account factors such as the physical layer's maximum transmission unit (MTU), channel conditions, and buffer size. Typical values are 128 bytes, 256 bytes, or 512 bytes. Encrypted RF configuration data may contain numerous parameters, with a total length potentially reaching several kilobytes or more. Segmentation aims to improve transmission reliability and facilitate error recovery and flow control. Each data segment requires the addition of necessary control information, such as segment number, total number of segments, and checksum. The segmentation strategy must consider the duration of the communication window and channel stability. The way data segments are organized affects transmission efficiency and error recovery capabilities. The preset length can be a fixed value or adaptively adjusted based on channel quality; this is not limited here. Whether additional encoding or compression is performed during segmentation can be determined based on requirements; this is not limited here.
[0080] The first specific method to implement this step is to use a combination of fixed-length segmentation and forward error correction coding. The switching device first calculates the total length L_total of the encrypted configuration data; selects a segment length L_segment = 256 bytes, and calculates the required number of segments N = ceil(L_total / L_segment); constructs a segment header for each data segment, containing a 16-bit segment number, a 16-bit total segment number, and a 32-bit CRC checksum; applies Reed-Solomon coding RS(255, 223) to each data segment, and adds 32 bytes of error correction code; combines the original data, segment header, and error correction code into a complete transmission segment; padding is added to the last segment to ensure all segments are of consistent length; a segment index table is generated to record the start position and status of each segment; the SHA-256 hash value of the entire data is calculated and appended to the last segment for integrity verification. The second specific method is a dynamic optimization method based on adaptive segmentation. Based on the current channel quality assessment, the optimal segment length is dynamically determined; a larger segment length (512 bytes) is used when the channel is good, and a smaller segment length (128 bytes) is used when the channel is poor; a hierarchical segmentation strategy is implemented, dividing the configuration data into critical parameters and optional parameters according to their importance; critical parameters use small segment lengths and high redundancy to ensure reliable transmission; optional parameters use large segment lengths and low redundancy to improve transmission efficiency; each segment is assigned a priority, with higher priority segments transmitted first and allowing more retransmissions; fountain code technology is used, so the receiver only needs to receive a sufficient number of coded segments to recover the original data; multiple redundant segments are pre-calculated and dynamically sent according to the transmission situation to improve the recovery success rate.
[0081] S209. If no signal with a signal strength greater than the third preset threshold is detected, the switching device will divide the encrypted radio frequency configuration data into multiple data segments of preset length at the point when communication is possible. If a sufficiently strong signal is not captured within the detection window, the system reverts to a prediction-based transmission mode. This strategy acknowledges the uncertainty of prediction but still attempts to communicate at the most probable time. Transmitting at a communicable point may face a greater risk of failure, so the data segmentation strategy may need to be adjusted accordingly. This trial-and-error transmission reflects the system's robust design philosophy. The segmentation process is similar to step S208 but may use different parameters to accommodate uncertain channel conditions. The triggering conditions and execution methods of the backup strategy need to be carefully designed to balance success rate and resource consumption.
[0082] The first specific approach to implementing this step is to adopt a conservative segmentation strategy. When no strong signal is detected, the switching device uses a smaller segment length, such as 128 bytes instead of the normal 256 bytes; increases the redundancy of error correction coding, using RS(255, 191) instead of RS(255, 223); adds a stronger synchronization sequence to each segment to help the receiver capture data under weak signal conditions; implements segment-level interleaving, distributing the data of each segment into multiple transmission bursts; uses spread spectrum modulation technology, sacrificing data rate for better anti-interference capability; increases the preset retransmission count to 5 instead of the normal 3; and adds an emergency transmission flag to the segment header to prompt the receiver to adopt a more sensitive reception strategy. The second specific approach is a distributed delivery method based on probability transmission. The data is divided into smaller segments, each only 64 bytes long; the segments are sent at multiple times before and after the predicted time point; the transmission time is randomized, following a normal distribution centered on the predicted time; each segment is independently encoded, using LDPC codes to provide error correction capabilities close to the Shannon limit; unacknowledged transmission is implemented, sending all segments directly without waiting for ACKs; an additional 50% redundant segments are generated, using different encoding parameters; the receiver only needs to collect 70% of the segments to recover the complete data.
[0083] S210. The switching device sends each data segment in sequence, and waits for the receiving confirmation information returned by the device to be switched after each data segment is sent; Sequential transmission means transmitting data in the order of segment numbers, ensuring the receiving end can correctly reassemble the data. Receive Acknowledgment (ACK) messages are feedback messages sent by the device to be switched after successfully receiving and verifying the data segment. The acknowledgment mechanism implements a stop-and-wait protocol or a sliding window protocol to ensure transmission reliability. Acknowledgment messages need to contain sufficient information to identify the corresponding data segment, such as segment number and checksum result. The timing relationship between sending and acknowledgment directly affects transmission efficiency. This acknowledgment mechanism can promptly detect transmission errors and trigger retransmissions. The waiting time setting needs to consider round-trip time and processing delay. The transmission control protocol can be a simple stop-and-wait ARQ or a more complex selective repeat ARQ; no limitation is made here. The format and content of the acknowledgment message can be designed according to system requirements; no limitation is made here.
[0084] The first specific method to implement this step is to use the enhanced stop-and-wait ARQ protocol. The switching device maintains a transmit state machine, including three states: waiting to transmit, transmitted but awaiting acknowledgment, and acknowledged. When transmitting the nth data segment, a 16-bit sequence number and a 16-bit timestamp are appended to the end of the segment. A segment timer is started, with a timeout set to RTT_avg + 4 * RTT_deviation. During the waiting period, the acknowledgment channel is continuously monitored; the acknowledgment frame format includes an 8-bit frame type, a 16-bit acknowledgment number, and an 8-bit receive status code. Upon receiving a correct ACK, the timer is canceled, RTT statistics are updated, and preparation is made to send the next segment. If a negative acknowledgment (NACK) is received, the corresponding segment is immediately retransmitted. Cumulative acknowledgment optimization is implemented, allowing one ACK to acknowledge multiple consecutively successfully received segments. The transmission count and success rate of each segment are recorded for link quality assessment. The second specific method is a pipelined transmission method based on a sliding window. The sending window size is set to 4, allowing a maximum of 4 segments to be in an unacknowledged state; a circular buffer is used to manage pending and sent but unacknowledged data segments; a selective retransmission mechanism is adopted, with the receiver reporting the reception status bitmap via SACK; the sender, based on the SACK information, only retransmits lost segments to avoid unnecessary retransmissions; congestion control is implemented, dynamically adjusting the sending rate based on the timeliness of acknowledgments; the window size is increased when consecutive acknowledgments are received, and decreased when a timeout occurs; a fast retransmission mechanism is used, retransmitting immediately upon receiving 3 duplicate ACKs without waiting for a timeout; a sending timestamp for each segment is maintained, and an accurate RTT is calculated for timeout settings.
[0085] S211. If no confirmation message is received within the second preset time period, the device is switched to resend the current data segment.
[0086] The second preset duration is the timeout for waiting for acknowledgment, which needs to be greater than the round-trip time plus processing delay under normal circumstances, such as 2 seconds, 3 seconds, or 5 seconds. Retransmission is a fundamental means of error recovery, ensuring reliable data transmission over unreliable channels. The current data segment refers to the most recently transmitted segment that has not yet received acknowledgment and needs to be retained in the buffer until acknowledgment. The retransmission mechanism needs to set a maximum retransmission limit to avoid infinite retransmissions. The timeout setting has a significant impact on system performance; too short a timeout will lead to unnecessary retransmissions, while too long a timeout will reduce error recovery speed. Retransmission may require adjustments to transmission parameters to adapt to changing channel conditions. The second preset duration can be a fixed value or an adaptive value based on RTT measurements; this is not limited here. Retransmission strategies can include backoff algorithms, power adjustments, and other optimization measures; this is not limited here either.
[0087] The first specific way to implement this step is to adopt an exponential backoff adaptive retransmission strategy. The initial second preset duration is set to 2 seconds, adjusted based on the most recent RTT measurement. The timeout for the nth retransmission is calculated as: Timeout(n) = min(Initial_Timeout * 2^(n-1), Max_Timeout); where Initial_Timeout is 2 seconds and Max_Timeout is 30 seconds to avoid excessive waiting. For each retransmission, the transmission parameters are adjusted according to the number of retransmissions: the first two retransmissions maintain the original parameters, the modulation order is reduced for the third and fourth retransmissions, and the transmission power is increased by 3dB after the fifth retransmission. Channel quality assessment is performed; if the channel is severely degraded, retransmission is paused and the process waits for channel improvement. The retransmission history of each segment is recorded, including the number of retransmissions, the result of each retransmission, and the channel status. When a segment fails after 7 retransmissions, it is marked as a transmission failure, and the upper-layer application is notified. After successful reception confirmation, the timeout is updated: New_Timeout = 0.8 * Old_Timeout + 0.2 * Measured_RTT. The second specific approach is an optimization method based on intelligent retransmission decision-making. A machine learning model is used to predict the retransmission success probability, with input features including historical retransmission success rates, current channel state, and time characteristics. The predicted probability determines whether to retransmit immediately or delay retransmission. A tiered retransmission strategy is implemented: the first retransmission uses the same parameters for rapid retry, the second retransmission uses more robust modulation and coding, and the third retransmission uses repeated coding to increase redundancy. Before retransmission, rapid channel probing is performed, sending short probe packets to assess the channel state. The optimal retransmission timing and parameters are selected based on the probe results. Forward error correction codes are concatenated, with different coded versions sent for each retransmission, which the receiver can then combine and decode. A retransmission mode library is established, selecting appropriate retransmission strategies for different error modes.
[0088] In the above embodiments, fluctuations in radio frequency signal strength are monitored to determine the communication link status, and a status query is proactively initiated when an anomaly is detected, enabling the system to promptly identify communication problems. Based on historical communication records, the communication patterns of the device to be switched are analyzed to predict the next reconnection time, improving reconnection efficiency. A data segmentation and acknowledgment mechanism is employed to ensure the integrity and reliability of data transmission even in temporary disconnection states, and to ensure accurate transmission of configuration data even under unstable communication conditions, improving the system's adaptability and reliability in complex environments.
[0089] The system in the embodiments of this invention is described below from the perspective of hardware processing. Please refer to [link / reference needed]. Figure 3 This is a schematic diagram of the physical device structure of a portable wireless radio frequency switching system provided in an embodiment of this application.
[0090] It should be noted that, Figure 3The structure of the system shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.
[0091] like Figure 3 As shown, the system includes a Central Processing Unit (CPU) 301, which can perform various appropriate actions and processes based on a program stored in Read-Only Memory (ROM) 302 or a program loaded from storage portion 308 into Random Access Memory (RAM) 303, such as executing the methods described in the above embodiments. The RAM 303 also stores various programs and data required for system operation. The CPU 301, ROM 302, and RAM 303 are interconnected via a bus 304. An Input / Output (I / O) interface 305 is also connected to the bus 304.
[0092] The following components are connected to I / O interface 305: input section 306 including a camera, infrared sensor, etc.; output section 307 including a liquid crystal display (LCD) and speakers, etc.; storage section 308 including a hard disk, etc.; and communication section 309 including a network interface card such as a LAN (Local Area Network) card and a modem, etc. Communication section 309 performs communication processing via a network such as the Internet. Drive 310 is also connected to I / O interface 305 as needed. Removable media 311, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 310 as needed so that computer programs read from them can be installed into storage section 308 as needed.
[0093] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing computer programs for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 309, and / or installed from removable medium 311. When the computer program is executed by central processing unit (CPU) 301, it performs the various functions defined in the present invention.
[0094] It should be noted that the computer-readable medium shown in the embodiments of the present invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. The transmitted data signal can take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof.
[0095] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. Each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0096] In another aspect, the present invention also provides a computer-readable storage medium, which may be included in the system described in the above embodiments; or it may exist independently and not assembled into the system. The storage medium carries one or more computer programs that, when executed by a processor of a system, cause the system to implement the methods provided in the above embodiments.
[0097] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
[0098] As used in the above embodiments, depending on the context, the term "when..." can be interpreted as "if...", "after...", "in response to determining...", or "in response to detecting...". Similarly, depending on the context, the phrase "when determining..." or "if (the stated condition or event) is interpreted as "if determining...", "in response to determining...", "when (the stated condition or event) is detected", or "in response to detecting (the stated condition or event)".
[0099] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive), etc.
[0100] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A portable radio frequency switching method applied to a system, characterized in that, The system comprises a switching device and a device to be switched, and the method comprises: The switching device performs signal scanning in a preset frequency range to obtain a radio frequency signal strength value of the device to be switched; In a case where it is determined based on the radio frequency signal strength value that a distance between the switching device and the device to be switched is not greater than a preset distance threshold, the switching device sends a wake-up instruction and a handshake request to the device to be switched which is in a deep sleep state and keeps low-power listening, the wake-up instruction being used to wake up a radio frequency module and a processor of the device to be switched; The switching device and the device to be switched perform the handshake request to establish a secure communication connection, the handshake request comprising bidirectional identity authentication; After the secure communication connection is established, the switching device sends encrypted radio frequency configuration data to the device to be switched, and the device to be switched writes the received encrypted radio frequency configuration data into a non-volatile memory; After the device to be switched completes writing of the encrypted radio frequency configuration data, the device to be switched sends a confirmation signal to the switching device and automatically switches to the deep sleep state and keeps low-power listening.
2. The method of claim 1, wherein, Before the radio frequency signal strength value of the device to be switched is obtained, the method further comprises: The switching device calculates a current moving speed vector based on acceleration data and a current orientation angle based on angular velocity data; The switching device determines a fan-shaped detection region according to the moving speed vector and the orientation angle, the fan-shaped detection region having a current position of the switching device as a vertex, a direction of the moving speed vector as a symmetry axis, a preset detection radius as a radius, and a preset detection angle as an opening angle; The switching device obtains an azimuth angle and a signal strength of each radio frequency signal source in the fan-shaped detection region; Based on the azimuth angle and the signal strength, the switching device calculates an angle interval and a signal strength difference between adjacent radio frequency signal sources, and determines a radio frequency signal source having an angle interval greater than a preset angle threshold and a signal strength difference greater than a preset strength threshold as a distinguishable device to be switched; The switching device adjusts a beam direction to an azimuth angle of a radio frequency signal source having the strongest signal strength and adjusts the preset distance threshold to be less than a minimum distance between adjacent distinguishable devices to be switched according to a number and a distribution position of the distinguishable devices to be switched.
3. The method of claim 2, wherein, The switching device adjusts a beam direction to an azimuth angle of a radio frequency signal source having the strongest signal strength according to a number and a distribution position of the distinguishable devices to be switched, specifically comprising: The switching device divides the fan-shaped detection region into a plurality of fan-shaped sub-regions, each fan-shaped sub-region having an opening angle less than the preset detection angle; The switching device calculates a number of distinguishable devices to be switched and a distribution position of each distinguishable device to be switched in each fan-shaped sub-region; The switching device selects a fan-shaped sub-region having the largest number of distinguishable devices to be switched as a target detection region; The switching device narrows the beam width in the target detection area, re-scans and acquires the signal strength of each radio frequency signal source, and selects the azimuth angle of the radio frequency signal source with the strongest signal strength as the final beam direction.
4. The method of claim 1, wherein, The method further comprises: In a case where it is determined that the fluctuation amplitude of the radio frequency signal strength value of the device to be switched within a preset time period exceeds a preset threshold, the switching device sends a state query instruction to the device to be switched; When the switching device does not receive a response to the state query instruction from the device to be switched within a first preset time length, it is determined that the device to be switched is in a temporary disconnected state; The switching device determines the communication period of the device to be switched based on the historical communication record of the device to be switched; The switching device calculates the next communicable time point of the device to be switched according to the communication period and the current time; The switching device divides the encrypted radio frequency configuration data into multiple data segments according to a preset length at the communicable time point; The switching device sends each data segment in turn and waits for the receiving confirmation information returned by the device to be switched after the sending of each data segment is completed; If the receiving confirmation information is not received within a second preset time length, the switching device re-sends the current data segment.
5. The method of claim 4, wherein, The switching device determines the communication period of the device to be switched based on the historical communication record of the device to be switched, specifically comprising: Extracting the time stamp of the most recent preset communication from the historical communication record; Calculating the time interval between adjacent two communications to obtain a time interval sample; Performing cluster analysis on the time interval sample to obtain the time interval value in the largest sample set; Determining the time interval value in the largest sample set as the communication period of the device to be switched.
6. The method of claim 4, wherein, After calculating the next communicable time point of the device to be switched, the method further comprises: Determining a forward preset time length and a backward preset time length of the communicable time point; Detecting the signal sent by the device to be switched at a preset detection interval within the time range determined by the forward preset time length and the backward preset time length; If the signal strength of the detected signal is greater than a third preset threshold, the time when the signal is detected is determined as the actual communicable time point; The switching device divides the encrypted radio frequency configuration data into multiple data segments according to the preset length at the actual communicable time point; If no signal with a signal strength greater than the third preset threshold is detected, the step of dividing the encrypted radio frequency configuration data into multiple data segments according to the preset length at the communicable time point by the switching device is performed.
7. The method of claim 6, wherein, The determination of the forward preset time length and the backward preset time length of the communicable time point specifically comprises: Based on the communicable time point, the forward preset time length is set to a third preset time length before the communicable time point; The backward preset time length is set to a fourth preset time length after the communicable time point, and the third preset time length is greater than the fourth preset time length.
8. A portable radio frequency switching system, characterized by The system comprises: one or more processors and a memory; the memory coupled with the one or more processors, the memory to store computer program code, the computer program code comprising computer instructions to cause the system to perform the method of any of claims 1-7.
9. A computer-readable storage medium comprising instructions, characterized in that, When the instructions are executed on the system, the system is caused to perform the method of any of claims 1-7.
10. A computer program product, characterised in that, When the computer program product is run on the system, the system is caused to perform the method of any of claims 1-7.
Citation Information
Cited By
Communication method, electronic equipment and computer readable storage medium
CN121842754A