WO2020048055A1 - 实体印章的记账方法及终端设备 - Google Patents

实体印章的记账方法及终端设备 Download PDF

Info

Publication number
WO2020048055A1
WO2020048055A1 PCT/CN2018/123789 CN2018123789W WO2020048055A1 WO 2020048055 A1 WO2020048055 A1 WO 2020048055A1 CN 2018123789 W CN2018123789 W CN 2018123789W WO 2020048055 A1 WO2020048055 A1 WO 2020048055A1
Authority
WO
WIPO (PCT)
Prior art keywords
print
block
record
blockchain network
records
Prior art date
Application number
PCT/CN2018/123789
Other languages
English (en)
French (fr)
Inventor
刘慧众
Original Assignee
深圳壹账通智能科技有限公司
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 深圳壹账通智能科技有限公司 filed Critical 深圳壹账通智能科技有限公司
Publication of WO2020048055A1 publication Critical patent/WO2020048055A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3827Use of message hashing
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B41PRINTING; LINING MACHINES; TYPEWRITERS; STAMPS
    • B41KSTAMPS; STAMPING OR NUMBERING APPARATUS OR DEVICES
    • B41K1/00Portable hand-operated devices without means for supporting or locating the articles to be stamped, i.e. hand stamps; Inking devices or other accessories therefor
    • B41K1/36Details
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • 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/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0643Hash functions, e.g. MD5, SHA, HMAC or f9 MAC

