CN114742017B - Method, device, equipment and storage medium for generating product anti-counterfeiting code - Google Patents

Method, device, equipment and storage medium for generating product anti-counterfeiting code Download PDF

Info

Publication number
CN114742017B
CN114742017B CN202210349299.6A CN202210349299A CN114742017B CN 114742017 B CN114742017 B CN 114742017B CN 202210349299 A CN202210349299 A CN 202210349299A CN 114742017 B CN114742017 B CN 114742017B
Authority
CN
China
Prior art keywords
identifier
code
product
bit
generating
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
Application number
CN202210349299.6A
Other languages
Chinese (zh)
Other versions
CN114742017A (en
Inventor
邢四化
刘莫
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Commerce Networks Shanghai Co ltd
Original Assignee
China Commerce Networks Shanghai Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Commerce Networks Shanghai Co ltd filed Critical China Commerce Networks Shanghai Co ltd
Priority to CN202210349299.6A priority Critical patent/CN114742017B/en
Publication of CN114742017A publication Critical patent/CN114742017A/en
Application granted granted Critical
Publication of CN114742017B publication Critical patent/CN114742017B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/126Character encoding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Bioethics (AREA)
  • Software Systems (AREA)
  • Computer Hardware Design (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • Storage Device Security (AREA)

Abstract

The embodiment of the invention discloses a method, a device, equipment and a storage medium for generating product anti-counterfeiting codes. Wherein the method comprises the following steps: constructing a character string based on the enterprise identifier, the date identifier, the product identifier and the random number, and generating an original product code for the character string by adopting a first encryption rule; splicing the original product code with the link identifier and the version identifier to obtain a splicing result, and obtaining a check bit by adopting a check bit generation algorithm; wherein the link identification is obtained based on link information of enterprises; and generating a product anti-counterfeiting code for marking authenticity based on the splicing result and the check bit by adopting a second encryption rule. According to the technical scheme, different encryption rules can be adopted to generate the product anti-counterfeiting code through multiple encryption, so that the safety of the product anti-counterfeiting code is enhanced, and the risk of theft of the product anti-counterfeiting code is effectively reduced.

Description

Method, device, equipment and storage medium for generating product anti-counterfeiting code
Technical Field
The present invention relates to the field of product anti-counterfeiting technologies, and in particular, to a method, an apparatus, a device, and a storage medium for generating product anti-counterfeiting codes.
Background
The product anti-counterfeiting code is used as an identity mark of a product, and plays a vital role in the field of product anti-counterfeiting. Consumers can quickly inquire the authenticity of the product through the product anti-counterfeiting code. However, some lawbreakers provide consumers with counterfeit and inferior products by misappropriating the product security code, severely compromising the consumer's interests. Therefore, how to prevent the anti-counterfeit code from being stolen in the product circulation process is a problem to be solved in the present day.
In the related art, the original information is encrypted by means of matrix inverse transformation. However, the scheme simply encrypts the original information only once, and is easy to crack and steal by people, so that the security of the encrypted information is poor.
Disclosure of Invention
The invention provides a method, a device, equipment and a storage medium for generating product anti-counterfeiting codes, which can generate the product anti-counterfeiting codes by adopting different encryption rules through multiple encryption, thereby enhancing the safety of the product anti-counterfeiting codes and effectively reducing the risk of the product anti-counterfeiting codes being stolen.
According to an aspect of the present invention, there is provided a method for generating product security codes, the method comprising:
constructing a character string based on the enterprise identifier, the date identifier, the product identifier and the random number, and generating an original product code for the character string by adopting a first encryption rule;
splicing the original product code with the link identifier and the version identifier to obtain a splicing result, and obtaining a check bit by adopting a check bit generation algorithm; wherein the link identification is obtained based on link information of enterprises;
and generating a product anti-counterfeiting code for marking authenticity based on the splicing result and the check bit by adopting a second encryption rule.
Optionally, after generating the original product code by using the first encryption rule on the character string, the method further includes:
and generating a warehouse-in code by adopting a third encryption rule for the original product code, and carrying out database storage on the warehouse-in code so as to carry out true-false comparison and identification on the product anti-counterfeiting code.
Optionally, the character string comprises a 4-bit enterprise identifier, an 8-bit date identifier, a 2-bit product identifier and a 13-bit random number;
correspondingly, generating an original product code for the character string by adopting a first encryption rule, including:
combining the 4-bit enterprise identifier, the 8-bit date identifier, the 2-bit product identifier and the 13-bit random number in the character string according to a preset rule to obtain a combined result;
and (3) adopting a matrix transformation algorithm to the combined result to obtain a 16-bit original product code.
Optionally, the combining according to a preset rule includes:
and sequentially splicing the first 2 bits of the 4-bit enterprise identifier, the first 4 bits of the 8-bit date identifier, the 2-bit product identifier, the last 2 bits of the 4-bit enterprise identifier, the 13-bit random number and the last 4 bits of the 8-bit date identifier.
Optionally, when the original product code is spliced with the link identifier and the version identifier, the original product code further comprises a separation identifier;
correspondingly, splicing the original product code with the link identifier and the version identifier comprises the following steps:
and sequentially splicing the link identifier, the separation identifier, the version identifier and the original product code.
Optionally, generating the product anti-counterfeiting code for marking authenticity based on the splicing result and the check bit by adopting a second encryption rule includes:
and sequentially splicing the link identifier, the separation identifier, the version identifier, the original product code and the check bit to generate a product anti-counterfeiting code for marking authenticity.
Optionally, after generating the product security code for marking authenticity based on the splicing result and the check bit by using a second encryption rule, the method further includes:
generating a transmission file based on at least one product anti-counterfeiting code;
and carrying out envelope encryption processing on the transmission file to generate an encrypted file.
According to another aspect of the present invention, there is provided a generation apparatus of product security code, including:
the original product code generation module is used for constructing a character string based on the enterprise identifier, the date identifier, the product identifier and the random number, and generating an original product code by adopting a first encryption rule for the character string;
the splicing module is used for splicing the original product code with the link identifier and the version identifier to obtain a splicing result, and obtaining a check bit by adopting a check bit generation algorithm; wherein the link identification is obtained based on link information of enterprises;
and the product anti-counterfeiting code generation module is used for generating a product anti-counterfeiting code for marking authenticity based on the splicing result and the check bit by adopting a second encryption rule.
According to another aspect of the present invention, there is provided an electronic device for generating product security codes, the electronic device including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the method of generating product security code according to any of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer readable storage medium storing computer instructions for causing a processor to implement the method for generating product security codes according to any of the embodiments of the present invention when executed.
According to the technical scheme, a character string is constructed based on enterprise identification, date identification, product identification and random numbers, and an original product code is generated on the character string by adopting a first encryption rule; splicing the original product code with the link identifier and the version identifier to obtain a splicing result, and obtaining a check bit by adopting a check bit generation algorithm; wherein the link identification is obtained based on link information of the enterprise; and generating a product anti-counterfeiting code for marking authenticity based on the splicing result and the check bit by adopting a second encryption rule. According to the technical scheme, different encryption rules can be adopted to generate the product anti-counterfeiting code through multiple encryption, so that the safety of the product anti-counterfeiting code is enhanced, and the risk of theft of the product anti-counterfeiting code is effectively reduced.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of a method for generating product security codes according to a first embodiment of the present invention;
fig. 2 is a flowchart of a method for generating product security codes according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a device for generating product anti-counterfeiting codes according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device implementing a method for generating product security codes according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," "target," and the like in the description and claims of the present invention and in the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
Fig. 1 is a flowchart of a method for generating a product security code according to a first embodiment of the present invention, where the method may be performed by a device for generating a product security code through multiple encryption, the device for generating a product security code may be implemented in hardware and/or software, and the device for generating a product security code may be configured in an electronic device having data processing capability. As shown in fig. 1, the method includes:
s110, constructing a character string based on the enterprise identifier, the date identifier, the product identifier and the random number, and generating an original product code on the character string by adopting a first encryption rule.
Wherein the enterprise identifier may be used to indicate the manufacturing enterprise of the product. The date identifier may be used to indicate the date of manufacture of the product. The product identification may be used to indicate the product type. For example, the product types may include water cups, kettles, bowls, plates, mineral water, juice, milk and the like. The character string may include numerals, letters, special characters, or the like, and the present embodiment does not limit any form of composition of the character string. The first encryption rule may refer to a preset encryption manner, and may be used to encrypt the constructed string. The first encryption rule may be, for example, a binary conversion or a basic operation, or may be a matrix transformation. The original product code may be understood as a new character string obtained by encrypting the constructed character string according to a preset rule.
In this embodiment, when the character string is constructed based on the enterprise identifier, the date identifier, the product identifier and the random number, the enterprise identifier, the date identifier, the product identifier and the random number may be directly spliced in a certain order, or the enterprise identifier, the date identifier, the product identifier and the random number may be first partially or completely disassembled, and then the disassembled elements are randomly combined. When the character string is subjected to a first encryption rule to generate an original product code, different binary system conversion can be carried out on the character string, or basic operations such as addition, subtraction, multiplication, division and the like are carried out on the character string, and the character string can be encrypted through matrix transformation, so that the first encryption in the process of generating the product anti-counterfeiting code is realized. It should be noted that, in this embodiment, the string construction manner and the first encryption rule are not limited, and may be flexibly set and adjusted according to actual requirements.
Optionally, the character string comprises a 4-bit enterprise identifier, an 8-bit date identifier, a 2-bit product identifier and a 13-bit random number; correspondingly, generating an original product code for the character string by adopting a first encryption rule, including: combining the 4-bit enterprise identifier, the 8-bit date identifier, the 2-bit product identifier and the 13-bit random number in the character string according to a preset rule to obtain a combined result; and (3) adopting a matrix transformation algorithm to the combined result to obtain a 16-bit original product code.
The preset rule may refer to a preset combination mode. The preset rule may be, for example, to directly splice and combine the parts, or to disassemble the parts first and then randomly combine the disassembled elements. The matrix transformation algorithm may include elementary, inverse or orthogonal transformation of the matrix, etc. It should be noted that, the matrix transformation algorithm may use a single form of matrix transformation, or may use a combination of multiple forms of matrix transformations.
In this embodiment, the character string may include a 4-bit enterprise identifier, an 8-bit date identifier, a 2-bit product identifier, and a 13-bit random number. Wherein the 8-digit date identifier may include a year, month, and day of production of the product. For example, if a product is produced on month 1 of 2022, then the date of the product is identified as 20220401. The character string constructed based on the enterprise identifier, the date identifier, the product identifier and the random number comprises a 4-bit enterprise identifier, an 8-bit date identifier, a 2-bit product identifier and a 13-bit random number. That is, the constructed character string includes 27 bits in total. When the character string is subjected to first encryption rules to generate an original product code, 4-bit enterprise identification, 8-bit date identification, 2-bit product identification and 13-bit random number in the character string can be combined in a direct splicing or disassembling splicing mode, and then the combined result is compressed and encrypted through single or combined algorithms such as elementary transformation, inverse transformation or orthogonal transformation, so that the 27-bit character string is changed into a 16-bit character string, and the 16-bit character string is used as the original product code to finish first re-encryption.
Through the arrangement, the first re-encryption in the process of generating the anti-counterfeiting code of the product can be realized through the preset rule and the matrix transformation algorithm, so that the flexibility is high, and the safety is high.
Optionally, the combining according to a preset rule includes: and sequentially splicing the first 2 bits of the 4-bit enterprise identifier, the first 4 bits of the 8-bit date identifier, the 2-bit product identifier, the last 2 bits of the 4-bit enterprise identifier, the 13-bit random number and the last 4 bits of the 8-bit date identifier.
In this embodiment, a 4-bit enterprise identifier, an 8-bit date identifier, a 2-bit product identifier, and a 13-bit random number in the character string may be combined in a disassembling and splicing manner. Specifically, the 4-bit enterprise identifier can be firstly disassembled in half to obtain the front 2 bits and the rear 2 bits of the enterprise identifier respectively; and (3) performing half-disassembly on the 8-bit date mark to respectively obtain the first 4 bits and the last 4 bits of the date mark. And then the front 2 bits of the enterprise identifier, the front 4 bits of the date identifier, the 2 bits of the product identifier, the rear 2 bits of the enterprise identifier, the 13 bits of the random number and the rear 4 bits of the date identifier are spliced sequentially.
Through such setting, this scheme can adopt the mode of disassembling the concatenation to make up the constituent element in the character string, has further improved the security of original product code.
S120, splicing the original product code with the link identifier and the version identifier to obtain a splicing result, and obtaining a check bit by adopting a check bit generation algorithm; wherein the link identification is obtained based on link information of the enterprise.
The link identifier may be used to indicate a website link for verifying the authenticity of the product security code. Illustratively, the link identifier may be a URL (Uniform Resource Locator ). The URL is a concise representation of the location and access method of the resources obtained on the internet, and is the address of the standard resources on the internet, that is, what we say a web address, and can be used to identify the unique names of different web pages on the internet. If a web site is desired to be accessed, a corresponding web page can be opened by entering the correct URL in the browser. Specifically, the link identifier is obtained according to the link information of the enterprise, and the link of the enterprise can be directly found through the link identifier. It will be appreciated that each enterprise has its own proprietary linking information, and thus the linking identity of the different enterprises is different.
In this embodiment, the version identifier may be used as a basis for generating the check bit. Specifically, different version identifiers may correspond to different check bit generation algorithms, or may correspond to the same check bit generation algorithm with different check parameters. Illustratively, the version identifier may be any one digit number from 0-9. The check bits may be used to check the splice result. Illustratively, the check bits may include 5 bits, 6 bits, or 7 bits. The check bit generation algorithm may refer to a method for generating check bits, among other things. For example, the check bit generation algorithm may be a parity check algorithm, a cyclic redundancy check algorithm, a secure hash algorithm, or the like.
In this embodiment, the original product code, the link identifier and the version identifier may be spliced in different orders, and the splicing result obtained after the splicing is completed is a character string. For example, the splicing may be performed sequentially according to the order of the original product code, the link identifier and the version identifier, or may be performed sequentially according to the order of the link identifier, the version identifier and the original product code, which is not limited in this embodiment. After the splicing is completed, a check bit generation algorithm is adopted on the splicing result, so that check bits with different digits or different contents are generated.
Optionally, when the original product code is spliced with the link identifier and the version identifier, the original product code further comprises a separation identifier; correspondingly, splicing the original product code with the link identifier and the version identifier comprises the following steps: and sequentially splicing the link identifier, the separation identifier, the version identifier and the original product code.
Wherein a separation identifier may be used to separate the link identifier from the original product code and version identifier. In particular, the separation mark may be composed of special characters or punctuation. Illustratively, the separation flag may be set to/? . In this embodiment, the splicing may be performed sequentially according to the order of the link identifier, the separation identifier, the version identifier, and the original product code. For example, assume that the link is identified as URL and the separation is identified as/? Then it may be in terms of URL,/? And (3) sequentially splicing version identification and original product codes.
Through the arrangement, the original product code can be associated with the enterprise link information through the link identifier, so that a verification website is provided for checking the subsequent product anti-counterfeiting code, and the safety of the product anti-counterfeiting code is further improved.
S130, generating a product anti-counterfeiting code for marking authenticity based on the splicing result and the check bit by adopting a second encryption rule.
The second encryption rule may refer to a preset encryption manner, and may be used to encrypt the generated original product code. The product anti-counterfeiting code can be used as a basis for a consumer to check the authenticity of the product. The product anti-counterfeiting code can be a bar code or a two-dimensional code, and the display form of the product anti-counterfeiting code is not limited in the embodiment. Specifically, the consumer can check the authenticity of the product by scanning the product anti-counterfeiting code printed on the product packaging bag.
In this embodiment, the two may be directly spliced or disassembled according to the splicing result and the generated check bit. For example, check bits can be directly added on the basis of the splicing result, so that a new character string is generated, and the second encryption in the process of generating the anti-counterfeiting code of the product is realized. And the bar code or the two-dimensional code can be generated by the anti-counterfeiting code generating component and used as a final product anti-counterfeiting code.
Optionally, generating the product anti-counterfeiting code for marking authenticity based on the splicing result and the check bit by adopting a second encryption rule includes: and sequentially splicing the link identifier, the separation identifier, the version identifier, the original product code and the check bit to generate a product anti-counterfeiting code for marking authenticity.
In this embodiment, the splicing result and the check bit may be spliced sequentially in a direct splicing manner, that is, the link identifier, the separation identifier, the version identifier, the original product code and the check bit are spliced sequentially, and the product anti-counterfeiting code is generated according to the spliced result.
Through such setting, the security of product anti-fake code can be further improved.
According to the technical scheme, a character string is constructed based on enterprise identification, date identification, product identification and random numbers, and an original product code is generated on the character string by adopting a first encryption rule; splicing the original product code with the link identifier and the version identifier to obtain a splicing result, and obtaining a check bit by adopting a check bit generation algorithm; wherein the link identification is obtained based on link information of the enterprise; and generating a product anti-counterfeiting code for marking authenticity based on the splicing result and the check bit by adopting a second encryption rule. According to the technical scheme, different encryption rules can be adopted to generate the product anti-counterfeiting code through multiple encryption, so that the safety of the product anti-counterfeiting code is enhanced, and the risk of theft of the product anti-counterfeiting code is effectively reduced.
In this embodiment, optionally, after generating the original product code by using the first encryption rule on the character string, the method further includes: and generating a warehouse-in code by adopting a third encryption rule for the original product code, and carrying out database storage on the warehouse-in code so as to carry out true-false comparison and identification on the product anti-counterfeiting code.
The third encryption rule may refer to a preset encryption manner, and may be used to encrypt the original product code when the original product code is stored in the database. The warehousing code can be a new product code obtained by encrypting the original product code to be warehoused, and can be used as a comparison basis for verifying the authenticity of the product anti-counterfeiting code.
In this embodiment, after the original product code is generated by using the first encryption rule on the character string, the third encryption may be performed on the original product code to generate the warehouse-in code, and the generated warehouse-in code is stored in the database. Illustratively, the original product code may be encrypted by a hash algorithm to generate the warehouse-in code. When the consumer checks the authenticity of the product by scanning the product anti-counterfeiting code, the consumer can jump to the enterprise link through the link identifier, and the original product code is obtained through decoding of the enterprise link. And then encrypting the decoded original product code according to a third encryption rule to obtain a corresponding encrypted character string. And comparing the encrypted character string with the warehouse-in codes stored in the database, if the warehouse-in codes which are completely the same as the encrypted character string exist, the product is indicated to be a genuine product, otherwise, the product can be indicated to be a counterfeit product.
By means of the arrangement, encryption can be conducted when the original product codes are put in storage, the problem of original product code leakage caused by computer viruses or database leakage can be effectively avoided, and therefore potential safety hazards are reduced.
Example two
Fig. 2 is a flowchart of a method for generating product security codes according to a second embodiment of the present invention, where the method is optimized based on the foregoing embodiment. The concrete optimization is as follows: after generating the product anti-counterfeiting code for marking authenticity based on the splicing result and the check bit by adopting a second encryption rule, the method further comprises the following steps: generating a transmission file based on at least one product anti-counterfeiting code; and carrying out envelope encryption processing on the transmission file to generate an encrypted file.
As shown in fig. 2, the method of this embodiment specifically includes the following steps:
s210, constructing a character string based on the enterprise identifier, the date identifier, the product identifier and the random number, and generating an original product code on the character string by adopting a first encryption rule.
S220, splicing the original product code with the link identifier and the version identifier to obtain a splicing result, and obtaining a check bit by adopting a check bit generation algorithm; wherein the link identification is obtained based on link information of the enterprise.
S230, generating a product anti-counterfeiting code for marking authenticity based on the splicing result and the check bit by adopting a second encryption rule.
The implementation process of S210-S230 can be described in S110-S130.
S240, generating a transmission file based on at least one product anti-counterfeiting code.
In this embodiment, after the product security code is generated, the product security code is further required to be sent to a printing device, and the product security code is printed on the product package by the printing device, so that the consumer can check the authenticity of the product. In order to improve the transmission efficiency of the product anti-counterfeiting codes, at least one product anti-counterfeiting code can be packaged and uniformly placed in a transmission file and sent to printing equipment in a file form, so that batch transmission of the product anti-counterfeiting codes is realized.
S250, carrying out envelope encryption processing on the transmission file to generate an encrypted file.
It will be appreciated that during file transfer, file loss or file theft may occur, which may result in leakage of product security code. In order to avoid such a situation, the embodiment can reduce the risk of leakage of the anti-counterfeiting code of the product by encrypting the transmission file and sending the encrypted file to the printing equipment in a network transmission mode.
In this embodiment, the transmission file may be encrypted using third party encryption software. For example, an envelope encryption technique into either inter-platon or alicloud may be used to encrypt the transmission file, thereby ensuring that indistinguishable scrambling codes are displayed in the encrypted file that is opened by unauthorized software. Among other things, envelope encryption techniques can store, transfer, and use data keys that encrypt data in envelopes. That is, envelope encryption no longer uses the master key to encrypt and decrypt data directly, but uses the client master key to generate a data key and then uses the offline data key to encrypt a large amount of data locally. By using the envelope encryption technology, the original product code with larger data quantity can be encrypted rapidly, so that the encryption efficiency is improved.
According to the technical scheme, at least one product anti-counterfeiting code is packaged and uniformly placed in a transmission file on the basis of generating the product anti-counterfeiting code based on the first encryption rule and the second encryption rule, and the transmission file is encrypted by adopting an envelope encryption technology. According to the technical scheme, encryption can be carried out for a plurality of times in the process of generating the product anti-counterfeiting code, the risk of product anti-counterfeiting code leakage is reduced, batch transmission of the product anti-counterfeiting code can be realized through the encrypted file, the transmission efficiency is improved, the safety of the product anti-counterfeiting code is further improved, and the risk of theft of the product anti-counterfeiting code is reduced.
Example III
Fig. 3 is a schematic structural diagram of a device for generating product anti-counterfeiting codes, which is provided by the third embodiment of the present invention, and the device can execute the method for generating product anti-counterfeiting codes, which is provided by any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method. As shown in fig. 3, the apparatus includes:
an original product code generating module 310, configured to construct a character string based on the enterprise identifier, the date identifier, the product identifier and the random number, and generate an original product code for the character string by adopting a first encryption rule;
the splicing module 320 is configured to splice the original product code with the link identifier and the version identifier to obtain a splicing result, and obtain a check bit by using a check bit generation algorithm; wherein the link identification is obtained based on link information of enterprises;
and the product anti-counterfeiting code generating module 330 is configured to generate a product anti-counterfeiting code for marking authenticity based on the splicing result and the check bit by using a second encryption rule.
Optionally, the apparatus further includes:
the warehouse-in code generation module is used for generating a warehouse-in code for the original product code by adopting a third encryption rule after generating the original product code for the character string by adopting the first encryption rule, and carrying out database storage for the warehouse-in code so as to carry out true-false comparison and identification for the product anti-counterfeiting code.
Optionally, the character string comprises a 4-bit enterprise identifier, an 8-bit date identifier, a 2-bit product identifier and a 13-bit random number;
accordingly, the original product code generating module 310 includes:
the combination unit is used for combining the 4-bit enterprise identifier, the 8-bit date identifier, the 2-bit product identifier and the 13-bit random number in the character string according to a preset rule to obtain a combination result;
and the original product code generating unit is used for obtaining the 16-bit original product code by adopting a matrix transformation algorithm to the combined result.
Optionally, the combination unit is specifically configured to:
and sequentially splicing the first 2 bits of the 4-bit enterprise identifier, the first 4 bits of the 8-bit date identifier, the 2-bit product identifier, the last 2 bits of the 4-bit enterprise identifier, the 13-bit random number and the last 4 bits of the 8-bit date identifier.
Optionally, when the original product code is spliced with the link identifier and the version identifier, the original product code further comprises a separation identifier;
correspondingly, the splicing module 320 is specifically configured to:
and sequentially splicing the link identifier, the separation identifier, the version identifier and the original product code.
Optionally, the product security code generating module 330 is specifically configured to:
and sequentially splicing the link identifier, the separation identifier, the version identifier, the original product code and the check bit to generate a product anti-counterfeiting code for marking authenticity.
Optionally, the apparatus further includes:
the transmission file generation module is used for generating a transmission file based on at least one product anti-counterfeiting code;
and the encryption file generation module is used for carrying out envelope encryption processing on the transmission file to generate an encryption file.
The device for generating the product anti-counterfeiting code provided by the embodiment of the invention can execute the method for generating the product anti-counterfeiting code provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Example IV
Fig. 4 shows a schematic diagram of the structure of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 4, the electronic device 10 includes at least one processor 11, and a memory, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., communicatively connected to the at least one processor 11, in which the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 may also be stored. The processor 11, the ROM 12 and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
Various components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, etc.; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the respective methods and processes described above, for example, the generation method of the product security code.
In some embodiments, the method of generating product security code may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the above-described generation method of the product security code may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the method of generating the product security code in any other suitable manner (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (9)

1. The method for generating the product anti-counterfeiting code is characterized by comprising the following steps of:
constructing a character string based on the enterprise identifier, the date identifier, the product identifier and the random number, and generating an original product code for the character string by adopting a first encryption rule;
splicing the original product code with the link identifier and the version identifier to obtain a splicing result, and obtaining a check bit by adopting a check bit generation algorithm; wherein the link identification is obtained based on link information of enterprises;
generating a product anti-counterfeiting code for marking authenticity based on the splicing result and the check bit by adopting a second encryption rule;
wherein, the obtaining the check bit by adopting the check bit generation algorithm comprises the following steps:
obtaining check bits by adopting a check bit generation algorithm according to the version identification; different version identifiers correspond to different check bit generation algorithms, or different version identifiers correspond to the same check bit generation algorithm of different check parameters;
wherein after generating the original product code for the character string using the first encryption rule, the method further comprises:
and generating a warehouse-in code by adopting a third encryption rule for the original product code, and carrying out database storage on the warehouse-in code so as to carry out true-false comparison and identification on the product anti-counterfeiting code.
2. The method of claim 1, wherein the character string comprises a 4-bit business identifier, an 8-bit date identifier, a 2-bit product identifier, and a 13-bit random number;
correspondingly, generating an original product code for the character string by adopting a first encryption rule, including:
combining the 4-bit enterprise identifier, the 8-bit date identifier, the 2-bit product identifier and the 13-bit random number in the character string according to a preset rule to obtain a combined result;
and (3) adopting a matrix transformation algorithm to the combined result to obtain a 16-bit original product code.
3. The method of claim 2, wherein the combining according to the preset rule comprises:
and sequentially splicing the first 2 bits of the 4-bit enterprise identifier, the first 4 bits of the 8-bit date identifier, the 2-bit product identifier, the last 2 bits of the 4-bit enterprise identifier, the 13-bit random number and the last 4 bits of the 8-bit date identifier.
4. The method of claim 1, further comprising a separation identifier when concatenating the original product code with a link identifier and a version identifier;
correspondingly, splicing the original product code with the link identifier and the version identifier comprises the following steps:
and sequentially splicing the link identifier, the separation identifier, the version identifier and the original product code.
5. The method of claim 4, wherein generating a product security code for marking authenticity based on the splice result and the check bit using a second encryption rule comprises:
and sequentially splicing the link identifier, the separation identifier, the version identifier, the original product code and the check bit to generate a product anti-counterfeiting code for marking authenticity.
6. The method of claim 1, wherein after generating the product security code for marking authenticity based on the concatenation result and the check bit using a second encryption rule, the method further comprises:
generating a transmission file based on at least one product anti-counterfeiting code;
and carrying out envelope encryption processing on the transmission file to generate an encrypted file.
7. A device for generating product security codes, the device comprising:
the original product code generation module is used for constructing a character string based on the enterprise identifier, the date identifier, the product identifier and the random number, and generating an original product code by adopting a first encryption rule for the character string;
the splicing module is used for splicing the original product code with the link identifier and the version identifier to obtain a splicing result, and obtaining a check bit by adopting a check bit generation algorithm; wherein the link identification is obtained based on link information of enterprises;
the product anti-counterfeiting code generation module is used for generating a product anti-counterfeiting code for marking authenticity based on the splicing result and the check bit by adopting a second encryption rule;
wherein, splice module, be used for specifically:
obtaining check bits by adopting a check bit generation algorithm according to the version identification; different version identifiers correspond to different check bit generation algorithms, or different version identifiers correspond to the same check bit generation algorithm of different check parameters;
wherein the apparatus further comprises:
the warehouse-in code generation module is used for generating a warehouse-in code for the original product code by adopting a third encryption rule after generating the original product code for the character string by adopting the first encryption rule, and carrying out database storage for the warehouse-in code so as to carry out true-false comparison and identification for the product anti-counterfeiting code.
8. An electronic device for generating product security codes, the electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the method of generating product security code of any one of claims 1-6.
9. A computer readable storage medium storing computer instructions for causing a processor to implement the method of generating product security codes of any one of claims 1-6 when executed.
CN202210349299.6A 2022-04-01 2022-04-01 Method, device, equipment and storage medium for generating product anti-counterfeiting code Active CN114742017B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210349299.6A CN114742017B (en) 2022-04-01 2022-04-01 Method, device, equipment and storage medium for generating product anti-counterfeiting code

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210349299.6A CN114742017B (en) 2022-04-01 2022-04-01 Method, device, equipment and storage medium for generating product anti-counterfeiting code

Publications (2)

Publication Number Publication Date
CN114742017A CN114742017A (en) 2022-07-12
CN114742017B true CN114742017B (en) 2023-05-12

Family

ID=82278733

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210349299.6A Active CN114742017B (en) 2022-04-01 2022-04-01 Method, device, equipment and storage medium for generating product anti-counterfeiting code

Country Status (1)

Country Link
CN (1) CN114742017B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020034623A1 (en) * 2018-08-15 2020-02-20 齐爱民 Blockchain-based commodity anti-counterfeiting code generation system

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102622633A (en) * 2012-03-14 2012-08-01 江苏联博计算机信息产业有限公司 Multifunctional digital anti-counterfeiting code tag and applications of multifunctional digital anti-counterfeiting code tag
CN104751337B (en) * 2013-12-31 2017-04-12 腾讯科技(深圳)有限公司 Product anti-fake method, device and system
CN106548353B (en) * 2016-09-30 2020-04-07 昆明理工大学 Commodity anti-counterfeiting code generation and verification method
CN106778993A (en) * 2016-11-23 2017-05-31 广州市人民印刷厂股份有限公司 A kind of generation method of antifalsification label, verification method and its device
CN107437188A (en) * 2017-06-28 2017-12-05 邱艺 A kind of method that fake certification is quickly realized using bar code
CN109359276A (en) * 2018-09-29 2019-02-19 上海中商网络股份有限公司 A kind of anti-fake code generating method, device, equipment and storage medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020034623A1 (en) * 2018-08-15 2020-02-20 齐爱民 Blockchain-based commodity anti-counterfeiting code generation system

Also Published As

Publication number Publication date
CN114742017A (en) 2022-07-12

Similar Documents

Publication Publication Date Title
US11206256B2 (en) Table-connected tokenization
US20210051027A1 (en) User identity information authentication and verification methods and devices
CN109766479B (en) Data processing method and device, electronic equipment and storage medium
CN108664798B (en) Information encryption method and device
CN111464499A (en) Electronic warehouse receipt tracing method and device, computer equipment and storage medium
US11838289B2 (en) Systems and methods for activating an authentication token within a communication platform
CN104618334A (en) Method and system for generating and verifying dynamic two-dimensional code
CN113822675A (en) Block chain based message processing method, device, equipment and storage medium
CN102222188A (en) Information system user password generation method
CN110704875B (en) Method, device, system, medium and electronic equipment for processing client sensitive information
CN112131593A (en) Information-based feature encryption method, device, equipment and storage medium
CN114499859A (en) Password verification method, device, equipment and storage medium
CN112307503B (en) Signature management method and device and electronic equipment
CN117633835A (en) Data processing method, device, equipment and storage medium
CN114742017B (en) Method, device, equipment and storage medium for generating product anti-counterfeiting code
CN112017017A (en) Bidding method and system based on block chain
CN116645055A (en) One-stop type medical enterprise information service platform
CN108512657B (en) Password generation method and device
CN115085934A (en) Contract management method based on block chain and combined key and related equipment
CN115242402A (en) Signature method, signature verification method and electronic equipment
Naser et al. QR code based two-factor authentication to verify paper-based documents
CN204791026U (en) Thief -proof secure transmission system of getting of sensitive information
CN113343269B (en) Encryption method and device
US20240177155A1 (en) Decentralized information transmission system and method thereof
CN114170014A (en) Processing method and device for blockchain transaction, computer equipment and storage medium

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