Power failure information determination method, energy storage power supply and storage medium
By writing the recorded information in the memory when the energy storage system is powered on and reading it after the power is off, the power-down time of the energy storage power supply is determined in software, which solves the problem of increased cost and complexity caused by hardware dependence in the existing technology. , achieving safe and accurate power-down time statistics.
Patent Information
- Application Number
- CN202410674782.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-27
- Publication Date
- 2024-09-10
Smart Images

Figure CN118626318A
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of power supply systems, and in particular to a method for determining power-off time, an energy storage power supply, and a computer-readable storage medium. Background Art
[0002] Most energy storage system equipment has the need to collect statistical information on system power-off time, which is used to display the specific operation status of the last system after the system is powered on again, or to analyze the system power supply quality and adopt different power supply strategies.
[0003] At present, the energy storage system generally uses hardware-assisted methods to implement the statistics of power failure time information, that is, a device that can provide short-term power supply is set in the system hardware to save the power failure information by relying on short-term power supply. Increasing the system hardware will not only greatly increase the design cost, but also increase the complexity of hardware design, bringing safety risks to the system. Summary of the invention
[0004] The embodiments of the present application provide a method for determining power-off information, an energy storage power supply, and a computer-readable storage medium, which realize the confirmation of the power-off time of the energy storage power supply in a software manner in combination with a memory.
[0005] An embodiment of the present application provides a method for determining power-off information, which is applied to an energy storage power supply. The method comprises: when the energy storage system is powered on, writing corresponding record information in a memory at preset time intervals; when the energy storage system is powered on again after power failure, reading the written record information; and determining the power-off time of the energy storage power supply based on the written record information.
[0006] In some embodiments, the memory stores data based on a preset data format, the preset data format includes multiple first fields and a second field storing a power-on time, the record information is written into the first field, the multiple first fields are arranged in sequence, and the energy storage power supply writes the power-on time into the second field when it is powered on; the corresponding record information is written into the memory at every preset time interval, including:
[0007] At every preset time interval, the value of the currently written field is updated once based on a preset threshold value to serve as the record information, the currently written field is any of the first fields, the currently written field is initially the first of the first fields, the initial value of the first field is one of the maximum value and the minimum value of the first field, the target value of the first field is the other of the maximum value and the minimum value of the first field, and the value of the first field becomes the target value of the first field after being updated a preset number of times; when the updated value of the currently written field is the target value, the next first field is determined to be the currently written field;
[0008] Determining the power-off time of the energy storage power supply based on the written record information includes: determining the power-off time of the energy storage power supply based on the values of each of the first fields, the power-on time of the second field, the preset threshold, and the preset time interval.
[0009] In some embodiments, the preset data format also includes and stores a third field for storing the number of cycle records. When all of the first fields are the target values, the energy storage power supply adds 1 to the number of cycle records in the third field and updates the values of all of the first fields to the initial value. The power-off time of the energy storage power supply is determined based on the values of each of the first fields, the power-on time of the second field, the preset threshold, and the preset time interval, including: determining the power-off time based on the values of each of the first fields, the power-on time of the second field, the number of cycle records in the third field, the preset threshold, and the preset time interval.
[0010] In some embodiments, the power-off time is determined based on the values of each of the first fields, the power-on time of the second field, the number of loop records in the third field, the preset threshold, and the preset time interval, including: determining the first record number based on the loop record number; determining the second record number based on the number of the first fields whose values are the target values; determining the third record number of the first field whose values are between the initial value and the target value based on the preset threshold; determining the total record duration based on the first record number, the second record number, the third record number and the preset time interval; determining the power-off time based on the total record duration and the power-on time of the second field.
[0011] In some embodiments, the preset data format also includes a fourth field for storing whether a power-off record has been performed, and the method also includes: when the energy storage system is powered on again after power failure, if it is determined based on the value of the fourth field read that the memory has performed a power-off record, then entering the step of reading the recorded information that has been written.
[0012] In some embodiments, the recorded information includes a writing time, and determining the power-off time of the energy storage power supply based on the recorded information that has been written includes: determining the power-off time of the energy storage power supply based on the writing time of the latest written recorded information.
[0013] The embodiment of the present application also provides a device for determining power-off time, which is applied to an energy storage power supply and is characterized in that it includes: a writing module, which is used to write corresponding record information in a memory at preset time intervals when the energy storage system is powered on; a reading module, which is used to read the written record information when the energy storage system is powered on again after power failure; and a determination module, which determines the power-off time of the energy storage power supply based on the written record information.
[0014] An embodiment of the present application also provides an energy storage power supply, characterized in that it includes: a processor and a memory; wherein the memory stores a computer program, the computer program is executed by the processor, and the computer program includes instructions for executing the method for determining the power-off time described in any of the above embodiments.
[0015] An embodiment of the present application further provides a computer-readable storage medium, comprising a computer program, and when the computer program is executed by a processor, the processor executes the method for determining power-off information described in any of the above embodiments.
[0016] In the method for determining power-off information, energy storage power supply, and computer-readable storage medium of the present application, by writing record information into the memory according to a preset time interval when the system is powered on, the record information can reflect the number of records after the system is powered on. When the system is powered off and then powered on again, the record information in the memory is recorded to the time of the last power off. By reading the record information, the time from the last power-on to the power-off of the system can be determined based on the preset time interval and the record information, and the power-off time of the system can be determined in combination with the last power-on time of the system. The confirmation of the system power-off time is realized by software, without the need to add additional hardware assistance, thereby reducing the cost and complexity of the system hardware.
[0017] Additional aspects and advantages of the embodiments of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0019] Figure 1 It is a scenario diagram of a method for determining power failure information in certain implementation modes of the present application;
[0020] Figure 2 It is a flowchart of a method for determining power failure information in certain implementation modes of the present application;
[0021] Figure 3It is a flowchart of a method for determining power failure information in certain implementation modes of the present application;
[0022] Figure 4 It is a schematic diagram of a preset data structure of a method for determining power failure information in certain implementation modes of the present application;
[0023] Figure 5 It is a flowchart of a method for determining power failure information in certain implementation modes of the present application;
[0024] Figure 6 It is a schematic diagram of a device for determining power failure information in certain implementation modes of the present application;
[0025] Figure 7 It is a schematic diagram of the connection status of a non-volatile computer-readable storage medium and a processor in certain embodiments of the present application. DETAILED DESCRIPTION
[0026] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals represent the same or similar elements or elements having the same or similar functions from beginning to end. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the embodiments of the present application, and cannot be understood as limiting the embodiments of the present application.
[0027] In the present application, unless otherwise clearly specified and limited, a first feature being “above” or “below” a second feature may mean that the first and second features are in direct contact, or the first and second features are in indirect contact through an intermediate medium. Moreover, a first feature being “above”, “above”, and “above” a second feature may mean that the first feature is directly above or obliquely above the second feature, or simply means that the first feature is higher in level than the second feature. A first feature being “below”, “below”, and “below” a second feature may mean that the first feature is directly below or obliquely below the second feature, or simply means that the first feature is lower in level than the second feature.
[0028] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one feature. In the description of this application, the meaning of "plurality" is at least two, such as two, three, unless otherwise clearly and specifically defined.
[0029] At present, most energy storage system equipment has the need to count the power-off time information of the energy storage system. After the energy storage system is powered on again, the specific operation status of the last energy storage system is displayed to the user based on the power-off time information. The current confirmation of the power-off time of the energy storage system is usually achieved by hardware-assisted methods. A short-term power supply device is set in the energy storage system hardware, such as: small-capacity batteries, supercapacitors, etc. After the energy storage system detects a power outage, it relies on a short power supply to save the power-off information. When the energy storage system is powered on again, the saved power-off information is read and the power-off time information is counted. This method of confirming power-off information not only greatly increases the system hardware design cost, but also increases the complexity of hardware design, which is easy to bring safety hazards to the energy storage system.
[0030] In order to solve the above technical problems, the present application provides a method for determining power failure information. The method for determining power failure information of the present application will be described in detail below:
[0031] See also Figure 1 The present application embodiment provides a method for determining power failure information, which is applied to energy storage power supply, and the method includes:
[0032] Step 011: When the energy storage system is powered on, corresponding record information is written into the memory at every preset time interval;
[0033] Optionally, the preset time interval is a pre-set time period, and the corresponding record information is written into the memory every fixed time period. The preset time interval can be determined according to the required time accuracy.
[0034] Specifically, since the power-off time of the energy storage system cannot be predicted in advance, and the energy storage system stops running when the power is off, it is impossible to save the power-off information when the energy storage system is powered off. In order to ensure that the power-off time of the energy storage system can be recorded, relevant information is recorded when the energy storage system is powered on. The corresponding recorded information is written into the memory at preset time intervals. When the energy storage system is powered off, the recording is automatically stopped. Then, according to the preset time interval and the recorded information, the time from power-on to power-off of the energy storage system can be obtained.
[0035] Step 012: When the energy storage system is powered on again after power failure, the written record information is read;
[0036] Optionally, the recorded information that has been written may be the time when the energy storage system was last powered on, the number of times recorded at preset time intervals after the last power-on, and the like.
[0037] Specifically, when the energy storage system is powered on again after power failure, the memory is written with the recorded information recorded from the last power-on to the power failure of the energy storage system. The recorded information written in the memory from the last power-on to the power failure of the energy storage system can be read to obtain the relevant information of the last power failure of the energy storage system.
[0038] Step 013: Determine the power-off time of the energy storage power supply based on the written record information.
[0039] Specifically, after reading the recorded information written from the last power-on to the power-off of the energy storage system, the running time from the last power-on to the power-off of the energy storage system and the last power-on time of the energy storage system can be determined based on the written recorded information and the preset time interval. The power-off time of the energy storage system can be determined based on the last power-on time of the energy storage system and the running time from power-on to power-off.
[0040] For example, when the preset time interval is 2 seconds (S), and the energy storage system is powered on again after power failure, the information recorded by the energy storage system from the last power-on to the power failure includes the power-on time T1 and the number of times n recorded according to the time interval. Then the last power failure time of the energy storage system is: T2 = T1 + 2*n.
[0041] At present, the statistics of power-off time information in energy storage systems are generally implemented with hardware-assisted methods. In the system hardware settings, a short-term power supply device can continue to provide normal operation of the system for a few seconds, such as: small-capacity batteries, supercapacitors, etc. After the system detects a power outage, it relies on a short power supply to save the power-off information. The next time the energy storage system is powered on again, the saved power-off information is read again to complete the statistics of the power-off time information. However, using hardware to record and count power-off information greatly increases the hardware design cost and complexity of the energy storage system, which brings safety risks to the energy storage system.
[0042] In the method for determining power-off information of the present application, when the energy storage system is powered on, relevant information is recorded in the memory at preset time intervals, and the recording stops immediately when the system is powered off. When the energy storage system is powered on again, the time from the last power-on to the power-off of the energy storage system can be calculated based on the number of records read in the memory and the preset time interval, and the power-off time of the energy storage system can be determined in combination with the last power-on time of the energy storage system. There is no need to add auxiliary hardware to record the power-off time of the energy storage system, which greatly reduces the system hardware design cost and hardware design complexity, and can also obtain the accurate power-off time of the energy storage system.
[0043] See also Figure 2 and Figure 3In some embodiments, the memory stores data based on a preset data format, the preset data format includes multiple first fields and a second field for storing the power-on time, the record information is written into the first field, the multiple first fields are arranged in sequence, and when the energy storage power supply is powered on, the power-on time is written into the second field; step 011 "when the energy storage system is powered on, write the corresponding record information into the memory at every preset time interval" is from step 0111 to step 0112, which is described in detail below.
[0044] Step 0111: at every preset time interval, the value of the currently written field is updated once based on the preset threshold value to serve as record information, the currently written field is any first field, the currently written field is initially the first first field, the initial value of the first field is one of the maximum value and the minimum value of the first field, the target value of the first field is the other of the maximum value and the minimum value of the first field, and the value of the first field becomes the target value of the first field after being updated a preset number of times;
[0045] Optionally, the preset data format may be a data format for recording information written into the memory during power-on for preserving the energy storage system, and the preset data format includes a second field and a plurality of first fields.
[0046] Optionally, the first field is used to store record information written by the system at predetermined intervals, and the initial value of the first field is the maximum value or minimum value that the first field can represent. When the initial value of the first field is the maximum value that the first field can represent, the minimum value of the first field is the target value, and the first field is updated based on a preset threshold value. After the preset number of updates, the first field is changed to the minimum value, that is, the target value; when the initial value of the first field is the minimum value that the first field can represent, the maximum value of the first field is the target value, and the first field is updated based on the preset threshold value. After the preset number of updates, the first field is changed to the maximum value, that is, the target value; the first field is updated once at every preset time interval, and the update of the first field is determined based on the preset threshold value.
[0047] Specifically, the recorded information of the energy storage system is stored in the memory in bytes. In order to ensure the accuracy of the recorded information and facilitate subsequent reading, a preset data format is set for the recorded information, and the recorded information is stored in the memory according to the preset data format. The preset data format includes a second field and multiple first fields, wherein the first field is used to store the recorded information written by the system at predetermined intervals, the multiple first fields are arranged in sequence, and the second field is used to store the power-on time of the system. When the energy storage system is powered on, the power-on time of the energy storage system is written in the second field. At every preset time interval, the first field is updated based on a preset threshold, and after a preset number of times, the first field becomes the target value of the first field.
[0048] Step 0112: When the updated value of the currently written field is the target value, determine the next first field as the currently written field.
[0049] Specifically, when the current write field is updated to the target value, it means that the current write field can no longer write record information. Then the first field next to the current write field is used as the current write field, and the address of the current write field is changed to the address of the next field.
[0050] Step 013 is implemented by step 014, which is described in detail below.
[0051] Step 014: Determine the power-off time of the energy storage power supply based on the values of each first field, the power-on time of the second field, the preset threshold, and the preset time interval.
[0052] Specifically, based on the values of each first field, if the value of the first field is the target value, it means that the first field has been updated a preset number of times. If the value of the first field is between the initial value and the target value, it means that the first field is the current write field and is in an updateable state. Based on the value of the current write field and the preset threshold, the number of updates of the current write field can be determined. Based on the number of first fields with the target value and the preset number of times the first field can be updated plus the number of updates of the current write field, the total number of updates after the energy storage system is powered on. Multiplying the total number of updates after the energy storage system is powered on by the preset interval time is the running time of the energy storage system after it is powered on. Read the power-on time of the energy storage system stored in the second field. The product of the power-on time of the energy storage system plus the total number of updates and the preset time interval is the moment when the energy storage system stops updating the first field. The moment when the energy storage system stops updating is the power-off time of the energy storage system.
[0053] In some embodiments, the preset data format also includes and stores a third field for storing the number of loop records. When all first fields of the energy storage power supply are target values, the number of loop records in the third field is increased by 1 and the values of all first fields are updated to initial values. Step 014 "determines the power-off time of the energy storage power supply based on the values of each first field, the power-on time of the second field, the preset threshold, and the preset time interval" is implemented by step 015, which is described in detail below.
[0054] Step 015: Determine the power-off time based on the values of each first field, the power-on time of the second field, the number of loop records in the third field, the preset threshold, and the preset time interval.
[0055] Optionally, the number of loop records is the number of times the values of the first first field to the last first field are updated to the target value. After the first first field to the last first field are updated to the target value, the number of loop records is increased by 1, and the values of all first fields are updated to the initial value, and the update of the first first field to the last first field is restarted, and the cycle repeats.
[0056] Specifically, the number of loop records can reflect the number of times all first fields are updated from the initial value to the target value before the start of this update cycle from the first first field to the last first field. The number of times each first field is updated from the initial value to the target value is fixed, so the number of loop records is multiplied by the number of first fields, and then multiplied by the preset number, which is the total number of updates before the start of this update cycle. Based on the values of each first field in this update cycle, the number of updates in this update cycle can be determined. The total number of updates before the start of this update cycle plus the number of updates in this update cycle is the total running time after the energy storage system is powered on. Read the power-on time of the second field, and the power-on time plus the total running time is the power-off time of the energy storage system.
[0057] For example, there are n first fields in total, and each first field is updated from the initial value to the target value for m times, the preset interval is z seconds, and the number of loop records is q times. Currently, there are x first fields whose values are the target values, and the number of updates of the first fields whose values are between the initial value and the target value is y times. The last power-on time of the energy storage system is t. 始 The total operating time of the energy storage system after power-on is T 总 :
[0058] T 总 =(q*m*n+x*m+y)*z
[0059] Energy storage system power-off time t 掉 :
[0060] t 掉 =t 始 +T 总
[0061] Thus, by adding the third field of the number of loop recordings, after the first first field to the last first field completes the cycle from the initial value to the target value, the number of loop recordings is recorded again. There is no need to set a huge number of first fields to record information for a long time. With a small number of first fields, the function of recording information for a long time can be achieved, and the number of first fields can be reduced to reduce the storage space required for recording information.
[0062] See also Figure 4In some embodiments, step 015 "determines the power-off time based on the values of each first field, the power-on time of the second field, the number of loop records in the third field, the preset threshold, and the preset time interval." is implemented by steps 0151 to 0155, which are described in detail below.
[0063] Step 0151: Determine the first recording number based on the number of loop recordings;
[0064] Specifically, the number of loop records is the number of cycles that all first fields undergo from the initial value to the target value. When all first fields complete an update from the initial value to the target value, the number of loop records is increased by 1, and all first fields are restored to their initial values to start the next cycle. The number of loop records multiplied by the number of first fields and then multiplied by the preset number of first field updates is the first record number.
[0065] Step 0152: Determine the second record count based on the number of first fields whose values are the target values;
[0066] Specifically, the first field whose value is the target value indicates that the first field has completed the update from the initial value to the target value, and the number of records is the preset number. The number of first fields whose value is the target value is obtained, and the second number of records is the number of first fields whose value is the target value multiplied by the preset number of records of the first field.
[0067] Step 0153: Based on a preset threshold, determine the number of third records of the first field whose value is between the initial value and the target value;
[0068] Specifically, the first field whose value is between the initial value and the target value indicates that the first field is the first field that stops recording when the energy storage system loses power. The product of the preset threshold and the preset number of times plus the initial value of the first field is the target value of the first field. Therefore, the difference between the value of the first field and the initial value of the first field, divided by the preset threshold, is the third number of records.
[0069] Step 0154: Determine the total recording duration based on the first recording number, the second recording number, the third recording number and the preset time interval;
[0070] Specifically, when the first recording number, the second recording number, the third recording number and the preset time interval are obtained, the sum of the first recording number, the second recording number and the third recording number is multiplied by the preset time interval to obtain the total recording duration.
[0071] Step 0155: Determine the power-off time based on the total recording time and the power-on time of the second field.
[0072] Specifically, the total recording duration is the total duration from when the energy storage system is powered on to when the energy storage system is powered off. Therefore, based on the power-on time recorded in the second field, the power-on time plus the total recording duration is the power-off time of the energy storage system.
[0073] In this way, by reading the record information of each field and calculating the number of records shown in each field, the total number of records after the energy storage system is powered on can be easily calculated, and the total recording time can be confirmed based on the total number of records and the preset time interval. The total recording time combined with the power-on time recorded in the fourth field can confirm the power-off time of the energy storage system, realize the rapid calculation of the power-off time confirmation, improve the calculation efficiency, and save storage space.
[0074] Please refer again Figure 3 and Figure 5 In some embodiments, the preset data format further includes a fourth field for storing whether a power-off record has been performed, and the method further includes:
[0075] When the energy storage system is powered on again after power failure, if it is determined based on the value of the fourth field that the memory has recorded the power failure, the step of reading the recorded information that has been written is entered.
[0076] Optionally, whether a power-off record has been made may indicate whether the energy storage system has had a power-off record before. If no power-off record has been made before, it means that the energy storage system is powered on for the first time and there is no power-off record before.
[0077] Specifically, after the energy storage system is powered on, the fourth field is read to determine whether a power-off record has been made. If the value of the fourth field read indicates that a power-off record has been made, the process proceeds to the step of writing the record information, and the power-off time of the energy storage system is determined based on the written record information. If the value of the fourth field read indicates that a power-off record has not been made, it means that the energy storage system is running for the first time, and there is no need to determine the power-off time of the energy storage system, and the record information can be written based on the preset time.
[0078] Thus, by adding a fourth field in the preset data format to store whether a power failure record has been made, it is convenient to determine whether the energy storage system has a power failure record. If there is no power failure record, there is no need to count the power failure information, thus avoiding useless traversal of each first field.
[0079] In some embodiments, the recorded information includes the writing time, and step 013 "determining the power-off time of the energy storage power supply based on the written recorded information" is implemented by step 016, which is described in detail below.
[0080] Step 016: Determine the power-off time of the energy storage power supply based on the writing time of the latest written record information.
[0081] Optionally, the recorded information includes a writing time, and the writing time indicates the time when the energy storage system writes the recorded information.
[0082] Specifically, since the energy storage system writes the writing time at the same time as writing the record information, the record information written when the energy storage system is powered off is the latest record information, and the writing time in the latest record information is the latest writing time, and the latest writing time is the power-off time of the energy storage power supply.
[0083] In this way, by adding the writing time when the recording information is written to the recording information, the writing time written when the energy storage system is powered off is the power-off time. When the energy storage system is powered on again, the power-off time of the energy storage system can be determined based on the writing time corresponding to the latest written information, which greatly improves the efficiency of confirming the power-off time.
[0084] In some embodiments, the first field is a preset number of bytes, and the number of the first field is determined based on the preset number of bytes, a preset threshold, and a maximum number of read and write times of the memory.
[0085] Optionally, the preset number of bytes may be the number of bytes of the first field, and the preset number of bytes of the first field may be determined according to the size of the memory storage unit and a preset threshold.
[0086] Optionally, the maximum readable and writable times of the memory may be the maximum readable and writable times of a storage unit of the memory. When a storage unit reaches the maximum readable and writable times, it may become unstable or can no longer reliably store data, and is considered to have become bad.
[0087] Specifically, if the preset number of bytes of the first field is too long and the preset threshold is too small, the first field located in the front column may be frequently read and written when recording information, which may cause the storage unit where the first field located in the front column is located to quickly reach the maximum number of read and write times and become a bad block of the storage. In this way, not only does it need to reallocate storage space for the first field, but it also causes data loss, making it impossible to determine the power-off time. Therefore, it is necessary to determine the number of first fields based on the preset number of bytes, the preset threshold, and the maximum number of read and write times of the memory, so that the number of read and write times of each storage unit can be as average as possible during use to extend the service life of the memory.
[0088] See also Figure 6 The embodiment of the present application also provides a device 10 for determining power-off time, which is applied to an energy storage power supply. The device 10 for determining power-off time includes a writing module 11, a reading module 12 and a determining module 13. The writing module 11 is used to write corresponding record information in the memory at preset time intervals when the energy storage system is powered on; the reading module 12 is used to read the written record information when the energy storage system is powered on again after power failure; the determining module 13 determines the power-off time of the energy storage power supply based on the written record information.
[0089] In some embodiments, the memory stores data based on a preset data format, the preset data format includes multiple first fields and a second field for storing the power-on time, the record information is written into the first field (specifically, the storage address corresponding to the first field), the multiple first fields are arranged in sequence, and the energy storage power supply writes the power-on time into the second field when it is powered on; the writing module 11 is also used to update the value of the current written field once every preset time interval based on a preset threshold value as the record information, the current written field is any first field, the current written field is the first first field at the initial time, the initial value of the first field is one of the maximum value and the minimum value of the first field, the target value of the first field is the other of the maximum value and the minimum value of the first field, and the value of the first field becomes the target value of the first field after being updated a preset number of times; when the value of the current written field after being updated is the target value, the next first field is determined to be the current written field;
[0090] In some embodiments, the determination module 13 is further used to determine the power-off time of the energy storage power supply based on the values of each first field, the power-on time of the second field, a preset threshold, and a preset time interval.
[0091] In some embodiments, the preset data format also includes and stores a third field for storing the number of loop records. When all first fields of the energy storage power supply are target values, the number of loop records in the third field is increased by 1 and the values of all first fields are updated to initial values. The determination module 13 is also used to determine the power-off time based on the values of each first field, the power-on time of the second field, the number of loop records in the third field, the preset threshold, and the preset time interval.
[0092] In some embodiments, the determination module 13 is also used to determine the first recording number based on the number of loop recordings; determine the second recording number based on the number of first fields whose values are the target values; determine the third recording number of the first field whose values are between the initial value and the target value based on a preset threshold; determine the total recording duration based on the first recording number, the second recording number, the third recording number and the preset time interval; determine the power-off time based on the total recording time and the power-on time of the second field.
[0093] In some embodiments, the preset data format also includes a fourth field for storing whether a power-off record has been made, and the reading module 12 is also used for, when the energy storage system is powered on again after power failure, if it is determined based on the value of the fourth field read that the memory has performed a power-off record, then entering the step of reading the written record information.
[0094] In some embodiments, the recorded information includes a writing time, and the determination module 13 is further used to determine the power-off time of the energy storage power supply based on the writing time of the latest written recorded information.
[0095] Please refer to the figure, an embodiment of the present application also provides an energy storage power supply 100, including a processor, a memory and a computer program. The computer program is stored in the memory and executed by the processor. The computer program includes instructions for executing the method for determining power-off information of any of the above-mentioned embodiments applied to the energy storage power supply. For the sake of brevity, it will not be repeated here.
[0096] See also Figure 7 The embodiment of the present application also provides a computer-readable storage medium 500, on which a computer program 510 is stored. When the computer program 510 is executed by a processor 520 (such as a controller of a storage power supply or a processor of a server), the steps of the method for determining power-off information of any of the above-mentioned embodiments are implemented. For the sake of brevity, they are not repeated here.
[0097] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples" or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiments or examples are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, unless they are contradictory.
[0098] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.
[0099] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in this field can change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. A method for determining power-off time, characterized in that: Applied to energy storage power supply, the method comprises: When the energy storage system is powered on, writing corresponding record information into the memory at preset time intervals; When the energy storage system is powered on again after power failure, reading the recorded information that has been written; The power-off time of the energy storage power supply is determined based on the written record information.
2. The method for determining the power-off time according to claim 1, characterized in that: The memory stores data based on a preset data format, the preset data format includes a plurality of first fields and a second field storing a power-on time, the record information is written into the first field, the plurality of first fields are arranged in sequence, and the energy storage power supply writes the power-on time into the second field when it is powered on; The step of writing corresponding record information into the memory at every preset time interval includes: At every preset time interval, the value of the currently written field is updated once based on a preset threshold value to serve as the record information, the currently written field is any of the first fields, the currently written field is initially the first of the first fields, the initial value of the first field is one of the maximum value and the minimum value of the first field, the target value of the first field is the other of the maximum value and the minimum value of the first field, and the value of the first field becomes the target value of the first field after being updated a preset number of times; In the case where the updated value of the currently written field is the target value, determining the next first field as the currently written field; The determining the power-off time of the energy storage power supply based on the written record information includes: The power-off time of the energy storage power supply is determined based on the values of each of the first fields, the power-on time of the second field, the preset threshold, and the preset time interval.
3. The method for determining the power-off time according to claim 2, characterized in that: The preset data format also includes and stores a third field for recording the number of cycles. When all the first fields are the target values, the energy storage power supply adds 1 to the number of cycles in the third field and updates the values of all the first fields to the initial values. The power-off time of the energy storage power supply is determined based on the values of each of the first fields, the power-on time of the second field, the preset threshold, and the preset time interval, including: The power-off time is determined based on the values of each of the first fields, the power-on time of the second field, the number of loop records in the third field, the preset threshold, and the preset time interval.
4. The method for determining the power-off time according to claim 3, characterized in that: The determining the power-off time based on the values of the first fields, the power-on time of the second field, the number of loop records in the third field, the preset threshold, and the preset time interval includes: Determine a first recording number based on the loop recording number; Determine a second record count based on the number of the first fields whose values are the target values; Based on the preset threshold, determining a third record number of the first field having a value between the initial value and the target value; Determine a total recording duration based on the first recording number, the second recording number, the third recording number, and the preset time interval; The power-off time is determined based on the total recording time and the power-on time of the second field.
5. The method for determining the power-off time according to claim 2, characterized in that: The preset data format further includes a fourth field for storing whether a power-off record has been performed, and the method further includes: When the energy storage system is powered on again after being powered off, if it is determined based on the value of the fourth field that the memory has performed a power-off record, the step of reading the written record information is entered.
6. The method for determining the power-off time according to claim 1, characterized in that: The recorded information includes a writing time, and determining the power-off time of the energy storage power supply based on the written recorded information includes: The power-off time of the energy storage power supply is determined based on the writing time of the latest written record information.
7. The method for determining the power-off time according to claim 2, characterized in that: The first field is a preset number of bytes, and the number of the first field is determined based on the preset number of bytes, the preset threshold, and the maximum number of read and write times of the memory.
8. A device for determining power-off time, applied to energy storage power supply, characterized in that: include: A writing module, used for writing corresponding record information into the memory at preset time intervals when the energy storage system is powered on; A reading module, used for reading the written record information when the energy storage system is powered on again after power failure; A determination module determines the power-off time of the energy storage power supply based on the written record information.
9. An energy storage power supply, characterized in that: include Processor and memory; The memory stores a computer program, the computer program is executed by the processor, and the computer program includes instructions for executing the method for determining the power-off time according to any one of claims 1 to 7.
10. A non-volatile computer-readable storage medium containing a computer program, wherein when the computer program is executed by a processor, the processor executes the method for determining the power-off time according to any one of claims 1 to 7.
