Movatterモバイル変換


[0]ホーム

URL:


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
CN113691528BCN202110969699.2ACN202110969699ACN113691528BCN 113691528 BCN113691528 BCN 113691528BCN 202110969699 ACN202110969699 ACN 202110969699ACN 113691528 BCN113691528 BCN 113691528B
Authority
CN
China
Prior art keywords
channel
terminal
color
dimensional code
color sub
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 LtdfiledCriticalVivo Mobile Communication Co Ltd
Priority to CN202110969699.2ApriorityCriticalpatent/CN113691528B/en
Publication of CN113691528ApublicationCriticalpatent/CN113691528A/en
Application grantedgrantedCritical
Publication of CN113691528BpublicationCriticalpatent/CN113691528B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Images

Classifications

Landscapes

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

Translated fromChinese
二维码处理方法、装置及电子设备Two-dimension code processing method, device and electronic equipment

技术领域technical field

本申请属于图像处理技术领域,具体涉及一种二维码处理方法、装置及电子设备。The present application belongs to the technical field of image processing, and in particular relates to a two-dimensional code processing method, device and electronic equipment.

背景技术Background technique

二维码图像通常涉及到个人隐私和财产安全。在远程协助过程中,被协助方通常直接截取二维码图片传输给协助方。若协助方无意泄露二维码,或二维码图片在传输过程中被人截取,容易导致用户信息和财产安全风险。Two-dimensional code images usually involve personal privacy and property security. During the remote assistance process, the assisted party usually directly intercepts the QR code picture and transmits it to the assisting party. If the assisting party discloses the QR code unintentionally, or the QR code image is intercepted during transmission, it may easily lead to user information and property security risks.

因此,如何提出一种方法,能够在传输过程中避免二维码信息泄露,具有十分重要的意义。Therefore, how to propose a method that can avoid information leakage of the two-dimensional code during the transmission process is of great significance.

发明内容Contents of the invention

本申请实施例的目的是提供一种二维码处理方法、装置及电子设备,能够克服现有技术中存在的二维码信息泄露导致安全风险的缺陷。The purpose of the embodiments of the present application is to provide a two-dimensional code processing method, device and electronic equipment, which can overcome the defect in the prior art that information leakage of two-dimensional codes causes security risks.

第一方面,本申请实施例提供了一种二维码处理方法,应用于第一终端,该方法包括:In the first aspect, the embodiment of the present application provides a two-dimensional code processing method, which is applied to the first terminal, and the method includes:

对第一二维码图像的颜色通道进行分离,并根据预定信息确定分离得到的第一颜色通道对应的排列规则;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 predetermined information;

根据所述第一颜色通道对应的排列规则对所述颜色通道进行排列,获得第二颜色通道;arranging the color channels according to an 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 of the following:

第一终端的标识信息;Identification information of the first terminal;

第二终端的标识信息、统一时钟信息以及预设时间窗口;其中,统一时钟为所述第一终端以及所述第二终端共用的时钟。Identification information of the second terminal, unified clock information, and a preset time window; wherein, the unified clock is a clock shared by the first terminal and the second terminal.

第二方面,本申请实施例提供了一种二维码处理方法,应用于第二终端,该方法包括:In a second aspect, the embodiment of the present application provides a method for processing a two-dimensional code, which is applied to a second terminal, and the method includes:

接收第一终端发送的第二二维码图像以及第一颜色通道对应的排列规则,根据所述第一颜色通道对应的排列规则确定第一颜色通道的反向排列规则;receiving the second two-dimensional code image sent by the first terminal and the arrangement rule corresponding to the first color channel, and determining the 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;

显示第一二维码图像。Display the first QR code image.

第三方面,本申请实施例提供了一种二维码处理装置,应用于第一终端,该装置包括:In a third aspect, an embodiment of the present application provides a two-dimensional code processing device, which is applied to a first terminal, and the device includes:

规则确定模块,用于对第一二维码图像的颜色通道进行分离,并根据预定信息确定分离得到的第一颜色通道对应的排列规则;A rule determination module, configured to separate the color channels of the first two-dimensional code image, and determine the arrangement rules corresponding to the separated first color channels according to predetermined information;

通道处理模块,用于根据所述第一颜色通道对应的排列规则对所述颜色通道进行排列,获得第二颜色通道;A channel processing module, configured to arrange the color channels according to the arrangement rule corresponding to the first color channel, to obtain a second color channel;

二维码合成模块,用于根据所述第二颜色通道,合成第二二维码图像;A two-dimensional code synthesis module, configured to synthesize a second two-dimensional code image according to the second color channel;

发送模块,用于将所述第二二维码图像发送至第二终端;a sending module, configured to send the second two-dimensional code image to a second terminal;

其中,所述预定信息包括以下任一项:Wherein, the predetermined information includes any of the following:

第一终端的标识信息;Identification information of the first terminal;

第二终端的标识信息、统一时钟信息以及预设时间窗口;其中,统一时钟为所述第一终端以及所述第二终端共用的时钟。Identification information of the second terminal, unified clock information, and a preset time window; wherein, the unified clock is a clock shared by the first terminal and the second terminal.

第四方面,本申请实施例提供了一种二维码处理装置,应用于第二终端,该装置包括:In a fourth aspect, the embodiment of the present application provides a two-dimensional code processing device, which is applied to a second terminal, and the device includes:

规则确定模块,用于接收第一终端发送的第二二维码图像以及第一颜色通道对应的排列规则,根据所述第一颜色通道对应的排列规则确定第一颜色通道的反向排列规则;A rule determination module, configured to receive the second two-dimensional code image sent by the first terminal and the arrangement rule corresponding to the first color channel, and determine the reverse arrangement rule of the first color channel according to the arrangement rule corresponding to the first color channel;

解码模块,用于根据所述第一颜色通道的反向排列规则对所述第二二维码图像进行解码,获得第二二维码对应的第一二维码;A decoding module, configured to decode the second two-dimensional code image according to the reverse arrangement rule of the first color channel, and obtain the first two-dimensional code corresponding to the second two-dimensional code;

显示模块,用于显示第一二维码图像。The display module is used to display the first two-dimensional code image.

第五方面,本申请实施例提供了一种电子设备,该电子设备包括处理器、存储器及存储在所述存储器上并可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如第一方面或第二方面所述的方法的步骤。In the fifth aspect, the embodiment of the present application provides an electronic device, the electronic device includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, and the program or instruction is executed by The processor implements the steps of the method described in the first aspect or the second aspect when executed.

第六方面,本申请实施例提供了一种可读存储介质,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如第一方面或第二方面所述的方法的步骤。In the sixth aspect, the embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the implementation as described in the first aspect or the second aspect is realized. steps of the method.

第七方面,本申请实施例提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现如第一方面或第二方面所述的方法的步骤。In the seventh aspect, the embodiment of the present application provides a chip, the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is used to run programs or instructions, so as to implement the first aspect Or the steps of the method described in the second aspect.

本申请实施例提供的二维码处理方法、装置及电子设备,通过对第一二维码图像的颜色通道采用对应的处理规则进行处理,并根据处理后的颜色通道合成第二二维码图像进行发送,可以实现对第一二维码信息的加密传输,从而避免二维码信息泄露导致的安全风险,提高了二维码传输的安全性。The two-dimensional code processing method, device and electronic equipment provided in the embodiments of the present application process the color channels of the first two-dimensional code image using corresponding processing rules, and synthesize the second two-dimensional code image according to the processed color channels Sending can realize the encrypted transmission of the first 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.

附图说明Description of drawings

图1是本申请实施例提供的二维码处理方法的流程示意图之一;Fig. 1 is one of the schematic flow charts of the two-dimensional code processing method provided by the embodiment of the present application;

图2是根据本申请实施例的第一二维码图像与第二二维码图像的示意图;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;

图3是本申请实施例提供的二维码处理方法的流程示意图之二;Fig. 3 is the second schematic flow diagram of the two-dimensional code processing method provided by the embodiment of the present application;

图4是本申请实施例提供的二维码处理装置的结构示意图之一;Fig. 4 is one of the structural schematic diagrams of the two-dimensional code processing device provided by the embodiment of the present application;

图5是本申请实施例提供的二维码处理装置的结构示意图之二;Fig. 5 is the second structural schematic diagram of the two-dimensional code processing device provided by the embodiment of the present application;

图6是根据本申请实施例的电子设备的结构示意图;FIG. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application;

图7是实现本申请实施例的一种电子设备的硬件结构示意图。FIG. 7 is a schematic diagram of a hardware structure of an electronic device implementing an embodiment of the present application.

具体实施方式Detailed ways

下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员获得的所有其他实施例,都属于本申请保护的范围。The following will clearly describe the technical solutions in the embodiments of the present application with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, but not all of them. All other embodiments obtained by persons of ordinary skill in the art based on the embodiments in this application belong to the protection scope of this application.

本申请的说明书和权利要求书中的术语“第一”、“第二”等是用于区别类似的对象,而不用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施,且“第一”、“第二”等所区分的对象通常为一类,并不限定对象的个数,例如第一对象可以是一个,也可以是多个。此外,说明书以及权利要求中“和/或”表示所连接对象的至少其中之一,字符“/”,一般表示前后关联对象是一种“或”的关系。The terms "first", "second" and the like in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific sequence or sequence. It should be understood that the terms so used are interchangeable under appropriate circumstances such that the embodiments of the application can be practiced in sequences other than those illustrated or described herein, and that references to "first," "second," etc. distinguish Objects are generally of one type, and the number of objects is not limited. For example, there may be one or more first objects. In addition, "and/or" in the specification and claims means at least one of the connected objects, and the character "/" generally means that the related objects are an "or" relationship.

下面结合附图,通过具体的实施例及其应用场景对本申请实施例提供的二维码处理方法、装置及电子设备进行详细地说明。The two-dimension code processing method, device and electronic equipment provided in the embodiments of the present application will be described in detail below through specific embodiments and application scenarios with reference to the accompanying drawings.

图1是本申请实施例提供的二维码处理方法的流程示意图之一。参照图1,本申请实施例提供一种二维码处理方法,可以包括:FIG. 1 is one of the schematic flowcharts of the two-dimensional code processing method provided by the embodiment of the present application. Referring to Fig. 1, the embodiment of the present application provides a two-dimensional code processing method, which may include:

步骤110、对第一二维码图像的颜色通道进行分离,并根据预定信息确定分离得到的第一颜色通道对应的排列规则;Step 110, separating the color channels of the first two-dimensional code image, and determining the arrangement rules corresponding to the separated first color channels according to predetermined information;

步骤120、根据第一颜色通道对应的排列规则对颜色通道进行排列,获得第二颜色通道;Step 120, arrange the color channels according to the arrangement rule corresponding to the first color channel, and obtain the second color channel;

步骤130、根据第二颜色通道,合成第二二维码图像;Step 130, synthesize a second two-dimensional code image according to the second color channel;

步骤140、将第二二维码图像发送至第二终端;Step 140, sending the second two-dimensional code image to the second terminal;

