Heartbeat packet sending method, storage device and electronic equipment

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 high reliability heartbeat packet transmission in the low power consumption state is realized.

CN120128509APending Publication Date: 2025-06-10HUAWEI TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202311689035.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-08
Publication Date
2025-06-10

AI Technical Summary

Technical Problem

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 deal with environmental changes, which may lead to link disconnection.

Method used

By detecting the ambient temperature and time when the processor enters the low-power state, the stored first correspondence and target temperature difference are used to dynamically determine the heartbeat interval so that it changes with temperature changes, thus taking into account low power consumption and high reliability.

Benefits of technology

It realizes the heartbeat packet transmission that maintains high reliability in the low power consumption state, avoids link breakage caused by environmental changes, and meets the simultaneous requirements of low power consumption and high reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120128509A_ABST
    Figure CN120128509A_ABST
Patent Text Reader

Abstract

The invention discloses a heartbeat packet sending method, a storage device and electronic equipment, the storage device comprises a processor and a memory, a first corresponding relation and a target temperature difference are stored in the memory, and the method comprises the following steps: detecting that the processor needs to enter a low power consumption state, and obtaining a first temperature and a first moment corresponding to the first temperature; determining a first heartbeat interval according to the first temperature, the first moment, the first corresponding relation and a target temperature difference; sending a first heartbeat packet to the main system according to the first moment and the first heartbeat interval, and obtaining a second temperature and a second moment corresponding to the second temperature; determining a second heartbeat interval according to the second temperature, the second moment, the first corresponding relation and the target temperature difference; a second heartbeat packet is sent to the main system according to the second moment and the second heartbeat interval, the first heartbeat interval is different from the second heartbeat interval, and the requirements for low power consumption and high reliability can be met at the same time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technologies, and in particular to a heartbeat packet sending method, a storage device, and an electronic device. Background Art

[0002] When a first link (such as a Peripheral Component Interconnect Express (PCIe) link) is in a low-power state, in order to maintain a reliable connection between a main system (such as a host system of a laptop computer) and a subsystem (such as a solid state drive (SSD) subsystem in a laptop computer), the subsystem periodically sends heartbeat packets to the main system to maintain the connection state of the first link and adjust balance parameters, which is abbreviated as "keep-alive". Usually, a fixed heartbeat interval value is used to ensure the state of the first link. Therefore, there is a problem in the prior art that it is impossible to satisfy both low power consumption and high reliability at the same time. Summary of the Invention

[0003] In view of this, embodiments of the present invention provide a heartbeat packet sending method, a storage device, and an electronic device, which can satisfy the requirements of both low power consumption and high reliability at the same time.

[0004] In a first aspect, an embodiment of the present invention provides a heartbeat packet sending method, which is applied to a storage device. The storage device includes a processor and a memory. A first correspondence and a target temperature difference are stored in the memory. The method includes:

[0005] When it is detected that the processor needs to enter a low-power state, obtain a first temperature and its corresponding first moment;

[0006] Determine a first heartbeat interval according to the first temperature, the first moment, the first correspondence, and the target temperature difference;

[0007] Send a first heartbeat packet to the main system according to the first moment and the first heartbeat interval, and obtain a second temperature and its corresponding second moment;

[0008] Determine a second heartbeat interval according to the second temperature, the second moment, the first correspondence, and the target temperature difference;

[0009] Send a second heartbeat packet to the master system according to the second moment and the second heartbeat interval, where the first heartbeat interval is different from the second heartbeat interval. After the processor of the storage device in this application enters the 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 break. In this application, determining the heartbeat interval according to the target temperature difference can ensure high reliability; determining the heartbeat interval according to the ambient temperature and the first correspondence can determine the maximum heartbeat interval in the current temperature environment and can meet the requirements of low power consumption, so as to meet the requirements of both low power consumption and high reliability at the same time.

[0010] In combination with the first aspect, in some implementation manners of the first aspect, the first correspondence includes the correspondence between temperature and time. In this application, by obtaining the temperature and its corresponding time at the current heartbeat and determining the heartbeat interval of the next heartbeat according to the target temperature difference, the correspondence between temperature and time, the heartbeat interval changes with the temperature, which can take into account both low power consumption and reliability.

[0011] In combination with the first aspect, in some implementation manners of the first aspect, the correspondence is a temperature decreasing function:

[0012]

[0013] where y is the current temperature value, t is the time, A 0 is the first constant, t 0 is the second constant, y 0 is the third constant.

[0014] In combination with the first aspect, in some implementation manners of the first aspect, the method further includes:

[0015] Detect whether the wake-up of the first link occurs;

[0016] If the wake-up of the first link occurs, the processor enters the working state. When the processor of the storage device in this application is in the low-power state, it detects whether the wake-up of the first link occurs. If the wake-up of the first link occurs, the processor enters the working state.

[0017] In combination with the first aspect, in some implementation manners of the first aspect, before obtaining the first temperature and its corresponding first time after detecting that the processor needs to enter the low-power state, the method further includes:

[0018] Obtain multiple temperatures and their corresponding times multiple times;

[0019] Determine the first correspondence according to the multiple temperatures and their corresponding relationships. In this application, the correspondence between temperature and time can be generated during the operation of the system, and it will not cause the problem of system timeout and link break due to configuration or training.

[0020] In combination with the first aspect, in some implementations of the first aspect, before detecting that the processor needs to enter the low-power state, it further includes:

[0021] In the initialization stage, according to the first piece of information, it is determined that the first corresponding relationship does not need to be updated, and it is detected that the processor needs to enter the low-power state, and the first temperature and its corresponding first moment are obtained; wherein, the first piece of information is used to indicate that the last power-off of the storage device is normal, 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.

[0022] If the last power-off is normal, not the first power-on, and not the first power-on after reinstalling the system, then the current first corresponding relationship is still credible and the first corresponding relationship does not need to be updated.

[0023] In combination with the first aspect, in some implementations of the first aspect, the method further includes:

[0024] According to the second piece of information, it is determined that the first corresponding relationship needs to be updated, the first corresponding relationship is deleted, and the multiple temperatures and their corresponding moments are obtained multiple times. The second piece of information is used to indicate that the last power-off of the storage device is abnormal or the storage device is powered on for the first time after reinstalling the system.

[0025] For example, if the system is running under a new system, such as the first boot after reinstalling the system, then the first corresponding relationship needs to be updated, and the first corresponding relationship needs to be deleted before updating the first corresponding relationship.

[0026] When the change occurs in adjusting the heartbeat interval using the first corresponding relationship in this application causes the first corresponding relationship to fail, new training optimization can be performed after the system is restored to obtain a new corresponding relationship.

[0027] In combination with the first aspect, in some implementations of the first aspect, the method further includes: determining that the first corresponding relationship needs to be updated according to the third piece of information, and performing the multiple obtaining of multiple temperatures and their corresponding moments. The third piece of information is used to indicate that the storage device is powered on for the first time.

[0028] If it is the first boot, the first corresponding relationship needs to be updated. Since the first corresponding relationship has not been stored before, there is no need to delete the first corresponding relationship before updating the first corresponding relationship.

[0029] In combination with the first aspect, in some implementations of the first aspect, the first link includes a high-speed peripheral component interconnect interface link.

[0030] In combination with the first aspect, in certain implementations of the first aspect, the target temperature difference includes the maximum temperature difference allowed when the storage device is operating normally.

[0031] In a second aspect, an embodiment of the present invention provides a storage device, including a processor and a memory. Wherein, the memory is used to store a program, and when the processor runs the program, the storage device is caused to execute the method described above.

[0032] In a third aspect, an embodiment of the present invention provides an electronic device, including the storage device described above.

[0033] In a fifth aspect, an embodiment of the present invention provides a readable storage medium, where the readable storage medium stores a program, and when the program is run by a device, the device is caused to execute the method as described above.

[0034] In a sixth aspect, an embodiment of the present invention provides a program product, where the program product includes a program, and when the program is run on a device or any at least one processor, the device is caused to execute the functions / steps in the method as described above.

[0035] 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 a first correspondence and a target temperature difference are stored in the memory. 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 according to the first temperature, the first moment, the first correspondence, and the target temperature difference; sending a first heartbeat packet to the main system according to the first moment and the first heartbeat interval and obtaining a second temperature and its corresponding second moment; determining a second heartbeat interval according to the second temperature, the second moment, the first correspondence, and the target temperature difference; and sending a second heartbeat packet to the main system according to the second moment and the second heartbeat interval. The first heartbeat interval and the second heartbeat interval are different, and can simultaneously meet the requirements of low power consumption and high reliability. Description of the Drawings

[0036] Figure 1 It is an architecture diagram of a heartbeat packet sending system provided by an embodiment of the present invention;

[0037] Figure 2 It is a signaling interaction diagram of a heartbeat packet sending method provided by an embodiment of the present invention;

[0038] Figure 3 It is a schematic diagram of the heating and cooling curves of the subsystem;

[0039] Figure 4 For Figure 2Schematic diagram of an application scenario of the heartbeat packet sending method shown

[0040] Figure 5 For Figure 2 Signaling interaction diagram before the processor in detects whether the processor needs to enter the low-power state

[0041] Figure 6 Flowchart of a heartbeat packet sending method provided by an embodiment of the present invention

[0042] Figure 7 For Figure 6 Flowchart before detecting that the processor needs to enter the low-power state and obtaining the first temperature and its corresponding first moment in

[0043] Figure 8 Schematic structural diagram of a device provided by an embodiment of the present invention Detailed implementation manners

[0044] For a better understanding of the technical solutions of the present invention, the embodiments of the present invention will be described in detail below with reference to the accompanying drawings

[0045] It should be clear that the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the scope of protection of the present invention

[0046] 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", "the" and "said" used in the embodiments of the present invention and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise

