Methods, apparatus and electronic devices for preventing abnormal writes to storage media

By determining the number of write operations on the storage medium in commercial air conditioners and employing delayed write and caching mechanisms, the problem of shortened lifespan caused by frequent writes on the storage medium is solved, extending the service life and improving product intelligence and user experience.

CN107766008BActive Publication Date: 2026-05-26GREE ELECTRIC APPLIANCE INC OF ZHUHAI

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GREE ELECTRIC APPLIANCE INC OF ZHUHAI
Filing Date
2017-12-05
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

In commercial air conditioning and other equipment, the lifespan of storage media is shortened due to frequent write operations, affecting product quality and reliability.

Method used

By judging the number of write operations per unit time, if the threshold is exceeded, data is written in a delayed manner; otherwise, it is written immediately. This is combined with a caching module and a delay timer for protection, and an alarm prompt is generated.

Benefits of technology

Extend the lifespan of storage media, improve product quality and intelligence, and enhance user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN107766008B_ABST
    Figure CN107766008B_ABST
Patent Text Reader

Abstract

This invention discloses a method, apparatus, and electronic device for preventing abnormal writes to storage media, relating to the field of control technology. The method includes: acquiring the number of write operations performed on the storage media within a unit time; determining whether the number of write operations exceeds a preset write count threshold; if so, writing the received write data to the storage media with a delay; if not, writing the received write data to the storage media immediately. The method, apparatus, and electronic device of this invention can perform flexible write operations based on the current write status of the storage media, protect the storage media with a delay, and remind users to check for corresponding anomalies. This improves the lifespan of the storage media and product quality, enhances product intelligence, and improves the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of control technology, and in particular to a method, apparatus, and electronic device for preventing abnormal writing to storage media. Background Technology

[0002] Storage media refers to the carriers that store data. Currently, widely used storage media include NAND flash and EEPROM. Due to factors such as storage materials, the number of write cycles for storage media is limited. For example, NAND flash has a write cycle life of 1 million cycles, AT24C08 (EEROM) has a write cycle life of 1 million cycles, and the LPC1788's internal EEPROM has a lifespan of 100,000 cycles. If write operations are continuously performed on the storage media, it will quickly lose its memory function, resulting in a very short lifespan. Currently, storage media are widely used in equipment such as commercial air conditioners, and the lifespan of the storage media is a quality metric. Commercial air conditioners are typically connected to building control systems. The touchscreen of the commercial air conditioner receives certain control commands sent by the building control system and performs write operations on the storage media. The group control software of the building control system sometimes sends control commands periodically or frequently sends write operation control commands when the automatic control algorithm malfunctions. Frequent write operations on the storage media will affect its lifespan. Over time, this can damage the touchscreen's storage media, causing it to lose its memory function and even preventing the program from starting, thus affecting product quality. Summary of the Invention

[0003] In view of this, one technical problem to be solved by the present invention is to provide a method, apparatus and electronic device for preventing abnormal writing to a storage medium, which can control the writing operation of the storage medium based on the result of judging whether the number of write operations in a unit time exceeds a write count threshold.

[0004] According to one aspect of the present invention, a method for preventing abnormal writing to a storage medium is provided, comprising: obtaining the number of write operations performed on the storage medium per unit time; determining whether the number of write operations performed exceeds a preset write count threshold; if so, writing the received write data to the storage medium in a delayed manner; if not, writing the received write data to the storage medium in an immediate manner.

[0005] Optionally, writing the received write data to the storage medium in a delayed manner includes: setting a delayed write period according to a preset delayed write time interval; and periodically writing the write data to the storage medium according to the delayed write period.

[0006] Optionally, the write data received during the delayed write cycle is stored in a cache module; the write data is periodically retrieved from the cache module and written to the storage medium according to the delayed write cycle.

[0007] Optionally, obtaining the number of write operations performed by the storage medium within a unit time period further includes: setting a detection period based on the unit time period; and periodically obtaining the number of write operations performed by the storage medium within the detection period according to the detection period.

