A method for quick repair based on UFS, a computer device and a storage medium

By introducing MIPI MPHY RX and TX diagnostic modules and a Unipro layer repair control module into the UFS device, the problem of data interaction errors after UFS speed mode switching was solved, and fast link repair and stable data transmission were achieved.

CN122372147APending Publication Date: 2026-07-10ARTMEM TECHNOLOGY CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ARTMEM TECHNOLOGY CO LTD
Filing Date
2026-03-30
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

In existing technologies, when data exchange errors occur after UFS speed mode switching, the retransmission process is time-consuming and cannot be quickly repaired, leading to link loss problems.

Method used

After the UFSHost and UFSDevice establish a link, the UFSHost initiates a speed switching operation. The MPHY enters the SAVE state and initiates a BURST action. Diagnosis and repair are performed through the MIPI MPHY RX and TX diagnostic modules and the Unipro layer repair control module. The speed mode is automatically adjusted to ensure normal data interaction.

Benefits of technology

It enables rapid detection and automatic repair of link status after speed mode switching, improving data interaction efficiency, avoiding long retransmission delays, and ensuring link stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122372147A_ABST
    Figure CN122372147A_ABST
Patent Text Reader

Abstract

This application proposes a method, computer device, and storage medium for rapid UFS-based repair, relating to the field of data transmission technology. The method includes: after a UFSHost and UFSDevice establish a link, controlling the UFSHost to initiate a speed switching operation to the UFSDevice; after receiving the speed switching operation, the UFSDevice controls the MPHY to enter a SAVE state and controls the UFSHost to initiate a BURST action; when the MPHY jumps from the SAVE state to the BURST state, controlling the MIPI MPHY RX diagnostic module to start working and determine a first diagnostic result; and controlling the working state of the MIPI MPHY TX diagnostic module and / or the Unipro layer's repair control module based on the first diagnostic result. This application enables rapid link repair and improves work efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data transmission technology, and in particular to a method, computer device and storage medium for fast repair based on UFS. Background Technology

[0002] In related technologies, the local PA layer of the UFS-HOST should send a PACP_PWR_req frame on the driver TX channel. When the UFS-DEVICE PA layer receives a valid PACP_PWR_req frame, it should first check the link capability request, save the relevant parameters of the required speed mode, and then send a PACP_PWR_cnf to the UFS-HOST. After the UFS-HOST and UFS-device complete the handshake, the PA layers of both unipro should configure the MPHY layer using the requested parameters. After confirming that the speed requester has correctly received the PACP_PWR_cnf, it will perform data interaction in the latest speed mode. However, whether the speed switching process is successful can only be detected if the interaction fails in the latest speed mode. According to the UFS protocol, a speed mode switching retransmission is defined when an error occurs during the UFS speed mode switching process; a retransmission mechanism is also defined when there is an error in data interaction in the latest speed mode after a speed mode switch. However, retransmission after a speed mode switch takes a lot of time, and in certain scenarios, when an error occurs in data interaction after a speed mode switch and retransmission fails, a recovery repair process cannot be performed. Summary of the Invention

[0003] This application aims to address at least one of the technical problems existing in the prior art. To this end, this application proposes a method, computer device, and storage medium based on UFS for rapid link repair, aiming to achieve rapid link repair and improve work efficiency.

[0004] In a first aspect, embodiments of this application provide a method for fast repair based on UFS, the method comprising: After the UFSHost and UFSDevice establish a connection, the UFSHost is controlled to initiate a speed switching operation to the UFSDevice; After the UFSDevice receives the speed and switches, the MPHY is controlled to enter the SAVE state and the UFSHost is controlled to initiate the BURST action. When the MPHY switches from the SAVE state to the BURST state, the MIPI MPHY RX diagnostic module is activated to determine the first diagnostic result. The operating status of the MIPI MPHY TX diagnostic module and / or the Unipro layer repair control module is controlled based on the first diagnostic result.

[0005] According to some embodiments of this application, the control of the MIPI MPHY RX diagnostic module to start working and determine a first diagnostic result includes: The first data transmission rate received by the MIPI MPHY RX diagnostic module is compared with the first preset transmission rate to obtain a first comparison result; If the first comparison result is inconsistent, the first diagnostic result is determined to be abnormal; If the first comparison result is consistent, the first diagnostic result is determined to be normal.

[0006] According to some embodiments of this application, controlling the operating state of the MIPI MPHY TX diagnostic module and / or the Unipro layer repair control module based on the first diagnostic result includes: If the first diagnostic result is abnormal, a first error report is obtained and sent to the repair control module of the Unipro layer, thereby controlling the repair control module of the Unipro layer to start working.

[0007] According to some embodiments of this application, controlling the operating state of the MIPI MPHY TX diagnostic module and / or the Unipro layer repair control module based on the first diagnostic result includes: If the first diagnostic result is normal, the MPHY will transmit the received data to the Unipro layer through the RMMI interface and control the MIPI MPHY TX diagnostic module to start working. The data includes the second data transmission rate and the level status on the TX line.

[0008] According to some embodiments of this application, after the control MIPI MPHY TX diagnostic module is turned on, it includes: The second data transmission rate received by the MIPI MPHY TX diagnostic module is compared with the second preset transmission rate to obtain a second comparison result; The voltage level on the TX line received by the MIPI MPHY TX diagnostic module is compared with the preset voltage level to obtain a third comparison result.

[0009] According to some embodiments of this application, after comparing the second data transmission rate received by the MIPI MPHY TX diagnostic module with a second preset transmission rate to obtain a second comparison result, the process includes: If the second comparison result is inconsistent, the second diagnostic result is determined to be abnormal and a second error report is obtained. The second error report is then sent to the repair control module of the Unipro layer, and the repair control module of the Unipro layer is controlled to start working. If the second comparison result is consistent, the UFSHost and the UFSDevice are controlled to perform data interaction according to the initial speed mode.

[0010] According to some embodiments of this application, after comparing the level state on the TX line received by the MIPI MPHY TX diagnostic module with a preset level state to obtain a third comparison result, the process includes: If the third comparison result does not match, the diagnosis result is determined to be abnormal and a third error report is obtained. The third error report is then sent to the repair control module of the Unipro layer, and the repair control module of the Unipro layer is controlled to start working. If the third comparison result is satisfactory, the UFSHost and the UFSDevice are controlled to interact with each other according to the initial speed mode.

[0011] According to some embodiments of this application, after the repair control module for controlling the Unipro layer is activated, it further includes: The repair control module of the Unipro layer sends a speed mode switching request to the UFSHost to obtain the target speed mode; The UFSHost and UFSDevice are controlled to interact with each other according to the target speed mode.

[0012] Secondly, embodiments of this application provide a computer device, including: At least one memory; At least one processor; At least one computer program; The at least one computer program is stored in the at least one memory, and the at least one processor executes the at least one computer program to implement the UFS-based fast repair method described in the first aspect above.

[0013] Thirdly, embodiments of this application provide a computer-readable storage medium storing a computer program for causing a computer to execute the UFS-based fast repair method described in the first aspect.

[0014] According to the technical solution of this application embodiment, it has at least the following beneficial effects: Firstly, after establishing a link between UFSHost and UFSDevice, this application controls UFSHost to initiate a speed switching operation to UFSDevice. After UFSDevice receives the speed switching operation, it controls MPHY to enter SAVE state and controls UFSHost to initiate a BURST action. When MPHY jumps from SAVE state to BURST, it controls the MIPI MPHY RX diagnostic module to start working, determines the first diagnostic result, and then controls the working state of the MIPI MPHY TX diagnostic module and / or the Unipro layer repair control module based on the first diagnostic result. This application embodiment can solve the problem of link loss due to speed mode switching, regardless of the scenario, and can quickly repair the link. It allows the hardware to quickly sense whether normal data interaction can be supported after a speed switch. Once it is found that the latest speed mode interaction cannot be guaranteed, link repair can be performed quickly. The entire repair process can be completed automatically by the hardware, achieving rapid link repair and improving work efficiency.