[0047] It should be understood that the term " / and / " used herein is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, a and / or b can represent: a exists alone, a and b exist simultaneously, and b exists alone. In addition, the character " / " herein generally represents an "or" relationship between the associated objects before and after

[0048] The receiver of the first link (such as a high-speed peripheral component interconnect (PCIe) link) adjusts the equalization parameters according to the received data signal during the working state to improve the link communication quality and reduce the bit error rate

[0049] When there is no data transmission on the first link, to reduce the power consumption of the entire system, the link state switches from the working state to the low-power state. The low-power state includes the non-working state and its sub-states with lower power consumption. When it is necessary to receive signals again, the processor restores the working state of the first link according to the equalization parameters before entering the low-power state and performs data transmission in the restored working state.

[0050] When the first link between the main system and the subsystem is in the low-power state, to maintain the reliable connection between the main system and the subsystem and prevent abnormal restoration of the first link due to environmental changes in the first link, the subsystem will regularly send heartbeat packets to the main system to maintain the connection state of the first link and adjust the equalization parameters, which is abbreviated as "keep-alive". Usually, a fixed heartbeat interval value is used to ensure the state of the first link.

[0051] The fixed heartbeat interval is usually the maximum interval obtained by the method of increasing the interval incrementally and trying errors. By gradually extending the heartbeat interval and observing that the heartbeat does not return to determine the maximum interval value, it cannot adapt to the online configuration in the local link, which may lead to multiple failed restarts of the system; when the original heartbeat configuration cannot be used normally after environmental changes, the system cannot optimize the configuration by itself and requires manual reconfiguration, so it cannot be adjusted according to environmental changes; during the process of obtaining the maximum interval value, the link may be disconnected, and relevant configuration adjustments cannot be made without the user noticing.

[0052] Therefore, the method of using a fixed heartbeat interval value to ensure the state of the first link has poor environmental adaptability. If the used heartbeat interval value is small, frequent entry and exit of the low-power state will increase the link overhead and the overall system power consumption; if the used heartbeat interval value is large, there will be no keep-alive communication after environmental changes, which may lead to link disconnection, the system cannot recognize the subsystem, and the reliability is low. Therefore, using a fixed heartbeat interval value to ensure the state of the first link has the problem of not being able to satisfy both low power consumption and high reliability at the same time.

[0053] Based on the above technical problems, an embodiment of the present invention provides a heartbeat packet sending system. Figure 1 It is an architecture diagram of a heartbeat packet sending system provided by an embodiment of the present invention.

[0054] As Figure 1 shown, 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 through the first communication interface 110. The subsystem 200 communicates with the main system 100 through the second communication interface 210. The transmission link between the first communication interface 110 and the second communication interface 210 is the first link.

[0055] Exemplarily, the first communication interface 110 and the second communication interface 210 are Peripheral Component Interconnect Express (PCIe) physical layer interfaces.

[0056] As Figure 1 shown, the second communication interface 210 of the subsystem 200 includes a heartbeat circuit 211. When the first link needs to be "kept alive", the heartbeat circuit 211 can send a heartbeat packet to the first communication interface 110 of the main system 100 to adjust the link parameters.

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

[0058] As Figure 1 shown, in the subsystem 200, the second communication interface 210, the memory 230, and the sensor 240 are all connected to the processor 220.

[0059] The sensor 240 of the subsystem 200 includes a sensor for detecting the parameters that need to be "kept alive". For example, a temperature sensor.

[0060] Based on Figure 1 the heartbeat packet sending system shown, an embodiment of the present invention provides a heartbeat packet sending method, which can balance low power consumption and reliability.

[0061] Figure 2 This is a signaling interaction diagram of a heartbeat packet sending method provided by an embodiment of the present invention. As Figure 2 shown, the method includes:

[0062] Step 302, the processor detects whether the processor needs to enter the low power consumption state. If so, execute step 304; if not, continue to execute step 302.

[0063] In this step, the processor of the subsystem detects whether the processor needs to enter the low power consumption state. When the subsystem receives a command from the main system to enter the low power consumption state (such as the main system setting a feature command Set Feature) or the first link meets the requirements for entering the low power consumption state (such as the subsystem APST being enabled), the processor of the subsystem detects that the processor needs to enter the low power consumption state. Therefore, the processor enters the low power consumption state, and along with it, the first link enters the low power consumption state. If the processor of the subsystem detects that the processor does not need to enter the low power consumption state, continue to execute step 302 and wait to enter the low power consumption state.

[0064] Exemplarily, the first link includes a transmission link between the main system and the subsystem, such as a PCIe link.

[0065] Exemplarily, the main system includes a host system.

[0066] Exemplarily, the subsystem is a storage device, such as an SSD subsystem.

[0067] Exemplarily, the first state is a low-power state.

[0068] Exemplarily, the low-power state is a non-operating state and its sub-states with lower power consumption.

[0069] Step 304: The processor sends a first message to the sensor.