[0008] Optionally, if it is determined that the number of write operations performed exceeds a preset write count threshold, an alarm message is generated and a reminder is issued based on the alarm message.

[0009] Optionally, when it is determined that the number of write operations performed exceeds a preset write count threshold, the acquisition of the number of write operations performed on the storage medium per unit time is stopped.

[0010] Optionally, if a detection recovery control command is received, the number of write operations performed on the storage medium per unit time is reacquired, and it is determined whether the number of write operations performed exceeds a preset write count threshold.

[0011] Optionally, the communication module receives the write data, the detection and recovery control command, or sends the alarm message to the host computer system; wherein, the communication module includes: a bus module, a Bluetooth module, and a WIFI communication module.

[0012] Optionally, the alarm message can be displayed or configuration commands and detection recovery control instructions can be received via a touchscreen module.

[0013] Optionally, the storage medium includes: NAND Flash, EEPROM.

[0014] According to another aspect of the present invention, an apparatus for preventing abnormal writing to a storage medium is provided, comprising: a detection module for acquiring the number of write operations performed on the storage medium per unit time; and a control module electrically connected to the detection module and the storage medium, for determining whether the number of write operations performed exceeds a preset write count threshold; if so, writing the received write data to the storage medium in a delayed manner; and if not, writing the received write data to the storage medium in an immediate manner.

[0015] Optionally, a delay timer module is electrically connected to the control module and sets a delay write period according to a preset delay write time interval. The control module triggers the delay timer module to start timing. When the duration of the delay timer module's timing reaches the delay write time interval, the delay timer module sends an execution signal to the control module so that the control module periodically writes the write data to the storage medium according to the delay write period.

[0016] Optionally, it includes: a cache module electrically connected to the control module; the control module is configured to store the write data received during the delayed write cycle in the cache module; and periodically retrieve the write data from the cache module and write it to the storage medium according to the delayed write cycle.

[0017] Optionally, it includes: a detection timer module electrically connected to the detection module, which sets a detection period according to the unit time; the detection module triggers the detection timer module to start timing, and when the timing duration of the detection timer module reaches the unit time, the detection timer module sends a detection signal to the detection module, so that the detection module periodically obtains the number of write operations performed by the storage medium within the detection period according to the detection period.

[0018] Optionally, the control module is further configured to generate an alarm message and issue a reminder based on the alarm message if it is determined that the number of write operations performed exceeds a preset write count threshold.

[0019] Optionally, the control module is further configured to control the detection module to stop acquiring the number of write operations performed on the storage medium per unit time when it is determined that the number of write operations performed exceeds a preset write count threshold.

[0020] Optionally, the control module is further configured to, upon receiving a detection recovery control command, control the detection module to reacquire the number of write operations performed on the storage medium within a unit time and determine whether the number of write operations performed exceeds a preset write count threshold.

[0021] Optionally, it includes: a communication module electrically connected to the control module; the control module receives the write data and the detection and recovery control command sent by the host computer system through the communication module, or sends alarm prompt information to the host computer system; wherein, the communication module includes: a bus module, a Bluetooth module, and a WIFI communication module.

[0022] Optionally, it includes: a touch screen module electrically connected to the control module, used to display the alarm prompt information sent by the control module or to receive setting commands and detection recovery control instructions.

[0023] Optionally, the storage medium includes: NAND Flash, EEPROM.

[0024] According to another aspect of the present invention, an electronic device is provided, comprising: a storage medium and means for preventing abnormal writing to the storage medium as described in any of the preceding claims.

[0025] The present invention provides a method, apparatus, and electronic device for preventing abnormal writing to a storage medium. The method determines whether the number of write operations performed on the storage medium within a unit time exceeds a preset write count threshold. If so, the received write data is written to the storage medium with a delay; otherwise, the received write data is written to the storage medium immediately. This allows for flexible write operations based on the current write status of the storage medium, protecting it with a delay and alerting the user to check for anomalies. This improves the lifespan of the storage medium and product quality, enhances product intelligence, and improves the user experience. Attached Figure Description

[0026] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art 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.

[0027] Figure 1 This is a flowchart illustrating an embodiment of the method for preventing abnormal writing to a storage medium according to the present invention;

[0028] Figure 2 A schematic diagram of a module according to an embodiment of a device for preventing abnormal writing to a storage medium according to the present invention;

[0029] Figure 3 This is a schematic diagram of another embodiment of the device for preventing abnormal writing to a storage medium according to the present invention. Detailed Implementation

[0030] The present invention will now be described more fully with reference to the accompanying drawings, which illustrate exemplary embodiments of the invention. 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. The technical solutions of the present invention will be described in various aspects below with reference to the various figures and embodiments.

[0031] Figure 1 This is a flowchart illustrating an embodiment of the method for preventing abnormal writing to a storage medium according to the present invention, as shown below. Figure 1 As shown:

[0032] Step 101: Obtain the number of write operations performed on the storage medium per unit time.

[0033] There are several ways to obtain the number of write operations performed by the storage medium per unit time. For example, a variable can be set to record the number of write operations performed by the storage medium, and the variable value can be obtained periodically on a unit time basis. The number of write operations performed per unit time can be determined based on the change in the variable value.

[0034] There are various types of storage media, such as NAND Flash and EEPROM. NAND flash memory is a type of flash memory that uses a non-linear macrocell model internally, and has advantages such as large capacity and fast rewrite speed. EEPROM (Electrically Erasable Programmable Read-Only Memory) is a type of memory chip that does not lose data after power is lost.

[0035] Step 102: Determine whether the number of write operations performed exceeds the preset write count threshold.

[0036] The system allows setting a unit time and a write count threshold. The write count threshold represents the maximum number of times the device can access the storage medium within a given time period. These thresholds can be configured based on different devices, communication methods, user habits, and storage medium types. For example, the unit time can be set to 10-120 seconds (default is 60 seconds), and the write count threshold can be set to 5-60 times (default is 15 times). Both the unit time and write count thresholds can be set via the touchscreen module, a host computer system, or other devices.

[0037] Step 103: If the number of write operations performed exceeds a preset write count threshold, the received write data to the storage medium is written to the storage medium with a delay; if the number of write operations performed does not exceed the preset write count threshold, the received write data to the storage medium is written to the storage medium immediately.

[0038] In one embodiment, there are several ways to obtain the number of write operations performed by the storage medium within a unit of time. A detection period is set based on the unit of time, and the number of write operations performed by the storage medium within the detection period is periodically obtained. By determining whether the number of written operations exceeds a preset write count threshold, it is determined whether the write operations on the storage medium are normal. For example, if the unit of time is set to 60 seconds, the detection period is 60 seconds, and the number of write operations performed by the storage medium within this 60-second period is periodically obtained every 60 seconds.

[0039] If the number of write operations exceeds the preset write count threshold, an anomaly is detected, and the write operation is automatically delayed for a certain period. The delay time can be set, for example, from 3 to 60 minutes, with a default delay of 30 minutes. The delay time can be calculated based on the selected storage medium and its lifespan. If the number of write operations does not exceed the preset write count threshold, the write operation can be processed normally, and the data is immediately written to the storage medium. Read operations on the storage medium do not require control, as they do not damage the storage medium.

[0040] Instantaneous writing refers to writing data immediately upon receipt. Delayed writing can be achieved in several ways. For example, a delayed write period can be set according to a preset delay interval. The delay interval is the delay time, which can range from 3 to 60 minutes, with a default of 30 minutes. Data received within the delayed write period is periodically written to the storage medium according to the delayed write period. For example, with a 30-minute delayed write period, data received within each 30-minute interval is periodically written to the storage medium.