Definitions

  • the present application belongs to the technical field of data processing, and in particular, relates to an accounting method for a physical seal and a terminal device.
  • a seal is a stationery used to be printed on a document to indicate authentication or signing. Because some seals, such as official seals, have high requirements for security, they are usually limited to designated individuals or units, or only for designated purposes. Therefore, in order to prevent seals Forgery and misuse require accounting of the use of the seal.
  • the electronic seal is usually recorded, that is, the process of stamping the electronic seal to an electronic file is recorded.
  • the physical seal there is no effective accounting method, which leads to the use of the physical seal. It is not clear and transparent, and it cannot be distinguished from the fake by using a forged seal. In summary, in the prior art, it is impossible to record the use record of the physical seal.
  • embodiments of the present application provide an accounting method for a physical seal and a terminal device, so as to solve the problem that the use records of the physical seal cannot be recorded in the prior art.
  • a first aspect of the embodiments of the present application provides a method for recording a physical seal, including:
  • a node in the blockchain network performs hash encryption on a block header of a latest block in the blockchain network to obtain a first hash value, and performs hash encryption on a plurality of sorted print records after sorting.
  • a second hash value is used to generate a print block based on the first hash value, the second hash value, and a plurality of sorted print records. If the print block is stored in the blockchain, If the result of the consensus verification in the network is successful, the printed block is added to the latest block.
  • a second aspect of the embodiments of the present application provides a terminal device, which may include a unit for implementing the steps of the accounting method of the physical seal described above.
  • a third aspect of the embodiments of the present application provides a terminal device including a memory and a processor.
  • the memory stores computer-readable instructions executable on the processor, and the processor executes the computer-readable instructions. The steps of the bookkeeping method for realizing the above-mentioned physical seal when reading the instruction.
  • a fourth aspect of the embodiments of the present application provides a computer non-volatile readable storage medium, where the computer non-readable storage medium stores computer readable instructions, and the computer readable instructions are executed by a processor Steps to implement the accounting method of the physical seal described above.
  • a communication connection is established with a recorder inside the physical seal, so as to obtain the print records of the physical seal recorded by the recorder.
  • the multiple printed records that are sorted are sent to the blockchain.
  • the network and the nodes of the blockchain network generate the printed blocks based on the sorted multiple printed records, and after the printed block consensus verification is successful, the printed blocks are added to the latest block of the blockchain network.
  • the use of the physical seal is recorded, making the use of the physical seal clearly visible and improving the transparency of the use of the seal.
  • FIG. 1 is an implementation flowchart of an accounting method for a physical seal in Embodiment 1 of the present application
  • FIG. 2 is a flowchart of implementing an accounting method for a physical seal in Embodiment 2 of the present application
  • FIG. 3 is a flowchart of implementing a method for recording a physical seal in Embodiment 3 of the present application
  • FIG. 4 is a flowchart of implementing an accounting method for a physical seal in Embodiment 4 of the present application.
  • FIG. 5 is a flowchart of implementing a method for recording a physical seal in a fifth embodiment of the present application.
  • FIG. 6 is a structural diagram of an accounting method for a physical seal in Embodiment 6 of the present application.
  • FIG. 7 is a structural block diagram of a terminal device in Embodiment 7 of the present application.
  • FIG. 8 is a schematic diagram of a terminal device in Embodiment 8 of the present application.
  • FIG. 1 is a flowchart of implementing a method for recording a physical seal provided by an embodiment of the present application. As shown in Figure 1, the accounting method includes the following steps:
  • S101 Establish a communication connection with the recorder inside the physical seal, and obtain a print record of the physical seal recorded by the recorder, where the print record includes a print time.
  • a recorder is mounted inside the physical seal, and the recorder is used to generate a print record of the secondary print when the user uses the physical seal for the print.
  • the recorder in the physical seal may include a single-chip microcomputer, and may further include more components, which are not limited in the embodiment of the present application.
  • the recorder in the first generation method of recording with a seal, includes a single-chip microcomputer and a pressure sensor.
  • the single-chip microcomputer is connected to the pressure sensor. When the user presses a physical seal for printing, the pressure sensor obtains the pressure applied by the user and converts The electrical signal is transmitted to the single-chip microcomputer. After receiving the electrical signal, the single-chip microcomputer generates a print record.
  • the recorder includes a single-chip microcomputer and a sprayer, and the sprayer is connected to the recorder.
  • the sprayer transmits the electric signal to the recorder, and the recorder generates a print record after obtaining the electric signal.
  • the use record includes the use time.
  • the use time is the current time obtained by the recorder when the physical seal is used. According to the needs of the actual scene, the print record can also include more content.
  • the print record can also include the number of times the physical seal is used (the number of uses is initially set to zero, and the recorder detects that each time the print is used, the number of uses is accumulated once).
  • Human biological information such as images or fingerprints of printed people collected through additional components
  • printed files such as images of printed files collected through additional components.
  • the execution subject is a terminal device.
  • the terminal device In order for the terminal device to obtain the print record generated by the recorder, first establish a communication connection between the terminal device and the recorder in the physical seal. Establishing the communication connection may be establishing a wired communication connection. You can also establish a wireless communication connection.
  • the terminal device can connect with the recorder through wireless communication methods such as 3G, 4G, Wi-Fi, or Bluetooth. After the connection is successful, the terminal device obtains the record of the physical seal generated by the recorder based on the communication connection.
  • the acquisition method may be that the terminal device actively initiates an acquisition request to the recorder in real time or at a fixed interval, or the recorder is in the After the print record is generated, an upload request is actively initiated to the terminal device in real time, so that the print record is transmitted. It is worth mentioning that, in the embodiment of the present application, the terminal device may establish a communication connection with a plurality of recorders in different physical seals.
  • S102 Sort a plurality of the print records according to the print time, and send the sorted multiple print records to a preset blockchain network.
  • the terminal device After receiving the multiple print records, the terminal device sorts the multiple print records in ascending order of the print time, and packs and sends the sorted multiple print records to a preset blockchain network for accounting.
  • the blockchain refers to a distributed ledger in which data blocks are sequentially connected in a chronological order, and a cryptographic method is used to ensure that the data blocks cannot be tampered with and cannot be forged. Guarantee the uniqueness and immutability of printed records. It is worth mentioning that due to the difficulty of generating new blocks in the blockchain network, the terminal device only uploads and prints multiple print records after receiving multiple print records instead of receiving the print records. Immediately after that, the printed record was uploaded to the blockchain network.
  • S103 The nodes in the blockchain network perform hash encryption on the block header of the latest block in the blockchain network to obtain a first hash value, and hash a plurality of the printed records after sorting.
  • a second hash value is obtained by encryption, and a print block is generated based on the first hash value, the second hash value, and a plurality of sorted print records. If the print block is located in the area, If the result of the consensus verification in the blockchain network is successful, the block for printing is added to the latest block.
  • the blockchain network is a decentralized point-to-point network, every server or device connected to the blockchain network is considered as a node in the blockchain network.
  • the data block in the blockchain network includes a block header and a block body.
  • the block header stores hash values for identification and calculation, and the block body stores actual transaction data.
  • the nodes in the blockchain network (including but not limited to the terminal device itself) upload the last one of the blockchain network.
  • the data block is used as the latest block.
  • the block header of the latest block is hash-encrypted to obtain a first hash value, and the sorted multiple print records are hash-encrypted to obtain a second hash value.
  • a hash value, a second hash value, and a plurality of sorted print records to construct a print block specifically, a block header for constructing a print block based on the first hash value and a second hash value, based on the sorted A block body of a plurality of printed records to construct a printed block.
  • the hash encryption in the embodiment of the present application is based on the Hash function for encryption. Since any input of any length is converted into a fixed-length output after being encrypted by the Hash function, and different inputs are passed through the Hash function The output obtained after encryption is different, so hash encryption can be applied in the blockchain network to identify each data block in the blockchain network.
  • one or more print blocks may be generated.
  • the printed block is published to the blockchain network for consensus verification.
  • the consensus verification can be performed by a practical Byzantine fault tolerance algorithm (Practical Byzantine Fault Tolerance (PBFT), Delegated Proof of Stake (DPOS), Proof of Work (POW), or Proof of Stake (POS) consensus mechanisms are implemented.
  • PBFT Practical Byzantine Fault Tolerance
  • DPOS Delegated Proof of Stake
  • POW Proof of Work
  • POS Proof of Stake
  • FIG. 6 is a structural diagram of an accounting method for a physical seal in an embodiment of the present application.
  • a terminal device establishes a communication connection with a recorder in multiple physical seals, and the recorder sends the generated seal record to the terminal device. Then, the terminal device sorts the multiple print records according to the print time, and sends the sorted multiple print records to the blockchain network.
  • the nodes in the blockchain network generate the print area based on the sorted multiple print records. Block, if the printed block passes consensus verification in the blockchain network, all nodes in the blockchain network will be notified to link the used block to the latest block in the blockchain network, and complete the block chain record recorded with printed block Account.
  • FIG. 2 is a flowchart of implementing a method for bookkeeping a physical seal provided by an embodiment of the present application.
  • the genesis block of the blockchain network in this embodiment includes multiple private keys for printing, each of which corresponds to a preset value, and the genesis block is a blockchain.
  • S201 ⁇ S203 are obtained after expanding S102, as detailed below:
  • a node in the blockchain network queries the number of blocks of the latest block, and maps the number of blocks to obtain a mapping value.
  • the terminal device sends the multiple printed records to the blockchain network
  • a node in the blockchain network when a node in the blockchain network generates a printed block based on the multiple printed records, it first queries the latest The number of blocks of a block, which is the total number of all data blocks in the blockchain network. Then, the node performs a mapping process on the number of blocks to obtain a mapping value.
  • the specific manner of the mapping process can be determined according to the actual application scenario. In order to facilitate the description of the embodiments of the present application, it is assumed that the mapping process uses the mantissa of the number of blocks as the mapping value. For example, if the number of blocks is 3421, the mapping value is 1. It should be known that the above examples do not constitute a limitation on the embodiments of the present application.
  • S202 Query the genesis block, determine a private key for printing corresponding to the mapping value, and encrypt a plurality of the printed records after printing by using the private key for encryption to obtain an encrypted record.
  • the genesis block is the first data block in the blockchain network.
  • multiple private keys for printing are stored in the genesis block, each private key for printing and a preset value.
  • the genesis block stores ten private keys for printing, which correspond to the values 0, 1, 2, ..., 9 respectively.
  • the private seal key is generated by a preset private seal encryption algorithm, and the private seal encryption algorithm is preferably an asymmetric encryption algorithm, such as an RSA asymmetric encryption algorithm.
  • the node obtains the mapping value of the block number, it queries the genesis block to determine the printing private key corresponding to the mapping value. For example, if the mapping value is 2, the private printing key corresponding to the value 2 is determined from ten private printing keys. . Then, the node encrypts the multiple printed records based on the printed private key corresponding to the mapped value to obtain an encrypted record.
  • S203 The nodes in the blockchain network hash-encrypt the block header of the latest block to obtain the first hash value, and hash-encrypt the encrypted record to obtain the second hash. Value, generating the block for printing based on the first hash value, the second hash value, and the encrypted record.
  • the nodes in the blockchain network After the nodes in the blockchain network have completed the encryption of the sorted multiple printed records, the nodes of the latest block in the blockchain network are hashed to obtain the first hash value, and the encrypted records (and Non-printed record) hash encryption to obtain a second hash value, and generate the printed block based on the first hash value, the second hash value, and the encrypted record, specifically based on the first hash value and the second hash value
  • the block header of the printed block is constructed, and the block body of the printed block is constructed based on the encrypted record.
  • the printed public key corresponding to the printed private key is sent to a node having viewing authority.
  • the public key of the private key corresponding to the private key of the private key generated based on the private key of the private key can also be sent to a node in the blockchain network that has permission to view the content.
  • the public key of the private key can be used to encrypt the content encrypted by the private key of the private key. Decrypt.
  • the node with viewing rights can access the Yin block, read the encrypted record in the Yin block, and decrypt the encrypted record using the public key stored in the node. Get multiple printed records. Take the above example for illustration.
  • Print block first get the block number of the print block in the blockchain network (that is, the total number of data blocks from the genesis block to the print block), and perform a minus operation on the block number Obtain the number of target blocks, and perform the mapping process on the number of target blocks to obtain the target mapping value. Find the public key for printing corresponding to the target mapping value stored by the node, and use the public key for decryption to decrypt the encrypted record in the block. To get multiple printed records.
  • the number of blocks in the blockchain network using the printed block is 1234, and the number of target blocks is 1233.
  • the public key of the printed block corresponding to the value 3 stored in the node is found, and the encrypted public key is used to encrypt the printed block.
  • the records are decrypted. For nodes that do not store a useful public key, they can only read the encrypted records in the printed blocks, but cannot decrypt the encrypted records. That is, the printed records are not available to nodes that do not have the viewing authority, which improves the printed records. Confidentiality.
  • the print block is generated based on the encrypted content, which improves the confidentiality of the print record.
  • FIG. 3 is a flowchart of implementing a method for recording a physical seal provided by an embodiment of the present application. Compared with the embodiment corresponding to FIG. 1, this embodiment extends S101 to S301 to S302 on the basis of using a print record that also includes a seal identification code. The details are as follows:
  • S301 Establish a corresponding record pool for each seal identification code, identify the seal identification code in the received print record, and store the print record in the corresponding record pool.
  • the seal record generated by the recorder further includes a seal identification code of the physical seal.
  • the seal identification code is an anti-counterfeit code of the physical seal and is unique.
  • the seal identification code may be Save to logger. Because the terminal device can establish a communication connection with the recorders of multiple physical seals, the terminal device may receive multiple print records including different seal identification codes.
  • a separate storage mechanism is applied to the used recording records including different seal identification codes. Specifically, a corresponding recording pool is established for each seal identification code, and the recording pool is used to store the used printing records.
  • the format may be
  • the data table in the database can also be a text file or a Comma-Separated value Values, CSV) files.
  • CSV Comma-Separated value Values
  • the number of print records in each record pool is obtained at a fixed statistical interval. If the number of print records in a record pool reaches a preset threshold, the multiple print pools in the record pool The records are sorted according to the printing time, and multiple sorted printing records are sent to the blockchain network.
  • an execution priority is set for each recording pool.
  • an execution priority may be set for each recording pool. If it is detected that the number of print records in two or more recording pools simultaneously reaches a preset threshold, the recording pool with a higher priority is first set. A plurality of print records in the sequence are sorted according to the print time. By setting a priority on the recording pool, the order of the print records is improved.
  • FIG. 4 is a flowchart of implementing a method for bookkeeping of a physical seal provided by an embodiment of the present application.
  • this embodiment refines S103 on the basis that the genesis block of the blockchain network includes multiple authorized node addresses, each authorized node address corresponding to a seal identification code Get S401 ⁇ S402, as follows:
  • S401 identify the seal identification code recorded by the print in the print block as the target identification code.
  • each authorized node address corresponds to a seal identification code
  • the authorized node address indicates Regarding the address of a node having access rights with a seal including a seal identification code
  • the authorized node address may also be an authorized node address set, which includes multiple addresses. Since the print records in a print block correspond to the same seal identification code, in the embodiment of the present application, when a node in the blockchain network links the print block to the latest block, the print block is identified. A stamp identification code recorded in the block is used as a target identification code.
  • S402 Determine the authorized node address corresponding to the target identification code, and set an access restriction interface for the printed block based on the authorized node address, and the access restriction interface is used to prevent except the authorized node address. Access the printed block.
  • the blockchain network After obtaining the target identification code, access the genesis block of the blockchain network, and determine the authorized node address corresponding to the target identification code from the multiple authorized node addresses stored in the genesis block. Then, setting an access restriction interface for the used block based on the authorized node address is essentially to set an access authentication mechanism for the used block. After the access restriction interface is set up, if a node in the blockchain network wants to access the printed block, the blockchain network will verify that the node's address is the same as the authorized node address in the access restriction interface. This node accesses the seal block; if it is not the same, the node is prohibited from accessing the seal block, which further enhances the security of the seal record in the seal block, and is applicable to scenarios such as the physical seal being a confidential official seal.
  • the embodiment of the present application improves the exclusivity and confidentiality of the print records in the print blocks by establishing access restrictions on the print blocks.
  • FIG. 5 is a flowchart of implementing a method for bookkeeping of a physical seal provided by an embodiment of the present application. Compared with the embodiment corresponding to FIG. 3, this embodiment further refines S301 to obtain S501 to S503 on the basis that the printed record also includes an encrypted verification code, which are detailed as follows:
  • S501 Decrypt the received print record based on multiple verification keys in a preset verification key set.
  • the recorder when the recorder generates a print record, it also encrypts a preset verification code based on a verification encryption algorithm, and adds the encrypted verification code to the print record, wherein the verification code and the seal identification code Correspondence, that is, different seal identification codes correspond to different verification codes.
  • the verification encryption algorithm can be determined according to the actual application scenario. For example, it can be a symmetric encryption algorithm or an asymmetric encryption algorithm. For physical seals with different seal identification codes, the same verification encryption algorithm can be used, or different verifications can be used. Encryption Algorithm. To facilitate decryption, the encrypted verification code can be added to the preset decryption position in the printed record.
  • the corresponding verification code and the verification key used for decryption in the verification encryption algorithm are stored in advance.
  • the storage address can be a data block in the blockchain network, or it can be The database of the terminal device.
  • the terminal device receives the print record transmitted by the recorder, it obtains the verification key set and the verification code corresponding to each seal identification code, and sequentially uses the multiple verification keys in the verification key set to sequentially verify the encrypted verification in the print record. Code to decrypt.
  • the verification key is used to decrypt the content at the decrypted position in the printed record. If the obtained result is the same as the verification code corresponding to the stamp identification code in the printed record, it is determined that the printed record is valid.
  • the printed records are stored in the corresponding record pool.
  • FIG. 7 shows a structural block diagram of a terminal device according to an embodiment of the present application, and each unit included in the terminal device is configured to execute steps in the embodiment corresponding to FIG. 1.
  • each unit included in the terminal device is configured to execute steps in the embodiment corresponding to FIG. 1.
  • only the parts related to this embodiment are shown.
  • the terminal device includes:
  • An obtaining unit 71 configured to establish a communication connection with the recorder inside the physical seal, and obtain a print record of the physical seal recorded by the recorder, where the print record includes a print time;
  • a sending unit 72 configured to sort a plurality of the print records according to the print time, and send the sorted multiple print records to a preset blockchain network;
  • An adding unit 73 is configured for a node in the blockchain network to hash and encrypt a block header of a latest block in the blockchain network to obtain a first hash value, and to sort a plurality of the used user labels after the sorting.
  • a record is hash-encrypted to obtain a second hash value, and a print block is generated based on the first hash value, the second hash value, and a plurality of sorted print records. If the result of the consensus verification in the blockchain network is successful, the printed block is added to the latest block.
  • the genesis block of the blockchain network includes multiple printing private keys, each of which corresponds to a preset value, and the genesis block is the first data block in the blockchain network
  • the sending unit 72 further includes:
  • a first query unit configured for a node in the blockchain network to query the number of blocks of the latest block, and perform a mapping process on the number of blocks to obtain a mapping value
  • a second querying unit configured to query the genesis block, determine a private key for printing corresponding to the mapping value, and encrypt a plurality of the printed records for use by the private key for encryption to obtain an encrypted record;
  • the adding unit 73 includes:
  • a generating unit configured to use a node in the blockchain network to hash the block header of the latest block to obtain the first hash value, and hash-encrypt the encrypted record to obtain the first A two hash value, generating the printed block based on the first hash value, the second hash value, and the encrypted record.
  • the print record further includes a seal identification code
  • the obtaining unit 71 further includes:
  • a depositing unit configured to separately establish a corresponding recording pool for each seal identification code, and identify the seal identification code in the received printing record, and store the printing record into the corresponding recording pool in;
  • An execution unit is configured to perform the operation of sorting a plurality of the print records according to the print time when the number of the print records in the recording pool reaches a preset threshold.
  • the genesis block of the blockchain network includes multiple authorized node addresses, each authorized node address corresponding to a seal identification code, and the adding unit 73 further includes:
  • An identification unit configured to identify a seal identification code recorded by the print in the print block as a target identification code
  • a setting unit configured to determine the authorized node address corresponding to the target identification code, and set an access restriction interface for the printed block based on the authorized node address, the access restriction interface being used to prevent the authorization from being removed Addresses other than the node address access the printed block.
  • the printed record further includes an encrypted verification code
  • the depositing unit includes:
  • a decryption unit configured to decrypt the received print record based on a plurality of verification keys in a preset verification key set
  • a depositing subunit for storing the print record in a corresponding recording pool if the result obtained after decryption includes the verification code
  • An alarm unit is configured to output an alarm prompt if the result obtained after decryption does not include the verification code.
  • FIG. 8 is a schematic diagram of a terminal device according to an embodiment of the present application.
  • the terminal device 8 of this embodiment includes a processor 80 and a memory 81.
  • the memory 81 stores computer-readable instructions 82 that can be run on the processor 80, such as a physical seal. Account procedures.
  • the processor 80 executes the computer-readable instructions 82, the steps in the embodiment of the accounting method for realizing the foregoing individual seals are implemented, for example, steps S101 to S103 shown in FIG.
  • the processor 80 executes the computer-readable instructions 82
  • the functions of the units in the foregoing terminal device embodiment are implemented, for example, the functions of the units 71 to 73 shown in FIG. 7.
  • the computer-readable instructions 82 may be divided into one or more modules / units, the one or more modules / units are stored in the memory 81 and executed by the processor 80, To complete this application.
  • the one or more modules / units may be a series of computer-readable instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer-readable instructions 82 in the terminal device 8.
  • the computer-readable instructions 82 may be divided into an obtaining unit, a sending unit, and an adding unit, and the specific functions of each unit are as described above.
  • the terminal device may include, but is not limited to, a processor 80 and a memory 81.
  • FIG. 8 is only an example of the terminal device 8 and does not constitute a limitation on the terminal device 8. It may include more or fewer components than shown in the figure, or combine some components or different components
  • the terminal device may further include an input / output device, a network access device, a bus, and the like.
  • the processor 80 may be a central processing unit (Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), and application-specific integrated circuits (Applications) Specific Integrated Circuit (ASIC), off-the-shelf Programmable Gate Array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • CPU Central Processing Unit
  • DSP digital signal processor
  • ASIC application-specific integrated circuits
  • FPGA off-the-shelf Programmable Gate Array
  • a general-purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the memory 81 may be an internal storage unit of the terminal device 8, such as a hard disk or a memory of the terminal device 8.
  • the memory 81 may also be an external storage device of the terminal device 8, such as a plug-in hard disk, a smart media card (SMC), and a secure digital (SD) provided on the terminal device 8. Card, flash card, etc. Further, the memory 81 may further include both an internal storage unit of the terminal device 8 and an external storage device.
  • the memory 81 is configured to store the computer-readable instructions and other programs and data required by the terminal device.
  • the memory 81 may also be used to temporarily store data that has been output or is to be output.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each of the units may exist separately physically, or two or more units may be integrated into one unit.
  • the above integrated unit may be implemented in the form of hardware or in the form of software functional unit.
  • the integrated unit When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a computer-readable storage medium.
  • the technical solution of the present application is essentially a part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium. , Including a plurality of instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in the embodiments of the present application.
  • the foregoing storage media include: U disks, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks and other media that can store program codes .

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Computer Security & Cryptography (AREA)
  • Accounting & Taxation (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Power Engineering (AREA)
  • Strategic Management (AREA)
  • Finance (AREA)
  • Storage Device Security (AREA)

Abstract

一种实体印章的记账方法及终端设备,适用于数据处理技术领域,该方法包括:与所述实体印章内部的所述记录器建立通信连接,并获取所述记录器记录的所述实体印章的用印记录,所述用印记录包括用印时间(S101);对多个所述用印记录按照所述用印时间进行排序,并将排序后的多个所述用印记录发送至预设的区块链网络中(S102);所述区块链网络中的节点基于排序后的多个所述用印记录生成用印区块,若将所述用印区块在所述区块链网络中进行共识验证的结果为成功,则将所述用印区块添加至所述最新区块(S103)。该方案基于区块链的记账技术,将实体印章的用印记录在区块链网络中进行记账,提升了实体印章用印的透明化程度。

Description

实体印章的记账方法及终端设备
本申请要求于2018年09月03日提交中国专利局、申请号为201811020992.9、名称为“实体印章的记账方法及终端设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请属于数据处理技术领域,尤其涉及一种实体印章的记账方法及终端设备。
背景技术
印章是用于印于文件上表示鉴定或签署的文具,由于某些印章如公章对于安全方面的需求较高,通常只限于指定的个人或单位使用,或只限于指定的用途,故为了防止印章伪造和滥用,需要对印章的使用记录进行记账。
在现有技术中,通常是对电子印章进行记账,也即是记录将电子印章加盖至电子文件的过程,而对于实体印章,并不存在有效的记账方法,导致实体印章的使用过程不够清晰透明,并且通过伪造的印章用印后,无法辨认真伪。综上,现有技术中,无法对实体印章的使用记录进行记账。
技术问题
有鉴于此,本申请实施例提供了一种实体印章的记账方法及终端设备,以解决现有技术中无法对实体印章的使用记录进行记账的问题。
技术解决方案
本申请实施例的第一方面提供了一种实体印章的记账方法,包括:
与所述实体印章内部的所述记录器建立通信连接,并获取所述记录器记录的所述实体印章的用印记录,所述用印记录包括用印时间;
对多个所述用印记录按照所述用印时间进行排序,并将排序后的多个所述用印记录发送至预设的区块链网络中;
所述区块链网络中的节点对所述区块链网络中最新区块的区块头进行哈希加密得到第一哈希值,并对排序后的多个所述用印记录进行哈希加密得到第二哈希值,基于所述第一哈希值、所述第二哈希值以及排序后的多个所述用印记录生成用印区块,若将所述用印区块在所述区块链网络中进行共识验证的结果为成功,则将所述用印区块添加至所述最新区块。
本申请实施例的第二方面提供了一种终端设备,可以包括用于实现上述实体印章的记账方法的步骤的单元。
本申请实施例的第三方面提供了一种终端设备,包括存储器以及处理器,所述存储器中存储有可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现上述实体印章的记账方法的步骤。
本申请实施例的第四方面提供了一种计算机非易失性可读存储介质,所述计算机非易失性可读存储介质存储有计算机可读指令,所述计算机可读指令被处理器执行时实现上述实体印章的记账方法的步骤。
有益效果
本申请实施例通过与实体印章内部的记录器建立通信连接,从而获取记录器记录的实体印章的用印记录,在接收到多个用印记录后,将排序后的多个用印记录发送至区块链网络,区块链网络的节点基于排序后的多个用印记录生成用印区块,并在用印区块共识验证成功后,将用印区块添加至区块链网络的最新区块,本申请实施例基于区块链对实体印章的用印记录进行记账,使实体印章的使用情况清晰可见,提升了用印的透明程度。
附图说明
图1是本申请实施例一中实体印章的记账方法的实现流程图;
图2是本申请实施例二中实体印章的记账方法的实现流程图;
图3是本申请实施例三中实体印章的记账方法的实现流程图;
图4是本申请实施例四中实体印章的记账方法的实现流程图;
图5是本申请实施例五中实体印章的记账方法的实现流程图;
图6是本申请实施例六中实体印章的记账方法的架构图;
图7是本申请实施例七中终端设备的结构框图;
图8是本申请实施例八中终端设备的示意图。
本发明的实施方式
为了对本申请的技术特征、目的和效果有更加清楚的理解,现对照附图详细说明本申请的具体实施方式。
请参阅图1,图1是本申请实施例提供的一种实体印章的记账方法的实现流程图。如图1所示,该记账方法包括以下步骤:
S101:与所述实体印章内部的所述记录器建立通信连接,并获取所述记录器记录的所述实体印章的用印记录,所述用印记录包括用印时间。
在本申请实施例中,实体印章内部搭载有记录器,该记录器用于在用户使用实体印章进行用印时,生成该次用印的用印记录。实体印章内的记录器可包括单片机,还可包括更多的部件,本申请实施例对此不做限定。举例来说,在用印记录的第一种生成方式中,记录器包括单片机和压力传感器,单片机与压力传感器连接,当用户按压实体印章进行用印时,压力传感器获取到用户施加的压力,并转换为电信号传输至单片机,单片机在接收到该电信号后生成用印记录;在另一种生成方式中,记录器包括单片机和喷涂器,喷涂器与记录器连接,该喷涂器用于在用户按压实体印章时输出墨水,用户在按压实体印章进行用印时,喷涂器将电信号传输至记录器,记录器在获取到该电信号后生成用印记录。当然,根据记录器包括部件的不同,用印记录还可存在更多的生成方式。用印记录包括用印时间,用印时间为实体印章被用印时,记录器获取的当前时间。根据实际场景的需要,用印记录还可包括更多内容,比如用印记录还可包括实体印章的使用次数(使用次数初始置为零,记录器检测到每用印一次,则使用次数累加一次)、用印人的生物信息(比如通过额外的部件采集到的用印人的图像或指纹)或用印文件(比如通过额外的部件采集到的被用印的文件的图像)等。
在本申请实施例中,执行主体为终端设备,为了使终端设备获取到记录器生成的用印记录,首先将终端设备与实体印章内的记录器建立通信连接,建立通信连接可以为建立有线通信连接,也可以为建立无线通信连接,比如终端设备可与记录器通过3G、4G、Wi-Fi或蓝牙等无线通信方式进行连接。连接成功后,终端设备基于通信连接获取记录器生成的实体印章的用印记录,其中,获取方式可以是终端设备实时或每隔固定的时间间隔向记录器主动发起获取请求,也可以是记录器在生成用印记录后,实时向终端设备主动发起上传请求,从而进行用印记录的传输。值得一提的是,在本申请实施例中,终端设备可与多个不同的实体印章中的记录器建立通信连接。
S102:对多个所述用印记录按照所述用印时间进行排序,并将排序后的多个所述用印记录发送至预设的区块链网络中。
终端设备在接收到多个用印记录后,对多个用印记录按照用印时间从小到大的顺序进行排序,并将排序后的多个用印记录打包发送至预设的区块链网络进行记账。其中,区块链是指按照时间顺序将数据区块以顺序相连的方式组合成的,并以密码学方式保证数据区块不可篡改和不可伪造的分布式账本,用于本申请实施例中以保证用印记录的唯一性和不可篡改性。值得一提的是,由于在区块链网络中产生新区块的难度较高,故终端设备在接收到多个用印记录后,才将多个用印记录进行打包上传,而不是在接收到用印记录后,立刻将该用印记录上传至区块链网络。
S103:所述区块链网络中的节点对所述区块链网络中最新区块的区块头进行哈希加密得到第一哈希值,并对排序后的多个所述用印记录进行哈希加密得到第二哈希值,基于所述第一哈希值、所述第二哈希值以及排序后的多个所述用印记录生成用印区块,若将所述用印区块在所述区块链网络中进行共识验证的结果为成功,则将所述用印区块添加至所述最新区块。
由于区块链网络是去中心化的点对点网络,故将接入区块链网络的每一个服务器或设备都看作区块链网络中的节点。区块链网络中的数据区块包括区块头和区块体,区块头存放有用于标识和计算的哈希值,区块体存放有实际的交易数据。在本申请实施例中,在终端设备将排序后的多个用印记录上传至区块链网络后,区块链网络中的节点(包括但不限于终端设备本身)将区块链网络的最后一个数据区块作为最新区块,对该最新区块的区块头进行哈希加密得到第一哈希值,并对排序后的多个用印记录进行哈希加密得到第二哈希值,然后基于第一哈希值、第二哈希值以及排序后的多个用印记录构建用印区块,具体地,基于第一哈希值和第二哈希值构建用印区块的区块头,基于排序后的多个用印记录构建用印区块的区块体。值得一提的是,本申请实施例中的哈希加密即为基于Hash函数进行加密,由于任意长度的输入在经过Hash函数加密后都会转换为固定长度的输出,并且不同的输入在经过Hash函数加密后得到的输出是不同的,故可在区块链网络中应用哈希加密以标识区块链网络中的每个数据区块。另外,根据排序后的多个用印记录的数据量不同,生成的用印区块可能为一个或多个。在区块链网络中的节点生成用印区块后,将用印区块发布至区块链网络中进行共识验证,共识验证可通过实用拜占庭容错算法(Practical Byzantine Fault Tolerance,PBFT)、委托权益证明(Delegated Proof of Stake,DPOS)、工作证明(Proof of Work,POW)或股权证明(Proof of Stake,POS)等共识机制实现。如果区块链网络中的某个节点发布的用印区块在区块链网络中共识验证成功,则通知区块链网络中的所有节点将用印区块链接至区块链网络中的最新区块,完成多个用印记录在区块链网络中的记账。
图6是本申请实施例中实体印章的记账方法的结构图,如图6所示,终端设备与多个实体印章中的记录器建立通信连接,记录器将生成的用印记录发送至终端设备后,终端设备对多个用印记录按照用印时间进行排序,并将排序后的多个用印记录发送至区块链网络中,区块链网络中的节点基于排序后的多个用印记录生成用印区块,如果用印区块在区块链网络中通过共识验证,则通知区块链网络中的所有节点将用印区块链接至区块链网络中的最新区块,完成用印记录的区块链记账。
通过图1所示实施例可知,本申请实施例实现了实体印章用印记录的区块链记账,提升了实体印章用印的透明化程度。
请参阅图2,图2是本申请实施例提供的一种实体印章的记账方法的实现流程图。相对于图1对应的实施例,本实施例在区块链网络的创世区块包括多个用印私钥,每个用印私钥与一个预设的数值对应,创世区块为区块链网络中的第一个数据区块的基础上,对S102进行扩展后得到S201~S203,详述如下:
S201:所述区块链网络中的节点查询所述最新区块的区块数,并对所述区块数进行映射处理,得到映射值。
在本申请实施例中,终端设备将排序后的多个用印记录发送至区块链网络后,区块链网络中的节点在基于排序后的多个用印记录生成用印区块时,首先查询最新区块的区块数,该区块数即为区块链网络中的所有数据区块的总数。然后,节点对区块数进行映射处理得到映射值。映射处理的具体方式可根据实际应用场景进行确定,为了便于说明本申请实施例的内容,假设映射处理为将区块数的尾数作为映射值,比如区块数为3120,则映射值为0,比如区块数为3421,则映射值为1,应获知的是,上述例子并不构成对本申请实施例的限定。
S202:查询所述创世区块,确定与所述映射值对应的用印私钥,通过所述用印私钥对排序后的多个所述用印记录进行加密得到加密记录。
创世区块为区块链网络中的第一个数据区块,在创建创世区块时,在创世区块中存储多个用印私钥,每个用印私钥与一个预设的数值对应,为了便于说明,假设创世区块存储有十个用印私钥,分别与数值0,1,2,……,9对应。用印私钥由预设的用印加密算法生成,用印加密算法优选为非对称加密算法,比如RSA非对称加密算法。节点在得到区块数的映射值后,查询创世区块,确定与映射值对应的用印私钥,比如映射值为2,则从十个用印私钥中确定与数值2对应的用印私钥。然后,节点基于与映射值对应的用印私钥对排序后的多个用印记录进行加密得到加密记录。
S203:所述区块链网络中的节点对所述最新区块的区块头进行哈希加密得到所述第一哈希值,并对所述加密记录进行哈希加密得到所述第二哈希值,基于所述第一哈希值、所述第二哈希值以及所述加密记录生成所述用印区块。
区块链网络中的节点在完成对排序后的多个用印记录的加密后,对区块链网络中最新区块的区块头进行哈希加密得到第一哈希值,并对加密记录(而非用印记录)进行哈希加密得到第二哈希值,基于第一哈希值、第二哈希值以及加密记录生成所述用印区块,具体基于第一哈希值和第二哈希值构建用印区块的区块头,基于加密记录构建用印区块的区块体。
可选地,将与用印私钥对应的用印公钥发送至具有查看权限的节点。在本申请实施例中,还可将基于用印加密算法生成的与用印私钥对应的用印公钥发送至区块链网络中具有查看权限的节点,用印公钥可对经用印私钥加密的内容进行解密。当用印区块通过共识验证,并链接至最新区块时,具有查看权限的节点可访问用印区块,读取用印区块中的加密记录,并使用节点存储的用印公钥对加密记录进行解密得到多个用印记录。以上述例子进行说明,假设存在十个用印公钥,分别与数值0,1,2,……,9对应,则存储有十个用印公钥的节点若想访问区块链网络中的某个用印区块,首先获取该用印区块在区块链网络中的区块数(即从创世区块到用印区块的数据区块的总个数),对该区块数执行减一操作得到目标区块数,并对目标区块数进行映射处理得到目标映射值,查找节点存储的与目标映射值对应的用印公钥,并利用该用印公钥对用印区块中的加密记录进行解密,得到多个用印记录。比如用印区块在区块链网络中的区块数1234,则目标区块数为1233,查找节点存储的与数值3对应的用印公钥,并利用该用印公钥对用印区块中的加密记录进行解密。而对于未存储有用印公钥的节点,只能读取用印区块中的加密记录,而无法对加密记录进行解密,即用印记录对于不具有查看权限的节点是无法获取的,提升了用印记录的保密性。
通过图2所示实施例可知,本申请实施例对用印记录加密后,再基于加密后的内容生成用印区块,提升了用印记录的保密性。
请参阅图3,图3是本申请实施例提供的一种实体印章的记账方法的实现流程图。相对于图1对应的实施例,本实施例在用印记录还包括印章识别码的基础上,对S101进行扩展后得到S301~S302,详述如下:
S301:分别为每个印章识别码建立对应的记录池,并识别接收到的所述用印记录中的所述印章识别码,将所述用印记录存入至对应的所述记录池中。
在本申请实施例中,记录器生成的用印记录还包括实体印章的印章识别码,该印章识别码是实体印章的防伪码,具有唯一性,为了方便用印记录的生成,可将印章识别码预先存入记录器中。由于终端设备可与多个实体印章的记录器建立通信连接,故终端设备可能接收到多个包括不同印章识别码的用印记录。在本申请实施例中,对包括不同印章识别码的用印记录应用分开存储的机制,具体地,分别为每个印章识别码建立对应的记录池,该记录池用于存储用印记录,格式可以为数据库中的数据表,也可以为文本文件,还可以为逗号分隔值(Comma-Separated Values,CSV)文件等。终端设备在接收到用印记录时,识别用印记录中的印章识别码,并将用印记录存储至与印章识别码对应的记录池中。
在S302中,当所述记录池中的所述用印记录的数量达到预设阈值时,执行所述对多个所述用印记录按照所述用印时间进行排序的操作。
对于设置的多个记录池,每隔固定的统计间隔获取每个记录池中用印记录的数量,若某个记录池中的用印记录的数量达到预设阈值,则对该记录池的多个用印记录按照用印时间进行排序,并将排序后的多个用印记录发送至区块链网络中。
可选地,对每个记录池设置执行优先级。在本申请实施例中,可对每个记录池设置执行优先级,若检测到同时存在两个以上的记录池中的用印记录的数量达到预设阈值,则先对优先级较高的记录池中的多个用印记录执行按照用印时间进行排序的操作,通过对记录池设置优先级,提升了用印记录记账的有序性。
通过图3所示实施例可知,本申请实施例为每个印章识别码单独建立记录池,提升了记账的有序性,并且在记录池中用印记录的数量达到预设阈值时才进行记账,减小了计算资源的损耗。
请参阅图4,图4是本申请实施例提供的一种实体印章的记账方法的实现流程图。相对于图3对应的实施例,本实施例在区块链网络的创世区块包括多个授权节点地址,每个授权节点地址与一个印章识别码对应的基础上,对S103进行细化后得到S401~S402,详述如下:
S401:识别所述用印区块中所述用印记录的印章识别码,作为目标识别码。
在本申请实施例中,在创建区块链网络中的创世区块时,在创世区块中存储多个授权节点地址,每个授权节点地址与一个印章识别码对应,授权节点地址指示对于包括印章识别码的用印记录具有访问权限的节点的地址,值得一提的是,根据实际应用场景的不同,授权节点地址也可以为授权节点地址集,即包括多个地址。由于一个用印区块内的用印记录均对应相同的印章识别码,故在本申请实施例中,在区块链网络中的某个节点将用印区块链接至最新区块时,识别该用印区块中用印记录的印章识别码,并将该印章识别码作为目标识别码。
S402:确定与所述目标识别码对应的所述授权节点地址,并基于所述授权节点地址为所述用印区块设置访问限制接口,所述访问限制接口用于防止除所述授权节点地址外的地址访问所述用印区块。
在得到目标识别码后,访问区块链网络的创世区块,并从创世区块存储的多个授权节点地址中确定与目标识别码对应的授权节点地址。然后,基于该授权节点地址为该用印区块设置访问限制接口,实质是为该用印区块设置访问鉴权机制。在访问限制接口设置完成后,区块链网络中的节点若欲访问用印区块,则区块链网络会验证该节点的地址是否与访问限制接口中的授权节点地址相同,若相同,则允许该节点访问用印区块;若不相同,则禁止该节点访问用印区块,进一步提升了用印区块中用印记录的安全性,适用于实体印章为机密公章等场景。
通过图4所示实施例可知,本申请实施例通过对用印区块建立访问限制,提升了用印区块中用印记录的专有性和保密性。
请参阅图5,图5是本申请实施例提供的一种实体印章的记账方法的实现流程图。相对于图3对应的实施例,本实施例在用印记录还包括被加密的验证码的基础上,对S301进行细化后得到S501~S503,详述如下:
S501:基于预设的验证密钥集中的多个验证密钥对接收到的所述用印记录进行解密。
在本申请实施例中,记录器在生成用印记录时,还将预设的验证码基于验证加密算法进行加密,并将加密后的验证码添加至用印记录中,其中,验证码与印章识别码对应,也即不同的印章识别码对应不同的验证码。验证加密算法可根据实际应用场景进行确定,比如可为对称加密算法,也可为非对称加密算法,对于具有不同印章识别码的实体印章,可采用相同的验证加密算法,也可采用不同的验证加密算法。为了便于进行解密,可将加密后的验证码添加用印记录中预设的解密位置。
与之对应的,在生产实体印章时,将其对应的验证码以及验证加密算法中用于解密的验证密钥进行预先存储,存储地址可以为区块链网络中的数据区块,也可以为终端设备的数据库。终端设备在接收到记录器传输的用印记录时,获取验证密钥集以及与各个印章识别码对应的验证码,并通过验证密钥集中的多个验证密钥依次对用印记录中被加密的验证码进行解密。
S502:若解密后得到的结果包括所述验证码,则将所述用印记录存入至对应的所述记录池中。
通过验证密钥对用印记录中位于解密位置的内容进行解密,如果得到的结果与终端设备获取的,与该用印记录中的印章识别码对应的验证码相同,则确定该用印记录有效,将该用印记录存入对应的记录池中。
S503:若解密后得到的结果都不包括所述验证码,则输出报警提示。
如果通过验证密钥集中的所有验证密钥对用印记录中位于解密位置的内容进行解密后,得到的结果都不包括与该用印记录中印章识别码对应的验证码,则确定该用印记录无效,并输出报警提示,提示终端设备的用户对该用印记录进行查看。
通过图5所示实施例可知,本申请实施例通过在用印记录中设置加密后的验证码,有效地防止了用印记录伪造。
图7示出了本申请实施例提供的终端设备的结构框图,该终端设备包括的各单元用于执行图1对应的实施例中的各步骤。具体请参阅图1与图1所对应的实施例中的相关描述。为了便于说明,仅示出了与本实施例相关的部分。
参见图7,终端设备包括:
获取单元71,用于与所述实体印章内部的所述记录器建立通信连接,并获取所述记录器记录的所述实体印章的用印记录,所述用印记录包括用印时间;
发送单元72,用于对多个所述用印记录按照所述用印时间进行排序,并将排序后的多个所述用印记录发送至预设的区块链网络中;
添加单元73,用于所述区块链网络中的节点对所述区块链网络中最新区块的区块头进行哈希加密得到第一哈希值,并对排序后的多个所述用印记录进行哈希加密得到第二哈希值,基于所述第一哈希值、所述第二哈希值以及排序后的多个所述用印记录生成用印区块,若将所述用印区块在所述区块链网络中进行共识验证的结果为成功,则将所述用印区块添加至所述最新区块。
可选地,区块链网络的创世区块包括多个用印私钥,每个用印私钥与一个预设的数值对应,创世区块为区块链网络中的第一个数据区块,所述发送单元72,还包括:
第一查询单元,用于所述区块链网络中的节点查询所述最新区块的区块数,并对所述区块数进行映射处理,得到映射值;
第二查询单元,用于查询所述创世区块,确定与所述映射值对应的用印私钥,通过所述用印私钥对排序后的多个所述用印记录进行加密得到加密记录;
所述添加单元73,包括:
生成单元,用于所述区块链网络中的节点对所述最新区块的区块头进行哈希加密得到所述第一哈希值,并对所述加密记录进行哈希加密得到所述第二哈希值,基于所述第一哈希值、所述第二哈希值以及所述加密记录生成所述用印区块。
可选地,所述用印记录还包括印章识别码,所述获取单元71,还包括:
存入单元,用于分别为每个印章识别码建立对应的记录池,并识别接收到的所述用印记录中的所述印章识别码,将所述用印记录存入至对应的所述记录池中;
执行单元,用于当所述记录池中的所述用印记录的数量达到预设阈值时,执行所述对多个所述用印记录按照所述用印时间进行排序的操作。
可选地,区块链网络的创世区块包括多个授权节点地址,每个授权节点地址与一个印章识别码对应,所述添加单元73,还包括:
识别单元,用于识别所述用印区块中所述用印记录的印章识别码,作为目标识别码;
设置单元,用于确定与所述目标识别码对应的所述授权节点地址,并基于所述授权节点地址为所述用印区块设置访问限制接口,所述访问限制接口用于防止除所述授权节点地址外的地址访问所述用印区块。
可选地,用印记录还包括被加密的验证码,所述存入单元,包括:
解密单元,用于基于预设的验证密钥集中的多个验证密钥对接收到的所述用印记录进行解密;
存入子单元,用于若解密后得到的结果包括所述验证码,则将所述用印记录存入至对应的所述记录池中;
报警单元,用于若解密后得到的结果都不包括所述验证码,则输出报警提示。
图8是本申请实施例提供的终端设备的示意图。如图8所示,该实施例的终端设备8包括:处理器80以及存储器81,所述存储器81中存储有可在所述处理器80上运行的计算机可读指令82,例如实体印章的记账程序。所述处理器80执行所述计算机可读指令82时实现上述各个实体印章的记账方法实施例中的步骤,例如图1所示的步骤S101至S103。或者,所述处理器80执行所述计算机可读指令82时实现上述终端设备实施例中各单元的功能,例如图7所示单元71至73的功能。
示例性的,所述计算机可读指令82可以被分割成一个或多个模块/单元,所述一个或者多个模块/单元被存储在所述存储器81中,并由所述处理器80执行,以完成本申请。所述一个或多个模块/单元可以是能够完成特定功能的一系列计算机可读指令段,该指令段用于描述所述计算机可读指令82在所述终端设备8中的执行过程。例如,所述计算机可读指令82可以被分割成获取单元、发送单元和添加单元,各单元具体功能如上所述。
所述终端设备可包括,但不仅限于,处理器80、存储器81。本领域技术人员可以理解,图8仅仅是终端设备8的示例,并不构成对终端设备8的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述终端设备还可以包括输入输出设备、网络接入设备、总线等。
所称处理器80可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器 (Digital Signal Processor,DSP)、专用集成电路 (Application Specific Integrated Circuit,ASIC)、现成可编程门阵列 (Field-Programmable Gate Array,FPGA) 或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
所述存储器81可以是所述终端设备8的内部存储单元,例如终端设备8的硬盘或内存。所述存储器81也可以是所述终端设备8的外部存储设备,例如所述终端设备8上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器81还可以既包括所述终端设备8的内部存储单元也包括外部存储设备。所述存储器81用于存储所述计算机可读指令以及所述终端设备所需的其他程序和数据。所述存储器81还可以用于暂时地存储已经输出或者将要输出的数据。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。

Claims (20)

  1. 一种实体印章的记账方法,其特征在于,实体印章内部搭载有记录器,所述记账方法包括:
    与所述实体印章内部的所述记录器建立通信连接,并获取所述记录器记录的所述实体印章的用印记录,所述用印记录包括用印时间;
    对多个所述用印记录按照所述用印时间进行排序,并将排序后的多个所述用印记录发送至预设的区块链网络中;
    所述区块链网络中的节点对所述区块链网络中最新区块的区块头进行哈希加密得到第一哈希值,并对排序后的多个所述用印记录进行哈希加密得到第二哈希值,基于所述第一哈希值、所述第二哈希值以及排序后的多个所述用印记录生成用印区块,若将所述用印区块在所述区块链网络中进行共识验证的结果为成功,则将所述用印区块添加至所述最新区块。
  2. 如权利要求1所述的记账方法,其特征在于,所述区块链网络的创世区块包括多个用印私钥,每个所述用印私钥与一个预设的数值对应,所述创世区块为所述区块链网络中的第一个数据区块,所述将排序后的多个所述用印记录发送至预设的区块链网络之后,还包括:
    所述区块链网络中的节点查询所述最新区块的区块数,并对所述区块数进行映射处理,得到映射值;
    查询所述创世区块,确定与所述映射值对应的用印私钥,通过所述用印私钥对排序后的多个所述用印记录进行加密得到加密记录;
    所述区块链网络中的节点对所述区块链网络中最新区块的区块头进行哈希加密得到第一哈希值,并对排序后的多个所述用印记录进行哈希加密得到第二哈希值,基于所述第一哈希值、所述第二哈希值以及排序后的多个所述用印记录生成用印区块,包括:
    所述区块链网络中的节点对所述最新区块的区块头进行哈希加密得到所述第一哈希值,并对所述加密记录进行哈希加密得到所述第二哈希值,基于所述第一哈希值、所述第二哈希值以及所述加密记录生成所述用印区块。
  3. 如权利要求1所述的记账方法,其特征在于,所述用印记录还包括印章识别码,所述获取所述记录器记录的所述实体印章的用印记录之后,还包括:
    分别为每个印章识别码建立对应的记录池,并识别接收到的所述用印记录中的所述印章识别码,将所述用印记录存入至对应的所述记录池中;
    当所述记录池中的所述用印记录的数量达到预设阈值时,执行所述对多个所述用印记录按照所述用印时间进行排序的操作。
  4. 如权利要求3所述的记账方法,其特征在于,所述区块链网络的创世区块包括多个授权节点地址,每个所述授权节点地址与一个所述印章识别码对应,所述将所述用印区块添加至所述最新区块之后,还包括:
    识别所述用印区块中所述用印记录的印章识别码,作为目标识别码;
    确定与所述目标识别码对应的所述授权节点地址,并基于所述授权节点地址为所述用印区块设置访问限制接口,所述访问限制接口用于防止除所述授权节点地址外的地址访问所述用印区块。
  5. 如权利要求3所述的记账方法,其特征在于,所述用印记录还包括被加密的验证码,所述识别接收到的所述用印记录中的所述印章识别码,将所述用印记录存入至对应的所述记录池中,包括:
    基于预设的验证密钥集中的多个验证密钥对接收到的所述用印记录进行解密;
    若解密后得到的结果包括所述验证码,则将所述用印记录存入至对应的所述记录池中;
    若解密后得到的结果都不包括所述验证码,则输出报警提示。
  6. 一种终端设备,其特征在于,包括:
    获取单元,用于与所述实体印章内部的所述记录器建立通信连接,并获取所述记录器记录的所述实体印章的用印记录,所述用印记录包括用印时间;
    发送单元,用于对多个所述用印记录按照所述用印时间进行排序,并将排序后的多个所述用印记录发送至预设的区块链网络中;
    添加单元,用于所述区块链网络中的节点对所述区块链网络中最新区块的区块头进行哈希加密得到第一哈希值,并对排序后的多个所述用印记录进行哈希加密得到第二哈希值,基于所述第一哈希值、所述第二哈希值以及排序后的多个所述用印记录生成用印区块,若将所述用印区块在所述区块链网络中进行共识验证的结果为成功,则将所述用印区块添加至所述最新区块。
  7. 如权利要求6所述的终端设备,其特征在于,所述区块链网络的创世区块包括多个用印私钥,每个所述用印私钥与一个预设的数值对应,所述创世区块为所述区块链网络中的第一个数据区块,所述发送单元还包括:
    第一查询单元,用于所述区块链网络中的节点查询所述最新区块的区块数,并对所述区块数进行映射处理,得到映射值;
    第二查询单元,用于查询所述创世区块,确定与所述映射值对应的用印私钥,通过所述用印私钥对排序后的多个所述用印记录进行加密得到加密记录;
    所述添加单元,包括:
    生成单元,用于所述区块链网络中的节点对所述最新区块的区块头进行哈希加密得到所述第一哈希值,并对所述加密记录进行哈希加密得到所述第二哈希值,基于所述第一哈希值、所述第二哈希值以及所述加密记录生成所述用印区块。
  8. 如权利要求6所述的终端设备,其特征在于,所述用印记录还包括印章识别码,所述获取单元还包括:
    存入单元,用于分别为每个印章识别码建立对应的记录池,并识别接收到的所述用印记录中的所述印章识别码,将所述用印记录存入至对应的所述记录池中;
    执行单元,用于当所述记录池中的所述用印记录的数量达到预设阈值时,执行所述对多个所述用印记录按照所述用印时间进行排序的操作。
  9. 如权利要求8所述的终端设备,其特征在于,所述区块链网络的创世区块包括多个授权节点地址,每个所述授权节点地址与一个所述印章识别码对应,所述添加单元还包括:
    识别单元,用于识别所述用印区块中所述用印记录的印章识别码,作为目标识别码;
    设置单元,用于确定与所述目标识别码对应的所述授权节点地址,并基于所述授权节点地址为所述用印区块设置访问限制接口,所述访问限制接口用于防止除所述授权节点地址外的地址访问所述用印区块。
  10. 如权利要求8所述的终端设备,其特征在于,所述用印记录还包括被加密的验证码,所述存入单元包括:
    解密单元,用于基于预设的验证密钥集中的多个验证密钥对接收到的所述用印记录进行解密;
    存入子单元,用于若解密后得到的结果包括所述验证码,则将所述用印记录存入至对应的所述记录池中;
    报警单元,用于若解密后得到的结果都不包括所述验证码,则输出报警提示。
  11. 一种终端设备,其特征在于,包括存储器以及处理器,所述存储器中存储有可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如下步骤:
    与所述实体印章内部的所述记录器建立通信连接,并获取所述记录器记录的所述实体印章的用印记录,所述用印记录包括用印时间;
    对多个所述用印记录按照所述用印时间进行排序,并将排序后的多个所述用印记录发送至预设的区块链网络中;
    所述区块链网络中的节点对所述区块链网络中最新区块的区块头进行哈希加密得到第一哈希值,并对排序后的多个所述用印记录进行哈希加密得到第二哈希值,基于所述第一哈希值、所述第二哈希值以及排序后的多个所述用印记录生成用印区块,若将所述用印区块在所述区块链网络中进行共识验证的结果为成功,则将所述用印区块添加至所述最新区块。
  12. 如权利要求11所述的终端设备,其特征在于,所述区块链网络的创世区块包括多个用印私钥,每个所述用印私钥与一个预设的数值对应,所述创世区块为所述区块链网络中的第一个数据区块,所述将排序后的多个所述用印记录发送至预设的区块链网络之后,还包括:
    所述区块链网络中的节点查询所述最新区块的区块数,并对所述区块数进行映射处理,得到映射值;
    查询所述创世区块,确定与所述映射值对应的用印私钥,通过所述用印私钥对排序后的多个所述用印记录进行加密得到加密记录;
    所述区块链网络中的节点对所述区块链网络中最新区块的区块头进行哈希加密得到第一哈希值,并对排序后的多个所述用印记录进行哈希加密得到第二哈希值,基于所述第一哈希值、所述第二哈希值以及排序后的多个所述用印记录生成用印区块,包括:
    所述区块链网络中的节点对所述最新区块的区块头进行哈希加密得到所述第一哈希值,并对所述加密记录进行哈希加密得到所述第二哈希值,基于所述第一哈希值、所述第二哈希值以及所述加密记录生成所述用印区块。
  13. 如权利要求11所述的终端设备,其特征在于,所述用印记录还包括印章识别码,所述获取所述记录器记录的所述实体印章的用印记录之后,还包括:
    分别为每个印章识别码建立对应的记录池,并识别接收到的所述用印记录中的所述印章识别码,将所述用印记录存入至对应的所述记录池中;
    当所述记录池中的所述用印记录的数量达到预设阈值时,执行所述对多个所述用印记录按照所述用印时间进行排序的操作。
  14. 如权利要求13所述的终端设备,其特征在于,所述区块链网络的创世区块包括多个授权节点地址,每个所述授权节点地址与一个所述印章识别码对应,所述将所述用印区块添加至所述最新区块之后,还包括:
    识别所述用印区块中所述用印记录的印章识别码,作为目标识别码;
    确定与所述目标识别码对应的所述授权节点地址,并基于所述授权节点地址为所述用印区块设置访问限制接口,所述访问限制接口用于防止除所述授权节点地址外的地址访问所述用印区块。
  15. 根据权利要求13所述的终端设备,其特征在于,所述用印记录还包括被加密的验证码,所述识别接收到的所述用印记录中的所述印章识别码,将所述用印记录存入至对应的所述记录池中,包括:
    基于预设的验证密钥集中的多个验证密钥对接收到的所述用印记录进行解密;
    若解密后得到的结果包括所述验证码,则将所述用印记录存入至对应的所述记录池中;
    若解密后得到的结果都不包括所述验证码,则输出报警提示。
  16. 一种计算机非易失性可读存储介质,所述计算机非易失性可读存储介质存储有计算机可读指令,其特征在于,所述计算机可读指令被至少一个处理器执行时实现如下步骤:
    与所述实体印章内部的所述记录器建立通信连接,并获取所述记录器记录的所述实体印章的用印记录,所述用印记录包括用印时间;
    对多个所述用印记录按照所述用印时间进行排序,并将排序后的多个所述用印记录发送至预设的区块链网络中;
    所述区块链网络中的节点对所述区块链网络中最新区块的区块头进行哈希加密得到第一哈希值,并对排序后的多个所述用印记录进行哈希加密得到第二哈希值,基于所述第一哈希值、所述第二哈希值以及排序后的多个所述用印记录生成用印区块,若将所述用印区块在所述区块链网络中进行共识验证的结果为成功,则将所述用印区块添加至所述最新区块。
  17. 根据权利要求16所述的计算机非易失性可读存储介质,其特征在于,所述区块链网络的创世区块包括多个用印私钥,每个所述用印私钥与一个预设的数值对应,所述创世区块为所述区块链网络中的第一个数据区块,所述将排序后的多个所述用印记录发送至预设的区块链网络之后,还包括:
    所述区块链网络中的节点查询所述最新区块的区块数,并对所述区块数进行映射处理,得到映射值;
    查询所述创世区块,确定与所述映射值对应的用印私钥,通过所述用印私钥对排序后的多个所述用印记录进行加密得到加密记录;
    所述区块链网络中的节点对所述区块链网络中最新区块的区块头进行哈希加密得到第一哈希值,并对排序后的多个所述用印记录进行哈希加密得到第二哈希值,基于所述第一哈希值、所述第二哈希值以及排序后的多个所述用印记录生成用印区块,包括:
    所述区块链网络中的节点对所述最新区块的区块头进行哈希加密得到所述第一哈希值,并对所述加密记录进行哈希加密得到所述第二哈希值,基于所述第一哈希值、所述第二哈希值以及所述加密记录生成所述用印区块。
  18. 根据权利要求16所述的计算机非易失性可读存储介质,其特征在于,所述用印记录还包括印章识别码,所述获取所述记录器记录的所述实体印章的用印记录之后,还包括:
    分别为每个印章识别码建立对应的记录池,并识别接收到的所述用印记录中的所述印章识别码,将所述用印记录存入至对应的所述记录池中;
    当所述记录池中的所述用印记录的数量达到预设阈值时,执行所述对多个所述用印记录按照所述用印时间进行排序的操作。
  19. 根据权利要求18所述的计算机非易失性可读存储介质,其特征在于,所述区块链网络的创世区块包括多个授权节点地址,每个所述授权节点地址与一个所述印章识别码对应,所述将所述用印区块添加至所述最新区块之后,还包括:
    识别所述用印区块中所述用印记录的印章识别码,作为目标识别码;
    确定与所述目标识别码对应的所述授权节点地址,并基于所述授权节点地址为所述用印区块设置访问限制接口,所述访问限制接口用于防止除所述授权节点地址外的地址访问所述用印区块。
  20. 根据权利要求18所述的计算机非易失性可读存储介质,其特征在于,所述用印记录还包括被加密的验证码,所述识别接收到的所述用印记录中的所述印章识别码,将所述用印记录存入至对应的所述记录池中,包括:
    基于预设的验证密钥集中的多个验证密钥对接收到的所述用印记录进行解密;
    若解密后得到的结果包括所述验证码,则将所述用印记录存入至对应的所述记录池中;
    若解密后得到的结果都不包括所述验证码,则输出报警提示。
PCT/CN2018/123789 2018-09-03 2018-12-26 实体印章的记账方法及终端设备 WO2020048055A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811020992.9 2018-09-03
CN201811020992.9A CN109377217A (zh) 2018-09-03 2018-09-03 实体印章的记账方法及终端设备

Publications (1)

Publication Number Publication Date
WO2020048055A1 true WO2020048055A1 (zh) 2020-03-12

Family

ID=65404274

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/123789 WO2020048055A1 (zh) 2018-09-03 2018-12-26 实体印章的记账方法及终端设备

Country Status (2)

Country Link
CN (1) CN109377217A (zh)
WO (1) WO2020048055A1 (zh)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110290200A (zh) * 2019-06-24 2019-09-27 吉林大学 一种防信息泄露的电子授权印章管理系统及使用方法
CN111047331A (zh) * 2019-11-12 2020-04-21 武汉金运激光股份有限公司 基于区块链和nfc芯片的商品防伪溯源方法及系统
CN111431916B (zh) * 2020-03-30 2021-12-24 绍兴章控智能科技有限公司 基于非对称加密的章印验证方法、印章和计算机存储介质
CN112115432A (zh) * 2020-09-18 2020-12-22 山大地纬软件股份有限公司 基于区块链的电子印章可信使用系统及方法
CN112381507A (zh) * 2020-11-11 2021-02-19 杭州甘道智能科技有限公司 基于区块链的印章流通监管系统、方法及印章
CN112559633B (zh) * 2020-12-16 2024-03-22 航天信息股份有限公司 电子印章服务节点管理系统及方法
CN113469658A (zh) * 2021-07-12 2021-10-01 支付宝(杭州)信息技术有限公司 基于区块链的物理印章使用方法、装置及电子设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107392618A (zh) * 2017-07-28 2017-11-24 中链科技有限公司 植入智能合约的方法和设备
CN107807951A (zh) * 2017-09-18 2018-03-16 联动优势科技有限公司 一种区块链生成方法、数据验证方法、节点及系统
CN108154351A (zh) * 2018-02-05 2018-06-12 胡金钱 物电一体化印章及事务审批实现方法、系统、平台、介质
CN108304710A (zh) * 2018-02-11 2018-07-20 安云印(天津)大数据科技有限公司 一种基于区块链的融入身份认证功能的电子印章签章方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107392618A (zh) * 2017-07-28 2017-11-24 中链科技有限公司 植入智能合约的方法和设备
CN107807951A (zh) * 2017-09-18 2018-03-16 联动优势科技有限公司 一种区块链生成方法、数据验证方法、节点及系统
CN108154351A (zh) * 2018-02-05 2018-06-12 胡金钱 物电一体化印章及事务审批实现方法、系统、平台、介质
CN108304710A (zh) * 2018-02-11 2018-07-20 安云印(天津)大数据科技有限公司 一种基于区块链的融入身份认证功能的电子印章签章方法

Also Published As

Publication number Publication date
CN109377217A (zh) 2019-02-22

Similar Documents

Publication Publication Date Title
WO2020048055A1 (zh) 实体印章的记账方法及终端设备
US11481518B2 (en) Blockchain-based method for registration and verification of a file
CN107947922B (zh) 一种基于区块链技术的数字档案管理方法及系统
CN108696358B (zh) 数字证书的管理方法、装置、可读存储介质及服务终端
EP3701668B1 (en) Methods for recording and sharing a digital identity of a user using distributed ledgers
CN101710380B (zh) 电子文件安全防护方法
CN112468506B (zh) 获取、下发电子证件的实现方法和装置
CN108206831B (zh) 电子印章的实现方法和服务器、客户端及可读存储介质
WO2018114585A1 (en) Improved blockchain-based method for registration and verification of a file
CN112530531B (zh) 基于双区块链的电子病历存储与共享方法
CN105074721A (zh) 使用具有附加验证的模拟数字签名签署电子文档的方法
CN111881481B (zh) 基于区块链的医疗数据处理方法、装置、设备及存储介质
Juyal et al. Privacy and security of IoT based skin monitoring system using blockchain approach
KR20130129478A (ko) 물리적으로 표현될 수 있는 가상 다수 공동 계약서를 안전하게 작성하는 방법
CN111698093A (zh) 一种基于pki体系的数字时间戳签发和查证方法
CN108985409B (zh) 身份证信息读取方法、装置及电子设备
CN116108410A (zh) 一种身份凭证生成方法及装置
CN110213232A (zh) 一种指纹特征和密钥双重验证方法和装置
US11070378B1 (en) Signcrypted biometric electronic signature tokens
US11882214B2 (en) Technique for cryptographic document protection and verification
JP2003169051A (ja) 電子印鑑システム
CN108400874B (zh) 利用印章验证终端的数字签名功能对印文进行认证的方法
CN112800477A (zh) 一种基于生物特征值的数据加解密系统及方法
CN112583772A (zh) 一种数据采集存储平台
Schrahe et al. Privacy preserving vaccinating‐and testing‐pass for the European Union

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18932393

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 09.06.2021)

122 Ep: pct application non-entry in european phase

Ref document number: 18932393

Country of ref document: EP

Kind code of ref document: A1