[0070] In this step, when the processor of the subsystem detects that the processor needs to enter the low-power state, it sends a first message to the sensor. The first message includes information indicating the acquisition of the first temperature and its corresponding first moment.

[0071] Step 306: The sensor sends the first temperature and its corresponding first moment to the processor according to the first message.

[0072] In this step, the sensor of the subsystem sends the first temperature and its corresponding first moment to the processor according to the first message.

[0073] Exemplarily, the sensor of the subsystem is used to collect the ambient temperature of the subsystem.

[0074] Exemplarily, the first temperature is the ambient temperature of the subsystem before the processor enters the low-power state.

[0075] When the processor of the subsystem enters the low-power state, the main system needs to "keep alive" the communication with the subsystem, and only resumes the working state of the processor of the subsystem during the heartbeat. The sensor of the subsystem will collect the temperature and send it to the processor. The subsystem maintains basic detection functions when in the low-power state. The first communication interface of the subsystem is in an idle state of the link and only works and configures during the heartbeat keep-alive.

[0076] Step 308: The processor determines a first heartbeat interval according to the first temperature, the first moment, the first correspondence, and the target temperature difference.

[0077] In this step, the processor of the subsystem determines a first heartbeat interval according to the first temperature, the first moment, the first correspondence, and the target temperature difference. The processor of the subsystem obtains the pre-stored first correspondence and the target temperature difference from the memory, and determines the first heartbeat interval according to the first temperature, the first moment, the first correspondence, and the target temperature difference. When the processor of the present application needs to enter the low-power state, it determines the heartbeat interval by obtaining the temperature, thereby associating the heartbeat interval with the temperature.

[0078] Exemplarily, the first correspondence is the relationship between temperature and moment. In the present application, by obtaining the temperature and its corresponding moment at the current heartbeat, and according to the target temperature difference and the first correspondence between temperature and moment, the heartbeat interval for the next heartbeat is determined.

[0079] Exemplarily, the target temperature difference includes the maximum temperature difference allowed when the subsystem is operating normally. For example, the target temperature difference is the maximum temperature difference at which the front-end module of the subsystem operates.

[0080] Exemplarily, the processor of the subsystem determines the time required for the temperature to rise or fall by the target temperature difference according to the first correspondence relationship, and uses this time as the first heartbeat interval. After the processor of the subsystem enters the 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 break. Therefore, in order to ensure reliability, it is necessary to ensure that the temperature difference between two heartbeats does not exceed the target temperature difference. Preferably, in order to ensure high reliability in this application, the target temperature difference is selected as the temperature difference between two heartbeats.

[0081] Figure 3 It is a schematic diagram of the heating and cooling curves of the subsystem. As Figure 3 shown, the processor of the subsystem starts to enter the low-power state at time 0. Before the processor of the subsystem enters the low-power state, since the subsystem has been operating for a period of time in the working state, the ambient temperature gradually rises, and the ambient temperature gradually decreases after entering the low-power state. Therefore, the processor can determine the time interval when the temperature drops from the first temperature by the target temperature difference according to the Figure 3 correspondence relationship between temperature and time in the temperature drop curve in, and use this time interval as the heartbeat interval.

[0082] Exemplarily, the first correspondence relationship can be a temperature drop function, that is

[0083]

[0084] where y is the current temperature value, t is the time, A 0 is the first constant, t 0 is the second constant, and y 0 is the third constant. Among them, the time t is the timing time obtained by starting to count from the time when the microprocessor of the subsystem enters the low-power state.

[0085] For example, assume that the target temperature difference is △y, the first time is t 1 , the first temperature is y 1 , and the processor needs to calculate the time interval △t when the temperature drops from y 1 by △y to y 2 . The corresponding time for y 2 is t 2 . Since △y, t 1 , and y 1 are known, y 2 can be calculated according to the following formula two, that is

[0086] y 2 = y 1 - △y (Formula 2)

[0087] Then substitute y 2 into Formula 1, and the corresponding time for y 2 can be calculated as t 2 , that is

[0088]

[0089] Then substitute t 1 and t 2 into Formula 4, and △t can be calculated.

[0090] △t = t 2 - t 1 (Formula 4)

[0091] Step 310: The processor sends a first message to the second communication interface according to the first heartbeat interval and the first time.

[0092] In this step, the processor of the subsystem sends a first message to the second communication interface according to the first heartbeat interval and the first time. Specifically, the processor starts the first timing from the first time, and when the time of the first timing reaches the first heartbeat interval, it sends a second message to the second communication interface.

[0093] Among them, the second message is used as the input for the second communication interface to send the first heartbeat packet to the first communication interface.

[0094] Step 312: The second communication interface sends a first heartbeat packet to the first communication interface according to the second message.

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

[0096] As Figure 2 shown, after Step 310, there are also Step 314 - Step 322.

[0097] Step 314: The processor sends a third message to the sensor.

