CN114154606B - Identification code generation method, computer device, and storage medium - Google Patents
Identification code generation method, computer device, and storage medium Download PDFInfo
- Publication number
- CN114154606B CN114154606B CN202111457982.3A CN202111457982A CN114154606B CN 114154606 B CN114154606 B CN 114154606B CN 202111457982 A CN202111457982 A CN 202111457982A CN 114154606 B CN114154606 B CN 114154606B
- Authority
- CN
- China
- Prior art keywords
- identification code
- user
- rule
- generate
- formulation
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 52
- 238000009472 formulation Methods 0.000 claims abstract description 64
- 239000000203 mixture Substances 0.000 claims abstract description 64
- 238000013475 authorization Methods 0.000 claims description 30
- 238000004590 computer program Methods 0.000 claims description 8
- 238000010586 diagram Methods 0.000 description 6
- 238000004891 communication Methods 0.000 description 4
- 230000006870 function Effects 0.000 description 4
- 230000000694 effects Effects 0.000 description 3
- 238000005299 abrasion Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000005530 etching Methods 0.000 description 2
- 239000000463 material Substances 0.000 description 2
- 238000005498 polishing Methods 0.000 description 2
- 238000007788 roughening Methods 0.000 description 2
- 238000000576 coating method Methods 0.000 description 1
- 239000003086 colorant Substances 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000010329 laser etching Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 239000002184 metal Substances 0.000 description 1
- 239000002923 metal particle Substances 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000002245 particle Substances 0.000 description 1
- 238000003825 pressing Methods 0.000 description 1
- 239000011347 resin Substances 0.000 description 1
- 229920005989 resin Polymers 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K19/00—Record carriers for use with machines and with at least a part designed to carry digital markings
- G06K19/06—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
- G06K19/06009—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking
- G06K19/06046—Constructional details
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/602—Providing cryptographic facilities or services
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K19/00—Record carriers for use with machines and with at least a part designed to carry digital markings
- G06K19/06—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
- G06K19/06009—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking
- G06K19/06046—Constructional details
- G06K19/0614—Constructional details the marking being selective to wavelength, e.g. color barcode or barcodes only visible under UV or IR
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/08—Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
- H04L9/0861—Generation of secret information including derivation or calculation of cryptographic keys or passwords
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Databases & Information Systems (AREA)
- Signal Processing (AREA)
- General Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Computing Systems (AREA)
- General Health & Medical Sciences (AREA)
- Computer Hardware Design (AREA)
- Bioethics (AREA)
- Software Systems (AREA)
- Health & Medical Sciences (AREA)
- Data Mining & Analysis (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
- Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
Abstract
The invention provides an identification code generation method, a computer device and a storage medium, wherein the method comprises the following steps: receiving a first identification code rule formulation request transaction generated by a first user side of a first user; executing a first identification code rule making request transaction through an identification code management contract, and distributing a first identification code making rule for a first user when the execution is successful; receiving a first identification code generated by a second user side of a second user to generate a request transaction; judging whether a second identification code formulation rule distributed for a second user exists on the blockchain through an identification code management contract: if yes, the first data to be encoded is encoded according to the second identification code formulation rule to generate a first identification code with a color and/or a graphic shape. The method and the device enable the small micro-precision parts to be easily identified.
Description
Technical Field
The present application relates to the field of blockchain technologies, and in particular, to an identification code generating method, a computer device, and a storage medium.
Background
In the prior art, the batch management marking identification of the parts generally adopts methods such as an electrochemical etching method, a laser etching method, a dot etching method, an ink-jet method and the like. In the case of small micro-precision parts, the above method has a problem that it is difficult to identify the parts.
Disclosure of Invention
In view of the foregoing drawbacks or shortcomings in the prior art, it is desirable to provide an identification code generation method, a computer device, and a storage medium that are easy to recognize.
In a first aspect, the present invention provides a method for generating an identification code for a blockchain node, the blockchain being configured with an identification code management contract, the method comprising:
receiving a first identification code rule formulation request transaction generated by a first user side of a first user;
executing a first identification code rule making request transaction through an identification code management contract, and distributing a first identification code making rule for a first user when the execution is successful; wherein the first identification code formulation rule comprises a color and/or a graphic shape;
receiving a first identification code generated by a second user side of a second user to generate a request transaction; wherein the first identification code generation request transaction includes first data to be encoded;
judging whether a second identification code formulation rule distributed for a second user exists on the blockchain through an identification code management contract:
if yes, the first data to be encoded is encoded according to the second identification code formulation rule to generate a first identification code with a color and/or a graphic shape.
In a second aspect, the present invention provides an identification code generating method applicable to a relay server, where a hardware encryption card is configured on the relay server, and the hardware encryption card stores a plurality of private keys allocated to users, where each private key is specified by a unique index, and the method includes:
receiving first identification code rule making request information generated by a first user side of a first user; the first identification code rule making request information comprises a first index;
signing the first identification code rule making request information through a first private key corresponding to the first index to generate a first identification code rule making request transaction;
transmitting a first identification code rule formulation request transaction to a blockchain network for a blockchain node to: executing a first identification code rule making request transaction through an identification code management contract, and distributing a first identification code making rule for a first user when the execution is successful; wherein the first identification code formulation rule comprises a color and/or a graphic shape;
receiving first identification code generation request information generated by a second user side of a second user; the first identification code generation request information comprises first data to be coded and second index;
signing the first identification code generation request information through a second private key corresponding to the second index to generate a first identification code generation request transaction;
transmitting the first identification code generation request transaction to the blockchain network for the blockchain node to:
judging whether a second identification code formulation rule distributed for a second user exists on the blockchain through an identification code management contract:
if yes, the first data to be encoded is encoded according to the second identification code formulation rule to generate a first identification code with a color and/or a graphic shape.
In a third aspect, the present invention also provides an apparatus comprising one or more processors and a memory, wherein the memory contains instructions executable by the one or more processors to cause the one or more processors to perform the method of generating an identification code provided in accordance with embodiments of the present invention.
In a fourth aspect, the present invention also provides a storage medium storing a computer program that causes a computer to execute the identification code generation method provided according to the embodiments of the present invention.
According to the identification code generation method, the computer equipment and the storage medium provided by the embodiments of the invention, request transaction is formulated by receiving a first identification code rule generated by a first user side of a first user; executing a first identification code rule making request transaction through an identification code management contract, and distributing a first identification code making rule for a first user when the execution is successful; receiving a first identification code generated by a second user side of a second user to generate a request transaction; judging whether a second identification code formulation rule distributed for a second user exists on the blockchain through an identification code management contract: if so, the first data to be coded is coded according to the second identification code formulation rule to generate the first identification code with color and/or graphic shape, so that the small micro-precision part is easy to identify.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the detailed description of non-limiting embodiments, made with reference to the following drawings, in which:
fig. 1 is a flowchart of an identification code generating method according to an embodiment of the present invention.
Fig. 2 is a flowchart of another method for generating an identification code according to an embodiment of the present invention.
Fig. 3 is a schematic structural diagram of an apparatus according to an embodiment of the present invention.
Detailed Description
The present application is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be noted that, for convenience of description, only the portions related to the invention are shown in the drawings.
It should be noted that, in the case of no conflict, the embodiments and features in the embodiments may be combined with each other. The present application will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 is a flowchart of an identification code generating method according to an embodiment of the present invention. As shown in fig. 1, in this embodiment, the present invention provides an identification code generation method applicable to a blockchain node, where a blockchain is configured with an identification code management contract, the method includes:
s11: receiving a first identification code rule formulation request transaction generated by a first user side of a first user;
s13: executing a first identification code rule making request transaction through an identification code management contract, and distributing a first identification code making rule for a first user when the execution is successful; wherein the first identification code formulation rule comprises a color and/or a graphic shape;
s15: receiving a first identification code generated by a second user side of a second user to generate a request transaction; wherein the first identification code generation request transaction includes first data to be encoded;
s171: judging whether a second identification code formulation rule distributed for a second user exists on the blockchain through an identification code management contract:
if yes, step S172 is executed: the first data to be encoded is encoded according to the second identification code formulation rule to generate a first identification code with a color and/or a graphic shape.
TABLE 1
Specifically, a user side of a part generator A responds to a request A to formulate an identification code rule, and generates an identification code rule formulation request transaction tx1;
the block chain node executes step S11 and receives tx1;
step S13, executing tx1 by the block chain link point through the identification code management contract, and when the tx1 is successfully executed, setting rules for the identification code allocation A; assume that the assigned identification code formulation rules are as shown in table 1 above;
the user side of A responds to the request of A to generate an identification code of a certain batch of parts M, and generates an identification code generation request transaction tx2; wherein tx2 comprises the data to be encoded: the generation time T of the part M;
the block chain node executes step S15 to receive tx2;
the block link point performs step S171 of determining, by the identifier management contract, whether or not the identifier formulation rule assigned for a exists on the block chain:
since there is, step S172 is performed: t is encoded according to the identification code formulation rules of Table 1 to generate the corresponding identification code.
The identification code may be marked on M by A, or by the part manufacturer authorized by A; the specific marking method can be configured as follows: the polishing or roughening treatment step can be finished in advance by pressing the metal particles with different colors into the surface of M by high pressure, for example, the surface of M needs polishing or roughening treatment. The marking method can reduce marking difficulty, marking cost and part surface defects.
In order to reduce the abrasion degree of the metal small particle mark on the surface of the part, a transparent coating process can be carried out on the surface of the M, and the material can be made of a stable transparent resin material, so that the effects of protecting the mark and resisting abrasion are achieved.
The above-described embodiments allow for easy identification of small micro-precision parts.
Preferably, encoding the first data to be encoded according to the second identification code formulation rule to generate the first identification code with a color, and/or a graphic shape includes:
generating one or more first identification codes according to the content of the first data to be coded and the maximum capacity of the single identification code capable of coding the data;
when generating a plurality of first identification codes, each first identification code further comprises a front-back connection relation.
Preferably, the method further comprises:
receiving a first authorized transaction generated by a third user side of a third user; wherein the authorized transaction includes fourth user addresses of a plurality of fourth users;
executing a first authorized transaction through an identification code management contract, and recording a first authorized association relation between a third user address of a third user and each fourth user address on a blockchain when the execution is successful;
receiving a first identification code generated by a fifth user side of a fifth user to authorize generation of a request transaction; wherein the first identification code authorization generation request transaction includes second data to be encoded;
judging whether a second authorization association relationship between the sixth user and the fifth user exists on the blockchain through the identification code management contract:
if so, the second data to be encoded is encoded according to a sixth identification code formulation rule allocated to the sixth user to generate a second identification code with a color and/or a graphic shape.
Specifically, a may also authorize others to formulate rules using the assigned identification code.
A authorizes B, C, D to formulate rules using the identification code assigned by a, generating an authorized transaction tx3, tx3 including addr (B), addr (C), addr (D);
the blockchain node receives tx3;
executing tx3 by the block chain node through an identification code management contract, and recording the authorized association relation of addr (A), addr (B), addr (C) and addr (D) on the block chain when the execution is successful;
b, the user generates an identification code to authorize the generation request transaction tx4; tx4 comprises the coded data M1;
the blockchain node receives tx4;
the blockchain node judges whether the authorization association relation with addr (B) exists on the blockchain through an identification code management contract:
since addr (A) is present, addr (B), addr (C), addr (D), M1 is encoded according to the identification code formulation rules of Table 1 to generate the corresponding identification code.
If each user applies for the identification code rule formulation on the block chain, a large number of identification code formulation rules are recorded on the block chain; and, each user needs to spend the generation identification code rule to formulate the commission of the request transaction, which can cause the waste of commission;
the above embodiment can reduce the rule of making the identification code recorded on the blockchain, and save the expenditure of the commission, and is suitable for the situation of the friends with B, C, D being A and the situation of the sub-manufacturers with B, C, D being A.
Fig. 2 is a flowchart of another method for generating an identification code according to an embodiment of the present invention. As shown in fig. 2, in this embodiment, the present invention provides an identification code generating method applicable to a relay server, where a hardware encryption card is configured on the relay server, and the hardware encryption card stores a plurality of private keys allocated to a user, where each private key is specified by a unique index, and the method includes:
s21: receiving first identification code rule making request information generated by a first user side of a first user; the first identification code rule making request information comprises a first index;
s22: signing the first identification code rule making request information through a first private key corresponding to the first index to generate a first identification code rule making request transaction;
s23: transmitting a first identification code rule formulation request transaction to a blockchain network for a blockchain node to: executing a first identification code rule making request transaction through an identification code management contract, and distributing a first identification code making rule for a first user when the execution is successful; wherein the first identification code formulation rule comprises a color and/or a graphic shape;
s24: receiving first identification code generation request information generated by a second user side of a second user; the first identification code generation request information comprises first data to be coded and second index;
s25: signing the first identification code generation request information through a second private key corresponding to the second index to generate a first identification code generation request transaction;
s26: transmitting the first identification code generation request transaction to the blockchain network for the blockchain node to:
judging whether a second identification code formulation rule distributed for a second user exists on the blockchain through an identification code management contract:
if yes, the first data to be encoded is encoded according to the second identification code formulation rule to generate a first identification code with a color and/or a graphic shape.
Specifically, a hardware encryption card is shared by a plurality of users; the first identification code rule formulation request information and the first identification code generation request information further include incremental nonces; s22 includes "determining whether the first private key is a private key assigned for the first user: if yes, signing the first identification code rule making request information through a first private key corresponding to the first index x to generate a first identification code rule making request transaction; and S25 includes "determining whether the second private key is a private key assigned for the second user: if yes, signing the first identification code generation request information through a second private key corresponding to the second index to generate a first identification code generation request transaction as an example;
suppose A, B, C, D shares a piece of hardware encryption card; the hardware encryption card stores private keys addr (A) _prikey_index_1 to addr (A) _prikey_index_3, addr (B) _prikey_index_1 to addr (B) _prikey_index_3, … … and addr (D) _prikey_index_1 to addr (D) _prikey_index_3 respectively allocated for A to D;
specifically, a user side of a part generator A responds to a request of A to formulate an identification code rule, and generates identification code rule formulation request information; the identification code rule making request information comprises index_1 and incremental nonces;
the relay server executes step S21 to receive the identification code rule formulation request information;
step S22 is executed by the relay server, and whether addr (A) _priKey_index_1 is a private key distributed for A or not is judged;
because the identification code rule making request information is signed through addr (A) _prikey_index_1 to generate an identification code rule making request transaction tx1;
the relay server executes step S23 to send tx1 to the blockchain network;
the block chain link point receives tx1, executes tx1 through the identification code management contract, and distributes identification codes for A to formulate rules when tx1 is executed successfully; assume that the assigned identification code formulation rules are as shown in table 1 above;
the user side of A responds to the request of A to generate the identification code of a certain batch of parts M, and generates identification code generation request information; the identification code generation request information includes data to be encoded: the generation time T of the part M, index_2 and incremental nonce;
the relay server executes step S24 to receive the identification code generation request information;
step S25 is executed by the relay server, and whether addr (A) _primary_index_2 is a private key distributed for A or not is judged;
because the identification code rule making request information is signed through addr (A) _prikey_index_2 to generate an identification code rule making request transaction tx2;
the relay server executes step S26 to send tx2 to the blockchain network;
the block chain link point receives tx2 and judges whether an identification code formulation rule distributed for A exists on the block chain or not through an identification code management contract:
since present, T is encoded according to the identification code formulation rules of table 1 to generate a corresponding identification code.
The above embodiment differs from the embodiment shown in fig. 1 in that the above embodiment introduces a relay server, and is signed by the private key stored by the hardware encryption card, regardless of tx1 or tx2, without exposing the private key of a itself.
Because the hardware encryption card has higher cost, if the hardware encryption card cannot be virtualized and reused, the use cost is higher, and the embodiment also enables the hardware encryption card to be reused, thereby reducing the use cost.
It should be understood by those skilled in the art that the above method may be modified according to actual needs, for example, when the relay server determines that addr (a) _prikey_index_1 is a private key allocated for a, generates signature information of the identifier code rule formulation request information and returns the signature information to a, and then a signs the identifier code rule formulation request information through addr (a) _prikey_index_1 to generate an identifier code rule formulation request transaction tx1 and sends the identifier code rule formulation request transaction tx1 to the blockchain, so that tx2 is the same.
It will be appreciated by those skilled in the art that if the first identification code rule formulation request information, the first identification code generation request information does not include incremental nonces, then the first identification code generation request information is considered to be invalid request information.
The above-described embodiments allow for easy identification of small micro-precision parts.
Preferably, a user is correspondingly provided with a hardware encryption card; the first identification code rule formulation request information and the first identification code generation request information further include incremental nonces.
The above-described embodiment differs from the embodiment shown in fig. 2 in that one user is provided with a corresponding one of the hardware encryption cards, which are not reusable.
Preferably, the first identifier code rule formulation request message further includes a first authorization code, signing the first identifier code rule formulation request message with a first private key corresponding to the first index to generate a first identifier code rule formulation request transaction includes:
when the first authorization code is correct, signing the first identification code rule making request information through a first private key corresponding to the first index to generate a first identification code rule making request transaction;
the first identification code generation request message further includes a second authorization code; signing the first identification code generation request information through a second private key corresponding to the second index to generate a first identification code generation request transaction comprises:
when the second authorization code is correct, the first identification code generation request information is signed through a second private key corresponding to the second index to generate a first identification code generation request transaction.
Each assigned private key corresponds to an authorization code, for example, a, and the relay server can sign the identification code rule formulation request information through addr (a) _private_index_1 to generate an identification code rule formulation request transaction tx1 only when the authorization code pass_pin_index_1 is provided.
It should be understood by those skilled in the art that the first authorization code included in the first identification code rule making request information may be a plaintext of the first authorization code, or may be an ciphertext of the authorization code generated by encryption, so that the same technical effects may be achieved.
It should be understood by those skilled in the art that the first authorization code may not be included in the first identification code rule making request information, and may be configured to be sent to the relay server separately according to actual needs, so as to achieve the same technical effects.
Fig. 3 is a schematic structural diagram of an apparatus according to an embodiment of the present invention.
As shown in fig. 3, as another aspect, the present application also provides an apparatus 300 including one or more Central Processing Units (CPUs) 301 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 302 or a program loaded from a storage section 308 into a Random Access Memory (RAM) 303. In the RAM303, various programs and data required for the operation of the device 300 are also stored. The CPU301, ROM302, and RAM303 are connected to each other through a bus 304. An input/output (I/O) interface 305 is also connected to bus 304.
The following components are connected to the I/O interface 305: an input section 306 including a keyboard, a mouse, and the like; an output portion 307 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage section 308 including a hard disk or the like; and a communication section 309 including a network interface card such as a LAN card, a modem, or the like. The communication section 309 performs communication processing via a network such as the internet. The drive 310 is also connected to the I/O interface 305 as needed. A removable medium 311 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is installed on the drive 310 as needed, so that a computer program read therefrom is installed into the storage section 308 as needed.
In particular, according to embodiments of the present disclosure, the method described in any of the above embodiments may be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program comprising program code for performing any of the methods described above. In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 309, and/or installed from the removable medium 311.
As yet another aspect, the present application also provides a computer-readable storage medium, which may be a computer-readable storage medium contained in the apparatus of the above-described embodiment; or may be a computer-readable storage medium, alone, that is not assembled into a device. The computer readable storage medium stores one or more programs for use by one or more processors to perform the methods described herein.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units or modules described in the embodiments of the present application may be implemented by software, or may be implemented by hardware. The described units or modules may also be provided in a processor, for example, each of the units may be a software program provided in a computer or a mobile smart device, or may be separately configured hardware devices. Wherein the names of the units or modules do not in some cases constitute a limitation of the units or modules themselves.
The foregoing description is only of the preferred embodiments of the present application and is presented as a description of the principles of the technology being utilized. It will be appreciated by persons skilled in the art that the scope of the invention referred to in this application is not limited to the specific combinations of features described above, but also covers other embodiments which may be formed by any combination of features described above or their equivalents without departing from the spirit of the application. Such as the above-described features and technical features having similar functions (but not limited to) disclosed in the present application are replaced with each other.
Claims (11)
1. An identification code generation method, wherein a blockchain is configured with an identification code management contract, the method being applicable to blockchain nodes, the method comprising:
receiving a first identification code rule formulation request transaction generated by a first user side of a first user;
executing the first identification code rule making request transaction through the identification code management contract, and distributing a first identification code making rule for the first user when the execution is successful; wherein the first identification code formulation rule comprises a color and/or a graphic shape;
receiving a first identification code generated by a second user side of a second user to generate a request transaction; wherein the first identification code generation request transaction includes first data to be encoded;
judging whether a second identification code formulation rule distributed for the second user exists on the blockchain or not through the identification code management contract:
and if so, encoding the first data to be encoded according to the second identification code formulation rule to generate a first identification code with a color and/or a graphic shape.
2. The method of claim 1, wherein encoding the first data to be encoded according to the second identification code formulation rule to generate a first identification code with a color, and/or a graphic shape comprises:
generating one or more first identification codes according to the content of the first data to be coded and the maximum capacity of the single identification code capable of coding data;
when a plurality of first identification codes are generated, each first identification code further comprises a front-back bearing relation.
3. The method as recited in claim 1, further comprising:
receiving a first authorized transaction generated by a third user side of a third user; wherein the authorization transaction includes fourth user addresses of a number of fourth users;
executing the first authorized transaction through the identification code management contract, and recording a first authorized association relation between the third user address of the third user and each fourth user address onto a blockchain when the execution is successful;
receiving a first identification code generated by a fifth user side of a fifth user to authorize generation of a request transaction; wherein the first identification code authorization generation request transaction comprises second data to be encoded;
judging whether a second authorization association relationship between a sixth user and the fifth user exists on the blockchain through the identification code management contract:
and if so, encoding the second data to be encoded according to a sixth identification code formulation rule allocated to the sixth user so as to generate a second identification code with a color and/or a graphic shape.
4. An identification code generation method, characterized in that a blockchain is configured with an identification code management contract, a relay server is configured with a hardware encryption card, the hardware encryption card stores a plurality of private keys allocated to users, each private key is correspondingly specified by a unique index, the method is suitable for the relay server, and the method comprises:
receiving first identification code rule making request information generated by a first user side of a first user; the first identification code rule making request information comprises a first index;
signing the first identification code rule making request information through a first private key corresponding to the first index to generate a first identification code rule making request transaction;
transmitting the first identification code rule formulation request transaction to a blockchain network for a blockchain node to: executing the first identification code rule making request transaction through the identification code management contract, and distributing a first identification code making rule for the first user when the execution is successful; wherein the first identification code formulation rule comprises a color and/or a graphic shape;
receiving first identification code generation request information generated by a second user side of a second user; the first identification code generation request information comprises first data to be coded and second index;
signing the first identification code generation request information through a second private key corresponding to the second index to generate a first identification code generation request transaction;
transmitting the first identification code generation request transaction to a blockchain network for a blockchain node to:
judging whether a second identification code formulation rule distributed for the second user exists on the blockchain or not through the identification code management contract:
and if so, encoding the first data to be encoded according to the second identification code formulation rule to generate a first identification code with a color and/or a graphic shape.
5. The method of claim 4, wherein encoding the first data to be encoded according to the second identification code formulation rule to generate a first identification code with a color, and/or a graphic shape comprises:
generating one or more first identification codes according to the content of the first data to be coded and the maximum capacity of the single identification code capable of coding data;
when a plurality of first identification codes are generated, each first identification code further comprises a front-back bearing relation.
6. The method as recited in claim 4, further comprising:
receiving first authorization information generated by a third user side of a third user; the authorization information comprises fourth user addresses and third index of a plurality of fourth users;
signing the first authorization information through a third private key corresponding to the third index to generate a first authorization information transaction;
transmitting the first identification code generation request transaction to a blockchain network for a blockchain node to: executing a first authorized transaction through the identification code management contract, and recording a first authorized association relation between a third user address of the third user and each fourth user address on a blockchain when the execution is successful;
receiving first identification code authorization generation request information generated by a fifth user side of a fifth user; the first identification code authorization generation request transaction comprises second data to be coded and a fourth index;
signing the first identification code authorization generation request information through a fourth private key corresponding to the fourth index to generate a first identification code authorization generation request transaction;
transmitting the first identification code authorization generation request transaction to a blockchain network for a blockchain node to:
judging whether a second authorization association relationship between a sixth user and the fifth user exists on the blockchain through the identification code management contract:
and if so, encoding the second data to be encoded according to a sixth identification code formulation rule allocated to the sixth user so as to generate a second identification code with a color and/or a graphic shape.
7. The method of claim 4, wherein the first identification code rule formulation request message further comprises a first authorization code, and wherein signing the first identification code rule formulation request message with the first private key corresponding to the first index to generate a first identification code rule formulation request transaction comprises:
when the first authorization code is correct, signing the first identification code rule making request information through a first private key corresponding to the first index to generate a first identification code rule making request transaction;
the first identification code generation request information further comprises a second authorization code; the signing the first identification code generation request information by the second private key corresponding to the second index to generate a first identification code generation request transaction includes:
and when the second authorization code is correct, signing the first identification code generation request information through a second private key corresponding to the second index to generate a first identification code generation request transaction.
8. The method of claim 4, wherein a user is provided with a corresponding one of the hardware encryption cards; the first identification code rule formulation request information and the first identification code generation request information further include incremental nonces.
9. The method of claim 4, wherein a plurality of users share one of the hardware encryption cards; the first identification code rule formulation request information and the first identification code generation request information further comprise incremental nonces;
the signing the first identification code rule making request information through the first private key corresponding to the first index to generate a first identification code rule making request transaction includes:
judging whether the first private key is a private key distributed for the first user or not:
if yes, signing the first identification code rule making request information through a first private key corresponding to the first index to generate a first identification code rule making request transaction;
the signing the first identification code generation request information by the second private key corresponding to the second index to generate a first identification code generation request transaction includes:
judging whether the second private key is a private key distributed for the second user or not:
and if so, signing the first identification code generation request information through a second private key corresponding to the second index to generate a first identification code generation request transaction.
10. An apparatus, the apparatus comprising:
one or more processors;
a memory for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method of any of claims 1-9.
11. A storage medium storing a computer program, characterized in that the program, when executed by a processor, implements the method according to any one of claims 1-9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111457982.3A CN114154606B (en) | 2021-12-02 | 2021-12-02 | Identification code generation method, computer device, and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111457982.3A CN114154606B (en) | 2021-12-02 | 2021-12-02 | Identification code generation method, computer device, and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114154606A CN114154606A (en) | 2022-03-08 |
CN114154606B true CN114154606B (en) | 2024-03-15 |
Family
ID=80455800
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111457982.3A Active CN114154606B (en) | 2021-12-02 | 2021-12-02 | Identification code generation method, computer device, and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114154606B (en) |
Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102163336A (en) * | 2011-03-25 | 2011-08-24 | 重庆酷贝科技发展有限公司 | Method for coding and decoding image identification codes |
EP2849121A1 (en) * | 2013-09-11 | 2015-03-18 | Roman Plöckl | Package marking and method for marking a package and verification of a packaged product |
CN108829350A (en) * | 2018-05-31 | 2018-11-16 | 阿里巴巴集团控股有限公司 | Data migration method and device based on block chain |
CN109102401A (en) * | 2018-07-23 | 2018-12-28 | 上海点融信息科技有限责任公司 | Method and apparatus for running intelligent contract in block chain network |
CA3060119A1 (en) * | 2017-08-23 | 2019-02-28 | Alibaba Group Holding Limited | Method and apparatus for generating and identifying identification code |
CN109583915A (en) * | 2018-11-28 | 2019-04-05 | 杭州复杂美科技有限公司 | Anti-counterfeiting authentication method, equipment and storage medium |
CN109658074A (en) * | 2018-08-09 | 2019-04-19 | 杭州复杂美科技有限公司 | A kind of storage of data and read system and method, equipment and storage medium |
CN109783372A (en) * | 2018-12-26 | 2019-05-21 | 中链科技有限公司 | Method for testing software, device, electronic equipment and storage medium based on block chain |
CN110796545A (en) * | 2019-10-25 | 2020-02-14 | 杭州趣链科技有限公司 | Batch processing method, equipment and storage medium for blockchain transaction |
WO2020063185A1 (en) * | 2018-09-30 | 2020-04-02 | 阿里巴巴集团控股有限公司 | Blockchain-based anti-counterfeiting method and apparatus, and electronic device |
CN111027990A (en) * | 2019-12-17 | 2020-04-17 | 广东工业大学 | Product anti-counterfeiting method and system based on material mark block chain |
CN111062188A (en) * | 2019-12-26 | 2020-04-24 | 山东爱城市网信息技术有限公司 | Method and equipment for generating and verifying unique identification code based on block chain |
WO2020147384A1 (en) * | 2019-01-17 | 2020-07-23 | 平安科技(深圳)有限公司 | Blockchain-based safe transaction method, device and apparatus, and storage medium |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TWI707573B (en) * | 2019-11-14 | 2020-10-11 | 財團法人資訊工業策進會 | Apparatus for adding data to blockchain, data verification apparatus, and data verification method |
-
2021
- 2021-12-02 CN CN202111457982.3A patent/CN114154606B/en active Active
Patent Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102163336A (en) * | 2011-03-25 | 2011-08-24 | 重庆酷贝科技发展有限公司 | Method for coding and decoding image identification codes |
EP2849121A1 (en) * | 2013-09-11 | 2015-03-18 | Roman Plöckl | Package marking and method for marking a package and verification of a packaged product |
CA3060119A1 (en) * | 2017-08-23 | 2019-02-28 | Alibaba Group Holding Limited | Method and apparatus for generating and identifying identification code |
CN108829350A (en) * | 2018-05-31 | 2018-11-16 | 阿里巴巴集团控股有限公司 | Data migration method and device based on block chain |
CN109102401A (en) * | 2018-07-23 | 2018-12-28 | 上海点融信息科技有限责任公司 | Method and apparatus for running intelligent contract in block chain network |
CN109658074A (en) * | 2018-08-09 | 2019-04-19 | 杭州复杂美科技有限公司 | A kind of storage of data and read system and method, equipment and storage medium |
WO2020063185A1 (en) * | 2018-09-30 | 2020-04-02 | 阿里巴巴集团控股有限公司 | Blockchain-based anti-counterfeiting method and apparatus, and electronic device |
CN109583915A (en) * | 2018-11-28 | 2019-04-05 | 杭州复杂美科技有限公司 | Anti-counterfeiting authentication method, equipment and storage medium |
CN109783372A (en) * | 2018-12-26 | 2019-05-21 | 中链科技有限公司 | Method for testing software, device, electronic equipment and storage medium based on block chain |
WO2020147384A1 (en) * | 2019-01-17 | 2020-07-23 | 平安科技(深圳)有限公司 | Blockchain-based safe transaction method, device and apparatus, and storage medium |
CN110796545A (en) * | 2019-10-25 | 2020-02-14 | 杭州趣链科技有限公司 | Batch processing method, equipment and storage medium for blockchain transaction |
CN111027990A (en) * | 2019-12-17 | 2020-04-17 | 广东工业大学 | Product anti-counterfeiting method and system based on material mark block chain |
CN111062188A (en) * | 2019-12-26 | 2020-04-24 | 山东爱城市网信息技术有限公司 | Method and equipment for generating and verifying unique identification code based on block chain |
Also Published As
Publication number | Publication date |
---|---|
CN114154606A (en) | 2022-03-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109409472B (en) | Two-dimensional code generation method, data processing device and server | |
CN105450620B (en) | A kind of information processing method and device | |
US6889378B2 (en) | Information processing method, inter-task communication method, and computer-executable program for the same | |
CN109714350A (en) | The authority control method and device of application program, storage medium, computer equipment | |
CN108242999B (en) | Key escrow method, device and computer-readable storage medium | |
CN103839097A (en) | Method and device for generating two-dimension code based on digital signature | |
CN101094383A (en) | IPTV authentication and authorization method, server and system | |
CN104252613A (en) | Method, device and terminal for obtaining virtual object | |
CN113114796B (en) | Active identification carrier, management method thereof and service platform | |
CN110263574B (en) | Data management method, device, system and readable storage medium | |
CN111445331A (en) | Transaction matching method and device | |
CN112966168B (en) | Business label query method and device for realizing privacy protection | |
CN113569263A (en) | Secure processing method and device for cross-private-domain data and electronic equipment | |
CN114154606B (en) | Identification code generation method, computer device, and storage medium | |
CN110366724B (en) | Computer system, license management method, and recording medium | |
CN109558419A (en) | Data query method, apparatus and storage medium | |
CN114095200B (en) | Resource access authority management method and device, electronic equipment and medium | |
CN111291084A (en) | Sample ID alignment method, device, equipment and storage medium | |
JP2011071758A (en) | Communication equipment, communication method, information processing apparatus, information processing method, program, and communication system | |
CN111798239B (en) | Parallel chain consensus method, apparatus and storage medium | |
CN114528377A (en) | Method, equipment and storage medium for batch signing of PDF electronic signatures | |
CN114301702A (en) | Agent loss transmission method and device, storage medium and electronic equipment | |
CN114302207A (en) | Bullet screen display method, device, system, equipment and storage medium | |
CN111062058B (en) | Block chain-based key pair processing method and device, terminal and readable storage medium | |
CN110932844A (en) | Terminal safety communication method and system for emergency field |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |