CN113517951A - Self-generating switch and processing method thereof, receiver and processing method thereof - Google Patents

Self-generating switch and processing method thereof, receiver and processing method thereof Download PDF

Info

Publication number
CN113517951A
CN113517951A CN202110531082.2A CN202110531082A CN113517951A CN 113517951 A CN113517951 A CN 113517951A CN 202110531082 A CN202110531082 A CN 202110531082A CN 113517951 A CN113517951 A CN 113517951A
Authority
CN
China
Prior art keywords
field
information
switch
current
identification
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
CN202110531082.2A
Other languages
Chinese (zh)
Other versions
CN113517951B (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.)
Wuhan Linptech Co Ltd
Original Assignee
Wuhan Linptech 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 Wuhan Linptech Co Ltd filed Critical Wuhan Linptech Co Ltd
Priority to CN202110531082.2A priority Critical patent/CN113517951B/en
Priority to CN202210668848.6A priority patent/CN115426112A/en
Publication of CN113517951A publication Critical patent/CN113517951A/en
Application granted granted Critical
Publication of CN113517951B publication Critical patent/CN113517951B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3247Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures
    • FMECHANICAL ENGINEERING; LIGHTING; HEATING; WEAPONS; BLASTING
    • F03MACHINES OR ENGINES FOR LIQUIDS; WIND, SPRING, OR WEIGHT MOTORS; PRODUCING MECHANICAL POWER OR A REACTIVE PROPULSIVE THRUST, NOT OTHERWISE PROVIDED FOR
    • F03GSPRING, WEIGHT, INERTIA OR LIKE MOTORS; MECHANICAL-POWER PRODUCING DEVICES OR MECHANISMS, NOT OTHERWISE PROVIDED FOR OR USING ENERGY SOURCES NOT OTHERWISE PROVIDED FOR
    • F03G1/00Spring motors
    • FMECHANICAL ENGINEERING; LIGHTING; HEATING; WEAPONS; BLASTING
    • F03MACHINES OR ENGINES FOR LIQUIDS; WIND, SPRING, OR WEIGHT MOTORS; PRODUCING MECHANICAL POWER OR A REACTIVE PROPULSIVE THRUST, NOT OTHERWISE PROVIDED FOR
    • F03GSPRING, WEIGHT, INERTIA OR LIKE MOTORS; MECHANICAL-POWER PRODUCING DEVICES OR MECHANISMS, NOT OTHERWISE PROVIDED FOR OR USING ENERGY SOURCES NOT OTHERWISE PROVIDED FOR
    • F03G5/00Devices for producing mechanical power from muscle energy
    • F03G5/06Devices for producing mechanical power from muscle energy other than of endless-walk type
    • F03G5/062Devices for producing mechanical power from muscle energy other than of endless-walk type driven by humans
    • F03G5/065Devices for producing mechanical power from muscle energy other than of endless-walk type driven by humans operated by the hand
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • H04L1/0056Systems characterized by the type of code used
    • H04L1/0061Error detection codes

