CN107678344B - Switch linkage control method and device - Google Patents

Switch linkage control method and device Download PDF

Info

Publication number
CN107678344B
CN107678344B CN201710952558.3A CN201710952558A CN107678344B CN 107678344 B CN107678344 B CN 107678344B CN 201710952558 A CN201710952558 A CN 201710952558A CN 107678344 B CN107678344 B CN 107678344B
Authority
CN
China
Prior art keywords
linkage
key
switch
setting
touch
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.)
Active
Application number
CN201710952558.3A
Other languages
Chinese (zh)
Other versions
CN107678344A (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.)
Shenzhen Jinma Technology Co ltd
Original Assignee
Shenzhen Jinma 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 Shenzhen Jinma Technology Co ltd filed Critical Shenzhen Jinma Technology Co ltd
Priority to CN201710952558.3A priority Critical patent/CN107678344B/en
Publication of CN107678344A publication Critical patent/CN107678344A/en
Application granted granted Critical
Publication of CN107678344B publication Critical patent/CN107678344B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/042Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
    • G05B19/0423Input/output
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/20Pc systems
    • G05B2219/25Pc structure of the system
    • G05B2219/25257Microcontroller

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Selective Calling Equipment (AREA)
  • Programmable Controllers (AREA)

Abstract

The invention discloses a switch linkage control method and a device, wherein the touch operation of a switch key is monitored through the scanning of the switch key; when the touch operation of a switch key is monitored, judging the type of the key operation; if the key operation type is on-off operation, inquiring a linkage list to carry out on-off operation; and if the key operation type is linkage operation, performing corresponding linkage setting operation according to the linkage operation instruction. The invention adopts the power carrier communication technology to realize linkage operation among a plurality of switches, one control is more, more control is more, and the plurality of switches are synchronously controlled. The whole setting process is completed by all the combination keys without adopting a computer host, and the operation is simple and convenient, and is stable and reliable.

Description