其中,预定信息包括以下任一项:Among them, the reservation information includes any of the following:

第一终端的标识信息;Identification information of the first terminal;

第二终端的标识信息、统一时钟信息以及预设时间窗口;其中,统一时钟为第一终端以及第二终端共用的时钟。The identification information of the second terminal, the unified clock information, and the preset time window; wherein, the unified clock is a clock shared by the first terminal and the second terminal.

需要说明的是,本申请实施例提供的上述二维码处理方法的执行主体可以是第一终端。第一终端可以是智能电子设备,例如手机、平板电脑、笔记本电脑、掌上电脑、车载电子设备、可穿戴设备、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本或者个人数字助理(personal digital assistant,PDA)等。第二终端与第一终端可以是相同类型的终端,例如第二终端与第一终端可以均为手机。第二终端与第一终端也可以是不同类型的终端,例如第二终端可以是PC,而第一终端可以是手机。It should be noted that the execution subject of the above 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 mobile phone, a tablet computer, a notebook computer, a handheld computer, a vehicle electronic device, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook, or a personal digital assistant (personal digital assistant). digital assistant, PDA), etc. The second terminal and the first terminal may be terminals of the same type, for example, both the second terminal and the first terminal may 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 mobile phone.

本申请实施例提供的二维码处理方法的应用场景可以是例如第一终端与第二终端进行远程协助的场景:第一终端可以作为被协助方接受第二终端的协助。在该场景中,第一终端可以根据本申请实施例提供的二维码处理方法对第一二维码进行处理,然后将第二二维码发送至第二终端。The application scenario of the two-dimensional code processing method provided in the embodiment of the present application may be, for example, a scenario where the first terminal and the second terminal perform remote assistance: the first terminal may accept assistance from 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 identify whether there is a two-dimensional code in the currently sent image.

若第一终端未识别到图像中包含有二维码,则第一终端可以正常发送图像。If the first terminal does not recognize that the image contains the two-dimensional code, the first terminal can send the image normally.

若第一终端识别到图像中包含有二维码,则第一终端会从图像中截取第一二维码图像,并将第一二维码图像的颜色通道从第一二维码图像中分离出来。其中,第一二维码图像可以是原始二维码图像。If the first terminal recognizes that the image contains a two-dimensional code, the first terminal will intercept the first two-dimensional code image from the image, and separate the color channel of the first two-dimensional code image from the first two-dimensional code image come out. Wherein, 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 can determine the arrangement rule corresponding to the first color channel according to the identification information of the first terminal; arrangement rules.

第一终端可以根据第一颜色通道对应的排列规则,对第一颜色通道进行处理,以得到第二颜色通道。The first terminal may process the first color channel according to the arrangement rule corresponding to the first color channel to obtain the second color channel.

在获得第二颜色通道后,第一终端可以根据第二颜色通道重新合成第二二维码图像。After obtaining the second color channel, the first terminal may recompose the second two-dimensional code image according to the second color channel.

在获得第二二维码图像后,第一终端会将第二二维码图像发送至第二终端。After obtaining the second two-dimensional code image, the first terminal will send the second two-dimensional code image to the second terminal.

需要说明的是,由于第一终端对第一二维码图像的颜色通道进行了处理得到第二二维码图像,因此,第二二维码图像与第一二维码图像具有显著的区别,如图2所示。在不知晓颜色通道的排列规则的情况下,第三方无法将第二二维码图像还原成第一二维码图像,从而无法获取第一二维码的信息。It should be noted that since the first terminal processes the color channels 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 picture 2. Without knowing the arrangement rules of the color channels, the third party cannot restore the second two-dimensional code image to the first two-dimensional code image, and thus cannot obtain the information of the first two-dimensional code.

本申请实施例提供的二维码处理方法,通过对第一二维码图像的颜色通道采用对应的排列规则进行处理,并根据处理后的颜色通道合成第二二维码图像进行发送,可以实现对第一二维码信息的加密传输,从而避免二维码信息泄露导致的安全风险,提高了二维码传输的安全性。The two-dimensional code processing method provided in the embodiment of the present application can be realized by processing the color channels of the first two-dimensional code image with corresponding arrangement rules, and synthesizing the second two-dimensional code image according to the processed color channels for sending. The encrypted transmission of the first two-dimensional code information avoids the security risk caused by the leakage of the two-dimensional code information and improves the security of the two-dimensional code transmission.

在一个实施例中,在预定信息包括第一终端的标识信息的情况下,本申请实施例提供的二维码处理方法,还可以包括:In an embodiment, when the predetermined information includes the identification information of the first terminal, the two-dimensional code processing method provided in the embodiment of the present application may further include:

将第一颜色通道对应的排列规则发送至第二终端。The arrangement rule corresponding to the first color channel is sent 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, 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 encrypted or unencrypted message.

本申请对第一颜色通道对应的排列规则的发送时机和发送方式不做具体限定。This application does not specifically limit the sending timing and sending method of the arrangement rule corresponding to the first color channel.

第二终端接收到第一终端发送的第一颜色通道对应的排列规则后,即可根据该第一颜色通道对应的排列规则,对接收到的第二二维码图像进行反向处理,以还原得到第一二维码图像,从而根据第一二维码图像进行远程协助等操作。After the second terminal receives the arrangement rule corresponding to the first color channel sent by the first terminal, it 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 The first two-dimensional code image is obtained, so as to perform operations such as remote assistance according to the first two-dimensional code image.

本申请实施例提供的二维码处理方法,通过在根据第一终端的标识信息确定各颜色通道对应的排列规则的情况下,将第一颜色通道对应的排列规则发送至第二终端,可以使得第二终端根据该第一颜色通道对应的排列规则还原得到第一二维码图像,从而保证远程协助等操作的顺利进行。The two-dimensional code processing method provided in the embodiment of the present application can send the arrangement rules corresponding to the first color channels to the second terminal under the condition that the arrangement rules corresponding to each color channel are determined according to the identification information of the first terminal, so that The second terminal restores and obtains the first two-dimensional code image according to the arrangement rule corresponding to the first color channel, so as to ensure smooth operation such as remote assistance.

需要说明的是,对于二维码的颜色通道而言,其通常可以由RGB三色子通道组成,即二维码的颜色通道可以具体分为红色子通道、绿色子通道以及蓝色子通道。It should be noted that, for the color channel of the two-dimensional code, it can usually be composed of RGB three-color sub-channels, that is, the color channel of the two-dimensional code can be specifically divided into red sub-channel, green sub-channel and blue sub-channel.

在一个实施例中,排列规则可以包括以下至少一项:In one embodiment, the arrangement rules may include at least one of the following:

排列规则A、调整颜色子通道中各像素的灰度值;Arrangement rule A, adjust the gray value of each pixel in the color sub-channel;

例如,对于红色子通道中像素的灰度值可以表示为R(x,y),该像素调整后的灰度值可以表示为

Figure BDA0003225195890000071
则:For example, the gray value of a pixel in the red sub-channel can be expressed as R(x,y), and the adjusted gray value of the pixel can be expressed as
Figure BDA0003225195890000071
but:

Figure BDA0003225195890000072
Figure BDA0003225195890000072

其中,x为像素的横坐标;y为像素的纵坐标;255为预设的灰度值;Max(R)表示红色子通道中各像素的灰度值中的最大值。Wherein, x is the abscissa of the pixel; y is the ordinate of the pixel; 255 is the preset gray value; Max(R) represents the maximum value of the gray value of each pixel in the red sub-channel.

从公式(1)可以看出,调整颜色子通道中各像素的灰度值可以是在预设的灰度值与各像素的灰度值中的最大值中选择较小值,再将该较小值与像素的灰度值相减得到该像素调整后的灰度值。其中,预设的灰度值的具体大小可以根据实际情况进行调整,本申请实施例对此不做具体限定。It can be seen from formula (1) that adjusting the gray value of each pixel in the color sub-channel can be to select a smaller value from the preset gray value and the maximum value of the gray value of each pixel, and then the comparison The small value is subtracted from the gray value of the pixel to obtain the adjusted gray value of the pixel. Wherein, the specific size of the preset gray value can be adjusted according to the actual situation, which is not specifically limited in this embodiment of the present application.

其他颜色子通道中各像素的灰度值的调整规则与上述相同,在此不再赘述。The adjustment rules of the gray value of each pixel in other color sub-channels are the same as above, and will not be repeated here.

排列规则B、将颜色子通道中的至少部分像素的灰度值,按照像素的横坐标进行平移;Arrangement rule B. Translating the gray value of at least some pixels in the color sub-channel according to the abscissa of the pixel;

例如,对于红色子通道中像素的灰度值可以表示为R(x,y),该像素根据横坐标进行平移后的灰度值可以表示为

Figure BDA0003225195890000073
则:For example, the gray value of a pixel in the red sub-channel can be expressed as R(x,y), and the gray value of the pixel after translation according to the abscissa can be expressed as
Figure BDA0003225195890000073
but:

Figure BDA0003225195890000074
Figure BDA0003225195890000074

其中,x为像素的横坐标;y为像素的纵坐标;w为第一二维码的宽度;w0为初始随机值,且w0∈[0,w]。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; w0 is the initial random value, and w0 ∈ [0,w].

从公式(2)可以看出,规则B是将至少部分像素的灰度值,按照像素的横坐标进行平移,即,将原来像素的灰度值沿横轴平移到其他像素上。其中,部分像素的具体数量由第一二维码的宽度w以及初始随机值w0确定。初始随机值w0的具体大小可以根据实际需要进行调整,本申请实施例对此不做具体限定。It can be seen from formula (2) that the rule B is to translate the gray value of at least some pixels according to the abscissa of the pixel, that is, to translate the gray value of the original pixel to other pixels along the abscissa. Wherein, the specific number of some pixels is determined by the width w of the first two-dimensional code and the initial random valuew0 . The specific size of the initial random value w0 can be adjusted according to actual needs, which is not specifically limited in this embodiment of the present application.

排列规则C、将颜色子通道中的至少部分像素的灰度值,按照像素的纵坐标进行平移。Arrangement rule C. Translating the gray values of at least some pixels in the color sub-channel according to the vertical coordinates of the pixels.

例如,对于红色子通道中像素的灰度值可以表示为R(x,y),该像素根据纵坐标进行平移后的灰度值可以表示为

Figure BDA0003225195890000081
则:For example, the gray value of a pixel in the red sub-channel can be expressed as R(x,y), and the gray value of the pixel after translation according to the ordinate can be expressed as
Figure BDA0003225195890000081
but:

Figure BDA0003225195890000082
Figure BDA0003225195890000082

其中,x为像素的横坐标;y为像素的纵坐标;h为第一二维码的高度;h0为初始随机值,且h0∈[0,h]。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; h0 is the initial random value, and h0 ∈ [0,h].

从公式(3)可以看出,规则C是将至少部分像素的灰度值,按照像素的纵坐标进行平移,即,将原来像素的灰度值沿纵轴平移到其他像素上。其中,部分像素的具体数量由第一二维码的高度h以及初始随机值h0确定。初始随机值h0的具体大小可以根据实际需要进行调整,本申请实施例对此不做具体限定。It can be seen from formula (3) that the rule C is to translate the gray value of at least some pixels according to the vertical coordinate of the pixel, that is, to translate the gray value of the original pixel to other pixels along the vertical axis. Wherein, the specific number of some pixels is determined by the height h of the first two-dimensional code and the initial random valueh0 . The specific size of the initial random valueh0 can be adjusted according to actual needs, which is not specifically limited in this embodiment of the present application.

需要说明的是,上述排列规则还可以进行任意组合。例如,将规则B与规则C结合,则可得出规则B+C:It should be noted that any combination of the above arrangement rules may be performed. For example, combining rule B with rule C results in rule B+C:

将颜色子通道中的至少部分像素的灰度值,按照像素的横坐标以及纵坐标进行平移;Translating the grayscale values of at least some pixels in the color sub-channel according to the abscissa and ordinate of the pixel;

例如,对于红色子通道中像素的灰度值可以表示为R(x,y),该像素根据横坐标与纵坐标进行平移后的灰度值可以表示为

Figure BDA0003225195890000083
则:For example, the gray value of a pixel in the red sub-channel can be expressed as R(x, y), and the gray value of the pixel after translation according to the abscissa and ordinate can be expressed as
Figure BDA0003225195890000083
but:

Figure BDA0003225195890000084
Figure BDA0003225195890000084

其中,x为像素的横坐标;y为像素的纵坐标;w为第一二维码的宽度;w0为初始随机值,且w0∈[0,w];h为第一二维码的高度;h0为初始随机值,且h0∈[0,h]。Among them, x is the abscissa of the pixel; y is the ordinate of the pixel; w is the width of the first two-dimensional code; w0 is the initial random value, and w0 ∈ [0,w]; h is the first two-dimensional code height; h0 is the initial random value, and h0 ∈[0,h].

从公式(4)可以看出,规则B+C是将至少部分像素的灰度值,按照像素的纵坐标以及横坐标进行平移,即,将原来像素的灰度值沿横轴与纵轴平移到其他像素上。It can be seen from formula (4) that the rule B+C is to translate the gray value of at least some pixels according to the vertical and horizontal coordinates of the pixel, that is, to translate the gray value of the original pixel along the horizontal axis and the vertical axis to other pixels.

在一个实施例中,在预定信息包括第一终端的标识信息的情况下,根据预定信息确定分离得到的第一颜色通道对应的排列规则,可以包括:In an embodiment, when the predetermined information includes the 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 the arrangement rules of the second color sub-channels according to the arrangement rules of the first color sub-channels;

根据第二颜色子通道的排列规则,确定第三颜色子通道的排列规则;determining the arrangement rules of the third color sub-channels according to the arrangement rules of the second color sub-channels;

其中,第一颜色通道包括第一颜色子通道、第二颜色子通道以及第三颜色子通道,并且第一颜色子通道、第二颜色子通道以及第三颜色通道分别对应红色子通道、绿色子通道以及蓝色子通道中的一种,且互不相同。Wherein, the first color channel includes 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 the red sub-channel, the green sub-channel channel and one of the blue subchannels, which 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.

假设红色子通道的排列规则为result,则:Assuming that the arrangement rule of the red sub-channel is result, then:

result=hashCode(deviceID)modN+1 (5)result=hashCode(deviceID)modN+1 (5)

其中,hashCode为哈希编码函数;deviceID为第一终端的ID;modN为哈希编码函数值与排列规则编号的对应关系函数。Wherein, hashCode is a hash coding function; deviceID is the ID of the first terminal; modN is a corresponding relationship function between the hash coding function value and the arrangement rule number.

由公式(5)可以看出,可以首先将第一终端的ID输入到哈希编码函数中,以确定第一终端的哈希编码函数值;之后,可以根据哈希编码函数值确定对应的排列规则编号N;最后,红色子通道的排列规则为排列规则编号N+1所对应的排列规则。It can be seen from formula (5) that the ID of the first terminal can be first input into the hash coding function to determine the hash coding function value of the first terminal; after that, the corresponding arrangement can be determined according to the hash coding function value The rule number is N; finally, the arrangement rule of the red sub-channel is the arrangement rule corresponding to the arrangement rule number N+1.

其中,modN可以如下表所示:Among them, modN can be shown in the following table:

表1哈希编码函数值与排列规则编号的对应关系表之一Table 1 One of the corresponding relationship tables between the hash coding function value and the arrangement rule number

hashCode(deviceID)hashCode(deviceID)规则编号rule number0≤hashCode(deviceID)<100≤hashCode(deviceID)<100,4,8,…0,4,8,…10≤hashCode(deviceID)<2010≤hashCode(deviceID)<201,5,…1,5,…20≤hashCode(deviceID)<3020≤hashCode(deviceID)<302,6,…2,6,…hashCode(deviceID)≥30hashCode(deviceID)≥303,7,…3,7,…

其中,上述排列规则A可以对应规则编号1,5,…;上述排列规则B可以对应规则编号2,6,…;上述排列规则C可以对应规则编号3,7,…;上述排列规则B+C可以对应规则编号4,8,…。Among them, the above-mentioned arrangement rule A may correspond to rule numbers 1, 5, ...; the above-mentioned arrangement rule B may correspond to rule numbers 2, 6, ...; the above-mentioned arrangement rule C may correspond to rule numbers 3, 7, ...; the above-mentioned arrangement rule B+C Can correspond to rule numbers 4,8,….

例如,当第一终端ID为88888888时,通过哈希编码函数对第一终端ID进行计算,可以得到第一终端ID的哈希编码函数值为1,则通过哈希编码函数值与排列规则编号的对应关系函数modN可以确定N为0,则红色子通道的排列规则为N+1=1所对应的排列规则,即根据排列规则A调整红色子通道中各像素的灰度值。For example, when the first terminal ID is 88888888, the first terminal ID is calculated through the hash encoding function, and the hash encoding function value of the first terminal ID can be obtained as 1, then the hash encoding function value and the arrangement rule number The corresponding relationship function modN can determine that N is 0, then the arrangement rule of the red sub-channel is the 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.

在确定红色子通道的排列规则后,可以根据红色子通道的排列规则编号确定绿色子通道的排列规则编号。例如,绿色子通道的排列规则编号可以为G=R+1。其中,R为红色子通道的排列规则编号。After the arrangement rule of the red sub-channel is determined, 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 permutation rule number of the green sub-channel may be G=R+1. Among them, R is the arrangement rule number of the red sub-channel.

在确定绿色子通道的排列规则后,可以根据绿色子通道的排列规则编号确定蓝色子通道的排列规则编号。例如,蓝色子通道的排列规则编号可以为B=G+1。After the arrangement rule of the green sub-channel is determined, the number of the arrangement rule of the blue sub-channel may be determined according to the number of the arrangement rule of the green sub-channel. For example, the permutation rule number of the blue sub-channel may be B=G+1.

因此,当红色子通道的排列规则的编号为1时,绿色子通道的排列规则的编号为2,蓝色子通道的排列规则的编号为3。即,根据规则B将绿色子通道中的至少部分像素的灰度值,按照像素的横坐标进行平移;根据规则C将蓝色子通道中的至少部分像素的灰度值,按照像素的纵坐标进行平移。Therefore, when the number of the arrangement rule of the red sub-channel is 1, the number of the arrangement rule of the green sub-channel is 2, and the number of the arrangement rule of the blue sub-channel is 3. That is, according to rule B, the gray value of at least some pixels in the green sub-channel is translated according to the abscissa of the pixel; according to rule C, the gray value of at least part of the pixels in the blue sub-channel is translated according to the vertical coordinate of the pixel to pan.

本申请实施例提供的二维码处理方法,通过基于第一终端的标识信息根据哈希编码函数等确定第一颜色子通道的排列规则,再依次确定其他颜色子通道的排列规则,可以有效提高各颜色子通道排列规则的确定复杂度,从而降低了第三方破解第二二维码的风险,进一步提高了二维码处理的安全性。In the two-dimensional code processing method provided in the embodiment of the present application, by determining the arrangement rules of the first color sub-channel according to the hash coding function based on the identification information of the first terminal, and then sequentially determining the arrangement rules of other color sub-channels, it can effectively improve The complexity of determining the arrangement rules of each color sub-channel reduces the risk of a third party cracking the second two-dimensional code and further improves the security of two-dimensional code processing.

在一个实施例中,在预定信息包括第二终端的标识信息、统一时钟信息以及预设时间窗口的情况下,根据预定信息确定分离得到的第一颜色通道对应的排列规则,可以包括:In an embodiment, when the predetermined information includes identification information of the second terminal, unified clock information, and a preset time window, determining an arrangement rule corresponding to the separated first color channel according to the predetermined information may include:

根据第二终端的标识信息、统一时钟信息以及预设时间窗口,确定第一颜色通道对应的排列规则。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 is determined.

可以预先设置第一终端以及第二终端共用的统一时钟以及预设时间窗口,然后使第一终端以及第二终端存储预先存储根据第二终端的标识信息、统一时钟信息以及预设时间窗口确定第一颜色通道对应的排列规则的方法。A unified clock and a preset time window shared by the first terminal and the second terminal can be preset, and then the first terminal and the second terminal can be stored in advance to determine the second terminal according to the identification information of the second terminal, the unified clock information and the preset time window. A method of permutation rules corresponding to a color channel.

这样,在第一终端接收第二终端发送的第二终端的标识信息后(或者第一终端也可以预先存储第二终端的标识信息),第一终端与第二终端均知晓确定各颜色通道对应的排列规则的方法,并且当第一终端根据统一钟信息确定各颜色通道对应的排列规则时,第二终端也能同步确定还原第一颜色通道的规则,从而还原出第一二维码。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), both the first terminal and the second terminal know that each color channel corresponds to The arrangement rule method, and when the first terminal determines the arrangement rules corresponding to each color channel according to the unified clock information, the second terminal can also simultaneously determine the rules for restoring the first color channel, thereby restoring the first two-dimensional code.

本申请实施例提供的二维码处理方法,通过设置第一终端与第二终端共用的统一时钟信息,并根据第二终端的标识信息以及统一时钟信息确定第一颜色通道对应的排列规则,可以使得第二终端同步确定还原第一颜色通道的规则,从而可以在不发送第一颜色通道对应的排列规则的情况下,实现第一二维码的还原,进一步提高了二维码传输的安全性。In the two-dimensional code processing method provided in the embodiment of the present application, by setting the unified clock information shared by the first terminal and the second terminal, and determining the arrangement rule corresponding to the first color channel according to the identification information of the second terminal and the unified clock information, it can Make the second terminal synchronously determine the rules for restoring the first color channel, so that the restoration of the first two-dimensional code can be realized without sending the arrangement rules corresponding to the first color channel, which further improves the security of two-dimensional code transmission .

