CN113691528B - 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
CN113691528B
CN113691528B CN202110969699.2A CN202110969699A CN113691528B CN 113691528 B CN113691528 B CN 113691528B CN 202110969699 A CN202110969699 A CN 202110969699A CN 113691528 B CN113691528 B CN 113691528B
Authority
CN
China
Prior art keywords
channel
terminal
dimensional code
color
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.)
Active
Application number
CN202110969699.2A
Other languages
Chinese (zh)
Other versions
CN113691528A (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

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 the color channels of the first two-dimensional code image, and determining the 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; transmitting the second two-dimensional code image to a second terminal; the predetermined information includes any one of the following: identification information of the first terminal; identification information of the second terminal, unified clock information and a preset time window; 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 often 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 assisted party. If the assisting party leaks the two-dimension code unintentionally or the two-dimension code picture is intercepted by a person in the transmission process, user information and property security risks are easily caused.
Therefore, how to provide a method capable of avoiding two-dimensional code information leakage in the transmission process has very important significance.
Disclosure of Invention
The embodiment of the application aims to provide a two-dimensional code processing method, a device and electronic equipment, which can overcome the defect that the two-dimensional code information leakage in the prior art causes safety risks.
In a first aspect, an embodiment of the present application provides a two-dimensional code processing method, which is applied to a first terminal, where the method includes:
separating the color channels of the first two-dimensional code image, and determining the 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;
transmitting the second two-dimensional code image to a second terminal;
the predetermined information includes any one of the following:
identification information of the first terminal;
identification information of the second terminal, unified clock information and a preset time window; 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, where 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 the 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;
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 of the second terminal, unified clock information and a preset time window; 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 the first terminal and an arrangement rule corresponding to the 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, embodiments of the present application provide an electronic device comprising a processor, a memory and a program or instruction stored on the memory and executable on the processor, the program or instruction implementing the steps of the method according to the first or second aspect when executed by the processor.
In a sixth aspect, embodiments of the present application provide a readable storage medium having stored thereon a program or instructions which, when executed by a processor, implement the steps of the method according to the first or second aspect.
In a seventh aspect, embodiments of the present application provide a chip, where the chip includes a processor and a communication interface, where the communication interface is coupled to the processor, and where the processor is configured to execute a program or instructions to implement the steps of the method according to the first or second aspect.
According to the two-dimensional code processing method, the two-dimensional code processing device and the electronic equipment, the color channels of the first two-dimensional code image are processed by adopting the corresponding processing rules, the second two-dimensional code image is synthesized according to the processed color channels to be sent, encryption transmission of the first two-dimensional code information can be achieved, so that safety risks caused by two-dimensional code information leakage are avoided, and the safety of two-dimensional code transmission is improved.
Drawings
Fig. 1 is one of flow diagrams of a two-dimensional code processing method provided in 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 flow chart of a two-dimensional code processing method according to an embodiment of the present disclosure;
fig. 4 is one of schematic structural diagrams of a two-dimensional code processing apparatus provided in an embodiment of the present application;
FIG. 5 is a second schematic 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 schematic diagram of a hardware structure of an electronic device implementing an embodiment of the present application.
Detailed Description
Technical solutions in the embodiments of the present application will be clearly described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application are within the scope of the protection of the present application.
The terms first, second and the like in the description and in the claims, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged, as appropriate, such that embodiments of the present application may be implemented in sequences other than those illustrated or described herein, and that the objects identified by "first," "second," etc. are generally of a type and not limited to the number of objects, e.g., the first object may be one or more. Furthermore, in the description and claims, "and/or" means at least one of the connected objects, and the character "/", generally means that the associated object is an "or" relationship.
The method, the device and the electronic equipment for processing the two-dimensional code provided by the embodiment of the application are described in detail through specific embodiments and application scenes thereof with reference to the accompanying drawings.
Fig. 1 is a schematic flow chart 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 the 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;
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 of the second terminal, unified clock information and a preset time window; the unified clock is a clock shared by the first terminal and the second terminal.
It should be noted that, the execution body of the two-dimensional code processing method provided in the embodiment of the present application may be the first terminal. The first terminal may be an intelligent electronic device, such as a cell phone, tablet computer, notebook computer, palm computer, vehicle mounted electronic device, wearable device, ultra-mobile personal computer (UMPC), netbook or personal digital assistant (personal digital assistant, PDA), etc. The second terminal and the first terminal may be the same type of terminal, for example, the second terminal and the first terminal may be both mobile phones. The second terminal may also be a different type of terminal than the first terminal, for example the second terminal may be a PC and the first terminal may be a mobile phone.
The application scenario of the two-dimensional code processing method provided by the embodiment of the application may be, for example, a scenario in which the first terminal and the second terminal perform remote assistance: the first terminal may be assisted by the second terminal as an assisted party. In this scenario, the first terminal may process the first two-dimensional code according to the two-dimensional code processing method provided in 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 currently transmitted image has a two-dimensional code.
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 recognizes 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 channels 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, so as to obtain a second color channel.
After the second color channel is obtained, the first terminal can 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, a third party cannot restore the second two-dimensional code image to the first two-dimensional code image, so that the information of the first two-dimensional code cannot be obtained.
According to the two-dimensional code processing method, the color channels of the first two-dimensional code image are processed by adopting the corresponding arrangement rules, the second two-dimensional code image is synthesized according to the processed color channels to be sent, encryption 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 where 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 can send the arrangement rule corresponding to the first color channel to the second terminal.
For example, when the first terminal sends the second two-dimensional code to the second terminal, the first terminal may send the arrangement rule corresponding to the first color channel 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 encrypted or unencrypted message.
The transmission timing and the transmission 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 perform reverse processing on the received second two-dimensional code image according to the arrangement rule corresponding to the first color channel so as to restore the received second two-dimensional code image to obtain the first two-dimensional code image, thereby performing operations such as remote assistance and the like according to the first two-dimensional code image.
According to the two-dimensional code processing method, under the condition that the arrangement rule corresponding to each color channel is determined according to the identification information of the first terminal, the arrangement rule corresponding to the first color channel is sent to the second terminal, the second terminal can restore to obtain the first two-dimensional code image according to the arrangement rule corresponding to the first color channel, and therefore smooth operation such as remote assistance is guaranteed.
It should be noted that, for the color channel of the two-dimensional code, it may be generally 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 arrangement rules may include at least one of:
the arrangement rule A adjusts the gray value of each pixel in the color sub-channel;
for example, the gray value for a pixel in the red subchannel may be expressed as R (x, y), and the adjusted gray value for that pixel may be expressed as
Figure BDA0003225195890000071
Then:
Figure BDA0003225195890000072
wherein x is the abscissa of the pixel; y is the ordinate of the pixel; 255 is a preset gray value; max (R) represents the maximum value among the gradation values of the pixels in the red sub-channel.
As can be seen from the formula (1), the gray value of each pixel in the color sub-channel is adjusted by selecting a smaller value from the preset gray value and the maximum value of the gray values of each pixel, and subtracting the smaller value from the gray value of the pixel to obtain the adjusted gray value of the pixel. The specific size of the preset gray value can be adjusted according to actual situations, which is not particularly limited in the embodiment of the present application.
The adjustment rule of the gray values of the pixels in the other color sub-channels is the same as that described above, and will not be described here again.
Arranging rule B, translating gray values of at least part of pixels in the color sub-channels according to the abscissa of the pixels;
for example, the gray value for a pixel in the red subchannel may be expressed as R (x, y), and the gray value for the pixel translated according to the abscissa may be expressed as
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 (w) 0 Is an initial random value, and w 0 ∈[0,w]。
As can be seen from equation (2), rule B is to translate the gray value of at least some pixels according to the abscissa of the pixels, i.e. translate the gray value of the original pixel along the abscissa onto other pixels. Wherein the specific number of partial pixels is defined by the width w of the first two-dimensional code and the initial random value w 0 And (5) determining. Initial random value w 0 The specific size of (c) may be adjusted according to actual needs, which is not specifically limited in the embodiment of the present application.
And (3) arranging rule C, and translating gray values of at least part of pixels in the color sub-channels according to the ordinate of the pixels.
For example, the gray value for a pixel in the red subchannel may be expressed as R (x, y), and the gray value for the pixel translated according to the ordinate may be expressed as
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 is a 0 Is an initial random value, and h 0 ∈[0,h]。
From equation (3), it can be seen thatRule C is to translate the gray value of at least some pixels along the ordinate of the pixel, i.e. translate the gray value of the original pixel along the ordinate onto other pixels. Wherein the specific number of partial pixels is defined by the height h of the first two-dimensional code and the initial random value h 0 And (5) determining. Initial random value h 0 The specific size of (c) may be adjusted according to actual needs, which is not specifically limited in the embodiment of the present application.
It should be noted that the arrangement rules may be arbitrarily combined. For example, combining rule B with rule C, rule b+c may be derived:
translating 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 value for a pixel in the red subchannel may be expressed as R (x, y), and the gray value for the pixel translated according to the abscissa and ordinate may be expressed as
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 (w) 0 Is an initial random value, and w 0 ∈[0,w]The method comprises the steps of carrying out a first treatment on the surface of the h is the height of the first two-dimensional code; h is a 0 Is an initial random value, and h 0 ∈[0,h]。
As can be seen from equation (4), the rule b+c is to translate the gray value of at least some pixels according to the ordinate and the abscissa of the pixels, that is, translate the gray value of the original pixel to other pixels along the abscissa and the ordinate.
In one embodiment, in a case where the predetermined information includes identification information of the first terminal, determining, according to the predetermined information, an arrangement rule corresponding to the separated first color channel may include:
determining an arrangement rule of the first color sub-channels according to the identification information of the first terminal;
determining an arrangement rule of the second color sub-channels according to the arrangement rule of the first color sub-channels;
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 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 hashCode is a hash encoding function; the deviceID is the ID of the first terminal; modN is the corresponding relation function of the hash coding function value and the permutation rule number.
As can be seen from equation (5), the ID of the first terminal may be first input into the hash encoding function to determine the hash encoding function value of the first terminal; then, determining a corresponding arrangement rule number N according to the hash coding function value; finally, the arrangement rule of the red sub-channel is the arrangement rule corresponding to the arrangement rule number n+1.
Wherein, mod n can be as shown in the following table:
TABLE 1 one of the corresponding relationship tables of hash code function value and permutation rule number
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 888888888, the hash coding function value of the first terminal ID is calculated by the hash coding function, so that it can be obtained that the hash coding function value of the first terminal ID is 1, N is 0 can be determined by the corresponding relation function mod N of 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 value of each pixel in the red sub-channel is adjusted according to the arrangement rule a.
After determining the arrangement rule of the red sub-channel, the arrangement rule number of the green sub-channel may be determined according to the arrangement rule number of the red sub-channel. For example, the arrangement rule number of the green sub-channels may be g=r+1. Wherein R is the arrangement rule number of the red sub-channels.
After determining the arrangement rule of the green sub-channels, the arrangement rule number of the blue sub-channels may be determined according to the arrangement rule number of the green sub-channels. For example, the arrangement rule number of the blue sub-channel may be b=g+1.
Therefore, when the arrangement rule number of the red sub-channel is 1, the arrangement rule number of the green sub-channel is 2, and the arrangement rule number of the blue sub-channel is 3. Namely, translating the gray values of at least part of pixels in the green sub-channels according to the rule B and 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 and the ordinate of the pixels.
According to the two-dimensional code processing method, the arrangement rule of the first color sub-channels is determined according to the hash coding function and the like based on the identification information of the first terminal, and the arrangement rules of the other color sub-channels are sequentially determined, so that the determination complexity of the arrangement rules of the sub-channels of each color can be effectively improved, the risk of cracking the second two-dimensional code by a third party is reduced, and the safety of two-dimensional code processing is further improved.
In one embodiment, when 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 method comprises the steps of presetting a unified clock and a preset time window which are shared by the first terminal and the second terminal, and then enabling the first terminal and the second terminal to store a method for presetting an 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.
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 prestore the identification information of the second terminal), the first terminal and the second terminal both know the method of 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 unified clock information, the second terminal can also synchronously determine the rule of restoring the first color channel, so as to restore the first two-dimensional code.
According to the two-dimensional code processing method, 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 of the second terminal and the unified clock information, so that the second terminal can synchronously determine the rule for restoring the first color channel, and the restoring 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 safety of two-dimensional code transmission is further improved.
On the basis of the foregoing embodiment, determining, according to the identification information of the second terminal, the unified clock information, and the preset time window, the arrangement rule corresponding to the first color channel may include:
determining a current time stamp according to the unified clock information;
determining an arrangement rule of the first color sub-channels according to the identification information of the second terminal, the current time stamp and a preset time window;
determining an arrangement rule of the second color sub-channels according to the arrangement rule of the first color sub-channels;
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 sub-channel, a green color 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+nowTime/T)modN+1 (6)
wherein hashCode is a hash encoding function; the deviceID is the ID of the second terminal; the nonTime is a current timestamp determined from the unified clock information; t is a preset time window; modN is the corresponding relation function of the hash coding function value and the permutation rule number.
As can be seen from the formula (6), the current timestamp can be determined according to the unified clock information, then 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 then the value of the nonwtime/T is unchanged within 30 s.
Then, the corresponding permutation rule number N may be determined according to the hash code function value.
Finally, the arrangement rule of the red sub-channel is the arrangement rule corresponding to the arrangement rule number n+1.
Wherein, mod n can be as shown in the following table:
TABLE 2 two corresponding relationship tables of hash code function value and permutation rule number
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 the hash coding function value as 1, N can be determined as 0 by the corresponding relation function modN of 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 value of each pixel in the red sub-channel is adjusted according to the arrangement rule a.
After determining the arrangement rule of the red sub-channel, the arrangement rule number of the green sub-channel may be determined according to the arrangement rule number of the red sub-channel. For example, the arrangement rule number of the green sub-channels may be g=r+1. Wherein R is the arrangement rule number of the red sub-channels.
After determining the arrangement rule of the green sub-channels, the arrangement rule number of the blue sub-channels may be determined according to the arrangement rule number of the green sub-channels. For example, the arrangement rule number of the blue sub-channel may be b=g+1.
Therefore, when the arrangement rule number of the red sub-channel is 1, the arrangement rule number of the green sub-channel is 2, and the arrangement rule number of the blue sub-channel is 3. Namely, translating the gray values of at least part of pixels in the green sub-channels according to the rule B and 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 and the ordinate of the pixels.
According to the two-dimensional code processing method, the arrangement rule of the first color sub-channels is determined according to the hash coding function and the like based on the identification information of the first terminal and the unified clock information, and then the arrangement rules of the other color sub-channels are sequentially determined, so that the determination complexity of the arrangement rules of the sub-channels of each color can be effectively improved, the risk of cracking the second two-dimensional code by a third party is reduced, and the safety of two-dimensional code transmission is further improved.
Fig. 3 is a second flowchart of a two-dimensional code processing method according to an embodiment of the present disclosure. 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, the execution body of the two-dimensional code processing method provided in the embodiment of the present application may be the second terminal. The second terminal may be an intelligent electronic device, such as a cell phone, tablet computer, notebook computer, palm computer, car mounted electronic device, wearable device, ultra-mobile personal computer (UMPC), netbook or personal digital assistant (personal digital assistant, PDA), etc. The second terminal and the first terminal may be the same type of terminal, for example, the second terminal and the first terminal may be both mobile phones. The second terminal may also be a different type of terminal than the first terminal, for example the second terminal may be a PC and the first terminal may be a mobile phone.
The application scenario of the two-dimensional code processing method provided by the embodiment of the application may be, for example, a scenario in which the first terminal and the second terminal perform remote assistance: the first terminal may be assisted by the second terminal as an assisted party. In this scenario, the first terminal may process the first two-dimensional code according to the two-dimensional code processing method provided in 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 a second two-dimensional code image sent by the first terminal and an arrangement rule corresponding to the first color channel.
The second two-dimensional code image is formed by separating color channels of the first two-dimensional code image by the first terminal, determining an arrangement rule corresponding to the first color channels of the first two-dimensional code image according to preset information, and determining according to the arrangement rule corresponding to the first color channels.
Wherein the predetermined information may include any one of the following:
identification information of the first terminal;
identification information of the second terminal, unified clock information and a preset time window; 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 embodiment described above, and will not be described herein.
After the first terminal processes the first color channels according to the arrangement rules corresponding to the color channels to determine the second two-dimensional code image, the first terminal can send the arrangement rules corresponding to the first color channels to the second terminal, and the second terminal can receive the arrangement rules corresponding to the first color channels sent by the first terminal.
For example, the second terminal may receive the arrangement rule corresponding to the first color channel while receiving the second two-dimensional code sent by the first terminal. 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 an individual 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 timing and receiving manner 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-channels in the first color channel is the arrangement rule b+c, after the second terminal receives the arrangement rule corresponding to the red sub-channels sent by the first terminal, it can be determined that the reverse arrangement rule of the corresponding red sub-channels 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 as to obtain a first two-dimensional code corresponding to the second two-dimensional code.
According to the two-dimensional code processing method, under the condition that the arrangement rule corresponding to the first color channel is determined according to the identification information of the first terminal, the arrangement rule corresponding to the first color channel is received, so that the second terminal can restore to obtain 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 may send the identification information of the second terminal to the first terminal when 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 that are common to the first terminal and the second terminal may be preset, and then the first terminal and the second terminal may be caused to store a method of preliminarily storing an arrangement rule for determining the first color channel corresponding to the identification information, the unified clock information, and the preset time window of the second terminal. Thus, 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 unified 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.
For example, when the first terminal determines that the arrangement rule of the red sub-channels 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-channels is B through the identification information, the unified clock information and the preset time window of the second terminal at the same time, thereby determining the reverse arrangement rule of the corresponding red sub-channels
Figure BDA0003225195890000151
Figure BDA0003225195890000152
Then, the second terminal can decode the second two-dimensional code image according to the determined reverse arrangement rule of the first color channel, so as to obtain a first two-dimensional code corresponding to the second two-dimensional code.
According to the two-dimensional code processing method, 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, and therefore the first two-dimensional code can be restored under the condition that the arrangement rule corresponding to the first color channel is not sent, and the safety of two-dimensional code transmission 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, according to the two-dimensional code processing method provided by the embodiment of the application, 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, the encryption transmission of the first two-dimensional code information can be realized, so that the security risk caused by the leakage of the two-dimensional code information is avoided, and the security of the two-dimensional code transmission is improved.
It should be noted that, in the two-dimensional code processing method provided in the embodiment of the present application, the execution subject may be a two-dimensional code processing apparatus, or a control module in the two-dimensional code processing apparatus for executing the two-dimensional code processing method. In the embodiment of the application, a two-dimensional code processing device is taken as an example to execute a two-dimensional code processing method, and the two-dimensional code processing device provided in the embodiment of the application is described.
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, so as to obtain a second color channel;
The two-dimensional code synthesis 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 of the second terminal, unified clock information and a preset time window; the unified clock is a clock shared by the first terminal and the second terminal.
According to the two-dimensional code processing device, the color channels of the first two-dimensional code image are processed by adopting the corresponding arrangement rules, the second two-dimensional code image is synthesized according to the processed color channels to be sent, encryption transmission of initial 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 one embodiment, in the 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 one embodiment, in the case that the predetermined information includes the identification information of the second terminal, the unified clock information, and the 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 determination module 410 is specifically configured to:
determining a current time stamp according to the unified clock information;
determining an arrangement rule of a first color sub-channel according to the identification information of the second terminal, the current time stamp 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, in the case that 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 sub-channel 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 arrangement rule includes at least one of:
adjusting the gray value of each pixel in the color sub-channel;
translating gray values of at least part of pixels in the color sub-channels according to the abscissa of the pixels;
and translating the gray scale value 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 application may be a device, or may be a component, an integrated circuit, or a chip in a terminal. The device may be a mobile electronic device or a non-mobile electronic device. By way of example, the mobile electronic device may be a cell phone, tablet computer, notebook computer, palm computer, vehicle-mounted electronic device, wearable device, ultra-mobile personal computer (ultra-mobile personal computer, UMPC), netbook or personal digital assistant (personal digital assistant, PDA), etc., and the non-mobile electronic device may be a server, network attached storage (Network Attached Storage, NAS), personal computer (personal computer, PC), television (TV), teller machine or self-service machine, etc., and the embodiments of the present application are not limited in particular.
The two-dimensional code processing device in the embodiment of the application may be a device with an operating system. The operating system may be an Android operating system, an ios operating system, or other possible operating systems, which are not specifically limited in the embodiments of the present application.
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 in order to avoid repetition, a detailed description is omitted here.
Fig. 5 is a second schematic structural diagram of the two-dimensional code processing apparatus according to the 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:
the rule determining module 510 is configured to receive a second two-dimensional code image sent by the 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, so as to obtain a first two-dimensional code corresponding to the second two-dimensional code;
a display module 530 for displaying the first two-dimensional code image.
According to the two-dimensional code processing device, 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 is received, so that the encryption transmission of the first two-dimensional code information can be realized, the safety risk caused by the leakage of the two-dimensional code information is avoided, and the safety of the two-dimensional code transmission is improved.
The two-dimensional code processing device in the embodiment of the application may be a device, or may be a component, an integrated circuit, or a chip in a terminal. The device may be a mobile electronic device or a non-mobile electronic device. By way of example, the mobile electronic device may be a cell phone, tablet computer, notebook computer, palm computer, vehicle-mounted electronic device, wearable device, ultra-mobile personal computer (ultra-mobile personal computer, UMPC), netbook or personal digital assistant (personal digital assistant, PDA), etc., and the non-mobile electronic device may be a server, network attached storage (Network Attached Storage, NAS), personal computer (personal computer, PC), television (TV), teller machine or self-service machine, etc., and the embodiments of the present application are not limited in particular.
The two-dimensional code processing device in the embodiment of the application may be a device with an operating system. The operating system may be an Android operating system, an ios operating system, or other possible operating systems, which are not specifically limited in the embodiments of the present application.
The two-dimensional code processing device provided in the embodiment of the present application can implement each process implemented by the method embodiment of fig. 3, and in order to avoid repetition, a detailed description is omitted here.
Optionally, as shown in fig. 6, the embodiment of the present application further provides an electronic device 600, including a processor 601, a memory 602, and a program or an instruction stored in the memory 602 and capable of running on the processor 601, where the program or the instruction implements each process of the above two-dimensional code processing method embodiment when executed by the processor 601, and the process can achieve the same technical effect, so that repetition is avoided and no further description is given here.
The electronic device in the embodiment of the application includes the mobile electronic device and the non-mobile electronic device described above.
Fig. 7 is a schematic hardware structure of an electronic device implementing an embodiment of the present application.
The electronic device 700 includes, but is not limited to: radio frequency unit 701, network module 702, audio output unit 703, input unit 704, sensor 705, display unit 706, user input unit 707, interface unit 708, memory 709, and processor 710.
Those skilled in the art will appreciate that the electronic device 700 may also include a power source (e.g., a battery) for powering the various components, which may be logically connected to the processor 710 via a power management system so as to perform functions such as managing charge, discharge, and power consumption 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 shown, or may combine certain components, or may be arranged in different components, which are not described in detail herein.
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 channels 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; the method comprises the steps of carrying out a first treatment on the surface of the
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 of the second terminal, unified clock information and a preset time window; the unified clock is a clock shared by the first terminal and the second terminal.
According to the electronic device provided by the embodiment of the application, the color channels of the first two-dimensional code image are processed by adopting the corresponding arrangement rules, and the second two-dimensional code image is synthesized according to the processed color channels to be sent, so that the encryption transmission of the first two-dimensional code information can be realized, the safety risk caused by the leakage of the two-dimensional code information is avoided, and the safety of the two-dimensional code transmission is improved
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 time stamp according to the unified clock information;
determining an arrangement rule of a first color sub-channel according to the identification information of the second terminal, the current time stamp 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 sub-channel 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 arrangement rule includes at least one of:
adjusting the gray value of each pixel in the color sub-channel;
translating gray values of at least part of pixels in the color sub-channels according to the abscissa of the pixels;
and translating the gray scale value 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.
According to the electronic device, 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 is received, so that the encryption transmission of the first two-dimensional code information can be realized, the safety risk caused by the leakage of the two-dimensional code information is avoided, and the safety of the two-dimensional code transmission is improved.
It should be appreciated that in embodiments of the present application, the input unit 704 may include a graphics processor (Graphics Processing Unit, GPU) 7041 and a microphone 7042, with the graphics processor 7041 processing image data of still pictures or video 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, 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, a joystick, and so forth, 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, application programs and an operating system. The processor 710 may integrate an application processor that primarily processes operating systems, user interfaces, applications, etc., with a modem processor that primarily processes wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 710.
The embodiment of the application further provides a readable storage medium, on which a program or an instruction is stored, where the program or the instruction realizes each process of the embodiment of the two-dimensional code processing method when executed by a processor, and the same technical effect can be achieved, so that repetition is avoided, and no detailed description is given here.
Wherein the processor is a 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 (Random Access Memory, RAM), a magnetic disk or an optical disk, and the like.
The embodiment of the application further provides a chip, the chip includes a processor and a communication interface, the communication interface is coupled with the processor, the processor is used for running a program or an instruction, implementing each process of the two-dimensional code processing method embodiment, and achieving the same technical effect, so as to avoid repetition, and no redundant description is provided herein.
It should be understood that the chips referred to in the embodiments of the present application may also be referred to as system-on-chip chips, chip systems, or system-on-chip chips, 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 one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Furthermore, it should be noted that the scope of the methods and apparatus in the embodiments of the present application is not limited to performing the functions in the order shown or discussed, but may also include performing the functions in a substantially simultaneous manner or in an opposite order depending on the functions involved, e.g., the described methods may be performed in an order different from that described, and various steps may also be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solutions of the present application may be embodied essentially or in a part contributing to the prior art in the form of a computer software product stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), comprising several instructions for causing a terminal (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the methods described in the embodiments of the present application.
The embodiments of the present application have been described above with reference to the accompanying drawings, but the present application is not limited to the above-described embodiments, which are merely illustrative, not restrictive, and many forms may be made by those of ordinary skill in the art without departing from the spirit of the present application and the scope of the claims, which are all within the scope of the present application.

Claims (14)

1. The two-dimensional code processing method is applied to a first terminal and is characterized by comprising the following steps:
separating the color channels of the first two-dimensional code image, and determining the 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;
transmitting 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 of the second terminal, unified clock information and a preset time window; 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 the 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 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 includes:
determining a current time stamp according to the unified clock information;
determining an arrangement rule of a first color sub-channel according to the identification information of the second terminal, the current time stamp 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 the case where 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 sub-channel 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 claim 3 or 4, wherein the arrangement rule includes at least one of:
adjusting the gray value of each pixel in the color sub-channel; the color sub-channel includes any one of the first color sub-channel, the second color sub-channel, and the third color sub-channel;
translating gray values of at least part of pixels in the color sub-channels according to the abscissa of the pixels;
and translating the gray scale value of at least part of pixels in the color sub-channels according to the ordinate of the pixels.
6. The two-dimensional 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;
displaying a first two-dimensional code image;
wherein, the arrangement rule corresponding to the first color channel is determined according to preset information;
the predetermined information includes any one of the following:
identification information of the first terminal;
the identification information, the unified clock information and the preset time window of the second terminal; the unified clock is a clock shared by the first terminal and the second terminal.
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 the 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;
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 of the second terminal, unified clock information and a preset time window; the unified clock is a clock shared by the first terminal and the second terminal.
8. The two-dimensional code processing apparatus according to claim 7, wherein in the case where 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 apparatus according to claim 8, wherein the rule determining module is specifically configured to:
determining a current time stamp according to the unified clock information;
determining an arrangement rule of a first color sub-channel according to the identification information of the second terminal, the current time stamp 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 the case where the predetermined information includes identification information of the first terminal, the rule determination module is specifically configured to:
determining an arrangement rule of a 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 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 claim 9 or 10, wherein the arrangement rule includes at least one of:
adjusting the gray value of each pixel in the color sub-channel; the color sub-channel includes any one of the first color sub-channel, the second color sub-channel, and the third color sub-channel;
Translating gray values of at least part of pixels in the color sub-channels according to the abscissa of the pixels;
and translating the gray scale value 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, which characterized in that includes:
the rule determining module is used for receiving a second two-dimensional code image sent by the first terminal and an arrangement rule corresponding to the 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;
the display module is used for displaying the first two-dimensional code image;
wherein, the arrangement rule corresponding to the first color channel is determined according to preset information;
the predetermined information includes any one of the following:
identification information of the first terminal;
the identification information, the unified clock information and the preset time window of the second terminal; the unified clock is a clock shared by the first terminal and the second terminal.
13. An electronic device comprising a processor, a memory, and a program or instruction stored on the memory and executable on the processor, the program or instruction 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 the steps of the two-dimensional code processing method according to claim 6.
14. A readable storage medium, wherein a program or an instruction is stored on the readable storage medium, which when executed by a processor, implements the steps of the two-dimensional code processing method according to any one of claims 1 to 5, or implements 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 CN113691528A (en) 2021-11-23
CN113691528B true 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 (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU2018204424A1 (en) * 2017-06-20 2019-01-17 LIND, Andrew Grant MR System and methods for authentication and/or identification
CN112950219A (en) * 2021-03-09 2021-06-11 支付宝(杭州)信息技术有限公司 Payment processing method and system

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5920148B2 (en) * 2012-09-28 2016-05-18 株式会社デンソーウェーブ Confirmation system
CN103646264B (en) * 2013-11-06 2016-07-06 杭州电子科技大学 A kind of dimension code anti-counterfeit method of multiple information encryption
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
CN109840574B (en) * 2019-01-16 2022-05-17 王诗会 Two-dimensional code information hiding method and 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
CN111428532B (en) * 2020-03-17 2023-09-29 镇江市高等专科学校 Coding and decoding method capable of encrypting three-dimensional code

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU2018204424A1 (en) * 2017-06-20 2019-01-17 LIND, Andrew Grant MR System and methods for authentication and/or identification
CN112950219A (en) * 2021-03-09 2021-06-11 支付宝(杭州)信息技术有限公司 Payment processing method and system

Also Published As

Publication number Publication date
CN113691528A (en) 2021-11-23

Similar Documents

Publication Publication Date Title
US11102450B2 (en) Device and method of displaying images
US10957004B2 (en) Watermark processing method and device
US8374648B2 (en) Method for performing communication function in wireless terminal
CN110991368B (en) Camera scene recognition method and related device
CN110463206B (en) Image filtering method, device and computer readable medium
US11410342B2 (en) Method for adding special effect to video, electronic device and storage medium
CN111737662A (en) Watermark adding method, watermark extracting method, watermark adding device, watermark extracting device and electronic equipment
US20210319144A1 (en) Information processing system, information processing method, terminal apparatus, and information processing apparatus
CN114449503A (en) Bluetooth connection method and Bluetooth connection device
CN113691816A (en) Image display method, image display device, display equipment and storage medium
CN113691528B (en) Two-dimensional code processing method and device and electronic equipment
CN113721876A (en) Screen projection processing method and related equipment
CN110190947B (en) Information encryption and decryption method, terminal and computer readable storage medium
CN110708494A (en) Video conference display control method, terminal and readable storage medium
CN113438400B (en) Image acquisition method, image acquisition device and electronic equipment
CN113364915B (en) Information display method and device and electronic equipment
CN107315970B (en) Sensitive data interaction method and device
CN109918882B (en) Image encryption method and mobile terminal
CN115701017A (en) Image processing method and device
CN113835820A (en) Graphic code display method and device
CN112947876B (en) Display control method, display control device, electronic device, and medium
CN113988649B (en) Display function testing method of display screen and related device
CN113162927B (en) Data transmission method, sending terminal, receiving terminal and electronic equipment
WO2023125231A1 (en) Loop filtering method and terminal
CN113901009A (en) Multimedia file processing method and device, electronic equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant