An optimization method and optimization system for transmission parameters of a storage device
By comparing current and historical data from storage devices, it is determined whether tuning is needed, and transmission parameters are optimized. This solves the performance and signal integrity issues of storage devices in different usage scenarios, improving efficiency and signal quality.
Patent Information
- Application Number
- CN202511212094.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-28
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2045-08-28
AI Technical Summary
In different usage scenarios of storage devices, whether or not tuning operations are performed can lead to performance degradation or signal integrity issues.
By acquiring the current temperature, time, and operating mode of the storage device and comparing it with historical data, it determines whether tuning processing is needed and updates the transmission parameters if necessary.
The transmission parameters of the storage device have been optimized to ensure signal integrity in different usage scenarios, avoid unnecessary tuning operations, and improve efficiency and performance.
Smart Images

Figure CN120723172B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of static storage, and in particular to a method and system for optimizing transmission parameters of a storage device. BACKGROUND
[0002] In order to ensure compatibility between a host and an embedded storage device, the host will perform a tuning operation when the data transmission speed of the storage device changes, for example, when the storage device switches from a HS200 low-speed working mode to a HS400 high-speed working mode. The host will consume a large amount of time to perform the tuning operation on the storage device, resulting in a decline in the use performance of the storage device. Many hosts will choose to directly skip the tuning operation, but this will cause a problem of signal integrity. Therefore, whether the tuning operation needs to be performed in different use scenarios of the storage device has become a problem to be solved. SUMMARY
[0003] The present application provides a method and system for optimizing transmission parameters of a storage device to solve the technical problem of whether to perform a tuning operation in different use scenarios of the storage device.
[0004] The present application provides a method for optimizing transmission parameters of a storage device, comprising:
[0005] In a running phase of the storage device, a current temperature, a current time and a current working mode of the storage device at a current moment are obtained, and a historical temperature, a historical time and a historical working mode of the storage device at a last time of performing a tuning process are obtained;
[0006] The current temperature is compared with the historical temperature to obtain a temperature comparison result;
[0007] In a time period between the current time and the historical time, a number of control commands sent to the storage device is counted, and the number of control commands is compared with a preset number threshold to obtain a command number comparison result;
[0008] The current working mode is compared with the historical working mode to obtain a working mode comparison result;
[0009] According to the temperature comparison result, the command number comparison result and the working mode comparison result, it is determined whether to perform a tuning process on the storage device, and when the tuning process is performed on the storage device, corresponding transmission parameters are updated, and the storage device is controlled to communicate under the updated transmission parameters.
[0010] In an embodiment of the present application, the step of determining whether to perform a tuning process on the storage device according to the temperature comparison result, the command number comparison result and the working mode comparison result comprises:
[0011] when the temperature comparison result is that the temperature difference between the current temperature and the historical temperature does not exceed the preset temperature threshold, the command number comparison result is that the command number is less than the preset number threshold, and the working mode comparison result is that the current working mode is the same as the historical working mode, not performing the tuning processing on the storage device;
[0012] Otherwise, performing the tuning processing on the storage device.
[0013] In an embodiment of the present application, the step of performing the tuning processing on the storage device comprises:
[0014] judging the temperature difference:
[0015] when the temperature difference exceeds the preset temperature threshold, performing the tuning processing on the storage device through all clock phases in a preset clock phase interval;
[0016] Otherwise, obtaining a historical phase interval of the clock phase corresponding to the transmission parameter when the tuning processing is performed last time, and performing the tuning processing on the storage device through clock phases in the historical phase interval.
[0017] In an embodiment of the present application, the step of performing the tuning processing on the storage device through clock phases in the historical phase interval comprises:
[0018] performing data transmission verification on the storage device through the minimum clock phase and the maximum clock phase in the historical phase interval respectively:
[0019] when the data transmission verification corresponding to the minimum clock phase and the maximum clock phase are both passed, taking the historical phase interval as a current phase interval of the clock phase corresponding to the transmission parameter when the tuning processing is performed currently, and taking an intermediate clock phase in the current phase interval as a best sampling clock phase;
[0020] Otherwise, performing the tuning processing on the storage device through all clock phases in a preset clock phase interval.
[0021] In an embodiment of the present application, the optimization method further comprises:
[0022] after performing a reset operation in a start-up stage of the storage device, judging whether the storage device has an abnormal power-off:
[0023] when the storage device has the abnormal power-off, performing the tuning processing on the storage device through all clock phases in a preset clock phase interval, updating the corresponding transmission parameter, and controlling the storage device to communicate under the updated transmission parameter;
[0024] Otherwise, no tuning process is performed on the storage device.
[0025] In an embodiment of the present application, the optimization method further comprises:
[0026] In the power-on process of the storage device in the boot stage, it is determined whether the storage device has failure information of loading a timing parameter table:
[0027] When the failure information occurs, a tuning process is performed on the storage device through all clock phases in a preset clock phase interval, corresponding transmission parameters are updated, and the storage device is controlled to perform data transmission under the updated transmission parameters.
[0028] Otherwise, no tuning process is performed on the storage device.
[0029] In an embodiment of the present application, the step of performing a tuning process on the storage device through all clock phases in a preset clock phase interval comprises:
[0030] The minimum clock phase in the preset clock phase interval is adjusted step by step according to a preset phase step amount until the maximum clock phase in the preset clock phase interval is reached, to obtain a plurality of check clock phases.
[0031] Data transmission checking is performed on the storage device based on each check clock phase, and a plurality of check clock phases that pass the data transmission checking are obtained.
[0032] The obtained plurality of check clock phases are used to generate a check clock phase interval, and a middle clock phase in the check clock phase interval is used as the best sampling clock phase.
[0033] In an embodiment of the present application, the step of performing data transmission checking on the storage device based on each check clock phase to obtain a plurality of check clock phases that pass the data transmission checking comprises:
[0034] Data transmission checking is performed on the storage device based on each check clock phase.
[0035] When the data transmission checking corresponding to all check clock phases does not pass, a driving strength parameter in the transmission parameter is adjusted, data transmission checking is performed again based on each check clock phase, and a plurality of check clock phases that pass the data checking are obtained.
[0036] Otherwise, a plurality of check clock phases that pass the data transmission checking are directly obtained.
[0037] In one embodiment of the present application, the step of performing data transmission verification based on each check clock phase, and obtaining a plurality of check clock phases that pass the data verification, comprises:
[0038] According to the adjusted driving strength parameter, performing data transmission verification based on each check clock phase:
[0039] If the data transmission verification of all check clock phases still fails, generating failure information of the storage device;
[0040] Otherwise, obtaining a plurality of check clock phases that pass the data verification.
[0041] The present application also provides a system for optimizing transmission parameters of a storage device, comprising:
[0042] An obtaining unit is configured to, in an operation phase of the storage device, obtain a current temperature, a current time and a current working mode of the storage device at a current time, and a historical temperature, a historical time and a historical working mode of the storage device at a last time when a tuning process is performed;
[0043] A comparison unit is configured to compare the current temperature with the historical temperature to obtain a temperature comparison result;
[0044] The comparison unit is further configured to, in a time period between the current time and the historical time, count a number of control commands sent to the storage device, compare the number of control commands with a preset number threshold to obtain a command number comparison result;
[0045] The comparison unit is further configured to compare the current working mode with the historical working mode to obtain a working mode comparison result;
[0046] A control unit is configured to determine whether to perform a tuning process on the storage device according to the temperature comparison result, the command number comparison result and the working mode comparison result, and update corresponding transmission parameters when the tuning process is performed on the storage device, and control the storage device to communicate under the updated transmission parameters.
[0047] The beneficial effects of this invention are as follows: This invention proposes a method and system for optimizing the transmission parameters of a storage device. During the operation of the storage device, the method comprehensively considers the current temperature, current operating mode, and the number of control commands received by the storage device within the time period between the current time and historical times. Compared to the previous tuning process, if any of the above parameters undergoes a significant adjustment, it indicates a significant change in the operating environment of the storage device, which may lead to a decrease in signal integrity. In this case, it is necessary to determine whether to perform tuning. When performing tuning on the storage device, the corresponding transmission parameters are updated, and the storage device is controlled to communicate under the updated transmission parameters, thereby ensuring the integrity of the transmitted data and signals. Attached Figure Description
[0048] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. It is obvious that the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.
[0049] In the attached diagram:
[0050] Figure 1 This is a structural block diagram of a storage device provided in one embodiment of the present invention.
[0051] Figure 2 This is a schematic diagram illustrating the steps of a method for optimizing the transmission parameters of a storage device according to an embodiment of the present invention.
[0052] Figure 3 This is a structural block diagram of a system for optimizing the transmission parameters of a storage device according to an embodiment of the present invention. Detailed Implementation
[0053] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments. Various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0054] It is to be noted that the drawings provided in the following embodiments only schematically illustrate the basic concepts of the present application, and the drawings only show the components related to the present application, rather than the number, shape and size of the components when actually implemented. The actual implementation of each component may be a random change in the number, shape and size, and the layout of the components may be more complex.
[0055] In the following description, numerous specific details are discussed in order to provide a thorough understanding of the embodiments of the present application. However, it will be apparent to one of ordinary skill in the art that the embodiments of the present application can be practiced without these specific details. In other instances, well-known structures and devices are shown in block diagram form in order to avoid obscuring the embodiments of the present application.
[0056] Referring to Figures 2 to 3 The present application provides an optimization method and system for transmission parameters of a storage device 20, which can detect and optimize the product performance of storage chips such as eMMC (Embedded Multi Media Card), SSD (Solid State Disk), UFS (Universal Flash Storage), etc. The present application can make appropriate judgments on whether to perform a tuning operation in different use scenarios of the storage device 20. The present application can avoid the following situations, for example, the storage device 20 needs to perform a tuning operation, but actually does not perform the tuning processing, resulting in a problem of signal integrity, and for example, the storage device 20 does not need to perform a tuning operation, but actually performs the tuning processing, resulting in a problem of wasting a lot of time. The following will be described in detail through specific embodiments.
[0057] Referring to Figure 2 The present application provides an optimization method for transmission parameters of a storage device 20, which can include the following steps.
[0058] Step S10, in the running phase of the storage device, the current temperature, current time and current working mode of the storage device at the current time are obtained, and the historical temperature, historical time and historical working mode of the storage device at the last time of performing the tuning processing are obtained.
[0059] Specifically, as Figure 1 shown, in the running phase of the storage device 20, the host 10 communicates with the storage device 20, so as to query the state information of the storage device 20 at the current time, including the current temperature, current time and current working mode. At the same time, the host 10 reads the historical temperature, historical time and historical working mode of the last time of performing the tuning processing from the historical record of the storage device 20.
[0060] For example, the current temperature can be collected in real time by the temperature sensor built into the storage device 20, the current time is recorded by the system clock of the host 10, and the current operating mode is determined according to the data transfer rate mode of the storage device 20. For example, the operating mode of the storage device 20 can be low-speed HS200 mode or high-speed HS400 mode. Historical data is automatically updated and stored by the storage device 20 after each tuning process to ensure the accuracy of subsequent tuning decisions.
[0061] Step S20: Compare the current temperature with the historical temperature to obtain the temperature comparison result.
[0062] Specifically, host 10 calculates the difference between the current temperature and the historical temperature, and compares it with a preset temperature threshold to obtain a temperature comparison result. The temperature threshold can be ±10℃. If the temperature difference exceeds the threshold, it indicates that the operating environment of storage device 20 has changed significantly, which may lead to a decrease in signal integrity. In this case, a full tuning process needs to be triggered. If the temperature difference does not exceed the threshold, further judgment is made based on other conditions to determine whether tuning is necessary.
[0063] In addition, the temperature threshold setting needs to be adjusted according to the hardware characteristics of the storage device 20 and the actual application scenario to ensure that the transmission parameters are optimized in a timely manner when the temperature fluctuates greatly.
[0064] Step S30: Within the time period between the current time and the historical time, count the number of control commands sent to the storage device, compare the number of commands with a preset number threshold, and obtain the command number comparison result.
[0065] Specifically, host 10 counts the number of control commands (CMDs) sent to storage device 20 from historical time to the current time and compares them with a preset threshold to obtain the command count comparison result. For example, the threshold could be 1000 times. If the command count does not exceed the threshold, it indicates that storage device 20 has not experienced high-intensity operation during this period, and the signal state may remain stable, allowing the tuning process to be skipped. If the command count exceeds the threshold, frequent operation may lead to a deterioration in signal quality, requiring further evaluation of the tuning method. The threshold setting should refer to the platform's typical load behavior to avoid affecting tuning efficiency due to an excessively high or low threshold.
[0066] Step S40: Compare the current working mode with the historical working modes to obtain the working mode comparison results.
[0067] Specifically, the host 10 compares the current working mode of the storage device 20 with the historical working mode, and if both are consistent, for example, both are the high-speed HS400 mode, the working mode comparison result is that no tuning is triggered due to mode switching. If they are inconsistent, for example, from the low-speed HS200 mode to the high-speed HS400 mode, the signal timing offset may be caused due to mode change, and the tuning mode needs to be determined in combination with the temperature and the command quantity conditions. Of course, when the storage device 20 is switched from the high-speed HS400 mode to the low-speed HS200 mode, the signal timing offset may also be caused due to mode change, and the tuning mode also needs to be determined in combination with the temperature and the command quantity conditions.
[0068] Step S50, according to the temperature comparison result, the command quantity comparison result and the working mode comparison result, it is judged whether the tuning processing is executed to the storage device, and when the tuning processing is executed to the storage device, the corresponding transmission parameter is updated, and the storage device is controlled to communicate under the updated transmission parameter.
[0069] Specifically, the host 10 makes a decision by comprehensively considering the temperature comparison result, the command quantity comparison result and the working mode comparison result: if the temperature difference value does not exceed the threshold value, the command quantity does not exceed the threshold value and the working mode does not change, the tuning is skipped, and the historical transmission parameter is directly used, otherwise the tuning processing needs to be executed.
[0070] The tuning mode is further divided into three cases: if the temperature difference value exceeds the threshold value or the loading timing parameter table fails, the complete tuning is executed, and all clock phases are traversed. If only the command quantity exceeds the threshold value or the working mode changes, the partial tuning is executed, and only the leftmost and rightmost clock phases of the historical phase interval are verified, and if the partial tuning fails, the complete tuning is rolled back.
[0071] After the tuning is completed, the host 10 updates the clock phase interval and the best sampling point in the transmission parameter, and controls the storage device 20 to communicate by using the new transmission parameter.
[0072] In an embodiment of the present application, in step S50, the step of judging whether the tuning processing is executed to the storage device according to the temperature comparison result, the command quantity comparison result and the working mode comparison result can include step S510 and step S520.
[0073] Step S510, when the temperature comparison result is that the temperature difference value between the current temperature and the historical temperature does not exceed the preset temperature threshold value, the command quantity comparison result is that the command quantity is less than the preset quantity threshold value, and the working mode comparison result is that the current working mode is the same as the historical working mode, the tuning processing is not executed to the storage device.
[0074] Specifically, the host 10 judges whether to skip the tuning process by checking the temperature comparison result, the command quantity comparison result and the working mode comparison result. First, the host 10 confirms whether the difference between the current temperature and the historical temperature is within a preset temperature threshold range. If the threshold is not exceeded, it means that the change in the ambient temperature has a small impact on the signal integrity. Then, the host 10 checks whether the number of commands received from the last tuning time to the current time is lower than a preset number threshold. If the threshold is lower, it means that the storage device 20 has not experienced high-intensity operation, and the signal state can remain stable. Finally, the host 10 verifies whether the current working mode is consistent with the historical working mode. If it is consistent, the timing problem caused by mode switching is excluded.
[0075] If the above three conditions are met, the host 10 determines that the tuning process is not needed, and directly uses the transmission parameters recorded in the last tuning, such as the clock phase interval and the optimal sampling point, thereby avoiding unnecessary performance overhead. This decision mechanism is particularly suitable for the scenario after the host 10 performs a soft reset (rst n). At this time, the storage device 20 has not experienced power failure and the working state is continuous, and maintaining the historical parameters can significantly improve the efficiency.
[0076] Step S520, otherwise, performing the tuning process on the storage device.
[0077] In an embodiment of the present application, specifically, for step S520, it can further include steps S521, S522 and S523.
[0078] Step S521, judging the temperature difference.
[0079] Specifically, the host 10 first accurately judges the temperature difference between the current temperature and the historical temperature. The host 10 compares the calculated temperature difference with the temperature threshold to form a temperature difference judgment result. The temperature difference judgment process is the key first step to determine the subsequent tuning strategy, because the temperature change will directly affect the electrical characteristics and signal transmission quality of the storage device 20.
[0080] Step S522, when the temperature difference exceeds the preset temperature threshold, performing the tuning process on the storage device through all clock phases in the preset clock phase interval.
[0081] Specifically, when the temperature difference exceeds the preset threshold, the host 10 will perform a complete tuning process. Complete tuning means that the host 10 needs to traverse all possible phase values in the preset clock phase interval, for example, 0 to 127 phase points, and perform data transmission verification testing on each phase point. Although this process takes a long time, it can ensure that the optimal transmission parameters are re-established under the most severe temperature change conditions.
[0082] Step S523, otherwise, obtaining a historical phase interval of the clock phase in the corresponding transmission parameter when the last time the tuning process is performed, and performing the tuning process on the storage device through the clock phase in the historical phase interval.
[0083] Specifically, when the temperature difference does not exceed the preset threshold, the host 10 adopts a partial tuning strategy. The host 10 first obtains the historical phase interval information of the clock signal when the last time the tuning is successful from the historical record of the storage device 20, including the leftmost phase value and the rightmost phase value of the historical phase interval. Then the host 10 only performs data transmission verification test on the two boundary phases.
[0084] In an embodiment of the present application, specifically, step S523 can include step S5231, step S5232 and step S5233.
[0085] Step S5231, performing data transmission verification on the storage device through the minimum clock phase and the maximum clock phase in the historical phase interval.
[0086] Step S5232, when the data transmission verification corresponding to the minimum clock phase and the maximum clock phase are both passed, taking the historical phase interval as the current phase interval of the clock phase in the corresponding transmission parameter when the tuning process is currently performed, and taking the intermediate clock phase in the current phase interval as the best sampling clock phase.
[0087] Step S5233, otherwise, performing the tuning process on the storage device through all the clock phases in the preset clock phase interval.
[0088] Specifically, if the data transmission verification test corresponding to the two boundary phases is passed, it indicates that the historical phase interval is still effective, and the host 10 will maintain the historical phase interval unchanged and continue to use the intermediate clock phase value as the best sampling point. If the data transmission verification test corresponding to any boundary phase fails, it indicates that the signal condition has changed, and it is necessary to upgrade to complete tuning process to re-scan all phase points to determine a new effective interval. This partial tuning method can significantly reduce the tuning time and improve the system efficiency in the case of small temperature change.
[0089] In an embodiment of the present application, the optimization method of the transmission parameter of the storage device 20 further includes step S610, step S620 and step S630.
[0090] Step S610, after performing the reset operation in the storage device startup stage, judging whether the storage device has abnormal power failure.
[0091] Specifically, during the power-on initialization phase of the storage device 20, the host 10 first checks the abnormal power-off flag bit in the device status register. The flag bit is cleared by the storage device 20 controller at each normal shutdown and remains when there is an abnormal power-off.
[0092] If the abnormal power-off flag bit is detected to be set, it is determined that there may be damage or failure of the timing parameter table. The host 10 then sends a command to read the timing parameter table, and confirms whether the loading is successful by checking the CRC check code of the returned data and the data structure integrity. If the CRC check fails or the data structure is abnormal, it is determined that the loading of the timing parameter table fails. This determination process focuses on the influence of abnormal power-off on the integrity of the parameter table, and ensures that subsequent operations are based on reliable parameter configuration.
[0093] Step S620, when the storage device has an abnormal power-off, performing tuning processing on the storage device through all clock phases in the preset clock phase interval, updating the corresponding transmission parameters, and controlling the storage device to communicate under the updated transmission parameters.
[0094] Specifically, when it is confirmed that the loading of the timing parameter table fails due to abnormal power-off, the host 10 immediately starts the complete tuning process. The host 10 will then gradually adjust the sampling clock phase according to the preset clock phase range, and perform complete data transmission testing at each phase point, including writing test pattern and reading back for verification. The host 10 records all the phase points that pass the verification, calculates a new effective phase interval, and selects the midpoint of the interval as the optimal sampling clock phase.
[0095] After the tuning is completed, the host 10 writes the new timing parameters into the storage device 20 register, updates the timing parameter table backup in the storage device 20, and finally clears the abnormal power-off flag bit, ensuring that the optimal transmission parameters are rebuilt after the abnormal power-off of the storage device 20 is restored.
[0096] Step S630, otherwise, no tuning processing is performed on the storage device.
[0097] Specifically, when the abnormal power-off flag bit is not detected or the loading of the timing parameter table is successful, the host 10 skips the tuning process.
[0098] In an embodiment of the present application, the optimization method of the transmission parameters of the storage device 20 further includes steps S710, S720 and S730.
[0099] Step S710, during the power-on process in the power-on phase of the storage device, determining whether there is failure information of loading the timing parameter table.
[0100] Specifically, during the power-on initialization of the storage device 20, the host 10 initiates the storage device 20 by sending an initialization command sequence. The storage device 20 controller attempts to read a pre-stored timing parameter table from the non-volatile memory, which contains key parameters such as the optimal clock phase and drive strength determined in the historical tuning process. The host 10 determines the loading result by analyzing the status register value and data response returned by the storage device 20.
[0101] If the storage device 20 returns a specific error code, such as a CRC check error or a timeout error, or the returned parameter table data does not conform to the expected format, it is determined that the loading of the timing parameter table fails. This usually occurs when the last abnormal power-off of the device causes the parameter table to be damaged, or when the hardware state of the device changes significantly. The host 10 needs to pay special attention to this determination result, as it is directly related to whether the complete tuning process needs to be performed subsequently.
[0102] Step S720, when the failure information occurs, performing tuning processing on the storage device through all clock phases in the preset clock phase interval, updating the corresponding transmission parameters, and controlling the storage device to perform data transmission under the updated transmission parameters.
[0103] Specifically, when the timing parameter table loading failure is detected, the host 10 immediately starts the complete tuning processing flow. The host 10 will then adjust the sampling clock phase step by step according to the preset clock phase range, and perform complete data transmission testing at each phase point, including writing test pattern and reading back for verification. The host 10 records all the verified phase points, calculates a new effective phase interval, and selects the midpoint of the interval as the optimal sampling clock phase.
[0104] Step S730, otherwise, not performing tuning processing on the storage device.
[0105] Specifically, when the timing parameter table is loaded successfully, the host 10 skips the tuning processing flow.
[0106] In steps S522, S5233, S620 and S720, the step of performing tuning processing on the storage device through all clock phases in the preset clock phase interval can include steps S810, S820 and S830.
[0107] Step S810, adjusting the minimum clock phase in the preset clock phase interval step by step according to the preset phase step amount, until the maximum clock phase in the preset clock phase interval is reached, to obtain a plurality of verification clock phases.
[0108] Specifically, the host 10 starts a clock phase scanning process, starting from the minimum value of the preset clock phase interval, for example, phase 0, and gradually increases the clock phase value according to the preset phase step, for example, the phase step is 1 phase unit. After each phase adjustment, the host 10 writes the current phase value to the clock phase control register of the storage device 20 to ensure that the storage device 20 uses the specified phase for data transmission verification.
[0109] This scanning process continues until the phase value reaches the maximum value of the preset interval, for example, phase 127. During the entire scanning process, the host 10 needs to ensure that the stabilization time of each phase point is long enough, usually waiting for several clock cycles to stabilize the signal, and then performing subsequent data transmission verification. This step-by-step adjustment process generates a series of equally spaced verification clock phases, providing complete phase coverage for subsequent signal quality testing.
[0110] Step S820, performing data transmission verification on the storage device based on each verification clock phase, and obtaining a plurality of verification clock phases that pass the data transmission verification.
[0111] Specifically, for each set verification clock phase, the host 10 performs a strict data transmission verification process. First, the host 10 writes a specific test data pattern to the storage device 20, which usually contains alternating 0 and 1, used to detect signal integrity at different phases. Then, the host 10 reads the returned data from the storage device 20 and compares it bit by bit with the original write data. If all data bits match, the current clock phase is determined to pass the verification. If there is any mismatch, the current phase is determined to fail the verification.
[0112] The host 10 needs to repeat this write-read-compare process for each phase multiple times, usually 3-5 times, to ensure the reliability of the test results. All verification clock phases that pass the verification will be recorded in a special pass list, which will be used to determine the best sampling phase later.
[0113] Step S830, generating a verification clock phase interval from the obtained plurality of verification clock phases, and taking the middle clock phase in the verification clock phase interval as the best sampling clock phase.
[0114] Specifically, the host 10 analyzes all the verification clock phases that pass the verification, first sorts these phases by numerical value, and then determines the continuous phase interval. If the pass phases are continuous, the minimum and maximum phases are directly taken as the interval boundaries. If there are multiple discontinuous pass intervals, the longest interval containing the most continuous pass phases is selected.
[0115] After the valid phase interval is determined, the host 10 calculates the middle value of the interval as the optimal sampling clock phase, which can be calculated by the formula (minimum phase + maximum phase) / 2, and takes the nearest integer value. Finally, the host 10 writes the optimal sampling phase value to the clock phase control register of the storage device 20 as the fixed sampling point for subsequent normal data transmission. At the same time, the host 10 also records the complete valid phase interval information for reference when re-tuning is needed.
[0116] In an embodiment of the present application, in step S820, steps S821, S822 and S823 can be included.
[0117] Step S821, data transmission verification is performed on the storage device based on each verification clock phase.
[0118] Specifically, the host 10 performs a rigorous data transmission verification process for each preset verification clock phase. For each phase point in the clock phase interval, the host 10 first accurately configures the phase value into the clock control register of the storage device 20 to ensure accurate signal sampling timing. Then the host 10 sends a specific test data pattern, which is usually designed to contain a high-frequency toggling 0101 alternating sequence and a low-frequency continuous 0000 / 1111 sequence, to comprehensively detect signal integrity at different phases.
[0119] Step S822, when the data transmission verification corresponding to all verification clock phases fails, the drive strength parameter in the transmission parameter is adjusted, and data transmission verification is performed again based on each verification clock phase to obtain multiple verification clock phases that pass the data verification.
[0120] Specifically, after the initial scan is completed, if it is found that all verification clock phases fail the data transmission verification, the host 10 will start the drive strength adjustment process. The host 10 first reads the current drive strength configuration of the storage device 20, modifies the drive strength parameter according to the preset adjustment strategy, which usually starts from the lowest strength and gradually increases. After each adjustment, the host 10 needs to reinitialize the storage device 20 interface and then completely repeat the test process of all verification clock phases.
[0121] The adjustment range of the drive strength needs to be determined according to the specifications of the storage device 20, and a typical value is 4-8 configurable levels. If a phase point that passes the verification appears at a certain drive strength level, the strength level and the corresponding valid phase are recorded. If no passing phase is found after traversing all drive strength levels, it is determined as a hardware failure.
[0122] Step S823, otherwise, directly obtain multiple verification clock phases that pass the data transmission verification.
[0123] Specifically, when the initial phase scanning detects at least one clock phase that passes the verification, the host 10 directly enters the result analysis stage. The host 10 first sorts all the phase points that pass the verification, and checks the continuity feature thereof. For the passing phases that are discretely distributed, the largest continuous phase interval is selected preferentially. For the case of multiple continuous intervals, the longest continuous interval is selected.
[0124] In an embodiment of the present application, in the step S822, the step of obtaining the multiple check clock phases that pass the data transmission verification based on each check clock phase after the driving strength parameter is adjusted, can include a step S8221, a step S8222 and a step S8223.
[0125] The step S8221, the data transmission verification is performed based on each check clock phase according to the adjusted driving strength parameter.
[0126] Specifically, after the driving strength parameter is adjusted, the host 10 needs to re-perform the complete clock phase verification process. First, the new driving strength value is written into the driving control register of the storage device 20 to ensure that the parameter change takes effect. Then, the host 10 starts from the preset clock phase interval starting point, and configures each check clock phase in turn according to the fixed phase step value.
[0127] The step S8222, if the data transmission verification of all the check clock phases still fails, the fault information of the storage device is generated.
[0128] Specifically, after the host 10 completes the full phase scanning of all the preset driving strength levels, if still no clock phase that can pass the data transmission verification is found, it is determined that the storage device 20 has a hardware fault.
[0129] The step S8223, otherwise, the multiple check clock phases that pass the data verification are obtained.
[0130] Specifically, when the clock phase that passes the verification is detected at a certain driving strength level, the host 10 immediately terminates the further driving strength adjustment, and locks the current optimal driving strength configuration. Then, the host 10 performs statistical analysis on all the phase points that pass the verification, first sorts them according to the phase value, and then identifies the largest continuous passing phase interval.
[0131] Please refer to Figure 3 In an embodiment of the present application, a transmission parameter optimization system 100 of a storage device 20 is provided, which can include an obtaining unit 110, a comparison unit 120 and a control unit 130.
[0132] The acquisition unit 110 is configured to acquire, in a running stage of the storage device 20, a current temperature, a current time and a current working mode of the storage device 20 at a current time, and a historical temperature, a historical time and a historical working mode of the storage device 20 at a last time of performing the tuning processing.
[0133] The comparison unit 120 is configured to compare the current temperature with the historical temperature to obtain a temperature comparison result.
[0134] The comparison unit 120 is further configured to count a number of commands of sending the control commands to the storage device 20 in a time period between the current time and the historical time, compare the number of commands with a preset number threshold to obtain a command number comparison result.
[0135] The comparison unit 120 is further configured to compare the current working mode with the historical working mode to obtain a working mode comparison result.
[0136] The control unit 130 is configured to determine whether to perform the tuning processing on the storage device 20 according to the temperature comparison result, the command number comparison result and the working mode comparison result, and update the corresponding transmission parameters when the tuning processing is performed on the storage device 20, and control the storage device 20 to communicate under the updated transmission parameters.
[0137] Therefore, the temperature comparison result, the command number comparison result and the working mode comparison result can be comprehensively considered for decision. Specifically, if the temperature difference does not exceed the threshold, the number of commands does not exceed the threshold, and the working mode does not change, the tuning is skipped, and the historical transmission parameters are directly used, otherwise the tuning processing needs to be performed.
[0138] In summary, the application provides a method and a system for optimizing transmission parameters of a storage device. In a running stage of the storage device, the current temperature, the current working mode of the storage device, and the number of commands received by the storage device in a time period between the current time and the historical time are comprehensively considered. When any of the above parameters is significantly adjusted compared to the last time of performing the tuning processing, it indicates that the working environment of the storage device has changed significantly, which may cause the signal integrity to decrease. At this time, it is necessary to determine whether to perform the tuning processing. When the tuning processing is performed on the storage device, the corresponding transmission parameters are updated, and the storage device is controlled to communicate under the updated transmission parameters, so as to ensure the integrity of the data and signal transmitted by the storage device.
[0139] The above embodiments only exemplarily illustrate the principles and effects of the application, and are not used to limit the application. Any person skilled in the art can modify or change the above embodiments without departing from the spirit and scope of the application. Therefore, all equivalent modifications or changes made by those skilled in the art without departing from the spirit and technical thought of the application should be covered by the claims of the application.
Claims
1. A method of optimizing transmission parameters of a storage device, characterized in that, The method comprises the following steps: In the running stage of the storage device, the current temperature, the current time and the current working mode of the storage device at the current moment are obtained, as well as the historical temperature, the historical time and the historical working mode of the storage device at the last time of executing the tuning processing; The current temperature is compared with the historical temperature to obtain a temperature comparison result; In the time period between the current time and the historical time, the number of control commands sent to the storage device is counted, and the number of commands is compared with a preset number threshold to obtain a command number comparison result; The current working mode is compared with the historical working mode to obtain a working mode comparison result; According to the temperature comparison result, the command number comparison result and the working mode comparison result, it is judged whether to execute the tuning processing on the storage device, and when the tuning processing is executed on the storage device, the corresponding transmission parameter is updated, and the storage device is controlled to communicate under the updated transmission parameter; The step of judging whether to execute the tuning processing on the storage device according to the temperature comparison result, the command number comparison result and the working mode comparison result comprises: When the temperature difference between the current temperature and the historical temperature does not exceed the preset temperature threshold, the number of commands is less than the preset number threshold, and the current working mode is the same as the historical working mode, the tuning processing is not executed on the storage device; Otherwise, the tuning processing is executed on the storage device; The step of executing the tuning processing on the storage device comprises: judging the temperature difference: When the temperature difference exceeds the preset temperature threshold, the tuning processing is executed on the storage device through all clock phases in the preset clock phase interval; Otherwise, the historical phase interval of the clock phase in the corresponding transmission parameter when the tuning processing is executed last time is obtained, and the tuning processing is executed on the storage device through the clock phases in the historical phase interval.
2. The method of optimizing transfer parameters of a storage device according to claim 1, wherein, The step of executing the tuning processing on the storage device through the clock phases in the historical phase interval comprises: Through the minimum clock phase and the maximum clock phase in the historical phase interval, data transmission verification is respectively performed on the storage device: When the data transmission verification corresponding to the minimum clock phase and the maximum clock phase both pass, the historical phase interval is taken as the current phase interval of the clock phase in the corresponding transmission parameter when the tuning processing is currently executed, and the intermediate clock phase in the current phase interval is taken as the best sampling clock phase; Otherwise, the tuning processing is executed on the storage device through all clock phases in the preset clock phase interval.
3. The method of optimizing transfer parameters of a storage device of claim 1, wherein, The optimization method further comprises: After executing the reset operation in the storage device startup stage, it is judged whether the storage device has abnormal power failure: When the storage device has abnormal power failure, the tuning processing is executed on the storage device through all clock phases in the preset clock phase interval, the corresponding transmission parameter is updated, and the storage device is controlled to communicate under the updated transmission parameter; Otherwise, no tuning processing is performed on the storage device.
4. The method of optimizing transfer parameters of a storage device of claim 1, wherein, The optimization method further comprises: In a power-on process in a storage device startup stage, it is determined whether failure information of loading a timing parameter table occurs in the storage device: When the failure information occurs, tuning processing is performed on the storage device through all clock phases in a preset clock phase interval, corresponding transmission parameters are updated, and the storage device is controlled to perform data transmission under the updated transmission parameters; Otherwise, no tuning processing is performed on the storage device.
5. The method of optimizing transfer parameters of a storage device according to any one of claims 1, 2, 3 or 4, characterized in that, The step of performing tuning processing on the storage device through all clock phases in a preset clock phase interval comprises: The minimum clock phase in the preset clock phase interval is adjusted step by step according to a preset phase step amount until the maximum clock phase in the preset clock phase interval is reached, to obtain a plurality of check clock phases; Data transmission checking is performed on the storage device based on each check clock phase, to obtain a plurality of check clock phases that pass the data transmission checking; The obtained plurality of check clock phases are used to generate a check clock phase interval, and a middle clock phase in the check clock phase interval is used as a best sampling clock phase.
6. The method of optimizing transmission parameters of a storage device according to claim 5, wherein, The step of performing data transmission checking on the storage device based on each check clock phase to obtain a plurality of check clock phases that pass the data transmission checking comprises: Data transmission checking is performed on the storage device based on each check clock phase: When the data transmission checking corresponding to all check clock phases all fails, a driving strength parameter in the transmission parameter is adjusted, data transmission checking is performed again based on each check clock phase, and a plurality of check clock phases that pass the data checking are obtained; Otherwise, the plurality of check clock phases that pass the data transmission checking are directly obtained.
7. The method of optimizing transfer parameters of a storage device according to claim 6, wherein, The step of performing data transmission checking on the storage device based on each check clock phase to obtain a plurality of check clock phases that pass the data checking comprises: Data transmission checking is performed on the storage device based on each check clock phase according to the adjusted driving strength parameter: If the data transmission checking of all check clock phases still all fails, failure information of the storage device is generated; Otherwise, the plurality of check clock phases that pass the data checking are obtained.
8. An optimization system for transmission parameters of a storage device, characterized in that, Comprise: The acquisition unit is configured to acquire, in a running stage of the storage device, a current temperature, a current time and a current working mode of the storage device at a current moment, and a historical temperature, a historical time and a historical working mode of the storage device at a last time when tuning processing is performed; The comparison unit is configured to compare the current temperature with the historical temperature to obtain a temperature comparison result; The comparison unit is further configured to count a number of control commands sent to the storage device in a time period between the current time and the historical time, compare the number of control commands with a preset number threshold to obtain a command number comparison result; The comparison unit is further configured to compare the current working mode with the historical working mode to obtain a working mode comparison result; The control unit is configured to determine whether to perform tuning processing on the storage device according to the temperature comparison result, the command quantity comparison result and the working mode comparison result, and update the corresponding transmission parameter when the tuning processing is performed on the storage device, and control the storage device to communicate under the updated transmission parameter. The step of determining whether to perform tuning processing on the storage device according to the temperature comparison result, the command quantity comparison result and the working mode comparison result comprises: When the temperature comparison result is that a temperature difference between the current temperature and the historical temperature does not exceed a preset temperature threshold, the command quantity comparison result is that the command quantity is less than a preset quantity threshold, and the working mode comparison result is that the current working mode is the same as the historical working mode, the tuning processing is not performed on the storage device; Otherwise, the tuning processing is performed on the storage device; The step of performing the tuning processing on the storage device comprises: determining a temperature difference value; When the temperature difference value exceeds the preset temperature threshold, the tuning processing is performed on the storage device through all clock phases in a preset clock phase interval; Otherwise, a historical phase interval of a clock phase in the corresponding transmission parameter when the tuning processing is performed last time is obtained, and the tuning processing is performed on the storage device through the clock phase in the historical phase interval.
Citation Information
Patent Citations
Algorithm for optimal usage of external memory tuning sequence
CN104704477A