Disclosure of Invention
The embodiment of the specification provides a signature recording method, a signature verification device and a storage medium.
In a first aspect, embodiments of the present disclosure provide a signature recording method, including:
detecting whether a signature device executes a signature action, wherein the signature action is executed when a target user signs by using the signature device;
when the signature device executes a signature action, acquiring signature characteristics of the signature;
the signature feature is sent to a target node of a blockchain to be saved to the target node so that the signature feature is invoked in the target node when the signature is verified.
In a second aspect, embodiments of the present disclosure provide a signature verification method, including:
acquiring signature characteristics to be verified from a target node in a block chain;
acquiring a target signature of a target user corresponding to the signature feature to be verified;
and determining whether the signature corresponding to the signature feature to be verified is the signature of the target user according to the signature feature to be verified and the target signature.
In a third aspect, embodiments of the present specification provide a signature recording apparatus, including:
the detection module is used for detecting whether the signature device executes a signature action, wherein the signature action is executed when a target user signs by using the signature device;
the signature characteristic acquisition module is used for acquiring signature characteristics of the signature when the signature device executes signature actions;
and the communication module is used for sending the signature characteristic to a target node of a blockchain so as to enable the signature characteristic to be stored in the target node, so that the signature characteristic is called in the target node when the signature is verified.
In a fourth aspect, embodiments of the present specification provide a signature verification apparatus, including:
the first acquisition module is used for acquiring signature characteristics to be verified from a target node in the blockchain;
the second acquisition module is used for acquiring a target signature of a target user corresponding to the signature feature to be verified;
and the verification module is used for determining whether the signature corresponding to the signature feature to be verified is the signature of the target user according to the signature feature to be verified and the target signature.
In a fifth aspect, embodiments of the present disclosure provide a signature apparatus, including:
the device comprises a controller, a signature characteristic collector and a transceiver, wherein the signature characteristic collector and the transceiver are respectively connected with the controller;
the controller is used for detecting whether the signature device executes signature action or not and controlling the signature feature collector to start when the signature device executes signature action;
the signature feature collector is used for collecting signature features of the signature device when the signature action is executed, and sending the signature features to the controller;
the controller is further used for sending the signature characteristics acquired by the signature characteristic acquisition unit to the transceiver;
the transceiver is configured to send the signature feature to a target node of a blockchain upon receiving the signature feature.
In a sixth aspect, embodiments of the present disclosure provide a signature verification apparatus comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor performing the steps of the method of the second aspect described above.
In a seventh aspect, embodiments of the present description provide a computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, implements the steps of any of the methods described above.
The embodiment of the specification has the following beneficial effects:
in the signature recording method provided in the embodiments of the present disclosure, when a signature device is detected to perform a signature action, a signature feature of a signature is obtained and sent to a target node of a blockchain, so that the signature feature is saved in the target node, and when the signature needs to be verified later, the signature feature can be directly invoked in the target node to be verified. According to the scheme in the embodiment of the specification, the steps are executed in the process of signing each time, namely the signing characteristics of each time are stored in the target node of the blockchain by detecting the signing each time, and the trusted certification is provided for subsequent signature verification by recording the signing each time.
Detailed Description
In order to better understand the technical solutions described above, the technical solutions of the embodiments of the present specification are described in detail below through the accompanying drawings and the specific embodiments, and it should be understood that the specific features of the embodiments of the present specification and the specific features of the embodiments of the present specification are detailed descriptions of the technical solutions of the embodiments of the present specification, and not limit the technical solutions of the present specification, and the technical features of the embodiments of the present specification may be combined without conflict.
In a first aspect, an embodiment of the present disclosure provides a signature recording method, as shown in fig. 1, which is a flowchart of the signature recording method provided in the embodiment of the present disclosure, where the method includes the following steps:
step S11: detecting whether a signature device executes a signature action, wherein the signature action is executed when a target user signs by using the signature device;
in the embodiments of the present description, the signing device may be a pen or other signing device used for signing. In one embodiment, the signing device may be a pen that specifically records signatures, and components such as a processor, controller, sensor, etc. may be provided in the signing device to detect and record the user's signature. In another embodiment, the signature device may be composed of a common pen and an external device arranged on the pen, wherein components such as a processor, a controller, a sensor and the like for detecting and recording signatures are arranged in the external device.
The target user may be any user who signs using the signing device, and may or may not perform a signing action, such as shaking the signing device without writing, when the target user holds the signing device. In the embodiment of the present specification, in order to effectively record signature characteristics, signature recording is performed when the signature device performs a signature action, that is, performs a writing action, and recording is not performed when the signature device does not perform a signature action.
The manner in which the signature device is detected to perform the signature action may be selected according to actual needs, and in one embodiment, the signature device may be identified by photographing with a camera, for example, a user signs on paper material using the signature device, and when handwriting is present in a photograph taken by the camera, the signature device is performing the signature action.
Step S12: when the signature device executes a signature action, acquiring signature characteristics of the signature;
in the embodiment of the present specification, the signature features may include signature handwriting features, writing order features of strokes, and the like. Depending on the type of signature feature, the manner in which the signature feature is acquired is also different. For example, when the signature feature is a signature handwriting feature, the signature handwriting feature may be acquired by an acceleration sensor, a laser, or the like. When the signature feature is a writing order feature of a stroke, the writing order feature of the stroke may be recorded by a camera. Of course, the signature feature may be obtained by other means, which is not limited herein.
Step S13: the signature feature is sent to a target node of a blockchain to be saved to the target node so that the signature feature is invoked in the target node when the signature is verified.
In this embodiment of the present disclosure, the target node of the blockchain may be selected according to actual needs, for example, the target node may be any node in the blockchain, or the target node may be a node closest to the signature device, or the target node is a preset node.
In one embodiment, a communication module can be arranged in the signature device and can be in communication connection with a node in the blockchain, and after the signature feature is acquired, the signature feature is sent to a target node through the communication module so as to be stored in the target node.
It should be appreciated that the above steps may be performed each time a user signs a signature, to obtain signature features of each signature and send the signature features to the target node for storage, so that if a signature needs to be verified later, the signature features to be verified may be read directly at the target node and signature verification performed. Therefore, the scheme in the embodiment of the specification can save signature characteristics of a user every time, and even if the signature is performed on paper materials, the signature can be saved according to the signature characteristics, so that a usable certificate is provided for verifying the validity of the signature.
Optionally, a writing detection sensor is disposed in the signature device, and the detecting whether the signature device performs the signature action includes: and controlling the writing detection sensor to detect whether the signature device is in a writing state, wherein when the signature device is in the writing state, the signature device is determined to execute the signature action.
In the embodiment of the specification, a writing detection sensor can be arranged in the signature device and used for determining whether a user performs writing activities currently. The writing detection sensor can be arranged according to actual needs. In one embodiment, the writing detection sensor may be a sensor that detects the rotation of a ball of the pen tip, and when the user writes on paper, the ball on the pen tip that is in contact with the paper rotates, indicating that a signature action is being performed if the ball rotation is detected, and indicating that no signature action is being performed if the ball rotation is not detected. In another embodiment, the writing detection sensor may be a camera, which may take a picture at a predetermined frequency, and when the result of the picture shows that ink is on the paper, this indicates that a signature action is being performed.
Optionally, a handwriting recognition sensor is disposed in the signature device, and the obtaining the signature feature of the signature includes: and controlling the handwriting recognition sensor to acquire the stroke writing direction characteristic and the stroke writing distance characteristic corresponding to the signature.
In the embodiment of the present disclosure, the handwriting recognition sensor may be an acceleration sensor, a gyroscope or other sensors, which are not limited herein. In one embodiment, the handwriting recognition sensor is an acceleration sensor, which can obtain the writing directions of the strokes in the three directions X, Y, Z and the writing distance in each direction when the signature device signs the signature. In another embodiment, the handwriting recognition sensor may be an acceleration sensor, a gyroscope and a camera, the writing direction and the writing distance of the strokes are obtained through the acceleration sensor and the gyroscope, the writing sequence of the strokes is recorded through the camera, and the writing direction, the writing distance and the writing sequence are used as signature features.
Optionally, before the sending the signature feature into the target node of the blockchain, the method further includes: acquiring signature information corresponding to the signature, wherein the signature information comprises signature time and/or signature contract information corresponding to the signature; the sending the signature feature to a target node of a blockchain includes: and sending the signature information and the signature characteristic to the target node.
In the embodiment of the present specification, in order to mark each signature, signature information may be acquired at the time of signing, and signature features acquired each time may be distinguished by the signature information. In one embodiment, the signature information may include signature time and/or contract information to which the signature belongs, and the contract information may include information of a name of the contract, information of both parties to which the contract is signed, a place to which the contract is signed, and the like. Of course, the signature information may be other information, which is not limited herein. And storing the signature information of each signature corresponding to the signature characteristics, and reading the corresponding signature characteristics from the target node according to the signature information when the signature is verified later.
Optionally, after the signature feature of the signature is obtained, the method further includes: encrypting the signature features in a preset encryption mode to obtain encrypted signature features; the sending the signature feature to a target node of a blockchain includes: and sending the encrypted signature characteristics to the target node.
To ensure that the signature feature sent to the target node is not tampered with, in this embodiment of the present disclosure, the signature feature may be encrypted. The preset encryption mode can be set according to actual needs, for example, the preset encryption mode is an asymmetric key encryption mode, a hash algorithm encryption mode or other encryption modes. And storing the encrypted signature characteristics to a target node. When the signature needs to be verified later, the corresponding encrypted signature feature is acquired at the target node, and the signature feature is acquired after the encrypted signature feature is decrypted by adopting a decryption mode corresponding to the encryption mode. In one embodiment, the target user may encrypt the signature feature using its own private key, upload the encrypted signature feature to the target node, and decrypt the encrypted signature feature by using the public key corresponding to the private key when verifying the signature, so as to obtain the signature feature.
In a second aspect, an embodiment of the present disclosure provides a signature verification method, as shown in fig. 2, which is a flowchart of the signature verification method provided in the embodiment of the present disclosure, where the method includes the following steps:
step S21: acquiring signature characteristics to be verified from a target node in a block chain;
step S22: acquiring a target signature of a target user corresponding to the signature feature to be verified;
step S23: and determining whether the signature corresponding to the signature feature to be verified is the signature of the target user according to the signature feature to be verified and the target signature.
In step S21, when a signature needs to be verified, the signature feature corresponding to the signature, that is, the signature feature to be verified, may be directly read at the target node of the blockchain. In one embodiment, since a large number of signature features may be stored in the target node, the signature feature to be verified may be acquired at the target node according to the signature information of the signature, for example, the signature feature to be verified may be determined from the signature features stored in the target node according to the signature time information of the signature or the signature contract information. In one embodiment, the corresponding relationship between the signature feature and the signature time and contract name are also recorded while the signature feature is stored, for example, the signature time corresponding to the signature feature a is 9 am on 2018, 1 month, 1 day, and the contract name corresponding to the signature feature a is ABC, and when the signature feature is obtained, one signature feature can be uniquely determined according to the signature time and the contract name.
In step S22, the target signature may be obtained by the target user rewriting the signature using the signature device according to the first aspect, or may be obtained by the target user rewriting the signature using a common pen, or may be obtained by the target user obtaining the target signature by reading a standard signature stored in advance by using the signature device and used for verification, which is not limited herein.
It should be understood that, in step S23, the verification manner of the signature feature to be verified is also different for different forms of target signatures, and the verification process of the signature feature to be verified will be described below by taking two implementations as examples.
The first implementation mode: performing signature restoration on the signature feature to be verified to obtain a restored signature to be verified; and determining whether the signature to be verified is the signature of the target user according to the similarity between the signature to be verified and the target signature and a preset similarity threshold, wherein when the similarity between the signature to be verified and the target signature is greater than the preset similarity threshold, the signature to be verified is determined to be the signature of the target user.
In a first implementation, the target signature may be a signature written by the target user using a normal pen, or may be a signature written by using a signature device. In one embodiment, when the signature of the contract a needs to be verified, firstly, the signature feature to be verified, which is uploaded by the target user while signing the contract a, is obtained in the target node, for example, when the signature feature to be verified is a stroke writing direction feature and a stroke writing distance feature, the signature while signing the contract a at the time can be restored according to the features. And then the target user can re-write the signature once by using a common pen or a signature device, the similarity comparison is carried out on the two signatures, and if the similarity of the two signatures is greater than a preset similarity threshold, the signature to be verified is determined to be the signature written by the target user. It should be understood that the preset similarity threshold may be set according to actual needs, such as 90%, 95%, etc., and is not limited herein.
The second implementation mode: writing the target signature by a signature device and acquiring target signature characteristics corresponding to the target signature; and determining whether the signature corresponding to the signature feature to be verified is the signature of the target user according to the signature feature to be verified and the target signature feature.
In a second implementation manner, the target signature is written by the signature device, and when the signature device is used for writing the target signature, the target signature feature corresponding to the target signature can be obtained by the signature recording method provided in the first aspect. In one embodiment, when the signature of the target user on the B contract needs to be verified, first, the signature feature to be verified, which is uploaded by the target user while signing the B contract, is read on the target node, for example, the signature feature to be verified is a stroke writing direction feature and a stroke writing distance feature. And then the target user rewrites the signature by using the signature device to obtain target signature characteristics, namely, the stroke writing direction characteristics and the stroke writing distance characteristics obtained by the rewritten signature. And comparing the target signature characteristic with the signature characteristic to be verified, for example, comparing the stroke writing direction characteristic to be verified with the stroke writing direction characteristic of the target signature, if the error of the stroke writing direction characteristic to be verified and the stroke writing distance characteristic of the target signature meets the preset direction error range, further comparing the writing distance characteristic to be verified with the stroke writing distance characteristic of the target signature, and if the error of the stroke writing distance characteristic to be verified and the stroke writing distance characteristic of the target signature meets the preset distance error range, determining the signature characteristic to be verified as the signature written by the target user. If the direction characteristic error does not meet the preset direction error range and/or the distance characteristic error does not meet the preset distance error range, determining that the signature to be verified is not the signature written by the target user.
In addition, other verification methods may be used besides the two verification methods, for example, the target user may set a standard signature or a standard signature feature, store the standard signature or the standard signature feature in a certain node of the blockchain, and when the signature feature needs to be verified for a certain time, directly call the standard signature or the standard signature feature, and compare with the signature feature to be verified to obtain a verification result.
It should be understood that when the signature feature is an encrypted signature feature, when the signature feature is verified, a corresponding decryption mode needs to be acquired according to the encryption mode of the signature feature to decrypt the encrypted signature feature so as to obtain the signature feature to be verified.
In a third aspect, an embodiment of the present disclosure provides a signature recording device, referring to fig. 3, including:
a detection module 31, configured to detect whether a signing device performs a signing action, where the signing action is an action performed when a target user signs using the signing device;
a signature feature acquisition module 32, configured to acquire signature features of the signature when the signature device performs a signature action;
a communication module 33, configured to send the signature feature to a target node of a blockchain, so that the signature feature is saved in the target node, so that the signature feature is invoked in the target node when the signature is verified.
In an alternative implementation, the signature device is provided with a writing detection sensor, and the detection module 31 includes:
and the first control module is used for controlling the writing detection sensor to detect whether the signature device is in a writing state, wherein when the signature device is in the writing state, the signature device is determined to execute the signature action.
In an alternative implementation, the signature device is provided with a handwriting recognition sensor, and the signature feature obtaining module 32 includes:
and the second control module is used for controlling the handwriting recognition sensor to acquire the stroke writing direction characteristic and the stroke writing distance characteristic corresponding to the signature.
In an alternative implementation, the signature recording device further includes: the signature information acquisition module is used for acquiring signature information corresponding to the signature, wherein the signature information comprises signature time and/or signature contract information corresponding to the signature;
the communication module 33 is configured to: and sending the signature information and the signature characteristic to the target node.
In an alternative implementation, the signature recording device further includes: the encryption module is used for encrypting the signature characteristic in a preset encryption mode to obtain an encrypted signature characteristic;
the communication module 33 is configured to: and sending the encrypted signature characteristics to the target node.
With respect to the above apparatus, the specific functions of the respective modules have been described in detail in the embodiments of the signature recording method provided in the embodiments of the present invention, and will not be described in detail herein.
In a fourth aspect, embodiments of the present disclosure provide a signature verification apparatus, referring to fig. 4, including:
a first obtaining module 41, configured to obtain signature features to be verified in a target node in a blockchain;
a second obtaining module 42, configured to obtain a target signature of a target user corresponding to the signature feature to be verified;
and the verification module 43 is configured to determine whether a signature corresponding to the signature feature to be verified is a signature of the target user according to the signature feature to be verified and the target signature.
In an alternative implementation, the verification module 43 is configured to:
performing signature restoration on the signature feature to be verified to obtain a restored signature to be verified;
and determining whether the signature to be verified is the signature of the target user according to the similarity between the signature to be verified and the target signature and a preset similarity threshold, wherein when the similarity between the signature to be verified and the target signature is greater than the preset similarity threshold, the signature to be verified is determined to be the signature of the target user.
In an alternative implementation, the second obtaining module 42 is configured to: writing the target signature by a signature device and acquiring target signature characteristics corresponding to the target signature;
the verification module 43 is configured to: and determining whether the signature corresponding to the signature feature to be verified is the signature of the target user according to the signature feature to be verified and the target signature feature.
With respect to the above apparatus, the specific functions of the respective modules have been described in detail in the embodiments of the signature verification method provided in the embodiments of the present invention, and will not be described in detail herein.
In a fifth aspect, embodiments of the present disclosure provide a signing device 50, please refer to fig. 5, comprising:
the controller 51, the signature feature collector 52, and the transceiver 53, the signature feature collector 52 and the transceiver 53 being connected to the controller 51, respectively;
the controller 51 is configured to detect whether the signing device 50 performs a signing action, and control the signature feature collector to start when the signing device performs a signing action;
the signature feature collector 52 is configured to collect signature features of the signature device 50 when performing the signature action, and send the signature features to the controller 51;
the controller 51 is further configured to send the signature feature acquired by the signature feature acquirer to the transceiver;
the transceiver 53 is configured to send the signature feature to a target node of the blockchain upon receipt of the signature feature.
In the present embodiment, the controller 51 may be composed of a writing detection sensor and a processor, wherein the writing detection sensor may detect a state of the signature device, which may include a writing state and a non-writing state. The processor may determine whether the signing device 50 performs a signing action based on the state of the signing device. In one embodiment, the writing detection sensor is a sensor that detects rotation of a ball of the signature device, determines that the signature device 50 is in a written state when rotation of the ball is detected, and determines that the signature device 50 is in a non-written state when rotation of the ball is not detected. The processor, upon receiving the writing status sent by the writing detection sensor, determines that the signing device 50 performs a signing action. In the present embodiment, the signature feature collector 52 is controlled to start when the processor determines that the signature device 50 performs a signature action.
The signature feature collector 52 may be a handwriting recognition sensor for collecting the stroke writing direction features and the stroke writing distance features of a user when signing with the signature device. The handwriting recognition sensor may be an acceleration sensor, a gyroscope, a camera, or the like, which is not limited herein.
After the signature collector 52 collects the signature, the signature is sent to the controller 51, the controller 51 transmits the signature to the transceiver 53, the transceiver 53 can be in communication connection with a node on the blockchain, and when the transceiver 53 receives the signature, the signature is sent to a target node on the blockchain. The target node may be any node on the blockchain or may be the nearest node to the signing device.
In addition, the signature device 50 may be further provided with an encryption device 54 for encrypting the signature feature, and the encryption mode may be set according to actual needs, such as an asymmetric key encryption mode, hash algorithm encryption, and the like. The transceiver 53 may send the encrypted signature to the target node for storage.
In a sixth aspect, based on the same inventive concept as the signature verification method in the foregoing embodiment, the present invention further provides a signature verification device, as shown in fig. 6, including a memory 604, a processor 602, and a computer program stored on the memory 604 and capable of running on the processor 602, where the processor 602 implements the steps of any one of the signature verification methods described above when executing the program.
Where in FIG. 6, a bus architecture (represented by bus 600), bus 600 may include any number of interconnected buses and bridges, with bus 600 linking together various circuits, including one or more processors, represented by processor 602, and memory, represented by memory 604. Bus 600 may also link together various other circuits such as peripheral devices, voltage regulators, power management circuits, etc., as are well known in the art and, therefore, will not be described further herein. The bus interface 606 provides an interface between the bus 600 and the receiver 601 and transmitter 603. The receiver 601 and the transmitter 603 may be the same element, i.e. a transceiver, providing a means for communicating with various other apparatus over a transmission medium. The processor 602 is responsible for managing the bus 600 and general processing, while the memory 604 may be used to store data used by the processor 602 in performing operations.
In a seventh aspect, based on the inventive concept as set forth in the previous embodiments based on the signature recording method and the signature verification method, the present invention further provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of any one of the methods described above based on the signature recording method or the signature verification method.
The present description is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the specification. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present invention without departing from the spirit or scope of the invention. Thus, it is intended that the present invention also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.