Blockchain-based printing method, device, computer equipment and storage medium
The printer nodes in the blockchain network obtain and decrypt the print request message, which solves the security problem in the transmission of printing data and realizes the security guarantee of data during transmission and storage.
Patent Information
- Application Number
- CN202010344593.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-04-27
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2040-04-27
AI Technical Summary
In the existing printing process, there is a problem of insufficient data security during the transmission of the print data, especially when connected through a mobile storage device or a network, the potential for data leakage is greater.
The printer node in the blockchain network obtains the print request message initiated by the terminal, obtains randomly encrypted ciphertext from the blockchain network based on the print request message, and uses encryption identification for decryption and printing, ensuring the security of the data during transmission and storage.
Improve data security during printing, reduce the potential risks of data leakage, and ensure the security of data during transmission and storage.
Smart Images

Figure CN113642009B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of blockchain technology, and in particular, to a printing method, apparatus, computer device, and storage medium based on blockchain. Background Art
[0002] Printing is a process of printing the calculation results or intermediate results of a computer in the form of numbers, letters, symbols, and graphics that can be recognized by humans on paper according to a specified format. With the wide application of printing technology in fields such as office, education, and life, printers for printing are developing towards being light, thin, short, small, low-power, high-speed, and intelligent.
[0003] However, in current printing processing, generally, a printer is connected through a removable storage device or through a network to perform printing. There is a potential risk of leakage during the transmission of printing data, and the security of data in printing processing is limited. Summary of the Invention
[0004] Based on this, in view of the above technical problems, it is necessary to provide a printing method, apparatus, computer device, and storage medium based on blockchain that can improve data security.
[0005] A printing method based on blockchain, the method includes:
[0006] Obtaining a printing request message initiated by a terminal through a printer node in a blockchain network;
[0007] According to the printing request message, obtaining a ciphertext to be printed from the blockchain network; wherein, the ciphertext is encrypted from plaintext using a random encryption method, the plaintext is uploaded to the blockchain network by the terminal, and an encryption method identifier corresponding to the encryption method is fed back to the terminal;
[0008] Obtaining an input encryption method identifier;
[0009] Using a decryption method that matches the encryption method identifier to decrypt the ciphertext and print.
[0010] In one embodiment, uploading the ciphertext to the blockchain network for consensus processing includes:
[0011] Generating chain-uploading information corresponding to the ciphertext;
[0012] Uploading the ciphertext and the chain-uploading information to the blockchain network for consensus processing;
[0013] Feeding back a printing event identifier and an encryption method identifier in the chain-uploading information to the terminal.
[0014] A printing apparatus based on blockchain, the apparatus includes:
[0015] A request message acquisition module, configured to acquire a print request message initiated by a terminal through a printer node in a blockchain network;
[0016] A ciphertext acquisition module, configured to acquire a ciphertext to be printed from the blockchain network according to the print request message; wherein, the ciphertext is encrypted from a plaintext by using a random encryption method, the plaintext is uploaded by the terminal to the blockchain network, and an encryption method identifier corresponding to the encryption method is fed back to the terminal;
[0017] An encryption identifier determination module, configured to acquire an input encryption method identifier;
[0018] A decryption and printing module, configured to decrypt the ciphertext and print it by using a decryption method matching the encryption method identifier.
[0019] A computer device, comprising a memory and a processor, where the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0020] Acquire a print request message initiated by a terminal through a printer node in a blockchain network;
[0021] Acquire a ciphertext to be printed from the blockchain network according to the print request message; wherein, the ciphertext is encrypted from a plaintext by using a random encryption method, the plaintext is uploaded by the terminal to the blockchain network, and an encryption method identifier corresponding to the encryption method is fed back to the terminal;
[0022] Acquire an input encryption method identifier;
[0023] Decrypt the ciphertext and print it by using a decryption method matching the encryption method identifier.
[0024] A computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0025] Acquire a print request message initiated by a terminal through a printer node in a blockchain network;
[0026] Acquire a ciphertext to be printed from the blockchain network according to the print request message; wherein, the ciphertext is encrypted from a plaintext by using a random encryption method, the plaintext is uploaded by the terminal to the blockchain network, and an encryption method identifier corresponding to the encryption method is fed back to the terminal;
[0027] Acquire an input encryption method identifier;
[0028] Decrypt the ciphertext and print it by using a decryption method matching the encryption method identifier.
[0029] The above blockchain-based printing method, apparatus, computer device, and storage medium enable a printer node in a blockchain network to obtain a ciphertext to be printed from the blockchain network according to a printing request message initiated by a terminal. The ciphertext is obtained by encrypting the plaintext uploaded by the terminal to the blockchain network using a random encryption method, and the ciphertext is decrypted using a decryption method matching the obtained encryption method identifier before printing. The data during the printing process is encrypted and stored by the blockchain. When printing, the ciphertext is obtained from the blockchain network and decrypted according to the decryption method corresponding to the encryption method, which can reduce the risk of data leakage and improve the security of data during the printing process. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 FIG. is an application environment diagram of a blockchain-based printing method in an embodiment;
[0031] Figure 2 FIG. is a flowchart of a blockchain-based printing method in an embodiment;
[0032] Figure 3 FIG. is a structural block diagram of a data sharing system in an embodiment;
[0033] Figure 4 FIG. is a schematic diagram of nodes in a blockchain network in an embodiment;
[0034] Figure 5 FIG. is a flowchart of the process of uploading plaintext to the blockchain in an embodiment;
[0035] Figure 6 FIG. is a flowchart of a blockchain-based printing method in another embodiment;
[0036] Figure 7 FIG. is a timing diagram of a blockchain-based printing method in an embodiment;
[0037] Figure 8 FIG. is a structural block diagram of a blockchain-based printing apparatus in an embodiment;
[0038] Figure 9 FIG. is an internal structural diagram of a computer device in an embodiment. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0039] In order to make the objectives, technical solutions, and advantages of the present application more clearly understood, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0040] The blockchain-based printing method provided by the present application can be applied to, for example, Figure 1In the application environment shown. Among them, the printer 104 is a node in the blockchain network, and the terminal 102 communicates with the printer 104 in the blockchain network through the network. The terminal 102 sends a print request message to the printer 104 in the blockchain network. The printer 104 obtains the ciphertext to be printed from the blockchain network according to the print request message initiated by the terminal 102. The ciphertext is obtained by encrypting the plaintext uploaded by the terminal 102 to the blockchain network using a random encryption method, and decrypts the ciphertext according to the decryption method matching the obtained encryption method identifier and then prints it. Among them, the terminal 102 can be but is not limited to various personal computers, laptop computers, smart phones, tablet computers, and portable wearable devices. The printer 104 can be a server with a printing function, and the server can be implemented by an independent server or a server cluster composed of multiple servers.
[0041] Blockchain is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, and encryption algorithms. Blockchain, in essence, is a decentralized database, a series of data blocks generated by using cryptographic methods. Each data block contains information about a batch of network transactions, which is used to verify the validity of the information (anti-counterfeiting) and generate the next block. Blockchain can include the blockchain underlying platform, the platform product service layer, and the application service layer.
[0042] The blockchain underlying platform can include processing modules such as user management, basic services, smart contracts, and operation monitoring. Among them, the user management module is responsible for the identity information management of all blockchain participants, including maintaining the generation of public and private keys (account management), key management, and the maintenance of the correspondence between the user's real identity and the blockchain address (permission management). And under authorization, it supervises and audits the transaction situations of certain real identities, and provides the rule configuration for risk control (risk control audit); the basic service module is deployed on all blockchain node devices to verify the validity of business requests, and records the valid requests to the storage after consensus. For a new business request, the basic service first performs interface adaptation parsing and authentication processing (interface adaptation), then encrypts the business information through the consensus algorithm (consensus management), transmits it to the shared ledger completely and consistently after encryption (network communication), and records it for storage; the smart contract module is responsible for the registration and issuance of contracts, contract triggering, and contract execution. Developers can define contract logic through a certain programming language, publish it to the blockchain (contract registration), and trigger the execution by calling keys or other events according to the logic of the contract terms to complete the contract logic. At the same time, it also provides functions for contract upgrade and cancellation; the operation monitoring module is mainly responsible for the deployment, configuration modification, contract setting, cloud adaptation during the product release process, and the visual output of the real-time state during the product operation, such as: alarm, monitoring network conditions, monitoring the health status of node devices, etc.
[0043] The platform product service layer provides the basic capabilities and implementation frameworks for typical applications. Developers can build on these basic capabilities and overlay the characteristics of the business to complete the blockchain implementation of the business logic. The application service layer provides application services based on the blockchain solution for business participants to use. This application is precisely a printing method based on blockchain technology.
[0044] In one embodiment, as Figure 2 shown, a printing method based on blockchain is provided. Taking the printer 104 in Figure 1 as an example, the method includes the following steps:
[0045] Step 202, obtain the print request message initiated by the terminal through the printer node in the blockchain network.
[0046] Among them, the blockchain network is composed of multiple distributed nodes. The printer node is a node in the blockchain network and can obtain consensus data from the blockchain network and perform data consensus. The print request message is initiated by the user terminal to request the printer to perform printing processing, such as printing a document, printing an image, etc. In a specific implementation, the print request message can carry the identity identification information of the blockchain user and the identification information of the data to be printed, so that the printer node can obtain the data corresponding to the print request message that needs to be printed from the blockchain network.
[0047] Specifically, referring to Figure 3 the data sharing system based on the blockchain network shown, the data sharing system 300 refers to a system used for data sharing between nodes. The data sharing system can include multiple nodes 301, and the multiple nodes 301 can refer to each client in the data sharing system. Each node 301 can receive input information during normal operation and maintain the shared data in the data sharing system based on the received input information. To ensure information interconnection within the data sharing system, there can be information connections between each node in the data sharing system, and nodes can transmit information through the above information connections. For example, when any node in the data sharing system receives input information, other nodes in the data sharing system obtain the input information according to the consensus algorithm and store the input information as data in the shared data, so that the data stored on all nodes in the data sharing system is consistent. For each node in the data sharing system, there is a corresponding node identifier, and each node in the data sharing system can store the node identifiers of other nodes in the data sharing system, so as to broadcast the generated block to other nodes in the data sharing system according to the node identifiers of other nodes later. The node 301 can be divided into a printer node and a blockchain node according to the work type, such as whether it can support a printing job. AsFigure 4 As shown, the nodes of the blockchain network are divided into printer nodes and blockchain nodes. The user terminal can upload data through any blockchain node for consensus, or can print on any printer node on the blockchain.
[0048] Step 204: Obtain the ciphertext to be printed from the blockchain network according to the print request message; wherein, the ciphertext is encrypted from the plaintext by a random encryption method. The plaintext is uploaded to the blockchain network by the terminal, and the encryption method identifier corresponding to the encryption method is fed back to the terminal.
[0049] Among them, the ciphertext is the data requested to be printed by the print request message, such as files like text and images. The ciphertext is obtained by encrypting the plaintext. The plaintext is unencrypted data, such as an unencrypted document file. The plaintext is from the terminal to the blockchain network and is the original data provided by the terminal. If the original data is directly transmitted, there is a security risk of data leakage during the transmission process. By encrypting the plaintext to obtain the ciphertext, the original data provided by the terminal can be encrypted and protected, effectively improving the security of the data. The ciphertext is obtained by encrypting the plaintext by a random encryption method, such as being encrypted by a randomly determined encryption method among various encryption algorithms such as MD5 (Message Digest Algorithm MD5), DES (Data Encryption Standard), AES (Advanced Encryption Standard), TDEA (Triple Data Encryption Algorithm), or RSA (Rivest-Shamir-Adleman, RSA encryption algorithm).
[0050] Specifically, the terminal can upload the plaintext at any node in the blockchain network. After the node receives the plaintext to be uploaded to the blockchain, the node generates a random encryption method, encrypts the plaintext by this encryption method to obtain the ciphertext, and uploads the encrypted ciphertext to the blockchain network, and the nodes in the blockchain network perform consensus processing. In addition, the node also feeds back the encryption method identifier corresponding to the encryption method of the plaintext to the terminal. The encryption method identifier is used to identify the encryption method corresponding to the plaintext. The encryption method identifier is fed back to the terminal user for storage, so that when printing, the corresponding encryption method of the ciphertext can be determined according to the encryption method identifier, so as to decrypt and restore the plaintext for printing.
[0051] Step 206: Obtain the input encryption method identifier.
[0052] Among them, the encryption method identifier is used to identify the encryption method corresponding to the plaintext. Specifically, it can be a string ID (Identity), which is obtained when a node in the blockchain network encrypts the plaintext uploaded by the terminal and uploads it to the blockchain. The node feeds back the encryption method identifier to the terminal user and provides it to the printer node when the terminal prints at the printer node, so that the printer node can decrypt the ciphertext obtained from the blockchain network and restore the plaintext.
[0053] Specifically, the encryption method identifier can be sent by the terminal to the printer node through the network, or can be directly input by the user through the input device of the printer node, such as buttons, trackballs, touchpads, keyboards, touchpads or mice, etc.
[0054] Step 208, use the decryption method matching the encryption method identifier to decrypt the ciphertext and print.
[0055] Among them, the decryption method corresponds to the encryption method and is the decryption method corresponding to decrypting the data encrypted by the encryption method. The decryption method can be obtained by matching the encryption method identifier. Specifically, the printer node can pre-record the mapping relationship between various encryption methods and the corresponding decryption methods, and can query and determine the corresponding decryption method through the encryption method identifier, so as to decrypt the encrypted data obtained by encrypting according to the encryption method and restore the original data. Further, after obtaining the encryption method identifier, the decryption method corresponding to the encryption method corresponding to the encryption method identifier can be matched, and the ciphertext obtained from the blockchain network can be decrypted by this decryption method, so as to restore the original data to obtain the plaintext and print the plaintext.
[0056] In the above blockchain-based printing method, the printer node in the blockchain network obtains the ciphertext to be printed according to the printing request message initiated by the terminal. The ciphertext is obtained by encrypting the plaintext uploaded by the terminal to the blockchain network with a random encryption method, and the ciphertext is decrypted by the decryption method matching the obtained encryption method identifier and then printed. The data during the printing process is encrypted and stored by the blockchain. When printing, the ciphertext is obtained from the blockchain network and decrypted according to the decryption method corresponding to the encryption method, which can reduce the risk of data leakage and improve the security of data during the printing process.
[0057] In one embodiment, obtaining the ciphertext to be printed from the blockchain network according to the printing request message includes: extracting a printing event identifier and a blockchain private key from the printing request message; determining the block corresponding to the blockchain private key from the blockchain network; and obtaining the ciphertext to be printed from the block according to the printing event identifier.
[0058] In this embodiment, the ciphertext to be printed is obtained from the blockchain network according to the print event identifier carried in the print request message and the blockchain private key. Among them, the print event identifier can be the identifier of various ciphertexts, used to distinguish various ciphertexts. The print event identifier can be generated when a node in the blockchain encrypts the plaintext. For example, it can be the print event ID. According to this print event identifier, the ciphertext to be printed can be determined; the blockchain private key is the identity information of the blockchain user. Generally, for users registered in the blockchain, they have a public key ID and a blockchain private key. The blockchain private key is a randomly selected 256-bit number, and the public key ID is obtained by elliptic curve multiplication of the blockchain private key. The public key ID and the blockchain private key form a key pair. The blockchain private key can be used as the identity authentication information for the user to log in to the blockchain network. After the user logs in to the blockchain network through the blockchain private key, the block belonging to the user in the blockchain network, that is, the data block, can be determined.
[0059] Specifically, after the printer node receives the print request message initiated by the terminal, it extracts the print event identifier and the blockchain private key from the print request message. For example, according to the message fields of the print request message, the fields of the print event identifier and the blockchain private key in the print request message can be determined, and the print event identifier and the blockchain private key are extracted from the corresponding fields. The blockchain private key is used as the identity authentication information for the user to log in to the blockchain network. After logging in to the blockchain network according to the blockchain private key, the block corresponding to the blockchain private key in the blockchain network can be determined. The block is the data block that the user corresponding to the blockchain private key can operate on. There can be multiple data blocks recorded by the blockchain user in the blockchain network. The corresponding block in the blockchain network can be determined through the blockchain private key, and the ciphertext to be printed is obtained from this block in combination with the print event identifier.
[0060] In this embodiment, logging in to the blockchain network with the blockchain private key of the blockchain user in the print request message and obtaining the ciphertext to be printed from the blockchain network according to the print event identifier can effectively utilize the blockchain to store and protect the ciphertext and improve the security of the ciphertext data.
[0061] In one embodiment, obtaining the ciphertext to be printed from the block according to the print event identifier includes: determining the on-chain information corresponding to the print event identifier; obtaining the ciphertext associated with the on-chain information from the block.
[0062] In this embodiment, the ciphertext to be printed is obtained from the block corresponding to the blockchain private key according to the on-chain information corresponding to the printing event identifier. Among them, the on-chain information corresponds to the printing event identifier, and the on-chain information can be generated when the node uploads the ciphertext to the blockchain network for consensus and is synchronously uploaded to the blockchain for storage. For example, the on-chain information may include, but is not limited to, data related to security such as the printing event identifier, user ID, file MD5, timestamp, and encryption method ID. Among them, the printing event identifier is used to identify the ciphertext involved in the printing event, the user ID is used to identify each user, the file MD5 is the eigenvalue obtained after the file passes through the MD5 mapping algorithm, the timestamp can be the moment when the plaintext is uploaded to the blockchain, and the encryption method ID is used to identify the encryption method adopted by the node when encrypting the plaintext. The on-chain information can construct a mapping relationship with the printing event identifier, so that the corresponding complete on-chain information can be queried according to the printing event identifier.
[0063] Specifically, after determining the block corresponding to the blockchain private key, the corresponding on-chain information is determined according to the printing event identifier. For example, the corresponding complete on-chain information can be queried based on the printing event identifier, and the ciphertext associated with the on-chain information, such as an encrypted document, is queried in the block according to the obtained on-chain information. Obtaining the ciphertext to be printed from the block corresponding to the blockchain private key based on the on-chain information corresponding to the printing event identifier can effectively utilize the blockchain to store and protect the ciphertext and improve the security of the ciphertext data.
[0064] In one embodiment, the printer node includes a data node accessing the blockchain network and a printing node that receives the data sent by the data node for simplex communication. After obtaining the ciphertext to be printed from the blockchain network according to the printing request message, it further includes: obtaining the printing record information of the ciphertext through the data node; obtaining the printing on-chain information based on the printing record information through the data node; and uploading the printing on-chain information to the blockchain network by the data node for consensus processing and sending the ciphertext to the printing node.
[0065] In this embodiment, the printer node includes a data node and a printing node. The data node accesses the blockchain network and can perform data consensus with other nodes in the blockchain network; the printing node performs simplex communication with the data node and is used to receive the data sent by the data node and print the received data. The printing node cannot connect to any other network, that is, the printing node cannot send data to the data node or the outside world. After obtaining the ciphertext to be printed, the data node uploads the printing record to the blockchain network for data consensus and sends the ciphertext to the printing node for printing.
[0066] Specifically, after obtaining the ciphertext to be printed from the blockchain network, the printing record information of the ciphertext is obtained through the data node. The printing record information can be the record data of this user's printing request, and specifically can include, but is not limited to, information such as the printing event ID, user ID, printer ID, file MD55, and printing timestamp. Among them, the printer ID can be the identification information of the printer node, and the printing timestamp is the moment of the printing request, that is, the moment when the terminal sends the printing request message. The printing record information is used to record the operation data of the current printing operation. After obtaining the printing record information of the ciphertext, the data node obtains the printing information to be uploaded to the blockchain network based on the printing record information. The printing information to be uploaded to the blockchain network is the data that needs to be uploaded to the blockchain network for on-chain storage in the operation data of the current printing operation, and can be selected from the printing record information, and can be specifically set according to actual needs. In addition, the printing record information can also be directly used as the printing information to be uploaded to the blockchain network. After determining the printing information to be uploaded to the blockchain network, the data node uploads the printing information to be uploaded to the blockchain network for consensus processing, and sends the obtained ciphertext to the printing node for printing.
[0067] In this embodiment, the communication with the blockchain network is implemented by the data node in the printer node, and the printing node in the printer node receives the data from the data node for printing. When the printing node prints the data, it cannot send the scanned data during the printing process to the data node or the outside world, further ensuring the security of the data during the printing process.
[0068] In a specific application, the data node in the printer node receives the printing request message and obtains the ciphertext to be printed from the blockchain network, and sends the obtained ciphertext to the printing node. The printing node decrypts and prints the ciphertext using the decryption method that matches the encryption method identifier. That is, the steps of obtaining the printing request message initiated by the terminal and obtaining the ciphertext to be printed from the blockchain network according to the printing request message can be processed by the data node in the printer node; while the steps of obtaining the input encryption method identifier and using the decryption method that matches the encryption method identifier to decrypt and print the ciphertext can be processed by the printing node. By separating the processing of data acquisition and data printing to be processed by the data node and the printing node respectively, the printing node cannot send the scanned data during the printing process to the data node or the outside world, further ensuring the security of the data during the printing process.
[0069] In one embodiment, decrypting and printing the ciphertext using the decryption method that matches the encryption method identifier includes: determining the decryption method identifier that matches the encryption method identifier through the printing node; determining the decryption method corresponding to the decryption method identifier through the printing node; and decrypting and printing the ciphertext by the printing node using the decryption method.
[0070] In this embodiment, the printing node decrypts the ciphertext according to the decryption method corresponding to the encryption method identifier and prints the decrypted and restored plaintext. Specifically, when decrypting the ciphertext and printing, the printing node determines the decryption method identifier that matches the encryption method identifier. The decryption method identifier corresponds to the encryption method identifier, and the decryption method identifier is the identifier information of the decryption method. The decryption method corresponds to the encryption method of the encryption method identifier. In specific implementation, the decryption method corresponds to the encryption method. The decryption method identifier for identifying the decryption method and the encryption method identifier for identifying the encryption method can be set as different identifier information or the same identifier information, that is, the same identifier information is used as the identifier for both the decryption method and the encryption method.
[0071] Furthermore, the encryption method identifier can be sent from the terminal to the printer node, or directly input by the end user through the input device of the printer node. For example, the encryption method identifier can be sent from the terminal to the data node in the printer node, and forwarded by the data node to the printing node, so that the printing node decrypts the ciphertext according to the decryption method that matches the encryption method identifier; the encryption method identifier can also be directly input by the user in the input device of the printing node in the printer node.
[0072] After determining the decryption method identifier that matches the encryption method identifier, the printing node determines the decryption method corresponding to the decryption method identifier. For example, the decryption method corresponding to the decryption method identifier can be queried through the decryption method mapping relationship pre-stored in the printing node, and the ciphertext is decrypted by this decryption method, and the ciphertext is restored to plaintext and the plaintext is printed.
[0073] In specific applications, a printing trigger condition can be set. For example, when the preset printing time is reached, the printing operation is triggered to print the plaintext obtained after decryption. In addition, a print queue can also be set to manage the ciphertext to be printed, so as to ensure the orderly operation of the printing node.
[0074] In this embodiment, the printing node in the printer node only communicates with the data in simplex mode, obtains the ciphertext obtained from the blockchain network from the data node, and decrypts the ciphertext using the decryption method that matches the obtained encryption method identifier, and then prints the decrypted plaintext, so that the printing node cannot send the scanned data to the outside world when scanning and printing the plaintext, ensuring the security of the data.
[0075] In one implementation, after decrypting the ciphertext and printing using the decryption method that matches the encryption method identifier, it further includes: the printing node destroys the ciphertext and the plaintext.
[0076] In this embodiment, after decrypting and printing the ciphertext, the printing node destroys the printed data. Specifically, in the printing node, after decrypting the ciphertext using the decryption method that matches the encryption method identifier and printing it, if the printing is successful, the printing node destroys the ciphertext obtained from the data node and the plaintext decrypted from the ciphertext, so as to destroy the data printed by the printing node this time, thereby further preventing data leakage and ensuring data security.
[0077] In specific implementation, a data destruction condition can be set. When this data destruction condition is met, such as receiving a data destruction instruction sent by the user or when the printing ends and reaches a preset duration, the printing node destroys the ciphertext and plaintext involved in the current printing operation, so as to promptly clear the data involved in the printing from the printing node and ensure data security.
[0078] In one embodiment, as Figure 5 shown, the blockchain-based printing method further includes the processing of uploading the plaintext to the blockchain, which specifically includes:
[0079] Step 502, a node in the blockchain network obtains the plaintext uploaded by the terminal.
[0080] In this embodiment, a node in the blockchain network encrypts the plaintext uploaded by the terminal and uploads the obtained ciphertext to the blockchain network for on-chain storage. Specifically, a node in the blockchain network obtains the plaintext uploaded by the terminal. The node can be a node in the blockchain network that can perform consensus processing on the plaintext, not limited to full nodes or light nodes. Further, the terminal user can send the plaintext, such as files like documents and images, to any node in the blockchain network, so that the node uploads the plaintext to the blockchain network for consensus processing.
[0081] Step 504, encrypt the plaintext using a random encryption method to obtain the ciphertext.
[0082] After receiving the plaintext sent by the terminal, the node in the blockchain network generates a random encryption method, such as randomly selecting an encryption method from multiple pre-stored encryption methods, specifically various encryption algorithms such as MD5, DES, AES, TDEA, or RSA, and encrypts the plaintext based on the randomly determined encryption method to obtain the ciphertext after encrypting the plaintext. In addition, after receiving the plaintext sent by the terminal, the node can perform a scanning process on the plaintext to scan the plaintext into an image format file and encrypt it based on the plaintext in image format, so as to unify the format of the plaintext and improve the processing efficiency of node encryption.
[0083] Step 506, upload the ciphertext to the blockchain network for consensus processing.
[0084] After encrypting the plaintext into ciphertext, the node uploads the text to the blockchain network for consensus processing. In addition, the node can also upload the operation information of the current plaintext on-chain processing to the blockchain network for storage. In specific implementation, when uploading the ciphertext to the blockchain network for consensus processing, all nodes in the blockchain network will collect the information received during a period of time, integrate them together to form the block structure stored on the blockchain network, and spread it across the network; after any node receives the data in the network, it will compare it with the data it stores, deduplicate the same data, and select the latest data. After consensus, it will be synchronized across the network, so as to store the ciphertext in each node of the blockchain network.
[0085] In this embodiment, by encrypting the plaintext and uploading it to the blockchain for storage, the risk of plaintext leakage can be effectively reduced, and the security of the plaintext data can be ensured.
[0086] In one embodiment, uploading the ciphertext to the blockchain network for consensus processing includes: generating the on-chain information corresponding to the ciphertext; uploading the ciphertext and the on-chain information to the blockchain network for consensus processing; feeding back the print event identifier and the encryption method identifier in the on-chain information to the terminal.
[0087] In this embodiment, when the node encrypts and uploads the plaintext and uploads it to the blockchain network, it also uploads the operation record data of the current encryption on-chain to the blockchain network. Specifically, when the node uploads the ciphertext to the blockchain network for consensus processing, the on-chain information corresponding to the ciphertext is generated. The on-chain information can be the operation record data of the current encryption on-chain, and specifically can include but is not limited to data related to security such as the print event identifier, user ID, file MD5, timestamp, and encryption method ID. Among them, the print event identifier is used to identify the ciphertext involved in the print event, the user ID is used to identify each user, the file MD5 is the characteristic value obtained after the file passes through the MD5 mapping algorithm, the timestamp can be the moment when the plaintext is uploaded to the blockchain, and the encryption method ID is used to identify the encryption method adopted by the node when encrypting the plaintext. The on-chain information can construct a mapping relationship with the print event identifier, so that the corresponding complete on-chain information can be queried according to the print event identifier.
[0088] After obtaining the on-chain information corresponding to the current encryption and on-chain operation of the ciphertext, the ciphertext and the on-chain information are respectively uploaded to the blockchain network for consensus processing, so as to store both the ciphertext and the on-chain information in the blockchain network to ensure data security. In addition, the print event identifier and the encryption method identifier in the on-chain information are fed back to the terminal. Among them, the print event identifier represents the ciphertext involved in the print event and corresponds to the on-chain information. According to the print event identifier, the on-chain information can be determined, and the corresponding ciphertext can be obtained based on the on-chain information; the encryption method identifier represents the encryption method, and according to the encryption method identifier, the corresponding decryption method can be determined to decrypt the ciphertext to be printed to obtain the plaintext to be printed. By feeding back the print event identifier and the encryption method identifier to the terminal, it is possible to support the user to securely print at any printer node in the blockchain network.
[0089] In one embodiment, as Figure 6 shown, a blockchain-based printing method is provided. This method is executed on a printer node in the blockchain network. The printer node includes a data node and a printing node. The data node accesses the blockchain network and can perform data consensus with other nodes in the blockchain network; the printing node communicates with the data node in simplex mode, is used to receive the data sent by the data node and print the received data, and the printing node cannot connect to any other network, that is, the printing node cannot send data to the data node or the outside world. Specifically, the method includes:
[0090] Step 602, obtaining a print request message initiated by the terminal through the data node in the printer node of the blockchain network;
[0091] Step 604, extracting a print event identifier and a blockchain private key from the print request message by the data node;
[0092] Step 606, determining the block corresponding to the blockchain private key from the blockchain network through the data node;
[0093] Step 608, obtaining the ciphertext to be printed from the block by the data node according to the print event identifier;
[0094] Step 610, obtaining the print record information of the ciphertext through the data node;
[0095] Step 612, obtaining the print on-chain information based on the print record information through the data node;
[0096] Step 614, uploading the print on-chain information to the blockchain network by the data node for consensus processing and sending the ciphertext to the printing node;
[0097] Step 616, obtaining the input encryption method identifier by the data node;
[0098] Step 618: Determine the decryption method identifier that matches the encryption method identifier through the printing node;
[0099] Step 620: Determine the decryption method corresponding to the decryption method identifier through the printing node;
[0100] Step 622: The printing node decrypts the ciphertext through the decryption method and prints it;
[0101] Step 624: The printing node destroys the ciphertext and the plaintext.
[0102] Among them, the ciphertext is encrypted from the plaintext using a random encryption method. The plaintext is uploaded by the terminal to the blockchain network, and the encryption method identifier corresponding to the encryption method is fed back to the terminal. In this embodiment, the ciphertext during the printing process is encrypted and stored by the nodes of the blockchain for the plaintext. When printing, the ciphertext is obtained by the data node in the printer node from the blockchain network, and the printing node in the printer node decrypts and prints it according to the decryption method corresponding to the encryption method. After successful printing, the printing node eliminates the obtained ciphertext and plaintext, which can reduce the risk of data leakage and improve the security of data during the printing process. In this embodiment, by separating the processing of data acquisition and data printing to be handled by the data node and the printing node respectively, the printing node cannot send the scanned data during the printing process to the data node or the outside world, further ensuring the security of data during the printing process.
[0103] This application also provides an application scenario that applies the above blockchain-based printing method. Specifically, as Figure 7 shown, the application of the blockchain-based printing method in this application scenario is as follows:
[0104] Among them, both the printer node and the blockchain node are nodes in the blockchain network. The printer node includes a data node and a printing node. The data node accesses the blockchain network and can obtain data from the blockchain network. The printing node communicates with the data node in simplex mode, obtains data from the data node and prints it. The printing node can also obtain user input data according to the input device.
[0105] When the terminal uploads the plaintext, such as a literary work, specifically a novel work, the terminal sends the plaintext to the blockchain node in the blockchain network. The blockchain node encrypts the plaintext sent by the terminal to obtain the ciphertext, and generates the on-chain information recording this encryption and on-chain processing. On the one hand, the plaintext and the on-chain information are uploaded to the blockchain network. On the other hand, the printing event identifier and the encryption method identifier in the on-chain information are fed back to the terminal. Each node in the blockchain network performs a consensus process on the ciphertext and the on-chain information.
[0106] During the processing of a printing operation, the terminal initiates a print request message to the data node. The print request message carries a print event identifier and a blockchain private key. The data node logs in to the blockchain network based on the blockchain private key and obtains the ciphertext to be printed corresponding to the print event identifier from the blockchain network. After determining the corresponding print-on-chain information based on the current printing operation processing, on the one hand, the obtained ciphertext is sent to the printing node, and on the other hand, the print-on-chain information is sent to the blockchain network. Each node in the blockchain network performs a consensus process on the print-on-chain information.
[0107] The printing node obtains an encryption method identifier through an input device, decrypts the ciphertext according to the decryption method matching the encryption method, and prints it. After successful printing, the obtained plaintext and ciphertext are destroyed.
[0108] By adopting blockchain technology, the data in the printing process is encrypted and stored by the blockchain. When printing, the ciphertext is obtained from the blockchain network and decrypted according to the decryption method corresponding to the encryption method, which can reduce the risk of data leakage and improve the security of data in the printing process.
[0109] It should be understood that although Figure 2 、 5 The steps in the flowchart of -6 are shown in sequence according to the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise clearly stated in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, Figure 2 、 5 At least a part of the steps in -6 may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.
[0110] In one embodiment, as Figure 8 shown, a blockchain-based printing device 800 is provided. The device can be a software module, a hardware module, or a combination of both to form a part of a computer device. The device specifically includes: a request message acquisition module 802, a ciphertext acquisition module 804, an encryption identifier determination module 806, and a decryption and printing module 808, where:
[0111] The request message acquisition module 802 is used to obtain the print request message initiated by the terminal through the printer node in the blockchain network;
[0112] The ciphertext acquisition module 804 is used to obtain the ciphertext to be printed from the blockchain network according to the print request message; wherein, the ciphertext is encrypted from the plaintext by a random encryption method, the plaintext is uploaded to the blockchain network by the terminal, and the encryption method identifier corresponding to the encryption method is fed back to the terminal;
[0113] The encryption identifier determination module 806 is used to obtain the input encryption method identifier;
[0114] The decryption and printing module 808 is used to decrypt the ciphertext and print it by using the decryption method matching the encryption method identifier.
[0115] In one embodiment, the ciphertext acquisition module 804 includes a request message analysis module, a block determination module, and a ciphertext determination module; wherein: The request message analysis module is used to extract the print event identifier and the blockchain private key from the print request message; The block determination module is used to determine the block corresponding to the blockchain private key from the blockchain network; The ciphertext determination module is used to determine the block corresponding to the blockchain private key from the blockchain network;
[0116] In one embodiment, the ciphertext determination module includes an on-chain information acquisition module and a ciphertext acquisition module; wherein: The on-chain information acquisition module is used to determine the on-chain information corresponding to the print event identifier; The ciphertext acquisition module is used to obtain the ciphertext associated with the on-chain information from the block.
[0117] In one embodiment, the printer node includes a data node accessing the blockchain network and a print node that receives the data sent by the data node for simplex communication; It also includes a print record determination module, a print on-chain information module, and a ciphertext sending module; wherein: The print record determination module is used to obtain the print record information of the ciphertext through the data node; The print on-chain information module is used to obtain the print on-chain information based on the print record information through the data node; The ciphertext sending module is used to upload the print on-chain information to the blockchain network by the data node for consensus processing and send the ciphertext to the print node.
[0118] In one embodiment, the decryption and printing module 808 includes a decryption identifier determination module, a decryption method determination module, and a printing module; wherein: The decryption identifier determination module is used to determine the decryption method identifier matching the encryption method identifier through the print node; The decryption method determination module is used to determine the decryption method corresponding to the decryption method identifier through the print node; The printing module is used to decrypt and print the ciphertext by the print node through the decryption method.
[0119] In one embodiment, it further includes a data destruction module, which is used to destroy the ciphertext and the plaintext by the print node.
[0120] In one embodiment, it further includes a plaintext receiving module, a plaintext encryption module, and a ciphertext consensus module; wherein: the plaintext receiving module is used to obtain the plaintext uploaded by the terminal by a node in the blockchain network; the plaintext encryption module is used to encrypt the plaintext by a random encryption method to obtain a ciphertext; the ciphertext consensus module is used to upload the ciphertext to the blockchain network for consensus processing.
[0121] In one embodiment, the ciphertext consensus module includes an on-chain information module, a consensus processing module, and an identification feedback module; wherein: the on-chain information module is used to generate the on-chain information corresponding to the ciphertext; the consensus processing module is used to upload the ciphertext and the on-chain information to the blockchain network for consensus processing; the identification feedback module is used to feedback the printing event identification and the encryption method identification in the on-chain information to the terminal.
[0122] For the specific limitations of the blockchain-based printing device, reference can be made to the limitations of the blockchain-based printing method in the foregoing text, which will not be elaborated here. Each module in the above-mentioned blockchain-based printing device can be implemented in whole or in part by software, hardware, and their combination. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or stored in the memory of the computer device in the form of software, so as to facilitate the processor to call and execute the operations corresponding to the above-mentioned modules.
[0123] In one embodiment, a computer device is provided. The computer device can be a server, and its internal structure diagram can be as Figure 9 shown. The computer device includes a processor, a memory, and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data related to blockchain-based printing. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it implements a blockchain-based printing method. In addition, the computer device may further include a display screen and an input device. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covered on the display screen, or a button, a trackball, or a touchpad provided on the housing of the computer device, or an external keyboard, a touchpad, or a mouse, etc.
[0124] Those skilled in the art can understand, Figure 9The structure shown is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.
[0125] In one embodiment, a computer device is further provided, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, the steps in the above method embodiments are implemented.
[0126] In one embodiment, a computer-readable storage medium is provided, storing a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0127] Those of ordinary skill in the art can understand that all or part of the processes of implementing the methods in the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it may include the processes of the above method embodiments. Among them, any reference to a memory, storage, database, or other medium used in the various embodiments provided in this application may include at least one of non-volatile and volatile memories. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical memory, etc. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.
[0128] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in this specification.
[0129] The above-described embodiments only represent several implementation manners of this application, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of the invention patent. It should be noted that for those of ordinary skill in the art, without departing from the concept of this application, several modifications and improvements can still be made, and these all belong to the protection scope of this application. Therefore, the protection scope of the patent of this application should be subject to the appended claims.
Claims
1. A printing method based on blockchain, characterized in that, The method includes: Obtaining a print request message initiated by a terminal through a data node included in a printer node in a blockchain network; the printer node includes the data node accessing the blockchain network and a print node that receives data sent by the data node for simplex communication, and the print node is not connected to other networks; Through the data node, obtaining a ciphertext to be printed from the blockchain network according to the print request message; wherein, the ciphertext is encrypted from a plaintext by a random encryption method, the plaintext is uploaded by the terminal to the blockchain network, and an encryption method identifier corresponding to the encryption method is fed back to the terminal; Obtaining an input encryption method identifier through the data node; Sending the ciphertext to the print node through the data node, and decrypting the ciphertext and printing it by the print node using a decryption method matching the encryption method identifier.
2. The method according to claim 1, wherein The obtaining the ciphertext to be printed from the blockchain network according to the print request message includes: Extracting a print event identifier and a blockchain private key from the print request message; Determining a block corresponding to the blockchain private key from the blockchain network; Obtaining the ciphertext to be printed from the block according to the print event identifier.
3. The method according to claim 2, wherein The obtaining the ciphertext to be printed from the block according to the print event identifier includes: Determining on-chain information corresponding to the print event identifier; Obtaining the ciphertext associated with the on-chain information from the block.
4. The method according to claim 1, wherein After obtaining the ciphertext to be printed from the blockchain network according to the print request message, it further includes: Obtaining print record information of the ciphertext through the data node; Obtaining print on-chain information based on the print record information through the data node; Uploading the print on-chain information to the blockchain network by the data node for consensus processing, and sending the ciphertext to the print node.
5. The method according to claim 4, wherein The decrypting the ciphertext and printing it by the print node using a decryption method matching the encryption method identifier includes: Determining a decryption method identifier matching the encryption method identifier through the print node; Determining a decryption method corresponding to the decryption method identifier through the print node; Decrypting the ciphertext and printing it by the print node through the decryption method.
6. The method according to claim 4, wherein After decrypting the ciphertext and printing it by the print node using a decryption method matching the encryption method identifier, it further includes: Destroying the ciphertext and the plaintext by the print node.
7. The method according to any one of claims 1 to 6, characterized in that, The method further includes: Obtaining the plaintext uploaded by the terminal by a node in the blockchain network; Encrypting the plaintext by a random encryption method to obtain the ciphertext; Uploading the ciphertext to the blockchain network for consensus processing.
8. A printing device based on blockchain, characterized in that, The device includes: A request message acquisition module, configured to obtain a print request message initiated by a terminal through a data node included in a printer node in a blockchain network; the printer node includes the data node accessing the blockchain network and a print node that receives data sent by the data node for simplex communication, and the print node is not connected to other networks; A ciphertext acquisition module, configured to obtain ciphertext to be printed from the blockchain network through the data node according to the printing request message; wherein, the ciphertext is encrypted from plaintext by using a random encryption method, the plaintext is uploaded to the blockchain network by the terminal, and an encryption method identifier corresponding to the encryption method is fed back to the terminal; An encryption identifier determination module, configured to obtain an input encryption method identifier through the data node; A decryption and printing module, configured to send the ciphertext to the printing node through the data node, and decrypt and print the ciphertext by using a decryption method matching the encryption method identifier through the printing node.
9. The apparatus according to claim 8, wherein, the ciphertext acquisition module is further configured to extract a printing event identifier and a blockchain private key from the printing request message; determine a block corresponding to the blockchain private key from the blockchain network; and obtain the ciphertext to be printed from the block according to the printing event identifier.
10. The apparatus according to claim 9, wherein, the ciphertext acquisition module is further configured to determine chain-upload information corresponding to the printing event identifier; and obtain the ciphertext associated with the chain-upload information from the block.
11. The device according to claim 8, characterized in that, The apparatus further includes: A printing record determination module, configured to obtain printing record information of the ciphertext through the data node; A printing chain-upload information module, configured to obtain printing chain-upload information based on the printing record information through the data node; A ciphertext sending module, configured to upload the printing chain-upload information to the blockchain network by the data node for consensus processing, and send the ciphertext to the printing node.
12. The apparatus according to claim 11, wherein, the decryption and printing module is further configured to determine a decryption method identifier matching the encryption method identifier through the printing node; determine a decryption method corresponding to the decryption method identifier through the printing node; and decrypt and print the ciphertext by the printing node through the decryption method.
13. The device according to claim 11, characterized in that, The apparatus further includes: A data destruction module, configured to destroy the ciphertext and the plaintext by the printing node.
14. The device according to any one of claims 8 to 13, characterized in that, The apparatus further includes: A plaintext receiving module, configured to obtain the plaintext uploaded by the terminal by a node in the blockchain network; A plaintext encryption module, configured to encrypt the plaintext by using a random encryption method to obtain the ciphertext; A ciphertext consensus module, configured to upload the ciphertext to the blockchain network for consensus processing.
15. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
16. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Method for dynamically encrypting network data, and storage medium
CN108768649A
Printing management system and method based on block chain technology
CN111045613A
Secure 3D model sharing using distributed ledger
US20170279783A1