Anti-counterfeiting verification method, device and electronic equipment
By carrying color information in the graphics code and generating dynamic color graphic codes to verify authenticity, the problem of easy tampering and cumbersome query of QR codes is solved, and security and accuracy are improved.
Patent Information
- Application Number
- CN202211215452.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-30
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2042-09-30
AI Technical Summary
Existing QR codes are easily tampered with, affecting the accuracy of authenticity results and the query process is cumbersome.
By carrying color information in the graphics code, a dynamically changing color graphic code is generated using a verification string, keeping the symbol arrangement structure unchanged only the color is adjusted, and the first and second graphic codes are generated to verify authenticity.
It improves the security and information capacity of graphics code, simplifies the query process, and improves the accuracy and efficiency of authenticity identification.
Smart Images

Figure CN115511030B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of communication technology, and specifically relates to an anti-counterfeiting verification method, device and electronic equipment. Background Art
[0002] With the development of science and technology, the use of QR codes has become increasingly common in users' daily lives. In particular, by printing or affixing QR codes to product packaging, users can scan the QR codes on the product with their electronic devices, which will redirect them to an anti-counterfeiting verification webpage to obtain the authenticity of the product. This allows for product traceability through QR codes.
[0003] However, the QR code has a single function in this process, which is to provide the URL of the anti-counterfeiting verification web page. It is easy for illegal elements to tamper with and forge it, affecting the accuracy of the authenticity results. Summary of the Invention
[0004] The purpose of the embodiments of the present application is to provide an anti-counterfeiting verification method, device, electronic device and storage medium, which can solve the problem that the current QR code has low security and affects the accuracy of the authenticity results.
[0005] In a first aspect, an embodiment of the present application provides an anti-counterfeiting verification method, which may include:
[0006] Obtaining a first graphic code corresponding to the target object at the current moment; the first graphic code carries color information;
[0007] Get the verification string corresponding to the target object at the current moment;
[0008] Determine the second graphic code corresponding to the target object at the current moment according to the verification string, where the second graphic code carries color information;
[0009] A verification result of the target object is determined according to the color information of the first graphic code and the color information of the second graphic code.
[0010] In a second aspect, an embodiment of the present application provides an anti-counterfeiting verification device, which may include:
[0011] An acquisition module, configured to acquire a first graphic code corresponding to the target object at a current moment, the first graphic code carrying color information;
[0012] The acquisition module is also used to obtain the verification string corresponding to the target object at the current moment;
[0013] a determination module, configured to determine a second graphic code corresponding to the target object at a current moment according to the verification string, the second graphic code carrying color information;
[0014] The determination module is further configured to determine a verification result of the target object according to the color information of the first graphic code and the color information of the second graphic code.
[0015] In a third aspect, an embodiment of the present application provides an electronic device comprising a processor, a memory, and a program or instruction stored in the memory and executable on the processor. When the program or instruction is executed by the processor, the steps of the anti-counterfeiting verification method shown in the first aspect are implemented.
[0016] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the anti-counterfeiting verification method shown in the first aspect are implemented.
[0017] In a fifth aspect, an embodiment of the present application provides a chip, which includes a processor and an anti-counterfeiting verification interface. The anti-counterfeiting verification interface is coupled to the processor, and the processor is used to run programs or instructions to implement the steps of the anti-counterfeiting verification method shown in the first aspect.
[0018] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method of the first aspect.
[0019] In an embodiment of the present application, a first graphical code corresponding to a target object at a current moment and a verification string are obtained. The first graphical code carries color information. Then, based on the verification string, a second graphical code corresponding to the target object at the current moment is determined. The second graphical code also carries color information. Thus, the verification result of the target object can be determined based on the color information of the first and second graphical codes. In this way, the color information carried in the graphical code reduces the possibility of malicious attackers altering the graphical code of the target object, thereby increasing the security of the graphical code. Furthermore, because the arrangement of the code elements in the graphical code is not changed, only the colors of certain code elements are adjusted, so that the graphical code carries color information, the information stored in the graphical code is retained and the authenticity of the target object can be verified using the color information in the graphical code. Thus, the graphical code achieves a "one code, two uses" effect, effectively increasing the information capacity of the graphical code, ensuring the security of the graphical code, and preventing tampering with the graphical code, thereby improving the accuracy of authenticating the target object using the color information in the graphical code. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 A flowchart of the anti-counterfeiting verification method provided in an embodiment of the present application;
[0021] Figure 2 A schematic diagram of a universal graphic code provided in an embodiment of the present application;
[0022] Figure 3 A schematic diagram of generating a second graphic code provided in an embodiment of the present application;
[0023] Figure 4 A schematic diagram of a second graphic code provided in an embodiment of the present application;
[0024] Figure 5 A schematic structural diagram of an anti-counterfeiting verification device provided in an embodiment of the present application;
[0025] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0026] Figure 7 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0027] The following will be combined with the accompanying drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the embodiments described are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field fall within the scope of protection of this application.
[0028] The terms "first," "second," and the like in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of this application can be implemented in an order other than that illustrated or described herein, and that the objects distinguished by "first," "second," and the like are generally of the same type, and do not limit the number of objects; for example, the first object can be one or more. In addition, the term "and / or" in the specification and claims refers to at least one of the connected objects, and the character " / " generally indicates that the objects connected are in an "or" relationship.
[0029] Counterfeit and substandard products harm the vital interests of businesses and consumers and seriously affect economic development. However, due to factors such as limited anti-counterfeiting technology and a single anti-counterfeiting method, most current product anti-counterfeiting solutions are imperfect. In order to combat counterfeit and substandard products and to provide a powerful "weapon" to trace problematic products, QR code anti-counterfeiting has emerged. A QR code (2-dimensional bar code) is a graphic that uses a certain geometric shape to record data symbol information in black and white distributed in a plane (two-dimensional direction) according to a certain pattern. In this way, QR code technology can be used to identify products and provide the URL of an anti-counterfeiting verification webpage. In this way, the QR code can be printed or affixed to the product packaging. The user can scan the QR code on the product with an electronic device to jump to the anti-counterfeiting verification webpage. Then, the user can scratch off the anti-counterfeiting layer on the product packaging and manually enter the product serial number under the anti-counterfeiting layer into the anti-counterfeiting verification webpage. Then, the authenticity result of the product can be obtained based on the product serial number.
[0030] However, in this process, since QR codes are easily modified, criminals can easily tamper with the address of the anti-counterfeiting verification webpage, resulting in inaccurate product authenticity results for users. This leads to low security of QR codes and low accuracy of the anti-counterfeiting information retrieved. Furthermore, since product serial numbers are generally long, this process increases the number of manual entries required by users, making the query process cumbersome and reducing the efficiency of anti-counterfeiting information retrieval.
[0031] Therefore, in response to the above-mentioned problems, an embodiment of the present application provides an anti-counterfeiting verification method for a target object based on the color information carried in a graphic code. The color information carried in the graphic code reduces the possibility that the graphic code of the target object may be changed by a malicious attacker, thereby increasing the security of the graphic code. In addition, since the arrangement structure of the code elements in the graphic code is not changed, only the colors of certain code elements in the graphic code are adjusted so that the graphic code carries color information. Therefore, the information stored in the graphic code is retained, and the authenticity of the target object can be verified through the color information in the graphic code. Thus, the graphic code achieves the effect of "one code for two uses", effectively increasing the information capacity of the graphic code, that is, ensuring the security of the graphic code and preventing the graphic code from being tampered with, thereby improving the accuracy of identifying the authenticity of the target object through the color information in the graphic code.
[0032] Based on this, the embodiment of the present application provides an anti-counterfeiting verification method. Figures 1 to 4 The anti-counterfeiting verification method provided in the embodiments of the present application is described in detail.
[0033] Figure 1 A flowchart of an anti-counterfeiting verification method provided in an embodiment of the present application.
[0034] like Figure 1As shown, the anti-counterfeiting verification method can be applied to electronic devices, based on which, it can specifically include the following steps:
[0035] Step 110, obtain the first graphic code corresponding to the target object at the current moment; the first graphic code carries color information; Step 120, obtain the verification string corresponding to the target object at the current moment; Step 130, determine the second graphic code corresponding to the target object at the current moment based on the verification string, the second graphic code carries color information; Step 140, determine the verification result of the target object based on the color information of the first graphic code and the color information of the second graphic code.
[0036] In this way, by obtaining the first graphical code corresponding to the target object at the current moment and a verification string, the first graphical code carries color information. Then, based on the verification string, the second graphical code corresponding to the target object at the current moment is determined. The second graphical code also carries color information. Thus, the verification result of the target object can be determined based on the color information of the first and second graphical codes. The color information carried in the graphical code reduces the possibility of malicious attackers altering the target object's graphical code, thereby increasing the security of the graphical code. Furthermore, because the arrangement of the code elements in the graphical code remains unchanged, only the colors of certain code elements are adjusted, allowing the graphical code to carry color information. This preserves the information stored in the graphical code and allows the authenticity of the target object to be verified using the color information in the graphical code. Thus, the graphical code achieves a "one code, two purposes" effect, effectively increasing the information capacity of the graphical code, ensuring the security of the graphical code and preventing tampering, thereby improving the accuracy of authenticating the target object using the color information in the graphical code.
[0037] The above steps are described in detail below.
[0038] First, step 110 is involved. In one or more possible embodiments, step 110 may specifically include:
[0039] Based on the object identification information of the target object, a first graphic code corresponding to the target object at the current moment is obtained from the server; wherein, the server determines the first encryption information corresponding to the target object at the current moment based on the verification string corresponding to the target object at the current moment, converts the first encryption information into a binary string, and adjusts the universal graphic code corresponding to the target object based on the color information corresponding to each character in the binary string at the current moment to obtain the first graphic code corresponding to the target object at the current moment, and associates the first graphic code with the object identification information of the target object; the universal graphic code is determined based on the object identification information of the target object.
[0040] It should be noted that the target object in the embodiment of the present application can be a product to be authenticated, which can be a physical product or a virtual electronic product. In this way, the object identification information of the target object can be a string of at least one of the following information: product serial number, product batch number, product anti-counterfeiting code.
[0041] Based on this, for example, the target object can be product A to be verified for authenticity. The user logs in to a web page or application for verifying the authenticity of product A through an electronic device, and enters the product serial number of product A in the web page or application, so that the request server calculates the first encryption information corresponding to product A at the current moment, such as a hash value, based on the verification string corresponding to product A at the current moment, such as a salt value (salt), converts the hash value into a binary string such as a 01 string, and adjusts the universal graphic code corresponding to product A according to the color information corresponding to the characters in the binary string at the current moment to obtain the first graphic code.
[0042] Here, as Figure 2 As shown, the universal graphic code 20 in the embodiment of the present application can be a black and white QR code, which can be a QR Code (Quick Response Code). Its version (Version) can be any of the 40 versions of the QR code (e.g., Version 1 to Version 40). In the embodiment of the present application, Version 1 (21×21) with a tolerance level of L is used as an example for illustration. It should be noted that since the achromatic code elements in the black and white QR code include black code elements 201 and white code elements 202, the process of adjusting the universal graphic code corresponding to product A based on the color information corresponding to the characters in the binary string at the current moment to obtain the first graphic code can be understood as adjusting the color of the black or white code elements based on the color information corresponding to the characters in the binary string at the current moment, such as 01, based on the color information corresponding to 0 corresponding to red (the code element corresponding to 1 remains unchanged), thereby obtaining the first graphic code carrying color information. The black and white code elements refer to the black and white blocks of a certain shape (e.g., square) that constitute the black and white QR code.
[0043] Next, step 120 may include:
[0044] According to the object identification information of the target object, obtain the verification string corresponding to the target object at the current moment from the server;
[0045] The server periodically updates the verification string corresponding to the target object.
[0046] For example, still referring to the above example, the target object can be product A to be verified for authenticity. The user logs in to a web page or application to verify the authenticity of product A through an electronic device, and enters the product serial number of product A in the web page or application, so that the request server is based on the verification string corresponding to product A at the current moment, such as a hash value.
[0047] It should be noted that the verification string can be obtained simultaneously with the first graphic code. In addition, since the server regularly updates the verification string corresponding to the target object, the first graphic code generated based on the verification string is also regularly updated and dynamically changed.
[0048] Next, step 130 is involved. In one or more possible embodiments, step 130 may specifically include:
[0049] Step 1301: Determine the second encrypted information corresponding to the target object at the current moment based on the verification string;
[0050] Step 1302, converting the second encrypted information into a binary string;
[0051] Step 1303, adjust the universal graphic code corresponding to the target object according to the color information corresponding to each character in the binary string at the current moment, and obtain the second graphic code corresponding to the target object at the current moment; the universal graphic code is determined according to the object identification information of the target object.
[0052] The above steps 1301 to 1303 are described in detail below.
[0053] In an example, the above-mentioned step 1301 may specifically include step 13011 and step 13012.
[0054] Step 13011: Determine the encrypted string corresponding to the target object at the current moment based on the verification string and the object identification information of the target object.
[0055] Among them, the first character of the verification string, such as the salt value, can be concatenated with the last character of the object identification information, such as the product serial number, to obtain the encrypted string str. For example, the salt value, such as "####", can be directly appended and concatenated after the product serial number "AAAAAA" to obtain the encrypted string str "AAAAAA####"; or, the verification string can be inserted into the product serial number to obtain the encrypted string str. For example, the salt value, such as "####", can be divided into "####" according to the preset character interval 1 to obtain "#", "#", "#" and "# ", then "#", "#", "#" and "#" can be inserted into the product serial number such as "AAAAAA" in sequence and at intervals to obtain the encrypted string str "A#A#A#A#AA", or, the salt value such as "####" is divided into "####" according to the preset character interval 2 to obtain "##" and "##", then "##" and "##" can be inserted into the product serial number such as "AAAAAA" at intervals to obtain the encrypted string str "A##A##AAAA", "AA##A##AAA", "A##AAAA##A", etc.
[0056] Step 13012: Encrypt the encrypted string according to a preset encryption algorithm to obtain the second encrypted information corresponding to the target object at the current moment.
[0057] Exemplarily, the encrypted string str can be encrypted by a preset encryption algorithm such as a hash algorithm to obtain second encrypted information such as a hash value or a hash value. Here, the preset encryption algorithm can include an MD5 algorithm, and the hash value can be represented in lowercase hexadecimal with a length of 16 bits.
[0058] Therefore, in the embodiments of the present application, message digest technology is used, that is, a check string such as a salt value is combined with object identification information such as a product serial number, and a hash value is generated using a preset encryption algorithm (such as MD5). Since the immutability of the object identification information is guaranteed by the performance of the hash function and the confidentiality of the check string, a slight change in the object identification information will cause a significant change in the final hash value. Therefore, the security of the graphic code (i.e., the first graphic code and the second graphic code) can be guaranteed, and the possibility of the graphic code being tampered with can be effectively prevented.
[0059] In another example, still taking step 1301 as an example, in the above-mentioned step 1302, the hash value (length is 16) can be converted into a decimal ASCII code, and then the decimal number can be converted into an 8-bit binary number, so that a 01 binary string with a length of 128 is obtained.
[0060] In another example, when the binary string includes characters of the first type and characters of the second type, and the universal graphic code corresponding to the target object includes a first color area and a second color area, step 1303 may specifically include:
[0061] According to the first color information corresponding to the first type of character, the first color area in the universal graphic code is adjusted, and according to the second color information corresponding to the second type of character, the second color area in the universal graphic code is adjusted to obtain the second graphic code corresponding to the target object at the current moment.
[0062] For example, still based on the above example, Figure 3 As shown, if the binary string includes a first type of character, i.e., 0, and a second type of character, i.e., 1, and the black and white two-dimensional code 20 includes a first color area, i.e., a black code element, and a second color area, i.e., a white code element, each code element in the black and white two-dimensional code is traversed. If the color of the code element is black, the black code element in the universal graphic code is adjusted according to the first color information corresponding to the first character of the first type, such as red, and the white code element in the universal graphic code is adjusted according to the second color information corresponding to the second type of character, i.e., blue, to obtain the second graphic code 30, as shown in FIG. Figure 3 As shown, the second graphic code includes an area 301 where the adjusted color code elements are located, and an area 302 where the black and white code elements are located.
[0063] It should be noted that the first color area and the second color area involved above can correspond to black code elements and white code elements respectively, or both can correspond to black code elements. In this way, the black code elements in the universal graphic code can be adjusted according to the red and blue colors. For example, the area corresponding to the black code elements is filled with color, and the white code elements in the universal graphic code remain unchanged. In this way, a target two-dimensional code with red code elements, blue code elements, black code elements and white code elements can be obtained.
[0064] At this point, it should be noted that the first or second graphic code in the embodiments of the present application does not change the arrangement of the various code elements in the universal graphic code. Therefore, the first or second graphic code includes the original content of the universal graphic code. In addition, due to the color adjustment of certain code elements in the universal graphic code, the first or second graphic code also includes colored code elements of different colors used to verify the authenticity of the target object. Here, the colored code elements in the embodiments of the present application include code elements corresponding to colors other than the black and white code elements in the achromatic code elements.
[0065] Furthermore, before step 1303, the anti-counterfeiting verification method may further include:
[0066] According to the object identification information of the target object, the color information corresponding to each type of character at the current moment is obtained from the server;
[0067] The server periodically updates the color information corresponding to each type of character.
[0068] For example, the first color information corresponding to the first type of characters and the second color information corresponding to the second type of characters mentioned above may be updated periodically by the server.
[0069] In this way, the client device obtains the first graphic code corresponding to the product at the current moment and the verification string (salt) corresponding to the product at the current moment from the server, and generates the second graphic code corresponding to the product at the current moment based on the verification string. If the color information of the first graphic code and the color information of the second graphic code are consistent, then the target object such as product A is authentic. Conversely, if the color information of the first graphic code and the color information of the second graphic code are inconsistent, then the target object such as product A is a counterfeit.
[0070] In addition, in addition to determining the second graphic code according to the method shown above, the embodiment of the present application also provides another method for determining the second graphic code, as shown below.
[0071] If the target object is a product, and the product appearance is marked with a second graphic code, then, in order to facilitate the subsequent verification of the authenticity of the target object, the user can take a picture of the product appearance marked with the second graphic code, that is, the electronic device captures the first image in the scan preview box, the first image includes the target object and the second graphic code, then recognizes the second graphic code, obtains the verification string in the second graphic code, and then obtains the color information in the second graphic code based on the verification string through the above method, which will not be repeated here.
[0072] Then, step 140 is involved. The above is an example of obtaining the first graphic code and the second graphic code, as well as the color information carried by the first graphic code and the color information carried by the second graphic code, so as to verify the authenticity of the target object based on these contents. In this way, the electronic device can be triggered to output the verification result of the target object in the following manner.
[0073] Then, involving 140, the user can compare the color information of the first graphic code with the color information of the second graphic code. At this time, if the color information of the first graphic code and the color information of the second graphic code are consistent, it means that the product including the second graphic code is authentic. Conversely, if the color information of the first graphic code and the color information of the second graphic code are inconsistent, it means that the product including the second graphic code is a counterfeit.
[0074] Therefore, in the embodiment of the present application, since the arrangement structure of the code elements in the universal graphic code is not changed and only the colors of certain code elements in the universal graphic code are adjusted, the information stored in the universal graphic code is retained and the authenticity of the target object can be verified through the color information in the universal graphic code. Therefore, the first graphic code and the second graphic code achieve the effect of "one code for two purposes", effectively increasing the information capacity of the universal graphic code, that is, ensuring the security of the graphic code, and improving the accuracy of identifying the authenticity of the target object through the second graphic code.
[0075] Furthermore, during the manufacturing process, the second graphic code can be recognized by a black and white camera, enabling rapid identification of different target objects and facilitating their management. For the user, electronic devices can use the graphic code, which carries color information, to obtain information about the target object and verify its authenticity. This eliminates the need for users to manually input the target object's identification information, simplifying the query process and improving the efficiency of querying anti-counterfeiting information.
[0076] In addition, since the provider of the target object does not need to maintain a complex authenticity query system and only needs to periodically change a specific string salt, the anti-counterfeiting verification method provided by the embodiment of the present application has lower maintenance costs.
[0077] Based on this, in order to better explain the above Figures 1 to 3 The anti-counterfeiting verification method shown is described in detail below, taking the object identification information corresponding to the target object, namely product A, such as the product serial number: 6920999701730, as an example, according to the anti-counterfeiting verification method provided in the embodiment of the present application.
[0078] In step 1, the target object can be product A to be verified. The user logs in to a webpage or application for verifying the authenticity of product A through an electronic device and enters the product serial number of product A on the webpage or application, so that the server is requested to verify the authenticity of product A based on the verification string corresponding to the current moment, such as the salt value (salt). Assuming that the verification string salt = 'vivo1' is specific within a certain period. Furthermore, based on salt = 'vivo1', the first encrypted information corresponding to product A at the current moment, such as the hash value 1, is calculated. The hash value 1 is converted into a binary string, such as a 01 string. Based on the color information corresponding to each character in the binary string at the current moment, the universal graphic code corresponding to product A is adjusted to obtain the first graphic code.
[0079] Step 2: Add salt = 'vivo1' to the product serial number 6920999701730 of product A to obtain an encrypted string, recorded as info, that is, info = '6920999701730vivo1'.
[0080] Step 3: Encrypt info using the MD5 function to obtain the second encrypted information, namely, hash value 2. The hash value is represented by a 16-bit lowercase hexadecimal number, which is recorded as hash='02e9758fa39435d2.
[0081] Step 4: Convert the hash value 2 into a decimal ASCII code, and then convert the decimal number into an 8-bit binary number to obtain a binary string.
[0082] Step 5: Adjust the universal graphic code corresponding to the target object based on the color information corresponding to each character in the binary string at the current moment, obtaining a second graphic code corresponding to the target object at the current moment. The universal graphic code is a black and white QR code containing the product serial number 6920999701730. The QR code selected here is Version 1 (21×21), a QR Code with a tolerance level of L, and the black and white QR code is recorded as black_qr. Each character in the hash = '02e9758fa39435d2, such as '0', is converted to the decimal ASCII code 48, and then 48 is converted to the 8-bit binary number 0011 0000. The binary string formed here will be filled into the QR code bit by bit using different colors. Furthermore, we can scan black_qr row by row in a row-first order. When we encounter a black square, we choose to fill it with the corresponding color. When we encounter a white square, we skip it and do not fill it with color. The color filling method can be freely selected as long as there is a large contrast between different colors. For ease of operation, the filling scheme used here is: red represents 0 in the binary string, and blue represents 1 in the binary string. Figure 3 The colors of the black squares in the first row after filling are: red, red, blue, blue, red, red, red, red. Repeat the above steps, convert each character in hash = '02e9758fa39435d2 into a binary string of length 8, and use the color information of the squares in the QR code to represent different characters, finally forming the following Figure 4 The QR code is shown in color.
[0083] It should be noted that the recognition of QR code information relies on the color difference between each small pattern and the QR code background. In the embodiment of this application, white is used as the background. The color of the QR code pattern is very different from white. Therefore, the target QR code with color can be correctly recognized by ordinary recognition devices. That is, in the production and circulation of products, ordinary recognition devices scan Figure 2 and Figure 4 The same result will be achieved; after seeing the product, the user can scan it with an electronic device Figure 4The graphic code in the image (which can be the universal QR code in step 5 above) can be used to obtain a salt, and then a second graphic code can be regenerated according to the above algorithm. If the color information of the newly generated second graphic code is inconsistent with the color information of the first graphic code obtained from the server, it can be considered that the QR code on the product is forged and the product is counterfeit. Conversely, if the color information of the newly generated second graphic code is consistent with the color information of the first graphic code obtained from the server, it can be considered that the QR code on the product is not forged and the product is authentic.
[0084] Thus, the server generates a hash value of the product at regular intervals, converts the hash value into a binary string, and assigns a color to each of the 01 characters in the binary string, adjusting the color of the black and white QR code generated based on the product's object identification information. Based on this, when the user obtains the salt at the current moment to generate the hash value at the current moment, the hash value is converted into a binary string, and each of the 01 characters in the binary string is assigned a color, adjusting the color of the black and white QR code generated based on the product's object identification information to obtain a second image code. If the generated colored second graphic code is consistent with the colored first graphic code obtained from the server, it means that it is authentic. In fact, the generated hash value needs to be consistent, and the colors corresponding to the 01 strings need to be consistent in order to generate a consistent colored QR code. In this way, through message digest technology, the verification string such as the salt value is combined with the object identification information such as the product serial number, and a preset encryption algorithm (such as MD5) is used to generate a hash value. Since the immutability of the object identification information is guaranteed by the performance of the hash function and the confidentiality of the check string, a slight change in the object identification information will cause a significant change in the final hash value. Thus, the security of the graphic code (i.e., the first graphic code and the second graphic code) can be guaranteed, effectively preventing the possibility of the graphic code being tampered with, thereby increasing the security of the graphic code. In addition, the anti-counterfeiting verification method provided by the embodiment of the present application does not change the arrangement structure of the code elements in the universal graphic code, but only adjusts the color of certain code elements in the universal graphic code. Therefore, the information stored in the universal graphic code is retained, and the authenticity of the product can be verified through the color information in the second graphic code generated by the universal graphic code. As a result, the second graphic code achieves the effect of "one code for two purposes", effectively increasing the information capacity of the initial QR code, that is, ensuring the security of the QR code, effectively increasing the information capacity of the graphic code, that is, ensuring the security of the graphic code, preventing the graphic code from being tampered with, and thus improving the accuracy of identifying the authenticity of the target object through the color information in the graphic code. In addition, for the user side, by using the electronic device to determine the first graphic code and the second image code, it is possible to obtain the object identification information of the product and to identify the authenticity of the product. During the product identification process, the user does not need to manually input the object identification information, which simplifies the query process and improves the efficiency of querying anti-counterfeiting information.
[0085] The anti-counterfeiting verification method provided in the embodiment of the present application can be executed by an anti-counterfeiting verification device. In the embodiment of the present application, the anti-counterfeiting verification device is used as an example to illustrate the anti-counterfeiting verification method provided in the embodiment of the present application.
[0086] Based on the same inventive concept, the present application also provides an anti-counterfeiting verification device. Figure 5 Provide detailed explanation.
[0087] Figure 5 A schematic structural diagram of an anti-counterfeiting verification device provided in an embodiment of the present application.
[0088] like Figure 5 As shown, the anti-counterfeiting verification device 50 is applied to electronic equipment and may specifically include:
[0089] An acquisition module 501 is configured to acquire a first graphic code corresponding to a target object at a current moment, where the first graphic code carries color information;
[0090] The acquisition module 501 is further used to obtain the verification string corresponding to the target object at the current moment;
[0091] A determination module 502 is configured to determine a second graphic code corresponding to the target object at the current moment based on the verification string, where the second graphic code carries color information;
[0092] The determination module 502 is further configured to determine a verification result of the target object according to the color information of the first graphic code and the color information of the second graphic code.
[0093] The anti-counterfeiting verification device 50 is described in detail below.
[0094] In one or more possible embodiments, the acquisition module 501 in the embodiment of the present application may be specifically configured to acquire, from a server, a first graphic code corresponding to the target object at a current moment according to the object identification information of the target object;
[0095] Among them, the server determines the first encryption information corresponding to the target object at the current moment based on the verification string corresponding to the target object at the current moment, converts the first encryption information into a binary string, adjusts the universal graphic code corresponding to the target object according to the color information corresponding to each character in the binary string at the current moment, obtains the first graphic code corresponding to the target object at the current moment, and associates the first graphic code with the object identification information of the target object; the universal graphic code is determined based on the object identification information of the target object.
[0096] In another or more possible embodiments, the acquisition module 501 in the embodiment of the present application may be specifically configured to acquire, from the server, a verification string corresponding to the target object at the current moment according to the object identification information of the target object;
[0097] The server periodically updates the verification string corresponding to the target object.
[0098] In one or more possible embodiments, the anti-counterfeiting verification device 50 in the embodiment of the present application may further include a conversion module and a processing module; wherein,
[0099] The determination module 502 is further configured to determine, based on the verification string, the second encrypted information corresponding to the target object at the current moment;
[0100] A conversion module, configured to convert the second encrypted information into a binary string;
[0101] The processing module is used to adjust the universal graphic code corresponding to the target object according to the color information corresponding to each character in the binary string at the current moment, and obtain the second graphic code corresponding to the target object at the current moment; the universal graphic code is determined based on the object identification information of the target object.
[0102] In one or more further possible embodiments, the determination module 502 may be specifically configured to determine, based on the verification string and the object identification information of the target object, the encrypted string corresponding to the target object at the current moment;
[0103] The acquisition module 501 may also be configured to encrypt the encrypted character string according to a preset encryption algorithm to obtain second encrypted information corresponding to the target object at the current moment.
[0104] In one or more possible embodiments, the processing module can be specifically used to, when the binary string includes a first type of characters and a second type of characters; and the universal graphic code corresponding to the target object includes a first color area and a second color area, adjust the first color area in the universal graphic code according to the first color information corresponding to the first type of characters, and adjust the second color area in the universal graphic code according to the second color information corresponding to the second type of characters, to obtain the second graphic code corresponding to the target object at the current moment.
[0105] In one or more possible embodiments, the acquisition module 501 may also be configured to acquire, from the server, color information corresponding to each type of character at the current moment according to the object identification information of the target object;
[0106] The server periodically updates the color information corresponding to each type of character.
[0107] The anti-counterfeiting verification device in the embodiment of the present application can be an electronic device, or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices other than a terminal. Exemplary, the electronic device can be a mobile phone, a tablet computer, a notebook computer, a palmtop computer, an on-board electronic device, a mobile internet device (Mobile Internet Device, MID), augmented reality (augmented reality, AR) / virtual reality (virtualreality, VR) equipment, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personalcomputer, PC), a television (television, TV), a teller machine or a self-service machine, etc., and the embodiment of the present application is not specifically limited.
[0108] The anti-counterfeiting verification device in the embodiment of the present application can be a device having an operating system. The operating system can be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0109] The anti-counterfeiting verification device provided in the embodiment of the present application can achieve Figures 1 to 4 The various processes implemented in the method embodiment achieve the same technical effect and will not be described again here to avoid repetition.
[0110] In an embodiment of the present application, a first graphical code corresponding to a target object at a current moment and a verification string are obtained. The first graphical code carries color information. Then, based on the verification string, a second graphical code corresponding to the target object at the current moment is determined. The second graphical code also carries color information. Thus, the verification result of the target object can be determined based on the color information of the first and second graphical codes. In this way, the color information carried in the graphical code reduces the possibility of malicious attackers altering the graphical code of the target object, thereby increasing the security of the graphical code. Furthermore, because the arrangement of the code elements in the graphical code is not changed, only the colors of certain code elements are adjusted, so that the graphical code carries color information, the information stored in the graphical code is retained and the authenticity of the target object can be verified using the color information in the graphical code. Thus, the graphical code achieves a "one code, two uses" effect, effectively increasing the information capacity of the graphical code, ensuring the security of the graphical code, and preventing tampering with the graphical code, thereby improving the accuracy of authenticating the target object using the color information in the graphical code.
[0111] Optional, such as Figure 6 As shown, an embodiment of the present application also provides an electronic device 60, including a processor 601 and a memory 602, wherein the memory 602 stores a program or instruction that can be run on the processor 601, and when the program or instruction is executed by the processor 601, the various steps of the above-mentioned anti-counterfeiting verification method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0112] It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
[0113] Figure 7 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application.
[0114] The electronic device 700 includes but is not limited to: a radio frequency unit 701, a network module 702, an audio output unit 703, an input unit 704, a sensor 705, a display unit 706, a user input unit 707, an interface unit 708, a memory 709 and a processor 710.
[0115] Those skilled in the art will understand that the electronic device 700 may also include a power source (such as a battery) to power each component, and the power source may be logically connected to the processor 710 through a power management system, thereby implementing functions such as charging, discharging, and power consumption management through the power management system. Figure 7 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be repeated here.
[0116] In this embodiment of the present application, processor 710 is configured to obtain a first graphical code corresponding to the target object at the current moment, the first graphical code carrying color information. Processor 710 is also configured to obtain a verification string corresponding to the target object at the current moment. Processor 710 is also configured to determine a second graphical code corresponding to the target object at the current moment based on the verification string, the second graphical code carrying color information. Processor 710 is also configured to determine a verification result of the target object based on the color information of the first graphical code and the color information of the second graphical code.
[0117] In one or more possible embodiments, the network module 702 is configured to obtain, from a server, a first graphic code corresponding to the target object at a current moment according to the object identification information of the target object;
[0118] Among them, the server determines the first encryption information corresponding to the target object at the current moment based on the verification string corresponding to the target object at the current moment, converts the first encryption information into a binary string, adjusts the universal graphic code corresponding to the target object according to the color information corresponding to each character in the binary string at the current moment, obtains the first graphic code corresponding to the target object at the current moment, and associates the first graphic code with the object identification information of the target object; the universal graphic code is determined based on the object identification information of the target object.
[0119] In another or more possible embodiments, the network module 702 is configured to obtain a verification string corresponding to the target object at the current moment from the server according to the object identification information of the target object;
[0120] The server periodically updates the verification string corresponding to the target object.
[0121] In one or more possible embodiments, the processor 710 is further used to determine, based on the verification string, the second encrypted information corresponding to the target object at the current moment; convert the second encrypted information into a binary string; adjust the universal graphic code corresponding to the target object according to the color information corresponding to each character in the binary string at the current moment, to obtain the second graphic code corresponding to the target object at the current moment; the universal graphic code is determined based on the object identification information of the target object.
[0122] In one or more possible embodiments, the processor 710 is further used to determine the encrypted string corresponding to the target object at the current moment based on the verification string and the object identification information of the target object; encrypt the encrypted string according to a preset encryption algorithm to obtain the second encrypted information corresponding to the target object at the current moment.
[0123] In one or more further possible embodiments, the processor 710 is further used to, when the binary string includes characters of the first type and characters of the second type; and the universal graphic code corresponding to the target object includes a first color area and a second color area, adjust the first color area in the universal graphic code according to the first color information corresponding to the first type of characters, and adjust the second color area in the universal graphic code according to the second color information corresponding to the second type of characters, to obtain the second graphic code corresponding to the target object at the current moment.
[0124] In one or more further possible embodiments, the network module 702 may also be configured to obtain, from the server, color information corresponding to each type of character at the current moment according to the object identification information of the target object;
[0125] The server periodically updates the color information corresponding to each type of character.
[0126] It should be understood that the input unit 704 may include a graphics processing unit (GPU) 7041 and a microphone 7042, and the graphics processor 7041 processes the image data of the static image or video obtained by the image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 706 may include a display panel, and the display panel may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 707 includes a touch panel 7071 and at least one of the other input devices 7072. The touch panel 7071 is also called a touch screen. The touch panel 7071 may include two parts: a touch detection device and a touch display. Other input devices 7072 may include but are not limited to a physical keyboard, function keys (such as a volume display button, a switch button, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.
[0127] The memory 709 can be used to store software programs and various data. The memory 709 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store an operating system, applications or instructions required for at least one function (such as a sound playback function, an image playback function, etc.). In addition, the memory 709 may include volatile memory or non-volatile memory, or the memory 709 may include both volatile and non-volatile memory. The non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM), and a direct memory bus random access memory (DRRAM). The memory 709 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.
[0128] Processor 710 may include one or more processing units. Optionally, processor 710 integrates an application processor and a modem processor. The application processor primarily handles operations related to the operating system, user interface, and application programs, while the modem processor primarily processes wireless anti-counterfeiting verification signals, such as a baseband processor. It is understood that the modem processor may not be integrated into processor 710.
[0129] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned anti-counterfeiting verification method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0130] The processor is the processor in the electronic device in the above embodiment. The readable storage medium includes a computer-readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0131] In addition, an embodiment of the present application further provides a chip, which includes a processor and an anti-counterfeiting verification interface. The anti-counterfeiting verification interface and the processor are coupled. The processor is used to run programs or instructions to implement the various processes of the above-mentioned anti-counterfeiting verification method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0132] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0133] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the anti-counterfeiting verification method embodiment described above, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0134] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.
[0135] Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of the present application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in reverse order depending on the functions involved. For example, the methods described may be performed in an order different from that described, and various steps may be added, omitted, or combined. Furthermore, features described with reference to certain examples may be combined in other examples.
[0136] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.
[0137] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of this application, ordinary technicians in this field can also make many forms without departing from the purpose of this application and the scope of protection of the claims, all of which are within the protection of this application.
Claims
1. An anti-counterfeiting verification method, characterized in that: include: Obtaining the first graphic code corresponding to the target object at the current moment; The first graphic code carries color information; Obtain the verification string corresponding to the target object at the current moment; Determining, based on the verification string, the second encrypted information corresponding to the target object at the current moment; Converting the second encrypted information into a binary string; Adjusting the universal graphic code corresponding to the target object according to the color information corresponding to each character in the binary string at the current moment to obtain a second graphic code corresponding to the target object at the current moment; The universal graphic code is determined based on the object identification information of the target object, and the second graphic code carries color information; A verification result of the target object is determined according to the color information of the first graphic code and the color information of the second graphic code.
2. The method according to claim 1, characterized in that The obtaining of the first graphic code corresponding to the target object at the current moment includes: According to the object identification information of the target object, obtaining a first graphic code corresponding to the target object at the current moment from the server; The server determines the first encryption information corresponding to the target object at the current moment based on the verification string corresponding to the target object at the current moment, converts the first encryption information into a binary string, adjusts the universal graphic code corresponding to the target object based on the color information corresponding to each character in the binary string at the current moment, obtains the first graphic code corresponding to the target object at the current moment, and associates the first graphic code with the object identification information of the target object; the universal graphic code is determined based on the object identification information of the target object.
3. The method according to claim 1, characterized in that The obtaining of the verification string corresponding to the target object at the current moment includes: Obtaining, from a server, a verification string corresponding to the target object at the current moment according to the object identification information of the target object; The server periodically updates the verification string corresponding to the target object.
4. The method according to claim 1, wherein The determining, based on the verification string, the second encrypted information corresponding to the target object at the current moment includes: Determining the encrypted string corresponding to the target object at the current moment according to the verification string and the object identification information of the target object; The encrypted character string is encrypted according to a preset encryption algorithm to obtain second encrypted information corresponding to the target object at the current moment.
5. The method according to claim 1, wherein The binary string includes characters of a first type and characters of a second type; the universal graphic code corresponding to the target object includes a first color area and a second color area; The step of adjusting the universal graphic code corresponding to the target object according to the color information corresponding to the characters in the binary string at the current moment to obtain the second graphic code corresponding to the target object at the current moment includes: According to the first color information corresponding to the first type of characters, the first color area in the universal graphic code is adjusted, and according to the second color information corresponding to the second type of characters, the second color area in the universal graphic code is adjusted to obtain the second graphic code corresponding to the target object at the current moment.
6. The method according to claim 5, characterized in that Before the step of adjusting the universal graphic code corresponding to the target object according to the color information corresponding to each character in the binary string at the current moment to obtain the second graphic code corresponding to the target object at the current moment, the method further includes: According to the object identification information of the target object, obtaining the color information corresponding to each type of character at the current moment from the server; The server periodically updates the color information corresponding to each type of character.
7. An anti-counterfeiting verification device, characterized in that: include: an acquisition module, configured to acquire a first graphic code corresponding to the target object at a current moment, wherein the first graphic code carries color information; The acquisition module is further configured to acquire a verification string corresponding to the target object at the current moment; a determination module, configured to determine, based on the verification string, the second encrypted information corresponding to the target object at the current moment; Converting the second encrypted information into a binary string; adjusting the universal graphic code corresponding to the target object according to the color information corresponding to each character in the binary string at the current moment, to obtain a second graphic code corresponding to the target object at the current moment; the universal graphic code is determined according to the object identification information of the target object, and the second graphic code carries color information; The determination module is further configured to determine a verification result of the target object according to the color information of the first graphic code and the color information of the second graphic code.
8. An electronic device, characterized in that: include: A processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the anti-counterfeiting verification method according to any one of claims 1 to 6.
9. A readable storage medium, characterized in that The readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the anti-counterfeiting verification method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Encoding and decoding method and system for intelligent anti-counterfeiting code
CN111242259A