Switch linkage control method and device
Technical Field
The invention relates to the technical field of switch linkage, in particular to a switch linkage control method and device.
Background
When the traditional switch realizes multi-connected mutual control, the wiring mode of the adopted switch is complex, a large amount of wiring needs to be conducted through the wall, the linkage function is single, the switch state cannot be displayed, and the like, so that inconvenience is brought to users.
Disclosure of Invention
The invention provides a switch linkage control method and device capable of saving a large amount of wiring.
In order to achieve the purpose, the invention provides a switch linkage control method, which comprises the following steps:
the touch operation of the switch keys is monitored through the switch key scanning;
when the touch operation of a switch key is monitored, judging the type of the key operation;
if the key operation type is on-off operation, inquiring a linkage list to carry out on-off operation;
and if the key operation type is linkage operation, performing corresponding linkage setting operation according to the linkage operation instruction.
Wherein, the step of scanning and monitoring the touch operation of the switch key by the switch key comprises the following steps:
scanning and monitoring a communication frame generated by touch operation of a switch key through the switch key; the communication frames include an invalid communication frame, a switch operation communication frame, and a linkage operation communication frame.
If the key operation type is a switch operation, the step of inquiring the linkage list to perform the switch operation comprises the following steps:
and if the key operation type is on-off operation, inquiring the linkage list to control the corresponding controlled key to execute corresponding on-off operation.
If the key operation type is linkage operation, the step of performing corresponding linkage setting operation according to the linkage operation instruction comprises the following steps:
if the key operation type is linkage operation, judging the type of the command of the linkage operation;
if the type of the linkage operation instruction is a linkage operation instruction, starting linkage operation, and setting the current touch key as a main control key;
monitoring the touch operation of the switch key again, if the duration time of the touch operation reaches the linkage operation adding time, setting the current touch key as a controlled key, and adding the key value into a linkage list;
and monitoring the touch operation of the switch key again, and if the duration time of the touch operation reaches the linkage confirmation operation time, confirming the main control key to complete the linkage setting operation.
And the linkage operation instruction outputs different key values according to the length of the key touch time, so that the switching action is realized, and a linked main control key, a controlled key and a confirmation key are arranged.
Wherein, if the key operation type is linkage operation, after the step of determining the type of the command of the linkage operation, the method further comprises:
and if the type of the linkage operation instruction is a linkage deletion operation instruction, selecting the key needing linkage deletion according to the linkage deletion operation instruction, and confirming that the key needing linkage deletion is completed.
Wherein, the linkage deleting operation instruction is as follows: and pressing the key for a preset time to enter a linkage deleting state, then releasing the key, and pressing for a long time again for confirmation.
Wherein, if the key operation type is linkage operation, after the step of determining the type of the command of the linkage operation, the method further comprises:
and if the type of the linkage operation instruction is a full-off key operation instruction, selecting the key needing full-off linkage according to the full-off key operation instruction, and confirming that the key needing full-off linkage is completed.
Wherein, the command of linkage operation is: and pressing the key for a preset time to enter a full-off setting state, then loosening the key, and pressing for a long time again for confirmation.
The invention proposes a switch-linked control device comprising a memory, a processor and a computer program stored on said memory, said computer program implementing the steps of the method as described above when run by said processor.
The switch linkage control method and the device provided by the invention adopt the power carrier communication technology to realize linkage operation among a plurality of switches, one control is more, more controls are more, and a plurality of switches are synchronously controlled. The whole setting process is completed by all the combination keys without adopting a computer host, and the operation is simple and convenient, and is stable and reliable.
Compared with the prior art, the method has the following characteristics:
1. the method can adopt a wireless radio frequency technology for communication, can also adopt a power carrier technology for communication, and recommends the adoption of the power carrier technology for communication, so that the method can easily penetrate through the wall, is not interfered by other wireless signals, and has no electromagnetic radiation.
2. The linkage is directly set through key operation, the linkage mutual control is set, and the operation is simple and convenient.
3. The idle keys can be increased and decreased through key setting for linkage mutual control of the switch.
4. The wiring mode of the switch is basically compatible with the wiring mode of the traditional switch, and compared with the wiring mode of the traditional switch, one more zero line needs to be arranged to the switch.
5. At most 6 buttons and 3 paths of output, multi-connected mutual control can be easily realized, and compared with the traditional multi-connected mutual control, a large amount of wiring can be saved.
Drawings
FIG. 1 is a schematic flow chart of a switch linkage control method according to a first embodiment of the present invention;
FIG. 2 is a schematic diagram of a system port initialization process of the present invention;
FIG. 3 is a schematic diagram of an initialization process of the power line carrier communication module according to the present invention;
FIG. 4 is a schematic view of a key scan thread according to the present invention;
FIG. 5 is a schematic diagram of a communication frame detection thread according to the present invention;
FIGS. 6 and 7 are schematic views of the set-up linkage operation of the present invention;
FIG. 8 is a schematic view of the delete linkage operation of the present invention;
FIG. 9 is a schematic view of the present invention setting full off operation;
FIG. 10 is a flow chart illustrating a specific process of setting the linkage operation according to the present invention;
FIG. 11 is a flowchart illustrating a specific process of communication frame monitoring according to the present invention;
FIG. 12 is a flowchart illustrating a specific process for deleting a linked operation according to the present invention;
FIG. 13 is a flow chart illustrating a specific process of setting the all-off operation according to the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Specifically, referring to fig. 1, fig. 1 is a switch linkage control method provided by the present invention, including the following steps:
step S101, scanning and monitoring touch operation of a switch key through the switch key;
the circuit structure related to the scheme of the invention comprises: the system comprises a main control singlechip, a power line carrier communication module, a key/LED/relay drive circuit and the like.
In the invention, any switch panel on the power grid can receive power carrier communication frames sent by other switch panels and analyze and process the frame content so as to realize the operation, setting, deletion, confirmation and the like of switch linkage.
After the initialization singlechip and the power carrier communication module are powered on and started, program management, a key scanning thread and a communication frame detection thread are performed in two threads. The two threads respectively complete key operation and communication frame analysis.
Firstly, the touch operation of the switch key is monitored through a key scanning thread and a communication frame detection thread. Specifically, a communication frame generated by touch operation of a switch key is scanned and monitored through the switch key; the communication frames include an invalid communication frame, a switch operation communication frame, and a linkage operation communication frame.
Step S102, judging the operation type of the key when the touch operation of the switch key is monitored;
when the touch operation of the switch key is monitored, whether the key operation type is switch operation, linkage operation or invalid operation is judged.
Step S103, if the key operation type is a switch operation, inquiring a linkage list to carry out the switch operation;
and step S104, if the key operation type is linkage operation, performing corresponding linkage setting operation according to the linkage operation instruction.
And if the key operation type is on-off operation, inquiring the linkage list to control the corresponding controlled key to execute corresponding on-off operation.
If the key operation type is linkage operation, judging the type of the command of the linkage operation;
if the type of the linkage operation instruction is a linkage operation instruction, starting linkage operation, and setting the current touch key as a main control key;
monitoring the touch operation of the switch key again, if the duration time of the touch operation reaches the linkage operation adding time, setting the current touch key as a controlled key, and adding the key value into a linkage list;
and monitoring the touch operation of the switch key again, and if the duration time of the touch operation reaches the linkage confirmation operation time, confirming the main control key to complete the linkage setting operation.
And the linkage operation instruction outputs different key values according to the length of the key touch time, so that the switching action is realized, and a linked main control key, a controlled key and a confirmation key are arranged.
And if the type of the linkage operation instruction is a linkage deletion operation instruction, selecting the key needing linkage deletion according to the linkage deletion operation instruction, and confirming that the key needing linkage deletion is completed.
Wherein, the linkage deleting operation instruction is as follows: and pressing the key for a preset time to enter a linkage deleting state, then releasing the key, and pressing for a long time again for confirmation.
And if the type of the linkage operation instruction is a full-off key operation instruction, selecting the key needing full-off linkage according to the full-off key operation instruction, and confirming that the key needing full-off linkage is completed.
Wherein, the command of linkage operation is: and pressing the key for a preset time to enter a full-off setting state, then loosening the key, and pressing for a long time again for confirmation.
The following details the embodiments of the present invention:
the invention adopts the common linked switch of the power carrier technology, mainly utilizes the power carrier communication technology to realize the linked operation among a plurality of switches, and the switches are controlled by one or more controls and by more controls and are synchronously controlled among the switches. The whole setting process is completed by all the combination keys without adopting a computer host, and the operation is simple and convenient, and is stable and reliable.
(1) Firstly, carrying out system initialization operation:
the method specifically comprises the following steps: the method mainly initializes the timer, the communication port (serial port), the key/LED/relay drive and other ports of the single chip microcomputer, as shown in FIG. 2; and initialization of the power carrier communication module, as shown in fig. 3.
(2) The specific treatment process comprises the following steps:
the specific processing flow is divided into two threads: after the initialization singlechip and the power carrier communication module are powered on and started, program management, a key scanning thread and a communication frame detection thread are performed in two threads. The two threads respectively complete key operation and communication frame analysis.
Wherein, the key scanning thread is as shown in fig. 4; the communication frame detection thread is shown in fig. 5.
The specific processing operation of the invention comprises: setting a linkage operation process, deleting the linkage operation process and setting a full-closed operation process.
Wherein, the process of setting the linkage operation is shown in fig. 6 and 7; the process of deleting the linkage operation is shown in fig. 8; the process of setting the all-off operation is shown in fig. 9.
Specifically, for setting the linkage operation, the function of setting the linkage operation realizes outputting different key values according to the length of the key touch time, thereby realizing the functions of switching, setting the linked main control key, setting the controlled key, confirming the key and the like. The specific processing flow is shown in fig. 10.
In communication frame monitoring, any switch panel on the power grid can receive power carrier communication frames sent by other switch panels. And the frame content is analyzed and processed to realize the operation, setting, deleting, confirming and the like of the switch linkage. The specific processing flow is shown in fig. 11.
For deleting linkage operation, in order to prevent misoperation of the keys, the deleting linkage operation needs to be carried out in two major steps, a long press is firstly carried out to enter a linkage deleting state, then the keys are released, and the long press is carried out again for confirmation. The specific processing flow is shown in fig. 12.
The method comprises the steps of setting a full-closed attribute, namely setting the full-closed attribute of a certain key, sending a closing signal by the key after the full-closed attribute is set so as to realize a full-closed function, setting the full-closed attribute in two steps in order to prevent misoperation of the key, entering a full-closed setting state by long pressing, then releasing the key, and confirming by long pressing again. The specific processing flow is shown in fig. 13.
The invention further provides a switch linkage control device, which comprises a memory, a processor and a computer program stored on the memory, wherein the computer program realizes the steps of the method of the embodiment when the computer program is executed by the processor.
Furthermore, the present invention also proposes a computer storage medium, which stores a computer program that, when executed by the processor, implements the steps of the method according to the above embodiment.
Compared with the prior art, the invention has the following characteristics:
1. the method can adopt a wireless radio frequency technology for communication, can also adopt a power carrier technology for communication, and recommends the adoption of the power carrier technology for communication, so that the method can easily penetrate through the wall, is not interfered by other wireless signals, and has no electromagnetic radiation. 2. The linkage is directly set through key operation, the linkage mutual control is set, and the operation is simple and convenient.
3. The idle keys can be increased and decreased through key setting for linkage mutual control of the switch.
4. The wiring mode of the switch is basically compatible with the wiring mode of the traditional switch, and compared with the wiring mode of the traditional switch, one more zero line needs to be arranged to the switch.
5. At most 6 buttons and 3 paths of output, multi-connected mutual control can be easily realized, and compared with the traditional multi-connected mutual control, a large amount of wiring can be saved.
The above description is only for the preferred embodiment of the present invention and is not intended to limit the scope of the present invention, and all equivalent structures or flow transformations made by the present specification and drawings, or applied directly or indirectly to other related arts, are included in the scope of the present invention.

Claims (7)

1. A switch linkage control method is characterized by comprising the following steps:
the touch operation of the switch keys is monitored through the switch key scanning;
when the touch operation of a switch key is monitored, judging the type of the key operation;
if the key operation type is on-off operation, inquiring a linkage list to carry out on-off operation;
if the key operation type is linkage operation, corresponding linkage setting operation is carried out according to the linkage operation instruction, wherein the type of the linkage setting operation instruction comprises the following steps: setting linkage operation, deleting linkage operation and setting all-off key operation, wherein the corresponding linkage setting operation according to the linkage operation instruction specifically comprises the following steps:
if the type of the linkage operation instruction is a linkage operation instruction, then the linkage operation is set, and the method specifically comprises the following steps:
set up the master control button, start linkage operation includes: the current touch key is touched and not released, if the duration time of the touch operation reaches the adding linkage operation time, the current touch key is set as a main control key, and the linkage operation is started, wherein the starting of the linkage operation comprises the starting of one-control-more operation and the starting of synchronous multi-control operation;
setting an additional controlled key, comprising: touching the key needing to be controlled not to be placed, if the duration time of the touch operation reaches the linkage operation adding time, setting the current touch key as the controlled key, and adding the key value into the linkage list;
confirm the master control button, accomplish linkage setting operation, include: the master control key is touched, if the duration time of the touch operation reaches the linkage confirmation operation time, the master control key is confirmed, and linkage setting operation is completed;
if the type of the linkage operation instruction is a linkage deletion operation instruction, selecting a key needing linkage deletion according to the linkage deletion operation instruction, and confirming that the key needing linkage deletion is completed;
and if the type of the linkage operation instruction is a full-off key operation instruction, selecting a key needing full-off linkage according to the full-off key operation instruction, confirming the full-off key setting operation, setting a full-off operation object as a key needing to be controlled by the full-off key, and confirming that the key needing full-off linkage is completed.
2. The switch linkage control method according to claim 1, wherein the step of monitoring the touch operation of the switch key by the switch key scanning includes:
scanning and monitoring a communication frame generated by touch operation of a switch key through the switch key; the communication frames include an invalid communication frame, a switch operation communication frame, and a linkage operation communication frame.
3. The switch linkage control method according to claim 1, wherein if the key operation type is a switch operation, the step of querying the linkage list for the switch operation comprises:
and if the key operation type is on-off operation, inquiring the linkage list to control the corresponding controlled key to execute corresponding on-off operation.
4. The switch linkage control method according to claim 1, wherein the linkage operation instruction outputs different key values according to the length of the key touch time, so as to realize the switch action, and a master control key, a controlled key and a confirmation key which are linked are arranged.
5. The switch linkage control method according to claim 1, wherein the linkage deletion operation command is: and pressing the key for a preset time to enter a linkage deleting state, then releasing the key, and pressing for a long time again for confirmation.
6. The switch linkage control method according to claim 1, wherein the command of the linkage operation is: and pressing the key for a preset time to enter a full-off setting state, then loosening the key, and pressing for a long time again for confirmation.
7. A switch-linkage control device, comprising a memory, a processor and a computer program stored on the memory, which computer program, when executed by the processor, carries out the steps of the method according to any one of claims 1 to 6.
CN201710952558.3A 2017-10-13 2017-10-13 Switch linkage control method and device Active CN107678344B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710952558.3A CN107678344B (en) 2017-10-13 2017-10-13 Switch linkage control method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710952558.3A CN107678344B (en) 2017-10-13 2017-10-13 Switch linkage control method and device