[0015] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description

[0016] The accompanying drawings are used to provide a further understanding of the technical solutions of this application and constitute a part of the specification. They are used together with the embodiments of this application to explain the technical solutions of this application and do not constitute a limitation on the technical solutions of this application.

[0017] Figure 1 This is a schematic diagram of the structure of a repair device provided in one embodiment of this application; Figure 2 This is a flowchart illustrating a method for fast repair based on UFS provided in one embodiment of this application; Figure 3 This is a schematic flowchart illustrating the process of determining a first diagnostic result provided in one embodiment of this application; Figure 4 This is a flowchart illustrating the working state of the MIPI MPHY TX diagnostic module and / or the repair control module of the Unipro layer provided in one embodiment of this application; Figure 5 This is a flowchart illustrating the working state of the MIPI MPHY TX diagnostic module and / or the repair control module of the Unipro layer, provided in another embodiment of this application. Figure 6 This is a schematic diagram of the subsequent process of controlling the MIPI MPHY TX diagnostic module to start working, according to one embodiment of this application; Figure 7This is a schematic diagram of the process following the acquisition of the second comparison result provided in one embodiment of this application; Figure 8 This is a schematic diagram of the process following the acquisition of the third comparison result provided in one embodiment of this application; Figure 9 This is a schematic diagram of the hardware structure of a computer device provided in one embodiment of this application. Detailed Implementation

[0018] The embodiments of this application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.

[0019] In the description of this application, it should be understood that the orientation descriptions, such as up, down, front, back, left, right, etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this application.

[0020] In the description of this application, "several" means one or more, "more than" means two or more, "greater than," "less than," and "exceeding" are understood to exclude the stated number, while "above," "below," and "within" are understood to include the stated number. The use of "first" and "second" in the description is merely for distinguishing technical features and should not be construed as indicating or implying relative importance, or implicitly indicating the number of indicated technical features, or implicitly indicating the order of the indicated technical features.

[0021] In the description of this application, unless otherwise expressly defined, terms such as "setup," "installation," and "connection" should be interpreted broadly, and those skilled in the art can reasonably determine the specific meaning of the above terms in this application in conjunction with the specific content of the technical solution.

[0022] First, let's analyze some of the terms used in this application: UCS (UFS Command Set Layer): UCS is the highest layer of the UFS protocol stack, responsible for defining the command set used by UFS devices. It is mainly based on SBC (SCSI Block Commands) and PC (SCSI Primary Commands), allowing UFS devices to handle read, write, management, and control operations like traditional SCSI devices.

[0023] UTP (UFS Transport Layer): UTP is a transport protocol specifically defined by JEDEC for UFS, located below UCS and above UIC. It is responsible for encapsulating commands and data from the UCS layer into UTP packets and reliably transmitting them between the host and the UFS device. You can think of UTP as a "UFS courier system," responsible for packaging, sending, and receiving.

[0024] UIC (UFS Interconnect Layer): UIC is the underlying communication protocol layer of UFS, consisting of two parts: Data Link Layer: based on the MIPI UniPro protocol (responsible for establishing connections, flow control, error handling, etc.); Physical Layer: based on the MIPI M-PHY protocol (responsible for high-speed serial data transmission, providing HS-Gear and LP-Gear modes).

[0025] The UFS-based fast repair method provided in this application is illustrated in the following embodiments.

[0026] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) is the theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.

[0027] Foundational technologies for artificial intelligence generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.

[0028] The UFS-based fast repair method provided in this application relates to the field of data transmission technology. This UFS-based fast repair method can be applied to a terminal, a server, or software running on either a terminal or a server. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, etc.; the server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application implementing the UFS-based fast repair method, but is not limited to the above forms.

[0029] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0030] It should be noted that in all specific embodiments of this application, when processing data related to user identity or characteristics, such as user information, user behavior data, user historical data, and user location information, user permission or consent will be obtained first. Furthermore, the collection, use, and processing of this data will comply with relevant laws, regulations, and standards. In addition, when embodiments of this application require access to sensitive personal information of users, separate permission or consent from the user will be obtained through pop-ups or redirects to confirmation pages. Only after obtaining the user's separate permission or consent will the necessary user-related data for the normal operation of the embodiments of this application be obtained.

[0031] The various embodiments of the chip of this application will be further described below with reference to the accompanying drawings.

[0032] like Figure 1 As shown, Figure 1This is a schematic diagram of the structure of a repair device provided in one embodiment of this application.

[0033] In one embodiment, the UFS protocol includes: UCS (UFS command set Layer) based on SBC and SPC SCSI commands, UTP (UFS Transport Layer) a JEDEC-defined protocol, UIC (UFS Intercollect Layer) a MIPI protocol for the data link layer and a MIPI-M-PHY protocol for the physical layer. UFS hosts and devices are interconnected via MIPI. Under current technologies and protocols, the UFS device's unipro and M-PHY are configured and managed. The host's application layer constructs the UFS protocol frame format and transmits it to the unipro via the UIC layer's Cport interface. The unipro layer then assembles the frames into the unipro protocol frame format and transmits it to the M-PHY via the RMMI interface. Finally, the M-PHY transmits the information to the line connected to the UFS device. The UFS device's M-PHY receives information from the host and transmits it to the unipro via the RMMI interface. The unipro decomposes the data frame into the UFS frame format and uploads it to the UTP layer via the Cport interface. Upon receiving a command, the UTP layer constructs a response for the host. Data is first transmitted to the unipro via the Cport interface, then to the M-PHY via the RMMI interface, and finally transmitted to the line connected to the host. This completes one full communication cycle between the UFS host and device. The UFS-HOST local PA layer should send a PACP_PWR_req frame on the driver TX channel. When the UFS-DEVICE PA layer receives a valid PACP_PWR_req frame, it should first check the link capability request, save the required speed mode parameters, and then send a PACP_PWR_cnf to the UFS-HOST. After the UFS-HOST and UFS-device complete their handshake, the PA layers of both unipro devices should configure the MPHY layer using the requested parameters.

[0034] Specifically, after confirming that PACP_PWR_cnf has been correctly received, the speed requester will interact with data in the latest speed mode. Whether the speed switching process is successful can only be detected if the interaction fails in the latest speed mode. In this invention, a method and apparatus for fast repair based on UFS, after the speed requester requests to switch the speed mode from low to high, the MIPI MPY TX controller detects the line level and bit rate during data bursts to confirm whether the speed switch meets expectations. If not, the hardware automatically initiates a speed mode switch request to the peer to repair the link. If the speed mode switch does not occur under sleep conditions, a line reset action is sent before initiating the speed mode switch request frame to reduce the peer's MPHY RX speed to the minimum speed, ensuring that the speed mode request frame is transmitted to the peer at the minimum speed. The MIPI MPY RX controller detects the line bit rate during data bursts to confirm whether the speed switch meets expectations. If not, the hardware automatically initiates a speed mode request to the peer to repair the link. Before initiating a speed mode switching request frame, a linereset action is sent first to reduce the MPHY RX speed of the peer to the minimum speed. This ensures that the speed mode request frame is transmitted to the peer at the minimum speed. The solution of this invention allows the hardware to quickly detect whether normal data interaction can be supported after a speed switch. If it is found that the latest speed mode interaction cannot be guaranteed, link repair can be performed quickly. The entire repair process can be completed automatically by the hardware.

[0035] The MIPI MPHY RX diagnostic module diagnoses whether the data rate received by the MPHY RX end is within the latest speed mode protocol. If the received data rate does not conform to the set speed mode protocol, the MIPI MPHY RX diagnostic module will transmit the error information to the Unipro layer's repair control module. The MIPI MPHY TX diagnostic module diagnoses whether the line voltage level at the TX end conforms to the latest speed mode protocol when the MPHY TX end switches from SAVE to BURST. If the MIPI MPHY TX diagnostic module detects that the line voltage level at the TX end does not conform to the set speed mode protocol, it will transmit the error information to the Unipro layer's repair control module. Simultaneously, the MIPI MPHY TX diagnostic module also diagnoses whether the data rate received by the MPHY TX end is within the latest speed mode protocol. If the transmitted data rate does not conform to the set speed mode protocol, it will transmit the error information to the Unipro layer's repair control module. The MIPI Unipro repair control module, when it receives an error message, will proactively initiate a line reset operation to the peer and send a speed mode switch request to the peer.