[0098] In this step, after sending the second message, the processor of the subsystem sends a third message to the sensor. The third message contains information indicating the acquisition of the second temperature and its corresponding second time.

[0099] Optionally, Step 314 and Step 210 can be executed simultaneously, that is, when the time of the first timing reaches the first heartbeat interval, the processor sends the second message and the third message simultaneously.

[0100] Step 316: The sensor sends the second temperature and its corresponding second moment to the processor according to the third message.

[0101] In this step, the sensor of the subsystem sends the second temperature and its corresponding second moment to the processor according to the third message.

[0102] In this application, when the processor is in the low-power state, it continuously detects whether it receives a wake-up message from the main system. If the processor receives a wake-up message from the main system, it enters the working state, and thus the first link also enters the working state.

[0103] Step 318: The processor determines the second heartbeat interval according to the second temperature, the second moment, the first correspondence, and the target temperature difference.

[0104] In this step, the processor of the subsystem determines the second heartbeat interval according to the second temperature, the second moment, the first correspondence, and the target temperature difference.

[0105] 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 elaborated here.

[0106] Step 320: The processor sends a second message to the second communication interface according to the second heartbeat interval and the second moment.

[0107] 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 moment.

[0108] It should be understood that the method for the processor to send a message to the second communication interface in step 320 is the same as that in step 310, and will not be elaborated here.

[0109] Among them, the fourth message is used as the input for the second communication interface to send a second heartbeat packet to the first communication interface.

[0110] Step 322: The second communication interface sends a second heartbeat packet to the first communication interface according to the fourth message.

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

[0112] Exemplarily, the first heartbeat interval is different from the second heartbeat interval. Therefore, the heartbeat interval is variable. Thus, this application dynamically adjusts the heartbeat interval according to the correspondence between temperature and moment, and can balance low power consumption and reliability.

[0113] After that, by analogy, if the subsystem is still in the low-power state, after or when sending the fourth message, the processor obtains the third temperature and its corresponding third moment collected by the sensor, and determines the third heartbeat interval according to the third temperature, the third moment, the first correspondence, and the target temperature difference.

[0114] Figure 4 is Figure 2 a schematic diagram of an application scenario of the heartbeat packet sending method shown in Figure 4 shown. The processor of the subsystem is initially in the working state. When it detects that the processor needs to enter the low-power state, it obtains the temperature T0 and its corresponding time t0, and combines with Figure 3 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 T0, its 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 its corresponding time t1. The temperature difference between T1 and T0 is the target temperature difference. The processor determines the second heartbeat interval Δt2 according to the temperature T1, its 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 time t2. The temperature difference between T2 and T1 is the target temperature difference. The processor determines the third heartbeat interval Δt3 according to the temperature T2, its corresponding time t2, the first correspondence, and the target temperature difference. The processor starts the third timing from time t2. 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 the temperature T3 and its corresponding time t3. The temperature difference between T3 and T2 is the target temperature difference. The processor determines the fourth heartbeat interval Δt4 according to the temperature T3, its corresponding time t3, the first correspondence, and the target temperature difference. The processor starts the fourth timing from time t3. 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 the temperature T4 and its corresponding time t4. The temperature difference between T4 and T3 is the target temperature difference, and so on, until the subsystem sends the nth heartbeat packet to the main system and obtains the temperature Tn and its corresponding time tn. Combining with Figure 3 the shown temperature drop curve, it can be seen that the rate of temperature drop is from fast to slow, so the time required for each drop of the target temperature difference becomes slower and slower. Therefore, Figure 4 the shown heartbeat intervals gradually increase. This application determines the heartbeat interval according to 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, it determines the heartbeat interval according to the target temperature difference, so that the temperature difference between two heartbeats does not exceed the target temperature difference, which can meet the requirements of high reliability.

[0115] Furthermore, Figure 5 is Figure 2 a signaling interaction diagram before the processor inFigure 5 As shown, before step 302, it further includes:

[0116] Step 402: During the initialization phase, the processor determines whether the first correspondence needs to be updated. If not, continue to execute step 302; if so, execute step 404 or step 406.

[0117] In this step, during the initialization phase, the processor of the subsystem determines whether the first correspondence needs to be updated.

[0118] In some possible embodiments, step 402 specifically includes: The processor determines that the first correspondence does not need to be updated according to the first information. The first information is used to indicate that the last power-down of the storage device was normal, 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 then execute step 404. When the change occurs in the heartbeat interval adjusted by using the first correspondence in this application causes the first correspondence to fail, new training optimization can be performed after the system is restored to obtain a new correspondence.

[0119] In some possible embodiments, step 402 specifically includes: The processor determines that the first correspondence needs to be updated according to the second information. The second information is used to indicate that the last power-down of the storage device was abnormal or the storage device is powered on for the first time after reinstalling the system, and then continue to execute step 302.

[0120] In some possible embodiments, step 402 specifically includes: The processor determines that the first correspondence needs to be updated according to the third information. The third information is used to indicate that the storage device is powered on for the first time, and then execute step 406.

