CN113691528A - Two-dimensional code processing method and device and electronic equipment - Google Patents

Two-dimensional code processing method and device and electronic equipment Download PDF

Info

Publication number
CN113691528A
CN113691528A CN202110969699.2A CN202110969699A CN113691528A CN 113691528 A CN113691528 A CN 113691528A CN 202110969699 A CN202110969699 A CN 202110969699A CN 113691528 A CN113691528 A CN 113691528A
Authority
CN
China
Prior art keywords
channel
dimensional code
color
terminal
arrangement rule
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.)
Granted
Application number
CN202110969699.2A
Other languages
Chinese (zh)
Other versions
CN113691528B (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.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication 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 Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN202110969699.2A priority Critical patent/CN113691528B/en
Publication of CN113691528A publication Critical patent/CN113691528A/en
Application granted granted Critical
Publication of CN113691528B publication Critical patent/CN113691528B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K19/00Record carriers for use with machines and with at least a part designed to carry digital markings
    • G06K19/06Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
    • G06K19/06009Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking
    • G06K19/06037Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking multi-dimensional coding

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Image Processing (AREA)

Abstract

The application discloses a two-dimensional code processing method and device and electronic equipment, and belongs to the technical field of image processing. The method comprises the following steps: separating color channels of the first two-dimensional code image, and determining an arrangement rule corresponding to the separated first color channels according to preset information; arranging the color channels according to the arrangement rule corresponding to the first color channel to obtain a second color channel; synthesizing a second two-dimensional code image according to the second color channel; sending the second two-dimensional code image to a second terminal; the predetermined information includes any one of: identification information of the first terminal; identification information, unified clock information and a preset time window of the second terminal; the unified clock is a clock shared by the first terminal and the second terminal.

Description

Two-dimensional code processing method and device and electronic equipment
Technical Field
The application belongs to the technical field of image processing, and particularly relates to a two-dimensional code processing method and device and electronic equipment.
Background
Two-dimensional code images are generally related to personal privacy and property security. In the remote assistance process, the assisted party usually directly intercepts the two-dimensional code picture and transmits the two-dimensional code picture to the assisting party. If the assisting party accidentally reveals the two-dimensional code, or the two-dimensional code picture is intercepted by people in the transmission process, user information and property safety risks are easily caused.
Therefore, how to provide a method can avoid the information leakage of the two-dimensional code in the transmission process, and has very important significance.
Disclosure of Invention
The embodiment of the application aims to provide a two-dimensional code processing method and device and electronic equipment, and the defect that safety risk is caused by two-dimensional code information leakage in the prior art can be overcome.
In a first aspect, an embodiment of the present application provides a two-dimensional code processing method, which is applied to a first terminal, and the method includes:
separating color channels of the first two-dimensional code image, and determining an arrangement rule corresponding to the separated first color channels according to preset information;
arranging the color channels according to the arrangement rule corresponding to the first color channel to obtain a second color channel;
synthesizing a second two-dimensional code image according to the second color channel;
sending the second two-dimensional code image to a second terminal;
the predetermined information includes any one of:
identification information of the first terminal;
identification information, unified clock information and a preset time window of the second terminal; the unified clock is a clock shared by the first terminal and the second terminal.
In a second aspect, an embodiment of the present application provides a two-dimensional code processing method, which is applied to a second terminal, and the method includes:
receiving a second two-dimensional code image sent by a first terminal and an arrangement rule corresponding to a first color channel, and determining a reverse arrangement rule of the first color channel according to the arrangement rule corresponding to the first color channel;
decoding the second two-dimensional code image according to the reverse arrangement rule of the first color channel to obtain a first two-dimensional code corresponding to the second two-dimensional code;
and displaying the first two-dimensional code image.
In a third aspect, an embodiment of the present application provides a two-dimensional code processing apparatus, which is applied to a first terminal, and the apparatus includes:
the rule determining module is used for separating color channels of the first two-dimensional code image and determining an arrangement rule corresponding to the separated first color channel according to preset information;
the channel processing module is used for arranging the color channels according to the arrangement rule corresponding to the first color channel to obtain a second color channel;
the two-dimensional code synthesis module is used for synthesizing a second two-dimensional code image according to the second color channel;
the sending module is used for sending the second two-dimensional code image to a second terminal;
wherein the predetermined information includes any one of:
identification information of the first terminal;
identification information, unified clock information and a preset time window of the second terminal; the unified clock is a clock shared by the first terminal and the second terminal.
In a fourth aspect, an embodiment of the present application provides a two-dimensional code processing apparatus, which is applied to a second terminal, and the apparatus includes:
the rule determining module is used for receiving a second two-dimensional code image sent by a first terminal and an arrangement rule corresponding to a first color channel, and determining a reverse arrangement rule of the first color channel according to the arrangement rule corresponding to the first color channel;
the decoding module is used for decoding the second two-dimensional code image according to the reverse arrangement rule of the first color channel to obtain a first two-dimensional code corresponding to the second two-dimensional code;
and the display module is used for displaying the first two-dimensional code image.
In a fifth aspect, the present application provides an electronic device, which includes a processor, a memory, and a program or instructions stored on the memory and executable on the processor, and when executed by the processor, the program or instructions implement the steps of the method according to the first aspect or the second aspect.
In a sixth aspect, embodiments of the present application provide a readable storage medium, on which a program or instructions are stored, which when executed by a processor implement the steps of the method according to the first or second aspect.
In a seventh aspect, an embodiment of the present application provides a chip, where the chip includes a processor and a communication interface, where the communication interface is coupled to the processor, and the processor is configured to execute a program or instructions to implement the steps of the method according to the first aspect or the second aspect.
According to the two-dimensional code processing method and device and the electronic equipment, the color channel of the first two-dimensional code image is processed by adopting the corresponding processing rule, and the second two-dimensional code image is synthesized according to the processed color channel and sent, so that encrypted transmission of the first two-dimensional code information can be realized, the safety risk caused by two-dimensional code information leakage is avoided, and the safety of two-dimensional code transmission is improved.
Drawings
Fig. 1 is a schematic flowchart of a two-dimensional code processing method according to an embodiment of the present application;
fig. 2 is a schematic diagram of a first two-dimensional code image and a second two-dimensional code image according to an embodiment of the present application;
fig. 3 is a second schematic flowchart of a two-dimensional code processing method according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a two-dimensional code processing apparatus according to an embodiment of the present application;
fig. 5 is a second schematic structural diagram of a two-dimensional code processing apparatus according to an embodiment of the present disclosure;
FIG. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 7 is a hardware structure diagram of an electronic device implementing an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described clearly below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments that can be derived by one of ordinary skill in the art from the embodiments given herein are intended to be within the scope of the present disclosure.
The terms first, second and the like in the description and in the claims of the present application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that embodiments of the application may be practiced in sequences other than those illustrated or described herein, and that the terms "first," "second," and the like are generally used herein in a generic sense and do not limit the number of terms, e.g., the first term can be one or more than one. In addition, "and/or" in the specification and claims means at least one of connected objects, a character "/" generally means that a preceding and succeeding related objects are in an "or" relationship.
The two-dimensional code processing method, the two-dimensional code processing device, and the electronic device provided in the embodiments of the present application are described in detail below with reference to the accompanying drawings through specific embodiments and application scenarios thereof.
Fig. 1 is a schematic flowchart of a two-dimensional code processing method according to an embodiment of the present application. Referring to fig. 1, an embodiment of the present application provides a two-dimensional code processing method, which may include:
step 110, separating color channels of the first two-dimensional code image, and determining an arrangement rule corresponding to the separated first color channels according to predetermined information;
step 120, arranging the color channels according to the arrangement rule corresponding to the first color channel to obtain a second color channel;
step 130, synthesizing a second two-dimensional code image according to the second color channel;
step 140, sending the second two-dimensional code image to a second terminal;
wherein the predetermined information includes any one of:
identification information of the first terminal;
identification information, unified clock information and a preset time window of the second terminal; the unified clock is a clock shared by the first terminal and the second terminal.
It should be noted that an execution main body of the two-dimensional code processing method provided in the embodiment of the present application may be a first terminal. The first terminal may be an intelligent electronic device, such as a mobile phone, a tablet computer, a notebook computer, a palm top computer, a vehicle-mounted electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a Personal Digital Assistant (PDA), and the like. The second terminal and the first terminal may be the same type of terminal, for example, the second terminal and the first terminal may both be mobile phones. The second terminal and the first terminal may also be different types of terminals, for example, the second terminal may be a PC and the first terminal may be a handset.
An application scenario of the two-dimensional code processing method provided by the embodiment of the present application may be, for example, a scenario in which the first terminal and the second terminal perform remote assistance: the first terminal can be used as an assisted party to accept the assistance of the second terminal. In this scenario, the first terminal may process the first two-dimensional code according to the two-dimensional code processing method provided by the embodiment of the present application, and then send the second two-dimensional code to the second terminal.
Of course, the two-dimensional code processing method provided in the embodiment of the present application may also be applicable to other application scenarios, which are not listed here.
The first terminal may first recognize whether the two-dimensional code exists in the currently transmitted image.
If the first terminal does not recognize that the image contains the two-dimensional code, the first terminal can normally send the image.
If the first terminal identifies that the image contains the two-dimensional code, the first terminal intercepts the first two-dimensional code image from the image and separates a color channel of the first two-dimensional code image from the first two-dimensional code image. The first two-dimensional code image may be an original two-dimensional code image.
After separating the color channels of the first two-dimensional code image, the first terminal may determine an arrangement rule corresponding to the first color channel according to predetermined information.
For example, the first terminal may determine an arrangement rule corresponding to the first color channel according to the identification information of the first terminal; or the first terminal may determine the arrangement rule corresponding to the first color channel according to the identification information of the second terminal, the unified clock information, and the preset time window.
The first terminal may process the first color channel according to an arrangement rule corresponding to the first color channel to obtain a second color channel.
After obtaining the second color channel, the first terminal may re-synthesize the second two-dimensional code image according to the second color channel.
After the second two-dimensional code image is obtained, the first terminal sends the second two-dimensional code image to the second terminal.
It should be noted that, since the first terminal processes the color channel of the first two-dimensional code image to obtain the second two-dimensional code image, the second two-dimensional code image is significantly different from the first two-dimensional code image, as shown in fig. 2. Under the condition that the arrangement rule of the color channels is not known, the third party cannot restore the second two-dimensional code image into the first two-dimensional code image, so that the information of the first two-dimensional code cannot be acquired.
According to the two-dimensional code processing method, the color channels of the first two-dimensional code image are processed according to the corresponding arrangement rules, the second two-dimensional code image is synthesized according to the processed color channels and sent, encrypted transmission of the first two-dimensional code information can be achieved, safety risks caused by two-dimensional code information leakage are avoided, and the safety of two-dimensional code transmission is improved.
In an embodiment, in a case that the predetermined information includes identification information of the first terminal, the two-dimensional code processing method provided in the embodiment of the present application may further include:
and sending the arrangement rule corresponding to the first color channel to the second terminal.
After the first terminal obtains the second color channel according to the arrangement rule corresponding to the first color channel and determines the second two-dimensional code image according to the second color channel, the first terminal may send the arrangement rule corresponding to the first color channel to the second terminal.
For example, the first terminal may send the arrangement rule corresponding to the first color channel to the second terminal when sending the second two-dimensional code to the second terminal. The first terminal may also send the arrangement rule corresponding to the first color channel to the second terminal after sending the second two-dimensional code to the second terminal.
For example, the first terminal may send the arrangement rule corresponding to the first color channel to the second terminal through a separate message, encrypted or not encrypted.
The present application does not specifically limit the transmission timing and the transmission manner of the arrangement rule corresponding to the first color channel.
After receiving the arrangement rule corresponding to the first color channel sent by the first terminal, the second terminal can perform reverse processing on the received second two-dimensional code image according to the arrangement rule corresponding to the first color channel to restore and obtain the first two-dimensional code image, and thus perform operations such as remote assistance according to the first two-dimensional code image.
According to the two-dimensional code processing method provided by the embodiment of the application, the arrangement rule corresponding to the first color channel is sent to the second terminal under the condition that the arrangement rule corresponding to each color channel is determined according to the identification information of the first terminal, so that the second terminal can restore the first two-dimensional code image according to the arrangement rule corresponding to the first color channel, and smooth operation such as remote assistance is guaranteed.
It should be noted that, for the color channel of the two-dimensional code, it may generally be composed of RGB three-color sub-channels, that is, the color channel of the two-dimensional code may be specifically divided into a red sub-channel, a green sub-channel, and a blue sub-channel.
In one embodiment, the ranking rules may include at least one of:
the arrangement rule A is used for adjusting the gray value of each pixel in the color sub-channel;
for example, the gray scale value for a pixel in the red sub-channel may be represented as R (x, y), and the adjusted gray scale value for the pixel may be represented as R (x, y)
Figure BDA0003225195890000071
Then:
Figure BDA0003225195890000072
wherein x is the abscissa of the pixel; y is the ordinate of the pixel; 255 is a preset grey value; max (r) represents the maximum of the gray values for each pixel in the red subchannel.
It can be seen from the formula (1) that adjusting the gray value of each pixel in the color sub-channel may be selecting a smaller value from the preset gray value and the maximum value of the gray value of each pixel, and subtracting the smaller value from the gray value of the pixel to obtain the gray value of the pixel after adjustment. The specific size of the preset gray value may be adjusted according to an actual situation, which is not specifically limited in the embodiment of the present application.
The adjustment rule of the gray scale values of the pixels in the other color sub-channels is the same as that described above, and is not described herein again.
The arrangement rule B is used for translating the gray values of at least part of pixels in the color sub-channels according to the abscissa of the pixels;
for example, the gray scale value for a pixel in the red sub-channel may be represented as R (x, y), and the gray scale value for the pixel after translation according to the abscissa may be represented as R (x, y)
Figure BDA0003225195890000073
Then:
Figure BDA0003225195890000074
wherein x is the abscissa of the pixel; y is the ordinate of the pixel; w is the width of the first two-dimensional code; w is a0Is an initial random value, and w0∈[0,w]。
As shown in formula (2), rule B is to shift the gray-level values of at least some pixels according to the abscissa of the pixels, i.e., shift the gray-level values of the original pixels to other pixels along the horizontal axis. Wherein the specific number of the partial pixels is determined by the width w of the first two-dimensional code and the initial random value w0And (4) determining. InitialRandom value w0The specific size of the optical fiber can be adjusted according to actual needs, which is not specifically limited in the embodiment of the present application.
And C, translating the gray values of at least part of pixels in the color sub-channels according to the ordinate of the pixels.
For example, the gray scale value for a pixel in the red sub-channel may be represented as R (x, y), and the gray scale value of the pixel after translation according to the ordinate may be represented as R (x, y)
Figure BDA0003225195890000081
Then:
Figure BDA0003225195890000082
wherein x is the abscissa of the pixel; y is the ordinate of the pixel; h is the height of the first two-dimensional code; h is0Is an initial random value, and h0∈[0,h]。
As shown in formula (3), rule C is to shift the gray-level values of at least some pixels according to the ordinate of the pixels, i.e., shift the gray-level values of the original pixels to other pixels along the ordinate. Wherein the specific number of the partial pixels is determined by the height h of the first two-dimensional code and the initial random value h0And (4) determining. Initial random value h0The specific size of the optical fiber can be adjusted according to actual needs, which is not specifically limited in the embodiment of the present application.
The above arrangement rules may be arbitrarily combined. For example, combining rule B with rule C, one can derive rule B + C:
translating the gray values of at least part of pixels in the color sub-channels according to the abscissa and the ordinate of the pixels;
for example, the gray scale value for a pixel in the red sub-channel may be represented as R (x, y), and the gray scale value for the pixel translated according to the abscissa and the ordinate may be represented as R (x, y)
Figure BDA0003225195890000083
Then:
Figure BDA0003225195890000084
wherein x is the abscissa of the pixel; y is the ordinate of the pixel; w is the width of the first two-dimensional code; w is a0Is an initial random value, and w0∈[0,w](ii) a h is the height of the first two-dimensional code; h is0Is an initial random value, and h0∈[0,h]。
As shown in formula (4), the rule B + C is to translate the gray scale value of at least some pixels according to the ordinate and abscissa of the pixel, that is, to translate the gray scale value of the original pixel to other pixels along the abscissa and the ordinate.
In an embodiment, in a case that the predetermined information includes identification information of the first terminal, determining an arrangement rule corresponding to the separated first color channel according to the predetermined information may include:
determining an arrangement rule of the first color sub-channel according to the identification information of the first terminal;
determining an arrangement rule of a second color sub-channel according to an arrangement rule of the first color sub-channel;
determining an arrangement rule of a third color sub-channel according to the arrangement rule of the second color sub-channel;
the first color channel comprises a first color sub-channel, a second color sub-channel and a third color sub-channel, and the first color sub-channel, the second color sub-channel and the third color channel respectively correspond to one of a red sub-channel, a green sub-channel and a blue sub-channel and are different from each other.
For example, the first color sub-channel may be a red sub-channel, the second color sub-channel may be a green sub-channel, and the third color sub-channel may be a blue sub-channel.
Assuming that the arrangement rule of the red sub-channels is result, then:
result=hashCode(deviceID)modN+1 (5)
wherein, the hashCode is a hash coding function; deviceID is the ID of the first terminal; modN is a corresponding relation function of the hash coding function value and the arrangement rule number.
As can be seen from equation (5), the ID of the first terminal may be first input into the hash coding function to determine the hash coding function value of the first terminal; then, a corresponding arrangement rule number N can be determined according to the hash coding function value; and finally, the arrangement rule of the red sub-channel is the arrangement rule corresponding to the arrangement rule number N + 1.
Wherein modN can be as shown in the following table:
TABLE 1 one of tables of correspondence between hash-coding function values and arrangement rule numbers
hashCode(deviceID) Rule numbering
0≤hashCode(deviceID)<10 0,4,8,…
10≤hashCode(deviceID)<20 1,5,…
20≤hashCode(deviceID)<30 2,6,…
hashCode(deviceID)≥30 3,7,…
Wherein, the arrangement rule a may correspond to rule numbers 1,5, …; the arrangement rule B may correspond to rule numbers 2,6, …; the arrangement rule C may correspond to rule numbers 3,7, …; the arrangement rule B + C may correspond to rule numbers 4,8, ….
For example, when the first terminal ID is 888888, the hash coding function value of the first terminal ID is 1 by calculating the first terminal ID through the hash coding function, N is determined to be 0 by the corresponding relation function modN between the hash coding function value and the arrangement rule number, and the arrangement rule of the red sub-channel is an arrangement rule corresponding to N +1 ═ 1, that is, the gray scale value of each pixel in the red sub-channel is adjusted according to the arrangement rule a.
After the arrangement rule of the red sub-channel is determined, the arrangement rule number of the green sub-channel can be determined according to the arrangement rule number of the red sub-channel. For example, the arrangement rule number of the green sub-channel may be G ═ R + 1. Wherein, R is the arrangement rule number of the red subchannel.
After the arrangement rule of the green sub-channel is determined, the arrangement rule number of the blue sub-channel can be determined according to the arrangement rule number of the green sub-channel. For example, the arrangement rule number of the blue sub-channel may be B ═ G + 1.
Therefore, when the arrangement rule of the red sub-channel is numbered 1, the arrangement rule of the green sub-channel is numbered 2, and the arrangement rule of the blue sub-channel is numbered 3. According to the rule B, translating the gray values of at least part of pixels in the green sub-channel according to the abscissa of the pixels; and translating the gray values of at least part of pixels in the blue sub-channel according to the rule C according to the ordinate of the pixels.
According to the two-dimensional code processing method provided by the embodiment of the application, the arrangement rule of the first color sub-channel is determined according to the Hash coding function and the like based on the identification information of the first terminal, and then the arrangement rules of other color sub-channels are sequentially determined, so that the determination complexity of the arrangement rules of the color sub-channels can be effectively improved, the risk that a third party cracks the second two-dimensional code is reduced, and the safety of two-dimensional code processing is further improved.
In an embodiment, in a case that the predetermined information includes identification information of the second terminal, unified clock information, and a preset time window, determining, according to the predetermined information, an arrangement rule corresponding to the separated first color channel may include:
and determining an arrangement rule corresponding to the first color channel according to the identification information of the second terminal, the unified clock information and the preset time window.
The unified clock and the preset time window shared by the first terminal and the second terminal may be preset, and then the method for determining the arrangement rule corresponding to the first color channel according to the identification information, the unified clock information and the preset time window of the second terminal, which are pre-stored, may be stored in the first terminal and the second terminal.
In this way, after the first terminal receives the identification information of the second terminal sent by the second terminal (or the first terminal may also store the identification information of the second terminal in advance), the first terminal and the second terminal both know the method for determining the arrangement rule corresponding to each color channel, and when the first terminal determines the arrangement rule corresponding to each color channel according to the one-time clock information, the second terminal can also synchronously determine the rule for restoring the first color channel, so as to restore the first two-dimensional code.
According to the two-dimensional code processing method provided by the embodiment of the application, the unified clock information shared by the first terminal and the second terminal is set, and the arrangement rule corresponding to the first color channel is determined according to the identification information and the unified clock information of the second terminal, so that the second terminal can synchronously determine the rule for restoring the first color channel, the restoration of the first two-dimensional code can be realized under the condition that the arrangement rule corresponding to the first color channel is not sent, and the transmission safety of the two-dimensional code is further improved.
On the basis of the foregoing embodiment, determining an arrangement rule corresponding to the first color channel according to the identification information of the second terminal, the unified clock information, and the preset time window may include:
determining a current timestamp according to the unified clock information;
determining an arrangement rule of the first color sub-channel according to the identification information of the second terminal, the current timestamp and a preset time window;
determining an arrangement rule of a second color sub-channel according to an arrangement rule of the first color sub-channel;
determining an arrangement rule of a third color sub-channel according to the arrangement rule of the second color sub-channel;
the first color channel comprises a first color sub-channel, a second color sub-channel and a third color sub-channel, and the first color sub-channel, the second color sub-channel and the third color sub-channel respectively correspond to one of a red color channel sub-channel, a green color sub-channel and a blue color sub-channel and are different from each other.
For example, the first color sub-channel may be a red sub-channel, the second color sub-channel may be a green sub-channel, and the third color sub-channel may be a blue sub-channel.
Assuming that the arrangement rule of the red sub-channels is result, then:
result=hashCode(deviceID+nowTime/T)modN+1 (6)
wherein, the hashCode is a hash coding function; deviceID is the ID of the second terminal; nowTime is the current timestamp determined according to the unified clock information; t is a preset time window; modN is a corresponding relation function of the hash coding function value and the arrangement rule number.
As can be seen from the formula (6), the current timestamp can be determined according to the unified clock information, the remainder calculation is performed on the current timestamp according to the preset time window, and then the second terminal ID and the remainder calculation result are input into the hash coding function to determine the hash coding function value; it should be noted that the length of the time window T may be, for example, 30s (the specific size of the time window T is not specifically limited in the embodiment of the present application), and the value of nowTime/T is not changed within 30 s.
Then, the corresponding arrangement rule number N may be determined according to the hash encoding function value.
And finally, the arrangement rule of the red sub-channel is the arrangement rule corresponding to the arrangement rule number N + 1.
Wherein modN can be as shown in the following table:
TABLE 2 second table of correspondence between hash-coding function values and arrangement rule numbers
hashCode(deviceID+nowTime/T) Rule numbering
0≤hashCode(deviceID+nowTime/T)<10 0,4,8,…
10≤hashCode(deviceID+nowTime/T)<20 1,5,…
20≤hashCode(deviceID+nowTime/T)<30 2,6,…
hashCode(deviceID+nowTime/T)≥30 3,7,…
Wherein, the arrangement rule a may correspond to rule numbers 1,5, …; the arrangement rule B may correspond to rule numbers 2,6, …; the arrangement rule C may correspond to rule numbers 3,7, …; the arrangement rule B + C may correspond to rule numbers 4,8, ….
For example, when the sum of the first terminal ID and the remainder calculation result is calculated by the hash coding function to obtain a hash coding function value of 1, N may be determined to be 0 by the corresponding relation function modN between the hash coding function value and the arrangement rule number, and the arrangement rule of the red sub-channel is an arrangement rule corresponding to N +1 ═ 1, that is, the gray scale value of each pixel in the red sub-channel is adjusted according to the arrangement rule a.
After the arrangement rule of the red sub-channel is determined, the arrangement rule number of the green sub-channel can be determined according to the arrangement rule number of the red sub-channel. For example, the arrangement rule number of the green sub-channel may be G ═ R + 1. Wherein, R is the arrangement rule number of the red subchannel.
After the arrangement rule of the green sub-channel is determined, the arrangement rule number of the blue sub-channel can be determined according to the arrangement rule number of the green sub-channel. For example, the arrangement rule number of the blue sub-channel may be B ═ G + 1.
Therefore, when the arrangement rule of the red sub-channel is numbered 1, the arrangement rule of the green sub-channel is numbered 2, and the arrangement rule of the blue sub-channel is numbered 3. According to the rule B, translating the gray values of at least part of pixels in the green sub-channel according to the abscissa of the pixels; and translating the gray values of at least part of pixels in the blue sub-channel according to the rule C according to the ordinate of the pixels.
According to the two-dimensional code processing method provided by the embodiment of the application, the arrangement rule of the first color sub-channel is determined according to the Hash coding function and the like based on the identification information and the unified clock information of the first terminal, and then the arrangement rules of other color sub-channels are sequentially determined, so that the determination complexity of the arrangement rules of the color sub-channels can be effectively improved, the risk that a third party cracks the second two-dimensional code is reduced, and the transmission safety of the two-dimensional code is further improved.
Fig. 3 is a second flowchart of a two-dimensional code processing method according to an embodiment of the present application. Referring to fig. 3, an embodiment of the present application provides a two-dimensional code processing method, which may include:
step 310, receiving a second two-dimensional code image sent by a first terminal and an arrangement rule corresponding to a first color channel, and determining a reverse arrangement rule of the first color channel according to the arrangement rule corresponding to the first color channel;
step 320, decoding the second two-dimensional code image according to the reverse arrangement rule of the first color channel to obtain a first two-dimensional code corresponding to the second two-dimensional code;
and displaying the first two-dimensional code image.
It should be noted that an execution main body of the two-dimensional code processing method provided in the embodiment of the present application may be a second terminal. The second terminal may be an intelligent electronic device, such as a mobile phone, a tablet computer, a notebook computer, a palm top computer, a vehicle-mounted electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a Personal Digital Assistant (PDA), and the like. The second terminal and the first terminal may be the same type of terminal, for example, the second terminal and the first terminal may both be mobile phones. The second terminal and the first terminal may also be different types of terminals, for example, the second terminal may be a PC and the first terminal may be a handset.
An application scenario of the two-dimensional code processing method provided by the embodiment of the present application may be, for example, a scenario in which the first terminal and the second terminal perform remote assistance: the first terminal can be used as an assisted party to accept the assistance of the second terminal. In this scenario, the first terminal may process the first two-dimensional code according to the two-dimensional code processing method provided by the embodiment of the present application, and then send the second two-dimensional code to the second terminal.
Of course, the two-dimensional code processing method provided in the embodiment of the present application may also be applicable to other application scenarios, which are not listed here.
The second terminal can receive the second two-dimensional code image sent by the first terminal and the arrangement rule corresponding to the first color channel.
The second two-dimensional code image is determined by the first terminal according to the arrangement rule corresponding to the first color channel of the first two-dimensional code image and the arrangement rule corresponding to the first color channel.
Wherein the predetermined information may include any one of:
identification information of the first terminal;
identification information, unified clock information and a preset time window of the second terminal; the unified clock is a clock shared by the first terminal and the second terminal.
The specific method for determining the second two-dimensional code image by the first terminal may refer to the method embodiments described above, and details are not repeated here.
After the first terminal processes the first color channel according to the arrangement rule corresponding to each color channel to determine the second two-dimensional code image, the first terminal may send the arrangement rule corresponding to the first color channel to the second terminal, and the second terminal may receive the arrangement rule corresponding to the first color channel sent by the first terminal.
For example, the second terminal may receive the second two-dimensional code sent by the first terminal and receive the arrangement rule corresponding to the first color channel. The second terminal may also receive the arrangement rule corresponding to the first color channel sent by the first terminal after receiving the second two-dimensional code sent by the first terminal.
For example, the second terminal may receive a single encrypted or unencrypted message sent by the first terminal, and then parse the arrangement rule corresponding to the first color channel from the message.
The receiving time and the receiving mode of the arrangement rule corresponding to the first color channel are not particularly limited.
After receiving the arrangement rule corresponding to the first color channel sent by the first terminal, the second terminal can determine the reverse arrangement rule of the first color channel according to the arrangement rule corresponding to the first color channel.
For example, when the arrangement rule of the red sub-channel in the first color channel is the arrangement rule B + C, after the second terminal receives the arrangement rule corresponding to the red sub-channel sent by the first terminal, it may be determined that the reverse arrangement rule of the corresponding red sub-channel is
Figure BDA0003225195890000141
After the second terminal determines the reverse arrangement rule of the first color channel, the second two-dimensional code image can be decoded according to the determined reverse arrangement rule of the first color channel, so that the first two-dimensional code corresponding to the second two-dimensional code is obtained.
According to the two-dimensional code processing method provided by the embodiment of the application, the arrangement rule corresponding to the first color channel is received under the condition that the arrangement rule corresponding to the first color channel is determined according to the identification information of the first terminal, so that the second terminal can restore the first two-dimensional code image according to the arrangement rule corresponding to the first color channel, and smooth operation such as remote assistance is guaranteed.
Optionally, the second terminal sends the identification information of the second terminal to the first terminal under the condition that the first terminal determines the arrangement rule corresponding to the first color channel of the first two-dimensional code image according to the identification information of the second terminal, the unified clock information and the preset time window.
In this case, a unified clock and a preset time window shared by the first terminal and the second terminal may be preset, and then the first terminal and the second terminal may store a method of determining an arrangement rule corresponding to the first color channel according to the identification information of the second terminal, the unified clock information, and the preset time window. Therefore, the first terminal and the second terminal both know the method for determining the arrangement rule corresponding to the first color channel, and when the first terminal determines the arrangement rule corresponding to each color channel according to the one-time clock information, the second terminal can also synchronously determine the rule for restoring the first color channel, so that the first two-dimensional code is restored.
For example, when the first terminal determines that the arrangement rule of the red sub-channel is the arrangement rule B through the identification information, the unified clock information, and the preset time window of the second terminal, the second terminal may also determine that the arrangement rule of the red sub-channel is B through the identification information, the unified clock information, and the preset time window of the second terminal, so as to determine the reverse arrangement rule of the corresponding red sub-channel
Figure BDA0003225195890000151
Figure BDA0003225195890000152
Then, the second terminal may decode the second two-dimensional code image according to the determined reverse arrangement rule of the first color channel to obtain a first two-dimensional code corresponding to the second two-dimensional code.
According to the two-dimensional code processing method provided by the embodiment of the application, the identification information of the second terminal is sent to the first terminal, so that the first terminal determines the arrangement rule corresponding to the first color channel according to the identification information of the second terminal, the unified clock information and the preset time window, the second terminal can synchronously determine the rule for restoring the first color channel, the restoration of the first two-dimensional code can be realized under the condition that the arrangement rule corresponding to the first color channel is not sent, and the transmission safety of the two-dimensional code is further improved.
After the second two-dimensional code is restored according to the reverse arrangement rule of the first color channel to obtain the first two-dimensional code, the second terminal can display the first two-dimensional code image.
In summary, the two-dimensional code processing method provided by the embodiment of the application can realize encrypted transmission of the first two-dimensional code information by receiving the second two-dimensional code image obtained by processing the color channel of the first two-dimensional code image according to the corresponding arrangement rule, thereby avoiding the security risk caused by two-dimensional code information leakage and improving the security of two-dimensional code transmission.
It should be noted that, in the two-dimensional code processing method provided in the embodiment of the present application, the execution main body may be a two-dimensional code processing apparatus, or a control module used for executing the two-dimensional code processing method in the two-dimensional code processing apparatus. The two-dimensional code processing device provided in the embodiment of the present application is described by taking an example of a two-dimensional code processing method executed by a two-dimensional code processing device.
Fig. 4 is a schematic structural diagram of a two-dimensional code processing apparatus according to an embodiment of the present application. Referring to fig. 4, the two-dimensional code processing apparatus provided in the embodiment of the present application may include:
the rule determining module 410 is configured to separate color channels of the first two-dimensional code image, and determine an arrangement rule corresponding to the separated first color channel according to predetermined information;
the channel processing module 420 is configured to arrange the color channels according to an arrangement rule corresponding to the first color channel to obtain a second color channel;
the two-dimensional code synthesizing module 430 is configured to synthesize a second two-dimensional code image according to the second color channel;
a sending module 440, configured to send the second two-dimensional code image to a second terminal;
wherein the predetermined information includes any one of:
identification information of the first terminal;
identification information, unified clock information and a preset time window of the second terminal; the unified clock is a clock shared by the first terminal and the second terminal.
The two-dimensional code processing device provided by the embodiment of the application adopts the corresponding arrangement rule to process through the color channel of the first two-dimensional code image, and synthesizes the second two-dimensional code image according to the processed color channel to send, can realize the encrypted transmission of the initial two-dimensional code information, thereby avoiding the security risk caused by the leakage of the two-dimensional code information, and improving the security of the two-dimensional code transmission.
In an embodiment, in a case that the predetermined information includes identification information of the first terminal, the sending module 440 is further configured to:
and sending the arrangement rule corresponding to the first color channel to the second terminal.
In an embodiment, in a case that the predetermined information includes identification information of the second terminal, unified clock information, and a preset time window, the rule determining module 410 is specifically configured to:
and determining a processing rule corresponding to the first color channel according to the identification information of the second terminal, the unified clock information and the preset time window.
In one embodiment, the rule determining module 410 is specifically configured to:
determining a current timestamp according to the unified clock information;
determining an arrangement rule of the first color sub-channel according to the identification information of the second terminal, the current timestamp and the preset time window;
determining an arrangement rule of a second color sub-channel according to the arrangement rule of the first color sub-channel;
determining an arrangement rule of a third color sub-channel according to the arrangement rule of the second color sub-channel;
wherein the first color channel includes the first color sub-channel, the second color sub-channel, and the third color sub-channel.
In an embodiment, when the predetermined information includes identification information of the first terminal, the rule determining module 410 is specifically configured to:
determining an arrangement rule of a first color subchannel according to the identification information of the first terminal;
determining an arrangement rule of a second color sub-channel according to the arrangement rule of the first color sub-channel;
determining an arrangement rule of a third color sub-channel according to the arrangement rule of the second color sub-channel;
wherein the first color channel includes the first color sub-channel, the second color sub-channel, and the third color sub-channel.
In one embodiment, the ranking rules include at least one of:
adjusting the gray value of each pixel in the color sub-channel;
translating the gray values of at least part of pixels in the color sub-channels according to the abscissa of the pixels;
and translating the gray values of at least part of pixels in the color sub-channels according to the ordinate of the pixels.
The two-dimensional code processing device in the embodiment of the present application may be a device, or may be a component, an integrated circuit, or a chip in a terminal. The device can be mobile electronic equipment or non-mobile electronic equipment. By way of example, the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a palm top computer, a vehicle-mounted electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a Personal Digital Assistant (PDA), and the like, and the non-mobile electronic device may be a server, a Network Attached Storage (NAS), a Personal Computer (PC), a Television (TV), a teller machine or a self-service machine, and the like, and the embodiments of the present application are not particularly limited.
The two-dimensional code processing device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, and embodiments of the present application are not limited specifically.
The two-dimensional code processing device provided in the embodiment of the present application can implement each process implemented by the method embodiments of fig. 1 and fig. 2, and is not described here again to avoid repetition.
Fig. 5 is a second schematic structural diagram of a two-dimensional code processing apparatus according to an embodiment of the present application. Referring to fig. 5, the two-dimensional code processing apparatus provided in the embodiment of the present application may include:
a rule determining module 510, configured to receive a second two-dimensional code image sent by a first terminal and an arrangement rule corresponding to a first color channel, and determine a reverse arrangement rule of the first color channel according to the arrangement rule corresponding to the first color channel;
the decoding module 520 is configured to decode the second two-dimensional code image according to the reverse arrangement rule of the first color channel to obtain a first two-dimensional code corresponding to the second two-dimensional code;
the display module 530 is configured to display the first two-dimensional code image.
The two-dimensional code processing device provided by the embodiment of the application can realize encrypted transmission of the first two-dimensional code information by receiving the second two-dimensional code image obtained after the color channel of the first two-dimensional code image is processed by adopting the corresponding arrangement rule, thereby avoiding the safety risk caused by leakage of the two-dimensional code information and improving the safety of two-dimensional code transmission.
The two-dimensional code processing device in the embodiment of the present application may be a device, or may be a component, an integrated circuit, or a chip in a terminal. The device can be mobile electronic equipment or non-mobile electronic equipment. By way of example, the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a palm top computer, a vehicle-mounted electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a Personal Digital Assistant (PDA), and the like, and the non-mobile electronic device may be a server, a Network Attached Storage (NAS), a Personal Computer (PC), a Television (TV), a teller machine or a self-service machine, and the like, and the embodiments of the present application are not particularly limited.
The two-dimensional code processing device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, and embodiments of the present application are not limited specifically.
The two-dimensional code processing apparatus provided in the embodiment of the present application can implement each process implemented in the method embodiment of fig. 3, and is not described here again to avoid repetition.
Optionally, as shown in fig. 6, an electronic device 600 is further provided in this embodiment of the present application, and includes a processor 601, a memory 602, and a program or an instruction stored in the memory 602 and capable of being executed on the processor 601, where the program or the instruction is executed by the processor 601 to implement each process of the two-dimensional code processing method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here.
It should be noted that the electronic device in the embodiment of the present application includes the mobile electronic device and the non-mobile electronic device described above.
Fig. 7 is a schematic diagram of a hardware structure of an electronic device implementing an embodiment of the present application.
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.
Those skilled in the art will appreciate that the electronic device 700 may also include a power supply (e.g., a battery) for powering the various components, and the power supply may be logically coupled to the processor 710 via a power management system, such that the functions of managing charging, discharging, and power consumption may be performed via the power management system. The electronic device structure shown in fig. 7 does not constitute a limitation of the electronic device, and the electronic device may include more or less components than those shown, or combine some components, or arrange different components, and thus, the description is omitted here.
The processor 710 is configured to separate color channels of the first two-dimensional code image, and determine an arrangement rule corresponding to the separated first color channel according to predetermined information;
arranging the color channels according to the arrangement rule corresponding to the first color channel to obtain a second color channel;
synthesizing a second two-dimensional code image according to the second color channel; (ii) a
The radio frequency unit 701 is configured to send the second two-dimensional code image to a second terminal;
wherein the predetermined information includes any one of:
identification information of the first terminal;
identification information, unified clock information and a preset time window of the second terminal; the unified clock is a clock shared by the first terminal and the second terminal.
The electronic equipment provided by the embodiment of the application adopts the corresponding arrangement rule to process through the color channel of the first two-dimensional code image, and synthesizes the second two-dimensional code image according to the processed color channel to send, can realize the encrypted transmission of the first two-dimensional code information, thereby avoiding the safety risk caused by the leakage of the two-dimensional code information, and improving the safety of the two-dimensional code transmission
In one embodiment, the radio frequency unit 701 is further configured to:
and sending the arrangement rule corresponding to the first color channel to the second terminal.
In one embodiment, the processor 710 is further configured to: and determining an arrangement rule corresponding to the first color channel according to the identification information of the second terminal, the unified clock information and the preset time window.
In one embodiment, the processor 710 is further configured to:
determining a current timestamp according to the unified clock information;
determining an arrangement rule of the first color sub-channel according to the identification information of the second terminal, the current timestamp and the preset time window;
determining an arrangement rule of a second color sub-channel according to the arrangement rule of the first color sub-channel;
determining an arrangement rule of a third color sub-channel according to the arrangement rule of the second color sub-channel;
wherein the first color channel includes the first color sub-channel, the second color sub-channel, and the third color sub-channel.
In one embodiment, the processor 710 is further configured to:
determining an arrangement rule of a first color subchannel according to the identification information of the first terminal;
determining an arrangement rule of a second color sub-channel according to the arrangement rule of the first color sub-channel;
determining an arrangement rule of a third color sub-channel according to the arrangement rule of the second color sub-channel;
wherein the first color channel includes the first color sub-channel, the second color sub-channel, and the third color sub-channel.
In one embodiment, the ranking rules include at least one of:
adjusting the gray value of each pixel in the color sub-channel;
translating the gray values of at least part of pixels in the color sub-channels according to the abscissa of the pixels;
and translating the gray values of at least part of pixels in the color sub-channels according to the ordinate of the pixels.
In one embodiment, the radio frequency unit 701 is configured to:
receiving a second two-dimensional code image sent by a first terminal and an arrangement rule corresponding to a first color channel;
the processor 710 is configured to: determining a reverse arrangement rule of the first color channel according to the arrangement rule corresponding to the first color channel;
decoding the second two-dimensional code image according to the reverse arrangement rule of the first color channel to obtain a first two-dimensional code corresponding to the second two-dimensional code;
and displaying the first two-dimensional code image.
The electronic equipment provided by the embodiment of the application can realize encrypted transmission of the first two-dimensional code information by receiving the second two-dimensional code image obtained after the color channel of the first two-dimensional code image is processed by adopting the corresponding arrangement rule, thereby avoiding the safety risk caused by leakage of the two-dimensional code information and improving the safety of two-dimensional code transmission.
It should be understood that in the embodiment of the present application, the input Unit 704 may include a Graphics Processing Unit (GPU) 7041 and a microphone 7042, and the Graphics Processing Unit 7041 processes image data of still pictures or videos obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The display unit 706 may include a display panel 7061, and the display panel 7061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 707 includes a touch panel 7071 and other input devices 7072. The touch panel 7071 is also referred to as a touch screen. The touch panel 7071 may include two parts of a touch detection device and a touch controller. Other input devices 7072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail herein. Memory 709 may be used to store software programs as well as various data, including but not limited to applications and operating systems. Processor 710 may integrate an application processor, which primarily handles operating systems, user interfaces, applications, etc., and a modem processor, which primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into processor 710.
The embodiment of the present application further provides a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or the instruction is executed by a processor, the program or the instruction implements each process of the foregoing two-dimensional code processing method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here.
The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and so on.
The embodiment of the present application further provides a chip, where the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to run a program or an instruction to implement each process of the two-dimensional code processing method embodiment, and can achieve the same technical effect, and in order to avoid repetition, the description is omitted here.
It should be understood that the chips mentioned in the embodiments of the present application may also be referred to as system-on-chip, system-on-chip or system-on-chip, etc.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Further, it should be noted that the scope of the methods and apparatus of the embodiments of the present application is not limited to performing the functions in the order illustrated or discussed, but may include performing the functions in a substantially simultaneous manner or in a reverse order based on the functions involved, e.g., the methods described may be performed in an order different than that described, and various steps may be added, omitted, or combined. In addition, features described with reference to certain examples may be combined in other examples.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may 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 instructions for enabling a terminal (such as a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present application.
While the present embodiments have been described with reference to the accompanying drawings, the present embodiments are not limited to the above embodiments, which are merely illustrative and not restrictive, and those skilled in the art can now make various changes and modifications without departing from the spirit and scope of the present invention.

Claims (14)

1. A two-dimension code processing method is applied to a first terminal and is characterized by comprising the following steps:
separating color channels of the first two-dimensional code image, and determining an arrangement rule corresponding to the separated first color channels according to preset information;
arranging the color channels according to the arrangement rule corresponding to the first color channel to obtain a second color channel;
synthesizing a second two-dimensional code image according to the second color channel;
sending the second two-dimensional code image to a second terminal;
wherein the predetermined information includes any one of:
identification information of the first terminal; identification information, unified clock information and a preset time window of the second terminal; the unified clock is a clock shared by the first terminal and the second terminal.
2. The two-dimensional code processing method according to claim 1, wherein in a case that the predetermined information includes identification information of the second terminal, unified clock information, and a preset time window, the determining, according to the predetermined information, an arrangement rule corresponding to the separated first color channel includes:
and determining an arrangement rule corresponding to the first color channel according to the identification information of the second terminal, the unified clock information and the preset time window.
3. The two-dimensional code processing method according to claim 2, wherein the determining an arrangement rule corresponding to the first color channel according to the identification information of the second terminal, the unified clock information, and a preset time window includes:
determining a current timestamp according to the unified clock information;
determining an arrangement rule of the first color sub-channel according to the identification information of the second terminal, the current timestamp and the preset time window;
determining an arrangement rule of a second color sub-channel according to the arrangement rule of the first color sub-channel;
determining an arrangement rule of a third color sub-channel according to the arrangement rule of the second color sub-channel;
wherein the first color channel includes the first color sub-channel, the second color sub-channel, and the third color sub-channel.
4. The two-dimensional code processing method according to claim 1, wherein in a case that the predetermined information includes identification information of the first terminal, the determining, according to the predetermined information, an arrangement rule corresponding to the separated first color channel includes:
determining an arrangement rule of a first color subchannel according to the identification information of the first terminal;
determining an arrangement rule of a second color sub-channel according to the arrangement rule of the first color sub-channel;
determining an arrangement rule of a third color sub-channel according to the arrangement rule of the second color sub-channel;
wherein the first color channel includes the first color sub-channel, the second color sub-channel, and the third color sub-channel.
5. The two-dimensional code processing method according to any one of claims 1 to 4, wherein the arrangement rule includes at least one of:
adjusting the gray value of each pixel in the color sub-channel;
translating the gray values of at least part of pixels in the color sub-channels according to the abscissa of the pixels;
and translating the gray values of at least part of pixels in the color sub-channels according to the ordinate of the pixels.
6. A two-dimension code processing method is applied to a second terminal and is characterized by comprising the following steps:
receiving a second two-dimensional code image sent by a first terminal and an arrangement rule corresponding to a first color channel, and determining a reverse arrangement rule of the first color channel according to the arrangement rule corresponding to the first color channel;
decoding the second two-dimensional code image according to the reverse arrangement rule of the first color channel to obtain a first two-dimensional code corresponding to the second two-dimensional code;
and displaying the first two-dimensional code image.
7. The utility model provides a two-dimensional code processing apparatus, is applied to first terminal, its characterized in that includes:
the rule determining module is used for separating color channels of the first two-dimensional code image and determining an arrangement rule corresponding to the separated first color channel according to preset information;
the channel processing module is used for arranging the color channels according to the arrangement rule corresponding to the first color channel to obtain a second color channel;
the two-dimensional code synthesis module is used for synthesizing a second two-dimensional code image according to the second color channel;
the sending module is used for sending the second two-dimensional code image to a second terminal;
wherein the predetermined information includes any one of:
identification information of the first terminal;
identification information, unified clock information and a preset time window of the second terminal; the unified clock is a clock shared by the first terminal and the second terminal.
8. The device according to claim 7, wherein in a case that the predetermined information includes identification information of the second terminal, unified clock information, and a preset time window, the rule determining module is specifically configured to:
and determining a processing rule corresponding to the first color channel according to the identification information of the second terminal, the unified clock information and the preset time window.
9. The two-dimensional code processing device according to claim 8, wherein the rule determining module is specifically configured to:
determining a current timestamp according to the unified clock information;
determining an arrangement rule of the first color sub-channel according to the identification information of the second terminal, the current timestamp and the preset time window;
determining an arrangement rule of a second color sub-channel according to the arrangement rule of the first color sub-channel;
determining an arrangement rule of a third color sub-channel according to the arrangement rule of the second color sub-channel;
wherein the first color channel includes the first color sub-channel, the second color sub-channel, and the third color sub-channel.
10. The two-dimensional code processing apparatus according to claim 7, wherein in a case that the predetermined information includes identification information of the first terminal, the rule determining module is specifically configured to:
determining an arrangement rule of a first color subchannel according to the identification information of the first terminal;
determining an arrangement rule of a second color sub-channel according to the arrangement rule of the first color sub-channel;
determining an arrangement rule of a third color sub-channel according to the arrangement rule of the second color sub-channel;
wherein the first color channel includes the first color sub-channel, the second color sub-channel, and the third color sub-channel.
11. The two-dimensional code processing apparatus according to any one of claims 7 to 10, wherein the arrangement rule includes at least one of:
adjusting the gray value of each pixel in the color sub-channel;
translating the gray values of at least part of pixels in the color sub-channels according to the abscissa of the pixels;
and translating the gray values of at least part of pixels in the color sub-channels according to the ordinate of the pixels.
12. The utility model provides a two-dimensional code processing apparatus, is applied to the second terminal, its characterized in that includes:
the rule determining module is used for receiving a second two-dimensional code image sent by a first terminal and an arrangement rule corresponding to a first color channel, and determining a reverse arrangement rule of the first color channel according to the arrangement rule corresponding to the first color channel;
the decoding module is used for decoding the second two-dimensional code image according to the reverse arrangement rule of the first color channel to obtain a first two-dimensional code corresponding to the second two-dimensional code;
and the display module is used for displaying the first two-dimensional code image.
13. An electronic device comprising a processor, a memory, and a program or instructions stored on the memory and executable on the processor, the program or instructions, when executed by the processor, implementing the steps of the two-dimensional code processing method according to any one of claims 1 to 5, or implementing the steps of the two-dimensional code processing method according to claim 6.
14. A readable storage medium, characterized in that the readable storage medium stores thereon a program or instructions which, when executed by a processor, implement the steps of the two-dimensional code processing method according to any one of claims 1 to 5, or implement the steps of the two-dimensional code processing method according to claim 6.
CN202110969699.2A 2021-08-23 2021-08-23 Two-dimensional code processing method and device and electronic equipment Active CN113691528B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110969699.2A CN113691528B (en) 2021-08-23 2021-08-23 Two-dimensional code processing method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110969699.2A CN113691528B (en) 2021-08-23 2021-08-23 Two-dimensional code processing method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN113691528A true CN113691528A (en) 2021-11-23
CN113691528B CN113691528B (en) 2023-06-27

Family

ID=78581566

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110969699.2A Active CN113691528B (en) 2021-08-23 2021-08-23 Two-dimensional code processing method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN113691528B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103646264A (en) * 2013-11-06 2014-03-19 杭州电子科技大学 Multiple information encrypted two-dimensional code anti-counterfeiting method
JP2014071721A (en) * 2012-09-28 2014-04-21 Denso Wave Inc Confirmation system
CN104463766A (en) * 2014-11-18 2015-03-25 哈尔滨理工大学 QR code encrypting and decrypting method based on ECA state ring
CN108197489A (en) * 2017-12-28 2018-06-22 上海传英信息技术有限公司 A kind of processing method and processing unit for intelligent terminal secret file
AU2018204424A1 (en) * 2017-06-20 2019-01-17 LIND, Andrew Grant MR System and methods for authentication and/or identification
CN109840574A (en) * 2019-01-16 2019-06-04 王诗会 A kind of hidden method of two-dimensional barcode information, device, electronic equipment and storage medium
CN109978111A (en) * 2019-03-13 2019-07-05 杭州百伴生物技术有限公司 Matrix two-dimensional code, its generation, coding/decoding method and its equipment
CN111428532A (en) * 2020-03-17 2020-07-17 镇江市高等专科学校 Encryptable three-dimensional code and encoding and decoding method
CN112950219A (en) * 2021-03-09 2021-06-11 支付宝(杭州)信息技术有限公司 Payment processing method and system

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014071721A (en) * 2012-09-28 2014-04-21 Denso Wave Inc Confirmation system
CN103646264A (en) * 2013-11-06 2014-03-19 杭州电子科技大学 Multiple information encrypted two-dimensional code anti-counterfeiting method
CN104463766A (en) * 2014-11-18 2015-03-25 哈尔滨理工大学 QR code encrypting and decrypting method based on ECA state ring
AU2018204424A1 (en) * 2017-06-20 2019-01-17 LIND, Andrew Grant MR System and methods for authentication and/or identification
CN108197489A (en) * 2017-12-28 2018-06-22 上海传英信息技术有限公司 A kind of processing method and processing unit for intelligent terminal secret file
CN109840574A (en) * 2019-01-16 2019-06-04 王诗会 A kind of hidden method of two-dimensional barcode information, device, electronic equipment and storage medium
CN109978111A (en) * 2019-03-13 2019-07-05 杭州百伴生物技术有限公司 Matrix two-dimensional code, its generation, coding/decoding method and its equipment
CN111428532A (en) * 2020-03-17 2020-07-17 镇江市高等专科学校 Encryptable three-dimensional code and encoding and decoding method
CN112950219A (en) * 2021-03-09 2021-06-11 支付宝(杭州)信息技术有限公司 Payment processing method and system

Also Published As

Publication number Publication date
CN113691528B (en) 2023-06-27

Similar Documents

Publication Publication Date Title
EP3040967A1 (en) Color adjustment method and device
US11410342B2 (en) Method for adding special effect to video, electronic device and storage medium
CN113691816A (en) Image display method, image display device, display equipment and storage medium
CN113126862A (en) Screen capture method and device, electronic equipment and readable storage medium
CN113721876A (en) Screen projection processing method and related equipment
CN114449503A (en) Bluetooth connection method and Bluetooth connection device
WO2024088132A1 (en) Target-image display method and display apparatus, and electronic device and storage medium
CN112969088A (en) Screen projection control method and device, electronic equipment and readable storage medium
CN112199149A (en) Interface rendering method and device and electronic equipment
CN110190947B (en) Information encryption and decryption method, terminal and computer readable storage medium
US20230214963A1 (en) Data processing method and apparatus, and electronic device
CN117115287A (en) Image generation method, device, electronic equipment and readable storage medium
CN113691528B (en) Two-dimensional code processing method and device and electronic equipment
CN113364915B (en) Information display method and device and electronic equipment
CN112104785B (en) Information display method and device
CN114285956A (en) Video sharing circuit, method and device and electronic equipment
CN113810675B (en) Image processing method, device, equipment and storage medium
CN113835820A (en) Graphic code display method and device
CN113965640A (en) Message processing method and device
CN113038179A (en) Video encoding method, video decoding method, video encoding device, video decoding device and electronic equipment
CN112511890A (en) Video image processing method and device and electronic equipment
CN101546221A (en) Method, device and system for data processing
CN112947876B (en) Display control method, display control device, electronic device, and medium
CN115103054B (en) Information processing method, device, electronic equipment and medium
CN113162927B (en) Data transmission method, sending terminal, receiving terminal and electronic equipment

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