[0036] Please see Figure 2 , Figure 2 This is a flowchart illustrating a UFS-based fast repair method provided in one embodiment of this application. The UFS-based fast repair method provided in this embodiment includes, but is not limited to, steps S210 to S240, which will be described in turn below.

[0037] Step S210: After the UFSHost and UFSDevice establish a connection, control the UFSHost to initiate a speed switching operation to the UFSDevice; After step S220, the UFSDevice receive speed switching operation is performed, the MPHY is controlled to enter the SAVE state and the UFSHost is controlled to initiate the BURST action; Step S230: When the MPHY jumps from the SAVE state to the BURST state, the MIPI MPHY RX diagnostic module is started to work and the first diagnostic result is determined. Step S240: Control the working status of the MIPI MPHY TX diagnostic module and / or the Unipro layer repair control module according to the first diagnostic result.

[0038] It should be noted that, firstly, after the UFSHost and UFSDevice establish a connection, the UFSHost initiates a speed switching operation to the UFSDevice. After receiving the speed switching operation, the UFSDevice controls the MPHY to enter the SAVE state and controls the UFSHost to initiate a BURST action. When the MPHY jumps from the SAVE state to the BURST state, the MIPI MPHY RX diagnostic module starts working, determines the first diagnostic result, and then controls the working state of the MIPI MPHY TX diagnostic module and / or the Unipro layer's repair control module based on the first diagnostic result. This embodiment can solve the problem of rapid repair of link loss caused by speed mode switching regardless of the scenario. It allows the hardware to quickly sense whether normal data interaction can be supported after a speed switch. Once it is found that the latest speed mode interaction cannot be guaranteed, link repair can be performed quickly, and the entire repair process can be completed automatically by the hardware.

[0039] Please see Figure 3 , Figure 3 This is a flowchart illustrating the determination of a first diagnostic result provided in one embodiment of this application; regarding the above step S230, which controls the MIPI MPHY RX diagnostic module to start working and determine the first diagnostic result, including but not limited to steps S310 to S330, each step will be described in turn below.

[0040] Step S310: Compare the first data transmission rate received by the MIPI MPHY RX diagnostic module with the first preset transmission rate to obtain the first comparison result; Step S320: If the first comparison result is inconsistent, determine that the first diagnostic result is abnormal; Step S330: If the first comparison result is consistent, the first diagnostic result is determined to be normal.

[0041] It should be noted that the first data transmission rate is the actual rate received and demodulated by RX, while the first preset transmission rate is the standard rate expected in the system configuration file.

[0042] In one embodiment, a non-compliance result indicates an malfunction at the RX terminal. The "non-compliance" conditions and corresponding diagnostic logic are: rate locked at an incorrect setting, rate drift exceeding the tolerance range, and no rate lock. When the first diagnostic result is determined to be abnormal due to rate locking at an incorrect setting, the system will trigger a rate reduction retry or directly report an error. Rate drift exceeding the tolerance range is determined through a comparison logic that includes a tolerance threshold. If |actual rate - preset rate| > tolerance, it is determined to be non-compliance.

[0043] Please see Figure 4, Figure 4 This is a flowchart illustrating the working state of the MIPI MPHY TX diagnostic module and / or the repair control module of the Unipro layer according to an embodiment of this application. The above step S240, which controls the working state of the MIPI MPHY TX diagnostic module and / or the repair control module of the Unipro layer according to the first diagnostic result, includes, but is not limited to, step S410. Each step will be described in turn below.

[0044] Step S410: If the first diagnostic result is abnormal, obtain the first error report and send the first error report to the repair control module of the Unipro layer, and control the repair control module of the Unipro layer to start working.

[0045] In one embodiment, a MIPI MPHY RX diagnostic module is added to diagnose whether the data rate received by the MPHY RX terminal is within the latest speed mode specification. If the MIPI MPHY RX diagnostic module determines that the received data rate does not conform to the set speed mode specification, it will transmit the error information to the Unipro layer's repair control module.

[0046] Please see Figure 5 , Figure 5 This is a flowchart illustrating the working state of the MIPI MPHY TX diagnostic module and / or the repair control module of the Unipro layer according to another embodiment of this application. Regarding the above step S240, which controls the working state of the MIPI MPHY TX diagnostic module and / or the repair control module of the Unipro layer according to the first diagnostic result, it includes, but is not limited to, step S510. The steps are described in turn below.

[0047] Step S510: If the first diagnostic result is normal, the MPHY will transmit the received data to the Unipro layer through the RMMI interface and control the MIPI MPHY TX diagnostic module to start working. The data includes the second data transmission rate and the level status on the TX line.

[0048] It should be noted that the second data transmission rate is the actual rate used by the TX end during the data transmission phase, which may differ from the rate during the initialization phase. The voltage levels on the X end line include the HS / LP mode status of the TX end, differential voltage amplitude, common-mode voltage, and signal presence / absence. This information is used by the Unipro layer to determine link quality and perform rate negotiation.

[0049] In one embodiment, the MPHY writes the received second data transmission rate into the RMMI mapping register, and the MPHY writes the TX terminal level status into the status register. The Unipro layer reads these registers through polling or interruption to obtain the link status.

[0050] Please see Figure 6 , Figure 6 This is a schematic diagram of the subsequent process of controlling the MIPI MPHY TX diagnostic module to start working according to an embodiment of this application; after controlling the MIPI MPHY TX diagnostic module to start working in step S510, there are steps including but not limited to steps S610 to S620, which will be described in turn below.

[0051] Step S610: Compare the second data transmission rate received by the MIPI MPHY TX diagnostic module with the second preset transmission rate to obtain a second comparison result; Step S620: Compare the level state on the TX line received by the MIPI MPHY TX diagnostic module with the preset level state to obtain the third comparison result.

[0052] It should be noted that the second data transmission rate is the actual output rate of the TX end used for data transmission, and the second preset transmission rate is the TX target rate pre-configured by the system / protocol layer; the level state on the TX end line is the electrical signal characteristic of the TX physical layer output to the transmission line (HS mode differential voltage, LP mode high and low level); the preset level state is the level qualification standard specified by the MIPI M-PHY protocol or customized by the system.

[0053] In one embodiment, the second data transmission rate is read by the TX diagnostic module through accessing the rate status register (e.g., TX_RATE_STAT_REG) of the MPHY controller to obtain the actual rate value locked by the TX PLL (phase-locked loop). The second preset transmission rate is read by the TX diagnostic module from the configuration register (e.g., TX_RATE_CFG_REG) or parameters issued by the protocol layer.

[0054] The TX diagnostic module acquires electrical signals on the TX transmission line through a dedicated analog detection circuit (ADC / level sampler), and analyzes them into quantifiable level parameters. In HS (high speed) mode, it acquires the differential voltage amplitude and common-mode voltage; in LP (low speed) mode, it acquires the high-level voltage and low-level voltage. If the TX level dimensions are normal, the overall TX diagnostic result is normal, and the UniPro layer is notified to confirm that the link can transmit data normally. If the TX diagnostic result is not compliant, the specific abnormality type is located (such as "HS differential voltage too low" or "LP high level insufficient"), triggering hardware calibration (such as adjusting the TX drive strength) or reporting a fault, and prohibiting data transmission.

[0055] Please see Figure 7 , Figure 7 This is a schematic diagram of the process following obtaining the second comparison result provided in one embodiment of this application; after comparing the second data transmission rate received by the MIPI MPHY TX diagnostic module with the second preset transmission rate to obtain the second comparison result in step S610, steps S710 to S720 are included but not limited to. Each step will be described in turn below.