[0041] The data received during the delayed write cycle can be stored in the cache module. According to the delayed write cycle, the write data is periodically retrieved from the cache module and written to the storage medium. For example, if the delayed write interval is 30 minutes, and the number of write operations exceeds a preset write count threshold, a delayed write operation is initiated, and a timer starts. Three write data entries received at 5 minutes, 7 minutes, and 15 minutes are placed in the cache module. When the timer reaches 30 minutes, the three write data entries are read from the cache module and written to the storage medium. After the device is powered off and on again, the data is read from the storage medium and placed into the cache module. Data can then be read from the cache module for display and other operations.

[0042] If the number of write operations performed exceeds a preset write count threshold, an anomaly is detected, and the acquisition of the number of write operations performed on the storage medium within a unit of time is stopped. If a detection and recovery control command is received, the number of write operations performed on the storage medium within a unit of time is acquired again, and it is determined whether the number of write operations performed exceeds the preset write count threshold. If it does, the received write data to the storage medium is written to the storage medium with a delay; otherwise, the received write data to the storage medium is written to the storage medium immediately. In other words, upon receiving the detection and recovery control command, the normal processing flow is resumed. The detection and recovery control command can be sent by the host computer system or by the touchscreen module, etc.

[0043] If the number of write operations exceeds a preset write count threshold, an alarm message is generated and a notification is issued. The alarm message can be in various formats, including text and audio-visual alerts. For example, the alarm message could be the text "Please check if the host computer communication write operation is abnormal." This message can be displayed on a screen or sent to a host computer system (such as a building control system or other devices). It can remind the user to check if the building monitoring communication data is normal and to avoid frequent write operations.

[0044] The communication module can receive write data, detect and recover control commands, or send alarm messages to the host computer system. Communication modules include bus modules, Bluetooth modules, and Wi-Fi communication modules. The communication module can receive or send data wirelessly or via wired connections. Bus modules can include RS485 bus modules and CAN bus modules. The touchscreen module can display alarm messages or receive configuration commands and detect and recover control commands. Configuration commands can be user-inputted settings for unit time, write count thresholds, and delayed write intervals.

[0045] In one embodiment, such as Figure 2 As shown, the device for preventing abnormal writing to storage media provided by the present invention includes a detection module 11 and a control module 12. The detection module 11 and the control module 12 can be implemented as a microcontroller, a single-board computer, a PLC, an integrated circuit module, etc.

[0046] The detection module 11 acquires the number of write operations performed by the storage medium 13 within a unit time. The control module 12 is electrically connected to both the detection module 11 and the storage medium 13, and determines whether the number of write operations performed exceeds a preset write count threshold. If so, the control module 12 writes the received write data to the storage medium 13 with a delay; otherwise, the control module 12 writes the received write data to the storage medium 13 immediately.

[0047] In one embodiment, such as Figure 3 As shown, the device for preventing abnormal writing to the storage medium also includes: a delay timer module 14, a cache module 15, a communication module 16, a touch screen module 17, and a detection timer module 18.

[0048] The delay timer module 14 is electrically connected to the control module 12 and sets the delay write period according to a preset delay write time interval. The control module 12 triggers the delay timer module 14 to start timing. When the duration of the delay timer module 14 reaches the delay write time interval, the delay timer module 14 sends an execution signal to the control module 12, so that the control module 12 periodically writes the write data received within the delay write period to the storage medium 13 according to the delay write period.

[0049] The cache module 15 is electrically connected to the control module 12. The control module 12 stores the write data received during the delayed write cycle in the cache module 15. The control module 12 periodically retrieves write data from the cache module 15 and writes it to the storage medium according to the delayed write cycle.

[0050] The detection timer module 18 is electrically connected to the detection module 11, and the detection period is set according to the unit time. The detection module 11 triggers the detection timer module 18 to start timing. When the timing duration of the detection timer module 18 reaches the unit time, the detection timer module 18 sends a detection signal to the detection module 11, so that the detection module 11 periodically obtains the number of write operations performed on the storage medium within the detection period according to the detection period.

