An Internet of Things device network configuration method and device, an electronic device, and a storage medium
Patent Information
- Application Number
- CN202611384756.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-08
- Publication Date
- 2026-10-13
AI Technical Summary
[0005]本申请实施例的目的是提供一种物联网设备配网方法、装置、电子设备及存储介质,能够解决静态二维码配网易受环境因素影响,导致拍摄的二维码图像不完整或模糊,进而导致配网失败的问题
[0016]本申请实施例提供的物联网设备配网方法具有以下有益效果:通过将配网信息编码为用户终端屏幕的亮度跳变,由物联网设备摄像头采集图像序列并提取亮度时序特征,识别亮度跳变沿还原比特流并解码,能够在不依赖蓝牙射频通道的前提下完成配网信息传输,有效避免了蓝牙配网在2.4GHz频段拥挤环境下易受干扰导致配网失败的问题;同时,由于配网信息承载于亮度时序的跳变沿中,信息解码依赖的是多帧图像之间的亮度变化趋势,而非单帧图像的完整性或清晰度,因此,即使摄像头拍摄的图像因光照过曝、镜头污损、对焦不准等原因导致单帧图像模糊或不完整,只要图像序列中屏幕区域的亮度时变特征能够被捕捉,即可通过多帧时序累积准确检测出跳变沿并解调出配网信息,克服了静态二维码配网对单帧成像质量高度依赖的缺陷,提高了物联网设备在复杂环境下的配网成功率。
Smart Images