Publications (2)

Publication Number Publication Date
CN107678344A CN107678344A (en) 2018-02-09
CN107678344B true CN107678344B (en) 2020-09-11

Family

ID=61140820

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710952558.3A Active CN107678344B (en) 2017-10-13 2017-10-13 Switch linkage control method and device

Country Status (1)

Country Link
CN (1) CN107678344B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114496599B (en) * 2021-12-31 2023-09-01 绿碳智能建筑(杭州)有限公司 Intelligent switch and local linkage control method

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN202306291U (en) * 2011-10-26 2012-07-04 东莞市中凌电子科技有限公司 Intelligent control switch
CN103199871B (en) * 2013-02-26 2016-02-03 无锡飞翎电子有限公司 The control method that a kind of adaptation function controlling button is replaced
CN105022362B (en) * 2014-04-29 2018-10-16 奔马物联科技(横琴)有限公司 A kind of coordinated control system and inter-linked controlling method of smart home device
JP6132817B2 (en) * 2014-07-23 2017-05-24 株式会社ソニー・インタラクティブエンタテインメント Input device
CN105953371B (en) * 2016-05-18 2019-01-04 珠海格力电器股份有限公司 Multi-variable air conditioning unit and its communication control method and device
CN106184069A (en) * 2016-07-07 2016-12-07 苏州大学 Automotive electronics micro-controller communications method based on CAN LIN network
CN106444543A (en) * 2016-11-21 2017-02-22 重庆帅星科技有限公司 Method for wirelessly controlling low-voltage switch
CN106656145A (en) * 2017-03-08 2017-05-10 上海小燕科技有限公司 Switch device supporting various key modes
CN106950886A (en) * 2017-04-20 2017-07-14 上海紫光乐联物联网科技有限公司 Intelligent switch is long-range and local inter-linked controlling method
CN106935020A (en) * 2017-04-25 2017-07-07 福建省光速达物联网科技股份有限公司 A kind of intelligent switch and its control method for sensing coordinated signals