[0056] Step S710: When the second comparison result is inconsistent, determine that the second diagnostic result is abnormal and obtain a second error report, and send the second error report to the repair control module of the Unipro layer, and control the repair control module of the Unipro layer to start working; Step S720: If the second comparison result is consistent, control UFSHost and UFSDevice to perform data interaction according to the initial speed mode.

[0057] It should be noted that when the second comparison result is inconsistent, the MIPI MPHY TX diagnostic module is used to diagnose whether the data rate received by the MPHY TX end is within the latest speed mode specification. If the MIPI MPHY TX diagnostic module determines that the transmitted data rate does not conform to the set speed mode specification, it will transmit the error information to the Unipro layer's repair control module. When the second comparison result is consistent, it controls the UFSHost and UFSDevice to interact with each other according to the initial speed mode. This allows for faster repair of speed mode switching failure scenarios and enables rapid repair of link loss issues caused by speed mode switching, regardless of the specific scenario.

[0058] Please see Figure 8 , Figure 8This is a schematic diagram of the process following obtaining the third comparison result provided in one embodiment of this application; after comparing the level state on the TX terminal line received by the MIPI MPHY TX diagnostic module with the preset level state in step S620 to obtain the third comparison result, the process includes, but is not limited to, steps S810 to S820, which will be described in turn below.

[0059] Step S810: When the third comparison result does not match, determine that the diagnosis result is abnormal and obtain the third error report, and send the third error report to the repair control module of the Unipro layer, and control the repair control module of the Unipro layer to start working. Step S820: If the third comparison result is consistent, control UFSHost and UFSDevice to perform data interaction according to the initial speed mode.

[0060] It should be noted that when the third comparison result is inconsistent, the system checks whether the voltage level on the TX end conforms to the protocol-defined voltage level of the latest speed mode. If the MIPI MPHY TX diagnostic module detects that the voltage level on the X end does not conform to the set speed mode protocol, then the MIPI MPHY TX diagnostic module will transmit the error information to the Unipro layer's repair control module. When the third comparison result is consistent, the system controls UFSHost and UFSDevice to interact with each other according to the initial speed mode, thereby more quickly repairing speed mode switching failure scenarios. Simultaneously, it can quickly repair link loss issues caused by speed mode switching regardless of the specific scenario.

[0061] In one embodiment, after the repair control module of the Unipro layer is activated, it further includes: The repair control module of the Unipro layer sends a speed mode switching request to the UFSHost to obtain the target speed mode; Control UFSHost and UFSDevice to exchange data according to the target speed mode.

[0062] It's important to note that when the Unipro repair control module receives an error message, it proactively initiates a line reset operation and sends a speed mode switch request to the peer to reduce the peer's MPHY RX speed to the minimum. This ensures that the speed mode request frame is transmitted to the peer at the lowest possible speed. This allows the hardware to quickly detect whether normal data interaction can be supported after the speed switch. If it finds that the latest speed mode interaction cannot be guaranteed, it can quickly repair the link. The entire repair process can be completed automatically by the hardware.

[0063] This application also provides a computer device comprising: at least one memory, at least one processor, and at least one computer program. The at least one computer program is stored in the at least one memory, and the at least one processor executes the at least one computer program to implement any of the UFS-based fast repair methods described in the above embodiments. This computer device can be any smart terminal, including tablet computers, in-vehicle computers, etc.

[0064] See Figure 9 , Figure 9 This is a schematic diagram of the hardware structure of a computer device provided in one embodiment of this application. The computer device includes: The processor 910 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application. The memory 920 can be implemented as a read-only memory (ROM), static storage device, dynamic storage device, or random access memory (RAM). The memory 920 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 920 and is called and executed by the processor 910 using the UFS-based fast repair method of the embodiments of this application. The input / output interface 930 is used to implement information input and output; The communication interface 940 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.). Bus 950 transmits information between various components of the device (e.g., processor 910, memory 920, input / output interface 930, and communication interface 940); The processor 910, memory 920, input / output interface 930 and communication interface 940 are connected to each other within the device via bus 950.