[0121] Step 404: The processor deletes the first correspondence.

[0122] In this step, if the last power-down was abnormal or it is the first power-on after reinstalling the system, the current first correspondence is no longer reliable, and the processor of the subsystem deletes the stored first correspondence.

[0123] Step 406: The processor detects whether the processor needs to enter the low-power state. If so, execute step 408; if not, continue to execute step 406.

[0124] Step 408: The processor obtains multiple temperatures collected by the sensor and their corresponding times.

[0125] In this step, after the processor of the subsystem detects that it needs to be in the low-power state, it obtains multiple temperatures collected by the sensor and their corresponding times.

[0126] In some possible embodiments, step 408 specifically includes: the processor detects that it needs to be in a low-power state and sends a fifth message to the sensor; the sensor sends the temperature and its corresponding time when entering the low-power state to the processor according to the fifth message; after entering the low-power state, at least one temperature and its corresponding time are obtained based on the initial heartbeat configuration.

[0127] When the processor of the subsystem enters the low-power state, the main system needs to "keep alive" the communication with the subsystem, perform a heartbeat according to the initial heartbeat configuration, restore the first link state during each heartbeat, and the sensor will collect the temperature and send it to the processor.

[0128] The initial heartbeat configuration refers to using a heartbeat scheme with a relatively small heartbeat interval by default for communication keep-alive. At this time, the power consumption of the heartbeat scheme is the highest. The heartbeat interval of the initial heartbeat configuration is usually fixed.

[0129] Step 410: The processor obtains a set of corresponding relationships based on multiple temperatures and their corresponding times.

[0130] In this step, the processor of the subsystem obtains a set of corresponding relationships based on multiple temperatures and their corresponding times and saves the corresponding relationships to the memory. The corresponding relationship includes the relationship between temperature and time. Exemplarily, the corresponding relationship can be the above formula (1), that is, the temperature drop function.

[0131] In the present application, the corresponding relationship between temperature and time can be generated during system operation, and it will not cause the problem of system timeout disconnection due to configuration or training.

[0132] In step 410, by substituting multiple temperatures and their corresponding times into formula (1), A 0 、t 0 、y 0 values can be obtained.

[0133] Step 412: The processor determines whether the number of groups of corresponding relationships is less than or equal to the first threshold. If so, continue to execute step 406; if not, continue to execute step 302.

[0134] 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, continue to execute step 406 to obtain a new set of corresponding relationships until the number of groups of corresponding relationships obtained is greater than the first threshold, and then continue to execute step 302.

[0135] In some possible embodiments, before step 302, it further includes: the processor determines a first corresponding relationship based on multiple groups of corresponding relationships.

[0136] Exemplarily, the corresponding relationship includes a second constant, that is, t 0。The second constant represents the speed of temperature rise or fall. The larger the second constant, the faster the temperature rises or falls; the smaller the second constant, the slower the temperature rises or falls. In this application, the set of corresponding relationships with the fastest temperature rise or fall is selected as the first corresponding relationship, which can ensure the reliability of the heartbeat interval obtained according to the first corresponding relationship and is not likely to cause a link disconnection.

[0137] In some possible embodiments, the processor determines whether the corresponding relationship with the largest second constant among multiple sets of corresponding relationships is the last set of corresponding relationships. If so, step 406 is continued; if not, the corresponding relationship with the largest second constant is determined as the first corresponding relationship. In this application, if the corresponding relationship with the largest second constant is the last set of corresponding relationships, it indicates that there is still a high probability that the change speed of the ambient temperature will continue to increase. Therefore, step 406 is continued to obtain a new corresponding relationship; if the corresponding relationship with the largest second constant is not the last set of corresponding relationships, it indicates that the probability that the change speed of the ambient temperature may continue to increase is small. Therefore, the corresponding relationship with the largest second constant can be directly determined as the first corresponding relationship.

[0138] This application records the temperature through a temperature sensor, calculates and fits the temperature drop function of the environment where the subsystem is located according to the recorded temperature; calculates the required heartbeat interval after entering the low-power state according to the temperature drop function and the target temperature difference allowed for the subsystem operation, and configures this heartbeat interval as the heartbeat interval before each entry into the low-power state, so as to realize the online automatic configuration of the heartbeat interval during the device operation. If a failure occurs after the environment changes, when the device is restarted, the subsystem recognizes the last abnormal shutdown, can obtain the temperature drop function of the new environment where the device is located, and configures the heartbeat interval according to the temperature drop function of the new environment to achieve online autonomous optimization configuration.

[0139] The present invention obtains the law of the change of the ambient temperature of the subsystem, that is, the corresponding relationship between temperature and time, and learns and trains to give the maximum heartbeat interval that can ensure the stable operation of the system, so as to achieve the optimal balance between power consumption and reliability. The device can be directly powered on and used, and the corresponding relationship is determined during the use process, without the need for manual configuration of the heartbeat parameters or separate configuration and use, improving the use experience and efficiency; after the environment changes, there is no need for manual reconfiguration of the heartbeat parameters, improving the use experience and efficiency.