[0051] When the number of write operations performed exceeds a preset write count threshold, the control module 12 controls the detection module 11 to stop acquiring the number of write operations performed on the storage medium within a unit time. If the control module 12 receives a detection recovery control command, it controls the detection module 11 to reacquire the number of write operations performed on the storage medium within a unit time and determines whether the number of write operations performed exceeds the preset write count threshold. If the control module 12 determines that the number of write operations performed exceeds the preset write count threshold, it generates an alarm message and provides a reminder based on the alarm message.

[0052] The communication module 16 is electrically connected to the control module 12. The control module 12 receives write data, detection and recovery control commands, or sends alarm messages to the host computer system via the communication module 16. The communication module 16 includes a bus module, a Bluetooth module, and a WIFI communication module. The touchscreen module 17 is electrically connected to the control module 12, displaying alarm messages sent by the control module 12 or receiving setting commands and detection and recovery control commands.

[0053] According to another aspect of the present invention, an electronic device is provided, comprising: a storage device and means for preventing abnormal writing to the storage medium as in any of the preceding embodiments. The electronic device may be a touchscreen device in an air conditioning unit, etc.

[0054] In one embodiment, multiple large air conditioning units on a subway line are connected to the same building monitoring system. The original building monitoring system uses a timed write operation every 300ms to control the chilled water outlet temperature. Using the method, apparatus, and electronic equipment of this invention to prevent abnormal writes to the storage medium, problems with the building monitoring system's own program can be quickly identified during debugging, preventing serious losses and protecting the storage medium and the air conditioning units.

[0055] The method, apparatus, and electronic device for preventing abnormal writing to the storage medium in the above embodiments determine whether the number of write operations performed on the storage medium within a unit time exceeds a preset write count threshold. If so, the received write data to the storage medium is written to the storage medium with a delay; otherwise, the received write data to the storage medium is written to the storage medium immediately. This allows for flexible write operations based on the current write status of the storage medium, protecting the storage medium with a delay, and reminding users to check for any abnormalities. This improves the lifespan of the storage medium and the quality of the product, enhances product intelligence, and improves the user experience.

[0056] The methods and systems of the present invention may be implemented in many ways. For example, they may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above-described order of steps for the method is for illustrative purposes only, and the steps of the method of the present invention are not limited to the order specifically described above unless otherwise specifically stated. Furthermore, in some embodiments, the present invention may also be implemented as a program recorded on a recording medium, the program comprising machine-readable instructions for implementing the method according to the present invention. Thus, the present invention also covers recording media storing programs for performing the method according to the present invention.

[0057] The description of this invention is given for illustrative and descriptive purposes only and is not intended to be exhaustive or to limit the invention to the forms disclosed. Many modifications and variations will be apparent to those skilled in the art. The embodiments were chosen and described in order to better illustrate the principles and practical application of the invention and to enable those skilled in the art to understand the invention and to design various embodiments with various modifications suitable for a particular purpose.

Claims

1. A method for preventing abnormal writing to a storage medium, characterized in that, include: Get the number of write operations performed on the storage medium per unit time. Determine whether the number of write operations performed exceeds a preset write count threshold; If so, the received write data for the storage medium is written to the storage medium in a delayed manner; wherein, a delayed write period is set according to a preset delayed write time interval; the write data received within the delayed write period is stored in a cache module; and the write data is periodically retrieved from the cache module and written to the storage medium according to the delayed write period. If not, the received write data for the storage medium is written to the storage medium in an immediate manner.

2. The method as described in claim 1, characterized in that, The method of obtaining the number of write operations performed by the storage medium per unit time also includes: The detection cycle is set according to the unit time; According to the detection cycle, the number of write operations performed by the storage medium within the detection cycle is periodically obtained.

