Disclosure of Invention
The invention provides a storage device and a control method of communication frequency thereof, which are used for solving the technical problem that a large amount of data identification errors are easy to generate between a host and the storage device in a high-temperature environment in the prior art.
The invention provides a storage device, comprising:
a flash memory;
The temperature sensor is used for measuring the operation temperature of the main controller;
the main control unit, with flash memory electric connection, the main control unit includes:
A status register for storing temperature status data of the main controller, the temperature status data reflecting the operation temperature of the main controller and the magnitude of the communication frequency, and
The central processing unit is used for acquiring the current communication frequency and the running temperature of the main controller, comparing the current communication frequency with a preset threshold frequency and the current running temperature with the preset threshold temperature, generating temperature state data based on a comparison result, and writing the temperature state data into the state register, wherein the threshold temperature and the threshold frequency are nonzero constants;
The central processing unit sends the temperature state data to the host, and the host sends a control instruction of the communication frequency to the storage device based on the temperature state data to maintain or adjust the communication frequency of the main controller.
In one embodiment of the present invention, the central processing unit is configured to set a plurality of threshold temperatures, where the plurality of threshold temperatures divide the operating temperature into a plurality of temperature intervals, and each of the temperature intervals corresponds to one of the threshold frequencies;
the central processing unit is used for keeping the current communication frequency when the current communication frequency of the main controller is smaller than or equal to the corresponding threshold frequency in a certain temperature interval, and sending the temperature state data to the host computer when the current communication frequency of the main controller is larger than the corresponding threshold frequency so as to adjust the communication frequency of the main controller.
In one embodiment of the present invention, when the current communication frequency of the main controller is less than or equal to the corresponding threshold frequency, the central processing unit receives a command for maintaining the communication frequency returned by the host after sending the corresponding temperature state data to the host;
When the current communication frequency of the main controller is greater than the corresponding threshold frequency, the central processing unit receives an adjustment instruction of the communication frequency returned by the host after sending the corresponding temperature state data to the host, so that the communication frequency adjusted by the main controller is smaller than the corresponding threshold frequency.
In one embodiment of the present invention, the central processing unit is configured to set, among the plurality of temperature intervals and the plurality of threshold frequencies, a magnitude of the temperature interval to be inversely proportional to a magnitude of the threshold frequency, such that the temperature interval having a larger value corresponds to the threshold frequency having a smaller value.
In one embodiment of the present invention, the status register is provided with a general identifier bit area, a reserved bit area, a command line bit area, and a test mode bit area, where the general identifier bit area, the reserved bit area, and the command line bit area store the operation status data of the storage device, and the test mode bit area is used to store the temperature status data of the storage device.
In one embodiment of the present invention, the central processing unit is configured to set at least three of the threshold temperatures, the at least three threshold temperatures dividing the operating temperature into at least four temperature intervals;
The central processing unit is used for storing the temperature state data on the test mode bit as a retention value when the current communication frequency of the main controller is smaller than or equal to a corresponding threshold frequency and storing the temperature state data on the test mode bit as a first value, a second value or a third value when the current communication frequency of the main controller is larger than the corresponding threshold frequency when the current communication frequency of the main controller is in a certain temperature interval.
In an embodiment of the present invention, the central processing unit is configured to store the temperature status data on the test mode bit as a first value, a second value, and a third value when the current communication frequency of the main controller is greater than a corresponding threshold frequency in a first temperature interval, a second temperature interval, and a third temperature interval of the main controller, where the first value < the second value < the third value.
The invention also provides a control method of the communication frequency of the storage device, which comprises the following steps:
Measuring the operating temperature of a main controller in the storage device;
Acquiring the current communication frequency and the running temperature of the main controller, and comparing the current communication frequency with a preset threshold frequency and the current running temperature with a preset threshold temperature, wherein the threshold temperature and the threshold frequency are nonzero constants;
generating temperature state data based on a comparison result, and writing the temperature state data into a state register of the main controller, wherein the temperature state data reflects the operation temperature and the communication frequency of the main controller;
And sending the temperature state data to a host, and sending a control instruction of the communication frequency to the storage device by the host based on the temperature state data to maintain or adjust the communication frequency of the main controller.
In one embodiment of the present invention, the step of transmitting the temperature status data to the host includes:
setting a plurality of threshold temperatures, wherein the plurality of threshold temperatures divide the operating temperature into a plurality of temperature intervals, and each temperature interval corresponds to one threshold frequency;
When the current communication frequency of the main controller is smaller than or equal to the corresponding threshold frequency in a certain temperature interval, the current communication frequency is kept;
And when the current communication frequency of the main controller is larger than the corresponding threshold frequency in the certain temperature interval of the main controller, sending the temperature state data to the main machine so as to adjust the communication frequency of the main controller.
In one embodiment of the present invention, when the current communication frequency of the main controller is less than or equal to a corresponding threshold frequency in a certain temperature interval of the main controller, after sending corresponding temperature state data to the host, a maintaining instruction of the communication frequency returned by the host is received;
and when the current communication frequency of the main controller is greater than the corresponding threshold frequency in the certain temperature interval, after sending the corresponding temperature state data to the host, receiving an adjustment instruction of the communication frequency returned by the host, so that the communication frequency adjusted by the main controller is smaller than the corresponding threshold frequency.
The storage device and the control method of the communication frequency thereof have the beneficial effects that the good communication quality between the host and the storage device can be ensured under different operation temperatures of the storage device, and the service performance and the service life of the storage device are improved.
Detailed Description
Other advantages and effects of the present invention will become apparent to those skilled in the art from the following disclosure, which describes the embodiments of the present invention with reference to specific examples. The invention may be practiced or carried out in other embodiments that depart from the specific details, and the details of the present description may be modified or varied from the spirit and scope of the present invention. It should be noted that the following embodiments and features in the embodiments may be combined with each other without conflict.
It should be noted that the illustrations provided in the following embodiments merely illustrate the basic concept of the present invention by way of illustration, and only the components related to the present invention are shown in the drawings and are not drawn according to the number, shape and size of the components in actual implementation, and the form, number and proportion of the components in actual implementation may be arbitrarily changed, and the layout of the components may be more complicated.
In the following description, numerous details are set forth in order to provide a more thorough explanation of embodiments of the present invention, it will be apparent, however, to one skilled in the art that embodiments of the present invention may be practiced without these specific details, in other embodiments, well-known structures and devices are shown in block diagram form, rather than in detail, in order to avoid obscuring the embodiments of the present invention.
Referring to fig. 1 to 4, the present invention provides a storage device and a method for controlling a communication frequency thereof, which can be applied to storage devices such as eMMC (Embedded Multi MEDIA CARD), SSD (Solid STATE DISK ), UFS (Univeral Flash Storage, universal flash memory) and the like. The invention can ensure good communication quality between the host 10 and the storage device 20 under different operating temperatures of the storage device 20, and improves the service performance and service life of the storage device 20. The following is a detailed description of specific embodiments.
Referring to fig. 1, in an embodiment of the present invention, a memory device 20 is provided, the memory device 20 is provided with a bus interface, the memory device 20 is electrically connected to a host 10 through the bus interface, the host 10 can write host data and send commands to the memory device 20, or the host 10 can read host data and receive commands from the memory device 20. The host 10 may be a communication device such as a personal computer (PC, personal Computer), a tablet (Pad), a mobile Phone (Cell Phone), etc.
Specifically, communication between the host 10 and the storage device 20 depends on a command signal (CMD), a data signal (data), and a clock signal (clock). The host 10 will set the storage device 20 to a particular rate value before the host 10 actually begins communication with the storage device 20 to ensure frequency synchronization between the host 10 and the storage device 20. Typically, to ensure operation performance, the host 10 sets a high rate value during the power-up phase of the storage device 20, and uses the high rate value during the operation phase of the storage device 20.
Referring to fig. 1, in one embodiment of the present invention, a memory device 20 may include a main controller 30, a flash memory 40, and a temperature sensor 50. The flash memory 40 is a nonvolatile memory, and is generally used for storing host data, system programs, and the like. The main controller 30 is mainly used for operating and managing the flash memory 40, and the main controller 30 can greatly improve the read-write and moving operation performance of host data in the flash memory 40.
Referring to fig. 1, in an embodiment of the present invention, a flash memory interface is disposed on a main controller 30 inside a memory device 20, and the main controller 30 is electrically connected to a flash memory 40 through the flash memory interface. The main controller 30 may include a status register 31 and a central processing unit (CPU, central Processing Unit) 32, the central processing unit 32 being an arithmetic core and a control core of the storage device 20.
Referring to FIG. 1, in one embodiment of the present invention, the memory device 20 generates heat during operation, and the temperature sensor 50 is used to measure the operating temperature of the main controller 30. If the temperature sensor 50 directly measures the ambient temperature around the storage device 20 without measuring the operation temperature of the main controller 30, there is a case where the ambient temperature cannot reflect the operation temperature of the main controller 30, i.e., the ambient temperature cannot reflect the real temperature of the main controller 30. The present embodiment can take the ambient temperature and the factors of the main controller 30 into consideration simultaneously by measuring the operation temperature of the main controller 30, which is expressed as the actual temperature of the main controller 30.
Specifically, the magnitude relationship between the communication frequency of the main controller 30 and the threshold frequency is analyzed while the main controller 30 is at a certain operating temperature. The host 10 may then maintain or adjust the communication frequency of the storage device 20, so that the storage device 20 maintains an appropriate communication frequency at a certain operating temperature, thereby ensuring the communication quality between the host 10 and the storage device 20, and improving the service performance and service life of the storage device 20.
It should be understood that the communication frequency of the storage device 20 is the communication frequency of the main controller 30. The communication frequency of the storage device 20 is written to outside the storage device 20 for convenience in describing the communication connection between the storage device 20 and the host 10. The communication frequency of the main controller 30 is written in the memory device 20 for convenience in describing the electrical connection between the main controller 30 and the flash memory 40 and the temperature sensor 50, respectively.
Referring to fig. 1, in one embodiment of the present invention, a status register 31 may be used to store temperature status data of the memory device 20, which reflects the operating temperature of the main controller 30 and the magnitude of the communication frequency. For example, when the operating temperature is 45 ℃ or less, the memory device 20 is at a normal temperature, which may allow the main controller 30 to be in a high rate communication frequency state. When the operating temperature is less than or equal to 45 ℃, the corresponding temperature state data may be set to 00, where 00 is binary data. The temperature state data appearing hereinafter are also binary data when 00, 01, 10, 11.
For example, when 45 ℃ is less than or equal to 60 ℃ and the operating temperature is less than or equal to 60 ℃, the main controller 30 is at a higher temperature, and in order to ensure the communication quality between the storage device 20 and the host 10, the storage device 20 may be allowed to be in a communication frequency state lower than the HS 200. HS200 refers to a bus communication frequency of 200MB/S for memory device 20. When 45 ℃ and the operating temperature are equal to or lower than 60 ℃, the corresponding temperature state data can be set to 01 when the communication frequency of the storage device 20 is greater than 200MB/S, and can be set to 00 when the communication frequency of the storage device 20 is equal to or lower than 200MB/S.
For example, when 60 ℃ is less than or equal to 85 ℃ and the operating temperature is less than or equal to 85 ℃, the main controller 30 is at a higher temperature, and in order to ensure the communication quality between the storage device 20 and the host 10, the storage device 20 may be allowed to be in a communication frequency state lower than the HDR 52. HDR52 refers to a bus communication frequency of 104MB/S for memory device 20. When 60 ℃ and the operating temperature are equal to or lower than 85 ℃, the corresponding temperature state data can be set to 10 when the communication frequency of the storage device 20 is greater than 104MB/S, and can be set to 00 when the communication frequency of the storage device 20 is equal to or lower than 104MB/S.
For example, when 85 ℃ is less than the operating temperature, the main controller 30 is at a very high temperature, and in order to ensure the quality of communication between the storage device 20 and the host 10, the storage device 20 may be allowed to be in a communication frequency state lower than the SDR 52. SDR52 refers to a bus communication frequency of 52MB/S for memory device 20. When 85 ℃ and operating temperature are equal, the corresponding temperature state data can be set to 11 if the communication frequency of the storage device 20 is >52MB/S, and can be set to 00 if the communication frequency of the storage device 20 is equal to or less than 52MB/S.
As is clear from the above analysis, when the temperature state data is 00, there is no need to adjust the communication frequency of the storage device 20. When the temperature status data is 01, 10 or 11, it indicates that the memory device 20 is at a higher temperature. For example, the temperature status data 01 corresponds to an operating temperature of the storage device 20 of 45 ℃ to 60 ℃, the temperature status data 10 corresponds to an operating temperature of the storage device 20 of 60 ℃ to 85 ℃, and for example, the temperature status data 11 corresponds to an operating temperature of the storage device 20 of greater than 85 ℃. When the temperature status data is 01, 10 or 11, the storage device 20 is at a higher temperature, and the communication frequency of the storage device 20 is higher at this time, so that the communication quality between the storage device 20 and the host 10 cannot be ensured, and the communication frequency of the storage device 20 needs to be adjusted.
It can be seen that the temperature status data can reflect the operation temperature and the communication frequency of the main controller 30, so that the temperature status data can be reused to further consider whether the communication frequency of the storage device 20 needs to be adjusted to ensure the communication quality between the storage device 20 and the host 10. The host 10 does not need to analyze the operating temperature and the communication frequency of the storage device 20 at any time, and the host 10 adjusts the communication frequency of the storage device 20 only when the host 10 receives the abnormal information of the storage device 20, that is, only when the host 10 receives the temperature state data returned by the main controller 30, which is 01, 10 or 11, thereby reducing the task amount of the host 10.
Referring to fig. 1, in an embodiment of the present invention, the central processing unit 32 is used as an operation core and a control core of the storage device 20, and the central processing unit 32 may obtain a current communication frequency and an operation temperature of the main controller 30, compare the current communication frequency with a preset threshold frequency and the current operation temperature with the preset threshold temperature, and generate temperature status data based on the comparison result. The threshold temperature and the threshold frequency are constants which are non-zero, the operating temperature is compared with the threshold temperature, and the threshold temperature can reflect the value of the operating temperature. The communication frequency is compared to a threshold frequency, which may reflect the magnitude of the communication frequency. The cpu 32 may write temperature status data into the status register 31 for storing the temperature status data.
Specifically, a plurality of threshold temperatures may be set at 45 ℃, 60 ℃, 85 ℃, and the operating temperature may be divided into temperature intervals of less than 45 ℃, 45 ℃ to 60 ℃, 60 ℃ to 85 ℃, and greater than 85 ℃. In the temperature interval of less than 45 ℃, the main controller 30 is at a normal temperature, allowing the memory device 20 to be in a high rate communication frequency state. Within a temperature range of 45-60 ℃, the threshold frequency may be 200MB/S. In the temperature range of 60 ℃ to 85 ℃, the threshold frequency can be 104MB/S. The threshold frequency may be 52MB/S over a temperature interval greater than 85 ℃.
Referring to fig. 1, in an embodiment of the present invention, in the case that the host 10 writes host data to the storage device 20, the host data of the host 10 is stored in the host controller 30, and then the host controller 30 sends the host data of the host 10 to the flash memory 40. In the case where the host 10 reads data from the storage device 20, host data in the flash memory 40 is stored in the host controller 30, and the host controller 30 then transmits the host data of the flash memory 40 to the host 10. The flash memory 40 may include a plurality of blocks (blocks) 41, and the blocks 41 may be used to store host data written by the host 10, and one Block 41 may further include a plurality of pages (pages) 42.
Referring to fig. 1, in one embodiment of the present invention, the cpu 32 may periodically obtain the operating temperature detected by the temperature sensor 50 during the communication between the storage device 20 and the host 10. For example, the central processing unit 32 acquires the operation temperature of the main controller 30 through the temperature sensor 50 every 10 minutes. The central processing unit 32 transmits the temperature state data to the host 10, and the host 10 transmits a control instruction of the communication frequency to the storage device 20 based on the temperature state data, thereby maintaining or adjusting the communication frequency of the storage device 20. As in the analysis described above, when the temperature state data is 00, there is no need to adjust the communication frequency of the storage device 20, whereas when the temperature state data is 01, 10, or 11, there is a need to adjust the communication frequency of the storage device 20.
Specifically, the central processing unit 32 sends the temperature status data to the host 10, and the host 10 obtains a specific value of the temperature status data after receiving the temperature status data. When the temperature state data is 00, the host 10 may transmit a hold instruction of the communication frequency to the storage device 20, or the host 10 may not transmit a control instruction of the communication frequency to the storage device 20, so that the communication frequency of the storage device 20 is held. When the temperature status data is 01, 10 or 11, the host 10 may send an adjustment instruction of the communication frequency to the storage device 20, and adjust the communication frequency of the storage device 20.
Referring to fig. 1, in one embodiment of the present invention, the central processing unit 32 sets a plurality of threshold temperatures, and the plurality of threshold temperatures divide the operating temperature into a plurality of temperature intervals, and each temperature interval corresponds to a threshold frequency. The central processing unit 32 maintains the current communication frequency when the current communication frequency of the storage device 20 is equal to or less than the corresponding threshold frequency while the main controller 30 is in a certain temperature interval. When the current communication frequency of the storage device 20 is greater than the corresponding threshold frequency, the temperature status data is sent to the host 10 to adjust the communication frequency of the storage device 20.
Specifically, as the operating temperature of the main controller 30 increases, the communication frequency of the storage device 20 needs to be adjusted in order to ensure the communication quality between the storage device 20 and the host 10. In order to improve the efficiency of adjusting the communication frequency of the storage device 20, it is not necessary to set a threshold frequency corresponding to each temperature value, and the operating temperature may be divided into a plurality of temperature sections according to the magnitude of the value.
For example, the plurality of threshold temperatures may be set at 45 ℃,60 ℃, 85 ℃, and the operating temperature may be divided into temperature intervals of less than 45 ℃,45 ℃ to 60 ℃,60 ℃ to 85 ℃, greater than 85 ℃. In the temperature interval of less than 45 ℃, the main controller 30 is at a normal temperature, allowing the memory device 20 to be in a high rate communication frequency state. In a temperature range of 45-60 ℃, the threshold frequency is 200MB/S. In the temperature range of 60-85 ℃, the threshold frequency is 104MB/S. The threshold frequency corresponds to 52MB/S over a temperature interval greater than 85 ℃. The central processing unit 32 sets the magnitude of the value of the temperature interval to be inversely proportional to the magnitude of the value of the threshold frequency among the plurality of temperature intervals and the plurality of threshold frequencies, so that the temperature interval having a larger value corresponds to the threshold frequency having a smaller value.
Specifically, a threshold frequency of 104MB/S is illustrated in a temperature range of 60-85 ℃. The central processing unit 32 can maintain the current communication frequency of the storage device 20 when the current communication frequency is less than or equal to the threshold frequency of 104MB/S in the temperature range of 60 ℃ to 85 ℃ of the main controller 30. When the current communication frequency of the storage device 20 is greater than the threshold frequency of 104MB/S, the temperature status data may be sent to the host 10 to adjust the communication frequency of the storage device 20.
Referring to fig. 1, in one embodiment of the present invention, when the current communication frequency of the storage device 20 is less than or equal to the corresponding threshold frequency, the cpu 32 sends the corresponding temperature status data to the host 10, and then receives a command for maintaining the communication frequency returned by the host 10. When the current communication frequency of the storage device 20 is greater than the corresponding threshold frequency, the central processing unit 32 receives an adjustment instruction of the communication frequency returned by the host 10 after sending the corresponding temperature state data to the host 10, so that the communication frequency adjusted by the storage device 20 is smaller than the corresponding threshold frequency.
Specifically, the transmission of instructions between the host computer 10 and the central processing unit 32 will be described by taking a threshold frequency of 104MB/S as an example in a temperature range of 60 ℃ to 85 ℃. In the temperature range of 60 ℃ to 85 ℃, when the current communication frequency of the storage device 20 is less than or equal to the threshold frequency of 104MB/S, the central processing unit 32 sends corresponding temperature state data to the host 10, and then receives a command for maintaining the communication frequency returned by the host 10. When the current communication frequency of the storage device 20 is greater than the threshold frequency of 104MB/S, after the central processing unit 32 sends the corresponding temperature status data to the host 10, an adjustment instruction of the communication frequency returned by the host 10 is received, so that the communication frequency adjusted by the storage device 20 is smaller than the corresponding threshold frequency.
Table 1, bit number table of status register 31
Referring to fig. 1 and table 1, in one embodiment of the present invention, a status register (Device status) 31 includes a common identifier bit (GENERAL IDENTIFIER) area, a Reserved bit (Reserved) area, a command line bit (vector CMD) area, and a Test mode bit (Test mode) area, where the operation status data of the storage Device 20 may be stored. The test mode bit region is a reserved bit region that is autonomously controlled by the manufacturer of the memory device 20, and the test mode bit region may store temperature state data of the memory device 20. The status register 31 may include a 32Bit memory space, the Bits of the general flag Bit region are Bit 31-Bit 5, the Bits of the reserved Bit region are Bit4, the Bits of the command line Bit region are Bit 3-Bit 2, and the Bits of the test mode Bit region are Bit 1-Bit 0. The cpu 32 reads the status register 31 to obtain the operating status data and the temperature status data of the memory device 20 at the same time.
Specifically, the central processing unit 32 may set at least three threshold temperatures, which may divide the operating temperature into at least four temperature intervals. The cpu 32 stores the temperature status data on the test mode bit as a hold value when the current communication frequency of the memory device 20 is equal to or lower than the corresponding threshold frequency while the main controller 30 is in a certain temperature interval. When the current communication frequency of the storage device 20 is greater than the corresponding threshold frequency, the temperature status data on the test mode bit is saved as a first value, a second value, or a third value. The first value may be binary 01, the second value may be binary 10, and the third value may be binary 11.
Specifically, three threshold temperatures of 45 ℃, 60 ℃ and 85 ℃ can be set, and the operating temperature can be divided into four temperature intervals of less than 45 ℃, 45 ℃ to 60 ℃, 60 ℃ to 85 ℃ and more than 85 ℃. The threshold frequency is 104MB/S in the temperature range of 60 ℃ to 85 ℃ for illustration. The central processing unit 32 stores the temperature status data on the test mode bit as a hold value when the current communication frequency of the storage device 20 is equal to or less than the threshold frequency of 104MB/S in the temperature interval of 60-85 ℃ of the main controller 30. When the current communication frequency of the memory device 20 is greater than the threshold frequency of 104MB/S, the temperature status data on the test mode bit is saved as a second value of 10.
Referring to fig. 1 and table 1, in an embodiment of the invention, the central processing unit 32 stores the temperature status data on the test mode bit as a first value, a second value and a third value when the current communication frequency of the memory device 20 is greater than the corresponding threshold frequency in the first temperature interval, the second temperature interval and the third temperature interval of the main controller 30 respectively. The first temperature interval has a value < the second temperature interval has a value < the third temperature interval has a value, and the first value < the second value < the third value.
Specifically, the first temperature interval may be 45 ℃ to 60 ℃, the second temperature interval may be 60 ℃ to 85 ℃, and the third temperature interval may be greater than 85 ℃. The threshold frequency corresponding to the first temperature interval may be 200MB/S, the threshold frequency corresponding to the second temperature interval may be 104MB/S, and the threshold frequency corresponding to the third temperature interval may be 52MB/S. The first value may be binary 01, the second value may be binary 10, and the third value may be binary 11. The values of the first temperature interval, the second temperature interval and the third temperature interval are in direct proportion to the values of the first value, the second value and the third value. The communication frequency between the host 10 and the storage device 20 is adjusted stepwise according to the operating temperature of the storage device 20 to ensure the communication quality between the host 10 and the storage device 20.
Referring to fig. 1 and 2, in one embodiment of the present invention, a method for controlling a communication frequency of a storage device is provided, which may include the following steps.
Step S10, measuring the operation temperature of the main controller in the storage device.
In one embodiment of the present invention, the main controller 30 of the storage device 20 may generate heat during operation, and the temperature sensor 50 may be used to measure the operating temperature of the main controller 30. If the temperature sensor 50 directly measures the ambient temperature around the storage device 20 without measuring the operation temperature of the main controller 30, there is a case where the ambient temperature cannot reflect the operation temperature of the main controller 30, i.e., the ambient temperature cannot reflect the real temperature of the main controller 30. The present embodiment can take the ambient temperature and the factors of the main controller 30 into consideration simultaneously by measuring the operation temperature of the main controller 30, which is expressed as the actual temperature of the main controller 30.
Step S20, the current communication frequency and the running temperature of the main controller are obtained, the current communication frequency is compared with a preset threshold frequency, the current running temperature is compared with the preset threshold temperature, and the threshold temperature and the threshold frequency are constants which are non-zero.
In one embodiment of the present invention, the current communication frequency and the operation temperature of the main controller 30 may be acquired, and the current communication frequency and the preset threshold frequency and the current operation temperature may be compared with the preset threshold temperature, and the temperature status data may be generated based on the comparison result. The threshold temperature and the threshold frequency are constants which are non-zero, the operating temperature is compared with the threshold temperature, and the threshold temperature can reflect the value of the operating temperature. The communication frequency is compared to a threshold frequency, which may reflect the magnitude of the communication frequency. The cpu 32 may write temperature status data into the status register 31 for storing the temperature status data.
And step S30, generating temperature state data based on the comparison result, and writing the temperature state data into a state register of the main controller, wherein the temperature state data reflects the operation temperature and the communication frequency of the main controller.
In one embodiment of the present invention, for example, the temperature status data 01 corresponds to an operating temperature of the main controller 30 of 45 ℃ to 60 ℃, the temperature status data 10 corresponds to an operating temperature of the main controller 30 of 60 ℃ to 85 ℃, and for example, the temperature status data 11 corresponds to an operating temperature of the main controller 30 of greater than 85 ℃. In a temperature range of 45-60 ℃, the threshold frequency is 200MB/S. In the temperature range of 60-85 ℃, the threshold frequency is 104MB/S. The threshold frequency corresponds to 52MB/S over a temperature interval greater than 85 ℃.
Step S40, the temperature state data is sent to the host, and the host sends a control command of the communication frequency to the storage device based on the temperature state data to maintain or adjust the communication frequency of the main controller.
In one embodiment of the present invention, when the temperature status data is 01, 10 or 11, the main controller 30 is at a higher temperature, and the communication frequency of the storage device 20 is higher at this time, so that the communication quality between the storage device 20 and the host 10 cannot be guaranteed, and the communication frequency of the storage device 20 needs to be adjusted. After the storage device 20 transmits the temperature state data to the host 10, the host 10 transmits a control command of the communication frequency to the storage device 20 based on the temperature state data, and holds or adjusts the communication frequency of the storage device 20. For example, when the temperature state data is 00, the communication frequency of the storage device 20 is not required to be adjusted, whereas when the temperature state data is 01, 10 or 11, the host 10 transmits an instruction for adjusting the communication frequency to the storage device 20, and adjusts the communication frequency of the storage device 20.
Referring to fig. 1,2 and 3, in one embodiment of the present invention, the step of sending the temperature status data to the host 10 in step S40 may include step S410, step S420 and step S430. Step S410 may be represented by setting a plurality of threshold temperatures, where the plurality of threshold temperatures divide the operating temperature into a plurality of temperature intervals, and each temperature interval corresponds to a threshold frequency.
Specifically, for example, three threshold temperatures of 45 ℃, 60 ℃ and 85 ℃ can be set, and the operating temperature can be divided into four temperature intervals of less than 45 ℃, 45 ℃ to 60 ℃, 60 ℃ to 85 ℃ and more than 85 ℃.
Step S420 may be represented by maintaining the current communication frequency of the storage device 20 when the current communication frequency is less than or equal to the corresponding threshold frequency while the main controller 30 is in a certain temperature interval.
Specifically, a threshold frequency of 104MB/S is illustrated in a temperature range of 60-85 ℃. When the current communication frequency of the storage device 20 is less than or equal to the threshold frequency of 104MB/S in the temperature range of 60 ℃ to 85 ℃ of the main controller 30, the current communication frequency can be maintained.
Step S430 may be represented by sending temperature status data to the host 10 to adjust the communication frequency of the storage device 20 when the current communication frequency of the host 30 is greater than the corresponding threshold frequency while the host 30 is in a certain temperature interval.
Specifically, a threshold frequency of 104MB/S is illustrated in a temperature range of 60-85 ℃. When the current communication frequency of the main controller 30 is greater than the threshold frequency of 104MB/S in the temperature range of 60 ℃ to 85 ℃ of the main controller 30, the temperature state data can be sent to the host 10 to adjust the communication frequency of the main controller 30.
Referring to fig. 1, 3 and 4, in an embodiment of the present invention, for step S420, when the current communication frequency of the main controller 30 is less than or equal to the corresponding threshold frequency in a certain temperature interval of the main controller 30, after sending the corresponding temperature status data to the host 10, a hold command of the communication frequency returned by the host 10 is received.
Specifically, the threshold frequency is 104MB/S in the temperature range of 60 ℃ to 85 ℃. When the current communication frequency of the main controller 30 is less than or equal to the threshold frequency of 104MB/S in the temperature range of 60-85 ℃ of the main controller 30, after corresponding temperature state data is sent to the host 10, a holding instruction of the communication frequency returned by the host 10 can be received.
For step S430, after the main controller 30 is in a certain temperature interval and the current communication frequency of the main controller 30 is greater than the corresponding threshold frequency, the corresponding temperature status data is sent to the host 10, and then an adjustment command of the communication frequency returned by the host 10 is received, so that the communication frequency adjusted by the main controller 30 is less than the corresponding threshold frequency.
Specifically, in the temperature range of 60 ℃ to 85 ℃, when the current communication frequency of the main controller 30 is greater than the threshold frequency of 104MB/S, after sending corresponding temperature state data to the host 10, an adjustment instruction of the communication frequency returned by the host 10 is received, so that the communication frequency adjusted by the main controller 30 is smaller than the corresponding threshold frequency.
In summary, the present invention provides a storage device and a method for controlling communication frequency thereof, which can ensure good communication quality between a host and the storage device when the storage device is at different operating temperatures, and improve service performance and service life of the storage device.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.