Method for establishing a data transmission link, storage device and storage medium

By actively acquiring and adjusting the communication version through the storage device, the problem of incompatibility between the communication versions of the host and the storage device is solved, enabling rapid adaptation and efficient data transmission on different host platforms.

CN123178318APending Publication Date: 2026-11-27HUIYI MICROELECTRONICS (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611677429.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-28
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

When the host and storage device use different communication versions, a data transmission link cannot be established, resulting in communication incompatibility issues.

Method used

The storage device actively obtains the host's communication version and compares it with its own version, records the differences, and adjusts the storage device's communication version to match the host after a forced restart to establish a data transmission link.

Benefits of technology

It enables storage devices to quickly switch communication protocols across different host platforms, improving compatibility and communication stability, reducing startup latency, and lowering power consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123178318A_ABST
    Figure CN123178318A_ABST
Patent Text Reader

Abstract

The application discloses a data transmission link establishment method, a storage device and a storage medium. The data transmission link establishment method comprises the following steps: establishing a basic transmission link between the storage device and a host computer, and actively acquiring the communication version of the host computer and reading the communication version of the storage device itself; in response to the communication version of the host computer not matching the communication version of the storage device, recording the communication version of the host computer, and feeding back link abnormal information to the host computer to trigger a forced restart mechanism of the host computer; again establishing a basic transmission link between the storage device and the host computer, and synchronously adjusting the communication version of the storage device itself to match the communication version of the host computer to establish a data transmission link. The above scheme enables the storage device to quickly switch the communication version on different versions of the host platform for communication version adaptation, thereby improving the compatibility and universality of the storage device for diversified host platforms.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of storage technology, and in particular to methods for establishing data transmission links, storage devices, and storage media. Background Technology

[0002] During use, storage devices need to establish a data transmission link with the host in order to exchange business data such as read and write commands and read and write data.

[0003] However, when the host and storage device use different communication versions, version incompatibility will occur, resulting in the inability to establish a data transmission link.

[0004] In particular, when the host's communication version is lower than that of the storage device, the host cannot correctly parse the messages sent by the storage device, which greatly increases the difficulty of establishing a data transmission link. Summary of the Invention

[0005] The main technical problem addressed by this application is to provide a method for establishing a data transmission link, a storage device, and a storage medium, in order to solve the problem that a data transmission link cannot be established when the host and the storage device use different communication versions.

[0006] To address the aforementioned issues, the first aspect of this application provides a method for establishing a data transmission link, comprising: establishing a basic transmission link between a storage device and a host, and actively acquiring the host's communication version and reading the storage device's own communication version; in response to a mismatch between the host's communication version and the storage device's communication version, recording the host's communication version and sending link error information back to the host to trigger a forced restart mechanism of the host; re-establishing the basic transmission link between the storage device and the host, and simultaneously adjusting the storage device's own communication version to match the host's communication version; and establishing a data transmission link with the host using the communication version that matches the host, to perform data transmission between the storage device and the host.

[0007] The process of establishing a basic transmission link between the storage device and the host includes: pre-storing multiple communication versions in the metadata area of ​​the storage medium of the storage device; adjusting the communication version of the storage device itself to match the communication version of the host, including: loading the target communication version in the metadata area of ​​the storage device; wherein the target communication version matches the communication version of the host; modifying the version attribute of the storage device based on the target communication version, and synchronously adjusting the configuration parameters corresponding to the link layer of the storage device to make the communication version of the storage device itself match the communication version of the host.

[0008] The process involves establishing a data transmission link with the host using a communication version that matches the host, to enable data transmission between the storage device and the host. This includes: receiving performance commands sent by the host, adjusting the storage device's link configuration to the highest performance mode under the current communication version based on the performance commands; simultaneously adjusting the host's link configuration to the highest performance mode under the current communication version; sending preset data to the host after adjustment to respond to the performance commands; and establishing a data transmission link with the host through the highest performance mode to enable data transmission between the storage device and the host.

[0009] The process of actively obtaining the host's communication version and reading the storage device's own communication version also includes: the storage device reading the host's communication version through the device management entity and reading the storage device's own communication version; and comparing the host's communication version with the storage device's own communication version.

[0010] The comparison between the host's communication version and the storage device's own communication version includes: when the host's communication version matches the storage device's communication version, receiving a performance command sent by the host, and adjusting the storage device's link configuration to the highest performance mode under the current communication version based on the performance command; wherein, the host's link configuration is synchronously adjusted to the highest performance mode under the current communication version; after adjustment, sending preset data to the host to respond to the performance command; and establishing a data transmission link with the host through the highest performance mode to carry out data transmission between the storage device and the host.

[0011] To address the aforementioned issues, a second aspect of this application provides a method for establishing a data transmission link, comprising: establishing a basic transmission link between a host and a storage device, and having the storage device read the communication version through the basic transmission link, so that when the storage device determines that the communication version of the host does not match the communication version of the storage device, it records the communication version of the host and sends link error information back to the host; after receiving the link error information, the host triggers a forced restart mechanism to re-establish the basic transmission link with the storage device, so that the communication version of the storage device itself is adjusted to match the communication version of the host; and establishing a data transmission link with the storage device to perform data transmission between the storage device and the host.

[0012] The process involves establishing a basic transmission link between the host and the storage device, followed by: the host sending service instructions to the storage device; and when the communication version of the host and the communication version of the storage device do not match, receiving link error information from the storage device to trigger a forced restart mechanism.

[0013] The process of establishing a data transmission link with the storage device to perform data transmission between the storage device and the host includes: adjusting the host's link configuration to the highest performance mode under the current communication version and sending a performance command to the storage device so that the storage device's link configuration is synchronously adjusted to the highest performance mode under the current communication version; and after receiving preset data sent by the storage device, establishing a data transmission link with the storage device through the highest performance mode to perform data transmission between the storage device and the host.

[0014] To address the aforementioned problems, a third aspect of this application provides a storage device including a storage unit and a processor coupled to each other. The processor is used to execute program instructions stored in the storage unit to implement the data transmission link establishment method described above.

[0015] To address the aforementioned problems, a fourth aspect of this application provides a computer-readable storage medium storing program instructions thereon, which, when executed by a processor, implement the method for establishing a data transmission link as described above.

[0016] The beneficial effects of this application are as follows: Unlike existing technologies, the data transmission link establishment method of this application, by actively acquiring host communication version data and comparing it with its own version during the first establishment of the basic transmission link, can accurately identify the differences between the versions at both ends, avoiding message parsing errors caused by version mismatch. Furthermore, when the host's communication version and the storage device's communication version do not match, the host version data is recorded, and the storage device version is adjusted to match the host during the second establishment of the basic transmission link. This achieves adaptive following of the storage device to the host's capabilities, enabling the storage device to quickly switch communication protocol versions on different host platforms without requiring any prior modifications to the host. It can actively match the host's communication version during use to establish the data transmission link, thereby improving the storage device's compatibility with diverse host platforms. Only one detection and adjustment process is needed, avoiding the startup delay caused by repeated retries or forced degradation in traditional solutions. This makes the data transmission link establishment process more efficient, significantly shortens startup delay, and reduces power consumption, which is beneficial for ensuring high-speed switching and communication stability across different host platforms. Attached Figure Description

[0017] Figure 1 This is a flowchart illustrating the first embodiment of the data transmission link establishment method provided in this application; Figure 2 This is a flowchart illustrating the second embodiment of the data transmission link establishment method provided in this application; Figure 3 This is a flowchart illustrating the third embodiment of the data transmission link establishment method provided in this application; Figure 4 This is a flowchart illustrating the fourth embodiment of the data transmission link establishment method provided in this application; Figure 5 This is a schematic diagram of the structure of a transmission system according to an embodiment of the present application; Figure 6 yes Figure 5 A schematic diagram of the data flow in one embodiment of the transmission system where each terminal transmits data; Figure 7 yes Figure 5 A schematic diagram of the data flow in another embodiment of the data transmission system performed by each terminal in the example; Figure 8 This is a schematic diagram of the framework of an embodiment of the storage device provided in this application; Figure 9 A schematic diagram of a framework of an embodiment of the computer-readable storage medium provided in this application. Detailed Implementation

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

[0019] It should be noted that if the embodiments of this application involve directional indicators (such as up, down, left, right, front, back, etc.), the directional indicators are only used to explain the relative positional relationship and movement of each component in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indicators will also change accordingly.

[0020] If the embodiments of this application involve descriptions such as "first" or "second," these descriptions are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first" or "second" may explicitly or implicitly include at least one of those features. Furthermore, the technical solutions of the various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. If the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed in this application.

[0021] Please see Figure 1 , Figure 1This is a flowchart illustrating the first embodiment of the data transmission link establishment method provided in this application. The data transmission link establishment method in this embodiment is applied to the storage device side and specifically includes the following steps: Step S11: Establish a basic transmission link between the storage device and the host, and actively obtain the communication version of the host and read the communication version of the storage device itself.

[0022] The storage devices in this embodiment include, but are not limited to, solid-state drives (SSDs), universal flash storage (UFS), enterprise-grade solid-state drives, secure digital memory cards (SD cards), embedded multimedia cards (eMMCs), portable hard drives, USB flash drives, and non-volatile memory (NAND flash).

[0023] A basic transmission link is established between the storage device and the host. Once the storage device and host are electrically connected, the establishment of the basic transmission link is triggered, and further attempts are made to establish a data transmission link for data exchange. At this stage, the basic transmission link is a low-speed, low-level communication connection, suitable for transmitting basic information and conducting basic communication, but not for high-speed business transactions. In a specific application scenario, the storage device and host can establish a basic transmission link via PWM (PWM Gear) mode or low-speed HS (Low-Speed ​​HS); the specific method is not limited here.

[0024] After the basic transmission link is established, the storage device actively obtains the host's communication version and reads its own communication version through the basic transmission link.

[0025] The storage device in this embodiment actively detects the communication version of the host, which can accurately identify the differences in protocol capabilities between the two ends, quickly determine the target for subsequent version adjustments, and avoid time-consuming and power-consuming solutions such as passive waiting or repeated retries.

[0026] The storage device also directly reads its own communication version to determine whether it is consistent with the host's communication version.

[0027] Step S12: In response to the mismatch between the communication version of the host and the communication version of the storage device, record the communication version of the host and send back link error information to the host to trigger the host's forced restart mechanism.

[0028] When the communication version of the host and the communication version of the storage device do not match, it indicates a difference between the host's version number and the version number currently running on the storage device. For example, the host supports UFS version 1.8 while the storage device supports UFS version 2.0. In this case, the storage device will record the host's communication version, specifically by writing the version number into the metadata area of ​​the storage medium to ensure persistent storage after the underlying transmission link is re-established.

[0029] When the host's communication version matches the storage device's communication version, a data transmission link is established between the storage device and the host.

[0030] When the communication version of the host and the communication version of the storage device are incompatible, the establishment of the data transmission link will inevitably fail, and business data interaction will be impossible. Therefore, the storage device will report the link error to the host to trigger the host's forced restart mechanism. The host's forced restart mechanism is a default mechanism inherent in the host itself; when a link establishment error occurs, the host will attempt to re-establish the link by restarting.

[0031] This step utilizes the host's default forced restart mechanism to naturally trigger the establishment of the second basic transmission link.

[0032] Step S13: Re-establish the basic transmission link with the host through the storage device, and simultaneously adjust the communication version of the storage device to match the communication version of the host.

[0033] After a forced restart of the host, since the storage device is still electrically connected to the host, the basic transmission link will be re-established by default.

[0034] This step involves re-establishing the basic transmission link between the storage device and the host. During this process, the storage device's own communication version is simultaneously adjusted to match the host's communication version. Specifically, this adjustment can be made based on the host's communication version metadata.

[0035] In this embodiment, it is impossible to know whether the communication versions of the host and the storage device are consistent before the initial establishment of the basic transmission link, nor is it possible to determine the target for adjusting the storage device's communication version. Therefore, after the initial establishment of the basic transmission link, the matching status of the host's communication version and the storage device's communication version is determined. If they do not match, a second basic transmission link is established, and the storage device's own communication version is simultaneously adjusted to match the host's communication version. This enables the storage device to adaptively follow the host's communication version, improving the storage device's compatibility with diverse host platforms. Only one detection and adjustment process is needed to achieve mutual matching of the two communication versions, avoiding the startup delays caused by repeated retries or forced degradation in traditional solutions, making the data transmission link establishment process more efficient.

[0036] Step S14: Establish a data transmission link with the host using a communication version that matches the host, so as to transmit data between the storage device and the host.

[0037] Once the communication version of the storage device is adjusted to match the communication version of the host, a data transmission link can be established with the host using the matching communication version to enable data transmission between the storage device and the host.

[0038] The data transmission link is the link used after the storage device enters normal working state. It is a high-speed transmission line and is specifically used for business data transmission, such as transmitting read and write commands issued by the host, as well as transmitting read and write data from the storage device.

[0039] In this embodiment, the execution entity is the storage device. The storage device actively obtains the host's communication version, reports link anomaly information to the host, records the host's communication version, and adjusts its own communication version. Throughout this process, the host does not need to perform any additional operations; it only needs to execute its inherent link establishment mechanism and forced restart mechanism. Therefore, the storage device in this embodiment, through its data transmission link establishment method, can be applied to adapt to the communication versions of various hosts without requiring any prior modifications to the host. It can actively match the host's communication version during use to establish a data transmission link, thereby increasing the applicability and usage flexibility of the storage device.

[0040] Through the above steps, the data transmission link establishment method of this embodiment, by actively acquiring the host communication version data and comparing it with its own version during the first establishment of the basic transmission link, can accurately identify the differences between the versions at both ends, avoiding message parsing errors caused by version mismatch. Furthermore, when the host's communication version and the storage device's communication version do not match, the host version data is recorded, and the storage device version is adjusted to match the host during the second establishment of the basic transmission link. This achieves adaptive following of the storage device to the host's capabilities, enabling the storage device to quickly switch communication protocol versions on different host platforms without requiring any prior modifications to the host. It can actively match the host's communication version during use to establish the data transmission link, thereby improving the storage device's compatibility and versatility with diverse host platforms. Moreover, requiring only one detection and adjustment process avoids the startup delay caused by repeated retries or forced degradation in traditional solutions, making the data transmission link establishment process more efficient, significantly shortening startup delay and reducing power consumption, which is beneficial for ensuring high-speed switching and communication stability across different host platforms.

[0041] Please see Figure 2 , Figure 2This is a flowchart illustrating a second embodiment of the data transmission link establishment method provided in this application. The data transmission link establishment method in this embodiment is applied to the host side and specifically includes the following steps: Step S21: Establish a basic transmission link between the host and the storage device, and have the communication version read by the storage device through the basic transmission link, so that when the storage device determines that the communication version of the host does not match the communication version of the storage device, it records the communication version of the host and sends the link abnormality information back to the host.

[0042] The storage devices in this embodiment include, but are not limited to, solid-state drives (SSDs), universal flash storage (UFS), enterprise-grade solid-state drives, SD memory cards, eMMC embedded storage units, portable hard drives, USB flash drives, and non-volatile storage units (NAND FLASH).

[0043] A basic transmission link is established between the host and the storage device. This link is triggered once the host and storage device are electrically connected. At this point, the basic transmission link is a low-speed, low-level communication connection, suitable for transmitting basic information and conducting basic communication, but not for high-speed business transactions. In a specific application scenario, the host and storage device can establish a basic transmission link via PWM (PWM Gear) mode or low-speed HS (Low-Speed ​​HS); the specific method is not limited here.

[0044] Once the basic transmission link is established, the storage device can obtain the host's communication version through the basic transmission link, and the storage device can read its own communication version.

[0045] The storage device in this embodiment actively detects the communication version of the host, which can accurately identify the differences in protocol capabilities between the two ends, quickly determine the target for subsequent version adjustments, and avoid time-consuming and power-consuming solutions such as passive waiting or repeated retries.

[0046] The storage device also directly reads its own communication version to determine whether it is consistent with the host's communication version.

[0047] When the host's communication version matches the storage device's communication version, a data transmission link is established between the storage device and the host.

[0048] When the communication version of the host and the communication version of the storage device are incompatible, the establishment of the data transmission link will inevitably fail, and business data interaction will be impossible. Therefore, the storage device will report the link error to the host to trigger the host's forced restart mechanism. The host's forced restart mechanism is a default mechanism inherent in the host itself; when a link establishment error occurs, the host will attempt to re-establish the link by restarting.

[0049] This step utilizes the host's default forced restart mechanism to naturally trigger the establishment of the second basic transmission link.

[0050] When the communication version of the host does not match the communication version of the storage device, it means that there is a difference between the version number of the host and the version number currently running on the storage device. At this time, the data transmission link cannot be established. The storage device will also record the communication version of the host. Specifically, it can write the version number into the metadata area of ​​the storage medium to ensure that it can be persistently saved after the basic transmission link is re-established.

[0051] Step S22: After receiving the link error information, the host triggers a forced restart mechanism to re-establish the basic transmission link with the storage device so that the communication version of the storage device is adjusted to match the communication version of the host.

[0052] Upon receiving link error information, the host triggers a forced restart mechanism. After restarting, it re-establishes the basic transmission link with the storage device. During this process, the storage device adjusts its communication version to match the host's communication version.

[0053] Step S23: Establish a data transmission link with the storage device to perform data transmission between the storage device and the host.

[0054] Once the communication version of the storage device is adjusted to match the communication version of the host, the host can establish a data transmission link with the storage device to carry out data transmission between the storage device and the host.

[0055] The data transmission link is the link used after the storage device enters normal working state. It is a high-speed transmission line and is specifically used for business data transmission, such as transmitting read and write commands issued by the host, as well as transmitting read and write data from the storage device.

[0056] Through the above steps, the data transmission link establishment method of this embodiment, by actively acquiring the host communication version data and comparing it with its own version during the first establishment of the basic transmission link, can accurately identify the differences between the versions at both ends, avoiding message parsing errors caused by version mismatch. Furthermore, when the host's communication version and the storage device's communication version do not match, the method records the host version data and feeds back the link abnormality information to the host, triggering a forced restart mechanism. During the second establishment of the basic transmission link after the host restarts, the storage device version is adjusted to match the host, achieving adaptive following of the storage device to the host's capabilities. No prior modifications to the host are required; the storage device can actively match the host's communication version during use, establishing the data transmission link. This allows the storage device to quickly switch communication protocol versions on different host platforms, thereby improving the storage device's compatibility and versatility with diverse host platforms. Moreover, requiring only one detection and adjustment process avoids the startup delay caused by repeated retries or forced degradation in traditional solutions, making the data transmission link establishment process more efficient, significantly shortening startup delay and reducing power consumption. This is beneficial for ensuring high-speed switching and communication stability across different host platforms.

[0057] Please see Figure 3 , Figure 3 This is a flowchart illustrating the third embodiment of the data transmission link establishment method provided in this application. The data transmission link establishment method in this embodiment is applied to the storage device side and specifically includes the following steps: Step S31: Pre-store multiple communication versions in the metadata area of ​​the storage medium of the storage device.

[0058] Before the storage device establishes a connection with the host, multiple communication versions are pre-stored in the metadata area of ​​the storage medium of the storage device. These multiple communication versions are matched with the type of storage device, that is, the specific type of communication version can be specifically set based on the type of storage device.

[0059] In a specific application scenario, when the storage device is a UFS (Universal Flash Storage) general-purpose flash storage, a dedicated field can be reserved in the metadata area of ​​the storage medium of the storage device to record multiple UniPro (Unified Protocol) version numbers and corresponding UniPro meta (metadata). Specifically, it can record all mainstream UniPro version numbers on the market; the version numbers include, but are not limited to, UniPro 1.0, UniPro 1.1, UniPro 1.4, UniPro 1.6, UniPro 1.8, UniPro 2.0, UniPro 2.1, UniPro 2.2, UniPro 3.0, UniPro 3.1, UniPro 4.0, UniPro 4.1, UniPro 5.0, etc.

[0060] In a specific application scenario, when the storage device is a solid-state drive (SSD), a dedicated field can be reserved in the metadata area of ​​the storage medium to record various PCIe version numbers (Peripheral Component Interconnect Express) and their corresponding metadata. Specifically, it can record all mainstream PCIe version numbers on the market; the version numbers include, but are not limited to, PCIe 1.0, PCIe 1.1, PCIe 2.0, PCIe 2.1, PCIe 3.0, PCIe 3.1, PCIe 4.0, PCIe 5.0, PCIe 6.0, PCIe 7.0, etc.

[0061] This step pre-stores multiple communication versions that can support the establishment of links between storage devices of that type in the metadata area of ​​the storage medium, based on the type of storage device.

[0062] Step S32: Establish a basic transmission link between the storage device and the host, read the communication version of the host through the device management entity, and read the communication version of the storage device itself.

[0063] When a storage device is electrically connected to a host, a basic transmission link is first established between the two devices. This basic transmission link is a low-speed, low-level communication connection, suitable for transmitting basic information and conducting basic communication, but not for high-speed business transactions. In a specific application scenario, the storage device and host can establish a basic transmission link via PWM mode (PWMGear) or low-speed HS (Low-Speed ​​HS). In another specific application scenario, the storage device runs the boot code and enters the STC (start code). The host actively initiates a link establishment with the storage device, exchanging and confirming link parameters to establish the basic transmission link. The specific method is not limited here.

[0064] In a specific application scenario, after the basic transmission link is established, the storage device can read the host's UniPro version through the Device Management Entity (DME). The DME obtains the UniPro version information supported by the peer through basic messages, without involving the Adapt waveform messages corresponding to the communication version. Therefore, even if the communication versions of the storage device and the host do not match, the host's communication version can still be read.

[0065] In a specific application scenario, the storage device can also analyze the host's protocol behavior characteristics, such as message format, capability bits, or extended field patterns, during the establishment of the basic transmission link to determine the host's communication version. The specific active reading method is not limited here.

[0066] In this step, the storage device also reads the local version attribute to obtain the UniPro version currently used by the storage device.

[0067] Step S33: Compare the communication version of the host with the communication version of the storage device itself.

[0068] The storage device compares the host's communication version with its own communication version.

[0069] In some embodiments, when the communication version of the host matches the communication version of the storage device, it indicates that the storage device can directly establish a data transmission link with the host. The host then adjusts its link configuration to the highest performance mode under the current communication version and sends a performance command to the storage device. After receiving the performance command from the host, the storage device adjusts its link configuration to the highest performance mode under the current communication version based on the performance command.

[0070] The highest performance mode refers to the maximum transmission rate supported by the current communication version. For example, it corresponds to Gear 4 in UniPro 1.8 and Gear 5 in UniPro 2.0. If both the host and storage device are using UniPro 1.8, then in this step, both the host and storage device need to adjust their link configuration to Gear 4. And so on, without further elaboration.

[0071] In a specific application scenario, performance commands can be link configuration commands issued by the host through the Power Mode Change (PMC) mechanism.

[0072] After the link adjustment, the storage device sends preset data to the host in response to performance commands. At this point, both parties complete the initialization preparation of the underlying hardware and interfaces. The preset data can be a specific handshake message, an ACK acknowledgment frame, or a semaphore used to trigger an interrupt, informing the host that the device is ready. The semaphore used to trigger the interrupt can be a UniPro interrupt.

[0073] This step involves receiving performance commands and synchronously adjusting both ends to the highest performance mode under the current communication version, enabling the storage device to immediately enter its optimal working state, fully utilizing hardware performance, improving data transmission efficiency, and ultimately enhancing the overall system throughput performance.

[0074] Finally, a data transmission link is established with the host in the highest performance mode to facilitate data transfer between the storage device and the host. This data transmission link is used after the storage device enters normal operating mode; it is a high-speed transmission line specifically used for business data transmission, such as transmitting read and write commands issued by the host, as well as transmitting read and write data from the storage device.

[0075] Step S34: When the communication version of the host does not match the communication version of the storage device, record the communication version of the host.

[0076] In some embodiments, when the communication version of the host and the communication version of the storage device do not match, it means that a data transmission link cannot be established based on the current basic transmission link. Therefore, the storage device records the communication version of the host in order to establish a subsequent data transmission link. In a specific application scenario, if the storage device detects a communication version mismatch during the PMC (Power Mode Change) phase, it triggers a version adjustment process, sets a version change trigger flag, triggers a refresh process, and writes the host's communication version into the metadata area of ​​the storage medium for recording, ensuring the persistence of the host's communication version.

[0077] In a specific application scenario, when it is confirmed that the communication version of the host and the communication version of the storage device do not match, the storage device can send a link error message back to the host so that the host can be forced to restart in preparation for retrying the connection.

[0078] In a specific application scenario, when the communication version of the host and the communication version of the storage device do not match, the storage device may not provide additional feedback but instead continue to receive performance commands from the host. Based on these commands, the storage device adjusts its link configuration to the highest performance mode under the current communication version, and the host also adjusts its link configuration to the highest performance mode under the current communication version. After the link adjustment, the storage device sends preset data to the host in response to the performance commands.

[0079] The host then sends a service command to the storage device. However, due to a mismatch in communication versions, an exception occurs when the storage device executes the service command, resulting in a command failure response being returned to the host. In this case, upon receiving the command failure response, the host will automatically trigger a forced restart, i.e., a forced reset, and will prepare to retry the connection. In this application scenario, no additional control over the storage device is required; the host's own failure restart mechanism can trigger a second establishment of the basic transmission link.

[0080] Step S35: Re-establish the basic transmission link with the host through the storage device, load the target communication version in the metadata area through the storage device, modify the version attribute of the storage device based on the target communication version, and synchronously adjust the configuration parameters corresponding to the link layer of the storage device so that the communication version of the storage device itself matches the communication version of the host.

[0081] After the host restarts, since the host remains electrically connected to the storage device, a basic transmission link will be re-established between the host and the storage device. In a specific application scenario, the storage device and the host can establish a basic transmission link via PWM mode (PWMGear) or low-speed HS (Low-Speed ​​HS). In another specific application scenario, the storage device runs the boot code (BOOT) and enters the STC (start code). The host actively initiates a link with the storage device, exchanging and confirming link parameters to establish the basic transmission link. The specific method is not limited here.

[0082] Since the storage device is aware that its communication version is inconsistent with the host's, it will proactively load the target communication version from its metadata area during the establishment of the basic transmission link. This target communication version will match the host's communication version. Based on the target communication version, the storage device's version attribute will be modified, and the configuration parameters corresponding to the storage device's link layer will be adjusted synchronously to ensure that the storage device's communication version matches the host's. The host and storage device will then enter a normal matching state, exchanging and confirming link parameters to establish the basic transmission link.

[0083] Step S36: Receive a performance command sent by the host, and adjust the link configuration of the storage device to the highest performance mode under the current communication version based on the performance command; wherein, the link configuration of the host is synchronously adjusted to the highest performance mode under the current communication version.

[0084] The host adjusts its link configuration to the highest performance mode under the current communication version and sends a performance command to the storage device. After receiving the performance command sent by the host, the storage device also adjusts its link configuration to the highest performance mode under the current communication version based on the performance command.

[0085] The highest performance mode refers to the maximum transmission rate supported by the current communication version. For example, it corresponds to Gear 4 in UniPro 1.8 and Gear 5 in UniPro 2.0. If both the host and storage device are using UniPro 1.8, then in this step, both the host and storage device need to adjust their link configuration to Gear 4. And so on, without further elaboration.

[0086] In a specific application scenario, performance commands can be link configuration commands issued by the host through the Power Mode Change (PMC) mechanism.

[0087] After the link adjustment, the storage device sends preset data to the host in response to performance commands. At this point, both parties complete the initialization preparation of the underlying hardware and interfaces. The preset data can be a specific handshake message, an ACK confirmation frame, or a semaphore used to trigger an interrupt, informing the host that the device is ready. The semaphore used to trigger the interrupt can be a UniPro interrupt.

[0088] This step involves receiving performance commands and synchronously adjusting both ends to the highest performance mode under the current communication version. This allows the storage device to immediately enter its optimal working state after the version adaptive adjustment, fully utilizing hardware performance, improving data transmission efficiency, and ultimately enhancing the overall system throughput performance.

[0089] Step S37: Establish a data transfer link with the host in the highest performance mode to perform data transfer between the storage device and the host.

[0090] A data transfer link is established with the host in the highest performance mode to facilitate data transfer between the storage device and the host. This data transfer link is used after the storage device enters normal operating mode; it is a high-speed transmission line specifically used for business data transfer, such as transmitting read and write commands issued by the host, as well as transmitting read and write data from the storage device.

[0091] Through the above steps, the data transmission link establishment method of this embodiment replaces coarse-grained version number negotiation with active version detection by the storage device. It can directly obtain the communication version of the host and actively adjust it when establishing the basic transmission link for the next time. Thus, it adopts an adaptive version selection strategy instead of conservative downgrading or static configuration. At the same time, the storage device changes from passive waiting or repeated retries to active detection. Version adaptation can be completed when establishing the basic transmission link for the second time, which significantly shortens the startup delay and reduces power consumption, effectively solving the communication version mismatch problem when connecting across generations of platforms.

[0092] Please see Figure 4 , Figure 4 This is a flowchart illustrating the fourth embodiment of the data transmission link establishment method provided in this application. The data transmission link establishment method in this embodiment is applied to the host side and specifically includes the following steps: Step S41: Establish a basic transmission link between the host and the storage device, and have the communication version read by the storage device through the basic transmission link, so that when the storage device determines that the communication version of the host does not match the communication version of the storage device, it records the communication version of the host and sends the link abnormality information back to the host.

[0093] When the host and storage device are electrically connected, a basic transmission link is first established. This basic transmission link is a low-speed, low-level communication connection, suitable for transmitting basic information and performing basic communication, but not for high-speed business transactions. In a specific application scenario, the host and storage device can establish a basic transmission link via PWM (PWM Gear) mode or Low-Speed ​​HS (Hyper-Hyper-HS). In another specific application scenario, the storage device runs the boot code (BOOT), enters the STC (start code), and the host and storage device establish a link, exchanging and confirming link parameters to establish the basic transmission link. The specific method is not limited here.

[0094] In a specific application scenario, after the basic transmission link is established, the storage device can read the host's communication version, i.e., the UniPro version, through the Device Management Entity (DME). The storage device also reads the local version attribute to obtain the UniPro version currently used by the storage device.

[0095] The storage device compares the host's communication version with its own communication version. When the host's communication version matches the storage device's communication version, it means that the storage device can directly establish a data transmission link with the host, and then execute business instructions normally.

[0096] When the communication version of the host and the communication version of the storage device do not match, the storage device records the communication version of the host and sends link anomaly information back to the host. In a specific application scenario, if the storage device detects a communication version mismatch during the PMC (Power Mode Change) phase, it triggers a version adjustment process, sets a version change trigger flag, triggers a refresh process, and writes the host's communication version into the metadata area of ​​the storage medium to ensure the persistence of the host's communication version.

[0097] In a specific application scenario, after the host establishes a basic transmission link with the storage device, it sends normal service commands to the storage device. However, because the communication versions of the host and the storage device are inconsistent, the host receives service failure information from the storage device. In this application scenario, this service failure information can be reported as a link anomaly, thereby triggering a forced restart of the host and re-establishing the basic transmission link between the host and the storage device. Therefore, in this application scenario, neither the storage device nor the host needs to perform any additional operations to trigger the host's forced restart mechanism.

[0098] In a specific application scenario, after the host and storage device establish a basic transmission link, if the storage device determines that the communication version of the host and the communication version of the storage device are inconsistent, it can also send a link abnormality information separately as feedback.

[0099] Step S42: The host receives the link error information from the storage device, triggers the forced restart mechanism, and re-establishes the basic transmission link with the storage device.

[0100] Upon receiving link error information, the host triggers a forced restart mechanism. After restarting, it re-establishes the basic transmission link with the storage device. During this process, the storage device adjusts its communication version to match the host's communication version.

[0101] Specifically, during the second establishment of the basic transmission link, the storage device loads the target communication version in the metadata area, modifies the version attribute of the storage device based on the target communication version, and synchronously adjusts the configuration parameters corresponding to the link layer of the storage device so that the communication version of the storage device itself matches the communication version of the host.

[0102] Step S43: Adjust the host's link configuration to the highest performance mode under the current communication version, and send a performance command to the storage device so that the storage device's link configuration is synchronously adjusted to the highest performance mode under the current communication version.

[0103] The host adjusts its link configuration to the highest performance mode under the current communication version and sends a performance command to the storage device. After receiving the performance command sent by the host, the storage device also adjusts its link configuration to the highest performance mode under the current communication version based on the performance command.

[0104] The highest performance mode refers to the maximum transmission rate supported by the current communication version. For example, it corresponds to Gear 4 in UniPro 1.8 and Gear 5 in UniPro 2.0. If both the host and storage device are using UniPro 1.8, then in this step, both the host and storage device need to adjust their link configuration to Gear 4. And so on, without further elaboration.

[0105] In a specific application scenario, performance commands can be link configuration commands issued by the host through the Power Mode Change (PMC) mechanism.

[0106] After the link is adjusted, the host receives preset data sent by the storage device to receive a response to the performance command. At this point, both parties complete the initialization preparation of the underlying hardware and interface. The preset data can be a specific handshake message, an ACK confirmation frame, or a semaphore used to trigger an interrupt, which informs the host device that it is ready. The semaphore used to trigger the interrupt can be a UniPro interrupt.

[0107] This step involves receiving performance commands and synchronously adjusting both ends to the highest performance mode under the current communication version. This allows the storage device and the host to immediately enter the optimal working state after the version adaptive adjustment, fully utilizing hardware performance, improving data transmission efficiency, and enhancing the overall system throughput performance.

[0108] Step S44: Establish a data transfer link with the storage device in the highest performance mode to perform data transfer between the storage device and the host.

[0109] The host establishes a data transmission link with the storage device in the highest performance mode to facilitate data transfer between the two devices. This data transmission link is used after the storage device enters normal operating mode; it is a high-speed transmission line specifically used for business data transmission, such as transmitting read and write commands issued by the host, and transmitting read and write data from the storage device.

[0110] Through the above steps, the data transmission link establishment method of this embodiment replaces coarse-grained version number negotiation with active version detection by the storage device. It can directly obtain the communication version of the host and actively adjust it when establishing the basic transmission link for the next time. Thus, it adopts an adaptive version selection strategy instead of conservative downgrading or static configuration. At the same time, the storage device changes from passive waiting or repeated retries to active detection. Version adaptation can be completed when establishing the basic transmission link for the second time, which significantly shortens the startup delay and reduces power consumption, effectively solving the communication version mismatch problem when connecting across generations of platforms.

[0111] Please refer to this together. Figures 5-6 , Figure 5 This is a schematic diagram of the structure of a transmission system according to an embodiment of the present application; Figure 6 yes Figure 5 This is a schematic diagram illustrating the data flow of one embodiment of the transmission system in which terminals transmit data. Figure 6 The example shown is an embodiment in which the communication version of the storage device matches the communication version of the host.

[0112] The transmission system 50 of this embodiment includes a host 51 and a storage device 52, and the host 51 and the storage device 52 are electrically connected.

[0113] Before establishing the basic transmission link, storage device 52 pre-stores multiple communication versions in the metadata area of ​​the storage medium.

[0114] In response to the electrical connection between host 51 and storage device 52, host 51 sends a connection request command to storage device 52, and storage device 52 sends a connection response to host 51 to establish a basic transmission link.

[0115] Storage device 52 reads the communication version of host 51 through the device management entity, and reads its own communication version. It then compares the communication version of host 51 with its own communication version to determine that the two match.

[0116] Host 51 adjusts its link configuration to the highest performance mode under the current communication version and sends a performance request command to storage device 52. Storage device 52 adjusts its link configuration to the highest performance mode under the current communication version based on the performance command. Storage device 52 sends preset data to host 51 in response to the performance command.

[0117] When the communication version of host 51 matches the communication version of storage device 52, host 51 and storage device 52 establish a data transmission link. Host 51 sends a request service command to storage device 52, and storage device 52 sends service data back to host 51, thereby successfully executing the service command.

[0118] Please refer to further information. Figure 5 and Figure 7 , Figure 7 yes Figure 5 This is a schematic diagram illustrating the data flow of another implementation method for data transmission between terminals in the transmission system described in this embodiment. Wherein, Figure 7 The example shown illustrates an instance where the communication version of the storage device does not match the communication version of the host.

[0119] Before establishing a connection, storage device 52 pre-stores multiple communication versions in the metadata area of ​​the storage medium.

[0120] In response to the electrical connection between host 51 and storage device 52, host 51 sends a connection request command to storage device 52, and storage device 52 sends a connection response to host 51 to establish a basic transmission link.

[0121] Storage device 52 reads the communication version of host 51 through the device management entity, reads its own communication version, compares the communication version of host 51 with its own communication version, determines that the two do not match, and records the communication version of host 51 to the metadata area.

[0122] Host 51 adjusts its link configuration to the highest performance mode under the current communication version and sends a performance request command to storage device 52. Storage device 52 adjusts its link configuration to the highest performance mode under the current communication version based on the performance command. Storage device 52 sends preset data to host 51 in response to the performance command.

[0123] If the communication version of host 51 is incompatible with the communication version of storage device 52, host 51 and storage device 52 cannot establish a data transmission link. Host 51 sends a service request command to storage device 52, and storage device 52 sends a link failure message back to host 51, thereby triggering a forced restart of host 51.

[0124] Host 51 sends a connection request command to storage device 52 again. During the second establishment of the basic transmission link, storage device 52 loads the target communication version in the metadata area, modifies the version attribute of storage device 52, and synchronously adjusts the configuration parameters corresponding to the link layer of storage device 52. Storage device 52 sends a connection response to host 51 to establish the basic transmission link.

[0125] Host 51 adjusts its link configuration to the highest performance mode under the current communication version and sends a performance request command to storage device 52. Storage device 52 adjusts its link configuration to the highest performance mode under the current communication version based on the performance command. Storage device 52 sends preset data to host 51 in response to the performance command.

[0126] At this point, the communication version of host 51 and the communication version of storage device 52 are matched, and a data transmission link is established between host 51 and storage device 52. Host 51 sends a request service command to storage device 52, and storage device 52 sends service data back to host 51, thus successfully executing the service command.

[0127] Through the above steps, the data transmission link establishment method of this embodiment, by actively acquiring the host communication version data and comparing it with its own version during the first establishment of the basic transmission link, can accurately identify the differences between the versions at both ends, avoiding message parsing errors caused by version mismatch. Furthermore, when the host's communication version and the storage device's communication version do not match, the host version data is recorded, and the storage device version is adjusted to match the host during the second establishment of the basic transmission link. This achieves adaptive following of the storage device to the host's capabilities, without requiring any prior modifications to the host. It can actively match the host's communication version during use, establishing the data transmission link. This allows the storage device to quickly switch communication protocol versions on different host platforms, thereby improving the storage device's compatibility and versatility with diverse host platforms. Only one detection and adjustment process is needed, avoiding the startup delay caused by repeated retries or forced degradation in traditional solutions, making the data transmission link establishment process more efficient, significantly shortening startup latency and reducing power consumption.

[0128] Please see Figure 8 , Figure 8 This is a schematic diagram of a framework of an embodiment of the storage device provided in this application. The storage device 800 includes a storage unit 801 and a processor 802 coupled to each other. The processor 802 is used to execute program instructions stored in the storage unit 801 to implement the steps of the above-described method embodiment. In a specific implementation scenario, the storage device 800 may include, but is not limited to, a microcomputer, a server, etc. In addition, the storage device 800 may also include a laptop computer, a tablet computer, a solid-state drive, a memory card, NAND flash, etc., without limitation.

[0129] Specifically, processor 802 controls itself and storage unit 801 to implement the steps of any of the above method embodiments. Processor 802 can also be referred to as a CPU (Central Processing Unit). Processor 802 may be an integrated circuit device with signal processing capabilities. Processor 802 can also be a general-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component. A general-purpose processor can be a microprocessor or any conventional processor. Furthermore, processor 802 can be implemented using integrated circuit devices.

[0130] The above solution requires no prior modifications to the host and can proactively match the communication version of the host during use to establish a data transmission link. Moreover, it only requires a single detection and adjustment process to achieve mutual matching of the two communication versions, avoiding the startup delay caused by repeated retries or forced downgrades in traditional solutions, making the data transmission link establishment process more efficient.

[0131] Please see Figure 9 , Figure 9 This is a schematic diagram of an embodiment of a computer-readable storage medium provided in this application. The computer-readable storage medium 900 stores program instructions 901 that can be executed by a processor. The program instructions 901 are used to implement the steps of any of the above-described method embodiments.

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

[0133] The units described 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 network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.

[0134] 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.

[0135] 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 several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods of various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0136] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. A method for establishing a data transmission link, characterized in that, The method for establishing the data transmission link includes: A basic transmission link is established between the storage device and the host, and the communication version of the host and the communication version of the storage device itself are actively obtained. In response to a mismatch between the communication version of the host and the communication version of the storage device, the communication version of the host is recorded, and link anomaly information is fed back to the host to trigger the host's forced restart mechanism; A basic transmission link is re-established between the storage device and the host, and the communication version of the storage device itself is simultaneously adjusted to match the communication version of the host. A data transmission link is established with the host using a communication version that matches the host, so as to perform data transmission between the storage device and the host.

2. The method for establishing a data transmission link according to claim 1, characterized in that, The establishment of a basic transmission link between the storage device and the host, prior to this includes: Multiple communication versions are pre-stored in the metadata area of ​​the storage medium of the storage device; Adjusting the communication version of the storage device to match the communication version of the host includes: The target communication version is loaded from the metadata area via the storage device; wherein the target communication version matches the communication version of the host. Based on the target communication version, modify the version attribute of the storage device and synchronously adjust the configuration parameters corresponding to the link layer of the storage device so that the communication version of the storage device itself matches the communication version of the host.

3. The method for establishing a data transmission link according to claim 1, characterized in that, The step of establishing a data transmission link with the host using a communication version compatible with the host to perform data transmission between the storage device and the host includes: The system receives a performance instruction sent by the host and adjusts the link configuration of the storage device to the highest performance mode under the current communication version based on the performance instruction; wherein, the link configuration of the host is synchronously adjusted to the highest performance mode under the current communication version. After adjustment, preset data is sent to the host to respond to the performance command; The data transmission link is established with the host through the highest performance mode to perform data transmission between the storage device and the host.

4. The method for establishing a data transmission link according to claim 1, characterized in that, The step of actively obtaining the communication version of the host and reading the communication version of the storage device itself also includes: The storage device reads the communication version of the host through the device management entity, and also reads its own communication version. The communication version of the host is compared with the communication version of the storage device itself.

5. The method for establishing a data transmission link according to claim 4, characterized in that, The comparison of the communication version of the host and the communication version of the storage device itself also includes: When the communication version of the host matches the communication version of the storage device, the host receives a performance instruction sent by the host to adjust the link configuration of the storage device to the highest performance mode under the current communication version based on the performance instruction; wherein, the link configuration of the host is synchronously adjusted to the highest performance mode under the current communication version. After adjustment, preset data is sent to the host to respond to the performance command; The data transmission link is established with the host through the highest performance mode to perform data transmission between the storage device and the host.

6. A method for establishing a data transmission link, characterized in that, The method for establishing the data transmission link includes: A basic transmission link is established between the host and the storage device, and the communication version is read by the storage device through the basic transmission link. When the storage device determines that the communication version of the host does not match the communication version of the storage device, it records the communication version of the host and sends link abnormality information back to the host. After receiving the link error information, the host triggers a forced restart mechanism to re-establish the basic transmission link with the storage device, so that the communication version of the storage device is adjusted to match the communication version of the host. A data transmission link is established with the storage device to enable data transmission between the storage device and the host.

7. The method for establishing a data transmission link according to claim 6, characterized in that, The process of establishing a basic transmission link between the host and the storage device then includes: The host sends service instructions to the storage device; When the communication version of the host does not match the communication version of the storage device, the host receives link error information from the storage device to trigger a forced restart mechanism.

8. The method for establishing a data transmission link according to claim 6, characterized in that, Establishing a data transmission link with the storage device to perform data transmission between the storage device and the host includes: The host's link configuration is adjusted to the highest performance mode under the current communication version, and a performance command is sent to the storage device so that the storage device's link configuration is synchronously adjusted to the highest performance mode under the current communication version. After receiving the preset data sent by the storage device, a data transmission link is established with the storage device through the highest performance mode to carry out data transmission between the storage device and the host.

9. A storage device, characterized in that, It includes a storage unit and a processor that are coupled to each other, the processor being used to execute program instructions stored in the storage unit to implement the method for establishing a data transmission link as described in any one of claims 1 to 5 or the method for establishing a data transmission link as described in any one of claims 6 to 8.

10. A computer-readable storage medium having program instructions stored thereon, characterized in that, When the program instructions are executed by the processor, they implement the method for establishing a data transmission link as described in any one of claims 1 to 5 or the method for establishing a data transmission link as described in any one of claims 6 to 8.