3. The method as described in claim 1, characterized in that, Also includes: If it is determined that the number of write operations performed exceeds a preset write count threshold, an alarm message is generated and a reminder is issued based on the alarm message.

4. The method as described in claim 3, characterized in that, Also includes: When it is determined that the number of write operations performed exceeds a preset write count threshold, the acquisition of the number of write operations performed on the storage medium per unit time is stopped.

5. The method as described in claim 4, characterized in that, Also includes: If a detection recovery control command is received, the number of write operations performed on the storage medium per unit time is reacquired, and it is determined whether the number of write operations performed exceeds a preset write count threshold.

6. The method as described in claim 5, characterized in that, Also includes: The communication module receives the write data and the detection and recovery control command sent by the host computer system, or sends the alarm prompt information to the host computer system. The communication module includes: a bus module, a Bluetooth module, and a WIFI communication module.

7. The method as described in claim 5, characterized in that, Also includes: The alarm message can be displayed or configuration commands and detection recovery control instructions can be received via the touch screen module.

8. The method as described in claim 1, characterized in that, The storage media include: NAND Flash and EEPROM.

9. A device for preventing abnormal writing to a storage medium, characterized in that, include: The detection module is used to obtain the number of write operations performed on the storage medium per unit time. The control module is electrically connected to both the detection module and the storage medium. The delay timer module is electrically connected to the control module and sets the delay write period according to the preset delay write time interval; The cache module is electrically connected to the control module; The control module is used to determine whether the number of write operations performed exceeds a preset write count threshold. If so, the received write data for the storage medium is written to the storage medium in a delayed manner. The control module triggers the delay timer module to start timing. When the duration of the delay timer module's timing reaches the delay write interval, the delay timer module sends an execution signal to the control module, causing the control module to periodically write the write data to the storage medium according to the delay write cycle. The control module stores the write data received within the delay write cycle in a cache module, and periodically retrieves the write data from the cache module and writes it to the storage medium according to the delay write cycle. The control module is further configured to write the received write data to the storage medium in an immediate manner if the number of write operations performed does not exceed a preset write count threshold.

10. The apparatus as claimed in claim 9, characterized in that, Also includes: A detection timer module is electrically connected to the detection module and sets the detection cycle according to the unit time. The detection module triggers the detection timer module to start timing. When the timing duration of the detection timer module reaches the unit time, the detection timer module sends a detection signal to the detection module so that the detection module periodically obtains the number of write operations performed by the storage medium within the detection period according to the detection cycle.

11. The apparatus as claimed in claim 9, characterized in that, The control module is further configured to generate an alarm message and issue a reminder based on the alarm message if it is determined that the number of write operations performed exceeds a preset write count threshold.

12. The apparatus as claimed in claim 11, characterized in that, The control module is further configured to control the detection module to stop acquiring the number of write operations performed on the storage medium per unit time when it is determined that the number of write operations performed exceeds a preset write count threshold.

13. The apparatus as claimed in claim 12, characterized in that, The control module is further configured to, upon receiving a detection recovery control command, control the detection module to reacquire the number of write operations performed on the storage medium within a unit time and determine whether the number of write operations performed exceeds a preset write count threshold.

14. The apparatus as claimed in claim 13, characterized in that, Also includes: A communication module is electrically connected to the control module; the control module receives the write data and the detection and recovery control command sent by the host computer system through the communication module, or sends alarm prompt information to the host computer system; wherein, the communication module includes: a bus module, a Bluetooth module, and a WIFI communication module.

15. The apparatus as claimed in claim 13, characterized in that, Also includes: The touchscreen module is electrically connected to the control module and is used to display the alarm prompts sent by the control module or to receive setting commands and detection recovery control instructions.

16. The apparatus as claimed in claim 9, characterized in that, The storage media include: NAND Flash and EEPROM.

17. An electronic device, characterized in that, include: Storage medium, and the apparatus for preventing abnormal writing to the storage medium as described in any one of claims 9 to 16.