Landscapes

  • Engineering & Computer Science (AREA)
  • Chemical & Material Sciences (AREA)
  • Combustion & Propulsion (AREA)
  • Mechanical Engineering (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Toxicology (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention provides a self-generating switch and a processing method thereof, a receiver and a processing method thereof, wherein the processing method of the self-generating switch comprises the following steps: acquiring current control information and a current verification identifier; the current control information comprises a key value, and the key value and the current verification identification are respectively filled into a key value field and a verification identification field of a payload part of the current control message; signing the filled information of the appointed field in the payload part to obtain current signature information, and filling the current signature information into the signature field of the payload part; the specified field is at least a partial field in the payload portion other than the signature field; sending the current control message to a receiving end so as to: and the receiving end extracts the information filled in the payload part, and executes a control event corresponding to the current control information after verifying that the current signature information and the current verification identifier both pass.

Description

Self-generating switch and processing method thereof, receiver and processing method thereof
Technical Field
The invention relates to the field of switches, in particular to a self-generating switch and a processing method thereof, and a receiver and a processing method thereof.
Background
A wireless switch is understood to be a switch configured with a wireless communication module, wherein one type of wireless switch is a self-generating switch, in a conventional self-generating switch, it is usually communicated with the outside through a radio frequency communication module, for example, the self-generating switch can communicate with various receiving terminals (such as lamps, wall switches, etc.) through radio frequency signals.
In the prior art, when the self-generating switch is controlled, a control message is sent out in response to the control of the self-generating switch, however, the content in the control message is relatively simple, and generally only information describing a key and a switch is contained, so that the requirement on safety cannot be met.
Disclosure of Invention
The invention provides a self-generating switch and a processing method thereof, and a receiver and a processing method thereof, and aims to solve the problem that the safety requirement cannot be met.
According to a first aspect of the present invention, there is provided a method of handling a self-generating switch, comprising:
acquiring current control information and a current verification identifier; the current manipulation information includes a key value characterizing at least one of: the self-generating switch receives the operated key currently; the self-generating switch is used for controlling the current operation and control action received by the key;
filling the key value and the current verification identification into a key value field and a verification identification field of a payload part of the current control message respectively;
signing the filled information of the appointed field in the payload part to obtain current signature information, and filling the current signature information into the signature field of the payload part; the specified field is at least a partial field in the payload portion other than the signature field;
sending the current control message to a receiving end so as to: and the receiving end extracts the information filled in the payload part, and executes a control event corresponding to the current control information after verifying that the current signature information and the current verification identifier both pass.
According to a second aspect of the present invention, there is provided a processing method at a receiving end, including:
receiving a current control message sent from a power generation switch;
acquiring information in a payload part of the current control message, wherein the acquired information in the payload part comprises current signature information, a current verification identifier and a key value in current control information; the current signature information is obtained after the spontaneous power generation switch signs the information filled in the designated field in the payload part, and the designated field is at least part of field except the signature field in the payload part;
the key value characterizes at least one of:
the self-generating switch receives the operated key currently;
the self-generating switch is used for controlling the current operation and control action received by the key;
and after the current signature information and the current verification identification are verified to pass, executing a control event corresponding to the current control information.
According to a third aspect of the present invention, there is provided a self-generating switch comprising:
the switch side acquisition module is used for acquiring current control information and a current verification identifier; the current manipulation information includes a key value characterizing at least one of: the self-generating switch receives the operated key currently; the self-generating switch is used for controlling the current operation and control action received by the key;
a filling module, configured to fill the key value and the current verification identifier into a key value field and a verification identifier field of a payload portion of a current control packet, respectively;
the signature module is used for signing the filled information of the specified field in the payload part to obtain current signature information, and filling the current signature information into the signature field of the payload part; the specified field is at least a partial field in the payload portion other than the signature field;
a sending module, configured to send the current control packet to a receiving end, so that: and the receiving end extracts the information filled in the payload part, and executes a control event corresponding to the current control information after verifying that the current signature information and the current verification identifier both pass.
According to a fourth aspect of the present invention, there is provided a receiving end, comprising:
the receiving module is used for receiving a current control message sent from the power generation switch;
a receiving side obtaining module, configured to obtain information in a payload portion of the current control packet, where the obtained information in the payload portion includes current signature information, a current verification identifier, and a key value in current control information; the current signature information is obtained after the spontaneous power generation switch signs the information filled in the designated field in the payload part, and the designated field is at least part of field except the signature field in the payload part;
the key value characterizes at least one of:
the self-generating switch receives the operated key currently;
the self-generating switch is used for controlling the current operation and control action received by the key;
and the execution module is used for executing the control event corresponding to the current control information after the current signature information and the current verification identifier are verified to pass.
According to a fifth aspect of the present invention, there is provided a control system comprising the self-generating switch provided in the third aspect and the receiver provided in the fourth aspect.
According to a sixth aspect of the present invention, there is provided a protocol processing method for an autonomous switch, comprising:
filling the lead code into a lead code field of the head of the current control message;
padding an access address into an access address field of the header; the access address field is concatenated after the preamble field;
padding broadcast parameters into a protocol data unit data header field of the header; the protocol data unit data head field is jointed behind the access address field;
filling address characteristic information into an address characteristic field of a physical address part of the current control message; the address characteristic field is concatenated after the protocol data unit data head field;
filling a switch identifier in the current control information into a field of the physical address part; the switch identification field of the physical address part is directly or indirectly connected behind the address characteristic field;
filling the length information of the target field into the length field of the payload part of the current control message; the target field comprises a switch identification field in the physical address part and the payload part; the length field is connected behind the switch identification field in the physical address part;
filling broadcast type information into a broadcast type field of the payload part, wherein the broadcast type field is connected behind the length field;
populating a device identification to a device identification field of the payload portion, the device identification field following the broadcast type field;
filling frame header control information into a frame header control field of the payload section, the frame header control field being concatenated after the equipment provider identification field;
filling a current verification identification into a verification identification field of the payload part, wherein the verification identification field is connected behind the frame header control field;
populating a switch type field of the payload portion with switch type information, the switch type field being directly or indirectly engaged after being engaged with the authentication identification field;
filling a key value field of the payload part with a key value in the current operation information, wherein the key value field is connected behind the switch type field, and the key value represents at least one of the following: the self-generating switch receives the operated key currently; the self-generating switch is used for controlling the current operation and control action received by the key;
signing the information filled in the appointed fields from the length field to the key value field in the effective load part to obtain current signature information, and filling the current signature information into the signature field of the effective load part; the signature field is concatenated after the key value field;
filling a CRC calculation value into a CRC field of a CRC part of the current control message; the CRC check part is connected with the signature field;
and sending the current control message to a receiving end.
According to a seventh aspect of the present invention, there is provided a protocol processing method at a receiving end, including:
receiving a current control message sent by a self-generating switch through the protocol processing method of claim 27;
acquiring a lead code from the lead code field and verifying that the lead code passes;
acquiring an access address from the access address field, and verifying that the access address passes;
acquiring the broadcast parameters from the data head field of the protocol data unit, and verifying that the broadcast parameters pass;
acquiring the address characteristic information from the address characteristic field, and verifying that the address characteristic information passes;
acquiring the switch identification from a switch identification field of the physical address part and/or the payload part;
acquiring the length information from the length field;
based on the length information, acquiring the broadcast type information from the broadcast type field, and verifying that the broadcast type information passes;
acquiring the equipment manufacturer identification from the equipment manufacturer identification field based on the length information, and verifying that the equipment manufacturer identification passes;
based on the length information, acquiring the frame header control information from the frame header control field, and verifying that the frame header control information passes;
based on the length information, acquiring the current verification identification from the verification identification field, and verifying that the current verification identification passes;
acquiring switch type information from the switch type field based on the length information, and verifying that the switch type information passes;
acquiring a key value in the current operation information from the key value field based on the length information;
acquiring the current signature information from the signature field based on the length information;
signing the acquired information from the length field to the appointed field of the key value field in the payload part to obtain reference signature information, and verifying that the current signature information passes by using the reference signature information; obtaining the CRC calculation value from the CRC field, and checking that the CRC calculation value passes;
and executing the control event corresponding to the current control information.
According to an eighth aspect of the present invention, there is provided a storage medium storing a program which, when executed by a processor, implements the method of the first, second, fifth, sixth aspects.
According to a ninth aspect of the present invention, there is provided an electronic device comprising a memory, a processor and a program stored in the memory and running on the processor, wherein the processor implements the method according to the first, second, fifth or sixth aspect when executing the program.
The spontaneous power generation switch and the processing method thereof, the receiver and the processing method thereof provided by the invention introduce the current verification identification in the verification identification field, further, the current verification identification can be used as one of the bases of message verification, meanwhile, the filled information of the appointed field in the payload part can be signed to obtain the current signature information, and further, the current signature information is used as the other base of message verification. The receiving end can execute the corresponding control event when the current signature information and the current verification identification are verified to pass, and the safety of the message is effectively guaranteed.
The anti-copy attack can be effectively prevented by using the verification identifier, and the counterfeiting attack can be effectively prevented by using the signature information.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a first schematic diagram of a control system according to an embodiment of the present invention;
FIG. 2 is a second schematic diagram of the control system according to an embodiment of the present invention;
fig. 3 is a schematic diagram of the construction of a self-generating switch according to an embodiment of the present invention;
FIG. 4 is a first schematic flow chart illustrating a method for processing the self-generating switch according to an embodiment of the present invention;
FIG. 5 is a flowchart illustrating step S301 according to an embodiment of the present invention;
FIG. 6 is a second schematic flow chart illustrating a method for processing the self-generating switch according to an embodiment of the present invention;
FIG. 7 is a third schematic flow chart illustrating a method for handling an autonomous switch in accordance with an embodiment of the present invention;
FIG. 8 is a fourth schematic flow chart illustrating a method for handling an auto-power-generating switch according to an embodiment of the present invention;
FIG. 9 is a diagram illustrating a data structure of a packet according to an embodiment of the present invention;
fig. 10 is a schematic diagram of a data structure of a packet in an embodiment of the present invention;
fig. 11 is a first flowchart illustrating a processing method of a receiving end according to an embodiment of the present invention;
fig. 12 is a second flowchart illustrating a processing method at the receiving end according to an embodiment of the present invention;
fig. 13 is a third schematic flowchart illustrating a processing method at the receiving end according to an embodiment of the present invention;
fig. 14 is a fourth schematic flowchart illustrating a processing method at the receiving end according to an embodiment of the present invention;
fig. 15 is a fifth flowchart illustrating a processing method at the receiving end according to an embodiment of the present invention;
FIG. 16 is a first flowchart illustrating a protocol processing method of the auto-power-generation switch according to an embodiment of the present invention;
FIG. 17 is a flowchart illustrating a protocol processing method of the auto-power-generation switch according to an embodiment of the invention;
fig. 18 is a first flowchart illustrating a protocol processing method at a receiving end according to an embodiment of the present invention;
fig. 19 is a flowchart illustrating a protocol processing method at a receiving end according to an embodiment of the present invention;
FIG. 20 is a schematic diagram of the program modules of the self-generating switch in accordance with an embodiment of the present invention;
FIG. 21 is a diagram illustrating program modules at a receiver according to an embodiment of the invention;
fig. 22 is a schematic configuration diagram of an electronic device in an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The technical solution of the present invention will be described in detail below with specific examples. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments.
Please refer to fig. 1, a self-generating switch 1 and a receiving terminal 2 are provided, and a self-generating switch and a receiving terminal are illustrated in the figure, in an actual control system, the number of the self-generating switches and the number of the receiving terminals can be multiple, and meanwhile, transmission of wireless signals can be realized between the self-generating switch 1 and the receiving terminal 2, and the wireless signals can be, for example, bluetooth, radio frequency, Wifi, and the like.
The receiving end 2 may be any controlled device capable of being controlled by a self-generating switch, or a device connected to the controlled device, and in a specific example, the receiving end 2 may be, for example, a wall switch, an electronic doorbell, a lamp, an automatic curtain, a fan, or the like. The controls it accepts may be, for example but not limited to:
controlling the receiving end or a device connected with the receiving end to enter a certain state; such as turning a wall switch on or off, turning a light on or off, ringing a doorbell, controlling a fan to start or stop rotating, automatic window shades to open or close, turning on or off a designated function at a receiving end, etc.;
controlling the receiving end or a device connected with the receiving end to switch between two states; for example, the on-off state of a wall-turning (switching) switch, the on-off state of a lamp, the on-off state of a fan, the on-off state of an automatic curtain, the on-off state of a function designated at a receiving end, and the like;
controlling the receiving end or a device connected with the receiving end to change working parameters; for example, adjusting the brightness of the lamp, adjusting the air volume of the fan, adjusting the opening degree of the curtain, etc.
According to the application field change of the self-generating switch 1, the specific content of control can be changed at will without departing from the scope of the embodiment of the invention.
Meanwhile, the following description of the control event may also be understood with reference to the above.
In the embodiment of the present invention, referring to fig. 2, the self-generating switch 1 includes a key 101, a generator 103, a switch circuit, a circuit board 114, and a reset component 102, where the switch circuit includes: a processor 108, a memory 107, a rectifying module 104, an energy storage module 105, a voltage output module 106, and a wireless communication module 109. The generator 103, the rectifying module 104, the energy storage module 105, the voltage output module 106, the processor 108 and the wireless communication module 109 are all connected to the circuit board.
The electrical connection referred to hereinafter may include a direct electrical connection and also include an indirect electrical connection.
The generator 103 is capable of generating electricity when the button 101 is manipulated (e.g., pressed and/or rebounded), and generating electric energy, which can be used to directly or indirectly power the processor 108, the wireless communication module 109, the memory 107, and the like, wherein the processor 108, the wireless communication module 109, and the memory 107 may be separate or integrated, and further, if integrated, then: the power supply to the processor 108, the wireless communication module 109 and the memory 107 can be realized based on the same power supply terminal.
The generator 103 may include a moving part 1031 and a sensing part 1032.
The moving part 1031 may be understood as a component or a combination of components that can be driven by at least one of a button and a reset component to move, and the sensing part 1032 may be understood as a component or a combination of components that can interact with the moving part 1031 to sense and generate electric energy when the moving part moves.
In a specific example, the generator 103 may include a permanent magnet portion, a magnetic conductive portion, and a coil portion, the coil portion may be disposed on the magnetic conductive portion, and the coil portion may generate an induced voltage when the permanent magnet portion and the magnetic conductive portion move relative to each other. The coil part can be regarded as the above mentioned induction part 1032, and the permanent magnet part or the magnetic conductive part can be regarded as the above mentioned movement part 1031, that is: in some examples, the permanent magnet part moves to directly and indirectly transmit with the key and the reset component, and in other examples, the magnetic conduction part moves to directly and indirectly transmit with the key and the reset component. It can be seen that the sensing part 1032 may or may not move with the moving part 1031.
The wireless communication module 109 and the memory 107 are electrically connected to the processor 108, the sensing portion 1032 of the generator 103 is electrically connected to the energy storage module 105 through the rectifying module 104, the energy storage module 105 is electrically connected to the wireless communication module 109, the processor 108 and the memory 107 (for example, connected to the wireless communication module 109, the processor 108 and a power supply terminal of the memory 107) through the voltage output module 106, the reset component 102 (for example, a torsion spring, a spring plate, a tension spring, etc.) can be in transmission with the motion portion 1031 of the generator 103, and the key 101 can also be in transmission with the motion portion 1031 of the generator directly or indirectly, that is: the key is directly or indirectly transmitted to the moving part of the generator, and the reset component is directly or indirectly transmitted to the moving part of the generator.
In some embodiments, the reset component 102 can be directly driven to the moving portion 1031, or in other embodiments, the reset component 102 can also be driven to a button or other component, so as to be indirectly driven to the moving portion 1031.
The reset device 102 is configured to: if the button 101 is pressed, then: deformation occurs and a reset acting force overcoming the deformation is generated; if the button 101 generates a rebounding operation, then: the moving part 1031 of the generator 103 is driven by the restoring force.
Furthermore, when the button 101 is pressed down, the movement portion 1031 can be driven to move in a first direction, the reset member 102 can be deformed when the movement portion 1031 moves in the first direction, and can generate a reset acting force to overcome the deformation, and after the acting force for pressing down the button 101 is removed, the reset member 102 can be driven by the reset acting force to move the movement portion 1031 in a second direction, and the button rebounds.
The generator 103 is configured to: if the button 101 is pressed, then: the moving part 1031 of the generator 103 is directly or indirectly driven by the key 101 to generate a first induced voltage in the induction part 1032 of the generator 103, and if the key 101 performs a rebounding manipulation operation, the moving part 1031 of the generator 103 is driven by the reset member 102 to generate a second induced voltage in the generator;
further, the sensing part 1032 is electrically connected to the rectifying module 104 to generate a first induced voltage when the movement part 1031 moves in the first direction, and to generate a second induced voltage when the movement part 1031 moves in the second direction.
The rectifying module 104 is configured to: storing a first electric energy corresponding to the first induced voltage and/or a second electric energy corresponding to the second induced voltage in the energy storage module 105; in a specific example, only the first electrical energy may be stored and/or used, and only the second electrical energy may be stored and/or used.
The energy storage module 105 is configured to: transmitting the stored electrical energy to the voltage output module 106;
the voltage output module 106 is configured to: the transmitted power (the first power and/or the second power) is used for providing a required power supply voltage for the processor 108, the memory 107 and the wireless communication module 109 to power up;
the processor 108 is configured to:
after the processor 108, the memory 107 and the wireless communication module 109 are powered on, a corresponding current control message is generated and sent to the receiving end 2 through the wireless communication module 109 (i.e. the message is sent out by the wireless communication module 109).
Wherein, if from the power generation switch be equipped with reset unit, then: the pressing operation can be the operation of pressing a key, and the rebounding operation can be the operation of removing the pressing action force to rebound the key.
Wherein the current control packet records current control information and the current verification identifier, so that: and the receiving terminal verifies whether the relationship between the current verification identification in the current control message and the stored historical verification identification is matched with a preset transformation rule of the current verification identification, and executes a control event corresponding to the current control information when the relationship is matched with the transformation rule, wherein the historical verification identification is determined according to the verification identification recorded in a control message or a pairing message which is sent to the receiving terminal before the self-generating switch.
The current steering information characterizes at least one of: the self-generating switch; the self-generating switch receives the operated key currently; and the self-generating switch controls the current received operation and control action of the keys.
It can be seen that, since the pressing operation and the rebounding operation are in a pair and continuous manner, rebounding usually occurs after pressing. Furthermore, in the above solution, the current verification identifier may be updated only after the pressing operation or the rebounding operation, or the current verification identifier may be updated only after the pressing operation or the rebounding operation.
In a specific example, the current control information may include a switch identifier, and then the switch identifier may be used to represent the self-generating switch, and the current control information may further include a key value, and then the key value is used to represent the key currently received by the self-generating switch and the control action currently received by the key in the self-generating switch.
The verification mark can be any character or combination of characters which can be suitable for realizing verification, the current verification mark can be understood as being currently sent by the self-generating switch, and the historical verification mark can be understood as being stored by a receiving end before the self-generating switch sends out.
In some examples, the historical verification identifier may be a current verification identifier that is sent to the receiving end (sent with the control message or the pairing message) and stored by the receiving end when the self-power switch has performed the last operation, or determined according to the current verification identifier, and in other examples, the historical verification identifier may also be a current verification identifier that is sent to the receiving end (sent with the control message or the pairing message) and stored by the receiving end when the self-power switch has performed the last specific operation (for example, the operation of pressing down or the operation of rebounding) or determined according to the current verification identifier.
Since the verification identifier is a specific numerical value, the verification identifier can also be described as a serial number, and further, in the example of the embodiment of the present invention, the description of the serial number can be regarded as the description of the verification identifier.
The wireless communication module 109 may be any circuit module capable of implementing wireless communication, and may include at least one of the following: radio frequency module, bluetooth module, Wifi module etc..
In one embodiment, please refer to fig. 3, the self-generating switch 1 further includes a polarity identification module 111; the polarity identification module 111 electrically connects the generator 103 (e.g., its sensing portion 1032) with the processor 108.
The polarity recognition module 111 is electrically connected between the sensing portion 1032 and the processor 108, and configured to feed back a press recognition signal to the processor 108 when the sensing portion 1032 outputs the first sensing voltage, and feed back a rebound recognition signal to the processor 108 when the sensing portion 1032 detects that the second sensing voltage is output.
After the processor, the memory, and the wireless communication module are powered on, the processor 108 is further configured to: the current control action of the key is identified through the polarity identification module 111, and the current control action is determined as a target control, wherein the target control is a designated one of a pressing control action and a rebounding control action.
It can be seen that in the above scheme, a scheme of "the transformation of the authentication identity occurs only after one complete press and rebound" is implemented.
In one embodiment, please refer to fig. 3, the self-generating switch 1 further includes a key identification module 110, and the key identification module 110 is electrically connected to the processor 108;
the processor 108, prior to generating the current control message, may be further configured to:
reading a switch identification characterizing the self-generating switch from the memory;
if the current operation is the operation of pressing down: acquiring current key information through the key identification module, and updating the current key information in the memory;
if the current operation is the springback operation, then: obtaining the stored current key information from the memory;
the current control information is determined based on the switch identifier, the currently generated control action, and the obtained current key information, for example, the switch identifier may be written into the current control packet, or a key value may be determined based on the control action and the current key information, and the key value may be written into the current control packet.
Based on the above description, the processing method and the protocol processing method provided in the embodiments of the present invention may describe the generation, transmission, reception, and processing processes of the current control packet.
Referring to fig. 4, the processing method of the self-generating switch includes:
s301: acquiring current control information and a current verification identifier;
the current manipulation information includes a key value characterizing at least one of: the self-generating switch receives the operated key currently; the self-generating switch is used for controlling the current operation and control action received by the key;
s302: filling the key value and the current verification identification into a key value field and a verification identification field of a payload part of the current control message respectively;
the PayLoad section may refer to "PayLoad" shown in fig. 9 and 10, which may adopt an AD Structure, and the key value field may refer to "key value" shown in fig. 9 and 10; the authentication identification field may refer to a "serial number" shown in fig. 9 and 10; the length of the key value field can be 1 byte, and the length of the verification identification field can be 4 bytes;
s303: signing the filled information of the appointed field in the payload part to obtain current signature information, and filling the current signature information into the signature field of the payload part;
the specified field is at least a partial field in the payload portion other than the signature field; for example, the fields from the length field to the front of the signature field in the payload section; the signature field may refer to "signature" shown in fig. 9 and 10; the signature field may be, for example, 4 bytes in length.
S304: sending the current control message to a receiving end;
through step S304, it is possible to cause: and the receiving end extracts the information filled in the payload part, and executes a control event corresponding to the current control information after verifying that the current signature information and the current verification identifier both pass.
In one embodiment, the process of signing the filled information of the specified field in the payload part in step S303 to obtain current signature information may specifically include:
signing the filled information of the appointed field by using a first key to obtain the current signature information;
the current signature information can be verified based on reference signature information obtained by the receiver re-signing the information filled in the designated field with a second key, where the second key is matched with the first key.
The key can be fixed and unchangeable, and can also be refreshed and changed by a certain method, and the self-generating switch and the receiving end are resynchronized after the refreshing and changing. For example: the key can be changed based on the function value with time as an independent variable, and the function relation corresponding to the first key is matched with the function relation corresponding to the second key.
In a specific example, the key may be a secret string of data, wherein the signature information may be calculated by a predetermined algorithm (e.g., AES algorithm) after combining the plaintext and the key. The plaintext may, for example, control at least part of the content of the message, which may contain the authentication identifier but no signature.
For example: at the self-generating switch, the processor can utilize a first secret key to encrypt the contents of the fields except the signature field in the payload part of the current control message to be sent, so as to obtain signature information, at the receiving end, the receiving end can utilize a second secret key to encrypt the contents of the fields except the signature field in the payload part of the received current control message, so as to obtain the signature information, and the receiving end can utilize the calculated signature information to verify the signature information recorded in the current control message.
In addition, the first key and the second key may be the same, and in other examples, the two keys may also be different.
The anti-counterfeiting function can be realized through the signature information, and the safety is guaranteed.
In one embodiment, referring to fig. 5, step S301 may specifically include:
s3011: whether the current manipulation is received;
if the determination result in step S3011 is yes, step S3012 may be implemented: generating the current manipulation information in response to a current manipulation for the self-generating switch;
if the determination result in step S3011 is no, it may return to step S3011;
s3013: reading the stored current authentication identification;
s3014: whether the current manipulation belongs to a target manipulation;
if the determination result in step S3014 is yes, step S3015 may be implemented: converting the current verification identifier from a first value to a second value according to a preset conversion rule, wherein the first value is different from the second value; the target maneuver includes a press maneuver and/or a rebound maneuver. In a specific example, the target manipulation may be determined by one of pressing and rebounding.
If the determination result in step S3014 is no, the process may return to step S3011.
The scheme of 'the change of the verification identifier only occurs after one complete press and rebound' can also play a role in saving electric energy. For example: if the sequence number (i.e. the current authentication identity) is updated only at the time of the rebound: when the serial number is pressed down, the serial number (namely the current verification identifier) does not need to be updated, and especially the energy consumption for writing the updated serial number into the memory can be saved.
Moreover, when the sequence numbers (namely the current verification identifiers) corresponding to the pressed control actions and the rebounded control actions are the same, the receiving end can be simpler to perform message deduplication according to the sequence numbers.
In a further example, the target manipulation is a rebound manipulation, and in other examples, the target manipulation may also be a press manipulation.
When a user presses a key of the self-generating switch, the user usually wants to obtain feedback of the control effect immediately. Furthermore, if the sequence number is updated only during rebound (i.e. the target maneuver is a maneuver that rebounds), all of the power during the depression can be used for other tasks, in particular to send a signal, without expending power to update the sequence number.
In one embodiment, the transformation rule includes at least one of:
accumulating a first reference value on the basis of said first value to obtain said second value;
subtracting a second reference value from the first value to obtain a second value;
multiplying a third reference value by the first value to obtain the second value;
dividing the first value by a fourth reference value to obtain the second value.
The accumulation, subtraction, multiplication, division and the like can be calculated by adopting decimal calculation and can also be calculated by adopting binary system or other binary systems. The first, second, third and fourth reference values may be fixed values or variable values, and their signs are usually the same and are not zero, e.g. positive numbers.
Taking the accumulated first reference value as an example, the first reference value used for accumulation may be a positive number that varies within a certain range, and further for example, the accumulated value may vary regularly, for example: if the cycle changes from accumulation 1, accumulation 2, and accumulation 3, then: the k-th transformation is realized by accumulating 1, the k + 1-th transformation is realized by accumulating 2, the k + 2-th transformation is realized by accumulating 3, and the k + 3-th transformation is realized by accumulating 1 again.
Corresponding to the above various cases, the processing method at the receiving end may include:
if the transformation rule is: accumulating a first reference value on the basis of said first value to obtain said second value, then: when the receiving end verifies whether the current verification identification is matched with the historical verification identification, the receiving end can verify whether the current verification identification is larger than the historical verification identification, or: verifying whether the current verification identification is larger than the historical verification identification or not, wherein the difference value of the current verification identification and the historical verification identification is matched with the first reference value;
if the transformation rule is: subtracting a second reference value from the first value to obtain a second value; then: when the receiving end verifies whether the current verification identification is matched with the historical verification identification, the receiving end can verify whether the current verification identification is smaller than the historical verification identification, or: verifying whether the current verification identification is smaller than the historical verification identification or not, wherein the difference value of the current verification identification and the historical verification identification is matched with the second reference value;
if the transformation rule is: multiplying a third reference value by the first value to obtain the second value; then: when the receiving end verifies whether the current verification identification is matched with the historical verification identification, the receiving end can verify whether the current verification identification is larger than the historical verification identification, or: verifying whether the current verification identification is larger than the historical verification identification or not, wherein the ratio of the current verification identification to the historical verification identification is matched with the third reference value;
if the transformation rule is: dividing said first value by a fourth reference value to obtain said second value; then: when the receiving end verifies whether the current verification identification is matched with the historical verification identification, whether the current verification identification is smaller than the historical verification identification can be verified, or: and verifying whether the current verification identification is smaller than the historical verification identification or not, wherein the ratio of the current verification identification to the historical verification identification is matched with the fourth reference value.
In the above scheme, by comparing the difference value with the first numerical value and the second numerical value and comparing the ratio value with the third numerical value and the fourth numerical value, it can be verified whether the comparison between the current verification identifier and the historical verification identifier is increased or decreased, and the change amplitude can also be verified, so that an attacker can perform exhaustive attack by using the numerical value which is larger (or smaller) than the current numerical value, and the security is further improved.
The difference value is matched with the first reference value and the second reference value, which can be understood as the same value, or the difference value is smaller than a certain threshold value, and the ratio value is matched with the third reference value and the fourth reference value, which can be understood as the same value, or the difference value is smaller than a certain threshold value.
In a specific example, the self-generating switch carries a serial number (i.e., a verification identifier), the serial number is automatically increased (or decreased) when the switch is pressed each time, and the serial number is automatically increased once after a complete press and rebound operation; the message carries information representing pressing/bouncing (it can be understood that the control information can represent control action).
Specifically, the self-generating switch rebounds after being pressed down each time, and the generator operates to generate electricity when being pressed down and rebounded, so that power is supplied to a back-end circuit (such as a processor, a wireless communication module, a memory and the like). The back-end circuit can identify whether the control action is a pressing control action or a rebounding control action through the polarity identification module.
If the control action is a pressing action, the serial number (namely the stored verification identification) is read from the memory, then the serial number is increased by itself (which can be understood as the transformation), and then the key information is read to generate the control message. And writing the serial number and the key information back to the memory, reading the serial number and the key information when the serial number and the key information are rebounded, and then sending the message. The order of writing back the memory and sending the message can be interchanged.
If the control is the rebound control, the serial number is directly read from the memory without self-increment (namely, the conversion is not needed to be implemented), and the key information is also directly read from the memory (rather than reading the feedback signal of the switching device).
To facilitate the description of the role of signature information and authentication identifiers (e.g., serial numbers), several concepts are first cleaned up as follows:
copy attack:
it can be understood that: an attacker first captures a message of a legal switch and then sends the message out without moving the message. By verifying the use of the identification, it is possible to effectively protect against copying attacks, such as: the receiving end stores the serial number (i.e. the verification identifier) of the last received message, and after receiving a new message, the receiving end continues to check the serial number even if the signature information is verified to be legal: the disallowed sequence number is the sequence number that has been received before the press or bounce, but is a sequence number that is larger than before and falls within a window (all, or a sliding window large enough).
Forgery attack:
it can be understood that: the attacker can operate a real device (e.g., an autonomous switch) that can issue a control message and then actively add 1 to the serial number (if the serial number is plaintext) to reconstruct the message.
Through the signature information, forgery attacks can be effectively prevented, and the signature information is calculated by the key according to the previous message content (if the serial number is plaintext). The self-generating switch is encrypted by a key, the receiving end calculates once by the key, and if the key is obtained, the message of the transmitting end is considered to be legal.
When using the authentication identification (e.g., serial number) and signature information, it may be possible, for example:
in the pairing process, the receiving end and the self-generating switch synchronize serial numbers; the serial number can not be verified in the pairing process, and the signature information can still be verified, namely the pairing process only considers anti-counterfeiting and does not consider anti-copying. Of course, the signature information can be verified;
in normal operation, on the one hand, the signature information is verified, and on the other hand, the serial number is verified, and only the verification is allowed to be larger (or smaller) than the previous serial number. If further strict verification is to be performed, the sequence number is required to be larger than the previous sequence number and to fall within a window (which may be embodied as, for example, the aforementioned first reference value, second reference value, third reference value, fourth reference value). Window-based verification can effectively cope with exhaustive attacks, such as: an attacker can perform an exhaustive attack with a sequence number larger than the current sequence number if no window is required.
In one embodiment, the authentication identifier (e.g., sequence number) itself is also converted before transmission, and an attacker cannot obtain the current sequence number. And further: the current verification identifier recorded in the current control message is a converted current verification identifier, wherein the conversion mode is a first data conversion mode, namely: the current verification identifier recorded in the current control message is the current verification identifier converted by the first data conversion mode;
the current verification identifier verified by the receiving end is obtained by reversely converting the converted current verification identifier, wherein the reverse conversion mode is a second data conversion mode, and the first data conversion mode and the second data conversion mode are opposite data conversion modes, that is: the current verification identification verified by the receiving end is obtained by carrying out reverse conversion on the converted current verification identification in a second data conversion mode.
The first data conversion method and the second data conversion method are opposite conversion methods, and any conversion method is adopted without departing from the scope of the embodiment of the invention.
In one embodiment, referring to fig. 6, before step S303, the method may further include:
s308: filling a signature encryption indication into an encryption indication field of a frame header control field of the payload section;
and further may be such that: the receiving end calculates the reference signature information when the encryption indication field is filled with the signature encryption indication, and verifies the current signature information by using the reference signature information; the signature encryption indication characterizes the inclusion of the current signature information in the payload portion.
The frame header control field can be understood by referring to the "frame header control word" shown in fig. 9 and 10, and the encryption indication field can be understood by referring to the "encryption type" shown in fig. 9 and 10. Further, the signed encryption indication may be, for example, a 0, and if other encryption types are used, the encryption indication field may be filled with the non-signed encryption indication (e.g., a 1). It can be seen that the length of the encryption indication field is 1 bit.
In one embodiment, the current operation information further includes a switch identifier characterizing the self-generating switch;
referring to fig. 6, before step S304, the method further includes:
s306: and acquiring the switch identifier, and filling the switch identifier into a switch identifier field of a physical address part of the current control message.
The physical address part can be understood with reference to "MAC" in fig. 9 and 10, and the switch identification field in the physical address part can be understood with reference to "MAC L" in fig. 9 and 10. The switch identifier can also be expressed as Source ID, furthermore, in the message, 4 bytes in the physical address part are used for expressing the Source ID of the self-generating switch, the inside of the payload part can also contain the switch identifier, or the switch identifier can not be additionally contained, and if the switch identifier is not contained, the length of the message is reduced as much as possible, and the electric quantity is saved;
in one embodiment, referring to fig. 6, before step S303, the method further includes:
s307: and determining length information of a target field, and filling the length information into the length field of the payload part.
The target field comprises the payload portion, and the payload portion is connected behind the switch identification field of the physical address portion; further, based on the length information, it is possible to provide a basis for extraction of information in the payload section.
The length field may be, for example, one byte, as understood by referring to "length" shown in fig. 9 and 10.
In one embodiment, before step S303, the method may further include:
s309: filling a specified switch identification indication into a switch identification indication field of a frame header control field of the payload part;
the specified switch identification indicates whether the payload part is filled with the switch identification. The designated switch identification indication may be, for example: characterizing the first switch identification indication in the payload section filled with switch identifications, may for example also be: a second switch identification indication characterizing an unfilled switch identification in the payload section.
The switch identification indication field may be, for example, the "ID type" shown in fig. 9 and 10, and the length thereof may be one bit, the first switch identification indication may be, for example, 1, and the second switch identification indication may be, for example, 0. Further, when the second switch flag indication is filled, as shown in fig. 9, the switch flag does not need to be filled in the payload section, and when the first switch flag indication is filled, as shown in fig. 10, the switch flag may be filled in the payload section.
Further, the length of the switch identification field of the payload section, the content of padding can be understood with reference to the switch identification field of the physical address section.
Furthermore, if the specified switch identifier indication is a first switch identifier indication, then: referring to fig. 8, before step S303, the method may further include:
s314: populating the switch identification in a switch identification field in the payload section.
The switch identification field in the payload section may be, for example, "Source ID" in the payload section shown in fig. 10.
In one embodiment, referring to fig. 7, before step S304, the method may further include:
s311: acquiring set version number information, broadcast type information, equipment manufacturer identification and switch type information;
s312: filling the version number information into a version number field of a frame header control field in the payload part;
s313: and filling the broadcast type information, the equipment manufacturer identification and the switch type information into a broadcast type field, an equipment manufacturer identification field and a switch type field in the payload part respectively.
The broadcast type field may refer to the "AD type" shown in fig. 9 and 10, and may have a length of 1 byte;
the device identifier field may refer to a "device identifier ID" shown in fig. 9 and 10, and further, the device identifier may also be characterized as a device identifier ID, which may be any information capable of characterizing a device provider, and the length of the device identifier field may be, for example, 2 bytes;
the switch type field may refer to "switch type" shown in fig. 9 and 10, where the described switch types may include a single-key switch type, a double-key switch type, and a triple-key switch type, and in other examples, the classification manner of the switch types may not be limited to the number of keys, and the length of the switch type field may be, for example, 1 byte.
In one embodiment, before step S304, the method may further include:
s305: acquiring a set lead code, an access address and a broadcast parameter, and filling the lead code, the access address and the broadcast parameter into a lead code field, an access address field and a protocol data unit data head field of the head of the current control message;
in the current control message, the header portion is followed by a physical address portion, and the physical address portion is followed by the payload portion.
The Preamble field may refer to "Preamble" shown in fig. 9 and 10, the Access Address field may refer to "Access Address" shown in fig. 9 and 10, the Header field of the protocol data unit may refer to "PDU Header" shown in fig. 9 and 10, and the length of the Header field may be 2 bytes.
In one embodiment, referring to fig. 6, before step S304, the method may further include:
s310: acquiring a CRC calculation value, and filling the CRC calculation value into a CRC field of a CRC part of the current control message;
the CRC check portion is concatenated with the payload portion.
The CRC check portion and the CRC field may be, for example, "CRC" as shown in fig. 9 and 10, and the length of the CRC field may be, for example, 3 bytes.
Corresponding to the above processing method of the self-power-generation switch, the embodiment of the invention further provides a processing method of a receiving end, wherein the related terms, technical effects and the like can be understood by referring to the related description.
Referring to fig. 11, the processing method of the receiving end includes:
s401: receiving a current control message sent from a power generation switch;
s402: acquiring information in a payload part of the current control message;
the acquired information in the payload part comprises current signature information, a current verification identifier and a key value in current control information; the current signature information is obtained after the spontaneous power generation switch signs the information filled in the designated field in the payload part, and the designated field is at least part of field except the signature field in the payload part;
the key value characterizes at least one of:
the self-generating switch receives the operated key currently;
the self-generating switch is used for controlling the current operation and control action received by the key;
s403: whether the current signature information is verified to pass;
s404: whether the current signature information is verified to pass;
if the determination results in steps S403 and S404 are yes, then: if the current signature information and the current verification identifier are both verified to pass, step S405 may be implemented: executing a control event corresponding to the current control information;
if at least one of the steps S403 and S404 is determined to be negative, step S406 may be performed: and discarding the current control message.
The discarding of the current control packet may be understood as not processing based on the current control packet, for example: and the control event corresponding to the current control message is not executed, and the information such as the historical verification identifier and the like is not updated and changed based on the current control message.
In one embodiment, the current signature information is obtained by the self-generating switch after signing by using a first key;
correspondingly, referring to fig. 12, verifying that the current signature information passes includes:
s408: signing the information filled in the appointed field in the payload part again by using a second key, and calculating reference signature information; the second key matches the first key;
s409: determining that the current signature information matches the reference signature information.
Further, before step S408, the method may further include:
s407: and determining that an encryption indication field of a frame header control field of the payload part is filled with a signature encryption indication, wherein the signature encryption indication indicates that the current signature information is contained in the payload part.
In one embodiment, the current operation information further includes a switch identifier characterizing the self-generating switch;
referring to fig. 13, after step S401, the method may further include:
s411: and acquiring the switch identification filled in the switch identification field of the physical address part in the current control message.
Further, the information in the acquired payload portion further includes:
the length information filled in the length field of the payload part is obtained based on the length information, the length information is the length information of a target field, the target field comprises the payload part, and the payload part is connected behind a physical address part.
Further, the information in the acquired payload portion further includes:
version number information filled in a version number field of a frame header control field in the payload section
Broadcast type information populated by a broadcast type field in the payload section;
an equipment identity populated by an equipment identity field in the payload section;
switch type information populated by a switch type field in the payload section.
In one embodiment, referring to fig. 13, before step S411, the method may further include:
s410: acquiring information in a header of the current control message;
the information in the acquired header includes:
a preamble padded to a preamble field of the header;
an access address populated into an access address field of the header;
and filling the broadcast parameters into the data head field of the protocol data unit of the header.
In one embodiment, referring to fig. 14, after step S401, the method further includes:
s412: acquiring a CRC calculation value filled in a CRC field of a CRC part of the current control message;
s413: and checking the CRC calculation value.
In one embodiment, referring to fig. 15, after step S401, the method further includes:
s414: and when the switch identification indication field of the frame header control field of the effective load part is filled with a first switch identification indication, responding to the first switch identification indication, and acquiring the switch identification filled in the switch identification field of the effective load part.
The following also provides a protocol processing method of the self-generating switch, which can be understood as a specific example of the above processing method of the self-generating switch.
Referring to fig. 16, the protocol processing method of the self-powered switch includes:
s501: filling the lead code into a lead code field of the head of the current control message;
for example, the Preamble can be padded to the field characterized by "Preamble" shown in fig. 9 and 10 (i.e. Preamble field); the preamble code can be stored in a memory of the self-generating switch, and the processor of the self-generating switch can extract the preamble code from the memory;
s502: padding an access address into an access address field of the header;
the access address field is concatenated after the preamble field; for example, the Access Address may be filled into a field (i.e. an Access Address field) represented by "Access Address" shown in fig. 9 and 10; the access address can be stored in a memory of the self-generating switch, and then the processor of the self-generating switch can extract the access address from the memory;
s503: padding broadcast parameters into a protocol data unit data header field of the header;
the protocol data unit data head field is jointed behind the access address field; for example, the broadcast parameter may be filled into a field (i.e. a protocol data unit data Header field) represented by "PDU Header" shown in fig. 9 and 10, and the broadcast parameter may be stored in a memory of the autonomous switch, and then the processor of the autonomous switch may extract the broadcast parameter therefrom;
s504: filling address characteristic information into an address characteristic field of a physical address part of the current control message;
the address characteristic field is concatenated after the protocol data unit data head field; the address characteristic field may be, for example, a most significant field of the physical address part, and the address characteristic information may be filled in a field (i.e., an address characteristic field) characterized by "MAC H" shown in fig. 9 and 10, and the address characteristic information may be, for example, address characteristic information characterizing a static address, and specifically, two most significant 1 s may be used to characterize the static address; the address characteristic information can be stored in a memory of the self-generating switch, and then the processor of the self-generating switch can extract the address characteristic information from the address characteristic information;
s505: filling a switch identifier in the current control information into a field of the physical address part;
the switch identification field of the physical address part is directly or indirectly connected behind the address characteristic field; in addition, any character padding (for example, 0 may be padded) may be employed between the address characteristic field and the switch identification field of the physical address section; the switch identifier may be filled in a field (i.e. a switch identifier field) represented by "MAC L" shown in fig. 9 and 10; the switch identifier can be stored in a memory of the self-generating switch, and then a processor of the self-generating switch can extract the switch identifier from the memory;
s506: filling the length information of the target field into the length field of the payload part of the current control message;
the target field comprises a switch identification field in the physical address part and the payload part; the length field is connected behind the switch identification field in the physical address part; the length information can be filled into the field (i.e. length field) represented by the "length" shown in fig. 9 and 10; the length information can be stored in a memory of the self-generating switch, and then the processor of the self-generating switch can extract the length information from the memory;
s507: padding broadcast type information into a broadcast type field of the payload part;
the broadcast type field is concatenated after the length field; the broadcast type information may be filled into a field (i.e., broadcast type field) characterized by "AD type" shown in fig. 9 and 10; the broadcast type information can be stored in a memory of the self-generating switch, and then the processor of the self-generating switch can extract the broadcast type information from the memory;
s508: populating an equipment identifier to an equipment identifier field of the payload section;
the device brand identification field is concatenated after the broadcast type field; the device identifier may be populated into a field (i.e., a device identifier field) characterized by the "device ID" shown in fig. 9 and 10; the equipment mark can be stored in a memory of the self-generating switch, and then a processor of the self-generating switch can extract the equipment mark;
s509: filling frame header control information into a frame header control field of the payload section;
the frame header control field is connected behind the equipment provider identification field; the frame header control information may be filled into the field (i.e. the frame header control field) represented by the "frame header control word" shown in fig. 9 and 10; the frame header control information can be stored in a memory of the self-generating switch, and then a processor of the self-generating switch can extract the frame header control information from the memory;
s510: padding a current authentication identifier into an authentication identifier field of the payload section;
the verification identification field is connected behind the frame header control field; the current authentication identifier (i.e. serial number) may be populated into a field (i.e. authentication identifier field) characterized by the "serial number" shown in fig. 9 and 10; the current verification flag may be updated based on the transformation rule mentioned above, or may be obtained and filled based on the obtaining manner mentioned above;
s511: padding switch type information into a switch type field of the payload section;
the switch type field is directly or indirectly connected behind the verification identification field; the switch type information may be filled in a field (i.e. a switch type field) represented by "switch type" shown in fig. 9 and 10; the switch type information can be stored in a memory of the self-generating switch, and then the processor of the self-generating switch can extract the switch type information from the memory;
s512: filling a key value in the current control information into a key value field of the payload part;
after the key value field is concatenated with the switch type field, the key value characterizes at least one of: the self-generating switch receives the operated key currently; the self-generating switch is used for controlling the current operation and control action received by the key; the key value can be filled into the field (namely, the key value field) characterized by the key value shown in fig. 9 and 10; the key value may be generated based on the aforementioned manner;
s513: signing the information filled in the appointed fields from the length field to the key value field in the effective load part to obtain current signature information, and filling the current signature information into the signature field of the effective load part;
the signature field is concatenated after the key value field; the signature information may be filled into the field (i.e. signature field) characterized by the "signature" shown in fig. 9 and 10, and the calculation process of the signature information can be understood by referring to the related description above;
s514: filling a CRC calculation value into a CRC field of a CRC part of the current control message;
after the CRC check part is connected to the signature field, the CRC calculation value may be filled in the field represented by "CRC" shown in fig. 9 and 10 (i.e. the CRC check part, i.e. the CRC field therein), and the CRC calculation value may be any value calculated based on the CRC calculation principle;
s515: and sending the current control message to a receiving end.
In one embodiment, step S509 may include:
s5091: filling version number information into a version number field of a frame header control field of the payload part;
the version number field is connected behind the equipment manufacturer identification field; the version number information may be filled in a field (i.e., a version number field) represented by the "version number" shown in fig. 9 and 10, and the version number information may be stored in a memory of the self-generating switch, and then the processor of the self-generating switch may extract the version number information therefrom;
s5092: filling a signature encryption indication into an encryption indication field of the frame header control field;
the encryption indication field is concatenated with the version number field; the signature encryption indication may be filled in the field represented by "encryption" shown in fig. 9 and 10 (i.e., the encryption indication field), and may be generated in a manner understood by referring to the related description above, or may be pre-stored in the memory, and the processor of the power-generating switch may extract the signature encryption indication therefrom;
s5093: filling the specified switch identification indication into the switch identification indication field of the frame header control field;
the switch identification indication field is connected with the encryption indication field; the specified switch identification indication characterizes whether a switch identification is contained in the payload section; the specified switch identification indication may be filled in a field (i.e. a switch identification indication field) represented by "ID" shown in fig. 9 and 10, and the generation manner thereof can be understood with reference to the related description above, or may be pre-stored in the memory, so that the processor of the self-powered switch can extract the specified switch identification indication therefrom;
s5094: filling the forwarding frequency information into a forwarding frequency field of the frame header control field;
the forwarding number field is connected behind the switch identification indication field; the forwarding number information may be filled in a field (i.e., a forwarding number field) represented by the "forwarding count" shown in fig. 9 and 10, and may be pre-stored in the memory, and the processor of the self-power-generating switch may extract the forwarding number information therefrom, and in addition, the forwarding number information may also be updated and changed according to the number of times the message is forwarded.
Referring to fig. 17 in conjunction with fig. 10, the protocol processing method of the self-powered switch may further include:
s517: if the specified switch identifier indication is a first switch identifier indication, then: populating a switch identification into a switch identification field in the payload portion;
a switch identification field in the payload portion is concatenated after the authentication identification field. The first switch identification indication (e.g., 1) may be populated into the field characterized by the "ID" shown in fig. 9 and 10 (i.e., the switch identification field).
For further example, referring to fig. 9 and fig. 10, the length of the signature field is 4 bytes, the length of the key field is 1 byte, and the length of the verification identifier field is 4 bytes; the length of the switch identification field is 4 bytes, and the length of the length field is 1 byte. The lengths of the remaining fields can be understood with reference to fig. 9 and 10.
For further example, referring to fig. 9 and 10, the preamble is 0xAA, the access address is 0x8E89BED6, the address characteristic information includes 11 of the two highest bits of the physical address part, the length information is 0x0E, the broadcast type information is 0xFF, the device identifier includes 0x09E2, and the switch identifier includes 0x00000FF-0 xffffff.
The following also provides a protocol processing method of a receiving end, which can be understood as a specific example of the above processing method of the receiving end. The technical terms, technical means and technical effects referred to in the technical terms can be understood by referring to the foregoing.
Referring to fig. 18, the protocol processing method at the receiving end includes:
s601: receiving a current control message sent by the self-generating switch through the protocol processing method;
s602: acquiring a lead code from the lead code field and verifying that the lead code passes;
s603: acquiring an access address from the access address field, and verifying that the access address passes;
s604: acquiring the broadcast parameters from the data head field of the protocol data unit, and verifying that the broadcast parameters pass;
s605: acquiring the address characteristic information from the address characteristic field, and verifying that the address characteristic information passes;
s606: acquiring the switch identification from a switch identification field of the physical address part;
s607: acquiring the length information from the length field;
s608: based on the length information, acquiring the broadcast type information from the broadcast type field, and verifying that the broadcast type information passes;
s609: acquiring the equipment manufacturer identification from the equipment manufacturer identification field based on the length information, and verifying that the equipment manufacturer identification passes;
s610: based on the length information, acquiring the frame header control information from the frame header control field, and verifying that the frame header control information passes;
s611: based on the length information, acquiring the current verification identification from the verification identification field, and verifying that the current verification identification passes;
s612: acquiring switch type information from the switch type field based on the length information, and verifying that the switch type information passes;
s613: acquiring a key value in the current operation information from the key value field based on the length information;
s614: acquiring the current signature information from the signature field based on the length information;
s615: signing the acquired information from the length field to the appointed field of the key value field in the payload part to obtain reference signature information, and verifying that the current signature information passes by using the reference signature information; obtaining the CRC calculation value from the CRC field, and checking that the CRC calculation value passes;
s616: and executing the control event corresponding to the current control information.
Optionally, referring to fig. 19, step S610 may include:
s6101: based on the length information, acquiring version number information from a version number field of the frame header control field, and verifying that the version number information passes;
s6102: based on the length information, acquiring the signature encryption indication from an encryption indication field of the frame header control field, and verifying that the signature encryption indication passes;
s6103: based on the length information, acquiring a specified switch identification indication from a switch identification indication field of the frame header control field;
s6104: and based on the length information, acquiring the forwarding time information from the forwarding time field of the frame header control field, and verifying the forwarding time information.
The protocol processing method further comprises the following steps:
s618: if the specified switch identifier indication is a first switch identifier indication, then: responding to the first switch identification indication, and acquiring the switch identification filled in the switch identification field in the payload part; the first switch identification indication characterizes a filling of switch identifications in the payload portion.
Referring to fig. 20, the self-generating switch 700 includes:
a switch side obtaining module 701, configured to obtain current operation information and a current verification identifier; the current manipulation information includes a key value characterizing at least one of: the self-generating switch receives the operated key currently; the self-generating switch is used for controlling the current operation and control action received by the key;
a filling module 702, configured to fill the key value and the current verification identifier into a key value field and a verification identifier field of a payload portion of a current control packet, respectively;
a signature module 703, configured to sign the filled information of the specified field in the payload section to obtain current signature information, and fill the current signature information into the signature field of the payload section; the specified field is at least a partial field in the payload portion other than the signature field;
a sending module 704, configured to send the current control packet to a receiving end, so that: and the receiving end extracts the information filled in the payload part, and executes a control event corresponding to the current control information after verifying that the current signature information and the current verification identifier both pass.
Optionally, the signature module 703 is specifically configured to:
signing the filled information of the appointed field by using a first key to obtain the current signature information;
the current signature information can be verified based on reference signature information obtained by the receiver re-signing the information filled in the designated field with a second key, where the second key is matched with the first key.
Optionally, the filling module 702 is further configured to:
padding a signature encryption indication into an encryption indication field of a frame header control field of the payload section such that: the receiving end calculates the reference signature information when the encryption indication field is filled with the signature encryption indication, and verifies the current signature information by using the reference signature information; the signature encryption indication characterizes the inclusion of the current signature information in the payload portion.
Optionally, the length of the encryption indication field is 1 bit, the length of the signature field is 4 bytes, the length of the key value field is 1 byte, and the length of the verification identification field is 4 bytes.
Optionally, the current manipulation information further includes a switch identifier characterizing the self-generating switch;
the switch-side obtaining module 701 is further configured to: acquiring the switch identification;
the filling module 702 is further configured to: and filling the switch identification into a switch identification field of a physical address part of the current control message.
Alternatively to this, the first and second parts may,
the switch-side obtaining module 701 is further configured to: determining length information of a target field, wherein the target field comprises the payload part, and the payload part is connected behind a switch identification field of the physical address part;
the filling module 702 is further configured to: padding the length information into a length field of the payload part.
Optionally, the filling module 702 is further configured to:
and filling a specified switch identification indication into a switch identification indication field of a frame header control field of the payload part, wherein the specified switch identification indication represents whether the payload part is filled with switch identifications or not.
Optionally, the length of the switch identifier field is 4 bytes, the length of the switch identifier indication field is 1 bit, and the length of the length field is 1 byte.
Optionally, the specified switch identifier indication is a first switch identifier indication, and the first switch identifier indication indicates that the payload portion is filled with a switch identifier;
the filling module 702 is further configured to:
populating the switch identification in a switch identification field in the payload section.
Optionally, the obtaining module 701 is further configured to: acquiring set version number information, broadcast type information, equipment manufacturer identification and switch type information;
the filling module 702 is further configured to:
filling the version number information into a version number field of a frame header control field in the payload part;
and filling the broadcast type information, the equipment manufacturer identification and the switch type information into a broadcast type field, an equipment manufacturer identification field and a switch type field in the payload part respectively.
Optionally, the obtaining module 701 is further configured to: acquiring a set lead code, an access address and a broadcast parameter;
the filling module 702 is further configured to:
and filling the lead code, the access address and the broadcast parameters into a lead code field, an access address field and a protocol data unit data head field of the head of the current control message, wherein in the current control message, a physical address part is connected behind the head, and the payload part is connected behind the physical address part.
Optionally, the obtaining module 701 is further configured to: acquiring a CRC calculation value;
the filling module 702 is further configured to:
filling the CRC calculation value into a CRC field of a CRC part of the current control message; the CRC check portion is concatenated with the payload portion.
Optionally, the obtaining module 701 is specifically configured to:
generating the current manipulation information in response to a current manipulation for the self-generating switch;
reading the stored current authentication identification;
if the current operation belongs to the target operation, converting the current verification identifier from a first numerical value to a second numerical value according to a preset conversion rule, wherein the first numerical value is different from the second numerical value; the target maneuver includes a press maneuver and/or a rebound maneuver.
Optionally, the transformation rule includes at least one of:
accumulating a first reference value on the basis of said first value to obtain said second value;
subtracting a second reference value from the first value to obtain a second value;
multiplying a third reference value by the first value to obtain the second value;
dividing the first value by a fourth reference value to obtain the second value.
Referring to fig. 21, a receiver 800 includes:
a receiving module 801, configured to receive a current control message sent from a power-generating switch;
a receiving side obtaining module 802, configured to obtain information in a payload portion of the current control packet, where the obtained information in the payload portion includes current signature information, a current verification identifier, and a key value in current control information; the current signature information is obtained after the spontaneous power generation switch signs the information filled in the designated field in the payload part, and the designated field is at least part of field except the signature field in the payload part;
the key value characterizes at least one of:
the self-generating switch receives the operated key currently;
the self-generating switch is used for controlling the current operation and control action received by the key;
and the executing module 803 is configured to execute the control event corresponding to the current control information after the current signature information and the current verification identifier are both verified to pass.
Optionally, the current signature information is obtained by the self-generating switch through signing by using a first key;
when verifying that the current signature information passes, the executing module 803 is specifically configured to:
signing the information filled in the appointed field in the payload part again by using a second key, and calculating reference signature information; the second key matches the first key;
determining that the current signature information matches the reference signature information.
Optionally, the executing module 803 is further configured to:
and determining that an encryption indication field of a frame header control field of the payload part is filled with a signature encryption indication, wherein the signature encryption indication indicates that the current signature information is contained in the payload part.
Optionally, the current manipulation information further includes a switch identifier characterizing the self-generating switch;
the receiving side obtaining module 802 is further configured to:
and acquiring the switch identification filled in the switch identification field of the physical address part in the current control message.
Optionally, the receiving side obtaining module 802 is further configured to:
and when a switch identification indication field of a frame header control field of the effective load part is filled with a first switch identification indication, responding to the first switch identification indication, and acquiring the switch identification filled in the switch identification field of the effective load part, wherein the first switch identification indication represents that the effective load part is filled with the switch identification.
Optionally, the information in the obtained payload part further includes:
the length information filled in the length field of the payload part is obtained based on the length information, the length information is the length information of a target field, the target field comprises the payload part, and the payload part is connected behind a physical address part.
Optionally, the information in the obtained payload part further includes:
version number information filled in a version number field of a frame header control field in the payload section
Broadcast type information populated by a broadcast type field in the payload section;
an equipment identity populated by an equipment identity field in the payload section;
switch type information populated by a switch type field in the payload section.
The receiving side obtaining module 802 is further configured to:
acquiring information in a header of the current control message;
the information in the acquired header includes:
a preamble padded to a preamble field of the header;
an access address populated into an access address field of the header;
and filling the broadcast parameters into the data head field of the protocol data unit of the header.
The receiving side obtaining module 802 is further configured to:
and acquiring a CRC calculation value filled in a CRC field of a CRC part of the current control message, and checking the CRC calculation value.
The embodiment of the invention also provides a control system which comprises the self-generating switch and the receiver.
Referring to fig. 22, an electronic device 90 is provided, which includes:
a processor 91; and the number of the first and second groups,
a memory 92 for storing executable instructions for the processor;
wherein the processor 91 is configured to perform the above-mentioned method via execution of the executable instructions.
The processor 91 is capable of communicating with the memory 92 via the bus 93.
Embodiments of the present invention also provide a computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the above-mentioned method.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (34)

1. A method of handling an autonomous switch, comprising:
acquiring current control information and a current verification identifier; the current manipulation information includes a key value characterizing at least one of: the self-generating switch receives the operated key currently; the self-generating switch is used for controlling the current operation and control action received by the key;
filling the key value and the current verification identification into a key value field and a verification identification field of a payload part of the current control message respectively;
signing the filled information of the appointed field in the payload part to obtain current signature information, and filling the current signature information into the signature field of the payload part; the specified field is at least a partial field in the payload portion other than the signature field;
sending the current control message to a receiving end so as to: and the receiving end extracts the information filled in the payload part, and executes a control event corresponding to the current control information after verifying that the current signature information and the current verification identifier both pass.
2. The processing method according to claim 1,
signing the filled information of the specified field in the payload part to obtain current signature information, specifically comprising:
signing the filled information of the appointed field by using a first key to obtain the current signature information;
the current signature information can be verified based on reference signature information obtained by the receiver re-signing the information filled in the designated field with a second key, where the second key is matched with the first key.
3. The processing method according to claim 2, wherein signing the populated information of the specified field in the payload section further comprises, before obtaining current signature information:
padding a signature encryption indication into an encryption indication field of a frame header control field of the payload section such that: the receiving end calculates the reference signature information when the encryption indication field is filled with the signature encryption indication, and verifies the current signature information by using the reference signature information; the signature encryption indication characterizes the inclusion of the current signature information in the payload portion.
4. The processing method according to claim 3, wherein the encryption indication field has a length of 1 bit, the signature field has a length of 4 bytes, the key field has a length of 1 byte, and the authentication identification field has a length of 4 bytes.
5. The processing method according to any one of claims 1 to 4, characterized in that the current handling information further comprises a switch identification characterizing the autonomous switch;
before sending the current control message to a receiving end, the method further includes:
acquiring the switch identification;
and filling the switch identification into a switch identification field of a physical address part of the current control message.
6. The processing method according to claim 5, wherein signing the filled information of the specified field in the payload section further comprises, before obtaining current signature information:
determining length information of a target field, wherein the target field comprises the payload part, and the payload part is connected behind a switch identification field of the physical address part;
padding the length information into a length field of the payload part.
7. The processing method according to claim 6, wherein signing the populated information of the specified field in the payload section further comprises, before obtaining current signature information:
and filling a specified switch identification indication into a switch identification indication field of a frame header control field of the payload part, wherein the specified switch identification indication represents whether the payload part is filled with switch identifications or not.
8. The processing method according to claim 7, wherein the switch identification field has a length of 4 bytes, the switch identification indication field has a length of 1 bit, and the length field has a length of 1 byte.
9. The processing method according to claim 8, wherein the specified switch identification indication is a first switch identification indication characterizing that the payload portion is populated with switch identifications;
signing the filled information of the specified field in the payload part, and before obtaining the current signature information, further comprising:
populating the switch identification in a switch identification field in the payload section.
10. The processing method according to any one of claims 1 to 4, wherein signing the filled information of the specified field in the payload section further comprises, before obtaining current signature information:
acquiring set version number information, broadcast type information, equipment manufacturer identification and switch type information;
filling the version number information into a version number field of a frame header control field in the payload part;
and filling the broadcast type information, the equipment manufacturer identification and the switch type information into a broadcast type field, an equipment manufacturer identification field and a switch type field in the payload part respectively.
11. The processing method according to any one of claims 1 to 4, wherein before sending the current control packet to a receiving end, the method further comprises:
acquiring a set lead code, an access address and a broadcast parameter;
and filling the lead code, the access address and the broadcast parameters into a lead code field, an access address field and a protocol data unit data head field of the head of the current control message, wherein in the current control message, a physical address part is connected behind the head, and the payload part is connected behind the physical address part.
12. The processing method according to any one of claims 1 to 4, wherein before sending the current control packet to a receiving end, the method further comprises:
acquiring a CRC calculation value;
filling the CRC calculation value into a CRC field of a CRC part of the current control message; the CRC check portion is concatenated with the payload portion.
13. The processing method according to any one of claims 1 to 4, wherein acquiring the current manipulation information and the current verification information specifically includes:
generating the current manipulation information in response to a current manipulation for the self-generating switch;
reading the stored current authentication identification;
if the current operation belongs to the target operation, converting the current verification identifier from a first numerical value to a second numerical value according to a preset conversion rule, wherein the first numerical value is different from the second numerical value; the target maneuver includes a press maneuver and/or a rebound maneuver.
14. The process of claim 13, wherein the transformation rules comprise at least one of:
accumulating a first reference value on the basis of said first value to obtain said second value;
subtracting a second reference value from the first value to obtain a second value;
multiplying a third reference value by the first value to obtain the second value;
dividing the first value by a fourth reference value to obtain the second value.
15. A method for processing a receiving end, comprising:
receiving a current control message sent from a power generation switch;
acquiring information in a payload part of the current control message, wherein the acquired information in the payload part comprises current signature information, a current verification identifier and a key value in current control information; the current signature information is obtained after the spontaneous power generation switch signs the information filled in the designated field in the payload part, and the designated field is at least part of field except the signature field in the payload part;
the key value characterizes at least one of:
the self-generating switch receives the operated key currently;
the self-generating switch is used for controlling the current operation and control action received by the key;
and after the current signature information and the current verification identification are verified to pass, executing a control event corresponding to the current control information.
16. The processing method according to claim 15, wherein the current signature information is obtained by the self-generating switch after signing with a first key;
verifying that the current signature information passes, comprising:
signing the information filled in the appointed field in the payload part again by using a second key, and calculating reference signature information; the second key matches the first key;
determining that the current signature information matches the reference signature information.
17. The processing method according to claim 16, wherein the re-signing the information filled in the specified field in the payload section with the second key further comprises, before calculating the reference signature information:
and determining that an encryption indication field of a frame header control field of the payload part is filled with a signature encryption indication, wherein the signature encryption indication indicates that the current signature information is contained in the payload part.
18. The processing method according to any one of claims 15 to 17, wherein the current manipulation information further comprises a switch identification characterizing the autonomous switch;
after receiving the current control message sent from the power generation switch, the method further comprises the following steps:
and acquiring the switch identification filled in the switch identification field of the physical address part in the current control message.
19. The processing method according to any one of claims 15 to 17,
after receiving the current control message sent from the power generation switch, the method further comprises the following steps:
and when a switch identification indication field of a frame header control field of the effective load part is filled with a first switch identification indication, responding to the first switch identification indication, and acquiring the switch identification filled in the switch identification field of the effective load part, wherein the first switch identification indication represents that the effective load part is filled with the switch identification.
20. The processing method according to any of claims 15 to 17, wherein the information in the acquired payload portion further comprises:
the length information filled in the length field of the payload part is obtained based on the length information, the length information is the length information of a target field, the target field comprises the payload part, and the payload part is connected behind a physical address part.
21. The processing method according to any of claims 15 to 17, wherein the information in the acquired payload portion further comprises:
version number information filled in a version number field of a frame header control field in the payload section
Broadcast type information populated by a broadcast type field in the payload section;
an equipment identity populated by an equipment identity field in the payload section;
switch type information populated by a switch type field in the payload section.
22. The processing method according to any one of claims 15 to 17, further comprising, after receiving a current control message from the power switch:
acquiring information in a header of the current control message;
the information in the acquired header includes:
a preamble padded to a preamble field of the header;
an access address populated into an access address field of the header;
and filling the broadcast parameters into the data head field of the protocol data unit of the header.
23. The processing method according to any one of claims 15 to 17, further comprising, after receiving a current control message from the power switch:
acquiring a CRC calculation value filled in a CRC field of a CRC part of the current control message;
and checking the CRC calculation value.
24. A self-generating switch, comprising:
the switch side acquisition module is used for acquiring current control information and a current verification identifier; the current manipulation information includes a key value characterizing at least one of: the self-generating switch receives the operated key currently; the self-generating switch is used for controlling the current operation and control action received by the key;
a filling module, configured to fill the key value and the current verification identifier into a key value field and a verification identifier field of a payload portion of a current control packet, respectively;
the signature module is used for signing the filled information of the specified field in the payload part to obtain current signature information, and filling the current signature information into the signature field of the payload part; the specified field is at least a partial field in the payload portion other than the signature field;
a sending module, configured to send the current control packet to a receiving end, so that: and the receiving end extracts the information filled in the payload part, and executes a control event corresponding to the current control information after verifying that the current signature information and the current verification identifier both pass.
25. A receiving end, comprising:
the receiving module is used for receiving a current control message sent from the power generation switch;
a receiving side obtaining module, configured to obtain information in a payload portion of the current control packet, where the obtained information in the payload portion includes current signature information, a current verification identifier, and a key value in current control information; the current signature information is obtained after the spontaneous power generation switch signs the information filled in the designated field in the payload part, and the designated field is at least part of field except the signature field in the payload part;
the key value characterizes at least one of:
the self-generating switch receives the operated key currently;
the self-generating switch is used for controlling the current operation and control action received by the key;
and the execution module is used for executing the control event corresponding to the current control information after the current signature information and the current verification identifier are verified to pass.
26. A control system comprising the self-generating switch of claim 24 and the receiver of claim 25.
27. A protocol processing method for an autonomous switch, comprising:
filling the lead code into a lead code field of the head of the current control message;
padding an access address into an access address field of the header; the access address field is concatenated after the preamble field;
padding broadcast parameters into a protocol data unit data header field of the header; the protocol data unit data head field is jointed behind the access address field;
filling address characteristic information into an address characteristic field of a physical address part of the current control message; the address characteristic field is concatenated after the protocol data unit data head field;
filling a switch identifier in the current control information into a field of the physical address part; the switch identification field of the physical address part is directly or indirectly connected behind the address characteristic field;
filling the length information of the target field into the length field of the payload part of the current control message; the target field comprises a switch identification field in the physical address part and the payload part; the length field is connected behind the switch identification field in the physical address part;
filling broadcast type information into a broadcast type field of the payload part, wherein the broadcast type field is connected behind the length field;
populating a device identification to a device identification field of the payload portion, the device identification field following the broadcast type field;
filling frame header control information into a frame header control field of the payload section, the frame header control field being concatenated after the equipment provider identification field;
filling a current verification identification into a verification identification field of the payload part, wherein the verification identification field is connected behind the frame header control field;
populating a switch type field of the payload portion with switch type information, the switch type field being directly or indirectly engaged after being engaged with the authentication identification field;
filling a key value field of the payload part with a key value in the current operation information, wherein the key value field is connected behind the switch type field, and the key value represents at least one of the following: the self-generating switch receives the operated key currently; the self-generating switch is used for controlling the current operation and control action received by the key;
signing the information filled in the appointed fields from the length field to the key value field in the effective load part to obtain current signature information, and filling the current signature information into the signature field of the effective load part; the signature field is concatenated after the key value field;
filling a CRC calculation value into a CRC field of a CRC part of the current control message; the CRC check part is connected with the signature field;
and sending the current control message to a receiving end.
28. The protocol processing method according to claim 27, wherein padding frame header control information into a frame header control field of the payload section comprises:
filling version number information into a version number field of a frame header control field of the payload part, wherein the version number field is connected behind the equipment provider identification field;
filling a signature encryption indication into an encryption indication field of the frame header control field, wherein the encryption indication field is connected with the version number field; the signature encryption indication characterizes the inclusion of the current signature information in the payload portion;
filling a specified switch identification indication into a switch identification indication field of the frame header control field, wherein the switch identification indication field is connected with the encryption indication field; the specified switch identification indication characterizes whether a switch identification is contained in the payload section;
filling the forwarding times information into a forwarding times field of the frame header control field, wherein the forwarding times field is connected behind the switch identification indication field;
the protocol processing method further comprises the following steps:
if the specified switch identifier indication is a first switch identifier indication, then: and filling the switch identification into a switch identification field in the payload part, wherein the switch identification field in the payload part is connected behind the verification identification field.
29. A protocol processing method at a receiving end is characterized by comprising the following steps:
receiving a current control message sent by a self-generating switch through the protocol processing method of claim 27;
acquiring a lead code from the lead code field and verifying that the lead code passes;
acquiring an access address from the access address field, and verifying that the access address passes;
acquiring the broadcast parameters from the data head field of the protocol data unit, and verifying that the broadcast parameters pass;
acquiring the address characteristic information from the address characteristic field, and verifying that the address characteristic information passes;
acquiring the switch identification from a switch identification field of the physical address part;
acquiring the length information from the length field;
based on the length information, acquiring the broadcast type information from the broadcast type field, and verifying that the broadcast type information passes;
acquiring the equipment manufacturer identification from the equipment manufacturer identification field based on the length information, and verifying that the equipment manufacturer identification passes;
based on the length information, acquiring the frame header control information from the frame header control field, and verifying that the frame header control information passes;
based on the length information, acquiring the current verification identification from the verification identification field, and verifying that the current verification identification passes;
acquiring switch type information from the switch type field based on the length information, and verifying that the switch type information passes;
acquiring a key value in the current operation information from the key value field based on the length information;
acquiring the current signature information from the signature field based on the length information;
signing the acquired information from the length field to the appointed field of the key value field in the payload part to obtain reference signature information, and verifying that the current signature information passes by using the reference signature information; obtaining the CRC calculation value from the CRC field, and checking that the CRC calculation value passes;
and executing the control event corresponding to the current control information.
30. The protocol processing method according to claim 29,
based on the length information, acquiring the frame header control information from the frame header control field, and verifying that the frame header control information passes, including:
based on the length information, acquiring version number information from a version number field of the frame header control field, and verifying that the version number information passes;
based on the length information, acquiring the signature encryption indication from an encryption indication field of the frame header control field, and verifying that the signature encryption indication passes;
based on the length information, acquiring a specified switch identification indication from a switch identification indication field of the frame header control field;
based on the length information, acquiring the forwarding time information from a forwarding time field of the frame header control field, and verifying the forwarding time information;
the protocol processing method further comprises the following steps:
if the specified switch identifier indication is a first switch identifier indication, then: responding to the first switch identification indication, and acquiring the switch identification filled in the switch identification field in the payload part; the first switch identification indication characterizes a filling of switch identifications in the payload portion.
31. The protocol processing method according to claim 27 or 29, wherein the signature field has a length of 4 bytes, the key field has a length of 1 byte, and the authentication identification field has a length of 4 bytes; the length of the switch identification field is 4 bytes, and the length of the length field is 1 byte.
32. The protocol processing method of claim 27 or 29, wherein the preamble is 0xAA, the access address is 0x8E89BED6, the address characteristic information includes 11 of the two highest bits of the physical address part, the length information is 0x0E, the broadcast type information is 0xFF, the device identifier includes 0x09E2, and the switch identifier includes 0x00000FF-0 xffffffff.
33. A storage medium storing a program, wherein the program, when executed by a processor, implements the method of any one of claims 1 to 23, 27-32.
34. An electronic device comprising a memory, a processor, and a program stored in the memory and running on the processor, wherein the processor implements the method of any of claims 1-23, 27-32 when executing the program.
CN202110531082.2A 2021-05-16 2021-05-16 Self-generating switch and processing method thereof, receiver and processing method thereof Active CN113517951B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202110531082.2A CN113517951B (en) 2021-05-16 2021-05-16 Self-generating switch and processing method thereof, receiver and processing method thereof
CN202210668848.6A CN115426112A (en) 2021-05-16 2021-05-16 Method for treating self-generating switch

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110531082.2A CN113517951B (en) 2021-05-16 2021-05-16 Self-generating switch and processing method thereof, receiver and processing method thereof

Related Child Applications (1)

Application Number Title Priority Date Filing Date
CN202210668848.6A Division CN115426112A (en) 2021-05-16 2021-05-16 Method for treating self-generating switch

Publications (2)

Publication Number Publication Date
CN113517951A true CN113517951A (en) 2021-10-19
CN113517951B CN113517951B (en) 2022-06-03

Family

ID=78064498

Family Applications (2)

Application Number Title Priority Date Filing Date
CN202210668848.6A Pending CN115426112A (en) 2021-05-16 2021-05-16 Method for treating self-generating switch
CN202110531082.2A Active CN113517951B (en) 2021-05-16 2021-05-16 Self-generating switch and processing method thereof, receiver and processing method thereof

Family Applications Before (1)

Application Number Title Priority Date Filing Date
CN202210668848.6A Pending CN115426112A (en) 2021-05-16 2021-05-16 Method for treating self-generating switch

Country Status (1)

Country Link
CN (2) CN115426112A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113794783A (en) * 2021-11-17 2021-12-14 武汉领普科技有限公司 Data processing method, device and storage medium
WO2022242516A1 (en) * 2021-05-16 2022-11-24 武汉领普科技有限公司 Switch control method, receiving end control method, self-generating switch, and receiving end
WO2022242523A1 (en) * 2021-05-16 2022-11-24 武汉领普科技有限公司 Self-powered switch and processing method therefor, and receiver and processing method therefor

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103067174A (en) * 2012-12-27 2013-04-24 飞天诚信科技股份有限公司 Digital signature method and system completed in mobile operating system
CN103944728A (en) * 2014-04-25 2014-07-23 天地融科技股份有限公司 Data security interactive system
CN105681281A (en) * 2015-12-30 2016-06-15 北京金科联信数据科技有限公司 Password device based on embedded operating system
CN109561106A (en) * 2018-12-29 2019-04-02 北京工业大学 A kind of marine communication message real time parsing filter method
CN109564557A (en) * 2017-03-01 2019-04-02 华为技术有限公司 Single line communication method and apparatus
WO2019210767A1 (en) * 2018-05-04 2019-11-07 飞天诚信科技股份有限公司 Method for secure interaction on universal platform and smart terminal
CN111325879A (en) * 2020-01-21 2020-06-23 上海钧正网络科技有限公司 Vehicle remote control method and device, storage medium and equipment

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103067174A (en) * 2012-12-27 2013-04-24 飞天诚信科技股份有限公司 Digital signature method and system completed in mobile operating system
CN103944728A (en) * 2014-04-25 2014-07-23 天地融科技股份有限公司 Data security interactive system
CN105681281A (en) * 2015-12-30 2016-06-15 北京金科联信数据科技有限公司 Password device based on embedded operating system
CN109564557A (en) * 2017-03-01 2019-04-02 华为技术有限公司 Single line communication method and apparatus
WO2019210767A1 (en) * 2018-05-04 2019-11-07 飞天诚信科技股份有限公司 Method for secure interaction on universal platform and smart terminal
CN109561106A (en) * 2018-12-29 2019-04-02 北京工业大学 A kind of marine communication message real time parsing filter method
CN111325879A (en) * 2020-01-21 2020-06-23 上海钧正网络科技有限公司 Vehicle remote control method and device, storage medium and equipment

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022242516A1 (en) * 2021-05-16 2022-11-24 武汉领普科技有限公司 Switch control method, receiving end control method, self-generating switch, and receiving end
WO2022242523A1 (en) * 2021-05-16 2022-11-24 武汉领普科技有限公司 Self-powered switch and processing method therefor, and receiver and processing method therefor
CN113794783A (en) * 2021-11-17 2021-12-14 武汉领普科技有限公司 Data processing method, device and storage medium
CN113794783B (en) * 2021-11-17 2022-02-25 武汉领普科技有限公司 Data processing method, device and storage medium
CN114500620A (en) * 2021-11-17 2022-05-13 武汉领普科技有限公司 Data processing method, device and storage medium
CN114520821A (en) * 2021-11-17 2022-05-20 武汉领普科技有限公司 Data processing method, device and storage medium
CN114520821B (en) * 2021-11-17 2024-05-03 武汉领普科技有限公司 Data processing method, device and storage medium
CN114500620B (en) * 2021-11-17 2024-06-18 武汉领普科技有限公司 Data processing method, device and storage medium

Also Published As

Publication number Publication date
CN113517951B (en) 2022-06-03
CN115426112A (en) 2022-12-02

Similar Documents

Publication Publication Date Title
CN113517951B (en) Self-generating switch and processing method thereof, receiver and processing method thereof
WO2022242523A1 (en) Self-powered switch and processing method therefor, and receiver and processing method therefor
JP7267627B2 (en) digital lock
CN113410971B (en) Self-generating switch and processing method and control system thereof
KR100673414B1 (en) Battery and authentication requesting device
US20240088772A1 (en) Switch control method, receiving end control method, self-generating switch and receiving end
JP2010166486A5 (en)
US11997487B2 (en) Wireless power transfer device authentication
CN108266061A (en) Fingerprint lock
CN104978515A (en) Computer intelligent hole-locking device
CN112841757A (en) Atomizer anti-counterfeiting identification method, atomizer and electronic atomization device
CN206805521U (en) A kind of mobile data memory unit based on quantum key encryption
CN106411501A (en) Method and system for generating permission token and equipment
CN207557892U (en) A kind of laser page turning pen with hyperlink
CN108702168A (en) Protection covering device for portable mobile terminal equipment, with temperature control charging circuit
CN108369621A (en) It touches and sound authentication device
CN113645619B (en) One-to-many key distribution method and device
CN115118586B (en) Self-generating switch, processing method thereof, electronic equipment and control system
CN212849957U (en) Protective shell
CN112671785A (en) AI algorithm-based safe electricity utilization electric meter system
CN202150150U (en) Intelligent mobile phone charging station
JP2015232861A (en) Radio communication system
CN113050499A (en) Parameterizable automation device
KR20080004694A (en) Electric power self-generation type remote-controller
CN110347247A (en) Man-machine interaction method, device, storage medium and electronic equipment

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