Figure CN122909602A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of Internet of Things and smart device network distribution technology, specifically relating to an Internet of Things device network distribution method, apparatus, electronic device and storage medium. Background Technology
[0002] Currently, IoT devices (such as smart cameras, smart locks, smart light bulbs, and sensor nodes) typically do not have network credentials configured at the factory. Users need to transmit the Wi-Fi network's SSID and password to the device via a mobile app upon initial use. The device then connects to the home or business Wi-Fi network based on this information; this process is called network configuration. With the increasing prevalence of IoT devices, network configuration technology is being widely applied in smart homes, security monitoring, and other fields.
[0003] Currently, the mainstream IoT device network configuration solutions are Bluetooth configuration and static QR code configuration. In Bluetooth configuration, the user's mobile app establishes a connection with the IoT device via Bluetooth broadcast, transmitting the Wi-Fi SSID and password to the IoT device through the Bluetooth link. Upon receiving the information, the IoT device connects to the target Wi-Fi network. In static QR code configuration, the user's mobile app encodes the Wi-Fi SSID and password into a static QR code image and displays it on the screen. The IoT device captures this QR code image using its built-in camera, decodes it through image recognition, extracts the configuration information, and connects to the target Wi-Fi network.
[0004] However, Bluetooth pairing relies on 2.4GHz radio frequency communication, which is shared by various devices such as Wi-Fi and microwave ovens. In congested environments, Bluetooth broadcast packets are prone to loss or timeouts, leading to pairing failures. While static QR code pairing can bypass the 2.4GHz radio frequency channel and solve the problem of Bluetooth pairing, it requires the QR code image captured by the camera to be complete and clear in a single shot. In practical use cases, the imaging quality of the device's camera is affected by various environmental factors: ambient lighting conditions (overexposure or underexposure), lens surface contamination, distance and angle deviation between the device and the screen, and inaccurate focusing. All of these can lead to incomplete or blurry QR code images, resulting in decoding failures and preventing IoT devices from pairing. Users can only repeatedly adjust the shooting angle or clean the lens and try again, which seriously affects pairing efficiency and user experience. Summary of the Invention
[0005] The purpose of this application is to provide a method, apparatus, electronic device and storage medium for network configuration of Internet of Things (IoT) devices, which can solve the problem that static QR code network configuration is easily affected by environmental factors, resulting in incomplete or blurry QR code images and thus network configuration failure.
[0006] To solve the above-mentioned technical problems, this application is implemented as follows: In a first aspect, embodiments of this application provide a method for configuring IoT devices on a network, including: Acquire an image sequence containing the user terminal screen, wherein brightness jumps in the screen area of the image sequence correspond to a bit stream, and the bit stream is determined by the user terminal based on distribution network information; The brightness feature values of pixels within the screen area of each frame of the image sequence are extracted to obtain a brightness time sequence; A symbol sequence is generated based on the brightness time sequence; one symbol in the symbol sequence corresponds one-to-one with one brightness feature value in the brightness time sequence. Detect the transition edges in the symbol sequence to obtain the bit stream; decode the bit stream to obtain the distribution network information, and perform distribution network based on the distribution network information.
[0007] Optionally, the brightness feature values of pixels within the screen area of each frame of the image sequence are extracted to obtain a brightness temporal sequence, including: Calculate the inter-frame difference value at the same pixel position between consecutive preset frame images in the image sequence; Based on the cumulative value of the inter-frame difference value corresponding to each pixel position in the image sequence, a connected region whose cumulative value of the inter-frame difference value exceeds a preset threshold is determined, and the connected region is determined as a screen region. The average grayscale value of all pixels within the screen area of each frame in the image sequence is calculated and used as the brightness feature value of the frame image.
[0008] Optionally, generating a symbol sequence based on the luminance timing sequence includes: Obtain the luminance feature value of the latest frame in the current luminance time sequence, the maximum value of all luminance feature values in the previous luminance time sequence, and the normalized previous luminance time sequence; Divide the brightness feature value of the latest frame by the maximum value to obtain the normalized brightness feature value of the latest frame; Discard the oldest frame in the normalized previous luminance time sequence, and add the normalized luminance feature value of the latest frame to the normalized previous luminance time sequence to obtain the normalized current luminance time sequence. The normalized current luminance time sequence is input into a pre-trained time classification model to obtain the current code, and the code sequence is composed of the code corresponding to each frame image.
[0009] Optionally, after extracting the brightness feature values of pixels within the screen area of each frame of the image sequence to obtain a brightness temporal sequence, the method further includes: The brightness time sequence is subjected to digital bandpass filtering.
[0010] Optionally, the image sequence is acquired by a camera, and before acquiring the image sequence including the user terminal screen, the method further includes: Acquire a training image sequence sent by a user terminal, wherein the brightness of the training image sequence is generated by the user terminal according to a preset transition mode; The actual transition points of the training image sequence are detected, and the phase deviation value is determined based on the time deviation between the preset transition point corresponding to the preset transition mode and the actual transition point. Based on the phase deviation value, the preset sampling time of the camera is compensated to obtain the target sampling time, and an image sequence of the user terminal screen is acquired at the target sampling time.
[0011] Optionally, the symbol sequence is obtained by a pre-trained temporal classification model that extracts and classifies the brightness change patterns in the brightness temporal sequence. The temporal classification model includes a cascaded first temporal convolutional layer, a pooling layer, a second temporal convolutional layer, a global average pooling layer, and a fully connected layer. Based on the brightness timing sequence, a symbol sequence is generated, including: The brightness temporal sequence is input into the first temporal convolutional layer for convolution, local temporal features of brightness changes between adjacent frames are extracted, and the first temporal feature map is output. The first temporal feature map is input into the pooling layer for max pooling downsampling, and the pooled feature map is output. The pooled feature map is input into the second temporal convolutional layer for convolution, and the brightness temporal combination features are extracted to output the second temporal feature map. The second temporal feature map is input into the global average pooling layer and globally averaged along the temporal dimension to aggregate into a global feature vector that characterizes the overall brightness change trend. The global feature vector is input into the fully connected layer, and the probability distribution of the output symbol being 0 or 1 is used to determine the current symbol. The symbol sequence is composed of the symbols corresponding to each frame image.
[0012] Optionally, the bit stream is determined by the user terminal encoding the synchronization header field and the distribution network information; Decoding the bitstream to obtain the network distribution information includes: Identify the synchronization header field in the bitstream; Extract the valid data after the synchronization header field from the bit stream; The valid data is decoded to obtain the distribution network information.
[0013] Secondly, embodiments of this application provide an IoT device network distribution apparatus, comprising: An image acquisition unit is used to acquire an image sequence containing the screen of a user terminal, wherein the brightness jumps of the screen area in the image sequence correspond to a bit stream, and the bit stream is determined by the user terminal based on the distribution network information. The feature extraction unit is used to extract the brightness feature values of pixels within the screen area of each frame of the image sequence to obtain a brightness time sequence. The symbol generation unit is used to generate a symbol sequence based on the brightness timing sequence; one symbol in the symbol sequence corresponds one-to-one with one brightness feature value in the brightness timing sequence. The decoding distribution unit is used to detect the transition edges in the symbol sequence to obtain a bit stream; decode the bit stream to obtain the distribution information, and perform distribution based on the distribution information.
[0014] Thirdly, embodiments of this application provide an electronic device including a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the method described in the first aspect.
[0015] Fourthly, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect.
[0016] The IoT device network configuration method provided in this application has the following advantages: By encoding network configuration information as brightness transitions of the user terminal screen, the IoT device camera captures image sequences and extracts brightness timing features, identifies brightness transition edges to reconstruct the bitstream and decodes it, enabling network configuration information transmission without relying on the Bluetooth radio frequency channel. This effectively avoids the problem of Bluetooth network configuration failure due to interference in the congested 2.4GHz band. Furthermore, since the network configuration information is carried in the brightness timing transition edges, information decoding relies on the brightness change trend between multiple frames, rather than the integrity or clarity of a single frame. Therefore, even if the image captured by the camera is blurred or incomplete due to overexposure, lens damage, or inaccurate focus, as long as the brightness timing features of the screen area in the image sequence can be captured, the transition edges can be accurately detected and the network configuration information demodulated through multi-frame timing accumulation. This overcomes the defect of static QR code network configuration being highly dependent on the quality of a single frame image, improving the success rate of IoT device network configuration in complex environments. Attached Figure Description
[0017] Figure 1A schematic flowchart of an embodiment of the IoT device network configuration method provided in this application; Figure 2 A schematic flowchart of another embodiment of the IoT device network configuration method provided in this application; Figure 3 A schematic diagram of an embodiment of the IoT device network distribution device provided in this application. Detailed Implementation
[0018] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0019] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0020] The IoT device network configuration method provided in this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.
[0021] Figure 1 A flowchart illustrating another IoT device network configuration method provided in this application embodiment is shown below. Figure 1 As shown, the IoT device network configuration method is applied to IoT devices, and the method includes: Step 101: Obtain an image sequence containing the user terminal screen. The brightness jumps in the screen area of the image sequence correspond to the bit stream, and the bit stream is determined by the user terminal based on the distribution network information. It should be noted that the image sequence is specifically obtained by capturing images of the user terminal screen through a camera. Prior to this, the user terminal has already encoded the network distribution information into a series of screen brightness changes. Therefore, the image sequence captured by the camera contains information about the changes in screen brightness over time, and the network distribution information can be decoded from this information.
[0022] Step 102: Extract the brightness feature values of pixels within the screen area of each frame of the image sequence to obtain the brightness time sequence; It should be noted that the image sequence obtained from step 101 is raw image data, and each frame of the image contains a screen area and a background environment. It is necessary to extract the brightness features of the screen area related to the power distribution network information from it. After performing the above operation on each frame of the image sequence, a set of brightness feature values arranged in chronological order can be obtained, that is, a brightness time series sequence.
[0023] Step 103: Generate a symbol sequence based on the luminance time sequence; one symbol in the symbol sequence corresponds one-to-one with one luminance feature value in the luminance time sequence. It should be noted that the brightness time-series sequence obtained from step 102 reflects the change in screen brightness over time, but the values in this sequence are continuous analog quantities and will fluctuate due to factors such as ambient light. This step maps each brightness feature value in the brightness time-series sequence to a discrete symbol (0 or 1), forming a symbol sequence. Each symbol in the symbol sequence corresponds one-to-one with each brightness feature value in the brightness time-series sequence in sequence position, that is, the t-th symbol corresponds to the brightness feature value of the t-th frame image, indicating whether the screen area in that frame image is in a bright or dark state. However, the value of each symbol is not determined independently by the brightness feature value of that frame, but is obtained by the time-series classification model based on the brightness change trend of the current frame and several consecutive frames before and after it.
[0024] Step 104: Detect the transition edges in the symbol sequence to obtain the bit stream; decode the bit stream to obtain the distribution network information, and perform distribution network based on the distribution network information.
[0025] It should be noted that distribution network information is encoded at the physical layer in the form of brightness transition edges. That is, the information is carried in the change of symbols from 0 to 1 or from 1 to 0, rather than the symbol values themselves. This step first detects all positions where transitions occur in the symbol sequence, restores the order of the transition edges into a bit stream, then decodes the bit stream according to the encoding format used by the user terminal to restore the distribution network information, and finally connects to the target network based on the distribution network information to complete the distribution network.
[0026] In summary, the main technical approach of this application is as follows: the user terminal transmits the network distribution information by encoding it into a screen brightness transition, the IoT device collects the light signal through a camera, and detects the brightness transition edge at the decoding end to reconstruct the network distribution information and complete the network distribution.
[0027] Compared with existing technologies, this application encodes network distribution information as brightness transitions on the user terminal screen. The IoT device's camera captures image sequences and extracts brightness timing features, identifies the brightness transition edges to reconstruct the bitstream, and decodes it. This enables network distribution information transmission without relying on the Bluetooth radio frequency channel, effectively avoiding the problem of network distribution failure caused by interference in the congested 2.4GHz band. Furthermore, since the network distribution information is carried in the brightness timing transition edges, information decoding relies on the brightness change trend between multiple frames, rather than the integrity or clarity of a single frame. Therefore, even if a single frame image is blurry or incomplete due to overexposure, lens damage, or inaccurate focus, as long as the brightness timing features of the screen area in the image sequence can be captured, the transition edges can be accurately detected and the network distribution information demodulated through multi-frame timing accumulation. This overcomes the high dependence of static QR code network distribution on single-frame imaging quality and improves the success rate of network distribution for IoT devices in complex environments.
[0028] Figure 2 A flowchart illustrating another IoT device network configuration method provided in this application embodiment is shown below. Figure 2 As shown, this is a network configuration method for IoT devices, applied to IoT devices equipped with cameras, including: Step 201: Obtain an image sequence containing the user terminal screen. The brightness jumps in the screen area of the image sequence correspond to the bit stream. The bit stream is determined by the user terminal based on the distribution network information. In some embodiments, prior to step 201, the method further includes the following steps: Sub-step S11: Enter network configuration mode and enable Bluetooth monitoring channel and camera acquisition channel; For example, the IoT device has a built-in network configuration management module, a Bluetooth receiver, and a camera. After the IoT device powers on and starts the network configuration mode, it first enters the network configuration mode. Its built-in network configuration management module simultaneously opens two parallel physical channels: a Bluetooth listening channel and a camera acquisition channel. The Bluetooth listening channel serves as the main channel, and the camera acquisition channel serves as the out-of-band network configuration channel. At this time, although the camera is powered on, it is only in standby mode and does not perform the subsequent complete image acquisition and decoding process to save power. Then, the first countdown timer is started, with a preset channel switching time threshold of 15 seconds (the specific value can be adjusted according to the actual application scenario; this embodiment uses 15 seconds as an example) to establish a multi-channel listening framework and prepare for subsequent adaptive channel switching. After completing the above initialization, the device begins to wait for network configuration connection requests from user terminals (such as mobile phones).
[0029] Sub-step S12: Detect whether the Bluetooth monitoring channel receives a valid Bluetooth configuration data packet from the user terminal within the preset channel switching time threshold. For example, a user opens a mobile app and enters or selects the SSID and password of their current home Wi-Fi network. After obtaining this network configuration information, the app encapsulates it into a Bluetooth network configuration data packet according to the Bluetooth network configuration protocol. This data packet contains the SSID string, the password string, and a device identifier for identity verification. The mobile app then broadcasts this network configuration data packet via the phone's built-in Bluetooth module and starts a second countdown timer (the specific time can be adjusted according to the actual application scenario; this embodiment uses 10 seconds as an example) to wait for Bluetooth confirmation from the IoT device. Bluetooth network configuration is the lowest power consumption network configuration path. Compared to a camera continuously capturing images and performing subsequent processing, the power consumption of Bluetooth radio frequency communication is more than an order of magnitude lower. Therefore, under normal circumstances, prioritizing the use of the Bluetooth channel to complete the network configuration information transmission is the most power-efficient choice.
[0030] In sub-step S13, if no valid Bluetooth network configuration data packet is received from the user terminal within a preset time threshold, the Bluetooth network configuration main channel is determined to be invalid, and the channel of the network configuration mode is switched to the camera acquisition channel to obtain an image sequence containing the user terminal screen.
[0031] For example, if the Bluetooth receiver built into the IoT device successfully receives and verifies the complete network configuration data packet within 15 seconds, the Bluetooth handshake is successful, and the device directly enters the Wi-Fi connection phase. The image acquisition and decoding process corresponding to the camera acquisition channel will not be triggered. If the Bluetooth receiver on the IoT device does not receive any valid Bluetooth network configuration data packet when the 15-second countdown reaches zero (possible reasons include co-channel interference in the 2.4GHz band, metal shielding, abnormal Bluetooth module driver, etc.), the network configuration management module determines that the Bluetooth network configuration main channel is invalid, and the Bluetooth handshake fails. At this time, the first countdown timer on the IoT device stops, the network configuration management module clears the "Bluetooth network configuration main channel available" flag in the channel status register to zero, and sets the "camera acquisition channel" flag. At the same time, the camera sensor of the IoT device switches from standby mode to full-speed acquisition mode, and begins to continuously acquire image sequences of the user terminal screen at a frame rate of 60 frames per second. Each frame is an 8-bit grayscale image with VGA resolution (640×480 pixels), that is, the brightness value of each pixel is in the range of 0~255. In this way, after detecting Bluetooth failure, the hardware resources of the backup channel are automatically and seamlessly activated. After completing the channel switch, the device enters the optical signal listening and decoding state, waiting for the optical beacon provided by the mobile phone screen.
[0032] Almost simultaneously with the Bluetooth timeout on the IoT device, the second countdown timer on the user's mobile app also reached zero after 10 seconds. The app did not receive a Bluetooth response from the IoT device, leading it to conclude that the Bluetooth listening channel was unavailable and the Bluetooth handshake had failed. Immediately, a message popped up on the user interface: "Bluetooth connection abnormality detected. Please point your phone screen at the device's camera." At the same time, the app initiated the light signal generation process: First, it retrieved the previously entered Wi-Fi SSID and password, converting these two strings into a raw binary data bitstream using UTF-8 encoding. Then, the app performed a three-layer encoding process on this bitstream. The first layer was Manchester encoding: converting raw bit 0 to 01 (i.e., a transition between light and dark), and raw bit 1 to 10 (i.e., a transition between light and dark), ensuring that each raw data bit is represented by a single level transition edge, eliminating the influence of DC drift. The second layer is frame encapsulation: a clock training sequence (a square wave alternating between bright and dark for 16 cycles at a frequency of 30Hz, used for device-side phase locking) and a frame synchronization header (a fixed byte 0xFFAA, used to identify the start position of valid data) are added sequentially to the header of the Manchester-encoded data stream, and a 16-bit CRC checksum (used for device-side integrity verification) is appended to the tail of the data stream. The third layer is physical mapping: the encoded complete data stream is mapped to screen brightness control instructions: when the data bit is bright (corresponding to a high level in Manchester encoding), the App calls the operating system's screen brightness control API to display a large area of white on the screen and adjust it to maximum brightness; when the data bit is dark (corresponding to a low level), the screen displays a large area of black and adjusts to minimum brightness. The screen brightness switching frequency is 30Hz, that is, 30 bright-dark alternations are completed per second. The purpose of this stage is to generate a timing-controllable optical physical layer signal encoded with complete network configuration information on the mobile phone side and transmit it through the screen. At this point, the mobile phone screen begins to flash continuously, emitting a light signal carrying network configuration information towards the device's camera.
[0033] The device's camera continuously captures image frames containing the phone screen area at a frame rate of 60 frames per second. Each frame output from the camera sensor is a two-dimensional pixel matrix with a size of 640×480. Each pixel stores an integer value from 0 to 255 representing its grayscale brightness. The camera transmits each frame of image data directly to the memory buffer of the device's main control chip in RAW format. This process is purely physical layer data acquisition, without any data processing or decoding operations. The camera continuously acquires data, triggering an interrupt after each frame is acquired, notifying the main control chip to read the frame data from the buffer for subsequent preprocessing.
[0034] In some embodiments, prior to step 201, the method further includes the following sub-steps: Sub-step S21: Obtain the training image sequence sent by the user terminal. The brightness of the training image sequence is generated by the user terminal according to a preset transition mode. It should be noted that the preset transition mode corresponds to the clock training sequence header in the encoding process described above. Specifically, before sending valid data carrying distribution network information, the user terminal inserts a training image sequence (i.e., a clock training sequence, such as a 16-cycle, 30Hz square wave signal) with brightness varying according to the preset transition mode into the data stream header. The transition mode of this sequence is known in advance to the device. By acquiring and analyzing the actual transition positions of this training image sequence, the device can deduce the clock phase deviation between the transmitting and receiving ends, thereby completing the sampling time calibration before formal data acquisition. In other words, this training image sequence does not carry distribution network information; its purpose is to provide a reference for phase locking for the device.
[0035] Sub-step S22: Detect the actual transition points of the training image sequence, and determine the phase deviation value based on the time deviation between the preset transition points corresponding to the preset transition mode and the actual transition points; It should be noted that the actual transition point refers to the brightness transition position actually detected by the device in the training image sequence. Detecting the actual transition point in the training image sequence can be achieved in various ways. For example, it can be done by calculating the difference between adjacent symbols in the symbol sequence; when the difference is non-zero, a transition edge is determined to exist at that position (i.e., differential detection method). Alternatively, a preset brightness threshold can be used, and positions in the brightness time sequence that cross the threshold can be identified as transition points (i.e., threshold comparison method). Zero-crossing detection, template matching, and other methods can also be used. Any method that can identify brightness transition points from the training image sequence is acceptable, and this application does not limit this approach.
[0036] Sub-step S23: Based on the phase deviation value, compensate for the preset sampling time of the camera to obtain the target sampling time, and acquire the image sequence of the user terminal screen at the target sampling time.
[0037] It should be noted that the preset sampling time is the theoretical sampling time under ideal conditions with no clock drift, while the target sampling time is the actual sampling time after adjusting the preset sampling time forward or backward based on the phase deviation value. Because the crystal oscillators of the device and the mobile phone originate from different sources, there is an inherent clock deviation between the two, causing the transition point detected by the device to be offset from the theoretical preset transition point on the time axis. This step compares the actual detected transition point with the preset transition point, calculates the time deviation between the two to quantify the phase difference between the transmitting and receiving ends, and adjusts the preset sampling time forward or backward by the corresponding amount based on the magnitude and direction of this deviation. This ensures that the sampling point aligns with the peak or trough of the brightness signal, avoiding it falling on the transition edge transition band. This effectively reduces the risk of blurred or misjudged brightness values caused by the sampling time falling on the transition band, improves the accuracy of transition edge detection and symbol judgment, and ultimately increases the success rate of network decoding.
[0038] This application is applicable to conventional indoor and outdoor environments, and has particularly good decoding performance in the typical illuminance range of 10 lux to 10000 lux. For strong light scenes, the device-side camera can adopt an automatic exposure control strategy to dynamically adjust the exposure time and gain according to the ambient light. Specifically, in some embodiments, the method further includes: acquiring ambient light intensity data; when the ambient light intensity is detected to be higher than a first light intensity threshold, determining that the ambient light is too strong, and controlling to reduce the exposure time and gain of the camera to prevent pixel saturation; when the ambient light intensity is detected to be lower than a second light intensity threshold, determining that the current ambient light is too dark, and controlling to increase the exposure time and gain of the camera to ensure signal amplitude, thereby ensuring that the brightness signal output by the camera is always within a reasonable dynamic range.
[0039] Step 202: Extract the brightness feature values of pixels within the screen area of each frame of the image sequence to obtain the brightness time sequence; Considering that each frame of image captured by the camera includes both the mobile phone screen area and the background environment, in order to extract features directly related to the network configuration information from the image sequence, it is necessary to first locate the position of the mobile phone screen in each frame of image, and then extract the brightness features in that area. Based on this, this step uses the inter-frame difference method to locate the screen area and calculates the average brightness in the screen area as the brightness feature value of that frame. Specifically, in some embodiments, step 202 includes the following sub-steps: Sub-step S31: Calculate the inter-frame difference value at the same pixel position between consecutive preset frame images in the image sequence; It should be noted that the screen area continuously changes brightness at a certain frequency (e.g., 30Hz) during the transmission of network information. Therefore, the brightness of pixels within the screen area varies significantly between consecutive frames. In contrast, the brightness of the background environment remains relatively constant over a period of time, and its inter-frame difference value approaches zero. Based on this characteristic, the inter-frame difference value can be used to distinguish between the screen area and the background area. It does not rely on static features such as color, shape, or texture in the image, nor does it require pre-storing any reference images. The screen area can be quickly located solely through the brightness difference between consecutive frames. This approach has the advantages of low computational load, fast response speed, and suitability for operation on resource-constrained IoT devices.
[0040] For example, take 5 consecutive frames of images, and calculate the absolute value of the grayscale difference at the same pixel position between adjacent frames (between the 1st and 2nd frames, between the 2nd and 3rd frames, ..., between the 4th and 5th frames) to obtain 4 sets of inter-frame difference values.
[0041] Sub-step S32: Based on the cumulative value of the inter-frame difference value corresponding to each pixel position in the image sequence, determine the connected region where the cumulative value of the inter-frame difference value exceeds a preset threshold, and determine the connected region as the screen region. It should be noted that if the screen area is determined solely based on the difference between a single pair of frames, it may be misjudged due to random noise in a particular frame. To improve the reliability of the detection, the screen area is determined by the cumulative value of the difference between frames.
[0042] For example, the four sets of inter-frame difference values obtained in sub-step S31 are accumulated at the same pixel position. Due to continuous jumps, the cumulative difference value of the screen area is much higher than that of the background area; while the background area hardly changes between consecutive frames, and the cumulative difference value is close to zero. Pixels whose cumulative difference value exceeds a preset threshold (in this embodiment, the threshold is set to 50, that is, the cumulative grayscale change of each pixel position between four consecutive pairs of frames exceeds 50 grayscale levels) are marked as target pixels. The largest connected region formed by all marked target pixels is determined as the position of the mobile phone screen in the image, i.e., the screen area. The input of this step is a complete grayscale image of 5 frames, and the output is the bounding box of the screen area, which is represented by a quadruple representing the pixel coordinate range of the screen in the image.
[0043] Sub-step S33: Calculate the average grayscale value of all pixels within the screen area of each frame of the image sequence, and use it as the brightness feature value of the frame image.
[0044] It should be noted that after locating the screen area, the two-dimensional image data needs to be converted into a one-dimensional signal for subsequent processing. In this step, based on the screen area bounding box determined in sub-step S32, the screen area is cropped from the grayscale image of the current frame, the grayscale values of all pixels in the area are counted and the arithmetic mean is calculated as the brightness feature value. The above operation is performed on each frame in the image sequence in sequence to obtain a set of brightness feature values arranged in chronological order, i.e., the brightness time sequence.
[0045] Considering that indoor LED lights typically exhibit 50Hz / 100Hz power frequency flicker, which may alias with the 30Hz screen flicker signal from mobile phones, interfering with subsequent edge detection, to filter out ambient light flicker interference, in some embodiments, after step 202, the method further includes: A digital bandpass filter is applied to the luminance time series to remove ambient light power frequency interference components, resulting in a preprocessed luminance time series.
[0046] In some embodiments, the preferred screen flicker frequency is 30Hz, and the passband range of the digital bandpass filter is set to 20Hz to 40Hz. The main power frequency flicker of indoor LED lights is 50Hz and its harmonic 100Hz. By setting the passband range of the digital bandpass filter to 20Hz to 40Hz, the screen flicker signal component near 30Hz can be effectively retained, while filtering out power frequency interference components and high-frequency noise at 50Hz and above. This results in a higher signal-to-noise ratio for the brightness timing sequence entering subsequent processing, ensuring the accuracy of decoding.
[0047] Step 203: Normalize the luminance time series to obtain the normalized luminance time series. Considering the significant differences in absolute brightness values captured by the camera under varying ambient lighting conditions (e.g., a dark screen under direct sunlight outdoors may still be captured with a high brightness value, while a bright screen indoors may only have a low brightness value), directly sending the raw brightness value into subsequent processing would result in completely different values for the same transition pattern under different lighting conditions, leading to decoding failure. To eliminate the interference of ambient lighting differences on decoding and ensure that the brightness change pattern maintains a consistent representation under different lighting conditions, in some embodiments, step 203 includes the following sub-steps: Sub-step S41: Obtain the brightness feature value of the latest frame in the current brightness time sequence, the maximum value of all brightness feature values in the previous brightness time sequence, and the normalized previous brightness time sequence. It should be noted that the reason for using the maximum value of all brightness feature values in the previous brightness time sequence instead of a global fixed value (such as 255) as the denominator is that ambient light is dynamic. The absolute value of the brightness of the same screen may differ by several times in sunny and cloudy scenes, and a fixed value cannot adapt to this change. Taking the maximum value in the previous sequence as a reference benchmark is equivalent to measuring the relative brightness level of the current frame with the brightest level recently, thereby eliminating the overall offset of ambient light.
[0048] Sub-step S42: Divide the brightness feature value of the latest frame by the maximum value to obtain the normalized brightness feature value of the latest frame. It's important to note that normalization essentially converts the absolute brightness value of the current frame into a relative value relative to recent ambient light levels. Since ambient light changes gradually over time (on milliseconds or even seconds), and the screen flicker frequency is 30Hz (approximately 33ms per frame), the ambient light level remains almost constant between adjacent frames. Therefore, the maximum value in the previous sequence accurately reflects the current ambient light reference level. By dividing the current frame's brightness feature value by this maximum value, the normalized result falls within the range of 0 to 1. This value describes the relative brightness of the current frame relative to its recent brightest state, not its absolute brightness. In this way, regardless of whether the environment is bright or dark, the normalized brightness state of the screen is close to 1, and the normalized dark state is close to 0. The transition pattern maintains a consistent representation under different lighting conditions. Subsequent models do not need to concern themselves with the absolute intensity of ambient light; they only need to determine the trend of this relative value, thus completely eliminating the impact of ambient light differences on decoding.
[0049] Sub-step S43: Discard the oldest frame in the normalized previous luminance time sequence, add the normalized luminance feature value of the latest frame to the normalized previous luminance time sequence, and obtain the normalized current luminance time sequence.
[0050] It should be noted that the temporal classification model requires a fixed length for the normalized luminance temporal sequence (N in this embodiment, such as 30 frames). For each new image frame acquired, the normalized luminance feature value of that frame is added to the end of the normalized luminance temporal sequence of the previous frame, while the oldest frame in the sequence is discarded, ensuring the sequence always contains data from the most recent N frames. This guarantees that the data dimension of the model's input is fixed each time, and that the normalized luminance temporal sequence always contains the latest luminance change information, enabling the model to track the screen brightness fluctuations in real time and providing a foundation for subsequent frame-by-frame code output.
[0051] Step 204: Input the normalized luminance time sequence into the pre-trained time classification model to obtain the current code, and the code sequence is composed of the code corresponding to each frame image. It should be noted that the task of the temporal classification model is to classify and determine the code corresponding to the current frame in the normalized luminance temporal sequence. Specifically, the model input is a normalized luminance temporal sequence of length N, and the output is the probability distribution of whether the code corresponding to the current frame is 0 or 1. During the training phase, the model has learned a large number of luminance transition patterns under various lighting conditions and noise environments, and can identify the code corresponding to the rising edge (from dark to bright) and falling edge (from bright to dark) in the luminance temporal sequence. Since the model's decision is based on the contextual information of N consecutive frames (i.e., the luminance change trend of consecutive frames), rather than the absolute value of a single frame, even if the luminance value of a certain frame deviates from the ideal value due to ambient light fluctuations or imaging noise, as long as the overall transition trend is correct, the model can still make an accurate decision, thus exhibiting good robustness to fluctuations in single-frame imaging quality.
[0052] It is understandable that the above normalization processing can be performed either frame-by-frame in real time, or by acquiring the complete image sequence first and then processing it uniformly. In real-time mode, normalization of each frame is completed and the normalized brightness time sequence is updated after each frame is acquired. Then, it is immediately input into the model for inference, and symbols are output frame by frame. Its advantage is that it processes while acquiring images, with low memory usage and low latency, making it suitable for resource-constrained IoT devices. In offline mode, all frame images are acquired and cached first, and then normalization and model inference are performed uniformly. Its advantage is that the implementation logic is simple, but it requires more memory and cannot output symbols in real time, resulting in relatively low efficiency. Those skilled in the art can choose the appropriate method according to the hardware conditions of the device and the application scenario, and this application does not limit this.
[0053] In some embodiments, the temporal classification model includes a cascaded first temporal convolutional layer, a pooling layer, a second temporal convolutional layer, a global average pooling layer, and a fully connected layer. This model structure is deployed in the main control chip of the IoT device, with the number of model parameters controlled within 50KB. It can run entirely in SRAM without external memory access. Step 204 includes the following sub-steps: Sub-step S51: Input the normalized luminance temporal sequence into the first temporal convolutional layer for convolution, extract the local temporal features of luminance changes between adjacent frames, and output the first temporal feature map; It should be noted that the first layer is a one-dimensional temporal convolutional layer with 16 convolutional kernels, each with a size of 5 (meaning each convolutional operation covers 5 consecutive time steps) and a stride of 1. It employs causal convolution (i.e., when outputting the result at position t, it only uses information from the normalized luminance temporal sequence up to position t, without incorporating information from future frames). This layer performs convolution operations on the normalized luminance temporal sequence to extract local temporal features of luminance changes between adjacent frames, including four types: rising edge (the process of changing from dark to bright), falling edge (the process of changing from bright to dark), sustained high level (luminance values close to 1 for multiple consecutive frames), and sustained low level (luminance values close to 0 for multiple consecutive frames). The activation function is ReLU (setting negative values to 0 and keeping positive values unchanged).
[0054] Sub-step S52: Input the first temporal feature map into the pooling layer for max pooling downsampling, and output the pooled feature map; It should be noted that the second layer is a one-dimensional max pooling layer with a pooling kernel size of 2 and a stride of 2. That is, the maximum value of the feature values of each two adjacent time steps is taken as the output. The role of pooling is to compress the data dimension, reduce the amount of computation, and at the same time make the model robust to small shifts in local temporal positions (even if there is a ±1 frame shift in the rising edge on the time axis, the same feature response can still be triggered after pooling).
[0055] Sub-step S53: Input the pooled feature map into the second temporal convolutional layer for convolution, extract the brightness temporal combination features, and output the second temporal feature map; It should be noted that the third layer is the second layer, a one-dimensional temporal convolutional layer, configured with 32 convolutional kernels, a kernel size of 3, a stride of 1, and the activation function ReLU. This layer, based on the local patterns extracted by the first layer, extracts higher-order temporal combination features. For example, it identifies a composite pattern of a rising edge followed by a sustained high level as a marker for a specific bit, and a falling edge followed by a sustained low level as another type of marker.
[0056] Sub-step S54: Input the second temporal feature map into the global average pooling layer and perform global averaging along the temporal dimension to aggregate it into a global feature vector that characterizes the overall brightness change trend. It should be noted that the fourth layer is the global average pooling layer. This layer averages all values of each feature channel along the temporal dimension. The role of global average pooling is to aggregate the global information of the entire temporal window into a feature vector, replacing the flattening operation in the traditional fully connected network. This greatly reduces the number of parameters and is less prone to overfitting, making it particularly suitable for deployment on resource-constrained MCUs.
[0057] In sub-step S55, the global feature vector is input into the fully connected layer, and the probability distribution of the output symbol being 0 or 1 is determined to identify the current symbol. The symbol sequence is composed of the symbols corresponding to each frame image.
[0058] It should be noted that the fifth layer is a fully connected layer (i.e., a linear layer). The linear output is calculated through the weight matrix and bias term, and then mapped to a probability distribution through the Softmax activation function. The values of the two output nodes represent the probability that the code corresponding to the center frame of the current sliding window is 0 and the probability that it is 1, respectively. The sum of the two is equal to 1. Here, code 0 represents that the screen area is currently in a low brightness state (i.e., dark state), and code 1 represents that the screen area is currently in a high brightness state (i.e., bright state). The code sequence output by the model at this stage describes the brightness state corresponding to each frame of the image. For example, when the output is [0.15, 0.85], the current code is determined to be 1. The code sequence is composed of the code corresponding to each frame of the image.
[0059] The aforementioned temporal classification model models the brightness change trend of multiple consecutive frames through a one-dimensional temporal convolution structure, effectively utilizing historical frame information. This allows the decision of the current frame to be based on the context of the preceding and following frames rather than the brightness value of a single frame. Even when a single frame is blurred or interfered with, it can still make an accurate decision based on the overall change trend, thereby improving the robustness of edge detection.
[0060] Step 205: Detect the transition edges in the symbol sequence to obtain the bit stream; decode the bit stream to obtain the distribution network information, and perform distribution network based on the distribution network information.
[0061] In some embodiments, step 205 includes the following sub-steps: Sub-step S61: Perform Manchester decoding on the symbol sequence, mapping adjacent bit pairs 01 to bit 0 and 10 to bit 1 to obtain a bit stream; It's important to note that the principle of Manchester encoding is as follows: the sending end encodes the original bit 0 as 01 (dark-to-light transition) and the original bit 1 as 10 (light-to-dark transition). Therefore, each original bit corresponds to two code elements, and the information is carried in the transition direction of the code elements. During decoding, adjacent code elements in the code element sequence are read pair by pair, restoring 01 to bit 0 and 10 to bit 1. If either 00 or 11 appears (in Manchester encoding, each original bit must correspond to one transition, and two consecutive identical states will not occur), then the current frame is determined to have a physical layer bit error, and the decoding result of that frame is marked as invalid and discarded.
[0062] Sub-step S62: Identify the synchronization header field in the bit stream and extract the valid data after the synchronization header field in the bit stream; It should be noted that the purpose of the synchronization header search is to locate the starting boundary of valid data in the bitstream after Manchester decoding. The decoding module starts from the beginning of the bitstream and searches bit by bit for the preset frame synchronization header field (fixed byte 0xFFAA, binary 1111111110101010). Once a match is found, the end position of the synchronization header is recorded, and valid data payload extraction begins from that position. All data before the synchronization header is discarded, ensuring the integrity and correctness of subsequently extracted data. If the search fails (e.g., due to a transmission error causing the synchronization header to be corrupted), the current bitstream is discarded, and the system waits for the next frame of valid data, thus triggering a retry mechanism in a timely manner and improving the overall efficiency of the distribution network process.
[0063] Sub-step S63: Perform CRC verification on the valid data. After the verification passes, decode and restore the SSID and password.
[0064] It should be noted that CRC checksum is used to verify the integrity and correctness of valid data. The decoding module extracts the data portion and the CRC checksum appended to the end of the valid data payload, recalculates the checksum value of the data portion according to a preset CRC algorithm, and compares it with the extracted checksum. If they match, the verification passes, and the SSID and password in the valid data payload are successfully restored; if the comparison fails, it indicates that there is a bit error during transmission, the current decoding result is discarded, the device returns to continuous acquisition state, and waits to receive the next round of complete data frames.
[0065] After receiving the restored network configuration information, namely the SSID and password, the network configuration management module invokes the device's Wi-Fi module. The Wi-Fi module first scans for surrounding wireless networks, matching the scanned SSID list with the received target SSID. Upon successful matching, the Wi-Fi module uses the password to initiate authentication and association requests, completing the connection with the home Wi-Fi router. After a successful connection, the device's Wi-Fi module obtains an IP address assigned by the router, and the device officially connects to the internet, completing the network configuration.
[0066] Simultaneously, the network configuration management module sends a successful network configuration confirmation message to the mobile app via the newly established Wi-Fi connection. This message includes the device's unique identifier and network configuration status code. Upon receiving this message, the mobile app displays a network configuration completion notification. The device also provides visual feedback via LED indicators: for example, when the camera successfully detects the screen area but has not yet completed full decoding, the device's built-in green LED flashes slowly at a frequency of 1Hz to indicate to the user that decoding is in progress; after a successful Wi-Fi connection, the LED switches to a constant on state, indicating that network configuration is complete.
[0067] At this point, the entire IoT device configuration process is complete. The device has successfully connected to the target Wi-Fi network, and users can remotely control and interact with the device via a mobile app.
[0068] Figure 3 This is a schematic diagram of the structure of an IoT device distribution network device provided in an embodiment of this application, such as... Figure 3 As shown, the device 300 specifically includes the following modules: The image acquisition unit 301 is used to acquire an image sequence containing the screen of the user terminal. The brightness jump of the screen area in the image sequence corresponds to a bit stream, and the bit stream is determined by the user terminal based on the distribution network information. The feature extraction unit 302 is used to extract the brightness feature values of pixels within the screen area of each frame of the image sequence to obtain a brightness time sequence. In some embodiments, the feature extraction unit 302 extracts the brightness feature values of pixels within the screen area of each frame of the image sequence to obtain a brightness time sequence, including: Calculate the inter-frame difference value at the same pixel position between consecutive preset frame images in an image sequence; Based on the cumulative value of the inter-frame difference corresponding to each pixel position in the image sequence, the connected regions where the cumulative value of the inter-frame difference exceeds a preset threshold are determined, and the connected regions are determined as screen regions. The average grayscale value of all pixels within the screen area of each frame in the image sequence is calculated and used as the brightness feature value of the frame image.
[0069] In some embodiments, the feature extraction unit 302 is further configured to extract the brightness feature values of pixels in the screen area of each frame of the image sequence, obtain a brightness time sequence, and then perform digital bandpass filtering on the brightness time sequence.
[0070] The symbol generation unit 303 is used to generate a symbol sequence based on the brightness timing sequence; one symbol in the symbol sequence corresponds one-to-one with one brightness feature value in the brightness timing sequence. In some embodiments, the symbol generation unit 303 performs the function of generating a symbol sequence based on a luminance timing sequence, including: Obtain the luminance feature value of the latest frame in the current luminance time sequence, the maximum value of all luminance feature values in the previous luminance time sequence, and the normalized previous luminance time sequence; Divide the brightness feature value of the latest frame by the maximum value to obtain the normalized brightness feature value of the latest frame; Discard the oldest frame in the normalized previous luminance time sequence, add the normalized luminance feature value of the latest frame to the normalized previous luminance time sequence, and obtain the normalized current luminance time sequence. The normalized current luminance time sequence is input into a pre-trained time classification model to obtain the current code, and the code sequence is composed of the code corresponding to each frame image.
[0071] In some embodiments, the symbol sequence is obtained by a pre-trained temporal classification model that extracts and classifies the brightness change patterns in the brightness temporal sequence. The temporal classification model includes a cascaded first temporal convolutional layer, a pooling layer, a second temporal convolutional layer, a global average pooling layer, and a fully connected layer. The symbol generation unit 303 generates the symbol sequence based on the brightness temporal sequence, including: The luminance temporal sequence is input into the first temporal convolutional layer for convolution, and local temporal features of luminance changes between adjacent frames are extracted to output the first temporal feature map. The first temporal feature map is input into the pooling layer for max pooling downsampling, and the pooled feature map is output. The pooled feature map is input into the second temporal convolutional layer for convolution, and the brightness temporal combination features are extracted and the second temporal feature map is output. The second temporal feature map is input into the global average pooling layer and globally averaged along the temporal dimension, and aggregated into a global feature vector to characterize the overall brightness change trend. The global feature vector is input into the fully connected layer, and the probability distribution of the output symbol being 0 or 1 is used to determine the current symbol. The symbol sequence is composed of the symbols corresponding to each frame of the image.
[0072] The decoding distribution unit 304 is used to detect the transition edges in the symbol sequence to obtain the bit stream; decode the bit stream to obtain the distribution information, and perform distribution based on the distribution information.
[0073] In some embodiments, the decoding of the bit stream performed by the decoding distribution unit 304 to obtain distribution information includes: Identify the synchronization header field in the bitstream; Extract the valid data after the synchronization header field from the bitstream; Decode the valid data to obtain the distribution network information.
[0074] In some embodiments, the device 300 further includes a deviation correction unit 305 for performing the following steps before the image sequence is acquired by the camera and the image sequence containing the user terminal screen is acquired: The training image sequence sent by the user terminal is acquired. The brightness of the training image sequence is generated by the user terminal according to a preset transition mode. The actual transition points of the training image sequence are detected, and the phase deviation value is determined based on the time deviation between the preset transition point and the actual transition point corresponding to the preset transition mode. Based on the phase deviation value, the preset sampling time of the camera is compensated to obtain the target sampling time, and the image sequence of the user terminal screen is acquired at the target sampling time.
[0075] The IoT device network configuration device in this application embodiment can be an independent device, or a component, integrated circuit, or chip in a terminal. This device can be a mobile electronic device or a non-mobile electronic device. For example, mobile electronic devices can be mobile phones, tablets, laptops, handheld terminals, in-vehicle electronic devices, wearable devices, ultra-mobile personal computers (UMPCs), netbooks, or personal digital assistants (PDAs), etc., while non-mobile electronic devices can be servers, network-attached storage (NAS), personal computers (PCs), televisions (TVs), ATMs, or self-service machines, etc. This application embodiment does not impose specific limitations.
[0076] The IoT device distribution device in this application embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit the specific operating system used.
[0077] The IoT device network distribution device provided in this application embodiment can realize all the processes implemented by the IoT device network distribution device in the above method embodiment. To avoid repetition, it will not be described again here.
[0078] This application also provides an electronic device, including: a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, it implements the various processes of the above-described IoT device network distribution method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0079] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.
[0080] This application also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the various processes of the above-described IoT device network configuration method embodiments and achieves the same technical effect. To avoid repetition, it will not be described again here.
[0081] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0082] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0083] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0084] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. A method for configuring IoT devices on a network, characterized in that, Applied to IoT devices, including: Acquire an image sequence containing the user terminal screen, wherein brightness jumps in the screen area of the image sequence correspond to a bit stream, and the bit stream is determined by the user terminal based on distribution network information; The brightness feature values of pixels within the screen area of each frame of the image sequence are extracted to obtain a brightness time sequence; A symbol sequence is generated based on the brightness time sequence; one symbol in the symbol sequence corresponds one-to-one with one brightness feature value in the brightness time sequence. Detect the transition edges in the symbol sequence to obtain the bit stream; decode the bit stream to obtain the distribution network information, and perform distribution network based on the distribution network information.
2. The IoT device network configuration method according to claim 1, characterized in that, Extracting the luminance feature values of pixels within the screen area of each frame in the image sequence to obtain a luminance temporal sequence, including: Calculate the inter-frame difference value at the same pixel position between consecutive preset frame images in the image sequence; Based on the cumulative value of the inter-frame difference value corresponding to each pixel position in the image sequence, a connected region whose cumulative value of the inter-frame difference value exceeds a preset threshold is determined, and the connected region is determined as a screen region. The average grayscale value of all pixels within the screen area of each frame in the image sequence is calculated and used as the brightness feature value of the frame image.
3. The IoT device network configuration method according to claim 1, characterized in that, Based on the brightness timing sequence, a symbol sequence is generated, including: Obtain the luminance feature value of the latest frame in the current luminance time sequence, the maximum value of all luminance feature values in the previous luminance time sequence, and the normalized previous luminance time sequence; Divide the brightness feature value of the latest frame by the maximum value to obtain the normalized brightness feature value of the latest frame; Discard the oldest frame in the normalized previous luminance time sequence, and add the normalized luminance feature value of the latest frame to the normalized previous luminance time sequence to obtain the normalized current luminance time sequence. The normalized current luminance time sequence is input into a pre-trained time classification model to obtain the current code, and the code sequence is composed of the code corresponding to each frame image.
4. The IoT device network configuration method according to claim 1, characterized in that, After extracting the brightness feature values of pixels within the screen area of each frame of the image sequence to obtain a brightness time sequence, the method further includes: The brightness time sequence is subjected to digital bandpass filtering.
5. The IoT device network configuration method according to claim 1, characterized in that, The image sequence is acquired by a camera. Before acquiring the image sequence containing the user terminal screen, the method further includes: Acquire a training image sequence sent by a user terminal, wherein the brightness of the training image sequence is generated by the user terminal according to a preset transition mode; The actual transition points of the training image sequence are detected, and the phase deviation value is determined based on the time deviation between the preset transition point corresponding to the preset transition mode and the actual transition point. Based on the phase deviation value, the preset sampling time of the camera is compensated to obtain the target sampling time, and an image sequence of the user terminal screen is acquired at the target sampling time.
6. The IoT device network configuration method according to claim 1, characterized in that, The symbol sequence is obtained by a pre-trained temporal classification model that extracts and classifies the brightness change patterns in the brightness temporal sequence. The temporal classification model includes a cascaded first temporal convolutional layer, a pooling layer, a second temporal convolutional layer, a global average pooling layer, and a fully connected layer. Based on the brightness timing sequence, a symbol sequence is generated, including: The brightness temporal sequence is input into the first temporal convolutional layer for convolution, local temporal features of brightness changes between adjacent frames are extracted, and the first temporal feature map is output. The first temporal feature map is input into the pooling layer for max pooling downsampling, and the pooled feature map is output. The pooled feature map is input into the second temporal convolutional layer for convolution, and the brightness temporal combination features are extracted to output the second temporal feature map. The second temporal feature map is input into the global average pooling layer and globally averaged along the temporal dimension to aggregate into a global feature vector that characterizes the overall brightness change trend. The global feature vector is input into the fully connected layer, and the probability distribution of the output symbol being 0 or 1 is used to determine the current symbol. The symbol sequence is composed of the symbols corresponding to each frame image.
7. The IoT device network configuration method according to claim 1, characterized in that, The bit stream is determined by the user terminal encoding the synchronization header field and the distribution network information. Decoding the bitstream to obtain the network distribution information includes: Identify the synchronization header field in the bit stream; Extract the valid data after the synchronization header field from the bit stream; The valid data is decoded to obtain the distribution network information.
8. A network distribution device for Internet of Things (IoT) devices, characterized in that, include: An image acquisition unit is used to acquire an image sequence containing the screen of a user terminal, wherein the brightness jumps of the screen area in the image sequence correspond to a bit stream, and the bit stream is determined by the user terminal based on the distribution network information. The feature extraction unit is used to extract the brightness feature values of pixels within the screen area of each frame of the image sequence to obtain a brightness time sequence. The symbol generation unit is used to generate a symbol sequence based on the brightness timing sequence; One symbol in the symbol sequence corresponds one-to-one with one brightness feature value in the brightness timing sequence; A decoding network unit is used to detect transition edges in the symbol sequence to obtain a bit stream; The bit stream is decoded to obtain the distribution network information, and distribution network is performed based on the distribution network information.
9. An electronic device, characterized in that, It includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the IoT device network configuration method as described in any one of claims 1 to 7.
10. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the IoT device network configuration method as described in any one of claims 1 to 7.