CN112803938A - Storage method and apparatus, switch apparatus, memory apparatus and readable storage medium - Google Patents

Storage method and apparatus, switch apparatus, memory apparatus and readable storage medium Download PDF

Info

Publication number
CN112803938A
CN112803938A CN202011640523.4A CN202011640523A CN112803938A CN 112803938 A CN112803938 A CN 112803938A CN 202011640523 A CN202011640523 A CN 202011640523A CN 112803938 A CN112803938 A CN 112803938A
Authority
CN
China
Prior art keywords
state
touch screen
switch
memory
storing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011640523.4A
Other languages
Chinese (zh)
Other versions
CN112803938B (en
Inventor
魏靖
杨彪
冯俭智
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Midea Intelligent Lighting and Controls Technology Co Ltd
Original Assignee
Midea Intelligent Lighting and Controls Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Midea Intelligent Lighting and Controls Technology Co Ltd filed Critical Midea Intelligent Lighting and Controls Technology Co Ltd
Priority to CN202011640523.4A priority Critical patent/CN112803938B/en
Publication of CN112803938A publication Critical patent/CN112803938A/en
Application granted granted Critical
Publication of CN112803938B publication Critical patent/CN112803938B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03KPULSE TECHNIQUE
    • H03K17/00Electronic switching or gating, i.e. not by contact-making and –breaking
    • H03K17/94Electronic switching or gating, i.e. not by contact-making and –breaking characterised by the way in which the control signals are generated
    • H03K17/96Touch switches
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C16/00Erasable programmable read-only memories
    • G11C16/02Erasable programmable read-only memories electrically programmable
    • G11C16/06Auxiliary circuits, e.g. for writing into memory
    • G11C16/10Programming or data input circuits

Abstract

The application provides a storage method and device, a switch device, a memory device and a readable storage medium. The storage method comprises the following steps: receiving a first touch screen click signal; determining the state of a touch screen switch according to the first touch screen click signal; and saving the selected state in the first memory based on the state of the touch screen switch being the selected state. According to the technical scheme, the selected state is stored based on the state of the touch screen switch, frequent operation of the touch screen switch can be effectively reduced, the operation times of the storage is reduced during state storage, the influence on the service life of the first storage is reduced, and the influence on the service life of a product is further reduced.

Description

Storage method and apparatus, switch apparatus, memory apparatus and readable storage medium
Technical Field
The present application relates to the field of data storage technologies, and in particular, to a storage method and apparatus, a switch apparatus, a memory apparatus, and a readable storage medium.
Background
The domestic switch that uses always at present, structural the general square or circular physics button of embedding on the monoblock panel, it is comparatively single in the function, can only open through the simple start-stop of single electrical apparatus of relay control. With the continuous progress of the internet of things technology, the intelligent development of home life and the progress of an intelligent home system are promoted, and the switch with a single function cannot meet the intelligent requirement.
Disclosure of Invention
The present application is directed to solving at least one of the above technical problems.
To this end, a first object of the present application is to provide a method for storing a switch state of a touch screen switch.
A second object of the present application is to provide a method for storing a switch state of a touch screen switch.
A third object of the present application is to provide a touch screen switching device.
A fourth object of the present application is to provide a first memory device.
A fifth object of the present application is to provide a switching state storage device.
A sixth object of the present application is to provide a readable storage medium.
In order to achieve the first object of the present application, a technical solution of the present application provides a method for storing a switch state of a touch screen switch, where the touch screen switch includes a touch screen and a first memory, and the method for storing the switch state includes: receiving a first touch screen click signal; determining the state of a touch screen switch according to the first touch screen click signal; and saving the selected state in the first memory based on the state of the touch screen switch being the selected state.
According to the technical scheme, the selected state is stored only when the state of the touch screen switch is the selected state, so that the frequent operation of the touch screen switch can be effectively reduced, the operation times of the storage during state storage are reduced, the influence on the service life of the first storage is reduced, and the influence on the service life of a product is further reduced.
In addition, the technical scheme provided by the application can also have the following additional technical characteristics:
in the above technical solution, the touch screen switch includes a main controller, the main controller can run a background program, and before receiving the first touch screen click signal, the switch state storage method further includes: and setting the background program into a waiting state, so that the background program waits for writing the selected state to be saved into the first memory.
According to the technical scheme, the background program is set in the waiting state, so that the touch screen click signal can be responded in time at any time, and the on-off state storage speed is increased.
In any of the above technical solutions, the method for storing the switch state of the touch screen switch further includes: and switching the background program to a ready state based on the state of the touch screen switch as a selected state, and preparing to write the selected state into the first storage.
According to the technical scheme, the state of the touch screen switch is the selected state, the background program is switched to the ready state, the selected state is ready to be written into the first storage at any time, the response speed is high by setting the background program to be in the ready state, and the storage speed of the switch state is increased.
In any of the above technical solutions, the saving of the selected state in the first memory based on the state of the touch screen switch being the selected state specifically includes: starting timing based on the state of the touch screen switch as a selected state; and in a first time period, a second touch screen clicking signal is not received, and the selected state is stored in the first memory.
According to the technical scheme, frequent on-off state storage can be effectively reduced, the operation times of the first storage device are reduced, the influence of the on-off state storage on the service life of the first storage device is reduced, and the influence on the service life of the touch screen switch is further reduced. In addition, the touch screen can be identified when being clicked by misoperation, the on-off state is not stored, and the influence on the service life of the first storage is further reduced.
In any of the above technical solutions, the method for storing the switch state of the touch screen switch further includes: and keeping the background program in a ready state based on receiving a second touch screen clicking signal in the first time period.
According to the technical scheme, the background program is kept in the ready state, and subsequent possible write-in operation can be performed, so that the response is rapid.
In any of the above technical solutions, the method for storing the switch state of the touch screen switch further includes: determining the state of a touch screen switch according to the second touch screen click signal; and restarting timing based on the state of the touch screen switch being the selected state.
According to the technical scheme, useless operation of saving the switch state is avoided when the switch is frequently clicked, only the final result is saved, the operation times of the first storage are reduced when the touch screen switch is frequently operated to save the state, the storage times of the first storage are reduced, the influence of frequent storage on the service life of the first storage is reduced, and the influence on the service life of the touch screen switch is further reduced.
In any of the above technical solutions, storing the selected state in the first memory specifically includes: switching the background program to a writing state, and writing the selected state into the first memory; and switching the background program to a waiting state.
According to the technical scheme, the background program is switched from the ready state to the write-in state, the write-in of the selected state is achieved, and the rapid and accurate storage of the selected state is achieved by controlling the background program to be switched among the waiting state, the ready state and the write-in state.
In any of the above solutions, the first memory includes a nonvolatile memory.
According to the technical scheme, the selected state of the touch screen switch is stored by adopting the nonvolatile memory, so that the selected state can be stored under the condition that the touch screen switch is powered off.
In order to achieve the second object of the present application, a technical solution of the present application provides a method for storing a switch state of a touch screen switch, where the touch screen switch includes a first memory, and the method for storing the switch state includes: receiving a selected state of a touch screen switch; the selected state is saved in the first memory.
According to the technical scheme, the selected state is received and then stored, so that the operation times of the first storage can be effectively reduced when the state is stored, the influence on the service life of the first storage is reduced, and the influence on the service life of a product is further reduced.
In addition, the technical scheme provided by the application can also have the following additional technical characteristics:
in the technical scheme, the touch screen switch comprises a touch screen and a main controller, the main controller can run a background program, and the switch state storage method comprises the following steps: setting the background program into a waiting state, and enabling the background program to wait for writing the selected state to be stored into the first memory; switching the background program to a ready state based on the state of the touch screen switch as a selected state, and preparing to write the selected state into the first memory; and switching the background program to a writing state based on the need of storing the selected state, writing the selected state into the first memory, and switching the background program to a waiting state.
According to the technical scheme, the three modes of the background program are set, so that timely response can be realized, and the speed of storing the switch state is increased.
In any of the above solutions, the first memory includes a nonvolatile memory.
According to the technical scheme, the selected state of the touch screen switch is stored by adopting the nonvolatile memory, so that the selected state can be stored under the condition that the touch screen switch is powered off.
To achieve the third object of the present application, a technical solution of the present application provides a touch screen switching device, including: the device comprises a first receiving module, a determining module and a first storage module; a first receiving module receives a first touch screen clicking signal; the determining module determines the state of a touch screen switch according to the first touch screen clicking signal; based on the condition that the state of the touch screen switch is the selected state, the first storage module stores the selected state in the first storage.
According to the technical scheme, the selected state is stored by the first storage module based on the state of the touch screen switch, so that the frequent operation of the touch screen switch can be effectively reduced, the operation times of the storage during state storage are reduced, the influence on the service life of the first storage is reduced, and the influence on the service life of a product is further reduced.
To achieve the fourth object of the present application, an aspect of the present application provides a first memory device including: the second receiving module and the second storage module; the second receiving module receives the selected state of the touch screen switch; the second storage module stores the selected state in the first storage.
According to the technical scheme, the selected state is received through the second receiving module, the second storage module stores the selected state, the operation times of the first storage device during state storage can be effectively reduced, the influence on the service life of the first storage device is reduced, and the influence on the service life of a product is further reduced.
To achieve the fifth object of the present application, the technical solution of the present application provides a switching state storage device, including: the second memory stores programs or instructions, and the processor executes the programs or instructions; when the processor executes the program or the instruction, the method for storing the switch state of the touch screen switch according to any technical scheme of the application is realized.
The on-off state storage device provided in the technical scheme realizes the steps of the method for storing the on-off state of the touch screen switch according to any one of the technical schemes of the present application, and thus has all the beneficial effects of the method for storing the on-off state of the touch screen switch according to any one of the technical schemes of the present application, and is not described herein again.
In order to achieve the sixth object of the present application, in the technical scheme of the present application, a readable storage medium is provided, where a program or an instruction is stored in the readable storage medium, and when the program or the instruction is executed, the steps of the method for storing the switch state of the touch screen switch in any one of the above technical schemes are implemented.
The readable storage medium provided in this technical solution implements the steps of the method for storing the on/off state of the touch screen switch according to any technical solution of this application, and thus has all the beneficial effects of the method for storing the on/off state of the touch screen switch according to any technical solution of this application, and details are not repeated here.
Additional aspects and advantages of the present application will be set forth in part in the description which follows, or may be learned by practice of the present application.
Drawings
The above and/or additional aspects and advantages of the present application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
fig. 1 is a schematic flow chart of a method for storing an on-off state of a touch screen switch according to an embodiment of the present application;
fig. 2 is a second schematic flowchart of a method for storing an on-off state of a touch screen switch according to an embodiment of the present application;
fig. 3 is a third schematic flowchart of a method for storing an on-off state of a touch screen switch according to an embodiment of the present application;
fig. 4 is a fourth schematic flowchart of a method for storing an on-off state of a touch screen switch according to an embodiment of the present application;
fig. 5 is a fifth flowchart illustrating a method for storing an on-off state of a touch screen switch according to an embodiment of the present application;
fig. 6 is a sixth schematic flowchart of a method for storing an on-off state of a touch screen switch according to an embodiment of the present application;
fig. 7 is a seventh flowchart illustrating a method for storing an on-off state of a touch screen switch according to an embodiment of the present application;
fig. 8 is an eighth schematic flowchart of a method for storing an on-off state of a touch screen switch according to an embodiment of the present application;
fig. 9 is a ninth flowchart illustrating a method for storing an on-off state of a touch screen switch according to an embodiment of the present application;
FIG. 10 is a schematic view of a touch screen switch assembly according to an embodiment of the present application;
FIG. 11 is a schematic diagram of a first memory device according to one embodiment of the present application;
FIG. 12 is a schematic diagram of a switch state storage device according to an embodiment of the present application;
FIG. 13 is a schematic diagram illustrating the operation of storing switch states according to one embodiment of the present application;
FIG. 14 is a diagram illustrating background program state transition according to an embodiment of the present application.
Wherein, the correspondence between the reference numbers and the part names in fig. 10 to 14 is:
100: touch screen switching device, 110: first receiving module, 120: determination module, 130: first memory module, 200: first memory device, 210: second receiving module, 220: second memory module, 300: switch state storage, 310: second memory, 320: processor, 400: wait state, 410: ready state, 420: write status, 430: a write memory operation.
Detailed Description
In order that the above objects, features and advantages of the present application can be more clearly understood, the present application will be described in further detail with reference to the accompanying drawings and detailed description. It should be noted that the embodiments and features of the embodiments of the present application may be combined with each other without conflict.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application, however, the present application may be practiced in other ways than those described herein, and therefore the scope of the present application is not limited by the specific embodiments disclosed below.
Storage methods and devices, switching devices, memory devices, and readable storage media of some embodiments of the present application are described below with reference to fig. 1 through 14.
Example 1:
as shown in fig. 1, the present embodiment provides a method for storing a switch state of a touch screen switch, where the touch screen switch includes a touch screen and a first memory, and the method for storing the switch state includes the following steps:
step S102, receiving a first touch screen clicking signal;
step S104, determining the state of a touch screen switch according to the first touch screen click signal;
and S106, saving the selected state in the first memory based on the state of the touch screen switch as the selected state.
Compared with a physical switch, the touch screen switch has no physical switch state, the on and off states are displayed through a user graphical interface, and after power failure and restart, data before power failure needs to be read to display the switch state, so that the data needs to be stored in a non-volatile memory (Flash). The nonvolatile memory has a certain storage life, and frequent data writing can reduce the usable time of the nonvolatile memory and influence the product life. Compared with a physical switch, the touch screen switch has the characteristics of easiness in clicking and quick response, the switch state can be frequently switched, and the service life of the storage device can be greatly shortened by storing the switch state too frequently.
In this embodiment, the touch screen switch is provided with a touch screen and a first memory, the touch screen can be used for clicking, and then some functions of the touch screen switch are realized, after the touch screen of the touch screen switch is clicked, a first touch screen click signal is received, the state of the touch screen switch is acquired based on the first touch screen click signal, when the state of the touch screen switch is a selected state, the selected state is stored in the first memory, and the selected state is stored only when the state of the touch screen switch is the selected state, so that frequent operation of the touch screen switch can be effectively reduced, the operation times of the memory during state storage are reduced, the influence on the service life of the first memory is reduced, and further the influence on the service life of a product is reduced. Moreover, useless operation of saving the switch state when the switch is frequently clicked can be avoided, and only the final result needs to be saved.
Example 2:
as shown in fig. 2, the present embodiment provides a method for storing a switch state of a touch screen switch, and in addition to the technical features of the foregoing embodiments, the present embodiment further includes the following technical features:
the touch screen switch comprises a main controller, the main controller can run a background program, and before receiving a first touch screen click signal, the switch state storage method further comprises the following steps:
step S202, the background program is set to be in a waiting state, and the background program is enabled to wait for writing the selected state needing to be saved into the first memory.
The main controller of the touch screen switch runs a background program which is in a waiting state all the time, waits for a selected state to be stored, writes the selected state into the first storage, and can respond to a touch screen click signal at any time by setting the background program in the waiting state, so that the storage speed of the on-off state is increased.
Example 3:
as shown in fig. 3, the present embodiment provides a method for storing a switch state of a touch screen switch, and in addition to the technical features of the above embodiments, the present embodiment further includes the following technical features:
the method for storing the switch state of the touch screen switch further comprises the following steps:
step S302, based on the state of the touch screen switch being the selected state, the background program is switched to the ready state and is ready to be written into the selected state to the first storage.
The background program is always in a waiting state, the selected state needing to be stored is waited to be written into the first storage, a first touch screen click signal is received, the state of the touch screen switch is determined according to the first touch screen click signal, the background program is switched to a ready state based on the state of the touch screen switch being the selected state, and the selected state is ready to be written into the first storage.
In the embodiment, the background program is switched to the ready state based on the state of the touch screen switch being the selected state, the selected state is ready to be written into the first memory at any time, and the state storage speed of the switch is increased by setting the background program to be in the ready state, so that the response speed is high.
Example 4:
as shown in fig. 4, the present embodiment provides a method for storing a switch state of a touch screen switch, and in addition to the technical features of the foregoing embodiments, the present embodiment further includes the following technical features:
the method comprises the following steps of saving a selected state in a first memory based on the state of a touch screen switch as the selected state, and specifically comprises the following steps:
step S402, timing is started based on the state of the touch screen switch as a selected state;
and S404, in a first time period, a second touch screen clicking signal is not received, and the selected state is stored in a first storage.
The method comprises the steps of firstly, receiving a first touch screen click signal, determining the state of a touch screen switch according to the first touch screen click signal, then, starting timing based on the state of the touch screen switch as a selected state, and storing the selected state into a first storage device within a first time period if a second touch screen click signal is not received.
The on and off of the touch screen switch are displayed through a user graphical interface, the state of the on and off state needs to be stored in the first storage, the first storage has certain storage life, and frequent data writing can reduce the service life of the first storage, so that the service life of a product is influenced. In addition, the touch screen switch responds to the click quickly, a user may click the touch screen by misoperation in the operation process, and then the on-off state is frequently switched, and the service life of the first storage is greatly shortened by storing the on-off state too frequently. In the embodiment, whether the touch screen is clicked again or not is monitored in the first time period, and if the touch screen is not clicked again, the selected state is stored. In addition, the touch screen can be identified when being clicked by misoperation, the on-off state is not stored, and the influence on the service life of the first storage is further reduced.
Example 5:
as shown in fig. 5, the present embodiment provides a method for storing a switch state of a touch screen switch, and in addition to the technical features of the foregoing embodiments, the present embodiment further includes the following technical features:
the method for storing the switch state of the touch screen switch further comprises the following steps:
step S502, based on the fact that a second touch screen clicking signal is received in a first time period, the background program is kept in a ready state.
When the touch screen is clicked again in the first time period, a second touch screen clicking signal is received, the background program is kept in a ready state, the state of the touch screen switch can be a selected state or a non-selected state based on the second touch screen clicking signal, the background program is kept in the ready state, and writing operation can be performed on follow-up possibility, so that quick response can be achieved.
Example 6:
as shown in fig. 6, the present embodiment provides a method for storing a switch state of a touch screen switch, and in addition to the technical features of the above embodiments, the present embodiment further includes the following technical features:
the method for storing the switch state of the touch screen switch further comprises the following steps:
step S602, determining the state of a touch screen switch according to the second touch screen click signal;
and step S604, restarting timing based on the state of the touch screen switch being the selected state.
If the touch screen is clicked again in the first time period, namely a second touch screen click signal is received, firstly, the state of the touch screen switch is determined, if the state is the selected state, the switch function is selected again in the first time period, at the moment, the selected state of the touch screen switch is obtained, timing is restarted, whether a new touch screen click signal is received again in the first time period is judged, if the new touch screen click signal is received, the state of the touch screen switch is determined again according to the new touch screen click signal, if the state of the touch screen switch is the selected state, the time is refreshed again, timing is restarted, by the method, useless operation of saving the switch state when the switch is frequently clicked is avoided, only the final result is saved, because the operation times of the first storage is reduced when the state of the frequently operated switch is saved, the influence on the service life of the first storage due to frequent storage is reduced, and the influence on the service life of the touch screen switch is further reduced.
Example 7:
as shown in fig. 7, the present embodiment provides a method for storing a switch state of a touch screen switch, and in addition to the technical features of the above embodiments, the present embodiment further includes the following technical features:
saving the selected state in the first memory, specifically comprising the steps of:
step S702, switching the background program to a writing state, and writing the selected state into a first memory;
step S704, the daemon is switched to a waiting state.
The background program starts to be in a waiting state, the selected state needing to be stored is waited to be written into the first storage, when the state of the touch screen switch is the selected state, the background program is switched to a ready state and is ready to be written into the first storage, the background program is switched to a writing state based on that a second touch screen clicking signal is not received in a first time period, the selected state is written into the first storage, and the background program is switched to the waiting state.
In the embodiment, the background program is switched from the ready state to the write state to realize the write-in of the selected state, and the rapid and accurate storage of the selected state is realized by controlling the background program to be switched among the waiting state, the ready state and the write state.
Example 8:
the present embodiment provides a method for storing a switch state of a touch screen switch, which, in addition to the technical features of the foregoing embodiments, further includes the following technical features:
the first memory includes a non-volatile memory.
After the power failure is restarted, the selected state of the touch screen switch before the power failure needs to be read to display the switch state, so that the first memory for storing the selected state of the touch screen switch needs to adopt a nonvolatile memory, and the nonvolatile memory refers to a memory in which stored data cannot disappear after the current is turned off.
Example 9:
as shown in fig. 8, this embodiment provides a method for storing a switch state of a touch screen switch, where the touch screen switch includes a first memory, and the method for storing the switch state includes the following steps:
step S802, receiving a selected state of a touch screen switch;
step S804, saving the selected state in the first memory.
The touch screen switch is provided with a first storage, the touch screen switch is further provided with a touch screen, certain functions of the touch screen switch can be achieved through the touch screen of the motor, after the touch screen of the touch screen switch is clicked, a first touch screen click signal is received, the state of the touch screen switch is acquired based on the first touch screen click signal, when the state of the touch screen switch is a selected state, the selected state is sent to the first storage, the first storage receives the selected state of the touch screen switch, and the selected state is stored.
In the embodiment, the first memory receives the selected state and then stores the selected state, so that the operation times of the first memory during state saving can be effectively reduced, the influence on the service life of the first memory is reduced, and the influence on the service life of a product is further reduced.
Example 10:
as shown in fig. 9, the present embodiment provides a method for storing a switch state of a touch screen switch, and in addition to the technical features of the above embodiments, the present embodiment further includes the following technical features:
the touch screen switch comprises a touch screen and a main controller, the main controller can run a background program, and the switch state storage method comprises the following steps:
step S902, setting the background program into a waiting state, and enabling the background program to wait for writing the selected state to be stored into the first memory;
step S904, switching the background program to a ready state based on the state of the touch screen switch as a selected state, and preparing to write the selected state into the first memory;
step S906, based on the selected state needing to be stored, the background program is switched to a writing state, the selected state is written into the first memory, and the background program is switched to a waiting state.
And running a background program by the main controller of the touch screen switch, wherein the background program is in a waiting state all the time, waits for a selected state to be stored, and writes the selected state into the first memory.
Receiving a first touch screen click signal, determining the state of a touch screen switch according to the first touch screen click signal, switching a background program to a ready state based on the state of the touch screen switch as a selected state, and preparing to write the selected state into a first memory.
And on the basis that a second touch screen click signal is not received in a first time period, the selected state needs to be stored, the background program is switched to the writing state, the selected state is written into the first memory, and the background program is switched to the waiting state.
According to the embodiment, the three modes of the background program are set, so that the response can be timely carried out, and the speed of storing the switch state is increased.
Example 11:
the present embodiment provides a method for storing a switch state of a touch screen switch, which, in addition to the technical features of the foregoing embodiments, further includes the following technical features:
the first memory includes a non-volatile memory.
After the touch screen switch is powered off and restarted, the selected state of the switch before the power is off needs to be read to display the switch state, and the first storage is used for storing the selected state of the touch screen switch, so that internal data does not disappear after the first storage is powered off and restarted again.
Example 12:
as shown in fig. 10, the present embodiment provides a touch screen switch device 100 including: a first receiving module 110, a determining module 120 and a first storing module 130; the first receiving module 110 receives a first touch screen click signal; the determining module 120 determines a state of a touch screen switch according to the first touch screen click signal; based on the state of the touch screen switch being the selected state, the first storage module 130 stores the selected state in the first storage.
In this embodiment, after a touch screen of the touch screen switch is clicked, the first receiving module 110 receives a first touch screen click signal, the determining module 120 determines, based on the first touch screen click signal, a state of the touch screen switch is obtained, when the state of the touch screen switch is a selected state, the first storage module 130 stores the selected state in the first storage, and only when the state of the touch screen switch is the selected state, the selected state is stored, which can effectively reduce the number of operations on the touch screen switch, and the number of operations on the storage during state storage, reduce the influence on the service life of the first storage, and further reduce the influence on the service life of the product. Moreover, useless operation of saving the switch state when the switch is frequently clicked can be avoided, and only the final result needs to be saved.
In the foregoing technical solution, before receiving the first touch screen click signal, the first receiving module 110 sets the background program to be in a waiting state, so that the background program waits to write the selected state to be stored into the first memory.
In any of the above technical solutions, the background program is switched to the ready state based on the state of the touch screen switch being the selected state, and the selected state is ready to be written into the first memory.
In any of the above technical solutions, timing is started based on that the state of the touch screen switch is the selected state, and in a first time period, a second touch screen click signal is not received, and the first storage module 130 stores the selected state in the first storage.
In any of the above technical solutions, based on that in the first time period, the first receiving module 110 receives the second touch screen click signal, the background program is kept in a ready state.
In any of the above technical solutions, according to the second touch screen click signal, the determining module 120 determines the state of the touch screen switch, and restarts timing based on that the state of the touch screen switch is the selected state.
In any of the above technical solutions, the background program is switched to the write state, the selected state is written into the first memory, and the background program is switched to the wait state.
In any of the above solutions, the first memory includes a non-volatile memory.
Example 13:
as shown in fig. 11, the present embodiment provides a first memory device 200, including: a second receiving module 210 and a second storing module 220; the second receiving module 210 receives a selected state of the touch screen switch; the second storage module 220 stores the selected state in the first memory.
According to the technical scheme, the selected state is received through the second receiving module 210, and then the selected state is stored through the second storage module 220, so that the operation times of the first storage device 200 during state saving can be effectively reduced, the influence on the service life of the first storage device 200 is reduced, and further the influence on the service life of a product is reduced.
In the above technical solution, the background program is set to be in a waiting state, so that the background program waits to write the selected state to be saved into the first memory device 200. Based on the state of the touch screen switch being the selected state, the background program is switched to the ready state, and the selected state is ready to be written into the first memory device 200. The background program is switched to the write state, the selected state is written to the first memory device 200, and the background program is switched to the wait state, based on the need to store the selected state.
In any of the above solutions, the first memory device 200 includes a nonvolatile memory.
Example 14:
as shown in fig. 12, the present embodiment provides a switching state storage device 300 including: a second memory 310 and a processor 320, the second memory 310 storing programs or instructions, the processor 320 executing the programs or instructions; wherein, the processor 320, when executing the program or the instructions, implements the steps of the method for storing the switch state of the touch screen switch according to any embodiment of the present application.
The method for storing the switch state of the touch screen switch can comprise the following steps: receiving a first touch screen click signal; determining the state of a touch screen switch according to the first touch screen click signal; and saving the selected state in the first memory based on the state of the touch screen switch being the selected state.
According to the technical scheme, the selected state is stored only when the state of the touch screen switch is the selected state, so that the frequent operation of the touch screen switch can be effectively reduced, the operation times of the storage during state storage are reduced, the influence on the service life of the first storage is reduced, and the influence on the service life of a product is further reduced.
In the above technical solution, the background program is set to be in a waiting state, so that the background program waits to write the selected state to be saved into the first memory.
According to the technical scheme, the background program is set in the waiting state, so that the touch screen click signal can be responded in time at any time, and the on-off state storage speed is increased.
In any of the above technical solutions, the background program is switched to the ready state based on the state of the touch screen switch being the selected state, and the selected state is ready to be written into the first memory.
According to the technical scheme, the state of the touch screen switch is the selected state, the background program is switched to the ready state, the selected state is ready to be written into the first storage at any time, the response speed is high by setting the background program to be in the ready state, and the storage speed of the switch state is increased.
In any technical scheme, timing is started based on the state of the touch screen switch as a selected state; and in a first time period, a second touch screen clicking signal is not received, and the selected state is stored in the first memory.
According to the technical scheme, frequent on-off state storage can be effectively reduced, the operation times of the first storage device are reduced, the influence of the on-off state storage on the service life of the first storage device is reduced, and the influence on the service life of the touch screen switch is further reduced. In addition, the touch screen can be identified when being clicked by misoperation, the on-off state is not stored, and the influence on the service life of the first storage is further reduced.
In any of the above technical solutions, the background program is kept in a ready state based on that a second touch screen click signal is received in a first time period.
According to the technical scheme, the background program is kept in the ready state, and subsequent possible write-in operation can be performed, so that the response is rapid.
In any of the above technical solutions, determining the state of the touch screen switch according to the second touch screen click signal; and restarting timing based on the state of the touch screen switch being the selected state.
According to the technical scheme, useless operation of saving the switch state is avoided when the switch is frequently clicked, only the final result is saved, the operation times of the first storage are reduced when the touch screen switch is frequently operated to save the state, the storage times of the first storage are reduced, the influence of frequent storage on the service life of the first storage is reduced, and the influence on the service life of the touch screen switch is further reduced.
In any of the above technical solutions, the background program is switched to a write-in state, and the selected state is written into the first memory; and switching the background program to a waiting state.
According to the technical scheme, the background program is switched from the ready state to the write-in state, the write-in of the selected state is achieved, and the rapid and accurate storage of the selected state is achieved by controlling the background program to be switched among the waiting state, the ready state and the write-in state.
In any of the above solutions, the first memory includes a non-volatile memory.
According to the technical scheme, the selected state of the touch screen switch is stored by adopting the nonvolatile memory, so that the selected state can be stored under the condition that the touch screen switch is powered off.
The method for storing the switch state of the touch screen switch further comprises the steps of receiving the selected state of the touch screen switch; the selected state is saved in the first memory.
According to the technical scheme, the selected state is received and then stored, so that the operation times of the first storage can be effectively reduced when the state is stored, the influence on the service life of the first storage is reduced, and the influence on the service life of a product is further reduced.
In the technical scheme, the background program is set to be in a waiting state, so that the background program waits for writing the selected state to be stored into the first memory; switching the background program to a ready state based on the state of the touch screen switch as a selected state, and preparing to write the selected state into the first memory; and switching the background program to a writing state based on the need of storing the selected state, writing the selected state into the first memory, and switching the background program to a waiting state.
According to the technical scheme, the three modes of the background program are set, so that the response can be timely carried out, and the storage speed of the switch state is increased.
In any of the above solutions, the first memory includes a nonvolatile memory.
According to the technical scheme, the selected state of the touch screen switch is stored by adopting the nonvolatile memory, so that the selected state can be stored under the condition that the touch screen switch is powered off.
Example 15:
the present embodiment provides a readable storage medium, which stores a program or instructions, and when the program or instructions are executed by the processor 320, the steps of the method for storing the switch state of the touch screen switch according to any of the above embodiments are implemented.
The specific embodiment is as follows:
compared with a physical switch, the touch screen switch has no state of the physical switch, the on and off states are displayed through a user graphical interface, and after the power failure is restarted, data before the power failure needs to be read to display the state of the switch, so that the data needs to be stored in a nonvolatile memory. The nonvolatile memory (Flash) has a certain storage life, and frequent data writing can reduce the available time of the nonvolatile memory (Flash) and influence the product life. Compared with a physical switch, the touch screen switch has the characteristics of easiness in clicking and quick response, the switch state can be frequently switched, and the service life of the storage device can be greatly shortened by storing the switch state too frequently.
The technical scheme of the embodiment is as follows:
(1) the main controller background program is always in a waiting state for waiting for acquiring a signal and writing a switch state to be stored into the first memory.
(2) After a user clicks a touch screen switch, the master control judges that a selected function is clicked, if the selected function is not in a control switch state, storage processing is not performed, and if the selected switch state is selected, a background program is switched to a ready state to be ready to write the switch state into a first storage.
(3) If the touch screen switch is not detected to be clicked within a certain time, and the background program is switched to the writing state, the switching state is written into the first storage, and after the operation is completed, the background program is switched to the waiting state; and if the switch is detected to be clicked again within a certain time, keeping the background program in a ready state, refreshing the detection time, and detecting again.
According to the method and the device, the state storage of the touch screen switch is optimized, the storage times during frequent switch control are reduced, and the influence of frequent storage of the switch state on the service life of the storage device is reduced.
In this embodiment, the main controller determines the clicked function by detecting that the touch screen switch is clicked, controls the device if the switch state is selected, prepares to write the switch state into the nonvolatile memory, and delays the state storage if the switch state is selected by determining that the touch screen switch is clicked again within a certain time, thereby avoiding continuous writing of the state and only saving the last state.
As shown in fig. 13, a schematic diagram of the operation of storing the switch states specifically includes:
step S1002: intelligent switch user graphical interface;
in the intelligent switch user graphical interface, after the main controller detects a user click operation, a judgment instruction is entered to judge whether the operation is a click switch button, if the operation is other operations, the step S1004 is entered, and if the operation is the click switch button, the step S1006 is entered.
Step S1004, no processing;
step S1006, sending a click signal;
step S1008, background program processing;
the background program processes the click signal.
As shown in fig. 14, a schematic diagram of background program state transition is specifically shown as follows:
if no signal is received, the background program is in a waiting state 400, after a click signal is received, the background program is switched to a ready state 410, a timer is started, the background program is in detection time and enters a writing state 420, and if a click signal is received again in the detection time, the background program jumps to the ready state 410, restarts the timer and refreshes the detection time; if the click signal is not received within the detection time, the operation 430 of writing into the memory is performed, the switch state is written into the first memory, the switch state is saved, and after the writing is completed, the state is switched to the waiting state 400 to wait for the next writing operation.
The embodiment avoids useless operation of saving the switch state when the switch is frequently clicked, and only the final result is saved.
According to the embodiment, the frequency of operating the touch screen switch is reduced, the operation frequency of the storage is reduced during state saving, the influence on the service life of the storage is reduced, and the influence on the service life of a product is further reduced.
To sum up, the beneficial effect of this application embodiment is:
1. in this embodiment, only the selected state is saved based on the state of the touch screen switch being the selected state, so that the frequent operation of the touch screen switch and the operation times of the memory during the state saving can be effectively reduced, the influence on the service life of the first memory is reduced, and further the influence on the service life of the product is reduced.
2. According to the embodiment, useless operation of saving the switch state when the switch is frequently clicked is avoided, and only the final result is saved.
In this application, the terms "first," "second," and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance; the term "plurality" means two or more unless expressly limited otherwise. The terms "mounted," "connected," "fixed," and the like are to be construed broadly, and for example, "connected" may be a fixed connection, a removable connection, or an integral connection; "coupled" may be direct or indirect through an intermediary. The specific meaning of the above terms in the present application can be understood by those of ordinary skill in the art as appropriate.
In the description of the present application, it is to be understood that the terms "upper", "lower", "left", "right", "front", "rear", and the like indicate orientations or positional relationships based on those shown in the drawings, and are only for convenience of description and simplification of description, but do not indicate or imply that the referred device or unit must have a specific direction, be configured and operated in a specific orientation, and thus, should not be construed as limiting the present application.
In the description herein, the description of the terms "one embodiment," "some embodiments," "specific embodiments," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the application. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (15)

1. A method for storing the switch state of a touch screen switch, wherein the touch screen switch comprises a touch screen and a first memory, and the method for storing the switch state comprises the following steps:
receiving a first touch screen click signal;
determining the state of the touch screen switch according to the first touch screen click signal;
and saving the selected state in the first memory based on the state of the touch screen switch being the selected state.
2. The method for storing the switch state of the touch screen switch according to claim 1, wherein the touch screen switch comprises a main controller, the main controller is capable of running a background program, and before the receiving the first touch screen click signal, the method for storing the switch state further comprises:
and setting the background program into a waiting state, and enabling the background program to wait for writing the selected state to be saved into the first memory.
3. The method for storing the switch state of the touch screen switch according to claim 2, further comprising:
and switching the background program to a ready state based on the state of the touch screen switch being the selected state, and preparing to write the selected state into the first memory.
4. The method for storing the switch state of the touch screen switch according to claim 3, wherein the saving the selected state in the first memory based on the state of the touch screen switch being the selected state specifically includes:
starting timing based on the state of the touch screen switch as a selected state;
and in a first time period, a second touch screen click signal is not received, and the selected state is stored in the first memory.
5. The method for storing the switch state of the touch screen switch according to claim 4, further comprising:
and keeping the background program in a ready state based on the fact that the second touch screen clicking signal is received in a first time period.
6. The method for storing the switch state of the touch screen switch according to claim 5, further comprising:
determining the state of the touch screen switch according to the second touch screen click signal;
and restarting timing based on the state of the touch screen switch being the selected state.
7. The method for storing the switch state of the touch screen switch according to claim 2, wherein the storing the selected state in the first memory specifically includes:
switching the background program to a writing state, and writing the selected state into the first memory;
and switching the background program to the waiting state.
8. The touch screen switch switching state storage method according to any one of claims 1 to 7, wherein the first memory includes a nonvolatile memory.
9. A method for storing the switch state of a touch screen switch, wherein the touch screen switch comprises a first memory, and the method for storing the switch state comprises the following steps:
receiving a selected state of the touch screen switch;
saving the selected state in the first memory.
10. The method for storing the switching state of the touch screen switch according to claim 9, wherein the touch screen switch comprises a touch screen and a main controller, the main controller can run a background program, and the method for storing the switching state comprises:
setting the background program into a waiting state, and enabling the background program to wait for writing the selected state to be saved into the first memory;
switching the background program to a ready state based on the state of the touch screen switch being the selected state, and preparing to write the selected state into the first memory;
and switching the background program to a writing state based on the need of storing the selected state, writing the selected state into the first memory, and switching the background program to the waiting state.
11. The method for storing the switch state of the touch screen switch according to claim 9 or 10, wherein the first memory comprises a nonvolatile memory.
12. A touch screen switching device (100), comprising:
a first receiving module (110), wherein the first receiving module (110) receives a first touch screen click signal;
a determining module (120), wherein the determining module (120) determines the state of the touch screen switch according to the first touch screen click signal;
the first storage module (130) stores the selected state in the first storage based on the state of the touch screen switch being the selected state.
13. A first memory device (200), comprising:
the second receiving module (210), the second receiving module (210) receives the selected state of the touch screen switch;
a second storage module (220), said second storage module (220) saving said selected state in said first memory.
14. A switch state storage device (300), comprising:
a second memory (310) storing programs or instructions;
a processor (320) that executes the program or instructions;
wherein the processor (320), upon execution of the program or instructions, implements the steps of a method for storing a switching state of a touch screen switch according to any one of claims 1 to 8, or implements the steps of a method for storing a switching state of a touch screen switch according to any one of claims 9 to 11.
15. A readable storage medium, characterized in that the readable storage medium stores thereon a program or instructions which, when executed by a processor, implement the steps of the method for storing the switching state of a touch screen switch according to any one of claims 1 to 8, or implement the steps of the method for storing the switching state of a touch screen switch according to any one of claims 9 to 11.
CN202011640523.4A 2020-12-31 2020-12-31 Storage method and apparatus, switch apparatus, memory apparatus and readable storage medium Active CN112803938B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011640523.4A CN112803938B (en) 2020-12-31 2020-12-31 Storage method and apparatus, switch apparatus, memory apparatus and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011640523.4A CN112803938B (en) 2020-12-31 2020-12-31 Storage method and apparatus, switch apparatus, memory apparatus and readable storage medium

Publications (2)

Publication Number Publication Date
CN112803938A true CN112803938A (en) 2021-05-14
CN112803938B CN112803938B (en) 2023-04-07

Family

ID=75809123

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011640523.4A Active CN112803938B (en) 2020-12-31 2020-12-31 Storage method and apparatus, switch apparatus, memory apparatus and readable storage medium

Country Status (1)

Country Link
CN (1) CN112803938B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07199935A (en) * 1993-12-30 1995-08-04 Casio Comput Co Ltd Touch detector
CN103200327A (en) * 2013-04-08 2013-07-10 上海斐讯数据通信技术有限公司 Method for achieving mouse function on mobile phone
CN103218074A (en) * 2013-03-06 2013-07-24 广东欧珀移动通信有限公司 Method for realizing touch stroke structure of intelligent terminal and intelligent terminal
US20140250262A1 (en) * 2013-03-01 2014-09-04 Ocz Storage Solutions, Inc. System and method for polling the status of memory devices
CN104584693A (en) * 2012-12-13 2015-04-29 松下知识产权经营株式会社 Wall switch
CN107340910A (en) * 2017-06-26 2017-11-10 广东欧珀移动通信有限公司 A kind of response method of touch key-press, device, storage medium and electronic equipment
CN107665091A (en) * 2016-07-28 2018-02-06 大心电子股份有限公司 Method for reading data, method for writing data and its storage control
WO2018054060A1 (en) * 2016-09-26 2018-03-29 深圳市中兴微电子技术有限公司 Processor and bootloader program update method, and storage medium
CN108681432A (en) * 2018-05-17 2018-10-19 Oppo广东移动通信有限公司 Processing method, device, storage medium and the electronic device of touch information
US20190220164A1 (en) * 2018-01-18 2019-07-18 Parkimon Inc. Method and system for facilitating an infinite navigation menu on a touch screen device
CN110196823A (en) * 2018-02-27 2019-09-03 爱思开海力士有限公司 Electronic device and its operating method

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07199935A (en) * 1993-12-30 1995-08-04 Casio Comput Co Ltd Touch detector
CN104584693A (en) * 2012-12-13 2015-04-29 松下知识产权经营株式会社 Wall switch
US20140250262A1 (en) * 2013-03-01 2014-09-04 Ocz Storage Solutions, Inc. System and method for polling the status of memory devices
CN103218074A (en) * 2013-03-06 2013-07-24 广东欧珀移动通信有限公司 Method for realizing touch stroke structure of intelligent terminal and intelligent terminal
CN103200327A (en) * 2013-04-08 2013-07-10 上海斐讯数据通信技术有限公司 Method for achieving mouse function on mobile phone
CN107665091A (en) * 2016-07-28 2018-02-06 大心电子股份有限公司 Method for reading data, method for writing data and its storage control
WO2018054060A1 (en) * 2016-09-26 2018-03-29 深圳市中兴微电子技术有限公司 Processor and bootloader program update method, and storage medium
CN107340910A (en) * 2017-06-26 2017-11-10 广东欧珀移动通信有限公司 A kind of response method of touch key-press, device, storage medium and electronic equipment
US20190220164A1 (en) * 2018-01-18 2019-07-18 Parkimon Inc. Method and system for facilitating an infinite navigation menu on a touch screen device
CN110196823A (en) * 2018-02-27 2019-09-03 爱思开海力士有限公司 Electronic device and its operating method
CN108681432A (en) * 2018-05-17 2018-10-19 Oppo广东移动通信有限公司 Processing method, device, storage medium and the electronic device of touch information

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
房俊龙;宋金龙;张馨;孙志佳;李文龙;: "通用智能灌溉施肥机控制器研发" *

Also Published As

Publication number Publication date
CN112803938B (en) 2023-04-07

Similar Documents

Publication Publication Date Title
US8543164B2 (en) Sleep method, wake method and mobile terminal device
US7996665B2 (en) Information processing device, power supply control method and storage medium
CN100359434C (en) Information processor, starting method thereof
CN102098182B (en) Method for restoring allocation of distributed equipment and distributed equipment
CN110908847A (en) Abnormity recovery method, system, electronic equipment and storage medium
CN102279787B (en) Method and device for testing average fault-free time
CN108829347A (en) A kind of hardware control, control method and the liquid crystal display of Nand equipment
CN103514024B (en) Quickly startup UI system and the quick start method of a kind of electrical equipment
CN111338698A (en) Method and system for accurately booting server by BIOS (basic input output System)
CN112803938B (en) Storage method and apparatus, switch apparatus, memory apparatus and readable storage medium
JP2005337017A (en) Electronic control device for vehicle
CN108490289B (en) Electronic equipment testing method and device and electronic equipment
CN108954702B (en) Control method and device of air conditioner, air conditioner and storage medium
CN109922014B (en) Method and system for judging cold and hot start of switch
CN113189907A (en) Vehicle-mounted system recovery method and device
WO2022028350A1 (en) Electronic device and method for controlling update of data in electronic device
US6163847A (en) Computer with automatic power cut-off function and control method therefor
CN107247642B (en) Method and device for determining executable mapping file during system startup
CN111522427A (en) Power supply control method of high-power-consumption satellite-borne storage system
CN112584085B (en) Dual-mode-supporting starting method and system, UVC (ultraviolet video coding) equipment and storage medium
CN113115417B (en) Wireless upgrading method and device for remote controller program, remote controller and electric appliance system
JP2002207537A (en) Computer system and selection method for system start mode
CN115576679B (en) Sensor control method and device, electronic equipment and storage medium
JP7385060B2 (en) How to search for disconnection device, slave device, master device and storage medium
JP5029123B2 (en) Electronic control device and communication system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant