A refrigerator event recording method
By using a circular data structure in the refrigerator to record event times and updating the data at the end of each unit of time, the problems of excessive memory consumption and anomalies in existing refrigerator event recording methods are solved, and efficient and stable event statistics are achieved.
Patent Information
- Application Number
- CN202211138574.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-19
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2042-09-19
AI Technical Summary
Existing refrigerator event logging methods are prone to excessive memory usage or logging errors when counting events, and may cause system crashes after a long period of time.
A circular data structure is used to record event times and update the data at the end of each unit of time. The system determines whether the conditions are met by counting. Using a circular data structure to record data reduces anomalies and improves system robustness.
It achieves high versatility in various event logs, low memory consumption, simple calculation logic, high system stability, and avoids problems such as memory overflow and system crash.
Smart Images

Figure CN115481123B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of refrigerator technology, and specifically relates to a refrigerator event recording method, which is a software implementation of the recording method for various events in refrigerator control, used to record the number of times an event occurs within a certain time period. Background Technology
[0002] Currently, refrigerator control systems require statistical analysis of the number of times (N) various events (such as refrigerator door opening, button pressing, and shutdown) occur within a time period T (e.g., the refrigerator door being opened more than 5 times in 12 consecutive hours). There are two ways to achieve this: one is to divide the time into periods T and count the number of events occurring in each period; the other is to record the time points of all events starting from 0 and then make a judgment at each time point.
[0003] Both of these statistical methods have shortcomings:
[0004] (1) Method 1: There may be problems with the event statistics during the two cycles. For example, in two consecutive cycles T1 and T2, the events occur N / 2 times in the second half of T1 and N / 2 times in the first half of T2. In this way, the number of events does not reach N in both cycles T1 and T2, but in fact, it does reach N times in the process.
[0005] (2) Method 2: It is simple to implement, but since the total time cannot be determined in advance, overflow and other problems may occur after a long time, leading to system crash.
[0006] To avoid the shortcomings of the two methods mentioned above, this application provides a program logic for recording events that uses fewer memory resources. Since this application focuses on the timing of the event and is not sensitive to the event itself, it can be applied to various event determination processes. Summary of the Invention
[0007] The purpose of this invention is to provide a refrigerator event recording method. By using a circular data structure to record data, the data in the circular data structure is updated at the end of each unit of time, and the data in the circular data structure is judged to see if the required conditions are met. This solves the problems of existing refrigerator event recording methods, such as excessive memory usage and easy occurrence of recording anomalies.
[0008] To solve the above-mentioned technical problems, the present invention is achieved through the following technical solution:
[0009] This invention relates to a refrigerator event recording method. It defines a circular data structure R to record event times, and sets the current system time as t, the event as Pk (k = 0, 1, 2...), and the occurrence time as t. Pk It includes the following steps:
[0010] Step 1: When event Pk occurs, record the time, write the value T into the current data in data structure R, and move the pointer to the next data address;
[0011] Step 2: After each time unit, decrement the non-zero data in data structure R by 1, and count the non-zero data in data structure R.
[0012] Step 3: When the count value is not less than N, the condition is considered met, and the system returns true.
[0013] Step four: If the count value is less than N, the condition is considered not met, and false is returned.
[0014] As a preferred technical solution, the number of data len(R) that the ring data structure R can accommodate is not less than the required number of statistical events N; the maximum value that each data can accommodate is not less than the required period T.
[0015] As a preferred technical solution, the current time of the system should be greater than or equal to the time of occurrence, i.e., t ≥ t Pk .
[0016] The present invention has the following beneficial effects:
[0017] (1) This invention records data by using a circular data structure. At the end of each unit time, the data in the circular data structure is updated, and the data in the circular data structure is judged to see if the required conditions are met. If the conditions are met, the output is true; otherwise, the output is false. The system then performs corresponding operations based on this output. It is applicable to various events and has universality.
[0018] (2) The present invention uses an environmental data structure to record data, which can result in fewer anomalies and better overall program robustness.
[0019] (3) The system used in this invention has predictable program space usage and simple calculation logic.
[0020] Of course, any product implementing this invention does not necessarily need to achieve all of the advantages described above at the same time. Attached Figure Description
[0021] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 This is a schematic diagram of the data structure of the present invention;
[0023] Figure 2 This is a flowchart illustrating the process of handling an event when it occurs.
[0024] Figure 3 The flowchart shows the process for determining when a unit of time ends.
[0025] Figure 4 This is a flowchart of the processing at the end of a unit of time. Detailed Implementation
[0026] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0027] Please see Figure 1 As shown, this invention provides a refrigerator event recording method. It defines a circular data structure R to record event times, and sets the current system time as t, the event as Pk (k = 0, 1, 2...), and the occurrence time as t. Pk It includes the following steps:
[0028] Step 1: When event Pk occurs, record the time, write the value T into the current data in data structure R, and move the pointer to the next data address;
[0029] Step 2: After each time unit, decrement the non-zero data in data structure R by 1, and count the non-zero data in data structure R.
[0030] Step 3: When the count value is not less than N, the condition is considered met, and the system returns true.
[0031] Step four: If the count value is less than N, the condition is considered not met, and false is returned.
[0032] The number of data points len(R) that can be accommodated in the circular data structure R is not less than the required number of statistical events N; the maximum value that each data point can accommodate is not less than the required period T.
[0033] The current system time should be greater than or equal to the time of occurrence, i.e., t ≥ t Pk .
[0034] One specific application of this embodiment is:
[0035] A certain moment is recorded as time zero t0, which is generally the system startup time.
[0036] Define a circular data structure R to record the time of events, as shown in the attached figure. Figure 1 The number of data points that can be accommodated, len(R), is not less than the number of events to be counted, N, such as 2N; the maximum value that each data point can accommodate is not less than the required period T, such as 2T.
[0037] Let the current system time be t, the event be Pk (k = 0, 1, 2...), and the time of occurrence be t. Pk It should be that t ≥ t Pk .
[0038] When event Pk occurs, record this event, write the value T into the current data in R, and move the pointer to the next data address, as shown in the appendix of the manual. Figure 2 As shown.
[0039] At each time unit, decrement the non-zero data in data structure R by 1, and count the non-zero data in R, as shown in the appendix to the manual. Figure 4 When the count value is not less than N, the condition is considered met and the system returns true; otherwise, it returns false. See the attached instruction manual. Figure 3 .
[0040] It is worth noting that the various units included in the above system embodiments are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the scope of protection of the present invention.
[0041] Furthermore, those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing related hardware, and the corresponding program can be stored in a computer-readable storage medium.
[0042] The preferred embodiments of the present invention disclosed above are merely illustrative of the invention. These preferred embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the content of this specification. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the invention, thereby enabling those skilled in the art to better understand and utilize the invention. The invention is limited only by the claims and their full scope and equivalents.
Claims
1. A refrigerator event recording method, defining a circular data structure R to record event times, and assuming the current system time is t, the event is Pk (k = 0, 1, 2...), and the occurrence time is t. Pk Its characteristics are, Includes the following steps: Step 1: When event Pk occurs, record the time, write the value T into the current data in data structure R, and move the pointer to the next data address; Step 2: After each time unit, decrement the non-zero data in data structure R by 1, and count the non-zero data in data structure R. Step 3: When the count value is not less than N, the condition is considered met, and the system returns true. Step four: If the count value is less than N, the condition is considered not met, and false is returned. The number of data items that the circular data structure R can hold, len(R), is not less than the required number of statistical events N; the maximum value that each data item can hold is not less than the required period T.
2. The refrigerator event recording method according to claim 1, characterized in that, The current time of the system should be greater than or equal to the time of occurrence, i.e., t ≥ t Pk .
Citation Information
Patent Citations
Event occurrence detection method and apparatus
US6920468B1