[0140] In the technical solution of the heartbeat packet sending method provided by the embodiment of the present invention, the method includes: detecting that the processor needs to enter the low-power state, obtaining the first temperature and its corresponding first moment; determining the first heartbeat interval according to the first temperature, the first moment, the first corresponding relationship and the target temperature difference; sending a first heartbeat packet to the main system according to the first moment and the first heartbeat interval and obtaining the second temperature and its corresponding second moment; determining the second heartbeat interval according to the second temperature, the second moment, the first corresponding relationship and the target temperature difference; sending a second heartbeat packet 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, which can meet the requirements of low power consumption and high reliability at the same time.

[0141] Figure 6 It is a flowchart 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 includes a processor and a memory. The first corresponding relationship and the target temperature difference are stored in the memory. As Figure 6 shown, the method includes:

[0142] Step 502, detecting that the processor needs to enter the low-power state, and obtaining the first temperature and its corresponding first moment.

[0143] Exemplarily, the first link includes a high-speed peripheral component interconnect interface link.

[0144] Step 504, determining the first heartbeat interval according to the first temperature, the first moment, the first corresponding relationship and the target temperature difference.

[0145] Exemplarily, the first corresponding relationship includes the corresponding relationship between temperature and moment.

[0146] Exemplarily, the target temperature difference includes the maximum temperature difference allowed when the storage device is working normally.

[0147] Step 506, sending a first heartbeat packet to the main system according to the first moment and the first heartbeat interval and obtaining the second temperature and its corresponding second moment.

[0148] In some possible embodiments, step 506 specifically includes: starting the first timing from the first moment, and when the time of the first timing reaches the first heartbeat interval, sending a first heartbeat packet to the main system.

[0149] Step 508, determining the second heartbeat interval according to the second temperature, the second moment, the first corresponding relationship and the target temperature difference.

[0150] Step 510, sending a second heartbeat packet 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.

[0151] In some possible embodiments, step 510 specifically includes: starting the second timing from the second moment, and when the time of the second timing reaches the second heartbeat interval, sending a second heartbeat packet to the main system.

[0152] Figure 7 For Figure 6 the flowchart before detecting that the processor needs to enter the low-power state and obtaining the first temperature and its corresponding first moment. As Figure 7 shown, the method includes:

[0153] Step 602, determine whether it is necessary to update the first correspondence relationship in the initialization stage. If not, continue to execute step 502; if so, execute step 604 or 606.

[0154] In some possible embodiments, step 602 specifically includes: determining that it is not necessary to update the first correspondence relationship according to the first information, where the first information is used to indicate that there is no abnormality in the last power-off of the storage device, 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 then execute step 604.

[0155] In some possible embodiments, step 602 specifically includes: determining that it is necessary to update the first correspondence relationship according to the second information, where the second information is used to indicate that there is an abnormality in the last power-off of the storage device or the storage device is powered on for the first time after reinstalling the system, and then continue to execute step 502.

[0156] In some possible embodiments, step 602 specifically includes: determining that it is necessary to update the first correspondence relationship according to the third information, where the third information is used to indicate that the storage device is powered on for the first time, and then execute step 606.

[0157] Step 604, delete the first correspondence relationship.

[0158] Step 606, detect whether the processor needs to be in the low-power state. If so, execute step 608; if not, continue to execute step 606.

[0159] Step 608, obtain multiple temperatures and their corresponding moments.

[0160] In some possible embodiments, step 608 specifically includes: detecting that it is necessary to be in the low-power state, obtaining the temperature and its corresponding moment when entering the low-power state; after entering the low-power state, obtaining at least one temperature and its corresponding moment based on the initial heartbeat configuration.

[0161] Step 610, obtain a set of correspondence relationships according to the multiple temperatures and their corresponding moments.

[0162] Step 612: Determine whether the number of groups of the corresponding relationships is less than or equal to the first threshold. If so, continue to execute Step 606; if not, continue to execute Step 502.

[0163] In the technical solution of the heartbeat packet sending method provided by the embodiments of the present invention, the method includes: detecting that the processor needs to enter the low-power state, obtaining the first temperature and its corresponding first moment; determining the first heartbeat interval according to the first temperature, the first moment, the first corresponding relationship, and the target temperature difference; sending the first heartbeat packet to the main system according to the first moment and the first heartbeat interval and obtaining the second temperature and its corresponding second moment; determining the second heartbeat interval according to the second temperature, the second moment, the first corresponding relationship, and the target temperature difference; sending the second heartbeat packet to the main system according to the second moment and the second heartbeat interval. The first heartbeat interval and the second heartbeat interval are different, and can simultaneously meet the requirements of low power consumption and high reliability.

[0164] Figure 8 FIG. is a schematic structural diagram 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. For the sake of avoiding repetition, details are not described herein again. The device 700 includes: a processor 701 and a memory 702.

