Two-dimensional code scanning method, electronic equipment, storage medium and chip system
By configuring a link between a QR code and a webpage in electronic devices, and leveraging the interaction between the security module and the package management module, the problem of scanning QR codes across applications is solved, achieving efficient and secure QR code display and improving the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUAWEI DEVICE CO LTD
- Filing Date
- 2024-10-28
- Publication Date
- 2026-04-28
AI Technical Summary
In existing technologies, electronic devices must scan QR codes through the application that matches the QR code, which prevents cross-application scanning, resulting in a poor user experience and low scanning efficiency.
By pre-configuring the link between the QR code and the associated page in the electronic device, and by interacting with the security module and the package management module, the page data of the page associated with the QR code can be directly obtained, enabling cross-application QR code scanning, avoiding interaction with the cloud and dependence on page redirection protocols.
It enables cross-application QR code scanning, improving scanning efficiency, saving time, enhancing user experience, and preventing malicious QR code intrusion.
Smart Images

Figure CN121936491A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of QR code scanning technology, and in particular to a QR code scanning method, electronic device, storage medium, and chip system. Background Technology
[0002] With the rapid development of internet technology, QR codes have been widely used. For example, users can scan a QR code with their mobile phones to open the payment page of an application and make payments, making life more convenient for users.
[0003] Currently, QR codes come from various sources, and these sources are not interoperable. When scanning a QR code, electronic devices must use the application that matches the QR code. If other applications are used to scan the QR code, the scan will fail, affecting the user experience. For example, if application A scans application A's QR code, the electronic device will display the corresponding page. However, if application B scans application A's QR code, the electronic device will not be able to recognize the QR code. Summary of the Invention
[0004] This application provides a QR code scanning method, electronic device, storage medium, and chip system that can enable cross-application QR code scanning.
[0005] Firstly, embodiments of this application provide a QR code scanning method. The subject executing this method can be an electronic device or a chip within an electronic device. The following description uses an electronic device as an example. In this method, the electronic device includes a first application and a second application. The electronic device can use the first application to scan the QR code of the second application to obtain QR code data. The QR code data includes: an identifier of the page associated with the QR code and data associated with the QR code. The electronic device can obtain the link of the associated page based on the identifier of the page associated with the QR code. The link of the associated page is used to indicate the page data of the associated page. The electronic device can display the associated page based on the page data of the associated page and the data associated with the QR code.
[0006] In this embodiment, the electronic device can use a first application to scan the QR code of a second application without needing to use the second application to scan the QR code of another second application, thus enabling cross-application QR code scanning. Furthermore, the electronic device can obtain the link to the associated page from the QR code, and then retrieve the page data of the associated page. Based on the page data and the data associated with the QR code, the electronic device can determine all the data within the associated page, and thus directly display the associated page. Additionally, the electronic device can directly display the associated page without interacting with the cloud to obtain its domain name, saving time and increasing scanning efficiency.
[0007] In one possible implementation, the data associated with the QR code includes: the content of elements in the associated page, and / or information for obtaining the content of elements in the associated page, with page data used to indicate the layout of elements in the associated page.
[0008] The layout of elements on the associated page includes the position, size, and color of the elements. Electronic devices can then use this layout to fill the corresponding positions on the associated page with the content of those elements, thus displaying the associated page.
[0009] For example, taking a shared bicycle scenario, the data associated with the QR code includes: the content of elements on the unlock page, and / or information used to obtain the content of those elements. The elements on the unlock page include: an identification display area and a map. The content of the identification display area can be the shared bicycle's identification identifier. The information used to obtain the content of the elements on the unlock page can include: the address and port number of the shared bicycle server. The address and port number of the shared bicycle server are used to obtain information such as the shared bicycle's location and usage status. The shared bicycle's location can be used as content on the map in the unlock page.
[0010] In this example, the electronic device can fill the shared bicycle's identity in the identity display area of the unlock page and fill the shared bicycle's location in the map area of the unlock page, based on the layout of the identity display area and the map layout, so as to display the unlock page.
[0011] For example, taking a power bank scenario, the data associated with the QR code includes: the content of elements on the charging page, and / or information used to obtain the content of those elements. The elements on the charging page include: an identification display area and a map. The content of the identification display area can be the power bank's identification identifier. The information used to obtain the map content can include: the power bank server's address and port number. The power bank server's address and port number are used to obtain information such as the power bank's location and usage status; the power bank's location can be used as content on the map on the charging page.
[0012] In this example, the electronic device can fill the power bank's identity in the identity display bar of the charging page and fill the power bank's position in the map position of the charging page, based on the layout of the identity display bar and the map layout, so as to display the charging page.
[0013] In this implementation, the electronic device can determine all the data in the associated page based on the data associated with the QR code and the page data of the associated page, so as to directly display the associated page.
[0014] In one possible implementation, the electronic device also includes a security module, and the second application includes a package management module for maintaining links to associated pages.
[0015] The following describes the QR code scanning method provided in the embodiments of this application from the perspective of the interaction between various modules in an electronic device.
[0016] The first application can scan the QR code of the second application to obtain QR code data. The first application can send the QR code data to the security module; the QR code data also includes the identifier of the second application. When the security module receives the QR code data from the first application, it can send a request to the second application based on the second application's identifier. This request instructs the second application to provide a link to a related page. To facilitate the second application's identification of the related page, the request may include the identifier of the related page. In response to the request from the security module, the packet management module in the second application can obtain the link to the related page based on its identifier.
[0017] For example, since the second application's module.json5 pre-configures the links to associated pages, the package management module of the second application can obtain these links by querying the second application's module.json5. After obtaining the links, the package management module can send them to the security module. When the security module receives the links from the package management module, it can trigger the electronic device to display the associated page based on the page data and the data associated with the QR code.
[0018] In this implementation, electronic devices can directly display associated pages based on the page data of the associated page and the data associated with the QR code, without going through a complicated page jump process, saving scanning time and improving scanning efficiency. At the same time, users do not need to perform any additional operations while the electronic device is displaying the associated page, thus improving the user experience.
[0019] In one possible implementation, before sending a request to the second application based on the second application's identifier, the security module performs a security scan on the QR code data. If the security scan passes, the security module sends the request to the second application.
[0020] In this implementation, the security scan scans the QR code data, which can ensure that the source of the QR code is reliable, thereby preventing the intrusion of malicious QR codes.
[0021] In one possible implementation, the security module can perform a security scan on the second application based on a whitelist. The whitelist includes the identifier of at least one application; applications in the whitelist are considered secure. The security module verifies the second application based on the identifier of at least one application in the whitelist. If the identifier of the second application is included in the whitelist, the security module confirms that the second application is secure, and the security scan passes. If the identifier of the second application is not in the whitelist, the security module confirms that the second application is insecure, and the security scan fails. When the security scan passes, the security module can send a request to the second application to further parse the QR code.
[0022] In one possible implementation, the package management module stores the identifiers of associated pages and the association relationships between the links of the associated pages. The package management module can obtain the links of the associated pages based on the identifiers of the associated pages and the association relationships.
[0023] In this implementation, the package management module can directly search for the link of the associated page in the association relationship based on the identifier of the associated page, resulting in faster query speed.
[0024] In one possible implementation, the electronic device further includes a capability module. The security module can send a link to the associated page and associated data via a QR code to the capability module. When the capability module receives the link and QR code data from the security module, it can retrieve the page data of the associated page based on the link. The capability module can then display the associated page based on the page data and the associated data via the QR code.
[0025] In this implementation, the capability module can interact with the security module to obtain the link to the associated page, thereby acquiring the page data of the associated page. Based on the page data and the data associated with the QR code, the capability module can directly display the associated page. This process eliminates the need for complex page navigation, resulting in high scanning efficiency and a superior user experience without requiring any additional user intervention.
[0026] In one possible implementation, before displaying the associated page based on the page data of the associated page and the data associated with the QR code, the capability module can execute the business logic corresponding to the QR code.
[0027] In this implementation, since there are various types of QR codes, different usage scenarios and different business logics correspond to different types of QR codes, the business logic executed by the capability module is also different.
[0028] For example, taking a shared bicycle scenario, the capability module needs to execute the business logic corresponding to the shared bicycle QR code. This business logic involves verifying the user's identity. In this example, the capability module executes the following logic: verify the user's identity. If the verification is successful, the capability module can display the unlock page based on the page data of the unlock page and the data associated with the shared bicycle QR code.
[0029] In a second aspect, embodiments of this application provide an electronic device, including a processor and a memory, wherein the memory is used to store code instructions and the processor is used to execute the code instructions to perform the methods described in the first aspect or any possible implementation thereof.
[0030] Thirdly, embodiments of this application provide a computer-readable storage medium storing a computer program or instructions that, when executed on a computer, cause the computer to perform the methods described in the first aspect or any possible implementation thereof.
[0031] Fourthly, embodiments of this application provide a computer program product including a computer program, which, when run on a computer, causes the computer to perform the methods described in the first aspect or any possible implementation of the first aspect.
[0032] Fifthly, this application provides a chip or chip system including at least one processor and a communication interface. The communication interface and the at least one processor are interconnected via a circuit. The at least one processor is used to run computer programs or instructions to perform the methods described in the first aspect or any possible implementation thereof. The communication interface in the chip can be an input / output interface, pins, or circuits, etc.
[0033] In one possible implementation, the chip or chip system described above in this application further includes at least one memory storing instructions. The memory can be an internal storage unit of the chip, such as a register or cache, or it can be a storage unit of the chip itself (e.g., read-only memory, random access memory, etc.).
[0034] It should be understood that the second to fifth aspects of this application correspond to the technical solutions of the first aspect of this application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation are similar, and will not be repeated here. Attached Figure Description
[0035] Figure 1 A schematic diagram illustrating the interface changes for scanning a shared bicycle QR code with a mobile phone, provided as an embodiment of this application;
[0036] Figure 2 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;
[0037] Figure 3 A software structure block diagram of an electronic device provided in an embodiment of this application;
[0038] Figure 4 A flowchart illustrating a QR code scanning method provided in an embodiment of this application;
[0039] Figure 5 A schematic diagram illustrating another interface change for scanning shared bicycle QR codes with a mobile phone, provided as an embodiment of this application.
[0040] Figure 6 A schematic diagram illustrating the interface changes for scanning a payment code on a mobile phone, provided as an embodiment of this application;
[0041] Figure 7 A flowchart illustrating another QR code scanning method provided in this application embodiment;
[0042] Figure 8 This is a flowchart illustrating another QR code scanning method provided in an embodiment of this application. Detailed Implementation
[0043] To facilitate understanding, the relevant terms and concepts involved in the embodiments of this application will be introduced below:
[0044] 1. QR code: A QR code is a graphic formed by the distribution of certain elements in a two-dimensional direction according to a certain pattern. For example, a QR code can be a rectangular array of black and white pixels arranged in a certain pattern. QR codes can store information, such as links, text, and numbers. In some scenarios, such as on web pages, links can be represented as Uniform Resource Locators (URLs).
[0045] This section uses storing a URL in a QR code as an example to illustrate the QR code generation process: The URL is encoded to obtain encoded data. Then, according to a specific algorithm and rules, the encoded data is converted into black and white pixels, and the black and white pixels are arranged in a regular pattern to generate a QR code. In this way, the QR code can include the URL.
[0046] QR codes have a wide range of applications. For example, in payment scenarios, a QR code can include payment information such as the amount and the recipient's name. Users can scan the QR code with their electronic devices to make payments. In social media scenarios, electronic devices can generate a user's QR code business card. Other users can scan this QR code business card with their own electronic devices to add the user as a friend or follow them.
[0047] 2. Domain name: Used to represent the name of a computer or group of computers on the Internet. For example, a domain name can consist of a string of characters separated by periods (.).
[0048] Because Internet Protocol (IP) addresses are inconvenient to remember, the Domain Name System (DNS) maps IP addresses to domain names. Electronic devices can then use the DNS to determine the IP address corresponding to a domain name. For example, when accessing a website, a user can enter the website's domain name or click on it, triggering a DNS lookup to obtain the IP address. Once the electronic device has the IP address, it can access the website. In essence, a DNS lookup can be understood as the electronic device querying the DNS for the IP address corresponding to a domain name.
[0049] 3. Cloud Server: A cloud server is a server built on cloud computing technology that provides remote computing and storage services. When an electronic device is connected to the internet, it can access the cloud server to perform remote computing and storage. For example, an electronic device can upload data to a cloud server, which can then store that data. The electronic device can also retrieve data from the cloud server and use that data for computation.
[0050] 4. Page Redirection Protocol: This defines the redirection rules for pages within the client. The client can be an application (APP), a webpage, or a mini-program, etc., and this application embodiment does not limit the form of the client. Page redirection can be between pages within the same client or between pages on different clients. The following embodiments use an application as an example for illustration.
[0051] In some embodiments, the scheme protocol can be understood as a type of page redirection protocol. A scheme protocol is a URL-based page redirection protocol that maps URLs to corresponding applications by defining a protocol header (scheme). Developers can define custom schemes for their applications or use existing schemes such as "http: / / " or "https: / / " as the application's scheme. For example, a user can enter a URL on an electronic device or click on a URL; the electronic device can then parse the URL, identify the scheme within it, and process the URL accordingly.
[0052] 5. Link: In this embodiment of the application, the link refers to the page link, which is used to obtain page data.
[0053] 6. Electronic devices:
[0054] The electronic device in this application embodiment is a device with QR code scanning function. Exemplarily, the electronic device can be referred to as user equipment (UE), terminal, etc. For example, the electronic device can be a mobile phone, tablet, personal digital assistant (PDA), handheld device with wireless communication function, computing device, in-vehicle device, or wearable device, virtual reality (VR) terminal device, augmented reality (AR) terminal device, wireless terminal in industrial control, wireless terminal in smart home, etc. This application embodiment does not specifically limit the form of the electronic device.
[0055] QR codes are widely used in various scenarios, such as payment, social media, and bike-sharing. For example, in the bike-sharing scenario, users can scan a QR code using a bike-sharing app on their electronic device (such as a mobile phone) or the scan function of other apps that support bike-sharing services. When the bike-sharing app or other supporting apps successfully scan the QR code, they can parse it to obtain the information stored within. Based on this information, the bike-sharing app or other supporting apps can then display a designated page for the bike-sharing service, allowing users to access the service.
[0056] In some embodiments, if a user is not logged into the application or has not used the application for a long time, a designated page displayed on the electronic device may prompt the user to log in in order to verify the user's identity and facilitate the user's use of the shared bicycle service.
[0057] In some embodiments, if the user is already logged into the application, the designated page displayed on the electronic device can be an unlock page, which may include an unlock button. The user can unlock the bicycle by clicking the unlock button.
[0058] In some embodiments, the QR code can be associated with the shared bicycle's Global Positioning System (GPS) location information. For the shared bicycle server, when a user scans the QR code with their mobile phone, the phone can report the bicycle's location to the server. Additionally, during user use of the shared bicycle, the shared bicycle app or an app supporting the shared bicycle service can display the bicycle's usage status, such as "unlocked," "started riding," or "locked." Correspondingly, the shared bicycle app or an app supporting the shared bicycle service can also report the bicycle's usage status to the server. Furthermore, the shared bicycle app or an app supporting the shared bicycle service can also display fault options, such as "cannot lock" or "cannot unlock." When a user clicks on the corresponding fault option, the shared bicycle app or an app supporting the shared bicycle service can generate a fault report, which can also be reported to the shared bicycle server. In this way, the shared bike server can obtain information such as the location, usage status, and fault reports of shared bikes in real time. Shared bike companies can optimize their bike scheduling strategies based on the bike location information obtained from the server, and they can also handle bike malfunctions based on the fault reports obtained from the server.
[0059] Currently, QR codes come from a wide variety of sources, which can be understood as the client applications associated with them. Different clients have their own QR codes; for example, application A has its own QR code, and application B has its own QR code. For instance, a QR code could be a payment code. Different clients can use their own unique mechanisms to generate and parse QR codes. Currently, a QR code can be scanned by a matching client, but other clients cannot. For example, application A can successfully scan its own QR code, and the electronic device will display the corresponding page. However, if application B scans application A's QR code, the electronic device will not be able to recognize the QR code; for example, the electronic device will display a message saying "Please use application A to scan the QR code."
[0060] For example, different applications can use different encoding methods to generate QR codes. For instance, application A generates a QR code using encoding method 1, while application B generates a QR code using encoding method 2. Taking QR code 1 generated by application A as an example, after scanning QR code 1, application A can use the decoding method corresponding to encoding method 1 to obtain the information stored in QR code 1. However, after scanning QR code 1, application B, using the decoding method corresponding to encoding method 2, cannot parse QR code 1. Therefore, electronic devices using application B cannot recognize QR code 1.
[0061] Currently, when users scan a QR code using their electronic devices, they need to scan the QR code using the source corresponding to the QR code so that the electronic device can access the corresponding page.
[0062] In some embodiments, the QR code may store the URL corresponding to a specified page. When a user scans the QR code with an electronic device, the electronic device can parse the URL in the QR code and access the specified page through the URL. That is, the electronic device can display the specified page after scanning the QR code.
[0063] In this example, the electronic device redirects to a page by parsing the obtained URL. The current URL relies on a page redirection protocol (such as a scheme protocol). The electronic device needs to deploy this protocol to recognize the URL and redirect the page. For instance, if the scheme in the URL is "http: / / " or "https: / / ", the electronic device can launch its default browser to display the specified page corresponding to the URL. If the scheme in the URL is a custom scheme, the electronic device can find the corresponding application based on the scheme, and then display the specified page corresponding to the URL.
[0064] In the current example, users can accurately navigate to the designated page by scanning the QR code using the source corresponding to the QR code. However, if users want to enjoy the desired services, they still need to perform additional operations on the designated page. For example, let's take a shared bicycle scenario and a mobile phone as an example for illustration. Figure 1 This is a schematic diagram illustrating the interface changes when scanning a shared bicycle QR code with a mobile phone, as provided in an embodiment of this application.
[0065] Reference Figure 1 In section 'a', interface 10 is the scan page of the shared bicycle application, and interface 10 may include a scan control 101. When the user operates the scan control 101, the shared bicycle application can display interface 11, as shown below. Figure 1 In section b, interface 11 may include a scanning frame 111. The user aligns the scanning frame 111 with the shared bicycle QR code, enabling the shared bicycle application to scan the QR code. When the shared bicycle application successfully scans the QR code, it can parse the URL from the QR code and display a specified page based on the URL. For example, the specified page could be an unlocking page.
[0066] In some embodiments, the bike-sharing app may display other pages before displaying the designated page. For example, after scanning the shared bike's QR code, the bike-sharing app can display interface 12, see reference... Figure 1In the context of interface 12 (c), it can include a map 121 and a prompt control 122. The map 121 can mark the user's location to facilitate route planning, and the prompt control 122 can display text information such as "Loading...". The "Loading..." text information indicates that the shared bicycle application is processing the user's bike-sharing request.
[0067] After processing a user's bike-sharing request, the app can display a designated page, such as the unlock page. (Reference) Figure 1 In the context of 'd', the shared bicycle application can display interface 13, which is the unlocking page. Interface 13 may include an unlocking control 131. When the user operates the unlocking control 131, it triggers the shared bicycle application to perform an unlocking operation. At this time, refer to... Figure 1 In the context of the shared bicycle application, interface 14 can be displayed, where the unlocking control 131 can show unlocking progress information, such as "Unlocking 0%". This unlocking progress information is used to visually demonstrate the unlocking progress of the shared bicycle to the user. When the unlocking control 131 displays "Unlocking 100%" or "Unlock Successful", the shared bicycle unlocks, and the user can then begin riding.
[0068] In this example, because the shared bike's QR code stores the URL corresponding to the unlocking page, the shared bike app can obtain the URL stored in the QR code when it scans the QR code. Furthermore, the shared bike app deploys a page redirection protocol (such as the Scheme protocol), allowing it to recognize the URL and display the unlocking page.
[0069] However, in this example, the electronic device needs to scan the QR code using the source corresponding to the QR code, thus preventing cross-application QR code scanning. Furthermore, the application needs to pre-deploy a page redirection protocol (such as the scheme protocol) to recognize the URL stored in the QR code. Additionally, this method involves a complex page redirection process to unlock the device.
[0070] To address the aforementioned technical issues, in some embodiments, the domain name of the page corresponding to the QR code can be pre-registered on a cloud server. This way, when an electronic device scans the QR code, it can retrieve the page's domain name from the cloud server and display the page corresponding to the QR code.
[0071] In some embodiments, the QR code may store an identifier, token, or encrypted link to the page corresponding to the QR code. The identifier, token, or encrypted link is used to indicate the page corresponding to the QR code. The following example illustrates this using the storage of a page identifier within a QR code:
[0072] When an electronic device scans a QR code, it reads the identifier within the QR code and sends this identifier to a cloud server. Since this identifier points to the page corresponding to the QR code, when the cloud server receives the identifier, it looks up the domain name of the page indicated by the identifier and sends that domain name to the electronic device. Upon receiving the page domain name, the electronic device uses a DNS lookup to find the corresponding IP address and displays the page corresponding to the QR code based on that IP address.
[0073] In this example, because the domain name of the page is stored on the cloud server, different applications can obtain the domain name by accessing the cloud server, thus enabling different applications to display the page. Therefore, this method does not require scanning through the application corresponding to the QR code, achieving cross-application QR code scanning. Furthermore, since the domain name of the page is stored on the cloud server, the method for identifying the page does not rely on the scheme protocol. Additionally, because the electronic device obtains the domain name corresponding to the page, it can directly display the page based on that domain name, without going through a complex page redirection process.
[0074] However, in this example, the page's domain name needs to be pre-deployed on the cloud server. When an electronic device scans the QR code, it needs to interact with the cloud server to obtain the page's domain name, resulting in low scanning efficiency. For instance, in situations with unstable network signals, the time it takes for the electronic device to obtain the page's domain name from the cloud server is long, impacting the user experience.
[0075] In summary, this application provides a QR code scanning method. In this method, the application can pre-configure page links. When an electronic device scans a QR code, the device can directly obtain the page link through the application to acquire page data and then display the page. This method eliminates the need for the electronic device to interact with a cloud server to obtain the page's domain name, saving time and improving scanning efficiency. Furthermore, this method can also achieve cross-application QR code scanning without relying on a scheme protocol. For example, an electronic device can scan the QR code of a second application through a first application. The first application can interact with the second application to acquire page data and then display the page, as described in the following embodiments.
[0076] Before introducing the QR code scanning method provided in the embodiments of this application, we will first introduce the preparations made to implement this method:
[0077] In some embodiments, the storage data format of the QR code can be standardized. For example, the QR code can store information such as the identifier of the QR code source, the identifier of the page associated with the QR code, and the data associated with the QR code.
[0078] The QR code source identifier indicates the source of the QR code, the QR code associated page identifier indicates the associated page, and the data associated with the QR code may include, but is not limited to: identity identifier, the address of the server (host) corresponding to the source of the QR code, the path of the source of the QR code, and the port number of the server corresponding to the source of the QR code.
[0079] For example, QR code 1 is a QR code generated for application A. The information stored in QR code 1 may include: the identifier of application A, the identifier of the page associated with QR code 1, and the data associated with QR code 1.
[0080] For example, taking a QR code as a payment code, the information stored in the payment code may include: the identifier of the payment application, the identifier of the payment page, and the data associated with the payment code. The data associated with the payment code may include, but is not limited to: the recipient's nickname, the recipient's profile picture, and the amount received.
[0081] For example, taking a shared bicycle scenario, the information stored in the shared bicycle QR code may include: the identifier of the shared bicycle application, the identifier of the unlock page, and the data associated with the shared bicycle QR code. The data associated with the shared bicycle QR code may include, but is not limited to: the shared bicycle's identity identifier, the address of the shared bicycle server, and the port number of the shared bicycle server.
[0082] For example, taking a power bank scenario, the information stored in the power bank's QR code may include: the identifier of the power bank application, the identifier of the charging page, and the data associated with the power bank's QR code. The data associated with the power bank's QR code may include, but is not limited to: the power bank's identity identifier, the power bank server's address, and the power bank server's port number.
[0083] In some embodiments, the identifier of the QR code source can be represented as appid, the identifier of the page associated with the QR code can be represented as pageid, and the data associated with the QR code can be represented as data.
[0084] To enable access to the QR code-linked page within an application, in some implementations, the link to the QR code-linked page can be pre-configured within the application. For example, the link to the QR code-linked page can be registered in the application's module.json5.
[0085] In some embodiments, the link associated with a page in a QR code is used to indicate page data. Electronic devices can obtain page data associated with a page through the link in the QR code. Page data may include, but is not limited to, information such as the layout, size, and color of elements on the page. Elements may include text, images, and controls on the page.
[0086] For example, taking a shared bicycle scenario, the QR code-linked page is the unlock page. The unlock page link can be pre-registered in the shared bicycle application's module.json5. The unlock page data can include: the position, size, and color of the identification display bar, and the position, size, and color of the map. Here, the identification bar is the shared bicycle's identifier, such as its serial number, and the map is used to indicate the shared bicycle's location.
[0087] For example, taking a power bank scenario, the QR code-linked page is the charging page. The link to the charging page can be pre-registered in the power bank application's module.json5. The page data for the charging page can include: the position, size, and color of the identification display bar, and the position, size, and color of the map. Here, the identification bar is the power bank's identifier, such as its serial number, and the map is used to indicate the power bank's location.
[0088] In some embodiments, the link associated with the QR code can be the storage location of the page data of the page associated with the QR code. The electronic device can retrieve the page data of the page associated with the QR code by accessing the storage location of the page data. In some embodiments, the link associated with the QR code can be an identifier for the page data. For example, the electronic device can store multiple pages of data, and can number each page data, i.e., assign it an identifier. The electronic device can distinguish different pages of data based on their identifiers. In this example, the electronic device can retrieve the page data of the page associated with the QR code from among multiple pages of data using the page data identifier.
[0089] In some embodiments, the link to the page associated with the QR code can also be represented as a link, and electronic devices can obtain page data by accessing the link to the page associated with the QR code.
[0090] Before introducing the QR code scanning method provided in the embodiments of this application, the structure of the electronic device provided in the embodiments of this application will be first introduced:
[0091] Figure 2 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. (Refer to...) Figure 2The electronic device 200 may include: a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (USB) interface 230, a charging management module 240, a power management module 241, a battery 242, antenna 1, antenna 2, a mobile communication module 250, a wireless communication module 260, an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, a headphone jack 270D, a sensor 280, buttons 290, a motor 291, an indicator 292, a camera 293, a display screen 294, and a subscriber identification module (SIM) card interface 295, etc. It is understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device 200.
[0092] In this embodiment of the application, the processor 210 can be used to execute the QR code scanning method provided in this embodiment of the application.
[0093] The internal memory 221 can be used to store relevant instructions so that when the processor 210 calls the relevant instructions, the QR code scanning method provided in the embodiments of this application can be implemented.
[0094] Display screen 294 can be used to display web pages. For example, in a shared bicycle scenario, display screen 294 can display a page for scanning the shared bicycle's QR code, or it can display a page for unlocking the bicycle.
[0095] In other embodiments of this application, the electronic device 200 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0096] The software system of an electronic device can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application uses a layered architecture as an example to illustrate the software structure of an electronic device. Figure 3 This is a software structure block diagram of an electronic device provided in an embodiment of this application. The layered architecture divides the software system of the electronic device into several layers, each with a clear role and division of labor. Layers communicate with each other through software interfaces. In some embodiments, refer to... Figure 3 Electronic devices can include an application layer and a system layer.
[0097] It is understood that the software structure division of the electronic device in this application embodiment is just an example. This application embodiment does not limit the hierarchical division method in the software system of the electronic device. The modules in each level in the following embodiments are the modules involved in the embodiments of this application. Each level may also include more or fewer modules than shown in the figure, or combine some modules, or split some modules.
[0098] The application layer can include a series of application packages. (See reference...) Figure 3 The application layer can include: a first application and a second application.
[0099] The first application is an application with scanning functionality. For example, the first application can be a system application or a third-party application. For instance, the first application can be a camera application within a system application, or a social media application or a short video application within a third-party application.
[0100] In some embodiments, the scan function on the negative one screen of an electronic device can also scan QR codes. In this application embodiment, the first application can also be the scan function on the negative one screen of an electronic device.
[0101] The second application can be an application that provides a specific service. For example, in the scenario of shared bicycles, the second application can be a shared bicycle application that provides shared bicycle services to users. Similarly, in the scenario of power banks, the second application can be a power bank application that provides power bank services to users.
[0102] In some embodiments, the first application can scan the QR code of the second application using the camera of an electronic device to obtain the information stored in the QR code of the second application.
[0103] In some embodiments, the information stored in a QR code may be referred to as QR code data.
[0104] In some embodiments, the second application may include a package management module.
[0105] The package management module can manage the application packages of the second application. For example, the package management module can be responsible for tasks such as downloading, installing, uninstalling and updating the application packages of the second application.
[0106] In some embodiments, the package management module can maintain the association between QR codes and pages. For example, the package management module can store the association between a QR code and a page, and the page's links. For instance, the package management module can store the mapping relationship between the identifier of the page associated with the QR code and the page's links. For example, application A generates QR code 1, and QR code 1 is associated with page 1. The information stored in QR code 1 includes: the identifier of application A, the identifier of page 1, and the data associated with QR code 1. In the package management module, the identifier of page 1 and page 1 can be mapped together. For example, the package management module can store the mapping relationship between the identifier of page 1 and the page 1's links.
[0107] The system layer can provide basic support and services to the application layer. In some embodiments, refer to Figure 3 The system layer can include a security module and an ability module.
[0108] The security module is responsible for data verification, encryption, and malicious code detection, ensuring the stable operation of electronic devices and the security of user data. In this embodiment, the security module is used to perform secure scanning of QR codes to ensure the reliability of the QR code's source and prevent malicious QR code intrusion.
[0109] In some embodiments, a whitelist can be set in the security module, which includes the identifier of at least one application. Applications in the whitelist can be considered safe and reliable.
[0110] In this embodiment, when the security module performs a security scan on a QR code, it can search for the source identifier of the QR code in a whitelist. If the whitelist includes the source identifier, the security module considers the source of the QR code reliable; if the whitelist does not include the source identifier, the security module determines that the source of the QR code is unreliable. If the security module determines that the source of the QR code is reliable, it can interact with the package management module and the Ability module to continue executing the method provided in this embodiment. If the security module determines that the source of the QR code is unreliable, it can choose not to interact with the package management module and the Ability module to prevent further parsing of the QR code.
[0111] The Ability module is responsible for launching the QR code-related page, loading the data associated with the QR code, and running the relevant business logic so that electronic devices can display the QR code-related page and execute the corresponding business logic.
[0112] The QR code scanning method provided in this application will be described below with reference to specific embodiments. These embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0113] The following is combined Figure 3 The structure of the electronic device shown illustrates the QR code scanning method provided in the embodiments of this application. Figure 4 This is a flowchart illustrating a QR code scanning method provided in an embodiment of this application. (Refer to...) Figure 4 The QR code scanning method provided in this application embodiment may include:
[0114] S401, the first application scans the QR code of the second application to obtain the QR code data.
[0115] The first application and the second application are two different applications in an electronic device. The second application can generate QR codes, and the first application has the function of scanning QR codes; the first application can scan the QR codes of the second application.
[0116] For example, taking a shared bicycle scenario, with the first application being a camera app and the second application being a shared bicycle app, in this scenario, the camera app scans the shared bicycle's QR code to obtain the shared bicycle's QR code data. The shared bicycle QR code data may include: the shared bicycle app's identifier, the unlock page's identifier, and data associated with the shared bicycle's QR code.
[0117] Reference Figure 5 In the diagram, 'a' refers to interface 50, which is the camera application's scan page. Interface 50 may include a scan control 501. When the user interacts with the scan control 501, the camera application can display interface 51, as shown below. Figure 5 In section b, interface 51 may include a scanning frame 511. When a user aligns the scanning frame 511 with the shared bicycle's QR code, the camera application can scan the QR code of a second application. When the camera application successfully scans the shared bicycle's QR code, it can parse the QR code and obtain the shared bicycle's QR code data.
[0118] contrast Figure 1 In this application, when the first application scans the shared bicycle QR code, the first application can parse the shared bicycle QR code and obtain the QR code data, without needing to use a second application to scan the shared bicycle QR code, thus enabling cross-application scanning of shared bicycle QR codes.
[0119] For example, taking a power bank scenario, with the first application being a camera app and the second application being a power bank app, in this scenario, the camera app scans the power bank's QR code to obtain the power bank's QR code data. The power bank's QR code data includes: the power bank app's identifier, the charging page's identifier, and data associated with the power bank's QR code.
[0120] S402, the first application sends QR code data to the security module.
[0121] Correspondingly, the security module receives QR code data from the first application.
[0122] S403, the security module performs a secure scan of the QR code data.
[0123] The QR code data may include an identifier of the QR code's source. In this embodiment, the security module has a whitelist, which includes identifiers of at least one application. The security module can verify the QR code data based on these identifiers. Specifically, if the QR code's source identifier is included in the whitelist, the security module can confirm that the QR code's source is reliable, and the verification passes. If the QR code's source identifier is not in the whitelist, the security module can confirm that the QR code's source is unreliable, and the verification fails.
[0124] It should be understood that "verification passed" means the security scan passed, while "verification failed" means the security scan failed.
[0125] S404, if the security scan passes, the security module sends a request to the second application, which instructs the second application to provide a link to the page associated with the QR code.
[0126] The QR code data includes an identifier indicating the QR code's source. Based on this identifier, the security module can determine that the QR code originates from a second application, and thus send a request to the second application. This request instructs the second application to provide a link to the page associated with the QR code.
[0127] In some embodiments, to facilitate the second application in determining the page associated with the QR code, the request may include: an identifier of the page associated with the QR code.
[0128] Understandably, if a security scan fails, the security module can send a notification to the first application, indicating that the QR code scanned by the first application is insecure, or the security module can choose not to send a request to the second application.
[0129] S405, In response to the request, the package management module in the second application looks up the link to the page associated with the QR code.
[0130] Because the package management module in the second application stores the association between QR codes and pages, such as the association between the identifier of the page associated with the QR code and the link of the page associated with the QR code, and because the request includes the identifier of the page associated with the QR code, the package management module can find the link of the page associated with the QR code based on the identifier of the page associated with the QR code and the association.
[0131] In some embodiments, the second application's module.json5 contains a link to a page associated with a QR code. Therefore, the package management module can obtain the link to the page associated with the QR code by querying the second application's module.json5.
[0132] S406, the package management module sends a QR code link to the security module.
[0133] Correspondingly, the security module can receive the link to the QR code associated page from the package management module.
[0134] S407, the security module sends the link to the QR code-associated page and the associated data of the QR code to the Ability module.
[0135] Correspondingly, the Ability module can receive the link to the QR code association page and the associated data from the security module.
[0136] S408, the Ability module executes business logic and displays the page associated with the QR code based on the link of the page associated with the QR code and the data associated with the QR code.
[0137] There are many types of QR codes, and the use cases and business logic executed by the Ability module differ depending on the type of QR code.
[0138] Taking the shared bicycle scenario as an example, the business logic executed by the Ability module can be as follows: The Ability module verifies the user's identity. If the user's identity verification is successful, the Ability module displays the unlock page based on the link of the page associated with the QR code and the data associated with the QR code.
[0139] Taking the power bank scenario as an example, the business logic executed by the Ability module can be as follows: The Ability module verifies the user's identity. If the user's identity is verified, the Ability module displays the charging page based on the link of the page associated with the QR code and the data associated with the QR code.
[0140] The Ability module can retrieve page data from the linked page of the QR code. This page data indicates the position, size, color, and other information of elements within the linked page. The Ability module can then populate the linked page with this data to create a complete linked page for display.
[0141] Taking payment and receipt scenarios as an example, refer to Figure 6 Users scan the QR code of the second application using the camera app (the first application), and the electronic device can display the payment page. Figure 6 In the diagram, 'a' represents the page where the camera app scans the payment code. This page can include a scanning frame 601. When the user aligns the scanning frame 601 with the payment code, the camera app can scan it. When the camera app successfully scans the payment code, the electronic device can display the payment page.
[0142] The payment page can include: page data and data associated with the payment code. (See reference...) Figure 6 In part b, the page data for the payment page may include: the position, size, and color of the payee information display bar 602; the position, size, and color of the payment amount display bar 603; and the position, size, and color of the payment control 604. (See reference...) Figure 6 In option b, the data associated with the payment page can include: the payee's nickname (e.g., Zhang San), the payee's avatar (e.g., a black box), and the payment amount (e.g., 50.00).
[0143] In this example, after the Ability module receives the QR code associated data from the security module, the Ability module can fill the recipient's avatar (e.g., a black box) and nickname (e.g., Zhang San) into the recipient information display bar 602. The Ability module can also fill the payment amount (e.g., 50.00) into the payment amount display bar 603 to obtain a complete payment page. The payment page can then be displayed, and the user can use the payment control 604 on the payment page to make a payment.
[0144] For example, taking a shared bicycle scenario, the Ability module can display an unlock page. The unlock page may include: page data for the unlock page and data associated with the shared bicycle's QR code. (See reference...) Figure 5 In the context of 'c', the page data for unlocking page 52 may include: the location, size, and color of the identity display bar 521, and the location, size, and color of the map 522. The data associated with the shared bicycle's QR code may include: the shared bicycle's identity identifier, the shared bicycle server's address, and the shared bicycle server's port number.
[0145] In this example, refer to Figure 5In the diagram (a) and (b), when a user scans the shared bicycle's QR code using their camera app, the camera app can obtain the data associated with the QR code. This data may include the shared bicycle's identifier, the shared bicycle server's address, and the shared bicycle server's port number. The camera app can then send the shared bicycle's identifier to the shared bicycle server using the server's address and port number to request relevant information. In response to the shared bicycle's identifier from the camera app, the shared bicycle server can determine the bicycle's usage status. If the bicycle's status is "locked," the server can send the bicycle's location and unlock command to the camera app. Accordingly, the camera app can display the shared bicycle's identifier and location on the unlock page.
[0146] Reference Figure 5 In the c section, the Ability module can fill the shared bike's identity identifier (such as MT3260225563) in the identity identifier display area 521, and the Ability module can also fill the shared bike's location in the map area 522 to obtain the complete unlock page, which can then be displayed so that the user can start riding.
[0147] contrast Figure 1 In this application, when a user scans the QR code of a shared bicycle using a camera application, the electronic device can directly display the unlock page without displaying a complicated page jump process, and the user does not need to click the unlock control on the unlock page to unlock the bicycle.
[0148] For example, taking a power bank scenario, the Ability module can display a charging page. The charging page includes: page data and data associated with the power bank's QR code. The page data may include: the position, size, and color of the identification display area, and the position, size, and color of the map. The data associated with the power bank's QR code includes: the power bank's identification, the power bank server's address, and the power bank server's port number.
[0149] In this example, when a user scans the power bank's QR code using a camera app (the first app), the camera app can obtain the data associated with the power bank's QR code. This data includes the power bank's identifier, the power bank server's address, and the power bank server's port number. The camera app can then send the power bank's identifier to the power bank server using the server's address and port number to request relevant information. Upon receiving the power bank's identifier from the camera app, the power bank server can check the power bank's usage status. If the shared bike's usage status is "unused," the power bank server can send the power bank's location and charging instructions to the camera app. Accordingly, the camera app can display the power bank's identifier and location on the charging page.
[0150] For example, the Ability module can fill the power bank's identification mark in the identification mark display area, and the Ability module can fill the power bank's location in the map location to obtain a complete charging page, which can then be displayed so that the user can start charging.
[0151] In this embodiment, the second application pre-configures a link to a QR code-associated page. The electronic device can use the first application to scan the QR code of the second application. The first application can obtain the QR code data and interact with the second application to obtain the link to the QR code-associated page. Based on this link, the first application can control the electronic device to display the QR code-associated page, eliminating the need to use the second application to scan the QR code and enabling cross-application QR code scanning. Furthermore, the first application does not need to interact with a cloud server to obtain the domain name of the QR code-associated page, improving scanning efficiency.
[0152] The information stored in QR codes is diverse. In addition to storing information in the unified data storage format provided in this application, QR codes can also store links, strings, and other information. Therefore, this application fully considers the diversity of information stored in QR codes during implementation and uses different methods to process QR codes for the diverse information stored in them, which can adapt to various types of QR codes.
[0153] Figure 7 This is a schematic diagram illustrating another QR code scanning process provided in an embodiment of this application. (Refer to...) Figure 7 The QR code scanning method provided in this application embodiment may include:
[0154] S701, the electronic device uses a first application to scan a QR code of a second application to obtain the information stored in the QR code.
[0155] S702: When the information stored in the QR code is a link, the electronic device displays a prompt message.
[0156] In some embodiments, the prompt message can serve as a security mechanism. When the information stored in the QR code is a link, the electronic device can display a prompt message to alert the user and avoid potential security risks. For example, the prompt message could be: "QR code is from an unreliable source."
[0157] In some embodiments, when the information stored in the QR code is a link, the electronic device may also display a continue access control. When the user operates the continue access control, they can access the page associated with the QR code.
[0158] In some embodiments, when an electronic device displays a prompt, the user can decide whether to continue access. For example, after seeing the prompt, the user can click the "Continue Access" control, or the user can choose not to click the "Continue Access" control to avoid potential security risks.
[0159] S703: When the information stored in the QR code is a string, the electronic device displays the string.
[0160] For example, if the string is "abcdef", an electronic device can directly display the string "abcdef" by scanning a QR code.
[0161] S704, when the information stored in the QR code includes the identifier of the QR code source, the identifier of the page associated with the QR code, and the data associated with the QR code, the electronic device executes S403-S408.
[0162] In some embodiments, when the information stored in the QR code contains an identifier of the QR code's source, but the electronic device cannot find the corresponding application, the electronic device may display text messages such as "invalid QR code" to prompt the user that the QR code is invalid. The electronic device may also display text messages such as "please install the corresponding application" to prompt the user to install the corresponding application.
[0163] In some embodiments, when the information stored in the QR code includes an identifier of the QR code's source and an identifier of the page associated with the QR code, but the electronic device cannot find the link to the associated page, the electronic device displays text information such as "invalid QR code" to prompt the user that the QR code is invalid.
[0164] In some embodiments, when the information stored in the QR code does not contain an identifier of the associated page, the electronic device displays text such as "invalid QR code" to prompt the user that the QR code is invalid.
[0165] In some embodiments, when the link to the page associated with the QR code is incorrect or the data associated with the QR code is incorrect, the electronic device displays text messages such as "invalid QR code" to prompt the user that the QR code is invalid.
[0166] In this embodiment, when an electronic device scans a QR code, it can perform different processing based on the different types of information stored in the QR code (links, strings, etc.), making the QR code processing method flexible. Furthermore, when the electronic device processes information stored in the QR code that includes the identifier of the QR code's source, the identifier of the page associated with the QR code, and the data associated with the QR code, it can perform detailed verification. For example, when the electronic device cannot find the corresponding application, it can display "Invalid QR code" or "Please install the corresponding application," etc. When the QR code data does not include the identifier of the page associated with the QR code, the link to the associated page cannot be found, or the data associated with the QR code is incorrect, the electronic device will display "Invalid QR code," improving the validity of the QR code, saving scanning time, and enhancing the user experience.
[0167] The above embodiments describe the QR code scanning method provided in this application from the perspective of the interaction between various modules. The following will combine... Figure 8 Taking electronic devices as an example, this application describes the QR code scanning method provided in its embodiments.
[0168] Figure 8 This is a flowchart illustrating another QR code scanning method provided in an embodiment of this application. (Refer to...) Figure 8 The QR code scanning method provided in this application embodiment may include:
[0169] S801, the electronic device uses the first application to scan the QR code of the second application to obtain QR code data, which includes: the identifier of the page associated with the QR code and the data associated with the QR code.
[0170] Referring to the description in S401, the first application and the second application are two different applications in the electronic device. The electronic device can use the first application to scan the QR code of the second application to obtain the QR code data. The QR code data can be referred to the description in S401. In S802, the electronic device obtains the link of the associated page based on the identifier of the page associated with the QR code. The link is used to indicate the page data of the associated page.
[0171] In some embodiments, the electronic device may store the identifier of the QR code associated page and the association relationship of the link of the QR code associated page. The electronic device can obtain the link of the associated page based on the identifier of the QR code associated page in the QR code data and the association relationship.
[0172] The link associated with the QR code is used to indicate the page data of the associated page. The link associated with the QR code and the page data of the associated page can be found in the description in S405.
[0173] S803: The electronic device displays the associated page based on the page data of the associated page and the data associated with the QR code.
[0174] In some embodiments, the page data of the associated page may include information such as the position, size, and color of elements in the associated page, and the data associated with the QR code may include data related to the QR code in the associated page. Based on the page data of the associated page and the data associated with the QR code, the electronic device can determine all the data in the associated page, and then the electronic device can display the associated page.
[0175] In some embodiments, the data associated with the QR code includes the content of elements in the associated page, and / or information for obtaining the content of elements in the associated page. The page data is used to indicate the layout of elements in the associated page. The electronic device can fill the corresponding position of the associated page with the content of the elements in the associated page according to the layout of the elements in the associated page, so that the electronic device can display the associated page.
[0176] For example, taking a shared bicycle scenario, the data associated with the shared bicycle's QR code can include: the content of elements on the unlock page and information used to obtain the content of those elements. The content of elements on the unlock page, such as the shared bicycle's identifier (e.g., its serial number), and the information used to obtain the content of those elements, such as the shared bicycle server's address and port number.
[0177] In this example, the electronic device can interact with the shared bicycle server based on its address and port number to obtain information such as the bicycle's location and usage status. This information can then be used as content for elements on the unlock page. The electronic device can then fill the corresponding positions on the unlock page with the content of these elements, based on the page's layout.
[0178] For example, taking a power bank scenario, the data associated with the power bank's QR code can include: the content of elements on the charging page and information used to retrieve the content of those elements. The content of elements on the charging page includes, for example, the power bank's identifier (such as its serial number), and the information used to retrieve that content includes, for example, the power bank server's address and port number.
[0179] In this example, the electronic device can interact with the power bank server using its address and port number to obtain information such as the power bank's location and usage status. This information can then be used as content for elements on the charging page. The electronic device can then fill the corresponding positions on the charging page with the content of these elements, based on the page's layout.
[0180] The embodiments of this application have the same technical effects as the embodiments described above, and can be referred to the descriptions in the embodiments above, which will not be repeated here.
[0181] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or refuse.
[0182] This application provides an electronic device, which includes a processor and a memory; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, causing the electronic device to perform the above-described method.
[0183] This application provides a chip. The chip includes a processor, which calls a computer program in memory to execute the technical solutions in the above embodiments. Its implementation principle and technical effects are similar to those in the related embodiments described above, and will not be repeated here.
[0184] This application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, it implements the methods described above. The methods described in the above embodiments can be implemented wholly or partially by software, hardware, firmware, or any combination thereof. If implemented in software, the functionality can be stored as one or more instructions or code on or transmitted over the computer-readable medium. The computer-readable medium can include computer storage media and communication media, and can also include any medium that can transfer a computer program from one place to another. The storage medium can be any target medium accessible by a computer.
[0185] In one possible implementation, a computer-readable medium may include random access memory (RAM), read-only memory (ROM), compact discread-only memory (CD-ROM) or other optical disc storage, magnetic disk storage or other magnetic storage devices, or any other medium targeted to carry or to store required program code in the form of instructions or data structures, and accessible by a computer. Furthermore, any connection is appropriately referred to as a computer-readable medium. For example, if software is transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwave, then coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. As used herein, disks and optical discs include optical discs, laser discs, optical discs, digital versatile discs (DVDs), floppy disks, and Blu-ray discs, where disks typically reproduce data magnetically, while optical discs optically reproduce data using lasers. Combinations of the above should also be included within the scope of computer-readable media.
[0186] This application provides a computer program product, which includes a computer program that, when run, causes a computer to perform the above-described method.
[0187] It should be noted that the modules or components described in the above embodiments can be one or more integrated circuits configured to implement the above methods, such as one or more application-specific integrated circuits (ASICs), one or more digital signal processors (DSPs), or one or more field-programmable gate arrays (FPGAs), etc. Furthermore, when a module is implemented through processing element scheduler code, the processing element can be a general-purpose processor, such as a central processing unit (CPU) or other processors capable of calling program code, such as a controller. Additionally, these modules can be integrated together to implement a system-on-a-chip (SOC).
[0188] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., a solid-state disk (SSD)).
[0189] The term "multiple" in this document refers to two or more. The term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. Furthermore, the character " / " in this document generally indicates an "or" relationship between the preceding and following related objects; in formulas, " / " indicates a "division" relationship between the preceding and following related objects. Additionally, it should be understood that in the description of this application, words such as "first" and "second" are used only for descriptive purposes and should not be construed as indicating or implying relative importance or order.
[0190] It is understood that the various numerical designations used in the embodiments of this application are merely for descriptive convenience and are not intended to limit the scope of the embodiments of this application.
[0191] It is understood that, in the embodiments of this application, the order of the above-mentioned process numbers does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
Claims
1. A QR code scanning method, characterized in that, Applied to an electronic device, the electronic device including a first application and a second application, the method includes: Use the first application to scan the QR code of the second application to obtain QR code data, the QR code data including the identifier of the page associated with the QR code and the data associated with the QR code; Based on the identifier of the page associated with the QR code, obtain the link of the associated page, whereby the link is used to indicate the page data of the associated page; The associated page is displayed based on the page data of the associated page and the data associated with the QR code.
2. The method according to claim 1, characterized in that, The data associated with the QR code includes the content of elements in the associated page, and / or information for obtaining the content of elements in the associated page, wherein the page data is used to indicate the layout of elements in the associated page; The step of displaying the associated page based on the page data of the associated page and the data associated with the QR code includes: Based on the layout of the elements in the associated page, the content of the elements in the associated page is filled into the corresponding positions of the associated page, and the associated page is displayed.
3. The method according to claim 1 or 2, characterized in that, The electronic device further includes a security module, and the second application includes a package management module, which is used to maintain the links of the associated pages; The step of using the first application to scan the QR code of the second application to obtain QR code data includes: The first application scans the QR code of the second application to obtain the QR code data; The step of obtaining the link of the associated page based on the identifier of the page associated with the QR code includes: The first application sends the QR code data to the security module, and the QR code data further includes: the identifier of the second application; The security module sends a request to the second application based on the identifier of the second application. The request is used to instruct the second application to provide a link to the associated page. The request includes the identifier of the associated page. The package management module in the second application obtains the link of the associated page based on the identifier of the associated page; The package management module sends the link of the associated page to the security module; The step of displaying the associated page based on the page data of the associated page and the data associated with the QR code includes: The security module triggers the electronic device to display the associated page based on the page data of the associated page and the data associated with the QR code.
4. The method according to claim 3, characterized in that, Before the security module sends a request to the second application based on the identifier of the second application, it also includes: The security module performs a secure scan of the QR code data; The security module sends a request to the second application based on the identifier of the second application, including: If the security scan passes, the security module sends the request to the second application.
5. The method according to claim 4, characterized in that, The security module performs a security scan on the QR code data, including: The security module performs a security scan on the second application based on a whitelist, the whitelist including the identifier of at least one application; wherein, when the identifier of the second application is included in the whitelist, the security scan passes.
6. The method according to any one of claims 3-5, characterized in that, The package management module stores the identifiers of the associated pages and the association relationships between the links of the associated pages. In the second application, the package management module retrieves the links of the associated pages based on their identifiers, including: The package management module obtains the link of the associated page based on the identifier of the associated page and the association relationship.
7. The method according to any one of claims 3-6, characterized in that, The electronic device also includes a capability module; The security module triggers the electronic device to display the associated page based on the page data of the associated page and the data associated with the QR code, including: The security module sends the link to the associated page and the data associated with the QR code to the capability module; The capability module obtains the page data of the associated page based on the link of the associated page; The capability module displays the associated page based on the page data of the associated page and the data associated with the QR code.
8. The method according to claim 7, characterized in that, Before displaying the associated page based on the page data of the associated page and the data associated with the QR code, the capability module further includes: Execute the business logic corresponding to the QR code.
9. An electronic device, characterized in that, The electronic device includes: one or more processors and memory; The memory is coupled to the one or more processors, the memory being used to store computer program code, the computer program code including computer instructions, the one or more processors invoking the computer instructions to cause the electronic device to perform the method as described in any one of claims 1-8.
10. A chip system, characterized in that, The chip system is applied to an electronic device, the chip system including one or more processors, the one or more processors being used to invoke computer instructions to cause the electronic device to perform the method as described in any one of claims 1-8.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes computer instructions that, when executed on an electronic device, cause the electronic device to perform the method as described in any one of claims 1-8.
12. A computer program product, characterized in that, The computer program product includes computer program code that, when run on an electronic device, causes the electronic device to perform the method as described in any one of claims 1-8.