Method and device applicable to touch display screen for replacement
Through integrated protocol adaptation, signal synchronization optimization and intelligent image repair, the problems of poor protocol compatibility, insufficient signal synchronization reliability and image quality deterioration after mobile phone display screen replacement are solved, achieving a more efficient maintenance process and a better user experience.
Patent Information
- Application Number
- CN202510445277.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-10
- Publication Date
- 2025-05-09
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the mobile phone display replacement and maintenance scenario, the existing technology faces the problems of poor protocol compatibility, insufficient signal synchronization reliability and deterioration of image quality, resulting in low maintenance efficiency and poor user experience.
Through a comprehensive technical solution of integrated protocol adaptation, signal synchronization optimization and intelligent image repair, including dynamic matching of communication protocols in the protocol adaptation stage, buffering mechanism and error monitoring in the signal synchronization stage, brightness mapping and cross-frame repair technology in the image optimization stage.
It realizes enhanced protocol compatibility, improved signal transmission reliability and image quality optimization after display screen replacement, achieving dual improvements in display effect and maintenance efficiency.
Smart Images

Figure CN119967067A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of display screen repair, and relates to an applicable method and device for replacing a touch display screen. Background Art
[0002] In the scenario of replacing and repairing mobile phone display screens, the repair and replacement cost of the original screen is high, and there is no choice for users. The replacement cost is high, but the existing technology of replacement screens faces a problem, that is, the display screen is not compatible with the mobile phone. This incompatibility is mainly caused by three reasons. First, the protocol compatibility is poor. Display screens of different manufacturers / models use differentiated communication protocols (such as I2C, SPI, MIPI), which require manual configuration of protocol parameters, which is inefficient and prone to errors. The compatibility only covers about 65% of mainstream display screens; second, the signal synchronization reliability is insufficient. The original signal of the mobile phone does not match the timing specifications of the replaced display screen (such as line / field synchronization frequency). The traditional fixed phase-locked loop solution cannot be adjusted dynamically, resulting in image tearing, freezing and a transmission error rate of up to 0.5%; third, the image quality is severely degraded. Due to differences in driving parameters or physical damage to the cable, uneven brightness, color distortion and partial image loss are prone to occur after replacement. Existing single-frame repair algorithms (such as Photoshop content recognition) cannot effectively restore cross-frame correlation, and global color correction causes distortion of key scenes such as human skin color. The above problems seriously restrict maintenance efficiency and user experience, and there is an urgent need for a comprehensive solution that integrates protocol self-adaptation, signal synchronization optimization and image intelligent repair. Summary of the invention
[0003] The present invention provides a method and device for replacing a touch display screen. Through dynamic matching of communication protocols in the protocol adaptation stage, buffering mechanism and error monitoring in the signal synchronization stage, and brightness mapping and cross-frame repair technology in the image optimization stage, the protocol compatibility after the display screen is replaced is enhanced, the signal transmission reliability is improved, and the image quality is optimized, thereby achieving the dual purpose of improving display effect and maintenance efficiency.
[0004] In order to achieve the above object, the present invention adopts the following technical solutions: A method for replacing a touch display screen, comprising: S1, protocol adaptation; In response to the electrical signal triggered by the display screen access, analyze its communication protocol characteristics and match the target protocol; Obtain identification parameters of the display screen and generate a protocol configuration including timing rules and display parameters; S2, signal synchronization; Adjusting the signal transmission specification according to the protocol configuration, wherein the adjusting the signal transmission specification according to the protocol configuration includes level conversion and timing synchronization; Transmit data through a buffering mechanism and monitor the transmission process for errors; S3, image optimization; Dynamically adjust image brightness distribution based on display parameters; Repairs missing areas in image data and corrects output colors.
[0005] Furthermore, in response to the electrical signal triggered by the display screen access, parsing its communication protocol characteristics and matching the target protocol includes: S11, trigger signal detection, monitoring the level jump signal of at least one GPIO pin, the jump sequence is low level, high level, low level, the duration is 50 milliseconds ± 10 milliseconds, the high level voltage is ≥ 2.7V, and the low level voltage is ≤ 0.4V; S12, protocol feature analysis, based on the communication signal captured by the GPIO pin, extract at least one of the following features: Clock frequency range, 100kHz to 400kHz, or greater than or equal to 1MHz; Data frame structure, 7-bit address frame or SPI data packet including start bit / stop bit; Control signal combination, periodic chip select signal or MIPI DSI LP mode start code 0xB8; S13: Protocol matching decision, activating the corresponding communication protocol driver according to the parsed protocol features.
[0006] Furthermore, the protocol matching decision activates the corresponding communication protocol driver according to the parsed protocol features, including: When the clock frequency is detected to be between 100kHz and 400kHz and the data frame contains a 7-bit address, it is determined to be an I2C protocol; When a continuous clock signal ≥ 1MHz and a periodic chip select signal are detected, it is determined to be an SPI protocol; When the control signal waveform includes a preset start code, it is determined to be the MIPI protocol.
[0007] Furthermore, the data is transmitted through a buffer mechanism and error monitoring is performed during the transmission process, including: S21, buffer initialization, allocating storage space for double buffers, with a single buffer capacity of 256KB to 1MB; S22, data writing, writing the synchronized image data into the current buffer row by row, triggering switching when 70% to 90% of the capacity is filled or the timeout is 0.5ms to 2ms; S23, error monitoring, adding CRC-16-CCITT check code to the transmitted data, triggering retransmission when the check fails, with a maximum of 3 retransmission times; S24: Protocol rematching. If verification fails for three consecutive times, return to S1 to rematch the protocol.
[0008] Furthermore, dynamically adjusting the image brightness distribution based on the display parameters includes: S31, extracting brightness component, converting the input RGB data into YUV format, and extracting brightness component Y; S32, histogram statistics, counting the brightness distribution histogram H(i) of the current frame, and calculating the cumulative probability density; S33, segment mapping, dynamically adjusting the brightness value according to the formula; ; in, is the input brightness value, is the output brightness value.
[0009] S34, parameter update, according to the maximum brightness in the protocol configuration and Minimum brightness dynamic calibration map parameters.
[0010] Furthermore, the repairing of the missing image area includes: S35, locating the missing area, identifying the damaged pixel block in the image by using an edge detection algorithm, wherein the edge detection algorithm is a Sobel operator, and the gradient threshold is set to ≥25; S36, reference block retrieval, taking the missing block coordinates of the current frame as the center, slidingly searching for a reference block of 8×8 pixels within the range of ±32 pixels of the adjacent frame; S37, similarity determination, using the structural similarity index SSIM to calculate the similarity between the current block and the reference block, and the SSIM threshold is set to ≥0.85; S38, pixel filling, copy the matched reference block to the missing area, and perform bilinear interpolation on the block edge. The interpolation weight formula is ; Where d is the distance between the current pixel and the boundary of the reference block, D is the side length of the reference block, which is fixed at 8, and w is the interpolation weight.
[0011] A touch display screen application device for replacement, used to execute the touch display screen application method for replacement, comprising: The protocol adapter module is used to detect the GPIO level jump signal triggered by the display screen access, analyze the communication protocol characteristics and match the target protocol, and generate the protocol configuration; A signal synchronization module, connected to the protocol adapter module, performs signal level conversion, timing adjustment, and double-buffered data transmission; The image optimization module is connected to the signal synchronization module to perform brightness mapping, cross-frame restoration and color correction; The data bus transmits protocol configuration, image data and feedback signals, forming a closed-loop link from protocol matching to image output.
[0012] Furthermore, the protocol adaptation module includes: Trigger detection unit, response time is less than or equal to 10ns, monitoring low level, high level, low level transition; Protocol decision unit, built-in I2C / SPI / MIPI protocol feature library, matching logic includes clock frequency, data frame or control signal.
[0013] Furthermore, the signal synchronization module includes: Level converter, supporting 1.8V / 3.3V output, delay less than or equal to 10ns; Double buffer controller, buffer capacity 256KB-1MB, switching threshold 70%-90% or timeout 0.5ms-2ms; CRC-16-CCITT checker, triggers less than or equal to 3 retransmissions.
[0014] Furthermore, the image optimization module includes: Brightness mapping engine, dynamically adjusts brightness according to a segmented formula; Cross-frame inpainting unit, search ±32 pixel range, fill 8×8 reference block when SSIM≥0.85, edge interpolation weight , where d is the distance between the current pixel and the reference block boundary, D is the side length of the reference block, which is fixed at 8, and w is the interpolation weight; Color correction unit, loads the color gamut matrix and dynamically limits the gamma value.
[0015] Beneficial effects of the present invention: This application effectively solves the problems of poor protocol compatibility, insufficient signal synchronization reliability and image quality degradation after display screen replacement through a comprehensive technical solution integrating protocol adaptation, signal synchronization optimization and intelligent image repair. In the protocol adaptation stage, by automatically detecting the electrical signal triggered by display screen access and parsing the communication protocol characteristics, dynamically matching the target protocol type (such as I2C, SPI or MIPI), generating a protocol configuration containing timing rules and display parameters, significantly improving the protocol compatibility range and reducing the manual configuration cost; in the signal synchronization stage, adjusting the signal transmission specifications based on the protocol configuration, dynamically managing data transmission through the buffer mechanism and performing real-time error monitoring, and combining the CRC check retransmission mechanism to ensure signal integrity and transmission stability; in the image optimization stage, using the brightness distribution dynamic mapping algorithm and cross-frame association repair technology, combined with the color gamut matrix to correct the output color, ensure that the brightness uniformity, detail restoration and color accuracy of the display screen after replacement meet the original screen standard. At the device level, through the hardware collaboration of the protocol adaptation module, signal synchronization module and image optimization module, the data bus forms a closed-loop processing link from protocol matching to image output, realizing full-process automated adaptation and optimization, greatly improving maintenance efficiency and user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 It is a schematic diagram of the overall process method steps of the present invention.
[0017] Figure 2 It is a detailed process diagram of step S1 of the present invention.
[0018] Figure 3 It is a detailed process diagram of step S2 of the present invention.
[0019] Figure 4 It is a schematic diagram of a detailed process method for dynamically adjusting image brightness distribution based on display parameters in step S3 of the present invention.
[0020] Figure 5 It is a schematic diagram of a detailed process method for repairing the missing area of the image in step S3 of the present invention. DETAILED DESCRIPTION
[0021] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. It should be understood that the present application is not limited to the example embodiments disclosed herein. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0022] In the description of the present invention, it should be understood that the terms "length", "width", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc., indicating the orientation or position relationship are based on the orientation or position relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention.
[0023] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0024] In the embodiments of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0025] In the scenario of replacing and repairing mobile phone display screens, the existing technology faces a problem, that is, the display screen is not compatible with the mobile phone. This incompatibility is mainly caused by three reasons. First, the protocol compatibility is poor. Display screens of different manufacturers / models use differentiated communication protocols (such as I2C, SPI, MIPI), which require manual configuration of protocol parameters, which is inefficient and prone to errors. The compatibility only covers about 65% of mainstream display screens. Second, the signal synchronization reliability is insufficient. The original signal of the mobile phone does not match the timing specifications of the replaced display screen (such as line / field synchronization frequency). The traditional fixed phase-locked loop solution cannot be adjusted dynamically, resulting in image tearing, freezing and transmission error rates as high as 0.5%. Third, the image quality is seriously degraded. Due to differences in driving parameters or physical damage to the cable, uneven brightness, color distortion and partial image loss are prone to occur after replacement. The existing single-frame repair algorithm (such as Photoshop content recognition) cannot effectively restore cross-frame correlation, and global color correction causes distortion of key scenes such as human skin color. The above problems seriously restrict the repair efficiency and user experience. A comprehensive solution integrating protocol self-adaptation, signal synchronization optimization and image intelligent repair is urgently needed. In addition, for display screens with integrated touch functions (i.e., integrated touch display modules), existing adaptation solutions have more complex compatibility issues. Since the touch function and display driver use independent communication protocols (such as I2C touch chip protocol or SPI touch data bus), additional touch protocol parameters need to be configured after replacing the display screen, and the timing synchronization requirements for touch signals and display signals are higher. Traditional solutions often require separate debugging of display and touch modules, resulting in increased risk of protocol conflicts (such as I2C address overlap), touch response delay (≥20ms), and offset between touch coordinates and display content, further reducing user experience.
[0026] The present invention provides Figures 1 to 5 In an embodiment of the present invention, a touch screen application method for replacement includes: S1, protocol adaptation; In response to the electrical signal triggered by the display screen access, analyze its communication protocol characteristics and match the target protocol; Obtain identification parameters of the display screen and generate a protocol configuration including timing rules and display parameters; S2, signal synchronization; Adjust signal transmission specifications according to protocol configuration, including level conversion and timing synchronization; Transmit data through a buffering mechanism and monitor the transmission process for errors; S3, image optimization; Dynamically adjust image brightness distribution based on display parameters; Repairs missing areas in image data and corrects output colors.
[0027] Specifically, in the display adaptation process after the display screen is replaced, the level jump signal of the specific GPIO pin when the display screen is connected is first detected by the protocol adaptation module, that is, the electrical signal, which triggers the protocol matching process. Then, the protocol features from the display screen communication interface are parsed, including the clock frequency, data frame structure and control signal combination, and the target protocol type (such as I2C, SPI or MIPI) is matched based on the preset protocol template library, and the identification parameters stored in the display screen are read to generate the protocol configuration, which includes timing rules and display parameters. Subsequently, the signal synchronization module adjusts the signal level to the required specifications of the target protocol according to the protocol configuration, dynamically calibrates the row synchronization and field synchronization timing, transmits the image data through the double buffering mechanism, and monitors the data stream for real-time errors during the transmission process. When a check error is detected, the retransmission mechanism is triggered to ensure data integrity. Finally, the image optimization module dynamically maps the brightness distribution of the input image based on the display parameters in the protocol configuration, locates and repairs the missing image area by analyzing the pixel correlation of adjacent frames, and loads the color gamut matrix matching the target display screen to correct the output color, ensuring that the replaced display screen achieves the same visual effect as the original screen in terms of brightness uniformity, detail restoration and color accuracy. The entire process uses the data bus to achieve efficient transmission of protocol configuration, synchronization signals and image data between modules, forming a closed-loop processing link from protocol matching to image output.
[0028] The step of responding to the electrical signal triggered by the display screen access, parsing the communication protocol characteristics thereof and matching the target protocol comprises: S11, trigger signal detection, monitoring the level jump signal of at least one GPIO pin, the jump sequence is low level, high level, low level, the duration is 50 milliseconds ± 10 milliseconds, the high level voltage is ≥ 2.7V, and the low level voltage is ≤ 0.4V; In step S11, the level transition waveform of the GPIO1 pin is obtained (low→high→low, duration 50ms±10ms, high level voltage ≥2.7V, low level voltage ≤0.4V); The voltage comparator is used to capture the level jump in real time. The trigger condition is two consecutive low→high→low jumps, and the high level duration is between 40ms and 60ms. Use a hardware timer (such as STM32 TIM2) to record the transition interval, and set the timeout threshold to 50ms±10ms; Trigger flag signal (high level valid) to activate the protocol parsing process.
[0029] S12, protocol feature analysis, based on the communication signal captured by the GPIO pin, extract at least one of the following features: Clock frequency range, 100kHz to 400kHz, or greater than or equal to 1MHz; Data frame structure, 7-bit address frame or SPI data packet including start bit / stop bit; Control signal combination, periodic chip select signal or MIPI DSI LP mode start code 0xB8; In step S12, the clock frequency measurement includes: Get the clock waveform of GPIO pin or GPIO3; Use the MCU's input capture unit (such as STM32 TIM3) to count the number of clock rising edges N within 1ms and calculate the frequency ; like , marked as an I2C protocol candidate; if , marked as SPI protocol candidate.
[0030] In step S12, data frame structure identification includes: Get continuous data packets of GPIO2 pin and GPIO3 pin; I2C frame parsing: detect the start bit (SDA falling edge + SCL high level), 7-bit address (binary sequence) and stop bit (SDA rising edge + SCL high level) through the state machine; SPI parsing: After detecting the falling edge of the chip select signal (GPIO4 pin), read the MOSI / MISO data stream and match the start bit 0xAA and the stop bit 0x55.
[0031] In step S12, the control signal is analyzed: Get the periodic chip select signal of the GPIO4 pin or the LP mode start code 0xB8 of the MIPI DSI; Perform FFT analysis on the GPIO4 pin signal to extract the fundamental frequency and duty cycle; If three consecutive 0xB8 bytes (binary 10111000) are detected, it is determined to be the MIPI protocol.
[0032] Furthermore, in step S12 protocol feature analysis, additional touch protocol features are extracted, including the I2C address of the touch chip (such as 0x38), the check bit format of the touch data packet (such as CRC-8), and the touch sampling rate (such as 100Hz). If the touch protocol features are detected, the touch timing rules (such as interrupt trigger cycle) and coordinate mapping parameters are synchronously generated in the protocol configuration.
[0033] S13: Protocol matching decision, activating the corresponding communication protocol driver according to the parsed protocol features.
[0034] In step S13, the protocol matching decision is: I2C protocol: if and only if both meet And when a 7-bit address frame is detected, the I2C driver is activated.
[0035] SPI protocol: if and only if And the chip select signal duty cycle Activate the SPI driver.
[0036] MIPI protocol: When the LP mode start code 0xB8 is detected, the MIPI driver is activated.
[0037] The data is transmitted through a buffer mechanism and error monitoring is performed during the transmission process, including: S21, buffer initialization, allocating storage space for double buffers, with a single buffer capacity of 256KB to 1MB; In step S21, the buffer is initialized and the storage space of the double buffer is allocated, including: Memory allocation: Buffer 0 address: 0x8000-0x9FFFF (512KB); Buffer 1 address: 0xA000-0xBFFFF (512KB).
[0038] Pointer settings: The write pointer is initialized to 0x8000 (buffer 0 start address); The read pointer is initialized to 0xA000 (the starting address of buffer 1).
[0039] S22, data writing and switching, writing the synchronized image data into the current buffer row by row, triggering switching when 70% to 90% of the capacity is filled or the timeout is 0.5ms to 2ms; In step S22, data writing and switching include: Input data format: Image data is transmitted line by line, with each line containing 2KB of data (RGB888 format, resolution 1920×1080, 1920 pixels per line × 3 bytes).
[0040] Write logic: The synchronized image data is written into the current write buffer line by line. The write pointer increases by 2KB for each line written.
[0041] Switching conditions: Capacity threshold: When the write pointer offset is ≥409KB (80%×512KB), the switch is triggered; Timeout trigger: If the write does not reach the threshold, but the timeout timer reaches 1ms, forced switching occurs.
[0042] Buffer switching: Swap read and write pointers; Reset the write pointer to the new buffer start address and start the next round of writing.
[0043] Furthermore, in the data writing step S22, a time-division multiplexing mechanism is adopted to write the display data and the touch data into the buffer alternately according to the timing configured by the protocol, the priority is set to the instant transmission of the touch data (preemptive writing), and the display data is transmitted in batches by line to ensure the real-time touch response.
[0044] S23, error monitoring, adding CRC-16-CCITT check code to the transmitted data, triggering retransmission when the check fails, with a maximum of 3 retransmission times; In step S23, error monitoring and retransmission include: CRC check algorithm: Input data: 512KB data block in the current read buffer; Calculation process: 1. Initialize the CRC register to 0xFFFF; 2. XOR the data byte by byte and shift right, polynomial 0x1021; 3. The final CRC value is inverted and stored at the end of the data packet.
[0045] Verification failure processing: Retransmission counter +1; If the counter is ≤3, retransmit the current buffer data; If the counter>3, a protocol rematch is triggered (S24).
[0046] Key parameters: CRC polynomial: 0x1021 (ISO / IEC 13239 standard); Maximum number of retransmissions: 3 times; Timeout retransmission interval: 1ms.
[0047] S24: Protocol rematching. If verification fails for three consecutive times, return to S1 to rematch the protocol.
[0048] In step S24, the protocol rematching includes: Trigger condition: 3 consecutive CRC check failures or transmission is not completed due to timeout.
[0049] Feedback mechanism: Send an error code (such as 0xE001) to the protocol adapter module through the feedback bus, reset the protocol configuration parameters, and restart the protocol matching process (S1).
[0050] The dynamically adjusting the image brightness distribution based on the display parameters comprises: S31, extracting brightness component, converting the input RGB data into YUV format, and extracting brightness component Y; In step S31, the brightness component extraction includes: Input data format: RGB888 image data (resolution 1920×1080, 3 bytes per pixel, example values: R=120, G=80, B=60).
[0051] Conversion formula: Y = 0.299R + 0.587G + 0.114B (BT.601 standard) Sample output: Input pixel (R=120, G=80, B=60) → Calculate Y = 0.299×120 + 0.587×80 + 0.114×60 = 93.8.
[0052] S32, histogram statistics, counting the brightness distribution histogram H(i) of the current frame, and calculating the cumulative probability density; Step S32 histogram statistics includes: Initialize 256 brightness value statistical buckets (bin range 0-255); Traverse the Y values of all pixels in the current frame and count the number of pixels H(i) in each bin; Calculate the cumulative probability density ; (N is the total number of pixels) S33, segment mapping, dynamically adjusting the brightness value according to the formula;
[0053] in, is the input brightness value, is the output brightness value.
[0054] Specifically, the output example is as follows: enter , ; enter , .
[0055] Furthermore, in step S33 brightness mapping, the brightness value of the area around the touch point is dynamically increased according to the touch coordinates (such as (x, y)), and the mapping formula is:
[0056] in, The original output brightness value after S33 segment mapping (value range 0-255) It is the final output brightness value after adding touch gain; (x0, y0) is the coordinate of the touch point; (x, y) is the current pixel coordinate It is a Gaussian attenuation function that controls the brightness enhancement range.
[0057] S34, parameter update, according to the maximum brightness in the protocol configuration and Minimum brightness dynamic calibration map parameters.
[0058] Specifically, the dynamic calibration logic includes: According to the protocol configuration and , scale the mapping parameters proportionally;
[0059] in, is the maximum brightness value supported by the display (unit: nit or grayscale value), is the minimum brightness value supported by the display. To input the original brightness value (range 0-255), is the output brightness value after calibration; Map the slope (e.g. 0.8) for the original low brightness area, is the calibrated low brightness area mapping slope, is the original low brightness area threshold (e.g. 50), is the low brightness area demarcation threshold after calibration.
[0060] Furthermore, input brightness Based on the standard range (0-255), but needs to be adapted to the actual brightness range of the display , the dynamic calibration formula is obtained by scaling the original mapping parameters (slope , threshold ), so that the output Take advantage of the display's dynamic range.
[0061] Furthermore, the logic of dynamic calibration is as follows: 1. Normalization of brightness range; Scales the standard brightness range (0-255) to the actual range of the display ( ), the scaling factor is: Scaling factor = ; 2. Parameter adjustment: Slope calibration, raw slope Multiply by the scaling factor to ensure that the brightness change rate after mapping is adapted to the actual brightness range; ; Threshold calibration: original threshold Multiply by the scaling factor so that the cutoff point corresponds to the actual brightness value; Scaling factor; 3. Output brightness calculation: The calibrated segment mapping formula is:
[0062] Offset adjustment: e.g. , to ensure that the dark details are adapted.
[0063] Specific reference examples are as follows: Assume display parameters: Nite, nit; Scaling factor: ; Parameters before calibration: , ; Parameters after calibration: ; ; Input / Output Comparison: Before calibration: → (Standard Range); After calibration: → NEET.
[0064] This embodiment ensures output brightness by dynamic scaling. Always range, avoid overexposure or underexposure, and enhance dark details ( ), High light suppression ( adaptation ), improve display quality, and adapt to the brightness specifications of different displays without manual intervention.
[0065] The repairing of the missing image area comprises: S35, locating the missing area, identifying the damaged pixel block in the image by using an edge detection algorithm, wherein the edge detection algorithm is a Sobel operator, and the gradient threshold is set to ≥25; Specifically, missing area positioning includes: Input data format, RGB888 image data of the current frame (resolution 1920×1080); Sobel edge detection algorithm: Horizontal Gradient : (* indicates convolution operation); Vertical Gradient : (* indicates convolution operation); Gradient amplitude G: ; Missing judgment: If , and continuous Regional gradient anomalies are marked as broken pixel blocks.
[0066] S36, reference block retrieval, taking the missing block coordinates of the current frame as the center, slidingly searching for a reference block of 8×8 pixels within the range of ±32 pixels of the adjacent frame; Specifically, the search range is based on the center coordinates of the missing block in the current frame, and the search is performed within the range of ±32 pixels of the adjacent frames; The sliding step is 1 pixel step, traversing all possible 8×8 candidate blocks.
[0067] S37, similarity determination, using the structural similarity index SSIM to calculate the similarity between the current block and the reference block, and the SSIM threshold is set to ≥0.85; SSIM calculation algorithm: ; in, , is the average brightness of the current block and the reference block, , is the variance, is the covariance, , .
[0068] The judgment condition is that if the SSIM is greater than or equal to 0.85, it is marked as a matching block.
[0069] S38, pixel filling, copy the matched reference block to the missing area, and perform bilinear interpolation on the block edge. The interpolation weight formula is ; Where d is the distance between the current pixel and the boundary of the reference block, D is the side length of the reference block, which is fixed at 8, and w is the interpolation weight.
[0070] In step S38, bilinear interpolation is performed on the block edge, wherein the interpolation calculation includes: Edge pixel processing: Perform bilinear interpolation on the edge pixels of the reference block and the current block, such as: ; in, is the interpolated pixel value, is the brightness or color value of the corresponding pixel in the reference block, is the original value of the corresponding pixel in the current block, is the interpolation weight (range 0 to 0.5).
[0071] Here is an example: When w=0.5 (the pixel is at the edge of the reference block): ; The reference block and the edge pixels of the current block are mixed with equal weights to achieve a smooth transition; When w=0.25 (the pixel is close to the inside of the reference block): ; The current block pixels are dominant, retaining more details; When w=0 (the pixel is outside the reference block): ; The current block pixel value is fully used to avoid introducing external interference.
[0072] A touch display screen application device for replacement, used to execute the touch display screen application method for replacement, comprising: The protocol adapter module is used to detect the GPIO level jump signal triggered by the display screen access, analyze the communication protocol characteristics and match the target protocol, and generate the protocol configuration; Function: Detect the level jump signal triggered by the display screen access, analyze the communication protocol characteristics, and generate protocol configuration.
[0073] The protocol adaptation module includes a trigger detection unit and a protocol decision unit; Trigger detection unit, GPIO1 is connected to the detection pin (Pin 12) of the display interface, configured as edge trigger mode, capturing low→high→low level transition signals (duration 50ms±10ms, high level ≥2.7V, low level ≤0.4V).
[0074] The protocol decision unit reads the manufacturer identifier (address 0x00-0x03) in the display EEPROM through the I2C bus (SCL=GPIO2, SDA=GPIO5); if the reading fails, the SPI protocol is forced to match according to the clock frequency (≥1MHz) of GPIO3 (SCLK clock line) and the duty cycle (50%±5%) of GPIO4 (CS chip select line), and the protocol configuration is generated, and the timing rules, brightness mapping table, and color gamut matrix are stored in the Flash address 0x1000-0x1008.
[0075] Furthermore, the protocol adaptation module further includes a touch protocol parsing unit for matching the communication protocol of the touch chip and generating touch parameters; the signal synchronization module further includes a touch data priority controller for dynamically allocating bus bandwidth; the image optimization module further includes a touch response enhancement unit for adjusting the local display brightness according to the touch coordinates.
[0076] Specifically, when it is detected that the clock frequency is 100kHz to 400kHz and the data frame contains a 7-bit address, it is determined to be an I2C protocol; When a continuous clock signal ≥ 1MHz and a periodic chip select signal are detected, it is determined to be an SPI protocol; When the control signal waveform includes a preset start code, it is determined to be the MIPI protocol.
[0077] A signal synchronization module, connected to the protocol adapter module, performs signal level conversion, timing adjustment, and double-buffered data transmission; Function: Convert signal levels, adjust timing, and transmit data through a double buffering mechanism.
[0078] The signal synchronization module includes a level converter, a double buffer controller and a CRC-16-CCITT checker; The level converter uses the SN74LVC8T245 chip, which supports 1.8V / 3.3V level conversion with a delay of ≤10ns.
[0079] Double buffer controller, buffer 0 (address 0x8000-0x9FFF) and buffer 1 (address 0xA000-0xBFFF), each with a capacity of 512KB; Switching condition: The current buffer write volume ≥ 80% (409KB) or timeout 1ms.
[0080] CRC-16-CCITT checker, calculates the CRC-16-CCITT check code (polynomial 0x1021), triggers a maximum of 3 retransmissions when the check fails.
[0081] The image optimization module is connected to the signal synchronization module to perform brightness mapping, cross-frame restoration, and color correction; Function: Dynamically adjust brightness, repair missing areas, and correct colors.
[0082] The image optimization module includes a brightness mapping engine, a cross-frame restoration unit, and a color correction unit; Brightness mapping engine, converts input RGB data into YUV format, extracts brightness component Y = 0.299R +0.587G + 0.114BY=0.299R+0.587G+0.114B; adjusts brightness according to the segmented formula , The parameters are stored in Flash address 0x3000-0x30FF.
[0083] Cross-frame inpainting unit, locates missing blocks by Sobel edge detection (gradient threshold ≥ 25); searches for 8×8 reference blocks within ±32 pixels of adjacent frames, and fills when SSIM ≥ 0.85; edge interpolation weights (d is the pixel distance).
[0084] Color correction unit, loads color gamut matrix (Flash address 0x1008-0x1010), dynamically calculates gamma value , limit 0.8≤ ≤2.2.
[0085] The data bus transmits protocol configuration, image data and feedback signals, forming a closed-loop link from protocol matching to image output.
[0086] The data bus includes: SPI control bus: transmission protocol configuration (10MHz clock, JSON format); 32-bit parallel image bus: transmit RGB888 data (100MHz clock, throughput ≥60fps); LVDS feedback bus: transmits CRC error code and protocol rematch instructions.
[0087] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "including a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0088] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for applying a touch screen display for replacement, characterized in that: include: S1, protocol adaptation; In response to the electrical signal triggered by the display screen access, analyze its communication protocol characteristics and match the target protocol; Obtain identification parameters of the display screen and generate a protocol configuration including timing rules and display parameters; S2, signal synchronization; Adjusting the signal transmission specification according to the protocol configuration, wherein the adjusting the signal transmission specification according to the protocol configuration includes level conversion and timing synchronization; Transmit data through a buffering mechanism and monitor the transmission process for errors; S3, image optimization; Dynamically adjust image brightness distribution based on display parameters; Repairs missing areas in image data and corrects output colors.
2. The touch screen application method for replacement according to claim 1, characterized in that: The step of responding to the electrical signal triggered by the display screen access, parsing the communication protocol characteristics thereof and matching the target protocol comprises: S11, trigger signal detection, monitoring the level jump signal of at least one GPIO pin, the jump sequence is low level, high level, low level, the duration is 50 milliseconds ± 10 milliseconds, the high level voltage is ≥ 2.7V, and the low level voltage is ≤ 0.4V; S12, protocol feature analysis, based on the communication signal captured by the GPIO pin, extract at least one of the following features: Clock frequency range: 60 Hz to 120 Hz, or greater than or equal to 144 Hz; Data frame structure, 7-bit address frame or SPI data packet including start bit / stop bit; Control signal combination, periodic chip select signal or MIPI DSI LP mode start code 0xB8; S13: Protocol matching decision, activating the corresponding communication protocol driver according to the parsed protocol features.
3. The touch screen application method for replacement according to claim 2, characterized in that: The protocol matching decision activates the corresponding communication protocol driver according to the parsed protocol features, including: When the clock frequency is detected to be between 100Hz and 120Hz and the data frame contains a 7-bit address, it is determined to be an I2C protocol; When a continuous clock signal ≥ 1MHz and a periodic chip select signal are detected, it is determined to be an SPI protocol; When the control signal waveform includes a preset start code, it is determined to be the MIPI protocol.
4. The touch screen display application method for replacement according to claim 1, characterized in that: The data is transmitted through a buffer mechanism and error monitoring is performed during the transmission process, including: S21, buffer initialization, allocating storage space for double buffers, with a single buffer capacity of 256KB to 1MB; S22, data writing, writing the synchronized image data into the current buffer row by row, triggering switching when 70% to 90% of the capacity is filled or the timeout is 0.5ms to 2ms; S23, error monitoring, adding CRC-16-CCITT check code to the transmitted data, triggering retransmission when the check fails, with a maximum of 3 retransmission times; S24: Protocol rematching. If verification fails for three consecutive times, return to S1 to rematch the protocol.
5. The touch screen display application method for replacement according to claim 1, characterized in that: The dynamically adjusting the image brightness distribution based on the display parameters comprises: S31, extracting brightness component, converting the input RGB data into YUV format, and extracting brightness component Y; S32, histogram statistics, counting the brightness distribution histogram H(i) of the current frame, and calculating the cumulative probability density; S33, segment mapping, dynamically adjusting the brightness value according to the formula; ; in, is the input brightness value, is the output brightness value; S34, parameter update, according to the maximum brightness in the protocol configuration and Minimum brightness dynamic calibration map parameters.
6. The method for applying a touch screen display screen for replacement according to claim 5, characterized in that: The repairing of the missing image area comprises: S35, locating the missing area, identifying the damaged pixel block in the image by using an edge detection algorithm, wherein the edge detection algorithm is a Sobel operator, and the gradient threshold is set to ≥25; S36, reference block retrieval, taking the missing block coordinates of the current frame as the center, slidingly searching for a reference block of 8×8 pixels within the range of ±32 pixels of the adjacent frame; S37, similarity determination, using the structural similarity index SSIM to calculate the similarity between the current block and the reference block, and the SSIM threshold is set to ≥0.85; S38, pixel filling, copy the matched reference block to the missing area, and perform bilinear interpolation on the block edge. The interpolation weight formula is ; Among them, d is the distance between the current pixel and the boundary of the reference block, D is the side length of the reference block, which is fixed at 8, and w is the interpolation weight.
7. A touch screen application device for replacement, used to execute the touch screen application method for replacement according to any one of claims 1 to 6, characterized in that: include: The protocol adapter module is used to detect the GPIO level jump signal triggered by the display screen access, analyze the communication protocol characteristics and match the target protocol, and generate the protocol configuration; A signal synchronization module, connected to the protocol adapter module, performs signal level conversion, timing adjustment, and double-buffered data transmission; The image optimization module is connected to the signal synchronization module to perform brightness mapping, cross-frame restoration, and color correction; The data bus transmits protocol configuration, image data and feedback signals, forming a closed-loop link from protocol matching to image output.
8. The touch screen display device for replacement according to claim 7, characterized in that: The protocol adaptation module comprises: Trigger detection unit, response time is less than or equal to 10ns, monitoring low level, high level, low level transition; Protocol decision unit, built-in I2C / SPI / MIPI protocol feature library, matching logic includes clock frequency, data frame or control signal.
9. The touch screen display device for replacement according to claim 7, characterized in that: The signal synchronization module comprises: Level converter, supporting 1.8V / 3.3V output, delay less than or equal to 10ns; Double buffer controller, buffer capacity 256KB-1MB, switching threshold 70%-90% or timeout 0.5ms-2ms; CRC-16-CCITT checker, triggers less than or equal to 3 retransmissions.
10. The touch screen display device for replacement according to claim 7, characterized in that: The image optimization module comprises: Brightness mapping engine, dynamically adjusts brightness according to a segmented formula; Cross-frame inpainting unit, search ±32 pixel range, fill 8×8 reference block when SSIM≥0.85, edge interpolation weight , where d is the distance between the current pixel and the reference block boundary, D is the side length of the reference block, which is fixed at 8, and w is the interpolation weight; Color correction unit, loads the color gamut matrix and dynamically limits the gamma value.
Citation Information
Cited By
Method, system and equipment for testing brightness uniformity of liquid crystal screen and medium
CN121499015A
Full-link debugging system and method for touch screen module
CN121807673A