[0165] The embodiments of the present application further provide 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. When the at least one processor 701 runs the at least one program, the storage device is enabled to execute the operations involved in the above method embodiments and Figures 2 - 7 as described above.

[0166] The embodiments of the present application further provide an electronic 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. When the at least one processor 701 runs the at least one program, the electronic device is enabled to execute the operations involved in the above method embodiments and Figures 2 - 7 as described above.

[0167] The embodiments of the present application further provide a readable storage medium. A program is stored in the readable storage medium. When the program runs on the storage device, the storage device is enabled to execute the operations involved in the above method embodiments and Figures 2 - 7 as described above.

[0168] The embodiments of the present application further provide a readable storage medium. A program is stored in the readable storage medium. When the program runs on the electronic device, the electronic device is enabled to execute the operations involved in the above method embodiments and Figures 2 - 7 as described above.

[0169] The embodiments of the present application also provide a program product. When the program product runs on a storage device or any at least one processor, it causes the storage device to execute the operations involved in the above method embodiments and Figures 2 - 7 those described below.

[0170] The embodiments of the present application also provide a program product. When the program product runs on an electronic device or any at least one processor, it causes the electronic device to execute the operations involved in the above method embodiments and Figures 2 - 7 those described below.

[0171] Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.

[0172] In several embodiments provided by the present 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 the present application, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a device (which can be a heartbeat generation device, an electronic device, a computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories, random access memories, magnetic disks, or optical discs that can store program codes.

[0173] The above is only the specific implementation manner of the present application. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application, and all such changes or substitutions should be covered by the protection scope of the present application. The protection scope of the present application shall be subject to the protection scope of the claims.

Claims

1. A heartbeat generation method, characterized in that, it is applied to a storage device, the storage device includes a processor and a memory, and a first correspondence and a target temperature difference are stored in the memory. The method includes: detecting that the processor needs to enter a low-power state, and obtaining a first temperature and its corresponding first moment; determining a first heartbeat interval according to the first temperature, the first moment, the first correspondence, and the target temperature difference; sending a first heartbeat packet to the main system according to the first moment and the first heartbeat interval, and obtaining a second temperature and its corresponding second moment; determining a second heartbeat interval according to the second temperature, the second moment, the first correspondence, and the target temperature difference; sending a second heartbeat packet to the main system according to the second moment and the second heartbeat interval, and the first heartbeat interval is different from the second heartbeat interval.

2. The method according to claim 1, characterized in that, the first correspondence includes the correspondence between temperature and moment.

3. The method according to claim 2, characterized in that, the correspondence is a temperature drop function: where y is the current temperature value, t is the time, A 0 is the first constant, t 0 is the second constant, y 0 is the third constant.

4. The method according to any one of claims 1-3, characterized in that, the method further includes: detecting whether the wake-up of the first link occurs; if the wake-up of the first link occurs, the processor enters the working state.

5. The method according to any one of claims 1-4, characterized in that, before obtaining the first temperature and its corresponding first moment after detecting that the processor needs to enter the low-power state, the method further includes: obtaining multiple temperatures and their corresponding moments multiple times to obtain multiple groups of correspondences; determining the first correspondence according to the multiple groups of correspondences.

6. The method according to any one of claims 1-5, characterized in that, before detecting that the processor needs to enter the low-power state, the method further includes: in the initialization stage, if it is determined according to the first information that the first correspondence does not need to be updated, then execute obtaining the first temperature and its corresponding first moment; wherein, the first information is used to indicate that the previous power-off of the storage device is normal, 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.

7. The method according to claim 5, characterized in that, the method further includes: determining according to the second information that the first correspondence needs to be updated, deleting the first correspondence, and executing obtaining multiple temperatures and their corresponding moments multiple times. The second information is used to indicate that the previous power-off of the storage device is abnormal or the storage device is powered on for the first time after reinstalling the system.

8. The method according to claim 5, characterized in that, the method further includes: determining according to the third information that the first correspondence needs to be updated, and executing obtaining multiple temperatures and their corresponding moments multiple times. 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-8, characterized in that, the first link includes a high-speed peripheral component interconnect interface link.

10. The method according to any one of claims 1-9, wherein, the target temperature difference includes the maximum temperature difference allowed when the storage device is operating normally.

11. A storage device, wherein, it includes a processor and a memory, wherein the memory is used to store a program, and when the processor runs the program, the storage device is caused to execute the steps of the method according to any one of claims 1-10.

12. An electronic device, wherein, it includes the storage device according to claim 11.

13. A readable storage medium, wherein, the readable storage medium stores a program, and the program includes program instructions, and when the program instructions are run by an electronic device, the electronic device is caused to execute the method according to any one of claims 1-10.

Citation Information

Cited By

  • Heartbeat packet sending method, storage apparatus, and electronic device

    EP4734471A1

  • Heartbeat packet sending method, storage apparatus, and electronic device

    WO2025118725A1