在上述实施例的基础上,根据第二终端的标识信息、统一时钟信息以及预设时间窗口,确定第一颜色通道对应的排列规则,可以包括:On the basis of the above embodiments, according to the identification information of the second terminal, the unified clock information and the preset time window, determining the arrangement rule corresponding to the first color channel may include:

根据统一时钟信息确定当前时间戳;Determine the current timestamp according to the unified clock information;

根据第二终端的标识信息、当前时间戳以及预设时间窗口,确定第一颜色子通道的排列规则;determining the arrangement rules of the first color sub-channels according to the identification information of the second terminal, the current time stamp and the preset time window;

根据第一颜色子通道的排列规则,确定第二颜色子通道的排列规则;determining the arrangement rules of the second color sub-channels according to the arrangement rules of the first color sub-channels;

根据第二颜色子通道的排列规则,确定第三颜色子通道的排列规则;determining the arrangement rules of the third color sub-channels according to the arrangement rules of the second color sub-channels;

其中,第一颜色通道包括第一颜色子通道、第二颜色子通道以及第三颜色子通道,并且第一颜色子通道、第二颜色子通道以及第三颜色子通道分别对应红色通道子、绿色子通道以及蓝色子通道中的一种,且互不相同。Wherein, the first color channel includes 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 correspond to the red channel, the green channel respectively One of the subchannels and the blue subchannel, which 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.

假设红色子通道的排列规则为result,则:Assuming that the arrangement rule of the red sub-channel is result, then:

result=hashCode(deviceID+nowTime/T)modN+1 (6)result=hashCode(deviceID+nowTime/T)modN+1 (6)

其中,hashCode为哈希编码函数;deviceID为第二终端的ID;nowTime为根据统一时钟信息确定的当前时间戳;T为预设的时间窗口;modN为哈希编码函数值与排列规则编号的对应关系函数。Among them, 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 the correspondence between the hash coding function value and the arrangement rule number relationship function.

由公式(6)可以看出,可以首先根据统一时钟信息确定当前时间戳,再根据预设的时间窗口对当前时间戳进行取余计算,接着将第二终端ID与取余计算结果输入到哈希编码函数中,以确定哈希编码函数值;需要说明的是,时间窗口T的长度可以为例如30s等(本申请实施例对时间窗口T的具体大小不做具体限定),则在30s内,nowTime/T的值不变。It can be seen from the formula (6) that the current timestamp can be determined first according to the unified clock information, and then the remainder calculation of the current timestamp can be performed according to the preset time window, and then the second terminal ID and the remainder calculation result can be input into the Ha Hash encoding function to determine the value of the hash encoding function; it should be noted that the length of the time window T can be, for example, 30s, etc. (the specific size of the time window T is not specifically limited in the embodiment of the present application), then within 30s , the value of nowTime/T remains unchanged.

之后,可以根据哈希编码函数值确定对应的排列规则编号N。Afterwards, the corresponding permutation rule number N can be determined according to the value of the hash coding function.

最后,红色子通道的排列规则为排列规则编号N+1所对应的排列规则。Finally, the arrangement rule of the red sub-channel is the arrangement rule corresponding to the arrangement rule number N+1.

其中,modN可以如下表所示:Among them, modN can be shown in the following table:

表2哈希编码函数值与排列规则编号的对应关系表之二Table 2 Correspondence between hash coding function value and arrangement rule number Table 2

hashCode(deviceID+nowTime/T)hashCode(deviceID+nowTime/T)规则编号rule number0≤hashCode(deviceID+nowTime/T)<100≤hashCode(deviceID+nowTime/T)<100,4,8,…0,4,8,…10≤hashCode(deviceID+nowTime/T)<2010≤hashCode(deviceID+nowTime/T)<201,5,…1,5,…20≤hashCode(deviceID+nowTime/T)<3020≤hashCode(deviceID+nowTime/T)<302,6,…2,6,…hashCode(deviceID+nowTime/T)≥30hashCode(deviceID+nowTime/T)≥303,7,…3,7,…

其中,上述排列规则A可以对应规则编号1,5,…;上述排列规则B可以对应规则编号2,6,…;上述排列规则C可以对应规则编号3,7,…;上述排列规则B+C可以对应规则编号4,8,…。Among them, the above-mentioned arrangement rule A may correspond to rule numbers 1, 5, ...; the above-mentioned arrangement rule B may correspond to rule numbers 2, 6, ...; the above-mentioned arrangement rule C may correspond to rule numbers 3, 7, ...; the above-mentioned arrangement rule B+C Can correspond to rule numbers 4,8,….

例如,当通过哈希编码函数对第一终端ID与取余计算结果之和进行计算,得到哈希编码函数值为1时,则通过哈希编码函数值与排列规则编号的对应关系函数modN可以确定N为0,则红色子通道的排列规则为N+1=1所对应的排列规则,即根据排列规则A调整红色子通道中各像素的灰度值。For example, when the sum of the first terminal ID and the remainder calculation result is calculated by the hash coding function, and the value of the hash coding function is 1, then the corresponding relationship function modN of the hash coding function value and the arrangement rule number can be If N is determined to be 0, the arrangement rule of the red sub-channel is the 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.

在确定红色子通道的排列规则后,可以根据红色子通道的排列规则编号确定绿色子通道的排列规则编号。例如,绿色子通道的排列规则编号可以为G=R+1。其中,R为红色子通道的排列规则编号。After the arrangement rule of the red sub-channel is determined, 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 permutation rule number of the green sub-channel may be G=R+1. Among them, R is the arrangement rule number of the red sub-channel.

在确定绿色子通道的排列规则后,可以根据绿色子通道的排列规则编号确定蓝色子通道的排列规则编号。例如,蓝色子通道的排列规则编号可以为B=G+1。After the arrangement rule of the green sub-channel is determined, the number of the arrangement rule of the blue sub-channel may be determined according to the number of the arrangement rule of the green sub-channel. For example, the permutation rule number of the blue sub-channel may be B=G+1.

因此,当红色子通道的排列规则的编号为1时,绿色子通道的排列规则的编号为2,蓝色子通道的排列规则的编号为3。即,根据规则B将绿色子通道中的至少部分像素的灰度值,按照像素的横坐标进行平移;根据规则C将蓝色子通道中的至少部分像素的灰度值,按照像素的纵坐标进行平移。Therefore, when the number of the arrangement rule of the red sub-channel is 1, the number of the arrangement rule of the green sub-channel is 2, and the number of the arrangement rule of the blue sub-channel is 3. That is, according to rule B, the gray value of at least some pixels in the green sub-channel is translated according to the abscissa of the pixel; according to rule C, the gray value of at least part of the pixels in the blue sub-channel is translated according to the vertical coordinate of the pixel to pan.

本申请实施例提供的二维码处理方法,通过基于第一终端的标识信息以及统一时钟信息根据哈希编码函数等确定第一颜色子通道的排列规则,再依次确定其他颜色子通道的排列规则,可以有效提高各颜色子通道排列规则的确定复杂度,从而降低了第三方破解第二二维码的风险,进一步提高了二维码传输的安全性。In the two-dimensional code processing method provided by the embodiment of the present application, the arrangement rules of the first color sub-channel are determined according to the hash coding function based on the identification information of the first terminal and the unified clock information, and then the arrangement rules of other color sub-channels are sequentially determined. , can effectively increase the complexity of determining the arrangement rules of each color sub-channel, thereby reducing the risk of a third party cracking the second two-dimensional code, and further improving the security of two-dimensional code transmission.

图3是本申请实施例提供的二维码处理方法的流程示意图之二。参照图3,本申请实施例提供一种二维码处理方法,可以包括:FIG. 3 is the second schematic flow diagram of the two-dimensional code processing method provided by the embodiment of the present application. Referring to Fig. 3, the embodiment of the present application provides a two-dimensional code processing method, which may include:

步骤310、接收第一终端发送的第二二维码图像以及第一颜色通道对应的排列规则,根据第一颜色通道对应的排列规则确定第一颜色通道的反向排列规则;Step 310, receiving the second two-dimensional code image sent by the first terminal and the arrangement rule corresponding to the first color channel, and determining the reverse arrangement rule of the first color channel according to the arrangement rule corresponding to the first color channel;

步骤320、根据第一颜色通道的反向排列规则对第二二维码图像进行解码,获得第二二维码对应的第一二维码;Step 320, decode the second two-dimensional code image according to the reverse arrangement rule of the first color channel, and obtain the first two-dimensional code corresponding to the second two-dimensional code;

显示第一二维码图像。Display the first QR code image.

需要说明的是,本申请实施例提供的上述二维码处理方法的执行主体可以是第二终端。第二终端可以是智能电子设备,例如手机、平板电脑、笔记本电脑、掌上电脑、车载电子设备、可穿戴设备、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本或者个人数字助理(personal digital assistant,PDA)等。第二终端与第一终端可以是相同类型的终端,例如第二终端与第一终端可以均为手机。第二终端与第一终端也可以是不同类型的终端,例如第二终端可以是PC,而第一终端可以是手机。It should be noted that the execution subject of the above 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 mobile phone, a tablet computer, a notebook computer, a handheld computer, a vehicle electronic device, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook, or a personal digital assistant (personal digital assistant). digital assistant, PDA), etc. The second terminal and the first terminal may be terminals of the same type, for example, both the second terminal and the first terminal may 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 mobile phone.

本申请实施例提供的二维码处理方法的应用场景可以是例如第一终端与第二终端进行远程协助的场景:第一终端可以作为被协助方接受第二终端的协助。在该场景中,第一终端可以根据本申请实施例提供的二维码处理方法对第一二维码进行处理,然后将第二二维码发送至第二终端。The application scenario of the two-dimensional code processing method provided in the embodiment of the present application may be, for example, a scenario where the first terminal and the second terminal perform remote assistance: the first terminal may accept assistance from 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 may receive the second two-dimensional code image and the arrangement rule corresponding to the first color channel sent by the first terminal.

该第二二维码图像是第一终端对第一二维码图像的颜色通道进行分离,根据预定信息确定第一二维码图像的第一颜色通道对应的排列规则,并根据第一颜色通道对应的排列规则确定的。In the second two-dimensional code image, the first terminal separates the color channels of the first two-dimensional code image, determines the arrangement rule corresponding to the first color channel of the first two-dimensional code image according to predetermined information, and The corresponding arrangement rules are determined.

其中,预定信息可以包括以下任一项:Among them, the reservation information may include any of the following:

第一终端的标识信息;Identification information of the first terminal;

第二终端的标识信息、统一时钟信息以及预设时间窗口;其中,统一时钟为第一终端以及第二终端共用的时钟。The identification information of the second terminal, the unified clock information, and the preset time window; wherein, the unified clock is a clock shared by the first terminal and the second terminal.

第一终端确定第二二维码图像的具体方法可以参照上文所述的方法实施例,在此不再赘述。For a specific method for the first terminal to determine the second two-dimensional code image, reference may be made 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 rules corresponding to each color channel to determine the second two-dimensional code image, the first terminal can send the arrangement rule corresponding to the first color channel to the second terminal, and the second The terminal receives the arrangement rule corresponding to the first color channel 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 out the arrangement rule corresponding to the first color channel from the message.

本申请对第一颜色通道对应的排列规则的接收时机和接收方式不做具体限定。This application does not specifically limit the receiving timing and receiving method 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 determine the reverse arrangement rule of the first color channel according to the arrangement rule corresponding to the first color channel.

例如,当第一颜色通道中红色子通道的排列规则为上述排列规则B+C时,在第二终端接收到第一终端发送的红色子通道对应的排列规则后,即可确定对应的红色子通道的反向排列规则为

Figure BDA0003225195890000141
For example, when the arrangement rule of the red sub-channel in the first color channel is the above-mentioned arrangement rule B+C, the second terminal can determine the corresponding red sub-channel after receiving the arrangement rule corresponding to the red sub-channel sent by the first terminal. The reverse arrangement rule of the channel is
Figure BDA0003225195890000141

第二终端确定第一颜色通道的反向排列规则后,即可根据确定的第一颜色通道的反向排列规则对第二二维码图像进行解码,以获得第二二维码对应的第一二维码。After the second terminal determines the reverse arrangement rule of the first color channel, it can decode the second two-dimensional code image according to the determined reverse arrangement rule of the first color channel, so as to obtain the first color corresponding to the second two-dimensional code. QR code.

本申请实施例提供的二维码处理方法,通过在根据第一终端的标识信息确定第一颜色通道对应的排列规则的情况下,接收第一颜色通道对应的排列规则,可以使得第二终端根据该第一颜色通道对应的排列规则还原得到第一二维码图像,从而保证远程协助等操作的顺利进行。In the two-dimensional code processing method provided by the embodiment of the present application, when the arrangement rule corresponding to the first color channel is determined according to the identification information of the first terminal, the second terminal can be configured according to the The arrangement rule corresponding to the first color channel is restored to obtain the first two-dimensional code image, thereby ensuring the smooth progress of operations such as remote assistance.

可选地,在第一终端根据第二终端的标识信息、统一时钟信息以及预设时间窗口确定第一二维码图像的第一颜色通道对应的排列规则的情况下,第二终端会向第一终端发送第二终端的标识信息。Optionally, 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, the second terminal will send a report to the second terminal. A terminal sends the identification information of the second terminal.

在这种情况下,可以预先设置第一终端以及第二终端共用的统一时钟以及预设时间窗口,然后使第一终端以及第二终端存储预先存储根据第二终端的标识信息、统一时钟信息以及预设时间窗口确定第一颜色通道对应的排列规则的方法。这样,第一终端与第二终端均知晓确定第一颜色通道对应的排列规则的方法,并且当第一终端根据统一钟信息确定各颜色通道对应的排列规则时,第二终端也能同步确定还原第一颜色通道的规则,从而还原出第一二维码。In this case, the unified clock and the preset time window shared by the first terminal and the second terminal can be preset, and then the first terminal and the second terminal can be stored in advance according to the identification information of the second terminal, the unified clock information and A method for determining the arrangement rule corresponding to the first color channel by presetting the time window. In this way, both the first terminal and the second terminal know the method of determining the arrangement rules corresponding to the first color channel, and when the first terminal determines the arrangement rules corresponding to each color channel according to the unified clock information, the second terminal can also simultaneously determine the restoration The rules of the first color channel, so as to restore the first two-dimensional code.

例如,当第一终端通过第二终端的标识信息、统一时钟信息以及预设时间窗口确定红色子通道的排列规则为上述排列规则B时,第二终端也可以同时通过自身的标识信息、统一时钟信息以及预设时间窗口确定红色子通道的排列规则为B,从而确定对应的红色子通道的反向排列规则

Figure BDA0003225195890000151
Figure BDA0003225195890000152
For example, when the first terminal determines that the arrangement rule of the red sub-channel is the above-mentioned arrangement rule B through the identification information of the second terminal, the unified clock information and the preset time window, the second terminal may also use its own identification information, the unified clock information at the same time The information and the preset time window determine that the arrangement rule of the red sub-channel is B, so as to determine the reverse arrangement rule of the corresponding red sub-channel
Figure BDA0003225195890000151
Figure BDA0003225195890000152

接着,第二终端可以根据确定的第一颜色通道的反向排列规则对第二二维码图像进行解码,以获得第二二维码对应的第一二维码。Next, the second terminal may decode the second two-dimensional code image according to the determined reverse arrangement rule of the first color channel, so as to obtain the first two-dimensional code corresponding to the second two-dimensional code.

本申请实施例提供的二维码处理方法,通过向第一终端发送第二终端的标识信息,以使第一终端根据第二终端的标识信息、统一时钟信息以及预设时间窗口确定第一颜色通道对应的排列规则,可以使得第二终端同步确定还原第一颜色通道的规则,从而可以在不发送第一颜色通道对应的排列规则的情况下,实现第一二维码的还原,进一步提高了二维码传输的安全性。In the two-dimensional code processing method provided in the embodiment of the present application, by sending the identification information of the second terminal to the first terminal, the first terminal determines the first color according to the identification information of the second terminal, unified clock information, and a preset time window The arrangement rules corresponding to the channels can make the second terminal synchronously determine the rules for restoring the first color channel, so that the restoration of the first two-dimensional code can be realized without sending the arrangement rules corresponding to the first color channel, which further improves the The security of QR code transmission.

在根据第一颜色通道的反向排列规则对第二二维码进行还原获得第一二维码后,第二终端可以显示第一二维码图像。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 may display the image of the first two-dimensional code.

综上所述,本申请实施例提供的二维码处理方法,通过接收对第一二维码图像的颜色通道采用对应的排列规则进行处理后得到的第二二维码图像,可以实现对第一二维码信息的加密传输,从而避免二维码信息泄露导致的安全风险,提高了二维码传输的安全性。To sum up, the two-dimensional code processing method provided by the embodiment of the present application can realize the processing of the second two-dimensional code image by receiving the second two-dimensional code image obtained after processing the color channels of the first two-dimensional code image with corresponding arrangement rules. Encrypted transmission of the 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.

需要说明的是,本申请实施例提供的二维码处理方法,执行主体可以为二维码处理装置,或者该二维码处理装置中的用于执行二维码处理方法的控制模块。本申请实施例中以二维码处理装置执行二维码处理方法为例,说明本申请实施例提供的二维码处理装置。It should be noted that, the two-dimensional code processing method provided in the embodiment of the present application may be executed by a two-dimensional code processing device, or a control module in the two-dimensional code processing device for executing the two-dimensional code processing method. In the embodiment of the present application, the two-dimensional code processing device provided in the embodiment of the present application is described by taking the two-dimensional code processing device executing the two-dimensional code processing method as an example.

图4是本申请实施例提供的二维码处理装置的结构示意图之一。参照图4,本申请实施例提供的二维码处理装置,可以包括:Fig. 4 is one of the structural schematic diagrams of the two-dimensional code processing device provided by the embodiment of the present application. Referring to Figure 4, the two-dimensional code processing device provided in the embodiment of the present application may include:

规则确定模块410,用于对第一二维码图像的颜色通道进行分离,并根据预定信息确定分离得到的第一颜色通道对应的排列规则;Arule determination module 410, configured to separate the 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;

通道处理模块420,用于根据所述第一颜色通道对应的排列规则对所述颜色通道进行排列,获得第二颜色通道;Achannel processing module 420, configured to arrange the color channels according to the arrangement rule corresponding to the first color channel to obtain a second color channel;

二维码合成模块430,用于根据所述第二颜色通道,合成第二二维码图像;A two-dimensionalcode synthesis module 430, configured to synthesize a second two-dimensional code image according to the second color channel;

发送模块440,用于将所述第二二维码图像发送至第二终端;A sendingmodule 440, configured to send the second two-dimensional code image to a second terminal;

其中,所述预定信息包括以下任一项:Wherein, the predetermined information includes any of the following:

第一终端的标识信息;Identification information of the first terminal;

第二终端的标识信息、统一时钟信息以及预设时间窗口;其中,统一时钟为所述第一终端以及所述第二终端共用的时钟。Identification information of the second terminal, unified clock information, and a preset time window; wherein, the unified clock is a clock shared by the first terminal and the second terminal.

本申请实施例提供的二维码处理装置,通过对第一二维码图像的颜色通道采用对应的排列规则进行处理,并根据处理后的颜色通道合成第二二维码图像进行发送,可以实现对初始二维码信息的加密传输,从而避免二维码信息泄露导致的安全风险,提高了二维码传输的安全性。The two-dimensional code processing device provided in the embodiment of the present application can realize The encrypted transmission of the initial two-dimensional code information avoids the security risk caused by the leakage of the two-dimensional code information and improves the security of the two-dimensional code transmission.

在一个实施例中,在所述预定信息包括第一终端的标识信息的情况下,所述发送模块440,还用于:In an embodiment, when the predetermined information includes identification information of the first terminal, the sendingmodule 440 is further configured to:

将所述第一颜色通道对应的排列规则发送至所述第二终端。Send the arrangement rule corresponding to the first color channel to the second terminal.

在一个实施例中,在所述预定信息包括第二终端的标识信息、统一时钟信息以及预设时间窗口的情况下,所述规则确定模块410具体用于:In one embodiment, when the predetermined information includes identification information of the second terminal, unified clock information, and a preset time window, therule determination module 410 is specifically configured to:

根据所述第二终端的标识信息、所述统一时钟信息以及所述预设时间窗口,确定所述第一颜色通道对应的处理规则。A processing rule corresponding to the first color channel is determined according to the identification information of the second terminal, the unified clock information, and the preset time window.

在一个实施例中,所述规则确定模块410具体用于:In one embodiment, therule determination module 410 is specifically configured to:

根据所述统一时钟信息确定当前时间戳;determining the 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 time stamp, and the preset time window;

根据所述第一颜色子通道的排列规则,确定第二颜色子通道的排列规则;determining the arrangement rules of the second color sub-channels according to the arrangement rules of the first color sub-channels;

根据所述第二颜色子通道的排列规则,确定第三颜色子通道的排列规则;determining the arrangement rules of the third color sub-channels according to the arrangement rules of the second color sub-channels;

其中,所述第一颜色通道包括所述第一颜色子通道、所述第二颜色子通道以及所述第三颜色子通道。Wherein, the first color channel includes the first color sub-channel, the second color sub-channel and the third color sub-channel.

在一个实施例中,所述预定信息包括第一终端的标识信息的情况下,所述规则确定模块410具体用于:In one embodiment, when the predetermined information includes the identification information of the first terminal, therule determining module 410 is specifically configured to:

根据所述第一终端的标识信息,确定第一颜色子通道的排列规则;determining an arrangement rule of the first color sub-channel according to the identification information of the first terminal;

根据所述第一颜色子通道的排列规则,确定第二颜色子通道的排列规则;determining the arrangement rules of the second color sub-channels according to the arrangement rules of the first color sub-channels;

根据所述第二颜色子通道的排列规则,确定第三颜色子通道的排列规则;determining the arrangement rules of the third color sub-channels according to the arrangement rules of the second color sub-channels;