Also Published As

Publication number Publication date
CN107678344A (en) 2018-02-09

Similar Documents

Publication Publication Date Title
CN102799481B (en) Method and device for switching modes on terminal
CN101859198A (en) Remote controller with griping recognition function and method thereof
CN103019596B (en) A kind of method and mobile terminal realizing operation of virtual key based on touch screen
CN103067784A (en) Virtual key pressing method based on touch screen television and television
CN102681784A (en) Method and device for operating mobile terminal on basis of sensor, and mobile terminal
CN103517105A (en) Household electrical appliance control system, television set and control method
CN105739786A (en) Method and device for starting application program in screen-off state
CN104951078A (en) Method and system for waking up black screen through gestures
CN103257829B (en) Terminal control system and the method for nearest task is switched before and after under a kind of Android
CN111973077B (en) Sweeping method and device of sweeper, sweeper and storage medium
CN104735233A (en) Screen control method and device
CN109923511A (en) A kind of object processing method and terminal
CN111078108A (en) Screen display method and device, storage medium and mobile terminal
CN107678344B (en) Switch linkage control method and device
WO2022105447A1 (en) Iot device control method, apparatus, terminal, and storage medium
WO2015089993A1 (en) Terminal and method for realizing bulk operation under touchscreen
CN106598467A (en) Mobile terminal and screen control method and system thereof
CN103916545A (en) Status switching method and electronic device
CN107635146A (en) A kind of remote control system
CN105491242A (en) Mobile communication terminal, control method and control device thereof
CN204517795U (en) Have the composite push-button of page up and homepage function concurrently
CN103558922A (en) Key processing method, device and system
CN103825595B (en) Method and its circuit that intelligent control system of domestic electric appliances wakes up
CN104601909B (en) TV set control method, television set and intelligent home network
CN105451051A (en) Key remote control and method for controlling electronic device by use of key remote control

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