CN115687814A - Two-dimensional code processing method and device - Google Patents
Two-dimensional code processing method and device Download PDFInfo
- Publication number
- CN115687814A CN115687814A CN202211401495.XA CN202211401495A CN115687814A CN 115687814 A CN115687814 A CN 115687814A CN 202211401495 A CN202211401495 A CN 202211401495A CN 115687814 A CN115687814 A CN 115687814A
- Authority
- CN
- China
- Prior art keywords
- dimensional code
- code
- identification
- scanning
- electronic device
- 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.)
- Pending
Links
Images
Landscapes
- Telephone Function (AREA)
Abstract
Description
技术领域technical field
本申请涉及二维码应用技术领域,尤其涉及一种二维码处理方法及装置。The present application relates to the technical field of two-dimensional code application, in particular to a two-dimensional code processing method and device.
背景技术Background technique
随着二维码的广泛使用,用户通过手机扫描二维码的次数也增多。用户在每次扫描二维码时要打开某个应用程序(如微信或支付宝),通过该应用程序调用摄像头扫描二维码,扫码结果通过该应用程序显示,这一过程较为耗时,存在扫码慢的问题。With the widespread use of QR codes, the number of times users scan QR codes with their mobile phones has also increased. Every time the user scans the QR code, he needs to open an application (such as WeChat or Alipay), use the application to call the camera to scan the QR code, and the scanning result will be displayed through the application. This process is time-consuming and has The problem of slow scanning.
发明内容Contents of the invention
本申请提供了一种二维码处理方法及装置,目的在于解决扫码慢的问题。为了实现上述目的,本申请提供了以下技术方案:The present application provides a two-dimensional code processing method and device, aiming at solving the problem of slow code scanning. In order to achieve the above object, the application provides the following technical solutions:
第一方面,本申请提供一种二维码处理方法,方法应用于电子设备中,电子设备显示至少一个二维码标识,二维码标识对应一个二维码,方法包括:接收对二维码标识的操作;响应对二维码标识的操作,显示二维码标识对应的二维码的扫码结果。例如下述结合场所码对二维码处理方法的说明,电子设备可以显示场所码标识(场所码标识是二维码为场所码时,二维码标识的示例),在用户点击场所码标识后,电子设备响应用户对场所码标识的点击操作,显示该场所码的扫码结果。由此电子设备通过点击二维码标识即可显示二维码的扫码结果,完成了对二维码的扫码,省去了开启应用程序、开启应用程序的“扫一扫”功能、调用摄像头拍摄场所码的图像的环节,简化二维码的处理过程且降低了耗时,解决了扫码慢的问题。并且因为省去“摄像头拍摄场所码的图像”的环节,二维码码的处理不再受到扫码因素影响,提高扫码成功率和扫码效率,进一步降低耗时,解决了扫码慢的问题。In the first aspect, the present application provides a two-dimensional code processing method, the method is applied to an electronic device, the electronic device displays at least one two-dimensional code identification, and the two-dimensional code identification corresponds to one two-dimensional code, the method includes: receiving the two-dimensional code The operation of the identification; in response to the operation on the two-dimensional code identification, display the scanning result of the two-dimensional code corresponding to the two-dimensional code identification. For example, the following description of the method for processing two-dimensional codes combined with the location code, the electronic device can display the location code logo (the location code logo is an example of the two-dimensional code logo when the two-dimensional code is the location code), after the user clicks the location code logo , the electronic device responds to the user's click operation on the location code identification, and displays the code scanning result of the location code. Thus, the electronic device can display the scanning result of the two-dimensional code by clicking on the two-dimensional code logo, completing the scanning of the two-dimensional code, eliminating the need to open the application program, open the "scan" function of the application program, call The camera captures the image of the location code, which simplifies the processing process of the two-dimensional code and reduces the time-consuming, which solves the problem of slow code scanning. And because the link of "the image of the location code captured by the camera" is omitted, the processing of the QR code is no longer affected by the scanning factors, which improves the success rate and efficiency of scanning codes, further reduces time-consuming, and solves the problem of slow code scanning. question.
可选的,方法还包括:获取电子设备当前的位置信息;突出显示与位置信息匹配的二维码标识,以使得与当前的位置信息匹配的二维码标识更加容易被用户识别。突出显示可以是与位置信息匹配的二维码标识的显示方式与其他二维码标识的显示方式不同,如与位置信息匹配的二维码标识以第一显示方式显示,其他二维码标识以第二显示方式显示,第一显示方式采用的颜色比第二显示方式采用的颜色明亮,和/或,第一显示方式采用的字体比第二显示方式采用的字体突出,字体突出可以是字体大、字体增加特效等等。Optionally, the method further includes: acquiring the current location information of the electronic device; highlighting the two-dimensional code identification matching the location information, so that the two-dimensional code identification matching the current location information is more easily recognized by the user. The highlighting may be that the display mode of the two-dimensional code identification matching the position information is different from that of other two-dimensional code identifications, for example, the two-dimensional code identification matching the position information is displayed in the first display mode, and the other two-dimensional code identifications are displayed in the The second display mode shows that the color used in the first display mode is brighter than the color used in the second display mode, and/or, the font used in the first display mode is more prominent than the font used in the second display mode, and the prominent font can be a larger font , fonts to increase special effects and so on.
可选的,突出显示与位置信息匹配的二维码标识包括:在所有二维码标识的第一位显示与位置信息匹配的二维码标识。仍以二维码标识是场所码标识为例,多个场所码标识可以排列在一张卡片上显示,在位置信息指示用户到达一个特定场所时,将该特定场所的场所码标识置顶,置顶是指排序在第一位,这样用户可以在不翻动卡片的情况下找到与位置信息匹配的场所码标识。Optionally, highlighting the two-dimensional code identification matching the location information includes: displaying the two-dimensional code identification matching the location information in the first digit of all the two-dimensional code identifications. Still taking the QR code logo as an example of a location code logo, multiple location code logos can be displayed on a card, and when the location information indicates that the user has arrived at a specific location, the location code logo of the specific location will be set to the top. Refers to the sorting at the first place, so that the user can find the place code identification that matches the location information without flipping the card.
可选的,二维码标识以二维码标识对应的位置信息命名,方便用户在到达一个位置信息时,找到与该位置信息匹配的二维码标识。例如场所码是特定场所A的场所码,以特定场所A命名该场所码标识;场所码是特定场所B的场所码,以特定场所B命名该场所码标识,这样方便用户找到当前所处特定场所的场所码。Optionally, the two-dimensional code logo is named after the location information corresponding to the two-dimensional code logo, so that when a user arrives at a piece of location information, he can find the two-dimensional code logo that matches the location information. For example, the site code is the site code of a specific site A, and the site code is named after the specific site A; the site code is the site code of the specific site B, and the site code is named after the specific site B, so that users can find the current specific site. location code.
可选的,响应对二维码标识的操作,显示二维码标识对应的二维码的扫码结果包括:响应对二维码标识的操作,向服务器发送二维码标识对应的二维码的快速响应值;接收服务器发送的扫码结果,扫码结果是由服务器基于快速响应值得到;显示扫码结果,通过二维码的快速响应值完成对二维码的扫描,并且二维码的快速响应值相对于二维码的图像来说,其数据量减少,从而提高效率。Optionally, in response to the operation on the two-dimensional code identification, displaying the scanning result of the two-dimensional code corresponding to the two-dimensional code identification includes: responding to the operation on the two-dimensional code identification, sending the two-dimensional code corresponding to the two-dimensional code identification to the server The quick response value of the QR code; receive the scanning result sent by the server, and the scanning result is obtained by the server based on the quick response value; display the scanning result, complete the scanning of the QR code through the QR code's quick response value, and the QR code Compared with the image of the two-dimensional code, the fast response value of the QR code reduces the amount of data, thereby improving the efficiency.
可选的,在接收对二维码标识的操作之前,方法还包括:保存二维码的快速响应值,快速响应值值占用的存储空间小于图像占用的存储空间,因此电子设备存储二维码的快速响应值,降低了对存储空间的占用。Optionally, before receiving the operation on the two-dimensional code identification, the method further includes: saving the quick response value of the two-dimensional code, the storage space occupied by the quick response value is smaller than the storage space occupied by the image, so the electronic device stores the two-dimensional code The fast response value reduces the storage space usage.
可选的,保存二维码的快速响应值包括:在二维码为预设类型二维码时,保存二维码的快速响应值。Optionally, storing the quick response value of the two-dimensional code includes: saving the quick response value of the two-dimensional code when the two-dimensional code is a preset type of two-dimensional code.
可选的,在二维码为预设类型二维码时,保存二维码的快速响应值包括:在二维码为场所码时,保存二维码的快速响应值;和/或,在二维码的快速响应值位于白名单中时,保存二维码的快速响应值,白名单中存储快速响应值是固定值的二维码的快速响应值。Optionally, when the two-dimensional code is a preset type of two-dimensional code, saving the quick response value of the two-dimensional code includes: when the two-dimensional code is a place code, saving the quick response value of the two-dimensional code; and/or, in When the quick response value of the two-dimensional code is in the white list, the quick response value of the two-dimensional code is saved, and the quick response value of the two-dimensional code whose quick response value is a fixed value is stored in the white list.
可选的,在接收对二维码标识的操作之前,方法还包括:响应于对二维码的扫码指令,调用电子设备的摄像头拍摄二维码,得到二维码的图像;向服务器发送二维码的图像;接收服务器对二维码的图像的解析结果;在解析结果表示成功对二维码的图像解析后,对二维码的图像进行解码,得到二维码的快速响应值,二维码的快速响应值用于在响应对二维码标识的操作时得到扫码结果;生成二维码的二维码标识,二维码标识能够显示在电子设备中。其中,二维码的快速响应值是服务器能够成功解析的二维码的图像的快速响应值,因此,二维码的快速响应值可以使服务器还原出能够成功解析的二维码的图像,这样在用户点击二维码标识后,电子设备向服务器发送该二维码的快速响应值,服务器可以还原出能够成功解析的二维码的图像,提高扫码成功率。如果解析结果表示解析失败,电子设备可以继续向服务器发送二维码的图像直接服务器解析成功,在这种情况下,二维码的快速响应值是电子设备送图的最后一帧图像的快速响应值,最后一帧图像是服务器成功解析的图像,使得电子设备可以得到服务器成功解析的二维码的图像的快速响应值,便于后续服务器仍可以成功解析,提高扫码成功率。Optionally, before receiving the operation on the two-dimensional code identification, the method further includes: in response to the instruction to scan the two-dimensional code, calling the camera of the electronic device to capture the two-dimensional code to obtain the image of the two-dimensional code; The image of the two-dimensional code; receiving the analysis result of the image of the two-dimensional code by the server; after the analysis result indicates that the image of the two-dimensional code is successfully analyzed, the image of the two-dimensional code is decoded to obtain the quick response value of the two-dimensional code, The quick response value of the two-dimensional code is used to obtain the scanning result when responding to the operation on the two-dimensional code mark; the two-dimensional code mark of the two-dimensional code is generated, and the two-dimensional code mark can be displayed in the electronic device. Wherein, the fast response value of the two-dimensional code is the fast response value of the image of the two-dimensional code that the server can successfully parse, therefore, the fast response value of the two-dimensional code can enable the server to restore the image of the two-dimensional code that can be successfully parsed, thus After the user clicks on the two-dimensional code logo, the electronic device sends the quick response value of the two-dimensional code to the server, and the server can restore the image of the two-dimensional code that can be successfully parsed, improving the success rate of scanning the code. If the analysis result indicates that the analysis fails, the electronic device can continue to send the image of the QR code to the server, and the server can directly analyze it successfully. In this case, the quick response value of the QR code is the quick response of the last frame image sent by the electronic device Value, the last frame image is the image successfully parsed by the server, so that the electronic device can obtain the quick response value of the QR code image successfully parsed by the server, so that the subsequent server can still successfully parse and improve the success rate of scanning codes.
可选的,在生成二维码的二维码标识后,方法还包括:显示与二维码标识对应的提示信息。该提示信息主要用于提示用户,电子设备正在生成一个二维码标识,在下次扫描该二维码时,用户可以直接点击该二维码标识。该提示信息是由电子设备的操作系统完成,对于二维码提供商来说,该提示信息是无感知的。Optionally, after the two-dimensional code identification of the two-dimensional code is generated, the method further includes: displaying prompt information corresponding to the two-dimensional code identification. The prompt information is mainly used to prompt the user that the electronic device is generating a two-dimensional code logo, and the user can directly click on the two-dimensional code logo when scanning the two-dimensional code next time. The prompt information is completed by the operating system of the electronic device, and for the two-dimensional code provider, the prompt information is imperceptible.
可选的,电子设备的应用程序层包括二维码标识应用程序,二维码标识应用程序用于显示至少一个二维码标识;二维码标识应用程序还用于接收对二维码标识的操作,响应对二维码标识的操作,触发扫码应用程序显示二维码标识对应的二维码的扫码结果,扫码应用程序位于应用程序层。如二维码标识应用程序可以是下述图8中的场所码标识卡片,利用场所码标识卡片显示场所码标识,场所码标识卡片用于响应对场所码标识的操作,触发图8中的扫码工具显示场所码的扫码结果。Optionally, the application layer of the electronic device includes a two-dimensional code identification application program, and the two-dimensional code identification application program is used to display at least one two-dimensional code identification; the two-dimensional code identification application program is also used to receive the two-dimensional code identification application Operation, in response to the operation on the two-dimensional code identification, trigger the code scanning application to display the scanning result of the two-dimensional code corresponding to the two-dimensional code identification, and the scanning application is located in the application layer. For example, the two-dimensional code identification application program can be the location code identification card in Figure 8 below, and the location code identification card is used to display the location code identification. The code tool displays the scanning result of the site code.
本申请提供一种电子设备,电子设备包括:一个或多个处理器;一个或多个存储器;存储器存储有一个或多个程序,当一个或者多个程序被处理器执行时,使得电子设备执行上述二维码处理方法。The present application provides an electronic device, the electronic device includes: one or more processors; one or more memories; the memory stores one or more programs, and when the one or more programs are executed by the processor, the electronic device executes The above two-dimensional code processing method.
本申请提供一种计算机可读存储介质,计算机可读存储介质中存储了计算机程序,当计算机程序被处理器执行时,使得处理器执行上述二维码处理方法。The present application provides a computer-readable storage medium. A computer program is stored in the computer-readable storage medium. When the computer program is executed by a processor, the processor is made to execute the above two-dimensional code processing method.
附图说明Description of drawings
图1至图3为扫描场所码的示意图;Figures 1 to 3 are schematic diagrams of scanning site codes;
图4为本申请提供的扫描场所码至显示扫码结果的示意图;Fig. 4 is a schematic diagram of scanning site codes to display scanning code results provided by this application;
图5为本申请提供的利用场所码标识显示扫码结果的示意图;Fig. 5 is a schematic diagram of displaying the code scanning result by using the site code identification provided by this application;
图6为本申请提供的二维码处理方法的流程图;Fig. 6 is a flow chart of the two-dimensional code processing method provided by the present application;
图7为本申请提供的电子设备的硬件结构图;FIG. 7 is a hardware structural diagram of the electronic device provided by the present application;
图8为本申请提供的电子设备的软硬件架构图;FIG. 8 is a software and hardware architecture diagram of the electronic device provided by the present application;
图9为本申请提供的扫描场所码至显示扫码结果时软硬件交互的示意图;Fig. 9 is a schematic diagram of the interaction between software and hardware when scanning the site code to display the scanning result provided by the application;
图10为本申请提供的利用场所码标识显示扫码结果时软硬件交互的示意图。FIG. 10 is a schematic diagram of software and hardware interaction when displaying code scanning results using location code identification provided by the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。以下实施例中所使用的术语只是为了描述特定实施例的目的,而并非旨在作为对本申请的限制。如在本申请的说明书和所附权利要求书中所使用的那样,单数表达形式“一个”、“一种”、“所述”、“上述”、“该”和“这一”旨在也包括例如“一个或多个”这种表达形式,除非其上下文中明确地有相反指示。还应当理解,在本申请实施例中,“一个或多个”是指一个、两个或两个以上;“和/或”,描述关联对象的关联关系,表示可以存在三种关系;例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A、 B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. The terms used in the following examples are for the purpose of describing particular examples only, and are not intended to limit the application. As used in the specification and appended claims of this application, the singular expressions "a", "an", "said", "above", "the" and "this" are intended to also Expressions such as "one or more" are included unless the context clearly dictates otherwise. It should also be understood that in the embodiments of the present application, "one or more" refers to one, two or more than two; "and/or" describes the association relationship of associated objects, indicating that there may be three types of relationships; for example, A and/or B may mean: A exists alone, A and B exist simultaneously, and B exists alone, wherein A and B may be singular or plural. The character "/" generally indicates that the contextual objects are an "or" relationship.
在本说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。Reference to "one embodiment" or "some embodiments" or the like in this specification means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in other embodiments," etc. in various places in this specification are not necessarily All refer to the same embodiment, but mean "one or more but not all embodiments" unless specifically stated otherwise. The terms "including", "comprising", "having" and variations thereof mean "including but not limited to", unless specifically stated otherwise.
本申请实施例涉及的多个,是指大于或等于两个。需要说明的是,在本申请实施例的描述中,“第一”、“第二”等词汇,仅用于区分描述的目的,而不能理解为指示或暗示相对重要性,也不能理解为指示或暗示顺序。A plurality referred to in the embodiment of the present application means greater than or equal to two. It should be noted that in the description of the embodiments of the present application, words such as "first" and "second" are only used to distinguish the purpose of description, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or imply order.
用户在出入特定场所时可以扫描该特定场所的场所码,以通过扫描该场所码确认用户出入过该特定场所以及确认是否存在风险等。如图1,特定场所1的出入口放置有场所码,用户在进入特定场所1时扫描特定场所1的场所码。如图2所示,特定场所2的出入口可以放置有场所码,用户在进入特定场所2时扫描特定场所2的场所码。如图3所示,特定场所3的出入口可以放置有场所码,用户在进入特定场所3时扫描特定场所3的场所码。虽然特定场所的场所码是固定的,但是用户每次进入特定场所时都要扫描特定场所的场所码。When a user enters or exits a specific place, he or she can scan the code of the specific place to confirm that the user has been in or out of the specific place and whether there is a risk by scanning the code. As shown in FIG. 1 , a place code is placed at the entrance and exit of a
以手机扫描场所码为例,手机扫描场所码到显示扫码结果的过程如图4所示。手机的桌面具有图4中的(1)所示标记为“扫码工具”的应用程序,该应用程序可以是微信或支付宝,用户打开图4中的(1)所示桌面上标记为“扫码工具”的应用程序。该应用程序具有“扫一扫”功能,用户在打开应用程序后可以开启该应用程序的“扫一扫”功能,手机跳转至图4中的(2)所示扫描界面,此时用户可以将手机对准场所码,通过手机扫描场所码,手机采用图4中的(3)所示方式显示正在扫描的场所码。在手机接收到扫码结果后,跳转至图4中的(4)显示扫码结果,图4中的(4)示出了扫码结果的一种示例。Taking mobile phone scanning site code as an example, the process from mobile phone scanning site code to displaying the scanning result is shown in Figure 4. The desktop of the mobile phone has an application program marked as "code scanning tool" shown in (1) in Figure 4, which can be WeChat or Alipay. Code Tool" application. The application has a "sweep" function. After opening the application, the user can open the "scan" function of the application, and the mobile phone jumps to the scanning interface shown in (2) in Figure 4. At this time, the user can Point the mobile phone at the location code, scan the location code through the mobile phone, and the mobile phone will display the scanning location code in the manner shown in (3) in Figure 4. After the mobile phone receives the code-scanning result, it jumps to (4) in FIG. 4 to display the code-scanning result. (4) in FIG. 4 shows an example of the code-scanning result.
其中,手机扫描场所码是通过手机的摄像头完成,在应用程序开启了“扫一扫”功能后,应用程序开启了手机的摄像头,调用摄像头拍摄场所码的图像。应用程序将场所码的图像发送给服务器,服务器是应用程序提供商的服务器,由服务器对场所码的图像进行解析,解析结果反馈给手机。如果手机接收到解析失败的解析结果,向服务器再次发送场所码的图像,该场所码的图像是摄像头再次拍摄到的图像;如果手机接收到解析成功的解析结果,停止向服务器发送场所码的图像,在手机上显示扫码结果的界面。由此,在手机扫描场所码过程中,手机可以向服务器发送多帧场所码的图像,直至服务器获取到场所码的完整信息,能够成功场所码解析。在一些示例中,手机接收到服务器的解析结果后,对场所码的图像进行标记,如标记该场所码的图像是否被成功解析。Among them, the mobile phone scans the site code through the camera of the mobile phone. After the app opens the "scan" function, the app opens the camera of the mobile phone and calls the camera to capture the image of the site code. The application program sends the image of the site code to the server. The server is the server of the application program provider. The server analyzes the image of the site code, and the analysis result is fed back to the mobile phone. If the mobile phone receives the analysis result of the analysis failure, it sends the image of the location code to the server again, and the image of the location code is the image captured by the camera again; if the mobile phone receives the analysis result of the successful analysis, it stops sending the image of the location code to the server , and the screen of the code scanning result is displayed on the mobile phone. Therefore, during the process of scanning the site code by the mobile phone, the mobile phone can send multiple frames of site code images to the server until the server obtains complete information of the site code and can successfully analyze the site code. In some examples, after receiving the parsing result from the server, the mobile phone marks the image of the location code, such as marking whether the image of the location code is successfully parsed.
综上,虽然特定场所的场所码固定,但是用户每次进入特定场所时要开启手机中的应用程序,打开该应用程序的“扫一扫”功能,然后调用摄像头对场所码进行拍照,得到场所码的图像,等待场所码的图像的解析结果,这一过程较为繁琐且耗时,存在扫码慢的问题。并且手机对场所码的处理,受到环境光照亮度、扫码角度、摄像头规格、摄像头调校、通信网络以及服务器响应速度等扫码因素影响,使得手机向服务器发送多帧场所码的图像后接收到解析结果,进一步增加了耗时。To sum up, although the location code of a specific place is fixed, every time the user enters a specific place, he needs to open the application in the mobile phone, open the "scan" function of the application, and then call the camera to take pictures of the location code to get the location The image of the code, waiting for the analysis result of the image of the site code, this process is cumbersome and time-consuming, and there is a problem of slow scanning. In addition, the mobile phone's processing of the site code is affected by factors such as ambient light brightness, scanning angle, camera specifications, camera adjustment, communication network, and server response speed, so that the mobile phone sends multiple frames of site code images to the server and receives Analyzing the results further increases the time-consuming.
针对这一问题,本申请提供一种二维码处理方法,在确定完成场所码的处理后,在桌面显示场所码标识;响应对场所码标识的点击操作,显示场所码的扫码结果,省去了开启应用程序、开启应用程序的“扫一扫”功能、调用摄像头拍摄场所码的图像的环节,简化场所码的处理过程且降低了耗时,解决了扫码慢的问题。并且因为省去“摄像头拍摄场所码的图像”的环节,场所码的处理不再受到上述扫码因素影响,提高扫码成功率和扫码效率,进一步降低耗时,解决了扫码慢的问题。In response to this problem, this application provides a two-dimensional code processing method. After the processing of the location code is confirmed, the location code logo is displayed on the desktop; in response to the click operation on the location code logo, the scanning result of the location code is displayed, saving The link of opening the application, opening the "scan" function of the application, and calling the camera to capture the image of the location code is eliminated, which simplifies the processing process of the location code and reduces time-consuming, and solves the problem of slow scanning. And because the link of "the image of the location code captured by the camera" is omitted, the processing of the location code is no longer affected by the above scanning factors, which improves the success rate and efficiency of scanning codes, further reduces time-consuming, and solves the problem of slow code scanning .
如图5所示,在用户完成特定场所1的场所码、特定场所2的场所码和特定场所3的场所码的处理后,在手机桌面上建立(即生成)这些场所码标识,如图5中的(1)所示。场所码标识显示在一张卡片中,如图5中的(2)所示。在用户点击任一场所码标识后,跳转至图5中的(3)所示界面,显示场所码的扫码结果。在用户点击任一场所码标识后,手机在后台运行场所码的处理,其过程包括手机将场所码的快速响应(Quick Response, QR)值发送给服务器,服务器根据该QR值得到扫码结果,场所码的QR值是手机上一次成功解析场所码时使用的图像的QR值。As shown in Figure 5, after the user completes the processing of the site code of the
图6示出了二维码处理方法的流程,可以包括以下步骤:Figure 6 shows the flow of the two-dimensional code processing method, which may include the following steps:
S101、手机打开了应用程序的扫一扫功能。S101, the mobile phone opens the scanning function of the application program.
S102、手机触发扫码侦测机制。在手机打开应用程序的扫一扫功能后,手机能够感知到当前处于扫码场景。如手机打开了微信应用程序或支付宝应用程序的扫一扫功能,手机确定当前处于扫码场景,则手机触发扫码侦测机制,扫码侦测机制主要是为了侦测扫码是否成功,在手机开启了建立场所码标识的功能的情况下,在扫码成功后手机可以在桌面建立场所码标识。S102. The mobile phone triggers a code scanning detection mechanism. After the mobile phone opens the scanning function of the application, the mobile phone can perceive that it is currently in the scanning scene. If the mobile phone opens the scan function of the WeChat application or the Alipay application, and the mobile phone determines that it is currently in the scanning scene, the mobile phone will trigger the scanning detection mechanism. The scanning detection mechanism is mainly to detect whether the scanning is successful. If the mobile phone has enabled the function of establishing a site code identification, the mobile phone can create a site code identification on the desktop after scanning the code successfully.
S103、手机确定扫码成功后,对送图的最后一帧图像进行解码,得到最后一帧图像的 QR值。S103. After the mobile phone determines that the code scanning is successful, it decodes the last frame of image sent to obtain the QR value of the last frame of image.
在扫码成功后,手机可以显示扫码结果。手机从开始扫描场所码至扫码成功的过程中,手机可以调用摄像头拍摄场所码的图像,在拍摄到场所码的第一帧图像后,手机将第一帧图像发送给服务器,服务器对第一帧图像进行解析;如果服务器解析失败,服务器向手机反馈解析失败的解析结果。手机在接收到解析失败的解析结果后,向服务器发送场所码的第二帧图像;服务器对第二帧图像进行解析;如果服务器再次解析失败,继续向手机反馈解析失败的解析结果,手机则继续向服务器发送场所码的第三帧图像,……以此类推,直至服务器向手机反馈解析成功的解析结果,解析成功的解析结果表示扫码成功,手机可以终止向服务器发送场所码的图像。例如服务器对第五帧图像解析成功,第五帧图像则是送图的最后一帧图像。After the code is scanned successfully, the mobile phone can display the code scanning result. During the process from the beginning of scanning the site code to the successful scanning of the mobile phone, the mobile phone can call the camera to capture the image of the site code. After capturing the first frame image of the site code, the mobile phone will send the first frame image to the server. The frame image is parsed; if the server fails to parse, the server feeds back the parsing result of the parsing failure to the mobile phone. After the mobile phone receives the analysis result of the analysis failure, it sends the second frame image of the site code to the server; the server analyzes the second frame image; if the server fails to analyze again, it continues to feed back the analysis result of the analysis failure to the mobile phone, and the mobile phone continues Send the third frame image of the location code to the server, and so on, until the server feeds back the analysis result of the successful analysis to the mobile phone. The successful analysis result indicates that the scanning is successful, and the mobile phone can stop sending the image of the location code to the server. For example, the server successfully parses the fifth frame of image, and the fifth frame of image is the last frame of image sent.
也就是说,送图的最后一帧图像是手机发送给服务器的场所码的最后一帧图像,服务器对最后一帧图像成功解析,相对应的手机利用最后一帧图像完成扫码且扫码成功。手机可以对最后一帧图像进行解码,得到最后一帧图像的QR值,最后一帧图像的QR值是一串字符串,通过QR值可以还原出最后一帧图像。That is to say, the last frame image sent is the last frame image of the site code sent by the mobile phone to the server. The server successfully parses the last frame image, and the corresponding mobile phone uses the last frame image to complete the code scanning and the code scanning is successful. . The mobile phone can decode the last frame of image to obtain the QR value of the last frame of image. The QR value of the last frame of image is a string of character strings, and the last frame of image can be restored through the QR value.
S104、手机在确定QR值为场所码的QR值时,存储场所码的QR值。一个场所码存储一个QR值,QR值占用的存储空间小于图像占用的存储空间,因此手机存储场所码的 QR值,降低了对存储空间的占用。在一些示例中,手机可以存储场所码的最后一帧图像,如将场所码最后一帧图像存储在相册中。S104. When the mobile phone determines that the QR value is the QR value of the location code, store the QR value of the location code. A location code stores a QR value, and the storage space occupied by the QR value is smaller than the storage space occupied by the image, so the mobile phone stores the QR value of the location code, reducing the occupation of storage space. In some examples, the mobile phone may store the last frame image of the location code, for example, store the last frame image of the location code in the photo album.
一般情况下,任一特定场所的场所码的图形是固定的,意味着场所码的QR值也是固定的,通过该QR值可以还原出场所码的一帧图像,还原出的场所码的图像是之前服务器成功解析的场所码的最后一帧图像,因此服务器利用场所码的QR值能够可以成功解析,基于此,手机可以存储场所码的QR值。场所码是由政府部门制作,每个场所码的QR值存在政府的域名,因此手机在获得一个QR值后,检查QR值是否包含.gov.cn这个政府域名的字符串,其中QR值是一串字符串,手机检查QR值的字符串是否包含.gov.cn,如果 QR值包含.gov.cn,确定QR值是场所码的QR值。In general, the pattern of the location code of any specific location is fixed, which means that the QR value of the location code is also fixed. Through this QR value, one frame of image of the location code can be restored, and the restored image of the location code is The last frame image of the venue code successfully parsed by the server before, so the server can successfully parse it using the QR value of the venue code. Based on this, the mobile phone can store the QR value of the venue code. The location code is made by the government department, and the QR value of each location code exists in the government domain name. Therefore, after the mobile phone obtains a QR value, it checks whether the QR value contains the string of the government domain name .gov.cn, where the QR value is a string, the mobile phone checks whether the string of the QR value contains .gov.cn, and if the QR value contains .gov.cn, it is determined that the QR value is the QR value of the venue code.
在一些示例中,手机在开启了场所码标识建立功能后,存储场所码的QR值;手机在关闭了场所码标识建立功能后,不再存储QR值。在手机关闭场所码标识建立功能后,存储的历史QR值可以保留,也可以删除,不进行限定。In some examples, the mobile phone stores the QR value of the site code after the function of establishing the site code identification is turned on; the mobile phone does not store the QR value after the function of establishing the site code identification is turned off. After the location code identification creation function is turned off on the mobile phone, the stored historical QR value can be retained or deleted without limitation.
在一些示例中,手机在第一次成功扫描一个场所码后,存储该场所码的QR值,这样对于用户曾经到过的任一特定场所,手机可以存储该特定场所的场所码的QR值,用户再次到这些特定场所时,手机可以直接调用存储的QR值,省去手机再次拍摄场所码的图像的环节。该示例可以与手机是否开启场所码标识建立功能相结合,此处不再阐述。In some examples, the mobile phone stores the QR value of the venue code after successfully scanning the venue code for the first time, so that for any specific venue that the user has ever been to, the mobile phone can store the QR value of the venue code of the specific venue, When the user goes to these specific places again, the mobile phone can directly call the stored QR value, eliminating the need for the mobile phone to take another image of the place code. This example may be combined with whether the mobile phone enables the location code identification establishment function, which will not be described here.
在一些示例中,手机每次成功扫描一个场所码后,记录成功扫描该场所码的次数,在次数大于或等于预设次数时,存储该场所码的QR值。在一个场所码成功扫描的次数大于或等于预设次数时,说明用户经常去该场所码指向的特定场所,那么该场所码被再次扫描的可能性较大,手机可以存储这些场所码的QR值,在降低存储空间占用的同时,提高了命中率。该示例可以与手机是否开启场所码标识建立功能相结合,此处不再阐述。In some examples, each time the mobile phone successfully scans a location code, it records the number of successful scans of the location code, and stores the QR value of the location code when the number of times is greater than or equal to the preset number of times. When the number of successful scans of a place code is greater than or equal to the preset number of times, it means that the user often goes to the specific place pointed to by the place code, so the possibility of the place code being scanned again is high, and the mobile phone can store the QR values of these place codes , while reducing the storage space occupied, the hit rate is improved. This example may be combined with whether the mobile phone enables the location code identification establishment function, which will not be described here.
手机在完成场所码的QR值存储后,手机可以监测场所码的QR值的使用情况,根据场所码的QR值的使用情况,控制场所码的QR值的存储。一种可能的实现方式是:手机删除使用次数较少的场所码的QR值,可以是周期性删除,也可以是不定期删除;另一种可能的实现方式是:手机根据场所码的QR值的使用次数,控制同一个卡片中场所码的排序,如使用次数较多的场所码的QR值,排序越靠前。After the mobile phone finishes storing the QR value of the location code, the mobile phone can monitor the use of the QR value of the location code, and control the storage of the QR value of the location code according to the usage of the QR value of the location code. One possible implementation method is: the mobile phone deletes the QR value of the location code that is used less frequently, either periodically or irregularly; another possible implementation method is: the mobile phone deletes the QR value of the location code according to the QR value of the location code The number of times of use controls the sorting of the location codes in the same card. For example, the QR value of the location code that is used more times is ranked higher.
S105、手机调用位置信息接口,获取扫描场所码时的位置信息,该位置信息指向了场所码对应的特定场所的名称。S105. The mobile phone invokes the location information interface to obtain the location information when the location code is scanned, and the location information points to the name of the specific location corresponding to the location code.
S106、手机建立场所码标识和该场所码的地理围栏,并在桌面上显示场所码标识。S106. The mobile phone establishes a location code identifier and a geofence of the location code, and displays the location code identifier on the desktop.
手机建立场所码标识时可以显示一个提示信息,该提示信息主要用于提示用户,手机正在建立一个场所码标识,在下次扫描该场所码时,用户可以直接点击该场所码标识。该提示信息是由手机的操作系统完成,对于场所码提供商来说,该提示信息是无感知的。When the mobile phone establishes a location code identification, it can display a prompt message, which is mainly used to remind the user that the mobile phone is creating a location code identification, and the user can directly click on the location code identification when scanning the location code next time. The prompt information is completed by the operating system of the mobile phone, and for the location code provider, the prompt information is imperceptible.
场所码标识可以以场所码对应的特定场所的名称命名,在提示用户时可以将场所码的名称提示给用户。例如场所码是特定场所1的场所码,以特定场所1命名该场所码标识;场所码是特定场所2的场所码,以特定场所2命名该场所码标识,这样方便用户找到当前所处特定场所的场所码。The place code identification can be named after the name of the specific place corresponding to the place code, and the name of the place code can be prompted to the user when prompting the user. For example, the site code is the site code of a
场所码标识在桌面上的显示是可以变化的,如在一些示例中,与用户位置信息匹配的场所码标识以第一显示方式显示,其他场所码标识以第二显示方式显示,第一显示方式使得与用户位置信息匹配的场所码标识突出显示,突出显示的目的是为了使得与用户位置信息匹配的场所码标识更加容易被用户识别。例如,第一显示方式采用的颜色比第二显示方式采用的颜色明亮,和/或,第一显示方式采用的字体比第二显示方式采用的字体突出,字体突出可以是字体大、字体增加特效等等。The display of the site code identification on the desktop can be changed. For example, in some examples, the site code identification matching the user's location information is displayed in the first display mode, other site code identifications are displayed in the second display mode, and the first display mode is displayed in the first display mode. The location code identifier matching the user location information is highlighted, and the purpose of highlighting is to make the location code identifier matching the user location information easier to be recognized by the user. For example, the color used in the first display mode is brighter than the color used in the second display mode, and/or, the font used in the first display mode is more prominent than the font used in the second display mode, and the font prominence can be that the font is large and the font has special effects etc.
在一些示例中,第一显示方式指示将与用户位置信息匹配的场所码标识排序在第一位显示。如多个场所码标识排列在一张卡片上显示的场景下,在用户位置信息指示用户到达一个特定场所时,将该特定场所的场所码标识置顶,置顶是指排序在第一位。为此,在桌面上建立场所码标识时,建立场所码对应的地理围栏,地理围栏可以是用一个虚拟的栅栏围出一个虚拟地理边界,当用户进入该地理围栏,将该地理围栏对应的场所码标识置顶。其中场所码的地理围栏可以是以用户扫描场所码时的位置信息为中心,将该中心向外一定范围内的区域作为场所码的地理围栏,如该中心为圆心,半径为500米的区域作为场所码的地理围栏。In some examples, the first display mode indicates that the location code identifiers matching the user location information are sorted and displayed first. For example, in the scenario where multiple place codes are arranged on one card, when the user's location information indicates that the user has arrived at a specific place, put the place code of the specific place on top, which means that it is sorted first. For this reason, when setting up the location code identification on the desktop, set up the geographic fence corresponding to the location code, the geographic fence can be a virtual geographical boundary surrounded by a virtual fence, when the user enters the geographic fence, the place corresponding to the geographic fence The code mark is set to the top. The geo-fence of the site code can be centered on the location information when the user scans the site code, and the area within a certain range outside the center is used as the geo-fence of the site code. For example, the center is the center of the circle and the area with a radius of 500 meters is used as Geofencing of site yards.
通过步骤S101至步骤S106手机完成了在桌面建立场所码标识,并为该场所码建立了地理围栏,即将场所码标识与场所码的地理围栏一一对应。手机对场所码标识和场所码的地理围栏的使用过程如步骤S107至步骤S109所示。Through steps S101 to S106, the mobile phone completes the establishment of the location code identification on the desktop, and establishes a geo-fence for the location code, that is, one-to-one correspondence between the location code identification and the geo-fence of the location code. The process of the mobile phone using the site code identification and the geographical fence of the site code is shown in steps S107 to S109.
S107、手机调用位置信息接口,获取当前的位置信息,当前的位置信息处于一个场所码的地理围栏中,将该场所码标识置顶。S107. The mobile phone invokes the location information interface to obtain the current location information. The current location information is in the geo-fence of a location code, and the location code identification is set to the top.
S108、手机响应对场所码标识的点击操作,调用具有扫一扫功能的应用程序的深度链接(Deeplink)接口,向该应用程序的服务器发送场所码的QR值。S108. The mobile phone responds to the click operation on the location code identification, calls the deep link (Deeplink) interface of the application program with the scanning function, and sends the QR value of the location code to the server of the application program.
具有扫一扫功能的应用程序可以是微信或支付宝等,在手机确定对场所码标识执行了点击操作,手机调起具有扫一扫功能的应用程序(如调起微信或支付宝等),并向该应用程序发送点击的场所码的QR值,通过该应用程序的Deeplink接口将场所码的QR值发送给手机的通信模块,再通过手机的通信模块向该应用程序的服务器发送场所码的QR值。The application program with scan function can be WeChat or Alipay, etc. After confirming that the mobile phone has clicked on the location code logo, the mobile phone calls up the application program with scan function (such as calling up WeChat or Alipay, etc.), and sends The app sends the QR value of the clicked location code, sends the QR value of the location code to the communication module of the mobile phone through the Deeplink interface of the application, and then sends the QR value of the location code to the server of the application through the communication module of the mobile phone .
S109、手机通过该应用程序显示扫码结果。S109. The mobile phone displays the code scanning result through the application program.
从步骤S108和步骤S109可知,场所码标识被点击后,手机可以从存储的所有QR值找到该场所码的QR值,将该场所码的QR值发送给服务器识别,省去了开启应用程序、开启应用程序的“扫一扫”功能、调用摄像头拍摄场所码的图像的环节,简化场所码的处理过程且降低了耗时,解决了扫码慢的问题。并且因为省去“摄像头拍摄场所码的图像”的环节,场所码的处理不再受到上述扫码因素影响,提高扫码效率。场所码的QR值是服务器成功解析的场所码的图像的QR值,服务器利用该场所码的QR值能够还原出能够被成功解析的场所码的图像,提高扫码成功率和扫码效率,进一步降低功耗,解决了扫码慢的问题。It can be known from step S108 and step S109 that after the location code logo is clicked, the mobile phone can find the QR value of the location code from all the stored QR values, and send the QR value of the location code to the server for identification, eliminating the need to open the application program, Turn on the "scan" function of the app and call the camera to capture the image of the site code, which simplifies the process of site code processing and reduces time-consuming, solving the problem of slow code scanning. And because the link of "taking the image of the location code by the camera" is omitted, the processing of the location code is no longer affected by the above-mentioned scanning factors, which improves the scanning efficiency. The QR value of the location code is the QR value of the image of the location code successfully parsed by the server. The server can use the QR value of the location code to restore the image of the location code that can be successfully parsed, improving the success rate and efficiency of scanning codes, and further Reduce power consumption and solve the problem of slow scanning.
上述二维码处理方法可以应用于电子设备中,在一些实施例中,该电子设备可以是手机、平板电脑、桌面型、膝上型、笔记本电脑、超级移动个人计算机(Ultra-mobilePersonal Computer,UMPC)、手持计算机、上网本、个人数字助理(Personal DigitalAssistant,PDA)、可穿戴电子设备、智能手表等设备。本申请对电子设备的具体形式不做特殊限定。The above-mentioned two-dimensional code processing method can be applied in an electronic device. In some embodiments, the electronic device can be a mobile phone, a tablet computer, a desktop, a laptop, a notebook computer, an ultra-mobile personal computer (Ultra-mobile Personal Computer, UMPC) ), handheld computers, netbooks, personal digital assistants (Personal Digital Assistant, PDA), wearable electronic devices, smart watches and other devices. The present application does not specifically limit the specific form of the electronic device.
如图7所示,该电子设备可以包括:处理器,外部存储器接口,内部存储器,通用串行总线(universal serial bus,USB)接口,充电管理模块,电源管理模块,电池,天线1,天线2,移动通信模块,无线通信模块,传感器模块,按键,马达,指示器,音频模块,摄像头,显示屏,以及用户标识模块(subscriber identification module,SIM)卡接口等。其中音频模块可以包括扬声器,受话器,麦克风,耳机接口等,传感器模块可以包括压力传感器,陀螺仪传感器,气压传感器,磁传感器,加速度传感器,距离传感器,接近光传感器,指纹传感器,温度传感器,触摸传感器,环境光传感器,骨传导传感器等。As shown in Figure 7, the electronic device may include: a processor, an external memory interface, an internal memory, a universal serial bus (universal serial bus, USB) interface, a charging management module, a power management module, a battery, an
处理器可以包括一个或多个处理单元,例如:处理器可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processingunit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit, NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。处理器是电子设备的神经中枢和指挥中心,控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The processor may include one or more processing units, for example: the processor may include an application processor (application processor, AP), a modem processor, a graphics processing unit (graphics processing unit, GPU), an image signal processor (image signal processor) processor, ISP), controller, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural network processor (neural-network processing unit, NPU), etc. Wherein, different processing units may be independent devices, or may be integrated in one or more processors. The processor is the nerve center and command center of electronic equipment. The controller can generate operation control signals according to instruction opcodes and timing signals, and complete the control of fetching and executing instructions.
外部存储器接口可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备的存储能力。外部存储卡通过外部存储器接口与处理器通信,实现数据存储功能。例如将场所码标识、场所码的QR值和场所码的地理围栏等保存在外部存储卡中。内部存储器可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器通过运行存储在内部存储器的指令,从而执行电子设备的各种功能应用以及数据处理。例如,在本申请中,处理器通过运行内部存储器中存储的指令,使得电子设备执行本申请提供的二维码处理方法。The external memory interface can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device. The external memory card communicates with the processor through the external memory interface to realize the data storage function. For example, the location code identification, the QR value of the location code and the geographical fence of the location code are stored in the external memory card. Internal memory may be used to store computer-executable program code, including instructions. The processor executes various functional applications and data processing of the electronic device by executing instructions stored in the internal memory. For example, in the present application, the processor executes the instructions stored in the internal memory, causing the electronic device to execute the two-dimensional code processing method provided in the present application.
天线1和天线2用于发射和接收电磁波信号。电子设备中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。移动通信模块可以提供应用在电子设备上的包括2G/3G/4G/5G等无线通信的解决方案。无线通信模块可以提供应用在电子设备上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。
电子设备通过GPU,显示屏,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。Electronic devices implement display functions through GPUs, display screens, and application processors. The GPU is a microprocessor for image processing, which is connected to the display screen and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering. The processor may include one or more GPUs that execute program instructions to generate or alter display information.
显示屏用于显示图像,视频等。显示屏包括显示面板。显示面板可以采用液晶显示屏 (liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organiclight emitting diode 的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed, Micro-oled,量子点发光二极管(quantum dot lightemitting diodes,QLED)等。在一些实施例中,电子设备可以包括1个或N个显示屏,N为大于1的正整数。Displays are used to display images, videos, etc. The display screen includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (active-matrix organic light emitting diode). diode, AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oled, quantum dot light-emitting diodes (quantum dot lightemitting diodes, QLED), etc. In some embodiments, the electronic device may include 1 or N display screens, where N is a positive integer greater than 1.
电子设备的显示屏上可以显示一系列图形用户界面(graphical userinterface,GUI),这些GUI都是该电子设备的主屏幕。一般来说,电子设备的显示屏的尺寸是固定的,只能在该电子设备的显示屏中显示有限的控件。控件是一种GUI元素,它是一种软件组件,包含在应用程序中,控制着该应用程序处理的所有数据以及关于这些数据的交互操作,用户可以通过直接操作(direct manipulation)来与控件交互,从而对应用程序的有关信息进行读取或者编辑。一般而言,控件可以包括图标、按钮、菜单、选项卡、文本框、对话框、状态栏、导航栏、Widget等可视的界面元素。例如,在本申请实施例中,显示屏可以显示场所码标识和扫码结果。A series of graphical user interfaces (graphical user interface, GUI) can be displayed on the display screen of the electronic device, and these GUIs are the main screen of the electronic device. Generally, the size of the display screen of an electronic device is fixed, and only limited controls can be displayed on the display screen of the electronic device. A control is a GUI element, which is a software component contained in an application that controls all the data processed by the application and the interaction of these data. Users can interact with the control through direct manipulation. , so as to read or edit the relevant information of the application. Generally speaking, controls may include visual interface elements such as icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, and Widgets. For example, in the embodiment of the present application, the display screen can display the location code identification and the code scanning result.
可以理解的是,本实施例示意的结构并不构成对电子设备的具体限定。在另一些实施例中,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It should be understood that the structure shown in this embodiment does not constitute a specific limitation on the electronic device. In other embodiments, the electronic device may include more or fewer components than shown, or combine certain components, or separate certain components, or arrange different components. The illustrated components can be realized in hardware, software or a combination of software and hardware.
另外,在上述部件之上,运行有操作系统。例如苹果公司所开发的iOS操作系统,谷歌公司所开发的Android开源操作系统,微软公司所开发的Windows操作系统等。In addition, an operating system runs on top of the above components. For example, the iOS operating system developed by Apple, the Android open source operating system developed by Google, and the Windows operating system developed by Microsoft.
电子设备的操作系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本申请实施例以分层架构的Android系统为例,示例性说明电子设备的软硬件结构。图8是电子设备的软硬件结构框图。分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。以Android系统为例,在一些实施例中,Android系统包括五层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和系统库,内核层以及硬件层。The operating system of the electronic device may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. In this embodiment of the present application, the Android system with layered architecture is taken as an example to illustrate the software and hardware structure of the electronic device. Fig. 8 is a block diagram of the hardware and software structure of the electronic device. The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate through software interfaces. Taking the Android system as an example, in some embodiments, the Android system includes five layers, which are respectively an application program layer, an application program framework layer, an Android runtime (Android runtime) and a system library, a kernel layer and a hardware layer from top to bottom.
应用程序层可以包括一系列应用程序包。如图8所示,应用程序包可以包括相机,图库,日历,通话,地图,导航,扫码工具,音乐,视频,短信息等应用程序,扫码工具可以是微信或支付宝。例如,在本申请实施例中,应用程序包还可以包括场所码标识卡片,通过场所码标识卡片向用户提供场所码标识。在用户点击场所码标识时,场所码标识卡片可以访问电子设备的存储空间(如内存),从存储空间中获取场所码的QR值。The application layer can consist of a series of application packages. As shown in Figure 8, the application package can include applications such as camera, gallery, calendar, call, map, navigation, code scanning tool, music, video, short message, etc. The code scanning tool can be WeChat or Alipay. For example, in the embodiment of the present application, the application package may further include a location code identification card, and the location code identification is provided to the user through the location code identification card. When the user clicks on the location code identification, the location code identification card can access the storage space (such as memory) of the electronic device, and obtain the QR value of the location code from the storage space.
应用程序框架层为应用程序层的应用程序提供应用编程接口(applicationprogramming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。如图8所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等。例如,在扫码场景中,应用程序框架层可以包括扫码算法模块,扫码算法模块用于得到场所码的QR值、特定场所的名称和场所码的地理围栏,并在场所码标识卡片中建立以特定场所的名称命名的场所码标识。The application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions. As shown in Figure 8, the application framework layer can include window manager, content provider, view system, phone manager, resource manager, notification manager, etc. For example, in a code-scanning scenario, the application framework layer may include a code-scanning algorithm module, which is used to obtain the QR value of the place code, the name of a specific place, and the geographical fence of the place code, and display the code in the place code identification card Create a site code ID named after the name of a specific site.
Android Runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的 java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(Media Libraries),三维图形处理库(例如:OpenGLES),2D 图形引擎(例如:SGL)等。内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动,内存驱动等。硬件层包括显示屏,摄像头,传感器,内存等。Android Runtime includes core library and virtual machine. The Android runtime is responsible for the scheduling and management of the Android system. The core library consists of two parts: one part is the function function that the java language needs to call, and the other part is the core library of Android. The application layer and the application framework layer run in virtual machines. The virtual machine executes the java files of the application program layer and the application program framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection. A system library can include multiple function modules. For example: surface manager (surface manager), media library (Media Libraries), 3D graphics processing library (eg: OpenGLES), 2D graphics engine (eg: SGL), etc. The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver, sensor driver, memory driver, etc. The hardware layer includes displays, cameras, sensors, memory, etc.
需要说明的是,本申请实施例虽然以Android系统为例进行说明,但是其基本原理同样适用于基于iOS或Windows等操作系统的电子设备。It should be noted that although the embodiment of the present application uses the Android system as an example for illustration, its basic principles are also applicable to electronic devices based on operating systems such as iOS or Windows.
图9示出了电子设备扫描场所码至完成场所码标识的建立时,软硬件之间的交互过程。在扫描场所码时用户打开了扫码工具的扫一扫功能,扫码工具调用摄像头驱动以开启摄像头,通过摄像头拍摄当前扫描的二维码的图像;二维码的图像至少通过扫码工具发送给扫码工具的服务器。扫码工具可以接收服务器发送的解析结果,如果解析结果指示解析失败,扫码工具再次获取摄像头拍摄到的二维码的下一帧图像,发送给服务器,直至接收到解析成功的解析结果。如在图9中,扫码工具向服务器发送二维码的第三帧图像后接收到解析成功的解析结果,扫码工具终止发送二维码的图像,摄像头也可以停止拍摄。FIG. 9 shows the interactive process between software and hardware when the electronic device scans the location code until the establishment of the location code identification is completed. When scanning the site code, the user opens the scan function of the code scanning tool. The code scanning tool invokes the camera driver to turn on the camera, and the image of the currently scanned QR code is captured through the camera; the image of the QR code is at least sent through the code scanning tool. The server for the scanning tool. The code scanning tool can receive the analysis result sent by the server. If the analysis result indicates that the analysis fails, the code scanning tool obtains the next frame image of the QR code captured by the camera and sends it to the server until the analysis result of successful analysis is received. As shown in Figure 9, after the code scanning tool sends the third frame image of the QR code to the server and receives a successful parsing result, the code scanning tool stops sending the image of the QR code, and the camera can also stop shooting.
在扫码工具接收到解析成功的解析结果后,扫码算法模块对送图的最后一帧图像进行解码,得到二维码的QR值,并在识别到二维码为场所码时,将场所码的QR值存储到内存中。扫码算法模块还能够建立场所码的地理围栏以及建立场所码标识,场所码的地理围栏以及场所码标识也可以存储到内存中,场所码标识可以显示在场所码标识卡片中,场所码标识可以以场所码对应的特定场所的名称命名。解析成功的解析结果,说明场所码扫描成功,电子设备显示扫码结果。After the code scanning tool receives the analysis result of successful analysis, the code scanning algorithm module decodes the last frame of image sent to obtain the QR value of the QR code, and when the QR code is recognized as a location code, the location The QR value of the code is stored into memory. The code scanning algorithm module can also establish the geographical fence of the site code and the establishment of the site code identification. The geographical fence of the site code and the site code identification can also be stored in the memory. The site code identification can be displayed in the site code identification card, and the site code identification can be Named after the specific site name corresponding to the site code. If the analysis is successful, the analysis result indicates that the location code is scanned successfully, and the electronic device displays the scanning result.
图10示出了用户点击场所码标识后软硬件之间的交互过程,在用户点击了场所码标识卡片中任一场所码标识后,场所码标识卡片从内存中获取该场所码的QR值,将场所码的QR值发送给服务器,并调起扫码工具。服务器向扫码工具反馈扫码结果,通过扫码工具显示扫码结果,在这一过程中,省去了用户开启扫码工具、用户开启应用程序的“扫一扫”功能、调用摄像头拍摄图像的环节,简化场所码的处理过程且降低了耗时,解决了扫码慢的问题。并且因为省去“摄像头拍摄场所码的图像”的环节,服务器利用场所码的QR 值能够还原出能够被成功解析的场所码的图像,提高扫码成功率和扫码效率,进一步降低功耗,解决了扫码慢的问题。Fig. 10 shows the interactive process between software and hardware after the user clicks the location code identification. After the user clicks any location code identification in the location code identification card, the location code identification card obtains the QR value of the location code from the memory, Send the QR value of the location code to the server, and invoke the scanning tool. The server feeds back the scanning result to the scanning tool, and displays the scanning result through the scanning tool. In this process, the user does not need to open the scanning tool, the user opens the "scan" function of the application, and calls the camera to capture images. It simplifies the processing process of site codes and reduces time-consuming, which solves the problem of slow code scanning. And because the link of "camera shooting the image of the location code" is omitted, the server can restore the image of the location code that can be successfully parsed by using the QR value of the location code, improving the success rate and efficiency of scanning codes, and further reducing power consumption. Solved the problem of slow scanning.
上述是以场所码为例阐述本申请提供的二维码处理方法,场所码具有图形固定的特性,意味着场所码的QR值也是固定的,对于QR值固定的其他类型二维码,如购票码、就诊预约码等,也可以采用本申请提供的二维码处理方法。如电子设备扫描购票码或就诊预约码后,电子设备也可以存储这些码的最后一帧图像的QR值、生成这些码的二维码标识和地理围栏。在用户点击这些二维码标识后,电子设备可以显示预设界面。如点击购票码标识,电子设备可以显示购票界面;又例如点击就诊预约码标识,电子设备可以显示就诊预约界面,在就诊预约界面选择就诊科室进行预约。为此,电子设备可以预设一个白名单,白名单中记录有多个QR值。电子设备在成功扫描一个二维码后,查找二维码的QR 值是否在白名单中,如果二维码的QR值在白名单中,电子设备在桌面建立该二维码的二维码标识,并保存该二维码的QR值。在用户点击该二维码的二维码标识后,电子设备将该二维码的QR值发送给服务器,由服务器反馈扫码结果。The above is taking the site code as an example to illustrate the two-dimensional code processing method provided by this application. The site code has the characteristic of fixed graphics, which means that the QR value of the site code is also fixed. For other types of two-dimensional codes with fixed QR values, such as purchasing Ticket codes, medical appointment codes, etc., can also use the two-dimensional code processing method provided by this application. For example, after the electronic device scans the ticket purchase code or medical appointment code, the electronic device can also store the QR value of the last frame image of these codes, and generate the QR code identification and geographic fence of these codes. After the user clicks these two-dimensional code marks, the electronic device can display a preset interface. For example, if you click on the sign of the ticket purchase code, the electronic device can display the ticket purchase interface; for another example, if you click on the sign of the appointment code for medical treatment, the electronic device can display the interface for making an appointment to make an appointment. For this reason, the electronic device can preset a white list, and multiple QR values are recorded in the white list. After successfully scanning a QR code, the electronic device checks whether the QR value of the QR code is in the white list. If the QR value of the QR code is in the white list, the electronic device creates a QR code identification of the QR code on the desktop , and save the QR value of the QR code. After the user clicks on the two-dimensional code mark of the two-dimensional code, the electronic device sends the QR value of the two-dimensional code to the server, and the server feeds back the scanning result.
本申请提供一种电子设备,电子设备包括:一个或多个处理器;一个或多个存储器;存储器存储有一个或多个程序,当一个或者多个程序被处理器执行时,使得电子设备执行上述二维码处理方法。The present application provides an electronic device, the electronic device includes: one or more processors; one or more memories; the memory stores one or more programs, and when the one or more programs are executed by the processor, the electronic device executes The above two-dimensional code processing method.
本申请提供一种计算机可读存储介质,计算机可读存储介质中存储了计算机程序,当计算机程序被处理器执行时,使得处理器执行上述二维码处理方法。The present application provides a computer-readable storage medium. A computer program is stored in the computer-readable storage medium. When the computer program is executed by a processor, the processor is made to execute the above two-dimensional code processing method.
Claims (13)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211401495.XA CN115687814A (en) | 2022-11-09 | 2022-11-09 | Two-dimensional code processing method and device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211401495.XA CN115687814A (en) | 2022-11-09 | 2022-11-09 | Two-dimensional code processing method and device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN115687814A true CN115687814A (en) | 2023-02-03 |
Family
ID=85050873
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202211401495.XA Pending CN115687814A (en) | 2022-11-09 | 2022-11-09 | Two-dimensional code processing method and device |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN115687814A (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN117077703A (en) * | 2023-09-14 | 2023-11-17 | 荣耀终端有限公司 | Image processing method and electronic equipment |
| CN117131888A (en) * | 2023-04-10 | 2023-11-28 | 荣耀终端有限公司 | An automatic scanning method, electronic device and system for virtual space QR codes |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112099892A (en) * | 2020-09-22 | 2020-12-18 | 青岛海信移动通信技术股份有限公司 | Communication terminal and method for rapidly scanning two-dimensional code |
| US20210012075A1 (en) * | 2019-07-12 | 2021-01-14 | Hongfujin Precision Electronices(Yantai)Co.,Ltd. | Method for intelligent inspections, electronic device using method, and non-transitory storage medium |
| CN112287706A (en) * | 2020-10-28 | 2021-01-29 | 维沃移动通信有限公司 | Scanning code interaction method and device |
| CN114880065A (en) * | 2022-07-08 | 2022-08-09 | 荣耀终端有限公司 | Method, device, system and storage medium for controlling card display |
-
2022
- 2022-11-09 CN CN202211401495.XA patent/CN115687814A/en active Pending
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20210012075A1 (en) * | 2019-07-12 | 2021-01-14 | Hongfujin Precision Electronices(Yantai)Co.,Ltd. | Method for intelligent inspections, electronic device using method, and non-transitory storage medium |
| CN112099892A (en) * | 2020-09-22 | 2020-12-18 | 青岛海信移动通信技术股份有限公司 | Communication terminal and method for rapidly scanning two-dimensional code |
| CN112287706A (en) * | 2020-10-28 | 2021-01-29 | 维沃移动通信有限公司 | Scanning code interaction method and device |
| CN114880065A (en) * | 2022-07-08 | 2022-08-09 | 荣耀终端有限公司 | Method, device, system and storage medium for controlling card display |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN117131888A (en) * | 2023-04-10 | 2023-11-28 | 荣耀终端有限公司 | An automatic scanning method, electronic device and system for virtual space QR codes |
| CN117077703A (en) * | 2023-09-14 | 2023-11-17 | 荣耀终端有限公司 | Image processing method and electronic equipment |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| EP4060475B1 (en) | Multi-screen cooperation method and system, and electronic device | |
| CN110060672A (en) | A kind of sound control method and electronic equipment | |
| CN114466102B (en) | Method for displaying application interface, related device and traffic information display system | |
| CN112417421B (en) | Scanning method, scanning device, electronic equipment and readable storage medium | |
| CN112835495B (en) | Method and device for opening application program and terminal equipment | |
| CN115801943B (en) | Display method, electronic device and storage medium | |
| CN115705118B (en) | Card information management method and electronic device | |
| CN115687814A (en) | Two-dimensional code processing method and device | |
| CN114173165B (en) | Display method and electronic equipment | |
| CN117940898A (en) | Information display method and electronic equipment | |
| US20190258370A1 (en) | Electronic apparatus and method for controlling information reading | |
| CN113467961B (en) | Copy and paste method, electronic device and system | |
| CN117519858A (en) | An application display method and electronic device | |
| CN116028707A (en) | Service recommendation method, equipment and storage medium | |
| CN116156229A (en) | Screen projection method, user interface and electronic device | |
| CN116720533B (en) | Code scanning method, electronic equipment and readable storage medium | |
| CN120076068A (en) | Data transmission method and device | |
| CN116700477B (en) | Display method and electronic device | |
| EP4273776B1 (en) | Information display method and electronic device | |
| CN118672943A (en) | Application page caching method, graphical interface and related electronic equipment | |
| CN116055627A (en) | A screen off control method, electronic device and storage medium | |
| CN118101826B (en) | A code scanning prompt method and related electronic equipment | |
| CN118277003A (en) | Comment method and electronic equipment | |
| CN120196458A (en) | Application message processing method and electronic device | |
| CN110069723B (en) | Graphic code identification method, device and storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| CB02 | Change of applicant information | ||
| CB02 | Change of applicant information |
Country or region after: China Address after: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040 Applicant after: Honor Terminal Co.,Ltd. Address before: 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong Applicant before: Honor Device Co.,Ltd. Country or region before: China |