[0065] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described UFS-based fast repair method.

[0066] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0067] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.

[0068] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.

[0069] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0070] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.

[0071] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0072] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0073] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0074] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0075] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0076] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0077] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.

Claims

1. A method for fast repair based on UFS, characterized in that, The method includes: After the UFSHost and UFSDevice establish a connection, the UFSHost is controlled to initiate a speed switching operation to the UFSDevice; After the UFSDevice receives the speed and switches, the MPHY is controlled to enter the SAVE state and the UFSHost is controlled to initiate the BURST action. When the MPHY switches from the SAVE state to the BURST state, the MIPI MPHY RX diagnostic module is activated to determine the first diagnostic result. The operating status of the MIPI MPHY TX diagnostic module and / or the Unipro layer repair control module is controlled based on the first diagnostic result.

2. The method according to claim 1, characterized in that, The control MIPI MPHY RX diagnostic module starts working and determines the first diagnostic result, including: The first data transmission rate received by the MIPI MPHY RX diagnostic module is compared with the first preset transmission rate to obtain a first comparison result; If the first comparison result is inconsistent, the first diagnostic result is determined to be abnormal; If the first comparison result is consistent, the first diagnostic result is determined to be normal.

3. The method according to claim 1, characterized in that, The step of controlling the working state of the MIPIMPHY TX diagnostic module and / or the Unipro layer repair control module based on the first diagnostic result includes: If the first diagnostic result is abnormal, a first error report is obtained and sent to the repair control module of the Unipro layer, thereby controlling the repair control module of the Unipro layer to start working.

4. The method according to claim 1, characterized in that, The step of controlling the working state of the MIPIMPHY TX diagnostic module and / or the Unipro layer repair control module based on the first diagnostic result includes: If the first diagnostic result is normal, the MPHY will transmit the received data to the Unipro layer through the RMMI interface and control the MIPI MPHY TX diagnostic module to start working. The data includes the second data transmission rate and the level status on the TX line.

5. The method according to claim 4, characterized in that, After the MIPI MPHY TX diagnostic module is started, it includes: The second data transmission rate received by the MIPI MPHY TX diagnostic module is compared with the second preset transmission rate to obtain a second comparison result; The voltage level on the TX line received by the MIPI MPHY TX diagnostic module is compared with the preset voltage level to obtain a third comparison result.

6. The method according to claim 5, characterized in that, After comparing the second data transmission rate received by the MIPI MPHY TX diagnostic module with the second preset transmission rate to obtain the second comparison result, the process includes: If the second comparison result is inconsistent, the second diagnostic result is determined to be abnormal and a second error report is obtained. The second error report is then sent to the repair control module of the Unipro layer, and the repair control module of the Unipro layer is controlled to start working. If the second comparison result is consistent, the UFSHost and the UFSDevice are controlled to perform data interaction according to the initial speed mode.

7. The method according to claim 5, characterized in that, After comparing the voltage level on the TX line received by the MIPI MPHY TX diagnostic module with a preset voltage level to obtain a third comparison result, the process includes: If the third comparison result does not match, the diagnosis result is determined to be abnormal and a third error report is obtained. The third error report is then sent to the repair control module of the Unipro layer, and the repair control module of the Unipro layer is controlled to start working. If the third comparison result is satisfactory, the UFSHost and the UFSDevice are controlled to interact with each other according to the initial speed mode.

8. The method according to claim 3, 6 or 7, characterized in that, After the repair control module controlling the Unipro layer is activated, it also includes: The repair control module of the Unipro layer sends a speed mode switching request to the UFSHost to obtain the target speed mode; The UFSHost and UFSDevice are controlled to interact with each other according to the target speed mode.

9. A computer device, characterized in that, include: At least one memory; At least one processor; At least one computer program; The at least one computer program is stored in the at least one memory, and the at least one processor executes the at least one computer program to implement the method as described in any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program for causing a computer to perform the method as described in any one of claims 1 to 8.