Data storage control method of electronic cigarette, electronic cigarette and computer-readable storage medium
By using temporary storage modules and flash memory modules in electronic cigarettes for data storage, the problem of additional configuration of non-volatile memory in the prior art is solved, and a simple data storage process and the effect of reducing manufacturing costs is realized.
Patent Information
- Application Number
- CN202111494978.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-08
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2041-12-08
AI Technical Summary
The existing data storage control method of electronic cigarettes requires additional configuration of nonvolatile memory, resulting in complex storage processes and high cost, affecting the production and manufacturing of electronic cigarettes.
By using the first temporary storage module, the second temporary storage module and the flash memory module in the electronic cigarette for data storage, temporarily store statistical data and parameter data, and write it to the flash memory module when specific conditions are met, long-term storage of data is realized , avoid additional configuration of nonvolatile memory.
It simplifies the data storage process, reduces the manufacturing cost of electronic cigarettes, and extends the service life of the flash memory module.
Smart Images

Figure CN116236000B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of electronic cigarettes, and in particular to a data storage control method for electronic cigarettes, an electronic cigarette, and a computer-readable storage medium. Background Art
[0002] During the use of electronic cigarettes, the use data of electronic cigarettes needs to be recorded and stored for users to query or use.
[0003] In the prior art, the data storage control method of the electronic cigarette usually requires additional configuration of a non-volatile memory in the electronic cigarette for data storage, such as FRAM (Ferroelectric Random Access Memory), EEPROM (Electrically Erasable Programmable Read Only Memory), EPROM (Erasable Programmable Read Only Memory), etc. This data storage control method not only has a complicated storage process, but also has a very high cost for the manufacture of electronic cigarettes, which is not conducive to the production of electronic cigarettes. Summary of the invention
[0004] In order to solve the above technical problems, the present application provides a data storage control method of an electronic cigarette, an electronic cigarette and a computer-readable storage medium. The data storage of the electronic cigarette can be realized through the first temporary storage module, the second temporary storage module and the flash memory module of the electronic cigarette. There is no need to configure an additional non-volatile memory. The process of storing electronic cigarette data is simple and the manufacturing cost of the electronic cigarette is reduced.
[0005] In a first aspect, the present application provides a data storage control method for an electronic cigarette, wherein the electronic cigarette comprises a first temporary storage module, a second temporary storage module and a flash memory module, and the data storage control method comprises the following steps: temporarily storing statistical data of the electronic cigarette in the first temporary storage module, wherein the statistical data comprises a statistical value of at least one statistical category; at least temporarily storing parameter data of the electronic cigarette in the second temporary storage module; and when the electronic cigarette meets a condition for entering sleep, judging whether the statistical data meets a first preset condition, and when it is determined that the statistical data meets the first preset condition, controlling the statistical data to be written into the flash memory module, and judging whether the parameter data meets a second preset condition, and when it is determined that the parameter data meets the second preset condition, controlling the parameter data to be written into the flash memory module.
[0006] The second aspect of the present application also provides an electronic cigarette, which includes a first temporary storage module, a second temporary storage module, a flash memory module and a control module. The first temporary storage module is used to temporarily store statistical data of the electronic cigarette, wherein the statistical data includes statistical values of at least one statistical category. The second temporary storage module is used to at least temporarily store parameter data of the electronic cigarette. The control module is used to determine whether the statistical data meets a first preset condition when the electronic cigarette meets the condition for entering sleep, and when it is determined that the statistical data meets the first preset condition, control the statistical data to be written into the flash memory module, and determine whether the parameter data meets a second preset condition, and when it is determined that the parameter data meets the second preset condition, control the parameter data to be written into the flash memory module.
[0007] The third aspect of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program is invoked and executed by a processor to implement the aforementioned electronic cigarette data storage control method.
[0008] The data storage control method, electronic cigarette and computer-readable storage medium of the electronic cigarette provided by the present application temporarily store the statistical data in the first temporary storage module, temporarily store the parameter data in the second temporary storage module, and when the electronic cigarette meets the conditions for entering sleep, determine whether it is necessary to write the statistical data and / or the parameter data into the flash memory module, and write the statistical data and / or the parameter data into the flash memory module when necessary to store the statistical data and / or the parameter data for a long time, thereby realizing data storage of the electronic cigarette without the need for storage through an additionally configured non-volatile memory, and the storage process is simple and convenient. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the implementation manner will be briefly introduced below. Obviously, the drawings described below are some implementation manners of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0010] Figure 1 This is a flow chart of the data storage control method of the electronic cigarette provided in an embodiment of the present application.
[0011] Figure 2 This is a structural block diagram of the electronic cigarette provided in an embodiment of the present application.
[0012] Description of reference numerals: 100 - electronic cigarette; 10 - first temporary storage module; 20 - second temporary storage module; 30 - flash memory module; 40 - control module. DETAILED DESCRIPTION
[0013] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0014] In the description of this application, the terms "first", "second", etc. are used to distinguish different objects rather than to describe a specific order, and therefore should not be understood as limiting this application.
[0015] In the description of this application, unless otherwise clearly specified and limited, the term "connection" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a direct connection, an indirect connection through an intermediate medium, or the internal communication of two elements. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.
[0016] See also Figure 1 , Figure 1 The electronic cigarette comprises a first temporary storage module, a second temporary storage module and a flash memory module. Figure 1 As shown, the electronic cigarette data storage control method includes the following steps:
[0017] S101: temporarily storing statistical data of the electronic cigarette in the first temporary storage module, wherein the statistical data includes statistical values of at least one statistical category.
[0018] S102: at least temporarily storing the parameter data of the electronic cigarette in the second temporary storage module.
[0019] S103: When the electronic cigarette meets the conditions for entering sleep mode, determine whether the statistical data meets a first preset condition, and when it is determined that the statistical data meets the first preset condition, control the statistical data to be written into the flash memory module, and determine whether the parameter data meets a second preset condition, and when it is determined that the parameter data meets the second preset condition, control the parameter data to be written into the flash memory module.
[0020] The data storage control method of the electronic cigarette provided in the embodiment of the present application realizes data storage of the electronic cigarette by temporarily storing the statistical data in the first temporary storage module, temporarily storing the parameter data in the second temporary storage module, and judging whether it is necessary to write the statistical data and / or the parameter data into the flash memory module when the electronic cigarette meets the condition of entering sleep mode, and writing the statistical data and / or the parameter data into the flash memory module when necessary to store the statistical data and / or the parameter data for a long time, without the need for storage through an additionally configured non-volatile memory, and the storage process is simple and convenient.
[0021] The statistical values of the statistical data often change with the use of the electronic cigarette, including the number of heating times, the number of power on and off times, the number of charging times, the number of reset times, the number of error codes, etc.
[0022] Among them, the parameter data may include state parameter data and configuration parameter data. The state parameter data may include temperature state, voltage state, etc. For example, the temperature exceeds the preset temperature range and is too low or too high, and the voltage exceeds the preset voltage range and is too high or too low; the configuration parameter data may include heating curve data, and the electronic cigarette performs program heating according to the heating curve data to atomize the e-liquid to generate smoke for the user to inhale.
[0023] It is understandable that when the statistical value of the statistical data changes with the use of the electronic cigarette, by controlling the statistical data to be pre-stored in the first temporary storage module, and then controlling the statistical data to be written into the flash memory module when the statistical data needs to be stored in the flash memory module, the number of writes to the flash memory module can be reduced and the life of the flash memory module can be extended. Similarly, when the parameter data changes, by controlling the parameter data to be pre-stored in the second temporary storage module, and then controlling the parameter data to be written into the flash memory module when the parameter data needs to be stored in the flash memory module, the number of writes to the flash memory module can also be reduced and the life of the flash memory module can be extended.
[0024] The first temporary storage module may be a register, for example, an 8-bit register, a 24-bit register, a 32-bit register, etc.
[0025] The second temporary storage module may be a RAM (Random Access Memory).
[0026] The flash memory module may be a flash memory. In some embodiments, the storage space of the flash memory is 4kB.
[0027] In some embodiments, the condition that the electronic cigarette satisfies entering dormancy may include: the time that the electronic cigarette has not been operated is equal to a first preset time. Wherein, the first preset time may be 2 minutes. When the time that the electronic cigarette has not been operated is equal to the first preset time, the electronic cigarette satisfies the condition that it enters dormancy, and at this time, the electronic cigarette determines whether the statistical data satisfies the first preset condition and determines whether the parameter data satisfies the second preset condition, and when it is determined that the statistical data satisfies the first preset condition, controls the statistical data to be written into the flash memory module, and when it is determined that the parameter data satisfies the second preset condition, controls the parameter data to be written into the flash memory module.
[0028] After the electronic cigarette enters the dormant state, it is in a non-working state and does not need to record and store data. When the electronic cigarette is dormant, the data stored in the first temporary storage module can still be saved. When the electronic cigarette is dormant or powered off, the data stored in the second temporary storage module will be lost. After the electronic cigarette is dormant or powered off, the data stored in the flash memory module will not be lost, but can be stored in the flash memory module for a long time.
[0029] In other embodiments, the electronic cigarette meets the condition for entering sleep mode, and further includes: receiving a sleep instruction generated in response to a sleep operation performed on the electronic cigarette. For example, the electronic cigarette is provided with a sleep button, and a sleep instruction is generated when the user clicks the sleep button. When the sleep instruction is received, it is determined that the electronic cigarette meets the condition for entering sleep mode. At this time, the electronic cigarette determines whether the statistical data meets the first preset condition and whether the parameter data meets the second preset condition, and when it is determined that the statistical data meets the first preset condition, controls the statistical data to be written into the flash memory module, and when it is determined that the parameter data meets the second preset condition, controls the parameter data to be written into the flash memory module.
[0030] In some embodiments, the first temporary storage module includes at least one first temporary storage sub-module, and each first temporary storage sub-module is used to store a statistical value of a statistical category accordingly.
[0031] The at least one first temporary storage submodule stores the statistical values of the at least one statistical category in a one-to-one correspondence.
[0032] The storage spaces of every two of the at least one first temporary storage submodules may be the same or different.
[0033] The following is a specific description using the first temporary storage module as a register. In some embodiments, the electronic cigarette includes 5 32-bit registers, the first temporary storage module is the 32-bit register, each 32-bit register is divided into 4 8-bit sub-registers, the first temporary storage sub-module is the 8-bit sub-register, then the electronic cigarette includes 20 8-bit sub-registers, that is, the electronic cigarette can store statistical values of 20 statistical categories. Obviously, in other embodiments, each 32-bit register can be divided into multiple sub-registers with different storage space sizes, for example, each 32-bit register can also be divided into 2 4-bit sub-registers and 2 12-bit sub-registers.
[0034] It can be understood that by dividing the first temporary storage module into a plurality of first temporary storage sub-modules, statistical values of different statistical categories can be stored correspondingly, so as to meet the need of recording data of multiple statistical categories of the electronic cigarette.
[0035] In some embodiments, the data storage control method further includes: in response to a single use of the electronic cigarette for a certain statistical category, controlling the statistical value of the corresponding statistical category stored in the corresponding first temporary storage submodule to be increased by one, thereby temporarily storing the statistical data of the electronic cigarette in the first temporary storage module.
[0036] The following is still specifically described with the first temporary storage module being a 32-bit register, and the first temporary storage module is divided into four 8-bit sub-registers, the first temporary storage sub-module is the 8-bit sub-register, the certain statistical category is the number of heating times of the electronic cigarette, when the statistical value of the number of heating times stored in the 8-bit sub-register is 50, after the user inhales the electronic cigarette and heats it once, the statistical value of the number of heating times stored in the 8-bit sub-register is controlled to be increased by one, so that the statistical value of the number of heating times stored in the 8-bit sub-register is 51.
[0037] In some embodiments, the data storage control method further includes: when it is determined at any time that the statistical data meets the first preset condition, temporarily storing the statistical data in the second temporary storage module.
[0038] In some embodiments, the first preset condition includes that the statistical value of the statistical category of the first temporary storage submodule is equal to the pre-designed value of the first temporary storage submodule, and when it is determined at any time that the statistical data meets the first preset condition, temporarily storing the statistical data in the second temporary storage module includes: when it is determined at any time that the statistical value of the statistical category of the first temporary storage submodule is equal to the pre-designed value of the first temporary storage submodule, in response to a single use of the statistical category by the electronic cigarette, controlling the statistical value of the same statistical category stored in the second temporary storage module to be increased by one.
[0039] The pre-designed value is less than or equal to the maximum countable value of the first temporary storage submodule.
[0040] The following is still a specific description of the first temporary storage module 10 as a 32-bit register, and the first temporary storage module is divided into 4 8-bit sub-registers, the first temporary storage sub-module is the 8-bit sub-register, and the maximum countable value of each 8-bit sub-register is 255 (counted from 1 to 255), then the pre-designed value can be set to be less than or equal to 255, for example, the preset count value is 200. The statistical category is the number of heating times of the electronic cigarette, when the statistical value of the number of heating times stored in the 8-bit sub-register is 200, and the statistical value of the number of heating times stored in the second temporary storage module is 300, after the user draws on the electronic cigarette and performs one heating, the electronic cigarette controls the statistical value of the number of heating times stored in the second temporary storage module to be increased by one, so that the statistical value of the number of heating times stored in the second temporary storage module is 301.
[0041] It can be understood that when the statistical value of a statistical category stored in a first temporary storage submodule is equal to the pre-designed value of the first temporary storage submodule, the problem of insufficient storage space of the first temporary storage submodule can be solved by controlling the writing of the newly generated statistical value of the statistical category into the second temporary storage module.
[0042] In some embodiments, when the electronic cigarette meets the condition for entering sleep, judging whether the statistical data meets a first preset condition, and when it is determined that the statistical data meets the first preset condition, controlling the statistical data to be written into the flash memory module, including: when the electronic cigarette meets the condition for entering sleep, judging whether the statistical value of the statistical category of the first temporary storage submodule is equal to the pre-designed numerical value of the first temporary storage submodule; when it is determined that the statistical value of the statistical category of the first temporary storage submodule is equal to the pre-designed numerical value, controlling the accumulation of the statistical value of the statistical category of the first temporary storage submodule and the statistical value of the same statistical category of the second temporary storage module, and controlling the accumulation of the statistical value into the flash memory module.
[0043] The following is still a specific description of the first temporary storage module 10 as a 32-bit register, and the first temporary storage module is divided into 4 8-bit sub-registers. The first temporary storage sub-module is the 8-bit sub-register, and the maximum countable value of each 8-bit sub-register is 255 (counted from 1 to 255). Then the pre-designed value can be set to be less than or equal to 255. For example, the preset count value is 200, and the statistical category is the number of heating times of the electronic cigarette. When the electronic cigarette meets the condition of entering sleep, the electronic cigarette determines whether the statistical value of the number of heating times of the 8-bit sub-register is equal to the pre-designed value 200 of the 8-bit sub-register. When it is determined that the statistical value of the number of heating times stored in the 8-bit sub-register is 200, the statistical value 200 of the number of heating times of the 8-bit sub-register is controlled to be accumulated with the statistical value of the number of heating times stored in the second temporary storage module. For example, the statistical value of the number of heating times stored in the second temporary storage module is 300, and then the accumulated statistical value 500 is controlled to be written into the flash memory module.
[0044] It can be understood that, when the statistical value of the statistical category of the first temporary storage submodule is equal to the pre-designed value, the electronic cigarette will control the newly generated statistical value of the statistical category to be written into the second temporary storage module. Therefore, when the electronic cigarette meets the conditions for entering sleep, when the present application determines that the statistical value of the statistical category of the first temporary storage submodule is equal to the pre-designed value, it controls the accumulation of the statistical value of the statistical category of the first temporary storage submodule and the statistical value of the same statistical category of the second temporary storage module, and controls the accumulation of the statistical value to be written into the flash memory module. This can avoid the omission of recording the statistical data stored in the second temporary storage module due to the loss of data in the second temporary storage module after the electronic cigarette falls into sleep.
[0045] In some embodiments, the data storage control method further includes: after controlling the accumulated statistical values to be written into the flash memory module, controlling the clearing of the statistical values of the statistical category stored in the first temporary storage submodule.
[0046] It is understandable that after writing the statistical data stored in the first temporary storage submodule into the flash memory module, clearing the statistical values of the statistical category stored in the first temporary storage submodule can avoid the statistical values stored in the first temporary storage submodule being repeatedly written into the flash memory module, resulting in incorrect data records.
[0047] In some embodiments, the data storage control method further includes: when it is determined that the statistical value of the statistical category of the first temporary storage submodule is less than the pre-designed value, there is no need to write the statistical value of the statistical category stored in the first temporary storage submodule into the flash memory module.
[0048] It can be understood that, since the data stored in the first temporary storage submodule will not be lost when the electronic cigarette is in a dormant state, when the statistical value of the statistical category stored in the first temporary storage submodule is less than the pre-designed value of the first temporary storage submodule, the first temporary storage submodule can still be used to count the statistical category. When the electronic cigarette meets the conditions for entering dormancy, there is no need to write the statistical value of the statistical category stored in the first temporary storage submodule into the flash memory module, which can reduce the number of write times of the flash memory module.
[0049] In some embodiments, the second preset condition includes that the parameter data stored in the second temporary storage module is different from the parameter data stored in the flash memory module; when the electronic cigarette meets the condition for entering sleep, judging whether the parameter data meets the second preset condition, and when it is determined that the parameter data meets the second preset condition, controlling the parameter data to be written into the flash memory module, including: when the electronic cigarette meets the condition for entering sleep, judging whether the parameter data stored in the second temporary storage module is the same as the parameter data stored in the flash memory module; when it is determined that the parameter data stored in the second temporary storage module is different from the parameter data stored in the flash memory module, controlling the parameter data stored in the second temporary storage module to be written into the flash memory module to replace the parameter data stored in the flash memory module.
[0050] When it is determined that the state parameter data stored in the second temporary storage module is different from the state parameter data stored in the flash memory module, the state parameter data stored in the second temporary storage module is controlled to be written into the flash memory module to replace the state parameter data stored in the flash memory module.
[0051] When it is determined that the configuration parameter data stored in the second temporary storage module is different from the configuration parameter data stored in the flash memory module, the configuration parameter data stored in the second temporary storage module is controlled to be written into the flash memory module to replace the configuration parameter data stored in the flash memory module.
[0052] For example, the second temporary storage module and the flash memory module both store original heating curve data. When the user changes the original heating curve data during use to form updated heating curve data, the updated heating curve data is stored in the second temporary storage module. When the electronic cigarette meets the conditions for entering sleep mode, the electronic cigarette compares the updated heating curve data stored in the second temporary storage module with the original heating curve data stored in the flash memory module. When it is determined that the updated heating curve data stored in the second temporary storage module is different from the original heating curve data stored in the flash memory module, the updated heating curve data stored in the second temporary storage module is controlled to be written into the flash memory module to replace the original heating curve data.
[0053] In some other embodiments, the data storage control method further includes: when it is determined that the parameter data stored in the second temporary storage module is the same as the parameter data stored in the flash memory module, determining that there is no need to write the parameter data stored in the second temporary storage module into the flash memory module.
[0054] It can be understood that, since the data stored in the second temporary storage module will be lost when the electronic cigarette is in a dormant state, when the electronic cigarette meets the conditions for entering dormancy, the parameter data stored in the second temporary storage module is controlled to be written into the flash memory module to replace the parameter data stored in the flash memory module, so as to prevent the parameter data located in the second temporary storage module 20 from being missed after the electronic cigarette is dormant. In addition, before performing a write operation, that is, before controlling the parameter data stored in the second temporary storage module to be written into the flash memory module, by pre-judging whether the parameter data stored in the second temporary storage module is the same as the parameter data stored in the flash memory module, the write operation is performed when they are the same, and the write operation is not performed when they are not the same, so as to reduce the number of writes to the flash memory module and extend the service life of the flash memory module.
[0055] In some embodiments, the flash memory module includes multiple writing areas, and controlling the writing of the statistical data and / or the parameter data into the flash memory module includes: determining a target writing area; and controlling the writing of the statistical data and / or the parameter data into the target writing area.
[0056] In some embodiments, the multiple write areas are pre-ordered in sequence, and the determining of the target write area includes: determining a previous write area where the statistical data and / or the parameter data were last written; and determining the next write area of the previous write area as the target write area based on the order of the multiple write areas.
[0057] In some embodiments, the multiple writing areas are pre-sorted in sequence according to numbers, and determining the target writing area includes: determining the previous writing area where the statistical data and / or the parameter data were last written; determining the next writing area of the previous writing area as the target writing area according to the number, that is, the writing area corresponding to the next number of the previous writing area is the target writing area.
[0058] Specifically, the multiple writing areas may be numbered 1, 2, 3, ..., N in sequence. When determining the target writing area, the number of the previous writing area in which the statistical data and / or the parameter data were last written is first determined. For example, when the number of the previous writing area is determined to be 1, the writing area numbered 2 is determined to be the target writing area. When the number of the previous writing area is the largest number N, the writing area corresponding to the smallest number 1 is determined to be the target writing area.
[0059] In some other embodiments, the multiple writing areas are pre-sorted in order according to the size of the storage space of the multiple writing areas, for example, the multiple writing areas are sorted in order from small to large according to the storage space. The determining of the target writing area includes: determining a previous writing area where the statistical data and / or the parameter data was last written; and determining the next writing area of the previous writing area as the target writing area according to the sorting of the storage space of the multiple writing areas.
[0060] In some embodiments, the number of the multiple write areas is two, and the two write areas are respectively a first write area and a second write area, and the control of writing at least the statistical data into the flash memory module may include: determining whether the write operation of writing the statistical data and / or the parameter data into the flash memory module is an odd-numbered write operation; when it is determined that the write operation is an odd-numbered write operation, the statistical data and / or the parameter data are controlled to be written into the first write area. Obviously, when it is determined that the write operation is an even-numbered write operation, the statistical data and / or the parameter data are controlled to be written into the second write area. For example, when it is determined that the write operation is the third write operation, the statistical data and / or the parameter data are controlled to be written into the first write area; when it is determined that the write operation is the fourth write operation, the statistical data and / or the parameter data are controlled to be written into the second write area.
[0061] In some embodiments, the storage space of the first writing area and the second writing area are both 2kB.
[0062] The embodiment of the present application forms the multiple write areas by partitioning the flash memory module, and when controlling at least the statistical data to be written into the flash memory module, the area written each time is different from the area written last time, so as to avoid damage to the flash memory module caused by repeated writing to the same write area.
[0063] In some embodiments, after the statistical data and / or the parameter data are controlled to be written into the flash memory module, the electronic cigarette enters a dormant state. Specifically, when the electronic cigarette meets the conditions for entering dormancy, the electronic cigarette controls the statistical data and / or the parameter data to be written into the flash memory module when it is determined that the statistical data stored in the first temporary storage module meets the first preset condition and / or the parameter data stored in the second temporary storage module meets the second preset condition, and then the electronic cigarette enters a dormant state.
[0064] In some other embodiments, when the electronic cigarette meets the conditions for entering sleep mode, and the electronic cigarette determines that the statistical data stored in the first temporary storage module does not meet the first preset condition and the parameter data stored in the second temporary storage module does not meet the second preset condition, the electronic cigarette directly enters sleep mode.
[0065] See also Figure 2 , Figure 2 This is a structural block diagram of the electronic cigarette 100 provided in the embodiment of the present application. Figure 2 As shown, the electronic cigarette 100 includes a first temporary storage module 10, a second temporary storage module 20, a flash memory module 30 and a control module 40. The first temporary storage module 10 is used to temporarily store the statistical data of the electronic cigarette 100, wherein the statistical data includes a statistical value of at least one statistical category. The second temporary storage module 20 is used to at least temporarily store the parameter data of the electronic cigarette 100. The control module 40 is used to determine whether the statistical data meets a first preset condition when the electronic cigarette 100 meets the condition of entering sleep mode, and when it is determined that the statistical data meets the first preset condition, control the statistical data to be written into the flash memory module 30, and determine whether the parameter data meets a second preset condition, and when it is determined that the parameter data meets the second preset condition, control the parameter data to be written into the flash memory module 30.
[0066] The electronic cigarette 100 provided in the embodiment of the present application realizes data storage of the electronic cigarette by setting the first temporary storage module 10 to temporarily store the statistical data, setting the second temporary storage module 20 to at least temporarily store the parameter data, and setting the flash memory module 30 to write the statistical data and / or the parameter data into the flash memory module when needed to store the statistical data and / or the parameter data for a long time, without the need for storage through an additional non-volatile memory, and the storage process is simple and convenient.
[0067] The control module 40 is electrically connected to the first temporary storage module 10 , the second temporary storage module 20 and the flash memory module 30 , respectively.
[0068] In some embodiments, the first temporary storage module 10, the second temporary storage module 20, the flash memory module 30 and the control module 40 are integrated into one to form a microcontroller (MCU). When manufacturing the electronic cigarette 100, the microcontroller can be directly placed in the electronic cigarette 100, so that the assembly process of the electronic cigarette 100 is simpler.
[0069] In some embodiments, the electronic cigarette 100 also includes a timer (not shown) electrically connected to the control module 40, which is used to start timing when the electronic cigarette 100 is not operated. When the time counted by the timer is equal to a first preset time, that is, the time when the electronic cigarette 100 is not operated is equal to the first preset time, the timer sends a first reminder signal to the control module 40. When receiving the first reminder signal, the control module 40 determines whether the statistical data meets a first preset condition, and when it is determined that the statistical data meets the first preset condition, controls the statistical data to be written into the flash memory module 30, and determines whether the parameter data meets a second preset condition, and when it is determined that the parameter data meets the second preset condition, controls the parameter data to be written into the flash memory module 30.
[0070] In some embodiments, the first temporary storage module 10 includes at least one first temporary storage sub-module, and each first temporary storage sub-module is used to store a statistical value of a statistical category.
[0071] In some embodiments, the control module 40 is further configured to control the statistical value of the corresponding statistical category stored in the corresponding first temporary storage submodule to be increased by one in response to one use of the electronic cigarette 100 for a certain statistical category.
[0072] In some embodiments, the control module 40 is further configured to temporarily store the statistical data in the second temporary storage module 20 when it is determined at any time that the statistical data meets the first preset condition.
[0073] In some embodiments, the first preset condition includes that the statistical value of the statistical category of the first temporary storage submodule is equal to the pre-designed value of the first temporary storage submodule, and the control module 40 is further used to control the statistical value of the same statistical category stored in the second temporary storage module 20 to be increased by one in response to a single use of the statistical category by the electronic cigarette 100 when it is determined at any time that the statistical value of the statistical category of the first temporary storage submodule is equal to the pre-designed value of the first temporary storage submodule.
[0074] In some embodiments, the control module 40 is also used to determine whether the statistical value of the statistical category of the first temporary storage submodule is equal to the pre-designed value of the first temporary storage submodule when the electronic cigarette 100 meets the conditions for entering sleep mode; when it is determined that the statistical value of the statistical category of the first temporary storage submodule is equal to the pre-designed value, control the accumulation of the statistical value of the statistical category of the first temporary storage submodule and the statistical value of the same statistical category of the second temporary storage module 20, and control the accumulation of the statistical value into the flash memory module 30.
[0075] In some embodiments, the control module 40 is further configured to control clearing of the statistical values of the statistical category stored in the first temporary storage submodule after controlling writing of the accumulated statistical values into the flash memory module 30 .
[0076] In some embodiments, the control module 40 is also used to determine whether the parameter data stored in the second temporary storage module 20 is the same as the parameter data stored in the flash memory module 30 when the electronic cigarette 100 meets the conditions for entering sleep mode; when it is determined that the parameter data stored in the second temporary storage module 20 is different from the parameter data stored in the flash memory module 30, control the parameter data stored in the second temporary storage module 20 to be written into the flash memory module 30 to replace the parameter data stored in the flash memory module 30.
[0077] In some embodiments, the flash memory module 30 includes multiple writing areas, and the control module 40 is also used to control the writing of the statistical data and / or the parameter data into the flash memory module, including: determining a target writing area; controlling the writing of the statistical data and / or the parameter data into the target writing area.
[0078] In some embodiments, the multiple writing areas are pre-sorted in sequence, and determining the target writing area includes: determining a previous writing area in which at least the statistical data was last written; and determining the next writing area of the previous writing area as the target writing area based on the sorting of the multiple writing areas.
[0079] The electronic cigarette 100 provided in the above embodiment corresponds to the aforementioned electronic cigarette data storage control method, and the relevant parts can be referenced to each other. For a more specific data storage process, reference can be made to the relevant description of the aforementioned electronic cigarette data storage control method, which will not be repeated here.
[0080] The embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the data storage control method of the electronic cigarette provided in any of the aforementioned embodiments.
[0081] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable memory, which can include: a flash drive, a read-only memory, a random access memory, a magnetic disk or an optical disk, etc.
[0082] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0083] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0084] The above is an implementation method of the embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the embodiment of the present application. These improvements and modifications are also considered to be within the scope of protection of the present application.
Claims
1. A data storage control method for an electronic cigarette, used to control the data storage of an electronic cigarette, characterized in that: The electronic cigarette includes a first temporary storage module, a second temporary storage module and a flash memory module, and the data storage control method includes the following steps: Temporarily storing the statistical data of the electronic cigarette in the first temporary storage module, wherein the statistical data includes a statistical value of at least one statistical category; at least temporarily storing the parameter data of the electronic cigarette in the second temporary storage module; and When the electronic cigarette meets the condition of entering dormancy, judging whether the statistical data meets a first preset condition, and when it is determined that the statistical data meets the first preset condition, controlling the statistical data to be written into the flash memory module, and judging whether the parameter data meets a second preset condition, and when it is determined that the parameter data meets the second preset condition, controlling the parameter data to be written into the flash memory module; Wherein, the first temporary storage module includes at least one first temporary storage submodule, and each of the first temporary storage submodules is used to store the statistical value of a statistical category correspondingly; The first preset condition includes that the statistical value of the statistical category of the first temporary storage submodule is equal to the pre-designed value of the first temporary storage submodule, and the second preset condition includes that the parameter data stored in the second temporary storage module is different from the parameter data stored in the flash memory module.
2. The electronic cigarette data storage control method according to claim 1, characterized in that: The data storage control method further includes: In response to a use of the electronic cigarette for a certain statistical category, a statistical value of the corresponding statistical category stored in the corresponding first temporary storage submodule is controlled to be increased by one.
3. The electronic cigarette data storage control method according to claim 2, characterized in that: The data storage control method further includes: When it is determined at any time that the statistical data meets the first preset condition, the statistical data is temporarily stored in the second temporary storage module.
4. The electronic cigarette data storage control method according to claim 3, characterized in that: When it is determined at any time that the statistical data meets the first preset condition, temporarily storing the statistical data in the second temporary storage module includes: When it is determined at any time that the statistical value of the statistical category of the first temporary storage submodule is equal to the pre-designed value of the first temporary storage submodule, in response to one use of the statistical category by the electronic cigarette, the statistical value of the same statistical category stored in the second temporary storage module is controlled to be increased by one.
5. The electronic cigarette data storage control method according to claim 4, characterized in that: When the electronic cigarette meets the condition of entering dormancy, judging whether the statistical data meets a first preset condition, and when it is determined that the statistical data meets the first preset condition, controlling the statistical data to be written into the flash memory module, comprises: When the electronic cigarette meets the condition of entering dormancy, determining whether the statistical value of the statistical category of the first temporary storage submodule is equal to the pre-designed value of the first temporary storage submodule; When it is determined that the statistical value of the statistical category of the first temporary storage submodule is equal to the pre-designed value, the statistical value of the statistical category of the first temporary storage submodule is controlled to be accumulated with the statistical value of the same statistical category of the second temporary storage module, and the accumulated statistical value is controlled to be written into the flash memory module.
6. The electronic cigarette data storage control method according to claim 5, characterized in that: The data storage control method further includes: After controlling to write the accumulated statistical values into the flash memory module, controlling to clear the statistical values of the statistical category stored in the first temporary storage submodule.
7. The electronic cigarette data storage control method according to claim 1, characterized in that: When the electronic cigarette meets the condition of entering dormancy, judging whether the parameter data meets a second preset condition, and when it is determined that the parameter data meets the second preset condition, controlling the parameter data to be written into the flash memory module, comprises: When the electronic cigarette meets the condition for entering dormancy, determining whether the parameter data stored in the second temporary storage module is the same as the parameter data stored in the flash memory module; When it is determined that the parameter data stored in the second temporary storage module is different from the parameter data stored in the flash memory module, the parameter data stored in the second temporary storage module is controlled to be written into the flash memory module to replace the parameter data stored in the flash memory module.
8. The electronic cigarette data storage control method according to claim 1, characterized in that: The flash memory module includes a plurality of writing areas, and controlling the statistical data and / or the parameter data to be written into the flash memory module includes: Determine the target writing area; Controlling writing of the statistical data and / or the parameter data into the target writing area.
9. The electronic cigarette data storage control method according to claim 8, characterized in that: The plurality of writing areas are pre-ordered in sequence, and the determining of the target writing area includes: determining a previously written area to which at least the statistical data was last written; The next writing area of the previous writing area is determined as the target writing area according to the order of the plurality of writing areas.
10. An electronic cigarette, characterized in that: The electronic cigarette comprises: A first temporary storage module, used for temporarily storing the statistical data of the electronic cigarette, wherein the statistical data includes a statistical value of at least one statistical category; A second temporary storage module, used to at least temporarily store parameter data of the electronic cigarette; Flash memory module; and A control module, used for judging whether the statistical data meets a first preset condition when the electronic cigarette meets a condition for entering sleep mode, and controlling the statistical data to be written into the flash memory module when it is determined that the statistical data meets the first preset condition, and judging whether the parameter data meets a second preset condition, and controlling the parameter data to be written into the flash memory module when it is determined that the parameter data meets the second preset condition; Wherein, the first temporary storage module includes at least one first temporary storage submodule, and each of the first temporary storage submodules is used to store the statistical value of a statistical category correspondingly; The first preset condition includes that the statistical value of the statistical category of the first temporary storage submodule is equal to the pre-designed value of the first temporary storage submodule, and the second preset condition includes that the parameter data stored in the second temporary storage module is different from the parameter data stored in the flash memory module.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is called and executed by the processor to implement the data storage control method of the electronic cigarette according to any one of claims 1 to 9.