其中,所述第一颜色通道包括所述第一颜色子通道、所述第二颜色子通道以及所述第三颜色子通道。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 rules include at least one of the following:

调整所述颜色子通道中各像素的灰度值;adjusting the gray value of each pixel in the color sub-channel;

将所述颜色子通道中的至少部分像素的灰度值,按照所述像素的横坐标进行平移;Translating the grayscale values of at least some pixels in the color sub-channel according to the abscissa of the pixel;

将所述颜色子通道中的至少部分像素的灰度值,按照所述像素的纵坐标进行平移。Translating the gray values of at least some pixels in the color sub-channel according to the ordinate of the pixels.

本申请实施例中的二维码处理装置可以是装置,也可以是终端中的部件、集成电路、或芯片。该装置可以是移动电子设备,也可以为非移动电子设备。示例性的,移动电子设备可以为手机、平板电脑、笔记本电脑、掌上电脑、车载电子设备、可穿戴设备、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本或者个人数字助理(personaldigital assistant,PDA)等,非移动电子设备可以为服务器、网络附属存储器(NetworkAttached Storage,NAS)、个人计算机(personal computer,PC)、电视机(television,TV)、柜员机或者自助机等,本申请实施例不作具体限定。The two-dimensional code processing device in the embodiment of the present application may be a device, or 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. Exemplarily, the mobile electronic device may be a mobile phone, tablet computer, notebook computer, palmtop computer, vehicle electronic device, wearable device, ultra-mobile personal computer (ultra-mobile personal computer, UMPC), netbook or personal digital assistant (personal digital assistant) , PDA), etc., the non-mobile electronic device can be a server, a network attached storage (NetworkAttached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., the embodiment of the present application Not specifically limited.

本申请实施例中的二维码处理装置可以为具有操作系统的装置。该操作系统可以为安卓(Android)操作系统,可以为ios操作系统,还可以为其他可能的操作系统,本申请实施例不作具体限定。The two-dimensional code processing device in the embodiment of the present application may be a device with an operating system. The operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, which are not specifically limited in this embodiment of the present application.

本申请实施例提供的二维码处理装置能够实现图1和图2的方法实施例实现的各个过程,为避免重复,这里不再赘述。The two-dimensional code processing device provided in the embodiment of the present application can realize various processes realized by the method embodiments in FIG. 1 and FIG. 2 , and details are not repeated here to avoid repetition.

图5是本申请实施例提供的二维码处理装置的结构示意图之二。参照图5,本申请实施例提供的二维码处理装置,可以包括:Fig. 5 is the second schematic diagram of the structure of the two-dimensional code processing device provided by the embodiment of the present application. Referring to Figure 5, the two-dimensional code processing device provided in the embodiment of the present application may include:

规则确定模块510,用于接收第一终端发送的第二二维码图像以及第一颜色通道对应的排列规则,根据所述第一颜色通道对应的排列规则确定第一颜色通道的反向排列规则;Therule determination module 510 is configured to receive the second two-dimensional code image sent by the first terminal and the arrangement rule corresponding to the first color channel, and determine the reverse arrangement rule of the first color channel according to the arrangement rule corresponding to the first color channel ;

解码模块520,用于根据所述第一颜色通道的反向排列规则对所述第二二维码图像进行解码,获得第二二维码对应的第一二维码;Thedecoding module 520 is configured to decode the second two-dimensional code image according to the reverse arrangement rule of the first color channel, and obtain the first two-dimensional code corresponding to the second two-dimensional code;

显示模块530,用于显示第一二维码图像。Thedisplay module 530 is configured to display the first two-dimensional code image.

本申请实施例提供的二维码处理装置,通过接收对第一二维码图像的颜色通道采用对应的排列规则进行处理后得到的第二二维码图像,可以实现对第一二维码信息的加密传输,从而避免二维码信息泄露导致的安全风险,提高了二维码传输的安全性。The two-dimensional code processing device provided in the embodiment of the present application can realize the processing of the first two-dimensional code information by receiving the second two-dimensional code image obtained after processing the color channels of the first two-dimensional code image with corresponding arrangement rules. Encrypted transmission, thereby avoiding the security risk caused by the leakage of QR code information, and improving the security of QR code transmission.

本申请实施例中的二维码处理装置可以是装置,也可以是终端中的部件、集成电路、或芯片。该装置可以是移动电子设备,也可以为非移动电子设备。示例性的,移动电子设备可以为手机、平板电脑、笔记本电脑、掌上电脑、车载电子设备、可穿戴设备、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本或者个人数字助理(personaldigital assistant,PDA)等,非移动电子设备可以为服务器、网络附属存储器(NetworkAttached Storage,NAS)、个人计算机(personal computer,PC)、电视机(television,TV)、柜员机或者自助机等,本申请实施例不作具体限定。The two-dimensional code processing device in the embodiment of the present application may be a device, or 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. Exemplarily, the mobile electronic device may be a mobile phone, tablet computer, notebook computer, palmtop computer, vehicle electronic device, wearable device, ultra-mobile personal computer (ultra-mobile personal computer, UMPC), netbook or personal digital assistant (personal digital assistant) , PDA), etc., the non-mobile electronic device can be a server, a network attached storage (NetworkAttached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., the embodiment of the present application Not specifically limited.

本申请实施例中的二维码处理装置可以为具有操作系统的装置。该操作系统可以为安卓(Android)操作系统,可以为ios操作系统,还可以为其他可能的操作系统,本申请实施例不作具体限定。The two-dimensional code processing device in the embodiment of the present application may be a device with an operating system. The operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, which are not specifically limited in this embodiment of the present application.

本申请实施例提供的二维码处理装置能够实现图3的方法实施例实现的各个过程,为避免重复,这里不再赘述。The two-dimensional code processing device provided in the embodiment of the present application can implement various processes realized in the method embodiment in FIG. 3 , and details are not repeated here to avoid repetition.

可选地,如图6所示,本申请实施例还提供一种电子设备600,包括处理器601,存储器602,存储在存储器602上并可在所述处理器601上运行的程序或指令,该程序或指令被处理器601执行时实现上述二维码处理方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。Optionally, as shown in FIG. 6 , the embodiment of the present application further provides anelectronic device 600, including aprocessor 601, amemory 602, and programs or instructions stored in thememory 602 and operable on theprocessor 601, When the program or instruction is executed by theprocessor 601, the various processes of the above two-dimensional code processing method embodiment can be realized, and the same technical effect can be achieved. To avoid repetition, details are not repeated here.

需要说明的是,本申请实施例中的电子设备包括上述所述的移动电子设备和非移动电子设备。It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.

图7为实现本申请实施例的一种电子设备的硬件结构示意图。FIG. 7 is a schematic diagram of a hardware structure of an electronic device implementing an embodiment of the present application.

该电子设备700包括但不限于:射频单元701、网络模块702、音频输出单元703、输入单元704、传感器705、显示单元706、用户输入单元707、接口单元708、存储器709、以及处理器710等部件。Theelectronic device 700 includes, but is not limited to: aradio frequency unit 701, anetwork module 702, anaudio output unit 703, aninput unit 704, asensor 705, adisplay unit 706, a user input unit 707, aninterface unit 708, amemory 709, and aprocessor 710, etc. part.

本领域技术人员可以理解,电子设备700还可以包括给各个部件供电的电源(比如电池),电源可以通过电源管理系统与处理器710逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。图7中示出的电子设备结构并不构成对电子设备的限定,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置,在此不再赘述。Those skilled in the art can understand that theelectronic device 700 can also include a power supply (such as a battery) for supplying power to various components, and the power supply can be logically connected to theprocessor 710 through the power management system, so that the management of charging, discharging, and function can be realized through the power management system. Consumption management and other functions. The structure of the electronic device shown in FIG. 7 does not constitute a limitation to the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange different components, and details will not be repeated here. .

其中,处理器710,用于对第一二维码图像的颜色通道进行分离,并根据预定信息确定分离得到的第一颜色通道对应的排列规则;Wherein, theprocessor 710 is configured to separate the 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 an 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;;

射频单元701,用于将所述第二二维码图像发送至第二终端;aradio frequency unit 701, configured to send the second two-dimensional code image to a second terminal;

其中,所述预定信息包括以下任一项:Wherein, the predetermined information includes any of the following:

第一终端的标识信息;Identification information of the first terminal;

第二终端的标识信息、统一时钟信息以及预设时间窗口;其中,统一时钟为所述第一终端以及所述第二终端共用的时钟。Identification information of the second terminal, unified clock information, and a preset time window; wherein, the unified clock is a clock shared by the first terminal and the second terminal.

本申请实施例提供的电子设备,通过对第一二维码图像的颜色通道采用对应的排列规则进行处理,并根据处理后的颜色通道合成第二二维码图像进行发送,可以实现对第一二维码信息的加密传输,从而避免二维码信息泄露导致的安全风险,提高了二维码传输的安全性The electronic device provided in the embodiment of the present application processes the color channels of the first two-dimensional code image using corresponding arrangement rules, and synthesizes and sends the second two-dimensional code image according to the processed color channels, so that the first two-dimensional code image can be processed. The encrypted transmission of QR code information avoids the security risk caused by the leakage of QR code information and improves the security of QR code transmission

在一个实施例中,所述射频单元701还用于:In one embodiment, theradio frequency unit 701 is also used for:

将所述第一颜色通道对应的排列规则发送至所述第二终端。Send the arrangement rule corresponding to the first color channel to the second terminal.

在一个实施例中,所述处理器710还用于:根据所述第二终端的标识信息、所述统一时钟信息以及所述预设时间窗口,确定所述第一颜色通道对应的排列规则。In one embodiment, theprocessor 710 is further configured to: determine 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.

在一个实施例中,所述处理器710还用于:In one embodiment, theprocessor 710 is further configured to:

根据所述统一时钟信息确定当前时间戳;determining the 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 time stamp, and the preset time window;

根据所述第一颜色子通道的排列规则,确定第二颜色子通道的排列规则;determining the arrangement rules of the second color sub-channels according to the arrangement rules of the first color sub-channels;

根据所述第二颜色子通道的排列规则,确定第三颜色子通道的排列规则;determining the arrangement rules of the third color sub-channels according to the arrangement rules of the second color sub-channels;

其中,所述第一颜色通道包括所述第一颜色子通道、所述第二颜色子通道以及所述第三颜色子通道。Wherein, the first color channel includes the first color sub-channel, the second color sub-channel and the third color sub-channel.

在一个实施例中,所述处理器710还用于:In one embodiment, theprocessor 710 is further configured to:

根据所述第一终端的标识信息,确定第一颜色子通道的排列规则;determining an arrangement rule of the first color sub-channel according to the identification information of the first terminal;

根据所述第一颜色子通道的排列规则,确定第二颜色子通道的排列规则;determining the arrangement rules of the second color sub-channels according to the arrangement rules of the first color sub-channels;

根据所述第二颜色子通道的排列规则,确定第三颜色子通道的排列规则;determining the arrangement rules of the third color sub-channels according to the arrangement rules of the second color sub-channels;

其中,所述第一颜色通道包括所述第一颜色子通道、所述第二颜色子通道以及所述第三颜色子通道。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 rules include at least one of the following:

调整所述颜色子通道中各像素的灰度值;adjusting the gray value of each pixel in the color sub-channel;

将所述颜色子通道中的至少部分像素的灰度值,按照所述像素的横坐标进行平移;Translating the grayscale values of at least some pixels in the color sub-channel according to the abscissa of the pixel;

将所述颜色子通道中的至少部分像素的灰度值,按照所述像素的纵坐标进行平移。Translating the gray values of at least some pixels in the color sub-channel according to the ordinate of the pixels.

在一个实施例中,所述射频单元701用于:In one embodiment, theradio frequency unit 701 is used for:

接收第一终端发送的第二二维码图像以及第一颜色通道对应的排列规则;receiving the second two-dimensional code image sent by the first terminal and the arrangement rule corresponding to the first color channel;

所述处理器710用于:根据所述第一颜色通道对应的排列规则确定第一颜色通道的反向排列规则;Theprocessor 710 is configured to: determine the 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;

显示第一二维码图像。Display the first QR code image.

本申请实施例提供的电子设备,通过接收对第一二维码图像的颜色通道采用对应的排列规则进行处理后得到的第二二维码图像,可以实现对第一二维码信息的加密传输,从而避免二维码信息泄露导致的安全风险,提高了二维码传输的安全性。The electronic device provided in the embodiment of the present application can realize the encrypted transmission of the first two-dimensional code information by receiving the second two-dimensional code image obtained by processing the color channels of the first two-dimensional code image with corresponding arrangement rules , thereby avoiding the security risk caused by the information leakage of the two-dimensional code, and improving the security of the two-dimensional code transmission.

应理解的是,本申请实施例中,输入单元704可以包括图形处理器(GraphicsProcessing Unit,GPU)7041和麦克风7042,图形处理器7041对在视频捕获模式或图像捕获模式中由图像捕获装置(如摄像头)获得的静态图片或视频的图像数据进行处理。显示单元706可包括显示面板7061,可以采用液晶显示器、有机发光二极管等形式来配置显示面板7061。用户输入单元707包括触控面板7071以及其他输入设备7072。触控面板7071,也称为触摸屏。触控面板7071可包括触摸检测装置和触摸控制器两个部分。其他输入设备7072可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆,在此不再赘述。存储器709可用于存储软件程序以及各种数据,包括但不限于应用程序和操作系统。处理器710可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器710中。It should be understood that, in the embodiment of the present application, theinput unit 704 may include a graphics processor (Graphics Processing Unit, GPU) 7041 and amicrophone 7042, and thegraphics processor 7041 is compatible with the image capture device (such as Camera) to process the image data of still pictures or videos. Thedisplay unit 706 may include adisplay panel 7061, and thedisplay 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 atouch panel 7071 andother input devices 7072 . Thetouch panel 7071 is also called a touch screen. Thetouch 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, physical keyboards, function keys (such as volume control buttons, switch buttons, etc.), trackballs, mice, and joysticks, which will not be described in detail here.Memory 709 may be used to store software programs as well as various data, including but not limited to application programs and operating systems. Theprocessor 710 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, user interface, application program, etc., and the modem processor mainly processes wireless communication. It can be understood that the foregoing modem processor may not be integrated into theprocessor 710 .

本申请实施例还提供一种可读存储介质,所述可读存储介质上存储有程序或指令,该程序或指令被处理器执行时实现上述二维码处理方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。The embodiment of the present application also provides a readable storage medium, the readable storage medium stores a program or an instruction, and when the program or instruction is executed by the processor, each process of the above-mentioned two-dimensional code processing method embodiment is implemented, and can To achieve the same technical effect, in order to avoid repetition, no more details are given here.

其中,所述处理器为上述实施例中所述的电子设备中的处理器。所述可读存储介质,包括计算机可读存储介质,如计算机只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等。Wherein, the processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (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 present application further provides a chip, the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the above two-dimensional code processing method Each process of the example, and can achieve the same technical effect, in order to avoid repetition, will not repeat them here.

应理解,本申请实施例提到的芯片还可以称为系统级芯片、系统芯片、芯片系统或片上系统芯片等。It should be understood that the chips mentioned in the embodiments of the present application may also be called system-on-chip, system-on-chip, system-on-a-chip, or system-on-a-chip.

需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。此外,需要指出的是,本申请实施方式中的方法和装置的范围不限按示出或讨论的顺序来执行功能,还可包括根据所涉及的功能按基本同时的方式或按相反的顺序来执行功能,例如,可以按不同于所描述的次序来执行所描述的方法,并且还可以添加、省去、或组合各种步骤。另外,参照某些示例所描述的特征可在其他示例中被组合。It should be noted that, in this document, the term "comprising", "comprising" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article or apparatus comprising a set of elements includes not only those elements, It also includes other elements not expressly listed, or elements inherent in the process, method, article, or device. Without further limitations, an element defined by the phrase "comprising a ..." does not preclude the presence of additional identical elements in the process, method, article, or apparatus comprising that element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved. Functions are performed, for example, 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.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以计算机软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus a necessary general-purpose hardware platform, and of course also by hardware, but in many cases the former is better implementation. Based on such an understanding, the technical solution of the present application can be embodied in the form of computer software products, which are stored in a storage medium (such as ROM/RAM, magnetic disk, etc.) , optical disc), including several instructions to enable a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of the present application.

上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本申请的保护范围之内。The embodiments of the present application have been described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementations. The above-mentioned specific implementations are only illustrative and not restrictive. Those of ordinary skill in the art will Under the inspiration of the present application, without departing from the purpose of the application and the protection scope of the claims, many forms can also be made, all of which belong to the protection scope of the application.

Claims (14)

Translated fromChinese
1.一种二维码处理方法,应用于第一终端,其特征在于,包括:1. A two-dimensional code processing method, applied to the first terminal, is characterized in that, comprising:对第一二维码图像的颜色通道进行分离,并根据预定信息确定分离得到的第一颜色通道对应的排列规则;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 predetermined information;根据所述第一颜色通道对应的排列规则对所述颜色通道进行排列,获得第二颜色通道;arranging the color channels according to an 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 of the following:第一终端的标识信息;第二终端的标识信息、统一时钟信息以及预设时间窗口;其中,统一时钟为所述第一终端以及所述第二终端共用的时钟。Identification information of the first terminal; identification information of the second terminal, unified clock information, and a preset time window; wherein, the unified clock is a clock shared by the first terminal and the second terminal.2.根据权利要求1所述的二维码处理方法,其特征在于,在所述预定信息包括第二终端的标识信息、统一时钟信息以及预设时间窗口的情况下,所述根据预定信息确定分离得到的第一颜色通道对应的排列规则,包括:2. The two-dimensional code processing method according to claim 1, wherein when the predetermined information includes identification information of the second terminal, unified clock information, and a preset time window, the predetermined information determines The arrangement rules corresponding to the separated first color channel include:根据所述第二终端的标识信息、所述统一时钟信息以及所述预设时间窗口,确定所述第一颜色通道对应的排列规则。An arrangement rule corresponding to the first color channel is determined according to the identification information of the second terminal, the unified clock information, and the preset time window.3.根据权利要求2所述的二维码处理方法,其特征在于,所述根据所述第二终端的标识信息、统一时钟信息以及预设时间窗口,确定所述第一颜色通道对应的排列规则,包括:3. The two-dimensional code processing method according to claim 2, wherein the arrangement corresponding to the first color channel is determined according to the identification information of the second terminal, unified clock information, and a preset time window rules, including:根据所述统一时钟信息确定当前时间戳;determining the 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 time stamp, and the preset time window;根据所述第一颜色子通道的排列规则,确定第二颜色子通道的排列规则;determining the arrangement rules of the second color sub-channels according to the arrangement rules of the first color sub-channels;根据所述第二颜色子通道的排列规则,确定第三颜色子通道的排列规则;determining the arrangement rules of the third color sub-channels according to the arrangement rules of the second color sub-channels;其中,所述第一颜色通道包括所述第一颜色子通道、所述第二颜色子通道以及所述第三颜色子通道。Wherein, the first color channel includes the first color sub-channel, the second color sub-channel and the third color sub-channel.4.根据权利要求1所述的二维码处理方法,其特征在于,在所述预定信息包括第一终端的标识信息的情况下,所述根据预定信息确定分离得到的第一颜色通道对应的排列规则,包括:4. The two-dimensional code processing method according to claim 1, characterized in that, in the case where the predetermined information includes the identification information of the first terminal, the first color channel corresponding to the separated first color channel is determined according to the predetermined information Arrangement rules, including:根据所述第一终端的标识信息,确定第一颜色子通道的排列规则;determining an arrangement rule of the first color sub-channel according to the identification information of the first terminal;根据所述第一颜色子通道的排列规则,确定第二颜色子通道的排列规则;determining the arrangement rules of the second color sub-channels according to the arrangement rules of the first color sub-channels;根据所述第二颜色子通道的排列规则,确定第三颜色子通道的排列规则;determining the arrangement rules of the third color sub-channels according to the arrangement rules of the second color sub-channels;其中,所述第一颜色通道包括所述第一颜色子通道、所述第二颜色子通道以及所述第三颜色子通道。Wherein, the first color channel includes the first color sub-channel, the second color sub-channel and the third color sub-channel.5.根据权利要求3或4所述的二维码处理方法,其特征在于,所述排列规则包括以下至少一项:5. The two-dimensional code processing method according to claim 3 or 4, wherein the arrangement rules include at least one of the following:调整颜色子通道中各像素的灰度值;所述颜色子通道包括所述第一颜色子通道、所述第二颜色子通道、所述第三颜色子通道中的任一项;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 the grayscale values of at least some pixels in the color sub-channel according to the abscissa of the pixel;将所述颜色子通道中的至少部分像素的灰度值,按照所述像素的纵坐标进行平移。Translating the gray values of at least some pixels in the color sub-channel according to the ordinate of the pixels.6.一种二维码处理方法,应用于第二终端,其特征在于,包括:6. A two-dimensional code processing method applied to a second terminal, characterized in that it comprises:接收第一终端发送的第二二维码图像以及第一颜色通道对应的排列规则,根据所述第一颜色通道对应的排列规则确定第一颜色通道的反向排列规则;receiving the second two-dimensional code image sent by the first terminal and the arrangement rule corresponding to the first color channel, and determining the 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 the first two-dimensional code image;其中,所述第一颜色通道对应的排列规则是根据预定信息确定的;Wherein, the arrangement rule corresponding to the first color channel is determined according to predetermined information;所述预定信息包括以下任一项:The predetermined information includes any of the following:所述第一终端的标识信息;Identification information of the first terminal;所述第二终端的标识信息、统一时钟信息以及预设时间窗口;其中,统一时钟为所述第一终端以及所述第二终端共用的时钟。The identification information of the second terminal, unified clock information, and a preset time window; wherein, the unified clock is a clock shared by the first terminal and the second terminal.7.一种二维码处理装置,应用于第一终端,其特征在于,包括:7. A two-dimensional code processing device applied to a first terminal, characterized in that it comprises:规则确定模块,用于对第一二维码图像的颜色通道进行分离,并根据预定信息确定分离得到的第一颜色通道对应的排列规则;A rule determination module, configured to separate the color channels of the first two-dimensional code image, and determine the arrangement rules corresponding to the separated first color channels according to predetermined information;通道处理模块,用于根据所述第一颜色通道对应的排列规则对所述颜色通道进行排列,获得第二颜色通道;A channel processing module, configured to arrange the color channels according to the arrangement rule corresponding to the first color channel, to obtain a second color channel;二维码合成模块,用于根据所述第二颜色通道,合成第二二维码图像;A two-dimensional code synthesis module, configured to synthesize a second two-dimensional code image according to the second color channel;发送模块,用于将所述第二二维码图像发送至第二终端;a sending module, configured to send the second two-dimensional code image to a second terminal;其中,所述预定信息包括以下任一项:Wherein, the predetermined information includes any of the following:第一终端的标识信息;identification information of the first terminal;第二终端的标识信息、统一时钟信息以及预设时间窗口;其中,统一时钟为所述第一终端以及所述第二终端共用的时钟。Identification information of the second terminal, unified clock information, and a preset time window; wherein, the unified clock is a clock shared by the first terminal and the second terminal.8.根据权利要求7所述的二维码处理装置,其特征在于,在所述预定信息包括第二终端的标识信息、统一时钟信息以及预设时间窗口的情况下,所述规则确定模块具体用于:8. The two-dimensional code processing device according to claim 7, wherein when the predetermined information includes identification information of the second terminal, unified clock information, and a preset time window, the rule determining module specifically Used for:根据所述第二终端的标识信息、所述统一时钟信息以及所述预设时间窗口,确定所述第一颜色通道对应的处理规则。A processing rule corresponding to the first color channel is determined according to the identification information of the second terminal, the unified clock information, and the preset time window.9.根据权利要求8所述的二维码处理装置,其特征在于,所述规则确定模块具体用于:9. The two-dimensional code processing device according to claim 8, wherein the rule determination module is specifically used for:根据所述统一时钟信息确定当前时间戳;determining the 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 time stamp, and the preset time window;根据所述第一颜色子通道的排列规则,确定第二颜色子通道的排列规则;determining the arrangement rules of the second color sub-channels according to the arrangement rules of the first color sub-channels;根据所述第二颜色子通道的排列规则,确定第三颜色子通道的排列规则;determining the arrangement rules of the third color sub-channels according to the arrangement rules of the second color sub-channels;其中,所述第一颜色通道包括所述第一颜色子通道、所述第二颜色子通道以及所述第三颜色子通道。Wherein, the first color channel includes the first color sub-channel, the second color sub-channel and the third color sub-channel.10.根据权利要求7所述的二维码处理装置,其特征在于,在所述预定信息包括第一终端的标识信息的情况下,所述规则确定模块具体用于:10. The two-dimensional code processing device according to claim 7, wherein when the predetermined information includes the identification information of the first terminal, the rule determination module is specifically used for:根据所述第一终端的标识信息,确定第一颜色子通道的排列规则;determining an arrangement rule of the first color sub-channel according to the identification information of the first terminal;根据所述第一颜色子通道的排列规则,确定第二颜色子通道的排列规则;determining the arrangement rules of the second color sub-channels according to the arrangement rules of the first color sub-channels;根据所述第二颜色子通道的排列规则,确定第三颜色子通道的排列规则;determining the arrangement rules of the third color sub-channels according to the arrangement rules of the second color sub-channels;其中,所述第一颜色通道包括所述第一颜色子通道、所述第二颜色子通道以及所述第三颜色子通道。Wherein, the first color channel includes the first color sub-channel, the second color sub-channel and the third color sub-channel.11.根据权利要求9或10所述的二维码处理装置,其特征在于,所述排列规则包括以下至少一项:11. The two-dimensional code processing device according to claim 9 or 10, wherein the arrangement rules include at least one of the following:调整颜色子通道中各像素的灰度值;所述颜色子通道包括所述第一颜色子通道、所述第二颜色子通道、所述第三颜色子通道中的任一项;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 the grayscale values of at least some pixels in the color sub-channel according to the abscissa of the pixel;将所述颜色子通道中的至少部分像素的灰度值,按照所述像素的纵坐标进行平移。Translating the gray values of at least some pixels in the color sub-channel according to the ordinate of the pixels.12.一种二维码处理装置,应用于第二终端,其特征在于,包括:12. A two-dimensional code processing device applied to a second terminal, characterized in that it comprises:规则确定模块,用于接收第一终端发送的第二二维码图像以及第一颜色通道对应的排列规则,根据所述第一颜色通道对应的排列规则确定第一颜色通道的反向排列规则;A rule determination module, configured to receive the second two-dimensional code image sent by the first terminal and the arrangement rule corresponding to the first color channel, and determine the reverse arrangement rule of the first color channel according to the arrangement rule corresponding to the first color channel;解码模块,用于根据所述第一颜色通道的反向排列规则对所述第二二维码图像进行解码,获得第二二维码对应的第一二维码;A decoding module, configured to decode the second two-dimensional code image according to the reverse arrangement rule of the first color channel, and obtain the first two-dimensional code corresponding to the second two-dimensional code;显示模块,用于显示第一二维码图像;a display module, configured to display the first two-dimensional code image;其中,所述第一颜色通道对应的排列规则是根据预定信息确定的;Wherein, the arrangement rule corresponding to the first color channel is determined according to predetermined information;所述预定信息包括以下任一项:The predetermined information includes any of the following:所述第一终端的标识信息;Identification information of the first terminal;所述第二终端的标识信息、统一时钟信息以及预设时间窗口;其中,统一时钟为所述第一终端以及所述第二终端共用的时钟。The identification information of the second terminal, unified clock information, and a preset time window; wherein, the unified clock is a clock shared by the first terminal and the second terminal.13.一种电子设备,其特征在于,包括处理器,存储器及存储在所述存储器上并可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如权利要求1至5任一项所述的二维码处理方法的步骤,或者实现如权利要求6所述的二维码处理方法的步骤。13. An electronic device, characterized in that it includes a processor, a memory, and a program or instruction stored on the memory and operable on the processor, and the program or instruction is implemented when executed by the processor. The steps of the two-dimensional code processing method according to any one of claims 1 to 5, or the steps for realizing the two-dimensional code processing method according to claim 6.14.一种可读存储介质,其特征在于,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如权利要求1至5任一项所述的二维码处理方法的步骤,或者实现如权利要求6所述的二维码处理方法的步骤。14. A readable storage medium, characterized in that the readable storage medium stores a program or an instruction, and when the program or instruction is executed by a processor, the two-dimensional code processing method, or realize the steps of the two-dimensional code processing method as claimed in claim 6.
CN202110969699.2A2021-08-232021-08-23Two-dimensional code processing method and device and electronic equipmentActiveCN113691528B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202110969699.2ACN113691528B (en)2021-08-232021-08-23Two-dimensional code processing method and device and electronic equipment

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202110969699.2ACN113691528B (en)2021-08-232021-08-23Two-dimensional code processing method and device and electronic equipment

Publications (2)

Publication NumberPublication Date
CN113691528A CN113691528A (en)2021-11-23
CN113691528Btrue CN113691528B (en)2023-06-27

Family

ID=78581566

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202110969699.2AActiveCN113691528B (en)2021-08-232021-08-23Two-dimensional code processing method and device and electronic equipment

Country Status (1)

CountryLink
CN (1)CN113691528B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN115050147A (en)*2022-05-072022-09-13中国银行股份有限公司Service processing method, device and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
AU2018204424A1 (en)*2017-06-202019-01-17LIND, Andrew Grant MRSystem and methods for authentication and/or identification
CN112950219A (en)*2021-03-092021-06-11支付宝(杭州)信息技术有限公司Payment processing method and system

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
JP5920148B2 (en)*2012-09-282016-05-18株式会社デンソーウェーブ Confirmation system
CN103646264B (en)*2013-11-062016-07-06杭州电子科技大学A kind of dimension code anti-counterfeit method of multiple information encryption
CN104463766A (en)*2014-11-182015-03-25哈尔滨理工大学QR code encrypting and decrypting method based on ECA state ring
CN108197489A (en)*2017-12-282018-06-22上海传英信息技术有限公司A kind of processing method and processing unit for intelligent terminal secret file
CN109840574B (en)*2019-01-162022-05-17王诗会Two-dimensional code information hiding method and device, electronic equipment and storage medium
CN109978111A (en)*2019-03-132019-07-05杭州百伴生物技术有限公司Matrix two-dimensional code, its generation, coding/decoding method and its equipment
CN111428532B (en)*2020-03-172023-09-29镇江市高等专科学校Coding and decoding method capable of encrypting three-dimensional code

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
AU2018204424A1 (en)*2017-06-202019-01-17LIND, Andrew Grant MRSystem and methods for authentication and/or identification
CN112950219A (en)*2021-03-092021-06-11支付宝(杭州)信息技术有限公司Payment processing method and system

Also Published As

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

Similar Documents

PublicationPublication DateTitle
US10230921B2 (en)Mobile terminal, display apparatus and control method thereof
CN112486386B (en) Screen projection method, screen projection device, electronic device and readable storage medium
KR20190050198A (en)Electronic apparatus and communication method thereof
WO2019148023A1 (en)Watermark processing method and device
US20210158577A1 (en)Method for Adding Special Effect to Video, Electronic Device and Storage Medium
US20180103234A1 (en)Device and method of displaying images
EP2632079A1 (en)Online terminal
CN113691528B (en)Two-dimensional code processing method and device and electronic equipment
EP4361790A1 (en)Display method and electronic device
CN116432772A (en)Federal learning method and device for privacy protection, electronic equipment and medium
CN105046166A (en)Image safe sharing implementing method and system
US11977810B2 (en)Multi-screen collaborative display method and electronic device
WO2023030519A1 (en)Screen projection processing method and related device
EP4164235A1 (en)Screen sharing method, terminal, and storage medium
CN112947876B (en)Display control method, display control device, electronic device, and medium
CN110190947B (en)Information encryption and decryption method, terminal and computer readable storage medium
CN112506460A (en)Screen control authority sharing method and device, terminal and storage medium
US20230214963A1 (en)Data processing method and apparatus, and electronic device
CN106375787A (en) Method and device for playing video
CN113518143B (en)Interface input source switching method and device, electronic equipment and storage medium
CN112734866B (en)Image processing method, terminal and storage medium
CN107229889A (en)A kind of operating method based on Quick Response Code, equipment and computer-readable recording medium
US9407938B2 (en)Method for processing image and electronic device for the method
CN115701017B (en)Image processing method and device
US9799138B2 (en)Device and method for processing three-dimensional lighting

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp