Heartbeat packet sending method, storage apparatus, and electronic device
By dynamically adjusting the heartbeat interval, the problem of difficult to take into account both low power consumption and high reliability in the prior art is solved according to the correspondence between ambient temperature and time and the target temperature difference, and the problem of high reliability heartbeat packet transmission in the low power consumption state is achieved.
Patent Information
- Application Number
- PCT/CN2024/116210
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-12-08
- Filing Date
- 2024-09-02
- Publication Date
- 2025-06-12
AI Technical Summary
The prior art is difficult to balance between maintaining low power consumption and high reliability, especially when the first link is in a low power consumption state, the fixed heartbeat interval cannot effectively adapt to environmental changes, which may lead to link disconnection.
By detecting the ambient temperature when the processor enters a low-power state and its corresponding moment, using the corresponding relationship between temperature and time and the target temperature difference, the heartbeat interval is dynamically determined so that it changes with temperature changes.
It realizes the heartbeat packet transmission that maintains high reliability in low power consumption, avoids link breakage caused by environmental changes, and takes into account the requirements of low power consumption and high reliability.
Smart Images

Figure CN2024116210_12062025_PF_FP_ABST
Abstract
Description
Heartbeat packet sending method, storage device and electronic device
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on December 8, 2023, with application number 202311689035.6 and application name “A heartbeat packet sending method, storage device and electronic device”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present invention relates to the field of communication technology, and in particular to a heartbeat packet sending method, a storage device and an electronic device. Background Art
[0003] When a primary link (such as a high-speed Peripheral Component Interconnect Express (PCIe) link) is in a low-power state, to maintain a reliable connection between a main system (such as a laptop's host system) and a subsystem (such as a laptop's solid-state drive (SSD) subsystem), the subsystem periodically sends heartbeat packets to the main system to maintain the primary link's connection status and adjust balancing parameters. This is referred to as "keep-alive." This is typically achieved using a fixed heartbeat interval to maintain the primary link's status, but existing technologies struggle to achieve both low power consumption and high reliability.
[0004] Summary of the Invention
[0005] In view of this, embodiments of the present invention provide a heartbeat packet sending method, a storage device, and an electronic device, which can simultaneously meet the requirements of low power consumption and high reliability.
[0006] In a first aspect, an embodiment of the present invention provides a heartbeat packet sending method, which is applied to a storage device, wherein the storage device includes a processor and a memory, and the memory stores a first correspondence and a target temperature difference. The method includes:
[0007] detecting that the processor needs to enter a low power consumption state, and obtaining a first temperature and a first time corresponding thereto;
[0008] determining a first heartbeat interval according to the first temperature, the first time, the first corresponding relationship, and the target temperature difference;
[0009] Sending a first heartbeat packet to the main system according to the first time and the first heartbeat interval and obtaining a second temperature and a second time corresponding thereto;
[0010] determining a second heartbeat interval according to the second temperature, the second time, the first corresponding relationship, and the target temperature difference;
[0011] A second heartbeat packet is sent to the main system according to the second moment and the second heartbeat interval, and the first heartbeat interval and the second heartbeat interval are different. After the processor of the storage device of the present application enters a low-power state, if the temperature difference between the ambient temperature at the next heartbeat and the ambient temperature at the previous heartbeat exceeds the target temperature difference, it is very likely to cause a link disconnection. The present application determines the heartbeat interval based on the target temperature difference to ensure high reliability; determines the heartbeat interval based on the ambient temperature and the first corresponding relationship, and can determine the maximum heartbeat interval under the current temperature environment, which can meet the requirements of low power consumption, thereby meeting the requirements of low power consumption and high reliability at the same time.
[0012] In conjunction with the first aspect, in certain implementations of the first aspect, the first correspondence includes a correspondence between temperature and time. The present application obtains the temperature and its corresponding time during the current heartbeat, and determines the heartbeat interval of the next heartbeat based on the target temperature difference, the first correspondence between temperature and time, so that the heartbeat interval changes with temperature, thereby achieving both low power consumption and reliability.
[0013] In conjunction with the first aspect, in some implementations of the first aspect, the corresponding relationship is a temperature drop function:
[0014] Where y is the current temperature, t is the time, A0 is the first constant, t0 is the second constant, and y0 is the third constant.
[0015] In conjunction with the first aspect, in some implementations of the first aspect, the method further includes:
[0016] detecting whether the first link is awakened;
[0017] If the first link is awakened, the processor enters the working state. When the processor of the storage device of the present application is in a low power consumption state, it detects whether the first link is awakened, and if so, the processor enters the working state.
[0018] In conjunction with the first aspect, in certain implementations of the first aspect, after detecting that the processor needs to enter a low power consumption state, and before obtaining the first temperature and the first time corresponding thereto, the method further includes:
[0019] Get multiple temperatures and their corresponding times multiple times;
[0020] The first corresponding relationship is determined based on the multiple temperatures and their corresponding relationships. In this application, the corresponding relationship between temperature and time can be generated when the system is running, and the system will not time out or disconnect due to configuration or training.
[0021] In conjunction with the first aspect, in certain implementations of the first aspect, before detecting that the processor needs to enter a low power consumption state, the method further includes:
[0022] During the initialization phase, it is determined based on the first information that the first correspondence does not need to be updated, the detection that the processor needs to enter a low power consumption state is executed, and the first temperature and its corresponding first moment are obtained; wherein, the first information is used to indicate that there was no abnormality when the storage device was powered off last time, the storage device is not powered on for the first time, and the storage device is not powered on for the first time after the system is reinstalled.
[0023] If there is no abnormality in the last power-off, it is not the first power-on and it is not the first power-on after reinstalling the system, the current first correspondence is still credible and does not need to be updated.
[0024] In conjunction with the first aspect, in some implementations of the first aspect, the method further includes:
[0025] According to the second information, it is determined that the first corresponding relationship needs to be updated, the first corresponding relationship is deleted, and the multiple acquisitions of multiple temperatures and their corresponding moments are executed. The second information is used to indicate that there was an abnormality when the storage device was powered off the last time or that the storage device is powered on for the first time after the system is reinstalled.
[0026] For example, if the system is running under a new system, such as the first boot after reinstalling the system, the first correspondence relationship needs to be updated, and the first correspondence relationship needs to be deleted before updating the first correspondence relationship.
[0027] When this application uses the first correspondence to adjust the heartbeat interval, changes may occur, causing the first correspondence to become invalid. After the system is restored, new training optimization can be performed to obtain a new correspondence.
[0028] In combination with the first aspect, in certain implementations of the first aspect, the method further includes: determining the need to update the first correspondence based on third information, executing the multiple acquisitions of multiple temperatures and their corresponding moments, and the third information is used to indicate that the storage device is powered on for the first time.
[0029] If it is the first time to start up, the first correspondence relationship needs to be updated. Since the first correspondence relationship has not been stored before, there is no need to delete the first correspondence relationship before updating the first correspondence relationship.
[0030] In combination with the first aspect, in some implementations of the first aspect, the first link includes a Peripheral Component Interconnect Express (PCI) interface link.
[0031] In combination with the first aspect, in certain implementations of the first aspect, the target temperature difference includes a maximum temperature difference allowed by the storage device during normal operation.
[0032] In a second aspect, an embodiment of the present invention provides a storage device, comprising a processor and a memory, wherein the memory is used to store a program, and when the processor runs the program, the storage device executes the above-mentioned method.
[0033] In a third aspect, an embodiment of the present invention provides an electronic device comprising the storage device described above.
[0034] In a fifth aspect, an embodiment of the present invention provides a readable storage medium, wherein the readable storage medium stores a program, and when the program is executed by a device, the device executes the method as described above.
[0035] In a sixth aspect, an embodiment of the present invention provides a program product, which includes a program. When the program is run on a device or any at least one processor, the device executes the functions / steps in the above method.
[0036] In the technical solutions of the heartbeat packet sending method, storage device and electronic device provided by the embodiments of the present invention, the storage device includes a processor and a memory, and the memory stores a first correspondence and a target temperature difference. The method includes: detecting that the processor needs to enter a low-power state, obtaining a first temperature and its corresponding first moment; determining a first heartbeat interval based on the first temperature, the first moment, the first correspondence and the target temperature difference; sending a first heartbeat packet to the main system and obtaining a second temperature and its corresponding second moment based on the first moment and the first heartbeat interval; determining a second heartbeat interval based on the second temperature, the second moment, the first correspondence and the target temperature difference; sending a second heartbeat packet to the main system based on the second moment and the second heartbeat interval, the first heartbeat interval and the second heartbeat interval being different, and being able to meet the requirements of low power consumption and high reliability at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] FIG1 is an architecture diagram of a heartbeat packet sending system provided by an embodiment of the present invention;
[0038] FIG2 is a signaling interaction diagram of a heartbeat packet sending method provided by an embodiment of the present invention;
[0039] FIG3 is a schematic diagram of the heating and cooling curves of the subsystem;
[0040] FIG4 is a schematic diagram of an application scenario of the heartbeat packet sending method shown in FIG2 ;
[0041] FIG5 is a signaling interaction diagram before the processor in FIG2 detects whether the processor needs to enter a low power consumption state;
[0042] 6 is a flow chart of a method for sending a heartbeat packet according to an embodiment of the present invention;
[0043] FIG7 is a flowchart of obtaining a first temperature and a first time corresponding thereto before detecting that the processor needs to enter a low power consumption state in FIG6 ;
[0044] FIG8 is a schematic structural diagram of a device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0045] In order to better understand the technical solution of the present invention, the embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0046] It should be understood that the embodiments described are only a portion of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative work are within the scope of protection of the present invention.
[0047] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The singular forms "a", "an", "the" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise.
[0048] It should be understood that the term "and / or" as used herein simply describes a relationship between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A alone, A and B together, or B alone. Furthermore, the character " / " in this document generally indicates an "or" relationship between the associated objects.
[0049] The receiver of the first link (such as a high-speed peripheral component interconnect interface (PCIe) link) will adjust the equalization parameters according to the received data signal in the working state to improve the link communication quality and reduce the bit error rate.
[0050] When no data is being transmitted on the primary link, the link switches from an active state to a low-power state to reduce overall system power consumption. The low-power state includes the inactive state and its lower-power sub-states. When signal reception is needed again, the processor restores the primary link to an active state based on the equalization parameters used before entering the low-power state, and resumes data transmission in the active state.
[0051] When the primary link between the main system and subsystem is in a low-power state, the subsystem periodically sends heartbeat packets to the main system to maintain a reliable connection between the two systems and prevent changes in the primary link environment from causing abnormal recovery of the primary link. This is referred to as "keep-alive." A fixed heartbeat interval is typically used to ensure the primary link's status.
[0052] A fixed heartbeat interval is typically the maximum interval obtained through trial and error with incremental heartbeat intervals. The maximum interval value is determined by gradually increasing the heartbeat interval and observing that no heartbeats return. This cannot adapt to online configurations on the local link and may cause the system to restart repeatedly. If the original heartbeat configuration becomes unusable due to environmental changes, the system cannot automatically optimize the configuration and requires manual reconfiguration, making it impossible to adjust to environmental changes. The process of obtaining the maximum interval value may cause link disconnection, preventing user-friendly configuration adjustments.
[0053] Therefore, the method of using a fixed heartbeat interval to ensure the first link state has poor environmental adaptability. If the heartbeat interval is too small, frequent switching in and out of low-power states will increase link overhead and overall system power consumption. If the heartbeat interval is too large, the lack of keepalive communication after environmental changes may cause the link to break, the system to be unable to identify the subsystem, and low reliability. Therefore, using a fixed heartbeat interval to ensure the first link state cannot achieve both low power consumption and high reliability.
[0054] Based on the above technical problems, an embodiment of the present invention provides a heartbeat packet sending system. Figure 1 is an architecture diagram of a heartbeat packet sending system provided by an embodiment of the present invention.
[0055] As shown in Figure 1, the heartbeat packet sending system includes a main system 100 and a subsystem 200. The main system 100 includes a first communication interface 110. The subsystem 200 includes a second communication interface 210, a processor 220, a memory 230, and at least one sensor 240. The main system 100 communicates with the subsystem 200 via the first communication interface 110. The subsystem 200 communicates with the main system 100 via the second communication interface 210. The transmission link between the first communication interface 110 and the second communication interface 210 is a first link.
[0056] Exemplarily, the first communication interface 110 and the second communication interface 210 are Peripheral Component Interconnect Express (PCIe Phy).
[0057] As shown in Figure 1, the second communication interface 210 of the subsystem 200 includes a heartbeat circuit 211. When the first link needs to be "keep-alive", the heartbeat circuit 211 can send a heartbeat packet to the first communication interface 110 of the main system 100 to adjust link parameters.
[0058] The subsystem 200 includes a front-end module (not shown in the figure), and the second communication interface 210 belongs to the front-end module.
[0059] As shown in FIG. 1 , in the subsystem 200 , the second communication interface 210 , the memory 230 , and the sensor 240 are all connected to the processor 220 .
[0060] The sensors 240 of the subsystem 200 include sensors for detecting parameters that require "keep alive", for example, a temperature sensor.
[0061] Based on the heartbeat packet sending system shown in FIG1 , an embodiment of the present invention provides a heartbeat packet sending method that can achieve both low power consumption and reliability.
[0062] FIG2 is a signaling interaction diagram of a heartbeat packet sending method provided by an embodiment of the present invention. As shown in FIG2 , the method includes:
[0063] Step 302 : The processor detects whether the processor needs to enter a low power consumption state. If so, step 304 is executed; if not, step 302 is continued.
[0064] In this step, the subsystem processor detects whether the processor needs to enter a low-power state. When the subsystem receives a command from the main system to enter a low-power state (e.g., a Set Feature command from the main system) or the first link meets the requirements for entering a low-power state (e.g., APST is enabled in the subsystem), the subsystem processor detects that the processor needs to enter a low-power state and enters a low-power state. This is accompanied by the first link entering a low-power state. If the subsystem processor detects that the processor does not need to enter a low-power state, the process proceeds to step 302 and waits for the processor to enter a low-power state.
[0065] Exemplarily, the first link includes a transmission link between the main system and the subsystem, such as a PCIe link.
[0066] Illustratively, the main system includes a host system.
[0067] Exemplarily, the subsystem is a storage device, such as an SSD subsystem.
[0068] Exemplarily, the first state is a low power consumption state.
[0069] Exemplarily, the low power consumption state is a non-working state and a sub-state thereof with even lower power consumption.
[0070] Step 304: The processor sends a first message to the sensor.
[0071] In this step, when the processor of the subsystem detects that the processor needs to enter a low power consumption state, the processor sends a first message to the sensor, where the first message includes information indicating that a first temperature and a first time corresponding thereto are obtained.
[0072] Step 306: The sensor sends the first temperature and the first time corresponding thereto to the processor according to the first message.
[0073] In this step, the sensor of the subsystem sends the first temperature and the corresponding first time to the processor according to the first message.
[0074] Exemplarily, the sensor of the subsystem is used to collect the ambient temperature of the subsystem.
[0075] Illustratively, the first temperature is the ambient temperature of the subsystem before the processor enters the low power state.
[0076] When a subsystem's processor enters a low-power state, communication between the main system and the subsystem requires "keep-alive." The subsystem's processor resumes operation only during heartbeats. The subsystem's sensors collect temperature data and transmit it to the processor. While in low-power mode, the subsystem maintains basic detection capabilities. The subsystem's primary communication interface is in an idle link state, operating and configuring only during heartbeats.
[0077] Step 308: The processor determines a first heartbeat interval according to the first temperature, the first time, the first corresponding relationship, and the target temperature difference.
[0078] In this step, the subsystem processor determines the first heartbeat interval based on the first temperature, the first moment, the first correspondence, and the target temperature difference. The subsystem processor retrieves the pre-stored first correspondence and the target temperature difference from the memory and determines the first heartbeat interval based on the first temperature, the first moment, the first correspondence, and the target temperature difference. When the processor of the present application needs to enter a low-power state, it determines the heartbeat interval by obtaining the temperature, thereby associating the heartbeat interval with the temperature.
[0079] Exemplarily, the first correspondence is the relationship between temperature and time. The present application obtains the temperature and its corresponding time during the current heartbeat, and determines the heartbeat interval of the next heartbeat according to the target temperature difference, the first correspondence between temperature and time.
[0080] Exemplarily, the target temperature difference includes the maximum temperature difference allowed during normal operation of the subsystem. For example, the target temperature difference is the maximum temperature difference of the front-end module of the subsystem.
[0081] Exemplarily, the processor of the subsystem determines the time required for the temperature to rise or fall from the first temperature to the target temperature difference based on the first corresponding relationship, and uses this time as the first heartbeat interval. After the processor of the subsystem enters a low-power state, if the temperature difference between the ambient temperature at the next heartbeat and the ambient temperature at the previous heartbeat exceeds the target temperature difference, it is very likely to cause the link to be broken. Therefore, in order to ensure reliability, it is necessary to ensure that the temperature difference between the two heartbeats does not exceed the target temperature difference. Preferably, in order to ensure high reliability, the present application selects the target temperature difference as the temperature difference between the two heartbeats.
[0082] Figure 3 is a schematic diagram of the subsystem's heating and cooling curves. As shown in Figure 3, the subsystem's processor enters a low-power state at time 0. Before entering the low-power state, the subsystem has been operating for a period of time, causing the ambient temperature to gradually rise. After entering the low-power state, the ambient temperature gradually decreases. Therefore, based on the corresponding relationship between temperature and time in the temperature drop curve in Figure 3, the processor can determine the time interval for the temperature to drop from the first temperature to the target temperature difference, and use this time interval as the heartbeat interval.
[0083] For example, the first corresponding relationship may be a temperature drop function, that is,
[0084] Where y is the current temperature value, t is the time, A0 is the first constant, t0 is the second constant, and y0 is the third constant. Wherein, time t is the time measured from the time when the microprocessor of the subsystem enters the low power state.
[0085] For example, assuming the target temperature difference is △y, the first moment is t1, and the first temperature is y1, the processor needs to calculate the time interval △t when the temperature drops from y1 to y2 by △y, and the moment corresponding to y2 is t2. Since △y, t1, and y1 are known, y2 can be calculated according to the following formula 2, that is,
[0086] y2=y1-△y (Formula 2)
[0087] Then substitute y2 into formula 1, and the time corresponding to y2 can be calculated as t2, that is,
[0088] Then substitute t1 and t2 into formula 4 to calculate △t.
[0089] △t = t2 - t1 (Formula 4)
[0090] Step 310: The processor sends a first message to the second communication interface according to the first heartbeat interval and the first time.
[0091] In this step, the processor of the subsystem sends the first message to the second communication interface according to the first heartbeat interval and the first moment. Specifically, the processor starts a first timer from the first moment, and sends a second message to the second communication interface when the first timer reaches the first heartbeat interval.
[0092] The second message serves as input for the second communication interface to send the first heartbeat packet to the first communication interface.
[0093] Step 312: The second communication interface sends a first heartbeat packet to the first communication interface according to the second message.
[0094] In this step, the second communication interface of the subsystem sends a first heartbeat packet to the first communication interface according to the second message.
[0095] As shown in FIG. 2 , after step 310 , steps 314 to 322 are further included.
[0096] Step 314: The processor sends a third message to the sensor.
[0097] In this step, after sending the second message, the processor of the subsystem sends a third message to the sensor. The third message includes information indicating the acquisition of the second temperature and its corresponding second time.
[0098] Optionally, step 314 and step 210 may be executed simultaneously, that is, when the first timed time reaches the first heartbeat interval, the processor sends the second message and the third message simultaneously.
[0099] Step 316: The sensor sends the second temperature and its corresponding second time to the processor according to the third message.
[0100] In this step, the sensor of the subsystem sends the second temperature and the corresponding second time to the processor according to the third message.
[0101] In this application, when the processor is in a low power consumption state, it detects in real time whether it has received a wake-up message from the main system. If the processor receives a wake-up message from the main system, it enters a working state, and thus the first link also enters a working state.
[0102] Step 318: The processor determines a second heartbeat interval according to the second temperature, the second time, the first corresponding relationship, and the target temperature difference.
[0103] In this step, the processor of the subsystem determines the second heartbeat interval according to the second temperature, the second time, the first corresponding relationship and the target temperature difference.
[0104] It should be understood that the method for determining the heartbeat interval in step 318 is the same as that in step 308 and will not be described in detail here.
[0105] Step 320: The processor sends a second message to the second communication interface according to the second heartbeat interval and the second time.
[0106] In this step, the processor of the subsystem sends a fourth message to the second communication interface according to the second heartbeat interval and the second time.
[0107] It should be understood that the method in which the processor sends the message to the second communication interface in step 320 is the same as that in step 310 and is not described again here.
[0108] The fourth message serves as input for the second communication interface to send the second heartbeat packet to the first communication interface.
[0109] Step 322: The second communication interface sends a second heartbeat packet to the first communication interface according to the fourth message.
[0110] In this step, the second communication interface of the subsystem sends a second heartbeat packet to the first communication interface according to the fourth message.
[0111] Exemplarily, the first heartbeat interval and the second heartbeat interval are different, so the heartbeat interval is variable. Therefore, the present application dynamically adjusts the heartbeat interval through the correspondence between temperature and time, which can take into account both low power consumption and reliability.
[0112] Afterwards, by analogy, if the subsystem is still in a low power state, the processor obtains the third temperature collected by the sensor and its corresponding third moment after sending the fourth message or when sending the fourth message, and determines the third heartbeat interval based on the third temperature, the third moment, the first corresponding relationship and the target temperature difference.
[0113] FIG4 is a schematic diagram of an application scenario of the heartbeat packet sending method shown in FIG2 . As shown in FIG4 , the processor of the subsystem is in a working state at the beginning. When it is detected that the processor needs to enter low power consumption, the temperature T0 and the corresponding time t0 are obtained. In combination with FIG3 , it can be seen that the temperature T0 is relatively high at this time. The processor determines the first heartbeat interval Δt1 according to the temperature TO and the corresponding time t0, the first correspondence and the target temperature difference. The processor starts the first timing from time t0. When the time of the first timing reaches the first heartbeat interval Δt1, the subsystem sends a heartbeat packet to the main system and obtains the temperature T1 and the corresponding time t1. The temperature difference between temperature T1 and temperature TO is the target temperature difference. The processor determines the second heartbeat interval Δt2 according to the temperature T1 and the corresponding time t1, the first correspondence and the target temperature difference. The processor starts the second timing from time t1. When the time of the second timing reaches the second heartbeat interval Δt2, the subsystem sends a heartbeat packet to the main system and obtains the temperature T2. and its corresponding moment t2, the temperature difference between temperature T2 and temperature T1 is the target temperature difference; the processor determines a third heartbeat interval Δt3 according to temperature T2 and its corresponding moment t2, the first correspondence and the target temperature difference; the processor starts the third timing from moment t2, and when the time of the third timing reaches the third heartbeat interval Δt3, the subsystem sends a heartbeat packet to the main system and obtains temperature T3 and its corresponding moment t3, and the temperature difference between temperature T3 and temperature T2 is the target temperature difference; the processor determines a fourth heartbeat interval Δt4 according to temperature T3 and its corresponding moment t3, the first correspondence and the target temperature difference; the processor starts the fourth timing from moment t3, and when the time of the fourth timing reaches the fourth heartbeat interval Δt4, the subsystem sends a heartbeat packet to the main system and obtains temperature T4 and its corresponding moment t4, and the temperature difference between temperature T4 and temperature T3 is the target temperature difference, and so on, until the subsystem sends the nth heartbeat packet to the main system and obtains temperature Tn and its corresponding moment tn. Combined with the temperature drop curve shown in Figure 3, it can be seen that the speed of temperature drop is from fast to slow, so the time required for each drop of the target temperature difference is getting slower and slower, so the heartbeat interval shown in Figure 4 gradually increases. The present application determines the heartbeat interval based on the ambient temperature, and can determine the maximum heartbeat interval in the current temperature environment in different temperature environments, which can meet the requirements of low power consumption; at the same time, the heartbeat interval is determined based on the target temperature difference, so that the temperature difference between two heartbeats will not exceed the target temperature difference, which can meet the requirements of high reliability.
[0114] Furthermore, FIG5 is a signaling interaction diagram before the processor in FIG2 detects whether the processor needs to enter a low power consumption state. As shown in FIG5 , before step 302, the following steps are also included:
[0115] Step 402 : The processor determines whether the first correspondence needs to be updated during the initialization phase. If not, the processor continues to execute step 302 ; if so, the processor executes step 404 or step 406 .
[0116] In this step, the processor of the subsystem determines whether the first correspondence needs to be updated during the initialization phase.
[0117] In some possible embodiments, step 402 specifically includes: the processor determining, based on the first information, that the first correspondence does not need to be updated, where the first information indicates that there was no abnormality when the storage device was last powered off, that this is not the first time the storage device is powered on, and that this is not the first time the storage device is powered on after a system reinstallation, and executing step 404. If a change occurs when the first correspondence is used in the present application to adjust the heartbeat interval, causing the first correspondence to become invalid, new training optimization can be performed after the system is restored to obtain a new correspondence.
[0118] In some possible embodiments, step 402 specifically includes: the processor determines that the first correspondence needs to be updated based on the second information, the second information is used to indicate that there was an abnormality when the storage device was powered off last time or the storage device is powered on for the first time after reinstalling the system, and continues to execute step 302.
[0119] In some possible embodiments, step 402 specifically includes: the processor determines that the first correspondence needs to be updated according to third information, where the third information is used to indicate that the storage device is powered on for the first time, and then executing step 406.
[0120] Step 404: The processor deletes the first correspondence.
[0121] In this step, if the last power-off was abnormal or it was the first power-on after reinstalling the system, the current first correspondence is no longer credible, and the processor of the subsystem deletes the stored first correspondence.
[0122] Step 406 : The processor detects whether the processor needs to enter a low power consumption state. If yes, execute step 408 ; if no, continue to execute step 406 .
[0123] Step 408: The processor obtains multiple temperatures collected by the sensor and their corresponding times.
[0124] In this step, after the processor of the subsystem detects that it needs to be in a low power consumption state, it obtains multiple temperatures collected by the sensor and their corresponding times.
[0125] In some possible embodiments, step 408 specifically includes: the processor detects that it needs to be in a low power consumption state, and sends a fifth message to the sensor; the sensor sends the temperature and the corresponding time when entering the low power consumption state to the processor according to the fifth message; after entering the low power consumption state, obtain at least one temperature and its corresponding time based on the initial heartbeat configuration.
[0126] When the processor of the subsystem enters a low-power state, the main system and the subsystem need to "keep alive" the communication. The heartbeat is performed according to the initial heartbeat configuration. The first link state is restored during each heartbeat. The sensor collects the temperature and sends it to the processor.
[0127] The initial heartbeat configuration uses a smaller heartbeat interval for communication keepalive by default. This consumes the most power. The initial heartbeat configuration usually uses a fixed heartbeat interval.
[0128] Step 410: The processor obtains a set of corresponding relationships based on multiple temperatures and their corresponding times.
[0129] In this step, the subsystem processor obtains a set of correspondences based on the multiple temperatures and their corresponding times and stores the correspondences in a memory. The correspondences include the relationship between the temperatures and the times. For example, the correspondences can be the above-mentioned formula 1, i.e., the temperature drop function.
[0130] In this application, the correspondence between temperature and time can be generated when the system is running, and there will be no system timeout or disconnection problems due to configuration or training.
[0131] In step 410 , by substituting multiple temperatures and their corresponding times into formula 1, the values of A0 , t0 , and y0 can be obtained.
[0132] Step 412 : The processor determines whether the number of corresponding relationship groups is less than or equal to a first threshold. If so, the processor continues to execute step 406 ; if not, the processor continues to execute step 302 .
[0133] In this step, the processor of the subsystem determines whether the number of groups of corresponding relationships is less than or equal to the first threshold. If the number of groups of corresponding relationships is less than or equal to the first threshold, step 406 is continued to be executed to obtain a new set of corresponding relationships. When the number of groups of corresponding relationships obtained is greater than the first threshold, step 302 is continued to be executed.
[0134] In some possible embodiments, before step 302 , the method further includes: a processor determining a first corresponding relationship according to multiple groups of corresponding relationships.
[0135] Exemplarily, the correspondence includes a second constant, namely t0. The second constant indicates how quickly the temperature rises or falls. A larger second constant indicates a faster temperature rise or fall; a smaller second constant indicates a slower temperature rise or fall. This application selects the set of correspondences with the fastest temperature rise or fall as the first correspondence, which ensures the reliability of the heartbeat interval obtained based on the first correspondence and is less likely to cause link disconnection.
[0136] In some possible embodiments, the processor determines whether the corresponding relationship with the largest second constant among the multiple groups of corresponding relationships is the last group of corresponding relationships. If so, the processor continues to execute step 406; if not, the processor determines the corresponding relationship with the largest second constant as the first corresponding relationship. In the present application, if the corresponding relationship with the largest second constant is the last group of corresponding relationships, it indicates that there is a high probability that the rate of change of the ambient temperature will continue to increase, and therefore, the processor continues to execute step 406 to obtain a new corresponding relationship. If the corresponding relationship with the largest second constant is not the last group of corresponding relationships, it indicates that there is a low probability that the rate of change of the ambient temperature will continue to increase, and therefore, the processor can directly determine the corresponding relationship with the largest second constant as the first corresponding relationship.
[0137] This application records the temperature through a temperature sensor, calculates and fits the temperature drop function of the subsystem's environment based on the recorded temperature; calculates the heartbeat interval required after entering low power consumption based on the temperature drop function and the target temperature difference allowed for the subsystem's operation, and configures this heartbeat interval as the heartbeat interval before each entry into low power consumption, thereby achieving online automatic configuration of the heartbeat interval during device operation. If a failure occurs after an environmental change, after restarting the device, the subsystem recognizes the last abnormal shutdown and can obtain the temperature drop function of the new environment in which the device is located. The heartbeat interval is configured according to the temperature drop function of the new environment to achieve online autonomous optimization configuration.
[0138] This invention achieves an optimal balance between power consumption and reliability by learning and training the maximum heartbeat interval that ensures stable system operation by capturing the patterns of subsystem ambient temperature changes—that is, the correspondence between temperature and time. The device can be powered on and used directly, and the correspondence is determined during use. There is no need to manually configure heartbeat parameters, or to separate configuration and use, improving user experience and efficiency. Furthermore, there is no need to manually reconfigure heartbeat parameters after environmental changes, improving user experience and efficiency.
[0139] In the technical solution of the heartbeat packet sending method provided by an embodiment of the present invention, the method includes: detecting that the processor needs to enter a low-power state, obtaining a first temperature and a first corresponding moment; determining a first heartbeat interval based on the first temperature, the first moment, the first correspondence and the target temperature difference; sending a first heartbeat packet to the main system based on the first moment and the first heartbeat interval and obtaining a second temperature and a second corresponding moment; determining a second heartbeat interval based on the second temperature, the second moment, the first correspondence and the target temperature difference; sending a second heartbeat packet to the main system based on the second moment and the second heartbeat interval, the first heartbeat interval and the second heartbeat interval being different, and being able to meet the requirements of low power consumption and high reliability at the same time.
[0140] FIG6 is a flow chart of a heartbeat packet sending method provided by an embodiment of the present invention. The heartbeat packet sending method is applied to a storage device, the storage device including a processor and a memory, and the memory stores a first correspondence relationship and a target temperature difference. As shown in FIG6 , the method includes:
[0141] Step 502: Detect that the processor needs to enter a low power consumption state, and obtain a first temperature and a first time corresponding thereto.
[0142] Illustratively, the first link comprises a Peripheral Component Interconnect Express (PCI) interface link.
[0143] Step 504: Determine a first heartbeat interval according to the first temperature, the first time, the first corresponding relationship, and the target temperature difference.
[0144] Exemplarily, the first correspondence includes a correspondence between temperature and time.
[0145] Exemplarily, the target temperature difference includes a maximum temperature difference allowed during normal operation of the storage device.
[0146] Step 506: Send a first heartbeat packet to the main system according to the first time and the first heartbeat interval and obtain the second temperature and its corresponding second time.
[0147] In some possible embodiments, step 506 specifically includes: starting a first count from a first moment, and when the first count reaches a first heartbeat interval, sending a first heartbeat packet to the main system.
[0148] Step 508: Determine a second heartbeat interval according to the second temperature, the second time, the first corresponding relationship, and the target temperature difference.
[0149] Step 510: Send a second heartbeat packet to the main system according to the second time and the second heartbeat interval, where the first heartbeat interval and the second heartbeat interval are different.
[0150] In some possible embodiments, step 510 specifically includes: starting a second timing from a second moment, and when the second timing reaches a second heartbeat interval, sending a second heartbeat packet to the main system.
[0151] FIG7 is a flow chart of the process of detecting that the processor needs to enter a low power consumption state and obtaining a first temperature and a first corresponding moment in FIG6 . As shown in FIG7 , the method includes:
[0152] Step 602 : Determine whether the first correspondence needs to be updated during the initialization phase. If not, continue with step 502 ; if so, execute step 604 or 606 .
[0153] In some possible embodiments, step 602 specifically includes: determining that the first corresponding relationship does not need to be updated based on the first information, the first information is used to indicate that there was no abnormality when the storage device was powered off the last time, the storage device is not powered on for the first time, and the storage device is not powered on for the first time after reinstalling the system, and executing step 604.
[0154] In some possible embodiments, step 602 specifically includes: determining that the first correspondence needs to be updated based on the second information, the second information is used to indicate that there was an abnormality when the storage device was powered off last time or the storage device is powered on for the first time after reinstalling the system, and continuing to execute step 502.
[0155] In some possible embodiments, step 602 specifically includes: determining that the first correspondence needs to be updated according to third information, where the third information is used to indicate that the storage device is powered on for the first time, and executing step 606 .
[0156] Step 604: Delete the first correspondence.
[0157] Step 606 , detecting whether the processor needs to be in a low power consumption state, if so, executing step 608 ; if not, continuing to execute step 606 .
[0158] Step 608: Acquire multiple temperatures and their corresponding times.
[0159] In some possible embodiments, step 608 specifically includes: detecting that a low power consumption state is required, obtaining the temperature and the corresponding time when entering the low power consumption state; after entering the low power consumption state, obtaining at least one temperature and the corresponding time based on the initial heartbeat configuration.
[0160] Step 610: Obtain a set of corresponding relationships based on multiple temperatures and their corresponding times.
[0161] Step 612: Determine whether the number of corresponding relationship groups is less than or equal to the first threshold. If so, continue to step 606; if not, continue to step 502.
[0162] In the technical solution of the heartbeat packet sending method provided by an embodiment of the present invention, the method includes: detecting that the processor needs to enter a low-power state, obtaining a first temperature and a first corresponding moment; determining a first heartbeat interval based on the first temperature, the first moment, the first correspondence and the target temperature difference; sending a first heartbeat packet to the main system based on the first moment and the first heartbeat interval and obtaining a second temperature and a second corresponding moment; determining a second heartbeat interval based on the second temperature, the second moment, the first correspondence and the target temperature difference; sending a second heartbeat packet to the main system based on the second moment and the second heartbeat interval, the first heartbeat interval and the second heartbeat interval being different, and being able to meet the requirements of low power consumption and high reliability at the same time.
[0163] FIG8 is a schematic diagram of the structure of a device provided by an embodiment of the present invention. It should be understood that the device 700 can execute each step in the above-mentioned heartbeat packet sending method. To avoid repetition, the details are not described here. The device 700 includes: a processor 701 and a memory 702.
[0164] An embodiment of the present application also provides a storage device, including at least one processor 701 and at least one memory 702, wherein the at least one memory 702 is used to store at least one program, and when the at least one processor 701 runs the at least one program, the storage device performs the operations involved in the above-mentioned method embodiment and Figures 2-7.
[0165] An embodiment of the present application also provides an electronic device, comprising at least one processor 701 and at least one memory 702, wherein the at least one memory 702 is used to store at least one program, and when the at least one processor 701 runs the at least one program, the electronic device performs the operations involved in the above-mentioned method embodiment and Figures 2-7.
[0166] An embodiment of the present application also provides a readable storage medium, which stores a program. When the program runs on a storage device, the storage device performs the operations involved in the above method embodiment and Figures 2-7.
[0167] An embodiment of the present application also provides a readable storage medium, which stores a program. When the program runs on an electronic device, the electronic device performs the operations involved in the above method embodiment and Figures 2-7.
[0168] An embodiment of the present application also provides a program product, which, when executed on a storage device or any at least one processor, enables the storage device to perform operations as described in the above method embodiment and in FIG. 2 to FIG. 7 .
[0169] An embodiment of the present application also provides a program product, which, when executed on an electronic device or any at least one processor, enables the electronic device to perform operations as described in the above method embodiment and in FIG. 2 to FIG. 7 .
[0170] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0171] In the several embodiments provided in this application, if any function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a device (which can be a heartbeat generating device, an electronic device, a computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of this application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory, a random access memory, a magnetic disk or an optical disk.
[0172] The above description is merely a specific embodiment of the present application. Any person skilled in the art may easily conceive of variations or substitutions within the technical scope disclosed in this application, and such variations or substitutions shall be within the scope of protection of this application. The scope of protection of this application shall be subject to the scope of protection of the claims.
Claims
1. A heartbeat generating method, characterized in that: Applied to a storage device, the storage device includes a processor and a memory, the memory stores a first corresponding relationship and a target temperature difference, and the method includes: Detecting that the processor needs to enter a low power consumption state, obtaining a first temperature and a first time corresponding thereto; determining a first heartbeat interval according to the first temperature, the first time, the first corresponding relationship, and the target temperature difference; Sending a first heartbeat packet to the main system according to the first time and the first heartbeat interval and acquiring a second temperature and a second time corresponding thereto; determining a second heartbeat interval according to the second temperature, the second time, the first corresponding relationship and the target temperature difference; A second heartbeat packet is sent to the main system according to the second time and the second heartbeat interval, wherein the first heartbeat interval and the second heartbeat interval are different.
2. The method according to claim 1, characterized in that The first corresponding relationship includes a corresponding relationship between temperature and time.
3. The method according to claim 2, characterized in that The corresponding relationship is a temperature drop function: Where y is the current temperature value, t is the time, A0 is the first constant, t0 is the second constant, and y0 is the third constant.
4. The method according to any one of claims 1 to 3, characterized in that The method further comprises: Detecting whether wake-up of the first link occurs; If the first link is awakened, the processor enters a working state.
5. The method according to any one of claims 1 to 4, characterized in that After detecting that the processor needs to enter a low power consumption state, before obtaining a first temperature and a first time corresponding thereto, the method further includes: Multiple temperatures and their corresponding moments are obtained multiple times to obtain multiple sets of corresponding relationships; The first corresponding relationship is determined according to the multiple groups of corresponding relationships.
6. The method according to any one of claims 1 to 5, characterized in that Before detecting that the processor needs to enter a low power consumption state, the method further includes: During the initialization phase, if it is determined based on the first information that the first corresponding relationship does not need to be updated, the acquisition of the first temperature and its corresponding first moment is executed; wherein the first information is used to indicate that there was no abnormality when the storage device was powered off the last time, that the storage device is not powered on for the first time, and that the storage device is not powered on for the first time after the system is reinstalled.
7. The method according to claim 5, characterized in that The method further comprises: According to the second information, it is determined that the first corresponding relationship needs to be updated, the first corresponding relationship is deleted, and the multiple acquisitions of multiple temperatures and their corresponding times are executed. The second information is used to indicate that there was an abnormality when the storage device was powered off the last time or that the storage device is powered on for the first time after the system is reinstalled.
8. The method according to claim 5, characterized in that The method further comprises: It is determined according to third information that the first corresponding relationship needs to be updated, and the multiple acquisitions of multiple temperatures and their corresponding times are performed multiple times, wherein the third information is used to indicate that the storage device is powered on for the first time.
9. The method according to any one of claims 1 to 8, characterized in that: The first link comprises a Peripheral Component Interconnect Express (PCI) interface link.
10. The method according to any one of claims 1 to 9, characterized in that: The target temperature difference includes a maximum temperature difference allowed by the storage device during normal operation.
11. A storage device, characterized in that: The invention comprises a processor and a memory, wherein the memory is used to store a program, and when the processor runs the program, the storage device executes the steps of the method according to any one of claims 1 to 10.
12. An electronic device, characterized in that: Comprising the storage device as claimed in claim 11.
13. A readable storage medium, characterized in that: The readable storage medium stores a program, wherein the program includes program instructions. When the program instructions are executed by an electronic device, the electronic device executes the method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Heartbeat packet sending method, storage device and electronic equipment
CN120128509A
Temperature collector control method and device, storage medium and system
CN110500718A
System and method for managing solid state storage devices in low temperature environments
CN114816848A
DRAM (Dynamic Random Access Memory) data retention time, refreshing interval determination method, refreshing method and device
CN114974342A
Method of operating memory device and memory device performing same
CN115729342A