WO2021129859A1 - 二维码处理方法和设备 - Google Patents

二维码处理方法和设备 Download PDF

Info

Publication number
WO2021129859A1
WO2021129859A1 PCT/CN2020/139990 CN2020139990W WO2021129859A1 WO 2021129859 A1 WO2021129859 A1 WO 2021129859A1 CN 2020139990 W CN2020139990 W CN 2020139990W WO 2021129859 A1 WO2021129859 A1 WO 2021129859A1
Authority
WO
WIPO (PCT)
Prior art keywords
information
scene information
electronic device
scene
execution environment
Prior art date
Application number
PCT/CN2020/139990
Other languages
English (en)
French (fr)
Inventor
章张锴
彭建新
张朋
王莲
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2021129859A1 publication Critical patent/WO2021129859A1/zh
Priority to US17/846,199 priority Critical patent/US11989618B2/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/31User authentication
    • G06F21/36User authentication by graphic or iconic representation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/1408Methods for optical code recognition the method being specifically adapted for the type of code
    • G06K7/14172D bar codes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K19/00Record carriers for use with machines and with at least a part designed to carry digital markings
    • G06K19/06Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
    • G06K19/06009Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking
    • G06K19/06046Constructional details
    • G06K19/06112Constructional details the marking being simulated using a light source, e.g. a barcode shown on a display or a laser beam with time-varying intensity profile
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/10544Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation by scanning of the records by radiation in the optical part of the electromagnetic spectrum
    • G06K7/10821Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation by scanning of the records by radiation in the optical part of the electromagnetic spectrum further details of bar or optical code scanning devices
    • G06K7/1095Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation by scanning of the records by radiation in the optical part of the electromagnetic spectrum further details of bar or optical code scanning devices the scanner comprising adaptations for scanning a record carrier that is displayed on a display-screen or the like

Definitions

  • This application relates to terminal technology, in particular to a two-dimensional code processing method and device.
  • terminal devices are particularly widely used.
  • the electronic device may provide a two-dimensional code, and then the user uses the two-dimensional code to complete payment behaviors, etc.
  • an electronic device can generate and display a two-dimensional code, and another electronic device scans the two-dimensional code; and then another electronic device performs payment behaviors, such as deductions, based on the obtained two-dimensional code.
  • the electronic device when an electronic device generates a QR code, the electronic device may be attacked by malware, etc., and the QR code that the electronic device needs to display is replaced by the QR code generated by the malware. Thus, the electronic device displays the replaced two-dimensional code, and further, the user's property is stolen. Furthermore, in the prior art, the two-dimensional code is maliciously replaced, which causes losses to the user's property.
  • This application provides a two-dimensional code processing method and device to solve the problem of malicious replacement of the two-dimensional code in the prior art.
  • the present application provides a two-dimensional code processing method, the method is applied to a first electronic device, and the method includes:
  • first scene information and determine two-dimensional code data and second scene information according to the two-dimensional code information, where the first scene information is scene information related to the first electronic device, and the second The second scene information is scene information related to the second electronic device;
  • preset processing is performed on the two-dimensional code data.
  • the scene information in the two-dimensional code displayed by the second electronic device is related to the second electronic device; then, the first electronic device can obtain The second scene information related to the second electronic device in the QR code; and the first electronic device can obtain the first scene information related to the first electronic device; the first electronic device will be related to the first electronic device
  • the first scene information and the second scene information related to the second electronic device are compared to determine whether the two match; if it is determined to match, the first electronic device can determine that the scanned QR code is the first 2.
  • the QR code generated by the electronic device is not issued by other malicious devices; then, the first electronic device can process the scanned QR code.
  • a rich execution environment is deployed in the system of the first electronic device; the acquiring first scene information includes: acquiring the first scene information based on the rich execution environment.
  • the first scene information can be obtained based on the rich execution environment.
  • a first scene device is provided in the first electronic device; acquiring the first scene information based on the rich execution environment includes:
  • the rich execution environment receives the first scene information sent by the first scene device.
  • the QR code can be automatically verified based on the scene information, and the scene information of two electronic devices that need to interact with the QR code can be compared, and then the QR code can be completed Verification: It can effectively ensure that the scanned QR code is not a maliciously attacked QR code, and a malicious QR code can be identified; thereby ensuring the safety of the user’s property.
  • a first scene device is provided in the first electronic device; a trusted execution environment is also deployed in the system of the first electronic device; and the first scene device is acquired based on the rich execution environment.
  • Scene information including:
  • the return message returned by the trusted execution environment is received based on the rich execution environment, where the return message is used to indicate the first scene information, and the first scene information is that the trusted execution environment receives information from the trusted execution environment. Describe the acquired in the first scene device.
  • the trusted execution environment Since the trusted execution environment is a safe world, the trusted execution environment of the first electronic device verifies the first scene information and the second scene information, which can ensure the validity and accuracy of the verification results, and guarantee the first scene information and the second scene information. The scene information will not be tampered with.
  • the second request message includes the second scene information, or the second request information is used to indicate the second scene information;
  • the return message is a verification result; receiving the return message returned by the trusted execution environment based on the rich execution environment includes:
  • the verification result indicates that the first scene information and the second scene information meet the preset condition.
  • the first scenario information and the second scenario information are verified through the trusted execution environment of the first electronic device; the trusted execution environment of the first electronic device sends the verification result to the rich execution environment of the first electronic device;
  • the execution environment is a safe world, which ensures that the first scene information and the second scene information will not be maliciously attacked during the verification process.
  • the method before sending the second request message to the trusted execution environment based on the rich execution environment, the method further includes: using a public key to sign the second scene information, and after the signature is obtained The second scene information;
  • the first scene information is obtained after the trusted execution environment uses a private key to determine that the signed second scene information passes verification. Then the trusted execution environment verifies the source of the second scene information.
  • the first scene information is obtained after the trusted execution environment sets the first scene device to a preset configuration, and the preset configuration represents the first scene information Can only be acquired by the trusted execution environment.
  • the trusted execution environment is a secure world.
  • the device in the first scene needs to be configured to be read by only the trusted execution environment. Then the trusted execution environment reads the information detected by the first scene device, and the trusted execution environment will be maliciously attacked. In the case of, the first scene information read by the trusted execution environment will not be maliciously tampered with, which ensures the accuracy and safety of the first scene information.
  • the method further includes:
  • prompt information is generated and displayed. Furthermore, when the scene information fails the verification, the user may be prompted that the scene information is attacked.
  • determining the two-dimensional code data and the second scene information according to the two-dimensional code information includes:
  • Decrypt the two-dimensional code information to obtain the two-dimensional code data and the second scene information.
  • the first scene information includes at least one of the following: global positioning system information, wireless local area network information, Bluetooth information, and natural environment information;
  • the second scene information includes at least one of the following : Global Positioning System information, wireless local area network information, Bluetooth information, natural environment information.
  • the preset condition is that the first scene information and the first scene information 2.
  • the scene information belongs to the preset geographic range;
  • the preset condition is that the wireless local area network identifier represented by the second scene information exists in the In the list of wireless local area networks represented by the first scene information;
  • the preset condition is that the Bluetooth identifier represented by the second scene information is present in the first scene information In the Bluetooth list;
  • the preset condition is that both the first scene information and the second scene information belong to a preset numerical range.
  • the present application provides a two-dimensional code processing method, the method is applied to a second electronic device, and the method includes:
  • the second scene information and the preset two-dimensional code data generate and display two-dimensional code information, where the two-dimensional code information is used by the first electronic device to determine the first scene information and the second Second, when the scene information meets a preset condition, perform preset processing on the two-dimensional code data, and the first scene information is scene information related to the first electronic device.
  • second scene information is acquired through a second electronic device, where the second scene information is scene information related to the second electronic device; the second electronic device is based on the second scene information and presets Generated and displayed the two-dimensional code information, wherein the two-dimensional code information is used by the first electronic device to determine that the first scene information and the second scene information meet a preset condition after obtaining the two-dimensional code information.
  • the two-dimensional code data is subjected to preset processing, and the first scene information is scene information related to the first electronic device.
  • the second electronic device can obtain the second scene information related to the second electronic device; the second electronic device adds the second scene information to the two-dimensional code; further, The two-dimensional code displayed by the second electronic device carries second scene information related to the second electronic device; the first electronic device scans the two-dimensional code to obtain the second scene information, and the first electronic device can also obtain the second scene information.
  • First scene information related to an electronic device the first electronic device compares the first scene information related to the first electronic device and the second scene information related to the second electronic device to determine whether the two are Match; if it is determined to match, the first electronic device can determine that the scanned QR code is generated by the second electronic device, and that the QR code is not issued by other malicious devices; then, the first electronic device can scan The received QR code has been processed.
  • the QR code can be automatically verified based on the scene information, and the scene information of two electronic devices that need to interact with the QR code can be compared, and then the QR code can be verified; it can effectively ensure that the scanned QR code is not
  • the malicious QR code can identify the malicious QR code; thereby ensuring the safety of the user’s property.
  • a rich execution environment is deployed in the system of the second electronic device; the acquiring second scene information includes:
  • the second scene information is acquired. It can complete the verification of scene information based on the rich execution environment, compare the scene information of two electronic devices that need to interact with the QR code, and then complete the verification of the QR code; it can effectively ensure that the scanned QR code is not malicious
  • the attacked QR code can identify the malicious QR code; thereby ensuring the safety of the user’s property.
  • the second electronic device is provided with a second scene device; based on the rich execution environment, acquiring the second scene information includes:
  • the second electronic device executes each step on the rich execution environment system side, that is, completes the acquisition of the second scene information in the rich execution environment environment, and generates a QR code carrying the second scene information; so that the first electronic device can be based on
  • the scene information automatically verifies the QR code, compares the scene information of two electronic devices that need to interact with the QR code, and then completes the verification of the QR code; it can effectively ensure that the scanned QR code is not maliciously attacked
  • the two-dimensional code can identify malicious two-dimensional code; thereby ensuring the safety of the user’s property.
  • the processing process is simple and fast.
  • a trusted execution environment is also deployed in the system of the second electronic device, and a second scene device is provided in the second electronic device; based on the rich execution environment, the first 2.
  • Scene information including:
  • the second scene information returned by the trusted execution environment is received based on the rich execution environment, where the second scene information is obtained by the trusted execution environment from the second scene device.
  • the trusted execution environment is a safe world
  • the second scene information acquired by the trusted execution environment of the second electronic device is relatively safe.
  • the second request message is a trigger instruction detected based on the rich execution environment, or the second request message includes the trigger instruction; the trigger instruction is used to instruct to generate the QR code information.
  • the second scene information is the scene information that the trusted execution environment uses a public key to perform signature processing; and the rich execution environment receives the information returned by the trusted execution environment After the second scene information, it also includes:
  • the private key is used to verify the second scene information based on the rich execution environment to obtain a verification result, where the verification result indicates that the second scene information passes the verification.
  • the trusted execution environment of the second electronic device may sign the second scene information to ensure that the second scene information is not tampered with when the second scene information is transferred to the rich execution environment of the second electronic device.
  • generating and displaying two-dimensional code information according to the second scene information and preset two-dimensional code data includes:
  • the data to be processed is sent to the trusted execution environment based on the rich execution environment, where the data to be processed is used in the trusted execution environment to generate and display the two-dimensional code information.
  • the rich execution environment of the second electronic device sends the QR code data including the second scene information to the trusted execution environment of the second electronic device; the trusted execution environment of the second electronic device draws and displays the QR code in the TUI Interface; due to the high security of the trusted execution environment, the two-dimensional code interface is drawn and displayed in the trusted execution environment, which further ensures that the second scene information and the two-dimensional code data will not be affected by malicious devices or malicious applications
  • the attack or tampering ensures the security of the second scene information and the two-dimensional code data.
  • the method before sending the data to be processed to the trusted execution environment based on the rich execution environment, the method further includes: encrypting the data to be processed based on the rich execution environment to obtain the encrypted data to be processed Data processing.
  • the second scene information is obtained after the trusted execution environment sets the second scene device to a preset configuration, and the preset configuration characterizes the second scene device
  • the second scene information can only be acquired by the trusted execution environment.
  • the trusted execution environment of the second electronic device Before the trusted execution environment of the second electronic device reads the second scene information detected by the second scene device, the trusted execution environment of the second electronic device sets the second scene device to only be read by the trusted execution environment Therefore, it is ensured that the second scene information detected by the second electronic device will not be tampered with by malicious applications in a rich execution environment environment, and the security of the second scene information is ensured.
  • the method before the acquiring the second scene information, the method further includes: receiving a trigger instruction, where the trigger instruction is used to instruct to generate the two-dimensional code information.
  • the first scene information includes at least one of the following: global positioning system information, wireless local area network information, Bluetooth information, and natural environment information;
  • the second scene information includes at least one of the following : Global Positioning System information, wireless local area network information, Bluetooth information, natural environment information.
  • the preset condition is that the first scene information and the first scene information 2.
  • the scene information belongs to the preset geographic range;
  • the preset condition is that the wireless local area network identifier represented by the second scene information exists in the In the list of wireless local area networks represented by the first scene information;
  • the preset condition is that the Bluetooth identifier represented by the second scene information is present in the first scene information In the Bluetooth list;
  • the preset condition is that both the first scene information and the second scene information belong to a preset numerical range.
  • the present application provides a first electronic device, and the first electronic device includes:
  • the first obtaining unit is configured to obtain the two-dimensional code information displayed by the second electronic device
  • the second acquiring unit is used to acquire first scene information
  • the determining unit is configured to determine two-dimensional code data and second scene information according to the two-dimensional code information, where the first scene information is scene information related to the first electronic device, and the second scene Information is scene information related to the second electronic device;
  • the processing unit is configured to perform preset processing on the two-dimensional code data when it is determined that the first scene information and the second scene information meet a preset condition.
  • the scene information in the two-dimensional code displayed by the second electronic device is related to the second electronic device; then, the first electronic device can obtain The second scene information related to the second electronic device in the QR code; and the first electronic device can obtain the first scene information related to the first electronic device; the first electronic device will be related to the first electronic device
  • the first scene information and the second scene information related to the second electronic device are compared to determine whether the two match; if it is determined to match, the first electronic device can determine that the scanned QR code is the first 2.
  • the QR code generated by the electronic device is not issued by other malicious devices; then, the first electronic device can process the scanned QR code.
  • the QR code can be automatically verified based on the scene information, and the scene information of two electronic devices that need to interact with the QR code can be compared, and then the QR code can be verified; it can effectively ensure that the scanned QR code is not
  • the malicious QR code can identify the malicious QR code; thereby ensuring the safety of the user’s property.
  • a rich execution environment is deployed in the system of the first electronic device; the second acquiring unit is specifically configured to:
  • the first scene information can be obtained based on the rich execution environment.
  • a first scene device is provided in the first electronic device; the second acquiring unit includes:
  • the first sending module is configured to send a first request message to the first scene device based on the rich execution environment, where the first request message is used to instruct to obtain the First scene information;
  • the first receiving module is configured to receive the first scene information sent by the first scene device based on the rich execution environment.
  • the QR code can be automatically verified based on the scene information, and the scene information of two electronic devices that need to interact with the QR code can be compared, and then the QR code can be completed Verification: It can effectively ensure that the scanned QR code is not a maliciously attacked QR code, and a malicious QR code can be identified; thereby ensuring the safety of the user’s property.
  • a first scene device is provided in the first electronic device; a trusted execution environment is also deployed in the system of the first electronic device; and the second acquiring unit includes:
  • a second sending module configured to send a second request message to the trusted execution environment based on the rich execution environment, where the second request message is used to instruct to obtain the first scene information
  • the second receiving module is configured to receive a return message returned by the trusted execution environment based on the rich execution environment, where the return message is used to indicate the first scene information, and the first scene information is all
  • the trusted execution environment is obtained from the first scene device.
  • the trusted execution environment Since the trusted execution environment is a safe world, the trusted execution environment of the first electronic device verifies the first scene information and the second scene information, which can ensure the validity and accuracy of the verification results, and guarantee the first scene information and the second scene information. The scene information will not be tampered with.
  • the second request message includes the second scene information, or the second request information is used to indicate the second scene information;
  • the return message is the verification result;
  • the second receiving module is specifically configured to:
  • the verification result indicates that the first scene information and the second scene information meet the preset condition.
  • the first scenario information and the second scenario information are verified through the trusted execution environment of the first electronic device; the trusted execution environment of the first electronic device sends the verification result to the rich execution environment of the first electronic device;
  • the execution environment is a safe world, which ensures that the first scene information and the second scene information will not be maliciously attacked during the verification process.
  • the second acquiring unit further includes:
  • the signature module is configured to use the public key to sign the second scene information before the second sending module sends the second request message to the trusted execution environment based on the rich execution environment to obtain the signed Second scene information;
  • the first scene information is obtained after the trusted execution environment uses a private key to determine that the signed second scene information passes verification.
  • the trusted execution environment uses a private key to determine that the signed second scene information passes verification.
  • the first scene information is obtained after the trusted execution environment sets the first scene device to a preset configuration, and the preset configuration represents the first scene information Can only be acquired by the trusted execution environment.
  • the trusted execution environment is a secure world.
  • the device in the first scene needs to be configured to be read by only the trusted execution environment. Then the trusted execution environment reads the information detected by the first scene device, and the trusted execution environment is maliciously attacked In the case of, the first scene information read by the trusted execution environment will not be maliciously tampered with, which ensures the accuracy and safety of the first scene information.
  • the first electronic device further includes:
  • the prompt unit is configured to generate and display prompt information when it is determined that the first scene information and the second scene information do not meet a preset condition. Furthermore, when the scene information fails the verification, the user may be prompted that the scene information is attacked.
  • the determining unit is specifically used for:
  • Decrypt the two-dimensional code information to obtain the two-dimensional code data and the second scene information.
  • the first scene information includes at least one of the following: global positioning system information, wireless local area network information, Bluetooth information, and natural environment information;
  • the second scene information includes at least one of the following : Global Positioning System information, wireless local area network information, Bluetooth information, natural environment information.
  • the preset condition is that the first scene information and the first scene information 2.
  • the scene information belongs to the preset geographic range;
  • the preset condition is that the wireless local area network identifier represented by the second scene information exists in the In the list of wireless local area networks represented by the first scene information;
  • the preset condition is that the Bluetooth identifier represented by the second scene information is present in the first scene information In the Bluetooth list;
  • the preset condition is that both the first scene information and the second scene information belong to a preset numerical range.
  • the present application provides a second electronic device, and the second electronic device includes:
  • An acquiring unit configured to acquire second scene information, where the second scene information is scene information related to the second electronic device;
  • a generating unit configured to generate and display two-dimensional code information according to the second scene information and preset two-dimensional code data
  • the display unit is configured to display two-dimensional code information, where the two-dimensional code information is used by the first electronic device to determine that the first scene information and the second scene information meet a preset condition after acquiring the two-dimensional code information.
  • the dimension code data is subjected to preset processing, and the first scene information is scene information related to the first electronic device.
  • second scene information is acquired through a second electronic device, where the second scene information is scene information related to the second electronic device; the second electronic device is based on the second scene information and presets Generated and displayed the two-dimensional code information, wherein the two-dimensional code information is used by the first electronic device to determine that the first scene information and the second scene information meet a preset condition after obtaining the two-dimensional code information.
  • the two-dimensional code data is subjected to preset processing, and the first scene information is scene information related to the first electronic device.
  • the second electronic device can obtain the second scene information related to the second electronic device; the second electronic device adds the second scene information to the two-dimensional code; further, The two-dimensional code displayed by the second electronic device carries second scene information related to the second electronic device; the first electronic device scans the two-dimensional code to obtain the second scene information, and the first electronic device can also obtain the second scene information.
  • First scene information related to an electronic device the first electronic device compares the first scene information related to the first electronic device and the second scene information related to the second electronic device to determine whether the two are Match; if it is determined to match, the first electronic device can determine that the scanned QR code is generated by the second electronic device, and that the QR code is not issued by other malicious devices; then, the first electronic device can scan The received QR code has been processed.
  • the QR code can be automatically verified based on the scene information, and the scene information of two electronic devices that need to interact with the QR code can be compared, and then the QR code can be verified; it can effectively ensure that the scanned QR code is not
  • the malicious QR code can identify the malicious QR code; thereby ensuring the safety of the user’s property.
  • a rich execution environment is deployed in the system of the second electronic device; the acquiring unit is specifically configured to:
  • the second scene information is acquired. It can complete the verification of scene information based on the rich execution environment, compare the scene information of two electronic devices that need to interact with the QR code, and then complete the verification of the QR code; it can effectively ensure that the scanned QR code is not malicious
  • the attacked QR code can identify the malicious QR code; thereby ensuring the safety of the user’s property.
  • a second scene device is provided in the second electronic device; the acquiring unit includes:
  • the first sending module is configured to send a first request message to the second scene device based on the rich execution environment, where the first request message is used to instruct to obtain the first request message detected by the second scene device 2.
  • Scene information
  • the first receiving module is configured to receive the second scene information sent by the second scene device based on the rich execution environment.
  • the second electronic device executes each step on the rich execution environment system side, that is, completes the acquisition of the second scene information in the rich execution environment environment, and generates a QR code carrying the second scene information; so that the first electronic device can be based on
  • the scene information automatically verifies the QR code, compares the scene information of two electronic devices that need to interact with the QR code, and then completes the verification of the QR code; it can effectively ensure that the scanned QR code is not maliciously attacked
  • the two-dimensional code can identify malicious two-dimensional code; thereby ensuring the safety of the user’s property.
  • the processing process is simple and fast.
  • a trusted execution environment is also deployed in the system of the second electronic device, and a second scene device is provided in the second electronic device;
  • the acquiring unit includes:
  • a second sending module configured to send a second request message to the trusted execution environment based on the rich execution environment, where the second request message is used to instruct to obtain the second scene information
  • the second receiving module is configured to receive, based on the rich execution environment, the second scene information returned by the trusted execution environment, where the second scene information is the second scene information from the trusted execution environment Obtained in the device.
  • the trusted execution environment is a safe world
  • the second scene information acquired by the trusted execution environment of the second electronic device is relatively safe.
  • the second request message is a trigger instruction detected based on the rich execution environment, or the second request message includes the trigger instruction; the trigger instruction is used to instruct to generate the QR code information.
  • the second scene information is scene information that has been signed by the trusted execution environment using a public key; the acquiring unit further includes:
  • the verification module is configured to, after the second receiving module receives the second scene information returned by the trusted execution environment based on the rich execution environment, use a private key to pair the second scene based on the rich execution environment.
  • the information is verified to obtain a verification result, where the verification result indicates that the second scene information passes the verification.
  • the trusted execution environment of the second electronic device may sign the second scene information to ensure that the second scene information is not tampered with when the second scene information is transferred to the rich execution environment of the second electronic device.
  • the generating unit includes:
  • a generating module configured to generate data to be processed according to the second scene information and the two-dimensional code data based on the rich execution environment, where the data to be processed is the two-dimensional code data including the second scene information;
  • the sending module is configured to send the to-be-processed data to the trusted execution environment based on the rich execution environment, where the to-be-processed data is used for the trusted execution environment to generate and display the two-dimensional code information.
  • the rich execution environment of the second electronic device sends the QR code data including the second scene information to the trusted execution environment of the second electronic device; the trusted execution environment of the second electronic device draws and displays the QR code in the TUI Interface; due to the high security of the trusted execution environment, the two-dimensional code interface is drawn and displayed in the trusted execution environment, which further ensures that the second scene information and the two-dimensional code data will not be affected by malicious devices or malicious applications
  • the attack or tampering ensures the security of the second scene information and the two-dimensional code data.
  • the generating unit further includes:
  • An encryption module configured to encrypt the data to be processed based on the rich execution environment before the sending module sends the data to be processed to the trusted execution environment based on the rich execution environment to obtain encrypted data to be processed .
  • the second scene information is obtained after the trusted execution environment sets the second scene device to a preset configuration, and the preset configuration characterizes the second scene device
  • the second scene information of can only be obtained by the trusted execution environment.
  • the trusted execution environment of the second electronic device Before the trusted execution environment of the second electronic device reads the second scene information detected by the second scene device, the trusted execution environment of the second electronic device sets the second scene device to only be read by the trusted execution environment Therefore, it is ensured that the second scene information detected by the second electronic device will not be tampered with by malicious applications in a rich execution environment environment, and the security of the second scene information is ensured.
  • the second electronic device further includes:
  • the receiving unit is configured to receive a trigger instruction before the acquiring unit acquires the second scene information, where the trigger instruction is used to instruct to generate the two-dimensional code information.
  • the first scene information includes at least one of the following: global positioning system information, wireless local area network information, Bluetooth information, and natural environment information;
  • the second scene information includes at least one of the following : Global Positioning System information, wireless local area network information, Bluetooth information, natural environment information.
  • the preset condition is that the first scene information and the first scene information 2.
  • the scene information belongs to the preset geographic range;
  • the preset condition is that the wireless local area network identifier represented by the second scene information exists in the In the list of wireless local area networks represented by the first scene information;
  • the preset condition is that the Bluetooth identifier represented by the second scene information is present in the first scene information In the Bluetooth list;
  • the preset condition is that both the first scene information and the second scene information belong to a preset numerical range.
  • the present application provides a first electronic device, including an image collector and a processor
  • the image collector is used to collect the two-dimensional code information in the method provided in the first aspect
  • the processor is configured to obtain the two-dimensional code information collected by the image collector and execute instructions in the computer executable program code; when the processor executes the instructions, the instructions cause the imaging device to Implement the methods provided in the first aspect.
  • the present application provides a second electronic device, including a processor
  • the processor is configured to execute instructions in the computer executable program code; when the processor executes the instructions, the instructions cause the imaging device to execute the method provided in the second aspect.
  • the present application provides a first electronic device, including a processor, an image collector, and a first scene device;
  • the image collector is used to collect the two-dimensional code information in any implementation manner of the first aspect above;
  • the processor is configured to obtain the two-dimensional code information collected by the image collector and execute instructions in the computer executable program code; when the processor executes the instructions, the instructions cause the imaging
  • the device executes any one of the implementations of the first aspect above.
  • the present application provides an imaging device including at least one processing element or chip for executing any implementation manner of the first aspect above.
  • this application provides a program, including program code, and when a computer runs the computer program, the program code executes any one of the above-mentioned implementation manners of the first aspect.
  • this application provides a computer-readable storage medium including the program of the ninth aspect.
  • the present application provides a first electronic device, including a processor and a second scene device;
  • the processor is configured to execute instructions in the computer executable program code; when the processor executes the instructions, the instructions cause the imaging device to execute any implementation manner of the above second aspect.
  • the present application provides an imaging device including at least one processing element or chip for executing any implementation manner of the second aspect above.
  • this application provides a program, including program code.
  • the program code executes any one of the implementations of the second aspect above.
  • this application provides a computer-readable storage medium, including the program of the thirteenth aspect.
  • this application provides a computer program, including program code.
  • the program code executes any implementation manner of the first aspect or any implementation manner of the second aspect above.
  • the present application provides a computer program product.
  • the computer program product includes: a computer program stored in a readable storage medium, and at least one processor of an electronic device can read from the readable storage medium.
  • the medium reads the computer program, and the at least one processor executes the computer program to make the electronic device execute the method described in the first aspect or the method described in the second aspect.
  • the electronic device may be the above-mentioned first electronic device or the second electronic device.
  • FIG. 1 is a schematic diagram 1 of an application scenario provided by an embodiment of the application
  • FIG. 2 is a second schematic diagram of an application scenario provided by an embodiment of this application.
  • FIG. 3 is a third schematic diagram of an application scenario provided by an embodiment of this application.
  • FIG. 4 is a schematic flowchart of a two-dimensional code processing method provided by an embodiment of this application.
  • FIG. 5 is a schematic flowchart of another two-dimensional code processing method provided by an embodiment of the application.
  • FIG. 6 is a schematic diagram of a display of a first electronic device provided by an embodiment of the application.
  • FIG. 7 is a schematic flowchart of another two-dimensional code processing method provided by an embodiment of the application.
  • FIG. 8 is a schematic flowchart of another two-dimensional code processing method provided by an embodiment of the application.
  • FIG. 9 is a schematic flowchart of another two-dimensional code processing method provided by an embodiment of this application.
  • FIG. 10 is a schematic diagram of an ARMv7 system architecture provided by an embodiment of the application.
  • FIG. 11 is a schematic diagram of instructions in the REE system provided by an embodiment of the application.
  • FIG. 12 is a schematic diagram of system deployment of a first electronic device according to an embodiment of the application.
  • FIG. 13 is an interaction diagram of the REE and TEE of the first electronic device provided by an embodiment of this application.
  • FIG. 14 is a schematic flowchart of another two-dimensional code processing method provided by an embodiment of this application.
  • 15 is a schematic flowchart of another two-dimensional code processing method provided by an embodiment of this application.
  • 16 is a schematic flowchart of another two-dimensional code processing method provided by an embodiment of this application.
  • FIG. 17 is a schematic flowchart of another two-dimensional code processing method provided by an embodiment of this application.
  • FIG. 18 is a schematic diagram of system deployment for providing a second electronic device according to an embodiment of the application.
  • FIG. 19 is an interactive diagram of REE and TEE of the second electronic device provided by an embodiment of the application.
  • 20 is a schematic flowchart of another two-dimensional code processing method provided by an embodiment of the application.
  • FIG. 21 is a schematic flowchart of another two-dimensional code processing method provided by an embodiment of this application.
  • FIG. 22 is a schematic flowchart of another two-dimensional code processing method provided by an embodiment of this application.
  • FIG. 23 is a schematic flowchart of another two-dimensional code processing method provided by an embodiment of this application.
  • FIG. 24 is a schematic structural diagram of a first electronic device provided by an embodiment of this application.
  • FIG. 25 is a schematic structural diagram of another first electronic device provided by an embodiment of this application.
  • FIG. 26 is a schematic structural diagram of still another first electronic device according to an embodiment of the application.
  • FIG. 27 is a schematic structural diagram of a second electronic device according to an embodiment of the application.
  • FIG. 28 is a schematic structural diagram of another second electronic device according to an embodiment of this application.
  • FIG. 29 is a schematic structural diagram of yet another second electronic device according to an embodiment of this application.
  • FIG. 30 is a schematic structural diagram of still another first electronic device according to an embodiment of the application.
  • FIG. 31 is a schematic structural diagram of still another second electronic device according to an embodiment of this application.
  • FIG. 32 is a schematic structural diagram of another first electronic device according to an embodiment of the application.
  • FIG. 33 is a schematic structural diagram of another second electronic device according to an embodiment of the application.
  • Electronic equipment includes but is not limited to: terminal equipment, fixed electronic equipment, and network equipment.
  • the terminal device may be a mobile terminal device or a fixed terminal device.
  • the electronic device can be an electronic device in the prior art, or an electronic device that will appear in the future.
  • An electronic device can be a device that generates and displays a QR code; or, it can be a device that scans and processes a QR code; or, it can have the function of generating and displaying a QR code, scanning and processing a QR code at the same time The function of the device.
  • a terminal device is a device that provides users with voice and/or data connectivity.
  • Terminal equipment in this application mainly refers to, but is not limited to, mobile terminals, vehicle terminals, vehicle-mounted terminals, vehicle equipment, public terminals, handheld devices with wireless communication functions, wearable devices, computing devices, terminals with POS (point of sales) machine functions, And so on.
  • vehicle-mounted terminals include but are not limited to vehicle navigators
  • mobile terminals include, but are not limited to, mobile phones, wearable devices, tablet computers, and the like.
  • the terminal device may also be a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal in industrial control, a wireless terminal in unmanned driving, and a remote medical device.
  • Wireless terminals wireless terminals in smart grids, wireless terminals in smart cities, wireless terminals in smart homes, and so on.
  • Network equipment also known as radio access network (RAN) equipment is a type of equipment that connects terminal equipment to a wireless network, which includes equipment in various communication standards; there may be multiple types of network equipment Forms, such as macro base stations, micro base stations, relay stations, and access points; network equipment includes, but is not limited to, network equipment in a new air interface network, and network equipment in a long-term evolution network.
  • RAN radio access network
  • network equipment includes but is not limited to: transmission reception point (TRP), next generation Node B (gNB), global system for mobile communication (GSM) or code division Base transceiver station (BTS) in code division multiple access (CDMA), node B (NB) in wideband code division multiple access (WCDMA) system, long-term evolution
  • TRP transmission reception point
  • gNB next generation Node B
  • GSM global system for mobile communication
  • BTS code division Base transceiver station
  • CDMA code division multiple access
  • NB node B
  • WCDMA wideband code division multiple access
  • the evolved Node B evolutional Node B, eNB or eNodeB
  • RNC radio network controller
  • BSC base station controller
  • HeNB home evolved NodeB
  • HNB home Node B
  • baseband unit baseband uit, BBU
  • Fixed electronic equipment such as a bus scanner that can read two-dimensional codes and/or generate two-dimensional codes
  • a bus scanner that can read two-dimensional codes and/or generate two-dimensional codes
  • subway cloud gates that can read two-dimensional codes and/or generate two-dimensional codes.
  • the subway cloud gate can be referred to as the cloud gate for short.
  • Multiple means two or more than two, and other quantifiers are similar.
  • And/or describes the association relationship of the associated objects, indicating that there can be three types of relationships, for example, A and/or B, which can mean: A alone exists, A and B exist at the same time, and B exists alone.
  • the character “/” generally indicates that the associated objects before and after are in an "or” relationship.
  • Correspondence can refer to an association relationship or binding relationship, and the correspondence between A and B means that there is an association relationship or binding relationship between A and B.
  • FIG. 1 is a schematic diagram 1 of an application scenario provided by an embodiment of this application
  • FIG. 2 is a schematic diagram 2 of an application scenario provided by an embodiment of this application.
  • the solution of the embodiment of the present application can be applied to the mobile terminal shown in FIG. 1 and FIG. 2.
  • the mobile terminal can read two-dimensional codes displayed by other electronic devices; as shown in Figure 2, the mobile terminal can also generate and display two-dimensional codes.
  • FIG. 3 is a third schematic diagram of an application scenario provided by an embodiment of the application.
  • the solution of the embodiment of the present application can be applied to the gate shown in FIG. 3.
  • the gate can read the QR code displayed by other electronic devices.
  • the gate can also generate and display a two-dimensional code.
  • the embodiments of the present application can also be applied to devices such as mobile terminals or code scanners in payment scenarios.
  • the electronic device may provide a two-dimensional code, and then the user uses the two-dimensional code to complete payment behaviors, etc.
  • the electronic device may be attacked by malicious software, etc., and the QR code that the electronic device needs to display is replaced by the QR code generated by the malicious software, so that the electronic device displays The replaced QR code, in turn, the user's property is stolen.
  • the two-dimensional code is maliciously replaced, which causes losses to the user's property.
  • the electronic device may be a mobile terminal device.
  • mobile terminal devices The emergence and development of mobile terminal devices have brought great convenience to users' lives and work. For example, users can use mobile terminal devices for shooting, navigation, payment, and so on. With the powerful functions, storage capacity, and computing power of mobile terminal equipment, it is necessary to better ensure the user's privacy information and property safety in the mobile terminal equipment. Once the mobile terminal device is maliciously attacked, the user's private information and property in the mobile terminal device will be stolen.
  • the operating system in mobile terminal devices was not secure. Attacking devices could use security vulnerabilities to control the operating system kernel in the mobile terminal devices, and the attacking devices could steal user privacy information and property in the mobile terminal devices. For example, the attacking device uses security vulnerabilities to control the operating system kernel in the mobile terminal device, and then attacks the QR code generated by the mobile terminal device. Furthermore, the attacking device uses a malicious QR code to replace the two-dimensional code generated by the mobile terminal device. code.
  • the background program of the terminal device allows an activity to pop up to the foreground, and then becomes an application running in the foreground; when the user operates a normal foreground application, the user triggers a switch application
  • the program interface at the moment the terminal device switches the interface, the background malicious application can pop up its own interface, and then the malicious interface replaces the interface that the normal application needs to display; and the above process is very important for the user. It's hard to detect.
  • the terminal device needs to generate and display a QR code
  • the user triggers the normal application of the terminal device to generate and display the QR code; at this time, the malicious application in the background of the terminal device can be checked by thread The user's trigger behavior; then, the malicious application displays a malicious QR code, which replaces the QR code that needs to be displayed by the normal application.
  • the malicious QR code will carry the attacker's payment information, and further, the user's property will be stolen, causing losses to the user's property.
  • a malicious application in the background of a terminal device can view the thread information of other applications through the ps-At command, and this viewing operation does not require any additional permissions.
  • the malicious application can continuously check the thread information of the payment application. Therefore, the malicious application can check the start time of the thread characterized by the payment behavior through the side channel.
  • the malicious application executes the am command in the background to replace it.
  • the interface of the normal payment QR code can be used to replace it.
  • the QR code displayed on the web page carries the payee
  • the terminal device can parse the location information in the QR code; the terminal device displays the location information in the QR code; then, the user makes a manual judgment Whether the location information in the QR code is the location information of the payee.
  • this method is only suitable for remote payment scenarios.
  • This application provides a two-dimensional code processing method and device, which can solve the above-mentioned problems.
  • FIG. 4 is a schematic flowchart of a two-dimensional code processing method provided by an embodiment of the application.
  • the method is applied to the first electronic device, and the method includes:
  • the first electronic device may be a mobile terminal device, a terminal device with POS function, or a cloud gate; or, the first electronic device may be another device or device that can execute the solution of this example.
  • the first electronic device may use a rich execution environment (REE) system to complete each step, or the first electronic device may use a trusted execution environment (TEE) system to complete each step.
  • the first electronic device may use other operating systems to complete various steps, and this embodiment does not limit the architecture and system on which the first electronic device is based.
  • the second electronic device can use the REE system to complete each step, or the second electronic device can use the TEE system to complete each step, or the second electronic device can use other operating systems to complete each step. Based on the architecture and system, there are no restrictions.
  • the first electronic device and the second electronic device can interact within a close range. After the second electronic device receives the trigger instruction, the second electronic device determines that it needs to generate and display a two-dimensional code.
  • the two-dimensional code displayed by the second electronic device is called two-dimensional code information; the two-dimensional code information is a black and white or color interface.
  • the second electronic device can obtain scene information related to the second electronic device, and the scene information related to the second electronic device is referred to as second scene information; and, the second electronic device obtains two-dimensional code data; two-dimensional code data
  • the user information of the user corresponding to the second electronic device is characterized.
  • the second electronic device generates two-dimensional code information according to the second scene information and the two-dimensional code data; thus, the two-dimensional code information carries scene information and two-dimensional code data related to the second electronic device.
  • the second electronic device may generate the two-dimensional code information according to the pre-stored two-dimensional code data and the acquired second scene information.
  • the second electronic device may obtain the two-dimensional code data from the network device; then, according to the two-dimensional code data and the obtained second scene information, generate the two-dimensional code information.
  • the QR code data includes but is not limited to the user information of the user as the payee; or, in the payment scenario, the QR code data includes but is not limited to the user information of the user as the payer .
  • the two-dimensional code data includes but is not limited to user information and user identification.
  • the second scene information includes but is not limited to the following information: global positioning system (GPS) information of the second electronic device, Bluetooth information of the second electronic device, wireless fidelity of the second electronic device , Wifi) information, natural environment information where the second electronic device is located.
  • GPS global positioning system
  • the Bluetooth information of the second electronic device is the Bluetooth information of the Bluetooth connection sent by the second electronic device.
  • the wifi information of the second electronic device is information of the wireless local area network to which the second electronic device is connected.
  • the natural environment information where the second electronic device is located includes but is not limited to the following information: environmental noise information, environmental light information, environmental humidity information, and environmental temperature information.
  • the second electronic device displays the two-dimensional code information, and then the first electronic device can scan the two-dimensional code displayed by the second electronic device.
  • first scene information is scene information related to the first electronic device.
  • the first electronic device may also obtain scene information related to the first electronic device; the scene information related to the first electronic device is referred to as the first scene information.
  • the first scene information includes but is not limited to the following information: global positioning system (GPS) information of the first electronic device, Bluetooth information of the first electronic device, wireless fidelity of the first electronic device , Wifi) information, natural environment information where the first electronic device is located.
  • GPS global positioning system
  • the Bluetooth information of the first electronic device is the Bluetooth information of the Bluetooth connection sent by the first electronic device.
  • the wifi information of the first electronic device is information of the wireless local area network to which the first electronic device is connected.
  • the natural environment information where the first electronic device is located includes but is not limited to the following information: environmental noise information, environmental light information, environmental humidity information, and environmental temperature information.
  • the first electronic device can obtain the two-dimensional code data and the second scene after analyzing the scanned two-dimensional code information. Scene information.
  • step 102 and step 103 there is no restriction on the execution order of the first electronic device's process of parsing the two-dimensional code information and the first electronic device's process of obtaining the first scene information. That is, the execution order of step 102 and step 103 is not limited. You can perform step 102 now, and then perform step 103; you can also perform step 103 first, and then perform step 102; or you can perform step 102 and step 103 at the same time.
  • the first electronic device has acquired the first scene information related to the first electronic device, and in step 103, the first electronic device has acquired the second scene related to the second electronic device Information; Then, the first electronic device can verify the first scene information and the second scene information, and then determine whether the first scene information and the second scene information meet the preset conditions.
  • the preset condition may be that the first electronic device and The second electronic device is located in the same geographic area.
  • the scene information is wifi information
  • the first scene information is information of the wireless local area network to which the first electronic device is connected
  • the second scene information is information of the wireless local area network to which the second electronic device is connected
  • the preset condition may be that both the first electronic device and the second electronic device are connected to the same wireless local area network; or, the preset condition may be the wireless local area network to which the first electronic device is connected, and the wireless local area network to which the second electronic device is connected Network, both belong to the same network range.
  • the scene information is Bluetooth information
  • the second scene information is the Bluetooth connection sent by the second electronic device
  • the first scene information is the Bluetooth list of which the first electronic device can connect to Bluetooth
  • the preset condition is the second The Bluetooth connection represented by the scene information is located in the Bluetooth list represented by the first scene information.
  • the preset conditions may be It is the light intensity represented by the first scene information and the light intensity represented by the second scene information, both of which are the same.
  • the preset conditions may be It is the light intensity represented by the first scene information and the light intensity represented by the second scene information, both of which are the same.
  • the first electronic device may perform preset processing on the acquired two-dimensional code data.
  • the preset processing includes, but is not limited to: transfer processing to the payee represented by the QR code data, deduction processing to the payer represented by the QR code data, and sending a preset request to the user represented by the QR code data;
  • the preset request for example, is a request to add a friend.
  • the first electronic device obtains the two-dimensional code information displayed by the second electronic device; the first electronic device obtains the first scene information, and according to the two-dimensional code information, determines the two-dimensional code data and the second scene information, where ,
  • the first scene information is scene information related to the first electronic device, and the second scene information is scene information related to the second electronic device; the first electronic device is determining that the first scene information and the second scene information meet a preset condition When the QR code data is pre-processed.
  • the scene information of the electronic device is added to the two-dimensional code, and the scene information in the two-dimensional code displayed by the second electronic device is related to the second electronic device; then, the first electronic device can obtain the two-dimensional code The second scene information related to the second electronic device; and the first electronic device can obtain the first scene information related to the first electronic device; the first electronic device can obtain the first scene information related to the first electronic device , The second scene information related to the second electronic device, compare the two to determine whether the two match; if it is determined to match, the first electronic device can determine that the scanned QR code is from the second electronic device The generated QR code is not sent by other malicious devices; then, the first electronic device can process the scanned QR code.
  • the QR code can be automatically verified based on the scene information, and the scene information of two electronic devices that need to interact with the QR code can be compared, and then the QR code can be verified; it can effectively ensure that the scanned QR code is not
  • the malicious QR code can identify the malicious QR code; thereby ensuring the safety of the user’s property.
  • FIG. 5 is a schematic flowchart of another two-dimensional code processing method provided by an embodiment of the application.
  • the method is applied to the first electronic device, and the method includes:
  • the first electronic device may be a mobile terminal device, a terminal device with POS function, or a cloud gate; or, the first electronic device may be another device or device that can execute the solution of this example.
  • the first electronic device may use the REE system to complete each step, or the first electronic device may use a trusted execution environment (TEE) system to complete each step, or the first electronic device may use other
  • TEE trusted execution environment
  • the operating system completes each step, and this embodiment does not limit the architecture and system on which the first electronic device is based.
  • the second electronic device can use the REE system to complete each step, or the second electronic device can use the TEE system to complete each step, or the second electronic device can use other operating systems to complete each step. Based on the architecture and system, there are no restrictions.
  • step 101 shown in FIG. 4 please refer to step 101 shown in FIG. 4, and will not be repeated here.
  • first scene information is scene information related to the first electronic device.
  • this step may refer to step 102 shown in FIG. 4, and details are not described herein again.
  • this step may refer to step 103 shown in FIG. 4, and details are not described herein again.
  • Step 202 can be performed now, and then step 203 can be performed; step 203 can be performed first, and then step 202 can be performed; step 202 and step 203 can also be performed at the same time.
  • this step may refer to step 104 shown in FIG. 4, and details are not described herein again.
  • the first electronic device has acquired first scene information related to the first electronic device
  • the first electronic device has acquired information related to the second electronic device. Then, the first electronic device can verify the first scene information and the second scene information, and then determine whether the first scene information and the second scene information meet the preset conditions.
  • the first electronic device determines that the first scene information and the second scene information meet the preset conditions, it determines that the acquired two-dimensional code data has been tampered with or replaced, and the first electronic device will not perform any operations on the two-dimensional code data. Preset processing.
  • the first electronic device needs to prompt the user, the first electronic device prompts the user that the QR code has been replaced; the first electronic device generates prompt information, and the first electronic device displays the prompt information to the user holding the first electronic device ,
  • the prompt information indicates that the QR code is a dangerous QR code.
  • the first electronic device may also send prompt information to the second electronic device for prompting that the two-dimensional code generated by the second electronic device has been maliciously replaced.
  • FIG. 6 is a schematic diagram of the display of the first electronic device provided by an embodiment of the application. As shown in FIG. 6, the first electronic device may pop up a display interface that is used to prompt the user of the obtained QR code It was replaced maliciously. The user can select a button on the display interface to close the display interface; or, the first electronic device can control the display interface to gradually message.
  • the first electronic device sends a prompt message to the user to prompt that the QR code has been maliciously replaced, and then prompts the user not to perform subsequent operations Up.
  • the scene information is wifi information
  • the first scene information is information of the wireless local area network to which the first electronic device is connected
  • the second scene information is information of the wireless local area network to which the second electronic device is connected
  • the first electronic device sends a prompt message to the user to prompt the second
  • the dimension code was maliciously replaced, and the user was prompted not to perform subsequent operations.
  • the scene information is Bluetooth information
  • the second scene information is the Bluetooth connection sent by the second electronic device
  • the first scene information is the Bluetooth list that the first electronic device can connect to Bluetooth
  • the first electronic device determines the first electronic device 2. If the Bluetooth connection sent by the electronic device is no longer in the Bluetooth list of the first electronic device, the first electronic device sends a prompt message to the user to indicate that the QR code has been maliciously replaced, and then prompts the user not to perform subsequent operations .
  • the first electronic device compares the first scene information related to the first electronic device and the second scene information related to the second electronic device to determine the two If it is determined that there is no match, the first electronic device can determine that the scanned QR code is not generated by the second electronic device, but is generated by the malicious device and replaced in the second electronic device; thus, The first electronic device may send a prompt message to prompt the user or the second electronic device.
  • the two-dimensional code can be automatically verified based on the scene information, and when it is determined that the scanned two-dimensional code is a two-dimensional code that has been maliciously attacked, a prompt message is issued to protect the user's property safety.
  • FIG. 7 is a schematic flowchart of another two-dimensional code processing method provided by an embodiment of the application.
  • the method is applied to a first electronic device, and a rich execution environment (REE) is deployed in the system of the first electronic device; the method includes:
  • the first electronic device may be a mobile terminal device, a terminal device with POS function, or a cloud gate; or, the first electronic device may be another device or device that can execute the solution of this example.
  • the REE system can be deployed in the electronic equipment system.
  • the REE system can include the following operating modes: user mode, kernel mode, and so on.
  • the second electronic device can use the REE system to complete each step, or the second electronic device can use the TEE system to complete each step, or the second electronic device can use other operating systems to complete each step. Based on the architecture and system, there are no restrictions.
  • the second electronic device may obtain second scene information related to the second electronic device; the second electronic device generates and displays the two-dimensional code information according to the second scene information and the two-dimensional code data.
  • the REE system of the first electronic device may obtain the first scene information in the user mode or the kernel mode.
  • other operating systems are configured in the first electronic device, and the REE system of the first electronic device interacts with the other operating systems to obtain the first scene information.
  • the first scene information is scene information related to the first electronic device.
  • step 303 specifically includes: decrypting the two-dimensional code information to obtain the two-dimensional code data and the second scene information.
  • the REE system of the first electronic device can decrypt and analyze the scanned two-dimensional code information in user mode or kernel mode to obtain two-dimensional code data and second scene information.
  • other operating systems are configured in the first electronic device, and the other operating systems of the first electronic device decrypt and analyze the scanned two-dimensional code information.
  • step 302 and step 303 There is no restriction on the execution order of step 302 and step 303. You can perform step 302 now, and then perform step 303; you can also perform step 303 first, and then perform step 302; or you can perform step 302 and step 303 at the same time.
  • the REE system of the first electronic device can analyze the first scene information and the second scene information in the user mode or the kernel mode.
  • other operating systems are configured in the first electronic device, and other operating systems of the first electronic device analyze the first scene information and the second scene information.
  • step 104 For the specific process of analyzing the first scene information and the second scene information, refer to step 104 shown in FIG. 4, which will not be repeated.
  • the first electronic device executes each step on the REE system side, and the QR code can be automatically verified based on the scene information, and the scene information of the two electronic devices that need to interact with the QR code can be compared, and then the two-dimensional code The code is verified; it can effectively ensure that the scanned two-dimensional code is not a two-dimensional code maliciously attacked, and a malicious two-dimensional code can be identified; thereby ensuring the safety of the user’s property.
  • FIG. 8 is a schematic flowchart of another two-dimensional code processing method provided by an embodiment of the application.
  • the method is applied to a first electronic device, the system of the first electronic device is deployed with a REE, and the first electronic device is provided with a first scene device; the method includes:
  • the first electronic device may be a mobile terminal device, a terminal device with POS function, or a cloud gate; or, the first electronic device may be another device or device that can execute the solution of this example.
  • the REE system can be deployed in the electronic equipment system.
  • the REE system can include the following operating modes: user mode, kernel mode, and so on.
  • the second electronic device can use the REE system to complete each step, or the second electronic device can use the TEE system to complete each step, or the second electronic device can use other operating systems to complete each step. Based on the architecture and system, there are no restrictions.
  • the second electronic device may obtain second scene information related to the second electronic device; the second electronic device generates and displays the two-dimensional code information according to the second scene information and the two-dimensional code data.
  • the REE system of the first electronic device may obtain the first scene information in the user mode or the kernel mode.
  • the first scene information is scene information related to the first electronic device.
  • the first scene device can be configured in the first electronic device.
  • the first scene device is a GPS chip
  • the first scene information is GPS information.
  • the first scene device is a wifi module
  • the first scene information is wifi information.
  • the first scene device is a Bluetooth chip
  • the first scene information is Bluetooth information.
  • the first scene device is a temperature sensor
  • the first scene information is ambient temperature information.
  • the first scene device is a sound sensor
  • the first scene information is environmental noise information.
  • the first scene device is a photosensitive sensor, and the first scene information is ambient lighting information.
  • the REE system of the first electronic device and the first scene device can directly interact, and the REE system of the first electronic device can obtain the first scene information detected by the first scene device.
  • the REE system of the first electronic device can directly send an instruction to the first scene device to obtain the first scene information.
  • the REE system of the first electronic device sends a first request message to the first scene device; then, the first scene device sends the detected first scene information to the REE system of the first electronic device.
  • the REE system of the first electronic device may receive the first scene information returned by the first scene device.
  • Step 403 is executed after step 402.
  • step 404 specifically includes: decrypting the two-dimensional code information to obtain the two-dimensional code data and the second scene information.
  • the REE system of the first electronic device can decrypt and analyze the scanned two-dimensional code information in user mode or kernel mode to obtain two-dimensional code data and second scene information. That is, the first electronic device completes the analysis of the two-dimensional code information in the REE system.
  • step 402 can be performed now, and then step 404 can be performed; step 404 can be performed first, and then step 402 can be performed; step 402 and step 404 can also be performed at the same time.
  • the REE system of the first electronic device can analyze the first scene information and the second scene information in the user mode or the kernel mode. That is, the first electronic device completes the analysis of the first scene information and the second scene information in the REE system.
  • step 104 For the analysis of the first scene information and the second scene information, refer to step 104 shown in FIG. 4, which will not be repeated.
  • each step is executed on the REE system side through the first electronic device, that is, the acquisition and verification of scene information is completed in the REE environment, and the QR code can be automatically verified based on the scene information.
  • the scene information of the electronic device interacted by the dimensional code can then complete the verification of the two-dimensional code; it can effectively ensure that the scanned two-dimensional code is not a two-dimensional code that is maliciously attacked, and the malicious two-dimensional code can be identified; thus, the user’s Property safety.
  • the processing process is simple and fast.
  • FIG. 9 is a schematic flowchart of another two-dimensional code processing method provided by an embodiment of the application.
  • the method is applied to a first electronic device, and a rich execution environment (REE) and a trusted execution environment (TEE) are deployed in the system of the first electronic device;
  • An electronic device is provided with a first scene device; the method includes:
  • the first electronic device may be a mobile terminal device, a terminal device with POS function, or a cloud gate; or, the first electronic device may be another device or device that can execute the solution of this example.
  • TrustZone technology In order to ensure the security of electronic equipment, TrustZone technology and ARM (advanced RISC machines) hardware virtualization technology are introduced.
  • Mobile terminal equipment can use ARM TrustZone technology to ensure that mobile terminal equipment is not easily attacked.
  • the hardware security features in the ARM central processing unit (CPU) can support TrustZone technology and ARM hardware virtualization technology; ARM TrustZone technology has higher authority than the operating system, so it will not be easily attacked.
  • the ARM TrustZone technology divides the hardware resources into two system sides, namely the REE system side and the TEE system side; further, the ARM TrustZone technology divides the hardware resources into two worlds, namely the non-secure world and the secure world; the REE side is the non-secure world and the secure world.
  • the safe world, the TEE side is the safe world.
  • TrustZone technology as a technology to ensure system security, runs in the TEE system.
  • the non-secure world does not mean that the operating system or software running in the REE system is malicious, but it means that the security of the REE system is lower than that of the TEE system. Because when the central processing unit (CPU) is working in the TEE system, the resources on the TEE system side are not allowed to be accessed by the central processing unit; the resources on the TEE system side, such as registers, memory, Cache, External devices, etc.; when the central processing unit accesses resources on the TEE system side, it causes the REE system to crash. However, running the hardware and software in the TEE system can have higher access rights.
  • the hardware using TrustZone technology can configure the TZASC (TrustZone address space converter) register and the TZMA (TrustZone memory adapter) register to set the sensitive memory as the secure memory; and the REE system cannot perform the secure memory. access.
  • TZASC TrustZone address space converter
  • TZMA TrustZone memory adapter
  • the central processing unit can not only access the resources in the TEE system, but also access the resources in the REE system.
  • FIG. 10 is a schematic diagram of an ARMv7 system architecture provided by an embodiment of the application.
  • the REE system as a non-secure world includes the following layers of architecture (CPU mode): user mode (USR), kernel mode (SVC), hypervisor mode (hypervisor mode, HYP) ).
  • the user mode and kernel mode in the REE system can run an operating system that is closely related to users and user operations; the HYP mode is the mode with the highest access authority in the REE system.
  • the central processing unit when the central processing unit is working in HYP mode, the central processing unit can access all hardware resources in user mode, kernel mode and HYP mode; when the central processing unit is working in user mode or kernel mode , The central processing unit cannot access all hardware resources in the HYP mode.
  • the REE as a non-secure world contains three levels of authority, namely PL0, PL1, and PL2.
  • PL0 is the user mode
  • PL1 is the kernel mode
  • PL2 is the HYP mode.
  • the TEE system as a secure world includes the following layers of architecture (CPU mode): user mode (USR), kernel mode (SVC), and monitor mode (MON) .
  • the TEE system may also include a hypervisor mode (hypervisor mode, HYP).
  • the monitoring mode is the mode with the highest access authority in the TEE system.
  • the central processing unit when the central processing unit is working in the monitoring mode, the central processing unit can access all the hardware resources of the secure world and can also access all the hardware resources of the non-secure world.
  • TrustZone technology can be used in the monitoring mode to configure the Hypervisor-related control registers to initialize and activate the Hypervisor mode.
  • the monitoring mode in TEE is also a gateway for the non-secure world to enter the secure world.
  • an instruction to enter the TEE (secure monitor call, SMC) can be executed, and then the REE system can be actively switched to the monitoring mode of the TEE system.
  • the ERET instruction in the monitoring mode of the TEE system, can be executed, and the central processing unit can check the NS bit of the SCR (secure control register) register to determine whether to stay in the TEE system; when the NS bit is 1 , The return operation in the monitoring mode returns to the kernel of the REE system, and then performs the world switch operation; when the NS position is 0, the return operation in the monitoring mode returns to the kernel of the TEE system without executing the system ( World) switching operation.
  • SCR secure control register
  • FIG. 11 is a schematic diagram of instructions in the REE system provided by an embodiment of the application. As shown in Figure 11, you can execute the HVC (hypervisor call) instruction in the kernel mode of the REE system to enter the HYP mode of the REE system; you can execute the ERET instruction in the HYP mode of the REE system, and then return to the REE system kernel from the HYP mode mode.
  • HVC hypervisor call
  • ARM has introduced the memory virtualization technology of the second level of memory address translation (Stage-2translation); using this technology, the level of memory address translation from virtual address to physical address (VA->PA) is transformed into the following process: Address translation from the virtual address to the intermediate address (VA->IPA), and then from the intermediate address to the physical address (IPA->PA). That is, after the two-layer memory address translation of VA->IPA->PA.
  • the second-level memory address translation (IPA->PA) process is fully controlled by the hypervisor and is transparent to the operating system; and for the operating system, IPA is the "physical address" used by the hypervisor .
  • the second-level address translation page table entry can be used to access the attributes of the monitoring bit, and then the hypervisor performs access control on the memory access of the operating system.
  • the second-level address translation page table entries include: read (R) control bits, write (W) control bits, and execute (X) control bits.
  • the read-write control bit is related to the data protection of the memory
  • the execution control bit is related to the execution of the memory code.
  • the Hypervisor can be used to resist mobile phone root attacks and kernel code tampering attacks, and the Hypervisor can be used to protect the kernel in real time.
  • the mobile terminal device can use TEE to generate a QR code in a payment scenario.
  • the application program of the mobile terminal device runs on the REE side of the mobile terminal device; when the application program of the mobile terminal device needs to draw a QR code, the application program of the mobile terminal device transmits to the mobile terminal device through the communication interface between the REE and TEE.
  • the kernel sends an SMC (secure monitor call) command, and the SMC command is used to request the TEE to draw a QR code.
  • the TEE of the mobile terminal device draws and displays the two-dimensional code.
  • malicious devices or malicious applications can still attack the QR code generation process.
  • the malicious application of the mobile terminal device sends an SMC command to the core of the mobile terminal device through the communication interface between the REE and TEE
  • the malicious application can initiate a denial of service (Dos) attack, and the malicious application passes the Dos Reject the SMC request; and, the malicious application generates a malicious QR code, and replaces the malicious QR code with the normal QR code.
  • the malicious application generates a fake QR code interface and replaces the fake QR code interface. , Replace to the normal QR code interface.
  • only the method of generating a QR code on the TEE side will still receive a total of malicious devices or malicious applications, and there is still no guarantee that the QR code will not be maliciously replaced, and there is a possibility that the user's property will be stolen.
  • FIG. 12 is a schematic diagram of system deployment of a first electronic device provided by an embodiment of the application. As shown in Figure 12, the REE system and the TEE system are deployed in the first electronic device.
  • the REE side of the first electronic device includes the following layers of architecture: user mode (USR), kernel mode (SVC), and hypervisor mode (HYP).
  • the TEE side of the first electronic device includes the following layers of architecture: user mode (USR), kernel mode (SVC), and monitor mode (MON).
  • the second electronic device can use the REE system to complete each step, or the second electronic device can use the TEE system to complete each step, or the second electronic device can use other operating systems to complete each step. Based on the architecture and system, there are no restrictions.
  • the second electronic device may obtain second scene information related to the second electronic device; the second electronic device generates and displays the two-dimensional code information according to the second scene information and the two-dimensional code data.
  • the application program that needs to scan and process the two-dimensional code may run on the REE side of the first electronic device.
  • the application program runs in the user mode on the REE side of the first electronic device. Therefore, the first electronic device scans the two-dimensional code information displayed by the second electronic device on the REE side.
  • the user triggers the first electronic device to perform a scanning behavior; the REE of the first electronic device sends a scanning instruction to the camera of the first electronic device, and then the first electronic device scans the second scene information written with the second scene information through the camera. Dimension code information.
  • step 502 specifically includes: decrypting the two-dimensional code information to obtain the two-dimensional code data and the second scene information.
  • the first electronic device decrypts and parses the two-dimensional code information on the REE side to obtain two-dimensional code data and second scene information, where the second scene information is scene information related to the second electronic device.
  • step 503 may be included:
  • the REE of the first electronic device uses the public key to perform the second scene information.
  • Signature processing to obtain the second scene information after the signature.
  • the first scene information is scene information related to the first electronic device.
  • the second request message includes the second scene information, or the second request information is used to indicate the second scene information.
  • the REE of the first electronic device triggers the SMC instruction to enter the TEE of the first electronic device. Then, the REE of the first electronic device requests the first scene information of the first electronic device from the TEE of the first electronic device based on the second scene information.
  • the REE of the first electronic device sends a second request message to the TEE of the first electronic device, where the second request message is used to indicate that the first scene information related to the first electronic device needs to be acquired.
  • the TEE of the first electronic device is also required to verify the second scene information related to the second electronic device, so the REE of the first electronic device needs to send the second scene information to the TEE of the first electronic device.
  • the REE of the first electronic device directly sends the signed second scene information to the TA of the TEE of the first electronic device.
  • the REE of the first electronic device puts the signed second scene information into the second request message, and the REE of the first electronic device sends the second request message to the TA of the TEE of the first electronic device.
  • the second request message may indicate the signed second scene information; the REE of the first electronic device sends the second request message to the TA of the TEE of the first electronic device.
  • the return message is the verification result
  • step 505 specifically includes: receiving the verification result returned by the TEE based on the REE, where the verification result is generated after the TEE compares the first scene information with the second scene information, and the verification result represents the first The scene information and the second scene information meet the preset condition.
  • the first scene information is obtained after the TEE uses the private key to determine that the signed second scene information passes verification.
  • the first scene information is obtained after the TEE sets the first scene device to a preset configuration, and the preset configuration indicates that the first scene information can only be obtained by the TEE.
  • the first scene information includes at least one of the following: GPS information, wifi information, Bluetooth information, and natural environment information
  • the second scene information includes at least one of the following: GPS information, wifi information, Bluetooth information, and natural environment information.
  • the preset condition is that both the first scene information and the second scene information belong to the preset geographic range.
  • the preset condition is that the wifi identifier represented by the second scene information exists in the wifi list represented by the first scene information.
  • the preset condition is that the Bluetooth identifier represented by the second scene information exists in the Bluetooth list represented by the first scene information.
  • the preset condition is that both the first scene information and the second scene information belong to the preset numerical range.
  • the TA of the TEE of the first electronic device needs to verify the source of the information after acquiring the signed second scene information based on the second request message.
  • the TA of the TEE of the first electronic device uses the private key corresponding to the public key to sign and verify the signed second scene information.
  • the TEE of the first electronic device needs to obtain the first scene information detected by the first scene device.
  • the TA of the TEE of the first electronic device determines that the signed second scene information is verified, the TA of the TEE of the first electronic device sends an acquisition request to the core of the TEE, and the acquisition request is used to instruct to acquire the first Scene information.
  • the TA of the TEE of the first electronic device when the TA of the TEE of the first electronic device passes the verification of the signed second scene information, it sends an acquisition request to the core of the TEE, and the acquisition request is used to instruct to acquire the first scene information.
  • the first scene device in the first electronic device may collect the first scene information. Before the core of the TEE of the first electronic device reads the first scene information, the TEE of the first electronic device needs to transfer the first scene device It is configured so that only TEE can read it. This is because the first scene device can be read by the REE and TEE of the first electronic device; however, REE is a non-secure world.
  • the REE reads the information detected by the first scene device
  • REE may be maliciously attacked
  • the first scene information read by the REE will be maliciously tampered with; TEE is a safe world, and the first scene device needs to be configured to be read by only the TEE, then the TEE reads the information detected by the first scene device , The TEE will be maliciously attacked, and the first scene information read by the TEE will not be maliciously tampered with, ensuring the accuracy and security of the first scene information.
  • the core of the TEE of the first electronic device is set to a preset configuration for the first scene device; the preset configuration represents the first scene information detected by the first scene device, and can only be used by the TEE of the first electronic device.
  • the core of the TEE of the first electronic device reads the first scene information detected by the first scene device.
  • the kernel of the TEE of the first electronic device sends the first scene information to the TA of the TEE of the first electronic device.
  • the TA of the TEE of the first electronic device verifies the first scene information and the second scene information according to preset conditions, and generates a verification result.
  • the verification result is characterized as that the first scene information and the second scene information meet the preset conditions, that is, the second scene information passes the verification; in the first scene information and
  • the verification result is characterized as that the first scene information and the second scene information do not meet the preset condition, that is, the second scene information does not pass the verification.
  • the scene information is GPS information, that is, the first scene information is the location where the first electronic device is located, and the second scene information is the location where the second electronic device is located.
  • the TEE of the first electronic device can determine whether the location represented by the first scene information and the location represented by the second scene information belong to the same preset geographic range; if they belong, the TEE of the first electronic device determines the second The scene information passes the verification; if it does not belong, the TEE of the first electronic device determines that the second scene information does not pass the verification.
  • the scene information is wifi information, that is, the first scene information is information of the wireless local area network to which the first electronic device is connected, and the second scene information is information of the wireless local area network to which the second electronic device is connected.
  • the TEE of the first electronic device can determine whether the wireless local area network represented by the first scene information and the wireless local area network represented by the second scene information belong to the same network range; if so, the TEE of the first electronic device determines the first Second, the scene information passes the verification; if not, the TEE of the first electronic device determines that the second scene information does not pass the verification.
  • the scene information is wifi information
  • the first scene information is information of a wireless local area network to which the first electronic device is connected
  • the second scene information is a list of wireless local area networks in the second electronic device.
  • the TEE of the first electronic device can determine whether the wireless local area network represented by the second scene information exists in the list of the first wireless local area network represented by the scene information; if so, the TEE of the first electronic device determines the second scene information Pass the verification; if not, the TEE of the first electronic device determines that the second scene information does not pass the verification.
  • the scene information is Bluetooth information, that is, the first scene information is information of Bluetooth to which the first electronic device is connected, and the second scene information is a list of Bluetooth in the second electronic device.
  • the TEE of the first electronic device can determine whether the Bluetooth represented by the second scene information exists in the list of Bluetooth represented by the first scene information; if so, the TEE of the first electronic device determines that the second scene information is verified; if If no, the TEE of the first electronic device determines that the second scene information does not pass the verification.
  • the scene information is natural environment information, that is, the first scene information is environment information of the environment where the first electronic device is located, and the second scene information is environment information of the environment where the second electronic device is located.
  • the TEE of the first electronic device can determine whether the environmental information represented by the first scene information and the environmental information represented by the second scene information belong to the same range; if so, the TEE of the first electronic device determines the second scene The information passes the verification; if not, the TEE of the first electronic device determines that the second scene information does not pass the verification.
  • Natural environment information including but not limited to the following information: light information, noise information, temperature information, and humidity information.
  • the TA of the TEE of the first electronic device passes the system kernel and sends the verification result to the REE of the first electronic device.
  • the REE of the first electronic device receives the verification result sent by the first electronic device.
  • the REE of the first electronic device may perform preset processing on the two-dimensional code data.
  • FIG. 13 provides an interactive diagram of the REE and TEE of the first electronic device according to an embodiment of the application.
  • the application layer sequence scans the two-dimensional code information displayed on the second electronic device; REE decrypts the two-dimensional code information to obtain the two-dimensional code data and the second scene information; REE uses the public key to perform the second scene information Signature processing, to obtain the second scene information after the signature.
  • step 1 REE triggers the SMC instruction to enter the TEE, and sends the signed second scene information to the TA of the TEE.
  • the TA of the TEE uses the private key to verify the signed second scene information; after the TA of the TEE confirms that the signed second scene information is verified, the TA of the TEE sends an acquisition request to the core of the TEE to obtain the request. Used to indicate to obtain the first scene information.
  • the kernel of the TEE sets the first scene information in the first electronic device as a preset configuration, and the preset configuration indicates that the first scene information can only be acquired by the kernel of the TEE.
  • the core of the TEE reads the first scene information.
  • the core of the TEE sends the first scene information to the TA of the TEE. Step 6.
  • the TA of the TEE verifies the determined first scene information and the second scene information according to preset conditions, and generates a verification result; the TA of the TEE sends the verification result to the REE through the system kernel, where the verification result represents the second scene The information passes the verification, or the verification result indicates that the second scene information does not pass the verification.
  • the two-dimensional code information displayed by the second electronic device is acquired through the REE of the first electronic device; the REE of the first electronic device determines the two-dimensional code data and the second related to the second electronic device according to the two-dimensional code information.
  • the REE of the first electronic device instructs the TEE of the first electronic device to read the first scene information related to the first electronic device; the TEE of the first electronic device can set the first scene device to only be read by the TEE Therefore, it is ensured that the first scene information detected by the first electronic device will not be tampered with by malicious applications in the REE environment, and the security of the first scene information is guaranteed; since TEE is a safe world, the first electronic device’s The TEE verifies the first scene information and the second scene information, which can ensure the validity and accuracy of the verification results, and ensure that the first scene information and the second scene information will not be tampered with; and the TEE of the first electronic device will be accurate
  • the verification result of is sent to the REE of the first electronic device; after the REE of the first electronic device determines that the verification result indicates that the second scene information is verified, the QR code is subjected to preset processing, such as payment or deduction processing.
  • the QR code can be automatically verified based on the scene information, and the scene information of two electronic devices that need to interact with the QR code can be compared, and then the QR code can be verified; it can effectively ensure that the scanned QR code is not
  • the malicious QR code can identify the malicious QR code; thereby ensuring the safety of the user’s property. And because of the security of the TEE environment, it is ensured that the process of acquiring and verifying scene information will not be maliciously attacked, which further ensures that the two-dimensional code is effectively verified and the malicious two-dimensional code is effectively identified.
  • FIG. 14 is a schematic flowchart of another two-dimensional code processing method provided by an embodiment of the application.
  • the method is applied to the second electronic device; the method includes:
  • the second electronic device may be a mobile terminal device, a terminal device with a POS function, or a cloud gate; or, the second electronic device may be another device or device that can execute the solution of this example.
  • the first electronic device can use the REE system to complete each step, or the first electronic device can use the TEE system to complete each step, or the first electronic device can use other operating systems to complete each step.
  • the architecture and system on which the first electronic device is based are not limited.
  • the second electronic device can use the REE system to complete each step, or the second electronic device can use the TEE system to complete each step, or the second electronic device can use other operating systems to complete each step. Based on the architecture and system, there are no restrictions.
  • the first electronic device and the second electronic device can interact within a close range. After the second electronic device receives the trigger instruction, the second electronic device determines that it needs to generate and display a two-dimensional code.
  • the two-dimensional code displayed by the second electronic device is called two-dimensional code information; the two-dimensional code information is a black and white or color interface.
  • the second electronic device may obtain scene information related to the second electronic device, and the scene information related to the second electronic device is referred to as second scene information.
  • the second scene information includes but is not limited to the following information: GPS information of the second electronic device, Bluetooth information of the second electronic device, WiFi information of the second electronic device, and natural environment information where the second electronic device is located.
  • the Bluetooth information of the second electronic device is the Bluetooth information of the Bluetooth connection sent by the second electronic device.
  • the wifi information of the second electronic device is information of the wireless local area network to which the second electronic device is connected.
  • the natural environment information where the second electronic device is located includes but is not limited to the following information: environmental noise information, environmental light information, environmental humidity information, and environmental temperature information.
  • 602. Generate and display the two-dimensional code information according to the second scene information and the preset two-dimensional code data, where the two-dimensional code information is used by the first electronic device to determine that the first scene information and the second scene information match When the conditions are preset, the two-dimensional code data is preset, and the first scene information is scene information related to the first electronic device.
  • the first scene information includes at least one of the following: GPS information, wifi information, Bluetooth information, and natural environment information
  • the second scene information includes at least one of the following: GPS information, wifi information, Bluetooth information, and natural environment information.
  • the preset condition is that both the first scene information and the second scene information belong to the preset geographic range.
  • the preset condition is that the wifi identifier represented by the second scene information exists in the wifi list represented by the first scene information.
  • the preset condition is that the Bluetooth identifier represented by the second scene information exists in the Bluetooth list represented by the first scene information.
  • the preset condition is that both the first scene information and the second scene information belong to the preset numerical range.
  • the second electronic device acquires two-dimensional code data; the two-dimensional code data represents user information of the user corresponding to the second electronic device. Then, the second electronic device generates two-dimensional code information according to the second scene information and the two-dimensional code data; thus, the two-dimensional code information carries scene information and two-dimensional code data related to the second electronic device.
  • the second electronic device may generate the two-dimensional code information according to the pre-stored two-dimensional code data and the acquired second scene information.
  • the second electronic device may obtain the two-dimensional code data from the network device; then, according to the two-dimensional code data and the obtained second scene information, generate the two-dimensional code information.
  • the QR code data includes but is not limited to the user information of the user as the payee; or, in the payment scenario, the QR code data includes but is not limited to the user information of the user as the payer .
  • the two-dimensional code data includes but is not limited to user information and user identification.
  • the second electronic device displays the two-dimensional code information, and then the first electronic device can scan the two-dimensional code displayed by the second electronic device.
  • the first electronic device can obtain the two-dimensional code data and the second scene information after analyzing the scanned two-dimensional code information.
  • the first electronic device may also obtain scene information related to the first electronic device; the scene information related to the first electronic device is referred to as first scene information.
  • the first scene information includes but is not limited to the following information: GPS information of the first electronic device, Bluetooth information of the first electronic device, wifi information of the first electronic device, and natural environment information where the first electronic device is located.
  • the Bluetooth information of the first electronic device is the Bluetooth information of the Bluetooth connection sent by the first electronic device.
  • the wifi information of the first electronic device is information of the wireless local area network to which the first electronic device is connected.
  • the natural environment information where the first electronic device is located includes but is not limited to the following information: environmental noise information, environmental light information, environmental humidity information, and environmental temperature information.
  • the first electronic device can obtain the two-dimensional code data and the second scene information after analyzing the scanned two-dimensional code information.
  • the first electronic device may verify the first scene information and the second scene information, and then determine whether the first scene information and the second scene information meet a preset condition.
  • the first electronic device may perform preset processing on the acquired two-dimensional code data.
  • the preset processing includes, but is not limited to: transfer processing to the payee represented by the QR code data, deduction processing to the payer represented by the QR code data, and sending a preset request to the user represented by the QR code data;
  • the preset request for example, is a request to add a friend.
  • the second scene information is acquired through the second electronic device, where the second scene information is scene information related to the second electronic device; the second electronic device is based on the second scene information and preset two-dimensional code data, Generate and display two-dimensional code information, where the two-dimensional code information is used by the first electronic device to perform preset processing on the two-dimensional code data when it is determined that the first scene information and the second scene information meet the preset conditions after being acquired by the first electronic device.
  • a scene information is scene information related to the first electronic device.
  • the second electronic device can obtain the second scene information related to the second electronic device; the second electronic device adds the second scene information to the two-dimensional code; further,
  • the QR code displayed by the second electronic device carries second scene information related to the second electronic device; the first electronic device scans the QR code to obtain the second scene information, and the first electronic device can also obtain the second scene information.
  • First scene information related to an electronic device the first electronic device compares the first scene information related to the first electronic device and the second scene information related to the second electronic device to determine whether the two Match; if it is determined to match, the first electronic device can determine that the scanned QR code is generated by the second electronic device, and that the QR code is not issued by other malicious devices; then, the first electronic device can scan The received QR code has been processed.
  • the QR code can be automatically verified based on the scene information, and the scene information of two electronic devices that need to interact with the QR code can be compared, and then the QR code can be verified; it can effectively ensure that the scanned QR code is not
  • the malicious QR code can identify the malicious QR code; thereby ensuring the safety of the user’s property.
  • FIG. 15 is a schematic flowchart of another two-dimensional code processing method provided by an embodiment of the application.
  • the method is applied to the second electronic device; the system of the second electronic device is equipped with REE; the method includes:
  • the second electronic device may be a mobile terminal device, a terminal device with a POS function, or a cloud gate; or, the second electronic device may be another device or device that can execute the solution of this example.
  • the first electronic device can use the REE system to complete each step, or the first electronic device can use the TEE system to complete each step, or the first electronic device can use other operating systems to complete each step.
  • the architecture and system on which the first electronic device is based are not limited.
  • the REE system can be deployed in the system of the second electronic device.
  • the REE system can include the following operating modes: user mode, kernel mode, and so on.
  • the REE system of the second electronic device can obtain the second scene information in the user mode or the kernel mode.
  • other operating systems are configured in the second electronic device, and the REE system of the second electronic device interacts with the other operating systems to obtain the second scene information.
  • the second scene information is scene information related to the second electronic device.
  • step 601 shown in FIG. 14 For the action of the first electronic device, refer to step 601 shown in FIG. 14, and details are not described again.
  • the second electronic device may be based on the process of generating and displaying the two-dimensional code information based on the REE system.
  • the process of generating and displaying the two-dimensional code information based on the REE system For the specific process, refer to step 602 shown in FIG. 14, and details are not described again.
  • the second electronic device can obtain the second scene information related to the second electronic device based on the REE; the second electronic device adds the second scene information to the QR code; further, the second electronic device
  • the displayed QR code carries second scene information related to the second electronic device; the first electronic device scans the QR code to obtain the second scene information, and the first electronic device can also obtain information related to the first electronic device.
  • the first electronic device compares the first scene information related to the first electronic device and the second scene information related to the second electronic device to determine whether the two match; if it is determined to match , The first electronic device can determine that the scanned QR code is generated by the second electronic device, and that the QR code is not issued by other malicious devices; then, the first electronic device can compare the scanned QR code Processed.
  • the QR code can be automatically verified based on the scene information, and the scene information of two electronic devices that need to interact with the QR code can be compared, and then the QR code can be verified; it can effectively ensure that the scanned QR code is not
  • the malicious QR code can identify the malicious QR code; thereby ensuring the safety of the user’s property.
  • FIG. 16 is a schematic flowchart of another two-dimensional code processing method provided by an embodiment of the application.
  • the method is applied to a second electronic device; a REE is deployed in the system of the second electronic device, and a second scene device is provided in the second electronic device; the method includes:
  • the second electronic device may be a mobile terminal device, a terminal device with a POS function, or a cloud gate; or, the second electronic device may be another device or device that can execute the solution of this example.
  • the first electronic device can use the REE system to complete each step, or the first electronic device can use the TEE system to complete each step, or the first electronic device can use other operating systems to complete each step.
  • the architecture and system on which the first electronic device is based are not limited.
  • the REE system can be deployed in the system of the second electronic device.
  • the REE system can include the following operating modes: user mode, kernel mode, and so on.
  • the user can send a trigger instruction to the second electronic device by means of touch, voice, gesture, etc., and the trigger instruction is used to instruct the second electronic device to generate two-dimensional code information.
  • the REE of the second electronic device receives the trigger command in the user mode or the kernel mode.
  • the REE system of the second electronic device may obtain the second scene information in the user mode or the kernel mode.
  • the second scene information is scene information related to the second electronic device.
  • the second scene device can be configured in the second electronic device.
  • the second scene device is a GPS chip
  • the second scene information is GPS information.
  • the second scene device is a wifi module
  • the second scene information is wifi information.
  • the second scene device is a Bluetooth chip
  • the second scene information is Bluetooth information.
  • the second scene device is a temperature sensor, and the second scene information is ambient temperature information.
  • the second scene device is a sound sensor, and the second scene information is environmental noise information.
  • the second scene device is a photosensitive sensor, and the second scene information is ambient lighting information.
  • the REE system of the second electronic device can directly interact with the second scene device, and the REE system of the second electronic device can obtain the second scene information detected by the second scene device.
  • the REE system of the second electronic device can directly send an instruction to the second scene device to obtain the second scene information.
  • the REE system of the second electronic device sends a first request message to the second scene device; then, the second scene device sends the detected second scene information to the REE system of the second electronic device.
  • the REE system of the second electronic device may receive the second scene information returned by the second scene device.
  • Step 803 is executed after step 802.
  • the REE system of the second electronic device generates and displays the two-dimensional code information according to the second scene information and the two-dimensional code data in the user mode or the kernel mode.
  • the first electronic device can scan the two-dimensional code information displayed by the second electronic device.
  • the action of the first electronic device refer to step 602 shown in FIG. 14, and details are not described herein again.
  • the second electronic device executes the steps on the REE system side, that is, the acquisition of the second scene information is completed in the REE environment, and the QR code carrying the second scene information is generated; thus, the first electronic device can be based on
  • the scene information automatically verifies the QR code, compares the scene information of two electronic devices that need to interact with the QR code, and then completes the verification of the QR code; it can effectively ensure that the scanned QR code is not maliciously attacked
  • the two-dimensional code can identify malicious two-dimensional code; thereby ensuring the safety of the user’s property.
  • the processing process is simple and fast.
  • FIG. 17 is a schematic flowchart of another two-dimensional code processing method provided by an embodiment of the application.
  • the method is applied to a second electronic device; REE and TEE are deployed in the system of the second electronic device, and a second scene device is provided in the second electronic device; the method includes:
  • the second electronic device may be a mobile terminal device, a terminal device with a POS function, or a cloud gate; or, the second electronic device may be another device or device that can execute the solution of this example.
  • the first electronic device can use the REE system to complete each step, or the first electronic device can use the TEE system to complete each step, or the first electronic device can use other operating systems to complete each step.
  • the architecture and system on which the first electronic device is based are not limited.
  • FIG. 18 is a schematic diagram of system deployment of a second electronic device according to an embodiment of the application. As shown in Figure 18, the REE system and the TEE system are deployed in the second electronic device.
  • the REE side of the second electronic device includes the following layers of architecture: user mode (USR), kernel mode (SVC), and hypervisor mode (HYP).
  • the TEE side of the second electronic device includes the following layers of architecture: user mode (USR), kernel mode (SVC), and monitor mode (MON).
  • multiple applications can be run, and the application can receive a trigger instruction issued by the user, where the trigger instruction is used to instruct the generation of two-dimensional code information.
  • the second request message is a trigger instruction detected based on the REE, or the second request message includes a trigger instruction; the trigger instruction is used to instruct the generation of two-dimensional code information.
  • the REE application of the second electronic device enters the TEE of the second electronic device through the SMC instruction.
  • the REE of the second electronic device sends a second request message to the TEE of the second electronic device for requesting to obtain second scene information related to the second electronic device.
  • the second scene information returned by the TEE is received based on the REE, where the second scene information is obtained by the TEE from the second scene device.
  • the second scene information is obtained after the TEE sets the second scene device to a preset configuration, and the second scene information that the preset configuration characterizes the second scene device can only be obtained by the TEE.
  • the second scene information is scene information for which the TEE has performed signature processing using a public key.
  • a second scene device is configured in the second electronic device, and the second scene device can detect the current second scene information of the second electronic device; the TEE of the second electronic device can read the second scene device detected The second scene information.
  • the TA of the TEE of the second electronic device sends a request instruction to the TEE core, and the request instruction is used to instruct to obtain the second scene information.
  • the TA of the TEE of the second electronic device can obtain the second scene information based on the TEE core.
  • the second scene device in the second electronic device can collect the second scene information.
  • the TEE of the second electronic device needs to transfer the second scene device It is configured so that only TEE can read it. This is because the second-scene device can be read by the REE and TEE of the second electronic device; however, REE is a non-secure world. If the REE reads the information detected by the second-scene device, REE may be maliciously attacked.
  • the second scene information read by the REE will be maliciously tampered with; TEE is a safe world, and the second scene device needs to be configured to only be read by the TEE, then the TEE reads the information detected by the second scene device , The TEE will be maliciously attacked, and the second scene information read by the TEE will not be maliciously tampered with, ensuring the accuracy and security of the second scene information.
  • the core of the TEE of the second electronic device is set to a preset configuration for the second scene device; the preset configuration represents the second scene information detected by the second scene device, which can only be used by the TEE of the second electronic device Obtain.
  • the core of the TEE of the second electronic device sets the second scene device to be accessible only by the TEE; the core of the TEE of the second electronic device reads the second scene information detected by the second scene device .
  • the core of the TEE of the second electronic device can also use a public key to pair the second scene
  • the information is signed, and the signed second scene information is obtained.
  • the kernel of the TEE of the second electronic device sends the signed second scene information to the TA of the TEE of the second electronic device.
  • the TA of the TEE of the second electronic device sends the signed second scene information to the REE application of the second electronic device through the system kernel.
  • the REE of the second electronic device receives the second scene information sent by the TEE of the second electronic device.
  • the REE of the second electronic device after the REE of the second electronic device receives the second scene information, it needs to verify the source of the information.
  • the REE of the second electronic device uses the private key corresponding to the public key to sign and verify the signed second scene information to obtain the verification result.
  • the REE of the second electronic device determines that the verification result indicates that the second scene information has passed the verification
  • the REE of the second electronic device generates the data to be processed according to the second scene information and the two-dimensional code data, and then transfers the second scene information to the data to be processed.
  • the scene information is added to the QR code data. That is, the data to be processed is the two-dimensional code data including the second scene information.
  • the REE of the second electronic device encrypts the data to be processed.
  • the encryption method is not limited.
  • the REE of the second electronic device sends the encrypted data to be processed through the SMC instruction to the TA of the TEE of the second electronic device through the system kernel.
  • the TA of the TEE of the second electronic device decrypts the encrypted data to be processed. Then, the TA of the TEE of the second electronic device draws the QR code data carrying the second scene information in the Trusted User Interface (TUI) for interaction between the user and the device to obtain the QR code information; The TEE of the second electronic device displays two-dimensional code information, that is, the TEE of the second electronic device displays a two-dimensional code interface.
  • TTI Trusted User Interface
  • the first electronic device scans the two-dimensional code information displayed by the second electronic device, and the first electronic device can parse out the second scene information; the first electronic device obtains the first scene information related to the first electronic device; The electronic device can verify the first scene information and the second scene information, and then determine whether the first scene information and the second scene information meet a preset condition. When determining that the first scene information and the second scene information meet the preset conditions, the first electronic device may perform preset processing on the acquired two-dimensional code data.
  • FIG. 19 provides an interactive diagram of the REE and TEE of the second electronic device according to an embodiment of the application.
  • multiple applications application , APP
  • the REE application program of the second electronic device receives a user's trigger instruction, and the trigger instruction is used to instruct the generation of two-dimensional code information.
  • the REE application of the second electronic device enters the TEE of the second electronic device through the SMC command.
  • the TA of the TEE of the second electronic device sends a request instruction to the TEE core, where the request instruction is used to instruct to acquire the second scene information.
  • the core of the TEE of the second electronic device sets the second scene device to be accessible only by the TEE.
  • the core of the TEE of the second electronic device reads the second scene information detected by the second scene device.
  • the core of the TEE of the second electronic device uses the public key to sign the second scene information; the core of the TEE of the second electronic device sends the signed second scene information to the TA of the TEE.
  • the TA of the TEE of the second electronic device sends the signed second scene information to the REE application through the system kernel.
  • the REE application of the second electronic device uses the private key to verify the signed second scene information; after the REE application of the second electronic device determines that the second scene information is verified, it is based on the second scene information And the two-dimensional code data to generate the data to be processed, the data to be processed is the two-dimensional code data including the second scene information; and the REE application of the second electronic device encrypts the data to be processed, and encrypts the encrypted data to be processed The data is sent to the TA of the TEE of the second electronic device through the system kernel. Finally, the TA of the TEE of the second electronic device decrypts the encrypted data to be processed, and draws and displays the two-dimensional code information in the TUI according to the data to be processed.
  • a second request message is sent to the TEE of the second electronic device through the REE of the second electronic device, where the second request message is used to instruct to obtain the second scene information; the REE of the second electronic device receives the second electronic device The second scene information returned by the TEE of the TEE, where the second scene information is obtained by the TEE of the second electronic device from the second scene device.
  • the second scene information obtained by the TEE of the second electronic device is relatively safe; further, before the TEE of the second electronic device reads the second scene information detected by the second scene device , The TEE of the second electronic device sets the second scene device to be only readable by the TEE, thereby ensuring that the second scene information detected by the second electronic device will not be tampered with by malicious applications in the REE environment. The security of the second scene information is improved.
  • the TEE of the second electronic device may also sign the second scene information to ensure that the second scene information is not tampered with when the second scene information is transferred to the REE of the second electronic device.
  • the REE of the second electronic device generates the two-dimensional code data including the second scene information according to the second scene information and the two-dimensional code data, and the REE of the second electronic device sends the two-dimensional code data including the second scene information to the first
  • the TEE of the second electronic device the TEE of the second electronic device draws and displays the two-dimensional code interface in the TUI; due to the high security of the TEE, the two-dimensional code interface is drawn and displayed in the TEE to further ensure the second scene information
  • the two-dimensional code data will not be attacked or tampered with by malicious devices or malicious applications, ensuring the security of the second scene information and the two-dimensional code data.
  • FIG. 20 is a schematic flowchart of another two-dimensional code processing method provided by an embodiment of the application.
  • the method includes:
  • the REE of the second electronic device receives a trigger instruction, where the trigger instruction is used to instruct to generate two-dimensional code information.
  • the second electronic device may be a mobile terminal device, a terminal device with a POS function, or a cloud gate; or, the second electronic device may be another device or device that can execute the solution of this example.
  • the REE system and the TEE system can be deployed in the system of the second electronic device.
  • step 901 in FIG. 17 For this step, refer to step 901 in FIG. 17, and will not be repeated.
  • the REE of the second electronic device sends a second request message to the TEE of the second electronic device, where the second request message is used to instruct to acquire the second scene information.
  • the second request message is a trigger instruction detected based on the REE, or the second request message includes a trigger instruction; the trigger instruction is used to instruct the generation of two-dimensional code information.
  • this step may refer to step 902 in FIG. 17, and details are not described herein again.
  • the REE of the second electronic device receives the second scene information returned by the TEE of the second electronic device, where the second scene information is obtained by the TEE from the second scene device.
  • the second scene information is obtained after the TEE sets the second scene device to a preset configuration, and the second scene information that the preset configuration characterizes the second scene device can only be obtained by the TEE.
  • the second scene information is scene information for which the TEE has performed signature processing using a public key.
  • this step may refer to step 903 in FIG. 17, and details are not described herein again.
  • the REE of the second electronic device uses the private key to verify the second scene information to obtain a verification result, where the verification result indicates that the second scene information has passed the verification.
  • this step may refer to step 904 in FIG. 17, and details are not described herein again.
  • the REE of the second electronic device generates data to be processed according to the second scene information and the two-dimensional code data, where the data to be processed is the two-dimensional code data including the second scene information.
  • this step may refer to step 905 in FIG. 17, and details are not described herein again.
  • the REE of the second electronic device encrypts the data to be processed to obtain encrypted data to be processed.
  • this step may refer to step 906 in FIG. 17, and details are not described herein again.
  • the REE of the second electronic device sends the data to be processed to the TEE of the second electronic device, where the data to be processed is used for the TEE of the second electronic device to generate and display the two-dimensional code information.
  • this step may refer to step 907 in FIG. 17, and details are not described again.
  • the REE of the first electronic device acquires the two-dimensional code information displayed by the second electronic device.
  • the first electronic device may be a mobile terminal device, a terminal device with POS function, or a cloud gate; or, the first electronic device may be another device or device that can execute the solution of this example.
  • the REE system and the TEE system can be deployed in the system of the first electronic device. For this step, refer to step 501 in FIG. 9 and will not be described again.
  • the REE of the first electronic device determines the two-dimensional code data and second scene information according to the two-dimensional code information, where the second scene information is scene information related to the second electronic device.
  • this step may refer to step 502 in FIG. 9, and details are not described again.
  • the REE of the first electronic device uses the public key to sign the second scene information to obtain the signed second scene information.
  • this step can refer to step 503 in FIG. 9, and details are not described again.
  • the REE of the first electronic device sends a second request message to the TEE of the first electronic device, where the second request message is used to instruct to obtain the first scene information.
  • the first scene information is scene information related to the first electronic device.
  • the second request message includes the second scene information, or the second request information is used to indicate the second scene information.
  • this step may refer to step 504 in FIG. 9, and details are not described again.
  • the REE of the first electronic device receives a return message returned by the TEE of the first electronic device, where the return message is used to indicate the first scene information, where the first scene information is that the TEE of the first electronic device is from the first scene device Obtained.
  • step 505 specifically includes: receiving the verification result returned by the TEE of the first electronic device based on the REE of the first electronic device, where the verification result is the first scene information of the TEE of the first electronic device It is generated after being compared with the second scene information, and the verification result indicates that the first scene information and the second scene information meet a preset condition.
  • the first scene information is obtained after the TEE of the first electronic device uses the private key to determine that the signed second scene information passes verification.
  • the first scene information is acquired after the TEE of the first electronic device sets the first scene device to a preset configuration, and the preset configuration indicates that the first scene information can only be acquired by the TEE of the first electronic device.
  • this step may refer to step 505 in FIG. 9, and details are not described herein again.
  • the REE of the first electronic device performs preset processing on the two-dimensional code data when it is determined that the first scene information and the second scene information meet the preset conditions.
  • this step may refer to step 506 in FIG. 9, and details are not described again.
  • a collusion attack means that a malicious application is installed on both the QR code generator and the QR code scanner, and the malicious application on the QR code generator maliciously attacks the QR code generation process. , The malicious application in the QR code scanning terminal maliciously attacks the QR code scanning process.
  • a malicious application in the QR code generator can generate a malicious QR code, and the malicious QR code includes the QR code data of the attacker's payment and the information of the scene where the attacker is located.
  • the malicious application cannot forge the correct scene information of the QR code generator.
  • the malicious application cannot forge the correct scene information of the QR code generator.
  • the malicious application on the QR code generating terminal displays the malicious QR code; and the malicious application on the QR code generating terminal can send the scene information of the attacker to the malicious application on the QR code scanning terminal.
  • the malicious application on the QR code scanning terminal can obtain the scene information of the attacker in the malicious QR code. Furthermore, the malicious application on the QR code scanning terminal can obtain the information obtained by the QR code scanning terminal.
  • the scene information of the QR code scanning terminal can be maliciously tampered with.
  • the scene information of the QR code scanning terminal can be replaced with the scene information of the attacker; then, the normal application of the QR code scanning terminal can obtain the malicious
  • the scene information, that is, the scene information where the attacker is located is obtained. Therefore, after the malicious QR code displayed on the QR code generator at the QR code scanning terminal, the malicious QR code includes the scene information where the attacker is located; at this time, the QR code scans the code.
  • the normal application on the end also obtains the malicious scene information, and then the normal application on the QR code scanning end compares the obtained malicious scene information and the malicious scene information in the malicious QR code.
  • the two are the same; then ,
  • the normal application of the QR code scanning terminal processes the QR code data, for example, performs payment processing. It can be seen that the comparison of scene information is bypassed; the attacker attacks the processing of the QR code and can obtain the user's property information.
  • the TEE of the second electronic device sets the second scene device to be only readable by the TEE, and the TEE of the second electronic device obtains the second scene information related to the second electronic device; this ensures that the second electronic device is The detected second scene information will not be tampered with by malicious applications in the REE environment, ensuring the security of the second scene information.
  • the REE of the second electronic device generates the two-dimensional code data including the second scene information according to the second scene information and the two-dimensional code data, and the REE of the second electronic device sends the two-dimensional code data including the second scene information to the first
  • the TEE of the second electronic device the TEE of the second electronic device draws and displays the two-dimensional code interface in the TUI; due to the high security of the TEE, the two-dimensional code interface is drawn and displayed in the TEE to further ensure the second scene information
  • the two-dimensional code data will not be attacked or tampered with by malicious devices or malicious applications, ensuring the security of the second scene information and the two-dimensional code data.
  • the REE of the first electronic device scans the QR code information displayed by the second electronic device; the TEE of the first electronic device sets the first scene device to only be readable by the TEE, and the TEE of the first electronic device obtains the same information as the first The first scene information related to the electronic device; thereby ensuring that the first scene information detected by the first electronic device will not be tampered with by malicious applications in the REE environment, thereby ensuring the security of the first scene information.
  • the TEE of the first electronic device verifies the first scene information and the second scene information. Since the TEE is a secure world, it is guaranteed that the first scene information and the second scene information will not be tampered with.
  • the REE of the first electronic device performs preset processing on the two-dimensional code after determining that the verification result indicates that the second scene information is verified.
  • the QR code can be automatically verified based on the scene information, and the scanned QR code can be guaranteed based on the scene information that the QR code is not maliciously attacked, and the malicious QR code can be identified; thereby ensuring the security of the user's property.
  • the second electronic device as the QR code generator and the first electronic device as the QR code scanner both use TEE to obtain dynamic scene data (respective scene information), which can guarantee The effectiveness and security of scene information; enhance the security of the entire process, and universities can resist malicious attacks with high authority and collusion.
  • FIG. 21 is a schematic flowchart of another two-dimensional code processing method provided by an embodiment of the application.
  • the method includes:
  • the REE of the second electronic device receives a trigger instruction, where the trigger instruction is used to instruct to generate two-dimensional code information.
  • the second electronic device may be a mobile terminal device, a terminal device with a POS function, or a cloud gate; or, the second electronic device may be another device or device that can execute the solution of this example.
  • the REE system and the TEE system can be deployed in the system of the second electronic device.
  • a second scene device is configured in the second electronic device.
  • step 901 in FIG. 17 For this step, refer to step 901 in FIG. 17, and will not be repeated.
  • the REE of the second electronic device sends a second request message to the TEE of the second electronic device, where the second request message is used to instruct to acquire the second scene information.
  • the second request message is a trigger instruction detected based on the REE, or the second request message includes a trigger instruction; the trigger instruction is used to instruct the generation of two-dimensional code information.
  • this step may refer to step 902 in FIG. 17, and details are not described herein again.
  • the REE of the second electronic device receives the second scene information returned by the TEE of the second electronic device, where the second scene information is obtained by the TEE from the second scene device.
  • the second scene information is obtained after the TEE sets the second scene device to a preset configuration, and the second scene information that the preset configuration characterizes the second scene device can only be obtained by the TEE.
  • the second scene information is scene information for which the TEE has performed signature processing using a public key.
  • this step may refer to step 903 in FIG. 17, and details are not described herein again.
  • the REE of the second electronic device uses the private key to verify the second scene information to obtain a verification result, where the verification result indicates that the second scene information passes the verification.
  • this step may refer to step 904 in FIG. 17, and details are not described herein again.
  • the REE of the second electronic device generates data to be processed according to the second scene information and the two-dimensional code data, where the data to be processed is the two-dimensional code data including the second scene information.
  • this step may refer to step 905 in FIG. 17, and details are not described herein again.
  • the REE of the second electronic device encrypts the data to be processed to obtain encrypted data to be processed.
  • this step may refer to step 906 in FIG. 17, and details are not described herein again.
  • the REE of the second electronic device sends the data to be processed to the TEE of the second electronic device, where the data to be processed is used for the TEE of the second electronic device to generate and display the two-dimensional code information.
  • this step may refer to step 907 in FIG. 17, and details are not described again.
  • the REE of the first electronic device scans the QR code information displayed by the second electronic device.
  • the REE system may be deployed in the system of the first electronic device; the first electronic device is configured with the first scene device.
  • step 401 in FIG. 8 refers to step 401 in FIG. 8 and will not be repeated.
  • the REE of the first electronic device sends a first request message to the first scene device, where the first request message is used to instruct to obtain the first scene information detected by the first scene device; the first scene information is related to the first scene information. Scene information related to electronic devices.
  • this step may refer to step 402 in FIG. 8, and details are not described again.
  • the REE of the first electronic device receives the first scene information sent by the first scene device.
  • this step may refer to step 403 in FIG. 8, and details are not described again.
  • the REE of the first electronic device determines the two-dimensional code data and second scene information according to the two-dimensional code information, where the second scene information is scene information related to the second electronic device.
  • this step may refer to step 404 in FIG. 8, and details are not described again.
  • the REE of the first electronic device performs preset processing on the two-dimensional code data when it is determined that the first scene information and the second scene information meet the preset conditions.
  • this step may refer to step 405 in FIG. 8, and details are not described herein again.
  • the TEE of the second electronic device sets the second scene device to be only readable by the TEE, and the TEE of the second electronic device obtains the second scene information related to the second electronic device; this ensures that the second electronic device is The detected second scene information will not be tampered with by malicious applications in the REE environment, ensuring the security of the second scene information.
  • the REE of the second electronic device generates the two-dimensional code data including the second scene information according to the second scene information and the two-dimensional code data, and the REE of the second electronic device sends the two-dimensional code data including the second scene information to the first
  • the TEE of the second electronic device the TEE of the second electronic device draws and displays the two-dimensional code interface in the TUI; due to the high security of the TEE, the two-dimensional code interface is drawn and displayed in the TEE to further ensure the second scene information
  • the two-dimensional code data will not be attacked or tampered with by malicious devices or malicious applications, ensuring the security of the second scene information and the two-dimensional code data.
  • the REE of the first electronic device scans the QR code information displayed by the second electronic device; the REE of the first electronic device acquires the first scene information; the REE of the first electronic device verifies the first scene information and the second scene information After the second scene information is verified, the REE of the first electronic device performs preset processing on the two-dimensional code.
  • the two-dimensional code can be automatically verified based on the scene information, and the scanned two-dimensional code can be ensured based on the scene information that the two-dimensional code is not maliciously attacked, and the malicious two-dimensional code can be identified; thereby ensuring the safety of the user's property.
  • the second electronic device as the QR code generator uses TEE to obtain dynamic scene data
  • the first electronic device as the QR code scanner uses REE to obtain dynamic scene data;
  • This process can resist malicious attacks to a certain extent.
  • the first electronic device of the QR code scanning terminal is used to obtain the first scene information and verify the scene information in the REE environment
  • the two-dimensional code generation terminal and the two-dimensional code are required for the collusion attack.
  • the code scanning end performs negotiation, collusion, message transmission, etc.
  • the process of collusion attacks is relatively complicated, and the scheme of this embodiment can resist malicious attacks of collusion to a certain extent.
  • FIG. 22 is a schematic flowchart of another two-dimensional code processing method provided by an embodiment of this application.
  • the method includes:
  • the REE of the second electronic device receives a trigger instruction, where the trigger instruction is used to instruct to generate two-dimensional code information.
  • the second electronic device may be a mobile terminal device, a terminal device with POS function, or a cloud gate; or, the second electronic device may be another device that can execute the solution of this example Or equipment.
  • a second scene device is configured in the second electronic device.
  • the REE system can be deployed in the system of the first electronic device. For this step, refer to step 801 in FIG. 16, and will not be described again.
  • the REE of the second electronic device sends a first request message to the second scene device, where the first request message is used to instruct to obtain the second scene information detected by the second scene device, and the second scene information is related to the second electronic device. Scene information related to the device.
  • this step may refer to step 802 in FIG. 16, and details are not described again.
  • the REE of the second electronic device receives the second scene information sent by the second scene device.
  • this step may refer to step 803 in FIG. 16, and details are not described herein again.
  • the REE of the second electronic device generates and displays the two-dimensional code information according to the second scene information and the preset two-dimensional code data.
  • this step may refer to step 804 in FIG. 16, and details are not described herein again.
  • the REE of the first electronic device scans the two-dimensional code information displayed by the second electronic device.
  • the REE system may be deployed in the system of the first electronic device; the first electronic device is configured with the first scene device.
  • the first electronic device is configured with the first scene device.
  • step 401 in FIG. 8 refers to step 401 in FIG. 8 and will not be repeated.
  • the REE of the first electronic device sends a first request message to the first scene device, where the first request message is used to instruct to obtain the first scene information detected by the first scene device; the first scene information is related to the first scene information. Scene information related to electronic devices.
  • this step may refer to step 402 in FIG. 8, and details are not described again.
  • the REE of the first electronic device receives the first scene information sent by the first scene device.
  • this step may refer to step 403 in FIG. 8, and details are not described again.
  • the REE of the first electronic device determines the two-dimensional code data and second scene information according to the two-dimensional code information, where the second scene information is scene information related to the second electronic device.
  • this step may refer to step 404 in FIG. 8, and details are not described again.
  • the REE of the first electronic device performs preset processing on the two-dimensional code data when determining that the first scene information and the second scene information meet the preset conditions.
  • this step may refer to step 405 in FIG. 8, and details are not described herein again.
  • the solution provided in this embodiment can verify the two-dimensional code based on scene information. But there is still the possibility of malicious attacks. The attacker only needs to install malware on the QR code generator to complete the QR code replacement attack.
  • the malicious application on the QR code generator can obtain the scene data of the QR code generator; the malicious application on the QR code generator can send the scene data of the QR code generator to the remote attacker device;
  • the attacker's device can root the attacker's device and tamper with the scene data in the QR code generator; the attacker's device can generate a malicious QR code with the attacker's information and the scene data of the QR code generator.
  • the QR code generator needs to generate a QR code
  • the attacker's device can replace the malicious QR code with the QR code generated by the QR code generator. Therefore, this embodiment may not be able to avoid malicious attacks in this situation.
  • the REE of the second electronic device acquires the second scene information related to the second electronic device; the REE of the second electronic device generates and displays a QR code carrying the second scene information; the REE scan of the first electronic device The QR code information displayed by the second electronic device; the REE of the first electronic device acquires the first scene information; the REE of the first electronic device verifies the first scene information and the second scene information, and after the second scene information is verified , The REE of the first electronic device performs preset processing on the two-dimensional code.
  • the two-dimensional code can be automatically verified based on the scene information, and the scanned two-dimensional code can be ensured based on the scene information that the two-dimensional code is not maliciously attacked, and the malicious two-dimensional code can be identified; thereby ensuring the safety of the user's property.
  • the above embodiments can be applied to payment scenarios.
  • the second electronic device on the QR code generating terminal it can obtain the second scene information related to the second electronic device; as the first electronic device on the QR code scanning terminal, it can acquire the first electronic device related to the first electronic device. Scene information; after the first electronic device verifies the first scene information and the second scene information; the first electronic device performs payment processing or deduction processing on the scanned QR code. Therefore, during the face-to-face scan code transfer process, the QR code payment process can be verified based on the scene information to ensure the safety of the user's property.
  • the first electronic device may have third-party payment software; or, the first electronic device has the function of a POS machine.
  • the above embodiments can be applied to a subway travel scene.
  • the subway has become an important means of transportation for people to travel, and users can scan the code to take the subway.
  • the card exchange attack refers to: passenger A takes the subway from station 1 to station 2, and passenger B takes the subway from station 2 to station 1.
  • passenger A’s mobile terminal equipment is at the station 1 Show QR code 1, scan the QR code 1 of the mobile terminal device of passenger A at the cloud gate at station 1; Show the QR code 2 of the mobile terminal device of passenger B at station 2, scan the code of the cloud gate at station 2 QR code 2 of passenger B’s mobile terminal device; however, when the subway travels to station 3 between station 1 and station 2, passengers A and B get off at the same time, and then passenger A and passenger B exchange their respective two-dimensional codes Then continue to ride; thus, passenger A’s mobile terminal device shows QR code 2 at station 2, and the cloud gate at station 2 scans the QR code of passenger A’s mobile terminal device 2; passenger B’s mobile terminal device Show QR code 1 at station 1, and scan the QR code 1 of passenger B’s mobile terminal at the cloud gate at station 1.
  • the QR code 2 displayed on the mobile terminal device of passenger A is still characterized as station 2.
  • the cloud gate of station 2 deducts the mobile terminal device of passenger A The fee will be less than C yuan; the QR code 1 displayed on the mobile terminal device of passenger B is still characterized as station 1.
  • the cloud gate at station 1 deducts the mobile terminal device of passenger B, which will be less than C yuan. This in turn causes property and economic losses to the subway.
  • FIG. 23 is a schematic flowchart of another two-dimensional code processing method provided by an embodiment of the application.
  • the method includes:
  • the mobile terminal device receives a trigger instruction at the inbound position, and the trigger instruction is used to instruct the generation of a two-dimensional code.
  • the mobile terminal device obtains the terminal scene information detected by the scene device of the mobile terminal device, and the terminal scene information is related to the inbound position.
  • the mobile terminal device generates and displays a two-dimensional code according to the terminal scene information and preset two-dimensional code data.
  • the mobile terminal device displays the two-dimensional code generated in step 3 at the outbound location.
  • the second cloud gate at the inbound position parses the QR code to obtain terminal scene information.
  • the second cloud gate at the inbound position determines whether the terminal scene information and the second cloud gate's scene information meet the preset conditions; wherein, the second cloud gate's scene information is fixed.
  • the preset condition is that the terminal scene information is inconsistent with the scene information of the second cloud gate.
  • the scene information is GPS information, that is, the terminal scene information is the GPS information obtained by the mobile terminal device at the inbound position, and the second cloud gate's scene information is the GPS information as the outbound position; the preset condition is The terminal scene information and the scene information of the second cloud gate do not belong to the same geographic scope.
  • the scene information is wifi information, that is, the terminal scene information is the wifi information obtained by the mobile terminal device at the inbound position, and the second cloud gate's scene information is the wifi information as the outbound position; preset conditions It is the terminal scene information and the scene information of the second cloud gate, which are different; or, the preset condition is that the wifi identifier represented by the terminal scene information is in the wifi list represented by the scene information of the second cloud gate.
  • the scene information is Bluetooth information, that is, the terminal scene information is the Bluetooth information obtained by the mobile terminal device at the inbound position, and the second cloud gate's scene information is the Bluetooth information as the outbound position; preset conditions It is the terminal scene information and the scene information of the second cloud gate, which are different; or, the preset condition is that the Bluetooth identifier represented by the terminal scene information is in the Bluetooth list represented by the scene information of the second cloud gate.
  • the scene information is natural environment information, that is, the terminal scene information is the natural environment information obtained by the mobile terminal device at the inbound position, and the scene information of the second cloud gate is the natural environment information as the outbound position;
  • the preset condition is that the terminal scene information and the scene information of the second cloud gate are different.
  • passenger A takes the subway from station 1 to station 2.
  • Passenger A's mobile terminal can be used as a QR code generator, and the cloud gate at the site can be used as a QR code scanner.
  • Passenger A enters the station at station 1, and the mobile terminal of passenger A is at the location of station 1, and obtains scene information 1 corresponding to the mobile terminal; according to the scene information 1, the QR code data corresponding to the mobile terminal, the mobile terminal of passenger A, Generate and display a QR code.
  • the cloud gate at station 1 scans the QR code displayed on the mobile terminal of passenger A, and the cloud gate at station 1 can directly confirm that passenger A enters the station.
  • Passenger A leaves the station at station 2, and the mobile terminal of passenger A displays the QR code generated on station 1.
  • the cloud gate at station 2 scans the QR code displayed on passenger A's mobile terminal.
  • the cloud gate of site 2 can obtain the scene information corresponding to the cloud gate of site 2; the scene information corresponding to the cloud gate of site 2 can be stored in the cloud gate of site 2; because the cloud of site 2
  • the position of the gate is fixed, so that the cloud gate of site 2 does not need to dynamically obtain scene information, and can directly retrieve pre-stored scene information.
  • the cloud gate at station 2 parses out the scene information in the QR code.
  • the scene information in the QR code is scene information 1 corresponding to the mobile terminal. That is, the scene information in the QR code is that the mobile terminal of passenger A is at the station Acquired at the location of 1.
  • the cloud gate of site 2 compares the scene information in the QR code with the scene information corresponding to the cloud gate of site 2; when it is determined that the two are inconsistent, the cloud gate of site 2 will deduct the QR code fee.
  • Passenger B enters the station at station 2; the mobile terminal of passenger B is at the location of station 2, and obtains scene information 2 corresponding to the mobile terminal; the mobile terminal of passenger B according to the scene information 2 corresponding to the mobile terminal, the QR code data, Generate a QR code for passenger B.
  • the mobile terminal of passenger B sends the QR code of passenger B to the mobile terminal of passenger A.
  • the scene information in passenger B’s QR code is the scene information obtained at station 2; the cloud at station 2 Scanning the QR code of the gate to the QR code of passenger B can parse out the scene information in the QR code of passenger B; the cloud gate of station 2 connects the scene information in the QR code of passenger B to the cloud gate of station 2 The scene information corresponding to the machine is compared; the cloud gate of site 2 can be determined that the two are consistent, so that the cloud gate of site 2 can determine the QR code, which is maliciously escaped. And then resisted the subway escape.
  • FIG. 24 is a schematic structural diagram of a first electronic device according to an embodiment of the application. As shown in FIG. 24, the first electronic device includes:
  • the first obtaining unit 241 is configured to obtain the two-dimensional code information displayed by the second electronic device. At this time, the first obtaining unit 241 may perform step 101 of the method shown in FIG. 4; or, the first obtaining unit 241 may perform step 201 of the method shown in FIG. 5; or, the first obtaining unit 241 may perform step 201 of the method shown in FIG. Step 301 of the method.
  • the second acquiring unit 242 is configured to acquire first scene information. At this time, the second obtaining unit 242 may perform step 102 of the method shown in FIG. 4; or, the second obtaining unit 242 may perform step 202 of the method shown in FIG. 5; or, the second obtaining unit 242 may perform step 202 of the method shown in FIG. Step 302 of the method.
  • the determining unit 243 is configured to determine the two-dimensional code data and the second scene information according to the two-dimensional code information, where the first scene information is scene information related to the first electronic device, and the second scene information is related to the second electronic device. Related scene information.
  • the determining unit 243 may execute step 103 of the method shown in FIG. 4; or, the determining unit 243 may execute step 203 of the method shown in FIG. 5; or, the determining unit 243 may execute step 303 of the method shown in FIG.
  • the processing unit 244 is configured to perform preset processing on the two-dimensional code data when it is determined that the first scene information and the second scene information meet the preset conditions. At this time, the processing unit 244 may execute step 104 of the method shown in FIG. 4; alternatively, the processing unit 244 may execute step 204 of the method shown in FIG. 5; or, the processing unit 244 may execute step 304 of the method shown in FIG.
  • the REE is deployed in the system of the first electronic device; the second obtaining unit 242 is specifically configured to: obtain the first scene information based on the REE. At this time, the second acquiring unit 242 may execute step 302 of the method shown in FIG. 7.
  • the first electronic device further includes: a prompt unit 245, configured to generate and display prompt information when it is determined that the first scene information and the second scene information do not meet a preset condition.
  • the prompt unit 245 may execute step 205 of the method shown in FIG. 5.
  • the determining unit 243 is specifically configured to: decrypt the two-dimensional code information to obtain the two-dimensional code data and the second scene information.
  • the first scene information includes at least one of the following: global positioning system information, wireless local area network information, Bluetooth information, and natural environment information;
  • the second scene information includes at least one of the following: global positioning system information, wireless local area network information Network information, Bluetooth information, and natural environment information.
  • the preset condition is that both the first scene information and the second scene information belong to the preset geographic range.
  • the preset condition is that the wireless local area network identifier represented by the second scene information exists in the wireless local area network represented by the first scene information List.
  • the preset condition is that the Bluetooth identifier represented by the second scene information exists in the Bluetooth list represented by the first scene information.
  • the preset condition is that both the first scene information and the second scene information belong to the preset numerical range.
  • the first electronic device of the embodiment shown in FIG. 24 can be used to execute the technical solutions of the embodiments shown in FIG. 4 to FIG. 5, FIG. 7 to FIG. 9, and FIG. 20 to FIG. The principle and technical effect are similar and will not be repeated here.
  • FIG. 25 is a schematic structural diagram of another first electronic device provided by an embodiment of the application.
  • a first scene device 251 is provided in the first electronic device;
  • the second acquiring unit 242 includes:
  • the first sending module 2421a is configured to send a first request message to the first scene device 251 based on the REE, where the first request message is used to instruct to obtain the first scene information detected by the first scene device 251. At this time, the first sending module 2421a may execute step 402 of the method shown in FIG. 8.
  • the first receiving module 2422a is configured to receive the first scene information sent by the first scene device based on the REE. At this time, the first receiving module 2422a may execute step 403 of the method shown in FIG. 8.
  • the first electronic device of the embodiment shown in FIG. 25 can be used to execute the technical solution of the embodiment shown in FIG. 8 in the foregoing method, and its implementation principles and technical effects are similar, and will not be repeated here.
  • FIG. 26 is a schematic structural diagram of still another first electronic device according to an embodiment of the application.
  • a first scene device 261 is provided in the first electronic device;
  • a trusted execution environment is also deployed in the system of the first electronic device ;
  • the second acquiring unit 242 includes:
  • the second sending module 2421b is configured to send a second request message to the trusted execution environment based on the REE, where the second request message is used to instruct to obtain the first scene information. At this time, the second sending module 2421b may execute step 504 of the method shown in FIG. 9.
  • the second receiving module 2422b is used to receive the return message returned by the trusted execution environment based on the REE, where the return message is used to indicate the first scene information, where the first scene information is obtained by the trusted execution environment from the first scene device Arrived. At this time, the second receiving module 2422b may execute step 505 of the method shown in FIG. 9.
  • the second request message includes the second scene information, or the second request information is used to indicate the second scene information; the return message is the verification result; the second receiving module 2422b is specifically used to:
  • the verification result is generated after the trusted execution environment compares the first scene information and the second scene information, and the verification result indicates that the first scene information and the second scene information conform to the expected Set conditions.
  • the second receiving module 2422b may execute step 505 of the method shown in FIG. 9.
  • the second obtaining unit 242 further includes:
  • the signature module 2423b is used for signing the second scene information with the public key before the second sending module 2421b sends the second request message to the trusted execution environment based on the REE to obtain the signed second scene information; The information is obtained after the trusted execution environment uses the private key to determine the signature of the second scene information after passing the verification. At this time, the signature module 2423b can execute step 503 of the method shown in FIG. 9.
  • the first scene information is acquired after the trusted execution environment sets the first scene device to a preset configuration, and the preset configuration indicates that the first scene information can only be acquired by the trusted execution environment.
  • the first electronic device of the embodiment shown in FIG. 26 can be used to execute the technical solution of the embodiment shown in FIG. 9 in the foregoing method, and its implementation principles and technical effects are similar, and will not be repeated here.
  • FIG. 27 is a schematic structural diagram of a second electronic device according to an embodiment of the application. As shown in Figure 27, the second electronic device includes:
  • the acquiring unit 271 is configured to acquire second scene information, where the second scene information is scene information related to the second electronic device. At this time, the acquiring unit 271 may execute step 601 of the method shown in FIG. 14; or, the acquiring unit 271 may execute step 701 of the method shown in FIG. 15.
  • the generating unit 272 is configured to generate and display two-dimensional code information according to the second scene information and preset two-dimensional code data. At this time, the generating unit 272 may execute step 602 of the method shown in FIG. 14; alternatively, the generating unit 272 may execute step 702 of the method shown in FIG. 15; or, the generating unit 272 may execute step 804 of the method shown in FIG.
  • the display unit 273 is configured to display two-dimensional code information, where the two-dimensional code information is used by the first electronic device to preview the two-dimensional code data when it is determined that the first scene information and the second scene information meet preset conditions. Assuming processing, the first scene information is scene information related to the first electronic device. At this time, the display unit 273 may perform step 602 of the method shown in FIG. 14; or, the display unit 273 may perform step 702 of the method shown in FIG. 15; or, the display unit 273 may perform step 804 of the method shown in FIG.
  • a REE is deployed in the system of the second electronic device; the obtaining unit 271 is specifically configured to: obtain the second scene information based on the REE. At this time, the acquiring unit 271 may execute step 701 of the method shown in FIG. 15.
  • the first scene information includes at least one of the following: global positioning system information, wireless local area network information, Bluetooth information, and natural environment information;
  • the second scene information includes at least one of the following: global positioning system information, wireless local area network information Network information, Bluetooth information, and natural environment information.
  • the preset condition is that both the first scene information and the second scene information belong to the preset geographic range.
  • the preset condition is that the wireless local area network identifier represented by the second scene information exists in the wireless local area network represented by the first scene information List.
  • the preset condition is that the Bluetooth identifier represented by the second scene information exists in the Bluetooth list represented by the first scene information.
  • the preset condition is that both the first scene information and the second scene information belong to the preset numerical range.
  • the second electronic device of the embodiment shown in FIG. 27 can be used to execute the technical solutions of the embodiments shown in FIGS. 14-17 and 20-22 in the above method, and its implementation principles and technical effects are similar. I won't repeat them here.
  • FIG. 28 is a schematic structural diagram of another second electronic device according to an embodiment of the application.
  • a second scene device 281 is provided in the second electronic device;
  • the acquiring unit 271 includes:
  • the first sending module 2711a is configured to send a first request message to the second scene device 281 based on the REE, where the first request message is used to instruct to obtain the second scene information detected by the second scene device 281. At this time, the first sending module 2711a may execute step 802 of the method shown in FIG. 16.
  • the first receiving module 2712b is configured to receive the second scene information sent by the second scene device 281 based on the REE. At this time, the first receiving module 2712b may execute step 803 of the method shown in FIG. 16.
  • the second electronic device in the embodiment shown in FIG. 28 can be used to execute the technical solution of the embodiment shown in FIG. 17 in the foregoing method, and its implementation principles and technical effects are similar, and will not be repeated here.
  • FIG. 29 is a schematic structural diagram of yet another second electronic device according to an embodiment of the application.
  • a trusted execution environment is also deployed in the system of the second electronic device, and a second scene device 291 is provided in the second electronic device;
  • the acquiring unit 271 includes :
  • the second sending module 2711b is configured to send a second request message to the trusted execution environment based on the REE, where the second request message is used to instruct to obtain the second scene information. At this time, the second sending module 2711b can execute step 902 of the method shown in FIG. 17.
  • the second receiving module 2712b is configured to receive the second scene information returned by the trusted execution environment based on the REE, where the second scene information is obtained by the trusted execution environment from the second scene device 291. At this time, the second receiving module 2712b may execute step 903 of the method shown in FIG. 17.
  • the second request message is a trigger instruction detected based on the REE, or the second request message includes a trigger instruction; the trigger instruction is used to instruct the generation of two-dimensional code information.
  • the second scene information is scene information that has been signed by the trusted execution environment using a public key; the acquiring unit 271 further includes:
  • the verification module 2713b is configured to verify the second scenario information based on the REE using the private key after the second receiving module 2712b receives the second scenario information returned by the trusted execution environment based on the REE to obtain the verification result, where the verification The result indicates that the second scene information passed the verification. At this time, the verification module 2713b can execute step 904 of the method shown in FIG. 17.
  • the generating unit 272 includes:
  • the generating module 2721 is configured to generate data to be processed based on the second scene information and the two-dimensional code data based on the REE, where the data to be processed is the two-dimensional code data including the second scene information. At this time, the generating unit 272 may execute step 905 of the method shown in FIG. 17.
  • the sending module 2722 is used to send the to-be-processed data to the trusted execution environment based on the REE, where the to-be-processed data is used in the trusted execution environment to generate and display the two-dimensional code information. At this time, the sending module 2722 can execute step 907 of the method shown in FIG. 17.
  • the generating unit 272 further includes:
  • the encryption module 2723 is configured to encrypt the data to be processed based on the REE before the sending module 2722 sends the data to be processed to the trusted execution environment based on the REE to obtain the encrypted data to be processed. At this time, the encryption module 2723 can execute step 906 of the method shown in FIG. 17.
  • the second scene information is obtained after the trusted execution environment sets the second scene device 291 to a preset configuration, and the preset configuration indicates that the second scene information of the second scene device 291 can only be used by the trusted execution environment Acquired.
  • the second electronic device further includes:
  • the receiving unit 292 is configured to receive a trigger instruction before the acquiring unit 271 acquires the second scene information, where the trigger instruction is used to instruct the generation of two-dimensional code information. At this time, the receiving unit 292 may execute step 901 of the method shown in FIG. 17.
  • the second electronic device of the embodiment shown in FIG. 29 can be used to execute the technical solution of the embodiment shown in FIG. 17 in the foregoing method, and its implementation principles and technical effects are similar, and will not be repeated here.
  • FIG. 30 is a schematic structural diagram of still another first electronic device according to an embodiment of the application. As shown in FIG. 30, the first electronic device includes a processor 311 and an image collector 312.
  • the image collector 312 is used to scan the two-dimensional code information displayed by the second electronic device.
  • the processor 311 is configured to obtain the two-dimensional code information displayed by the second electronic device; obtain the first scene information, and determine the two-dimensional code data and the second scene information according to the two-dimensional code information, where the first scene information is and Scene information related to the first electronic device, and the second scene information is scene information related to the second electronic device; when it is determined that the first scene information and the second scene information meet the preset conditions, the QR code data is preset .
  • the processor 311 may execute steps 101-104 shown in FIG. 4; or, the processor 311 may execute steps 201-204 shown in FIG. 5; or, the processor 311 may execute the steps shown in FIG. Steps 301-304.
  • the REE is deployed in the system of the first electronic device; when the processor 311 obtains the first scene information, it is specifically configured to: obtain the first scene information based on the REE. At this time, the processor 311 may execute step 302 of the method shown in FIG. 7.
  • a first scene device 313 is provided in the first electronic device; when the processor 311 obtains the first scene information based on the REE, it is specifically configured to:
  • the first request message is sent to the first scene device 313 based on the REE, where the first request message is used to instruct to obtain the first scene information detected by the first scene device 313; at this time, the processor 311 may execute the process shown in FIG. 8 Step 402 of the method.
  • the first scene information sent by the first scene device 313 is received based on the REE.
  • the processor 311 may execute step 403 of the method shown in FIG. 8.
  • a first scene device 313 is provided in the first electronic device; a trusted execution environment is also deployed in the system of the first electronic device; when the processor 31 obtains the first scene information based on the REE, it is specifically configured to:
  • a second request message is sent to the trusted execution environment based on the REE, where the second request message is used to instruct to obtain the first scene information; at this time, the processor 311 may execute step 504 of the method shown in FIG. 9.
  • a return message returned by the trusted execution environment is received based on the REE, where the return message is used to indicate the first scene information, where the first scene information is obtained by the trusted execution environment from the first scene device 313.
  • the processor 311 may execute step 505 of the method shown in FIG. 9.
  • the second request message includes the second scene information, or the second request information is used to indicate the second scene information; the return message is the verification result; when the processor 311 receives the return message returned by the trusted execution environment based on the REE , Specifically used for:
  • the verification result is generated after the trusted execution environment compares the first scene information and the second scene information, and the verification result indicates that the first scene information and the second scene information conform to the expected Set conditions.
  • the processor 311 may execute step 505 of the method shown in FIG. 9.
  • the processor 311 before sending the second request message to the trusted execution environment based on the REE, is further configured to: use the public key to sign the second scene information to obtain the signed second scene information; The scene information is obtained after the trusted execution environment uses the private key to determine the signed second scene information after passing verification. At this time, the processor 311 may execute step 503 of the method shown in FIG. 9.
  • the first scene information is acquired after the trusted execution environment sets the first scene device 313 to a preset configuration, and the preset configuration indicates that the first scene information can only be acquired by the trusted execution environment.
  • the processor 311 is further configured to generate and display prompt information when it is determined that the first scene information and the second scene information do not meet a preset condition. At this time, the processor 311 may execute step 205 of the method shown in FIG. 5.
  • the processor 311 determines the two-dimensional code data and the second scene information according to the two-dimensional code information, it is specifically configured to: decrypt the two-dimensional code information to obtain the two-dimensional code data and the second scene information.
  • the first scene information includes at least one of the following: global positioning system information, wireless local area network information, Bluetooth information, and natural environment information;
  • the second scene information includes at least one of the following: global positioning system information, wireless local area network information Network information, Bluetooth information, and natural environment information.
  • the preset condition is that both the first scene information and the second scene information belong to the preset geographic range.
  • the preset condition is that the wireless local area network identifier represented by the second scene information exists in the wireless local area network represented by the first scene information List.
  • the preset condition is that the Bluetooth identifier represented by the second scene information exists in the Bluetooth list represented by the first scene information.
  • the preset condition is that both the first scene information and the second scene information belong to the preset numerical range.
  • the first electronic device of the embodiment shown in FIG. 30 can be used to execute the technical solutions of the embodiments shown in FIG. 4 to FIG. 5, FIG. 7 to FIG. 9, and FIG. 20 to FIG. The principle and technical effect are similar and will not be repeated here.
  • FIG. 31 is a schematic structural diagram of still another second electronic device according to an embodiment of the application. As shown in FIG. 31, the second electronic device includes: a processor 321.
  • the processor 321 is configured to obtain second scene information, where the second scene information is scene information related to the second electronic device; according to the second scene information and preset two-dimensional code data, generate and display the two-dimensional code information , wherein the two-dimensional code information is used by the first electronic device to perform preset processing on the two-dimensional code data when it is determined that the first scene information and the second scene information meet the preset conditions, and the first scene information is the same as the first scene information. Scene information related to electronic devices.
  • the processor 321 may execute steps 601-602 of the method shown in FIG. 14; alternatively, the processor 321 may execute steps 701-702 of the method shown in FIG. 15.
  • the REE is deployed in the system of the second electronic device; when the processor 321 obtains the second scene information, it is specifically configured to: obtain the second scene information based on the REE. At this time, the processor 321 may execute step 701 of the method shown in FIG. 15.
  • a second scene device 322 is provided in the second electronic device; when the processor 321 obtains the second scene information based on the REE, it is specifically configured to:
  • the first request message is sent to the second scene device 322 based on the REE, where the first request message is used to instruct to obtain the second scene information detected by the second scene device 322; at this time, the processor 321 may execute the method shown in FIG. 16 ⁇ 802.
  • the second scene information sent by the second scene device 322 is received based on the REE.
  • the processor 321 may execute step 803 of the method shown in FIG. 16.
  • a trusted execution environment is also deployed in the system of the second electronic device, and a second scene device 322 is provided in the second electronic device; when the processor 321 acquires the second scene information based on the REE, it is specifically configured to:
  • a second request message is sent to the trusted execution environment based on the REE, where the second request message is used to instruct to obtain the second scene information; at this time, the processor 321 may execute step 902 of the method shown in FIG. 17.
  • the second scene information returned by the trusted execution environment is received based on the REE, where the second scene information is obtained by the trusted execution environment from the second scene device 322.
  • the processor 321 may execute step 903 of the method shown in FIG. 17.
  • the second request message is a trigger instruction detected based on the REE, or the second request message includes a trigger instruction; the trigger instruction is used to instruct the generation of two-dimensional code information.
  • the second scene information is the scene information that the trusted execution environment uses the public key to perform signature processing; after receiving the second scene information returned by the trusted execution environment based on the REE, the processor 321 is further configured to:
  • the private key is used to verify the second scene information to obtain a verification result, where the verification result indicates that the second scene information passes the verification.
  • the processor 321 may execute step 904 of the method shown in FIG. 17.
  • the processor 321 when the processor 321 generates and displays the two-dimensional code information according to the second scene information and the preset two-dimensional code data, it is specifically configured to:
  • the data to be processed is generated according to the second scene information and the two-dimensional code data, where the data to be processed is the two-dimensional code data including the second scene information; at this time, the processor 321 may execute the steps of the method shown in FIG. 17 905.
  • the data to be processed is sent to the trusted execution environment, where the data to be processed is used in the trusted execution environment to generate and display two-dimensional code information.
  • the processor 321 may execute step 907 of the method shown in FIG. 17.
  • the processor 321 before sending the data to be processed to the trusted execution environment based on the REE, the processor 321 is further configured to: encrypt the data to be processed based on the REE to obtain the encrypted data to be processed. At this time, the processor 321 may execute step 906 of the method shown in FIG. 17.
  • the second scene information is obtained after the trusted execution environment sets the second scene device 322 to a preset configuration, and the preset configuration indicates that the second scene device 322 can only be used by the trusted execution environment. Obtain.
  • the processor 321 before acquiring the second scene information, is further configured to: receive a trigger instruction, where the trigger instruction is used to instruct the generation of two-dimensional code information. At this time, the processor 321 may execute step 901 of the method shown in FIG. 17.
  • the first scene information includes at least one of the following: global positioning system information, wireless local area network information, Bluetooth information, and natural environment information;
  • the second scene information includes at least one of the following: global positioning system information, wireless local area network information Network information, Bluetooth information, and natural environment information.
  • the preset condition is that both the first scene information and the second scene information belong to the preset geographic range.
  • the preset condition is that the wireless local area network identifier represented by the second scene information exists in the wireless local area network represented by the first scene information List.
  • the preset condition is that the Bluetooth identifier represented by the second scene information exists in the Bluetooth list represented by the first scene information.
  • the preset condition is that both the first scene information and the second scene information belong to the preset numerical range.
  • the second electronic device of the embodiment shown in FIG. 31 can be used to execute the technical solutions of the embodiments shown in FIGS. 14-17 and 20-22 in the above method, and its implementation principles and technical effects are similar. I won't repeat them here.
  • FIG. 32 is a schematic structural diagram of another first electronic device according to an embodiment of the application.
  • the embodiment shown in FIG. 32 introduces that the first electronic device may be composed of a processor 331 and an image collector 332.
  • the first electronic device may also have a memory 333 and a first scene device 334.
  • the first electronic device includes: a processor 331, an image collector 332, a memory 333, and a first scene device 334.
  • the image collector 332, the memory 333, and the first scene device 334 may be coupled to the processor 331.
  • the image collector 332 is used to collect the two-dimensional code information of the method embodiments shown in FIGS. 4 to 5, 7 to 9, and 20 to 22.
  • the processor 331 is configured to obtain the two-dimensional code information collected by the image collector 332 and execute the instructions in the computer executable program code; when the processor 331 executes the instructions, the instructions cause the first electronic device to execute the above-mentioned FIGS. 4 to 5
  • FIGS. 7-9 and 20-22 The technical solutions of the method embodiments shown in FIGS. 7-9 and 20-22.
  • the first electronic device of the embodiment shown in FIG. 32 can be used in the technical solutions of the method embodiments shown in FIGS. 4 to 5, 7 to 9 and 20 to 22, or to implement the technical solutions shown in FIGS. 24 to 26.
  • the program of each unit and module of the illustrated embodiment has similar implementation principles and technical effects, and will not be repeated here.
  • the above-mentioned embodiments can refer to each other and learn from each other, and the same or similar steps and nouns will not be repeated one by one.
  • the first electronic device in the embodiment shown in FIG. 32 may further include a memory 333.
  • the memory 333 is used to store programs used to implement the above method embodiments, or the memory 333 is used to store programs of various units and modules in the embodiments shown in FIGS. 24-26, and the processor 331 calls the program to execute the above method implementations. Example operation to realize the various units and modules shown in Figure 24-26.
  • part or all of the above units and modules can also be implemented by embedding on a certain chip of the device in the form of an integrated circuit. And they can be implemented separately or integrated together. That is to say, the above modules can be configured to implement one or more integrated circuits of the above methods, for example: one or more application specific integrated circuits (ASIC), or one or more microprocessors (digital singnal processors). , DSP), or, one or more field programmable gate arrays (FPGA), etc.
  • ASIC application specific integrated circuits
  • microprocessors digital singnal processors
  • FPGA field programmable gate arrays
  • FIG. 33 is a schematic structural diagram of another second electronic device according to an embodiment of the application.
  • the second electronic device may be composed of a processor 341.
  • the second electronic device may also have an image collector 342, a memory 343, and a second scene device 344.
  • the second electronic device includes: a processor 341, an image collector 342, a memory 343, and a second scene device 344.
  • the image collector 342, the memory 343, and the second scene device 344 may be coupled to the processor 341.
  • the image collector 342 is used to collect the two-dimensional code information of the method embodiments shown in FIGS. 14-17 and 20-22.
  • the processor 341 is configured to execute instructions in the computer executable program code; when the processor 341 executes the instructions, the instructions cause the second electronic device to execute the method embodiments shown in FIGS. 14-17 and 20-22.
  • the second electronic device of the embodiment shown in FIG. 33 can be used in the technical solutions of the method embodiments shown in FIGS. 14-17 and FIG. 20-22, or execute the various units and units of the embodiment shown in FIGS. 27-29.
  • the module program, its implementation principle and technical effect are similar, so I won't repeat it here.
  • the above-mentioned embodiments can refer to each other and learn from each other, and the same or similar steps and nouns will not be repeated one by one.
  • the second electronic device in the embodiment shown in FIG. 33 may further include a memory 343.
  • the memory 343 is used to store programs used to implement the above method embodiments, or the memory 343 is used to store programs of various units and modules in the embodiments shown in FIGS. 27-29.
  • the processor 341 calls the program to execute the above method implementations. Example operation to realize the various units and modules shown in Figure 27-29.
  • part or all of the above units and modules can also be implemented by embedding on a certain chip of the device in the form of an integrated circuit. And they can be implemented separately or integrated together. That is to say, the above modules can be configured to implement one or more integrated circuits of the above methods, for example: one or more application specific integrated circuits (ASIC), or one or more microprocessors (digital singnal processors). , DSP), or, one or more field programmable gate arrays (FPGA), etc.
  • ASIC application specific integrated circuits
  • microprocessors digital singnal processors
  • FPGA field programmable gate arrays
  • the embodiment of the present application provides a program, including program code.
  • the program code executes the steps of the embodiments shown in FIGS. 4 to 5, 7 to 9, and 20 to 22.
  • the embodiment of the present application provides a computer-readable storage medium, including instructions, which when run on a computer, cause the computer to execute the steps of the embodiments shown in FIGS. 14-17 and 20-22.
  • the present application also provides a computer program product.
  • the computer program product includes: a computer program.
  • the computer program is stored in a readable storage medium, and at least one processor of the electronic device can read from the readable storage medium.
  • a computer program is taken, and at least one processor executes the computer program to make the electronic device execute the solution provided by any of the foregoing embodiments.
  • the electronic device may be the above-mentioned first electronic device or the second electronic device.
  • the above embodiments it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof.
  • software it can be implemented in the form of a computer program product in whole or in part.
  • the computer program product includes one or more computer instructions.
  • the computer program instructions When the computer program instructions are loaded and executed on the computer, the processes or functions according to the embodiments of the present application are generated in whole or in part.
  • the computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
  • Computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium.
  • computer instructions may be transmitted from a website, computer, server, or data center through a cable (such as , Coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL) or wireless (for example, infrared, wireless, microwave, etc.) transmission to another website site, computer, server or data center.
  • the computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or a data center integrated with one or more available media.
  • the usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, and a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (SSD)).
  • the functions described in the embodiments of the present application may be implemented by hardware, software, firmware, or any combination thereof. When implemented by software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on the computer-readable medium.
  • the computer-readable medium includes a computer storage medium and a communication medium, where the communication medium includes any medium that facilitates the transfer of a computer program from one place to another.
  • the storage medium may be any available medium that can be accessed by a general-purpose or special-purpose computer.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Electromagnetism (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Artificial Intelligence (AREA)
  • Toxicology (AREA)
  • Bioethics (AREA)
  • Optics & Photonics (AREA)
  • Storage Device Security (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

一种二维码处理方法和设备,该方法包括:第一电子设备获取第二电子设备显示的二维码信息(101);获取第一场景信息,所述第一场景信息为与第一电子设备相关的场景信息(102);根据所述二维码信息,确定二维码数据和第二场景信息,其中,第二场景信息为与该第二电子设备相关的场景信息(103);第一电子设备在确定第一场景信息和所述第二场景信息符合预设条件时,对二维码数据进行预设处理(104)。通过比对两个需要进行二维码交互的电子设备的场景信息,进而对二维码完成验证,可以有效保证扫码时所扫描到的二维码不是被恶意攻击的二维码,保证二维码的可靠性。

Description

二维码处理方法和设备
本申请要求于2019年12月26日提交中国专利局、申请号为201911368922.7、申请名称为“二维码处理方法和设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及终端技术,尤其涉及一种二维码处理方法和设备。
背景技术
随着终端技术的发展,电子设备已经成为人们生活和工作中必不可少的工具。在电子设备中,终端设备的使用尤其的广泛。为了增强用户生活的便捷性,电子设备可以提供二维码,进而用户使用二维码完成支付行为等。
现有技术中,电子设备可以生成并显示二维码,另一个电子设备扫描二维码;进而另一个电子设备根据获取到的二维码,进行支付行为,例如进行扣款。
然而现有技术中,电子设备在生成二维码的时候,电子设备可能会收到恶意软件等攻击,进而电子设备所需要显示的二维码,被恶意软件所生成的二维码所替代,从而,电子设备显示出被替换的二维码,进而,用户的财产被盗走。进而,现有技术中存在二维码被恶意替换,给用户的财产带来损失。
发明内容
本申请提供一种二维码处理方法和设备,以解决现有技术中存在的二维码被恶意替换的问题。
第一方面,本申请提供一种二维码处理方法,所述方法应用于第一电子设备,所述方法包括:
获取第二电子设备显示的二维码信息;
获取第一场景信息,并根据所述二维码信息,确定二维码数据和第二场景信息,其中,所述第一场景信息为与所述第一电子设备相关的场景信息,所述第二场景信息为与所述第二电子设备相关的场景信息;
在确定所述第一场景信息和所述第二场景信息符合预设条件时,对所述二维码数据进行预设处理。
本申请,通过在二维码中加入电子设备的场景信息,进而第二电子设备所显示的二维码中的场景信息,是与第二电子设备相关的;然后,第一电子设备可以获取到二维码中的与第二电子设备相关的第二场景信息;并且,第一电子设备可以获取到与第一电子设备相关的第一场景信息;第一电子设备将与第一电子设备相关的第一场景信息、与第二电子设备相关的第二场景信息,两者进行比对,以确定两者是否匹配;若确定匹配,则第一电子设备可以确定所扫描到的二维码是第二电子设备所生成的,二 维码不是其他恶意设备所发出的;然后,第一电子设备就可以对扫描到的二维码进行处理了。通过比对两个需要进行二维码交互的电子设备的场景信息,进而对二维码完成验证,可以有效的保证所扫描到的二维码不是被恶意攻击的二维码,尤其是针对面对面扫码场景(例如扫码支付、扫码进入地铁等)可以识别出恶意二维码,从而保证用户的财产等数据的安全。
在一种可能的设计中,所述第一电子设备的***中部署有富执行环境;所述获取第一场景信息,包括:基于所述富执行环境获取所述第一场景信息。可以基于富执行环境获取第一场景信息。
在一种可能的设计中,所述第一电子设备中设置有第一场景器件;基于所述富执行环境获取所述第一场景信息,包括:
基于所述富执行环境向所述第一场景器件发送第一请求消息,其中,所述第一请求消息用于指示获取所述第一场景器件所检测得到的所述第一场景信息;基于所述富执行环境接收所述第一场景器件发送的所述第一场景信息。
通过第一电子设备在富执行环境***侧执行各步骤,可以基于场景信息对二维码进行自动验证,比对两个需要进行二维码交互的电子设备的场景信息,进而对二维码完成验证;可以有效的保证所扫描到的二维码不是被恶意攻击的二维码,可以识别出恶意二维码;从而保证用户的财产安全。
在一种可能的设计中,所述第一电子设备中设置有第一场景器件;所述第一电子设备的***中还部署有可信执行环境;基于所述富执行环境获取所述第一场景信息,包括:
基于所述富执行环境向所述可信执行环境发送第二请求消息,其中,所述第二请求消息用于指示获取所述第一场景信息;
基于所述富执行环境接收所述可信执行环境返回的返回消息,其中所述返回消息用于指示所述第一场景信息,其中,所述第一场景信息是所述可信执行环境从所述第一场景器件中所获取到的。
由于可信执行环境是安全世界,第一电子设备的可信执行环境对第一场景信息和第二场景信息进行验证,可以保证验证结果的有效性和准确性,保证第一场景信息和第二场景信息不会被篡改。
在一种可能的设计中,所述第二请求消息包括所述第二场景信息,或者,所述第二请求信息用于指示所述第二场景信息;
所述返回消息为验证结果;基于所述富执行环境接收所述可信执行环境返回的所述返回消息,包括:
基于所述富执行环境接收所述可信执行环境返回的验证结果,其中,所述验证结果为所述可信执行环境对所述第一场景信息和所述第二场景信息进行比较之后生成,所述验证结果表征所述第一场景信息和所述第二场景信息符合所述预设条件。
通过第一电子设备的可信执行环境对第一场景信息和第二场景信息进行验证;第一电子设备的可信执行环境将验证结果,发送给第一电子设备的富执行环境;由于可信执行环境是安全世界,保证了验证过程中第一场景信息和第二场景信息不会被恶意攻击。
在一种可能的设计中,在基于所述富执行环境,向所述可信执行环境发送第二请求消息之前,还包括:采用公钥对所述第二场景信息进行签名处理,得到签名后的第二场景信息;
所述第一场景信息是所述可信执行环境采用私钥确定所述签名后的第二场景信息通过验证之后所获取的。进而可信执行环境对第二场景信息的来源进行验证。
在一种可能的设计中,所述第一场景信息是所述可信执行环境将所述第一场景器件设置为预设配置之后所获取的,所述预设配置表征所述第一场景信息只可被所述可信执行环境所获取。可信执行环境是安全世界,需要将第一场景器件配置为只有可信执行环境可以读取,那么可信执行环境读取第一场景器件所检测的信息,会出现可信执行环境被恶意攻击的情况,可信执行环境所读取的第一场景信息不会被恶意篡改,保证了第一场景信息的准确性和安全性。
在一种可能的设计中,所述方法,还包括:
在确定所述第一场景信息和所述第二场景信息不符合预设条件时,生成并显示提示信息。进而在场景信息没有通过验证时,可以提示用户场景信息被攻击。
在一种可能的设计中,根据所述二维码信息,确定二维码数据和第二场景信息,包括:
对所述二维码信息进行解密,得到所述二维码数据和所述第二场景信息。
在一种可能的设计中,所述第一场景信息包括以下的至少一种:全球定位***信息、无线局域网络信息、蓝牙信息、自然环境信息;所述第二场景信息包括以下的至少一种:全球定位***信息、无线局域网络信息、蓝牙信息、自然环境信息。
在一种可能的设计中,在所述第一场景信息为全球定位***信息,所述第二场景信息为全球定位***信息时,所述预设条件为所述第一场景信息与所述第二场景信息均属于预设地理范围;
在所述第一场景信息为无线局域网络信息,所述第二场景信息为无线局域网络信息时,所述预设条件为所述第二场景信息所表征的无线局域网络标识,存在于所述第一场景信息所表征的无线局域网络列表中;
在所述第一场景信息为蓝牙信息,所述第二场景信息为蓝牙信息时,所述预设条件为所述第二场景信息所表征的蓝牙标识,存在于所述第一场景信息所表征的蓝牙列表中;
在所述第一场景信息为自然环境信息,所述第二场景信息为自然环境信息时,所述预设条件为所述第一场景信息与所述第二场景信息均属于预设数值范围。
第二方面,本申请提供一种二维码处理方法,所述方法应用于第二电子设备,所述方法包括:
获取第二场景信息,其中,所述第二场景信息为与所述第二电子设备相关的场景信息;
根据所述第二场景信息和预设的二维码数据,生成并显示二维码信息,其中,所述二维码信息用于第一电子设备获取后在确定第一场景信息和所述第二场景信息符合预设条件时,对所述二维码数据进行预设处理,所述第一场景信息为与所述第一电子设备相关的场景信息。
本实施例,通过第二电子设备获取第二场景信息,其中,所述第二场景信息为与所述第二电子设备相关的场景信息;第二电子设备根据所述第二场景信息和预设的二维码数据,生成并显示二维码信息,其中,所述二维码信息用于第一电子设备获取后在确定第一场景信息和所述第二场景信息符合预设条件时,对所述二维码数据进行预设处理,所述第一场景信息为与所述第一电子设备相关的场景信息。第二电子设备在需要生成二维码的时候,第二电子设备可以获取与第二电子设备相关的第二场景信息;第二电子设备将第二场景信息,加入到二维码中;进而,第二电子设备所显示的二维码中携带有与第二电子设备相关的第二场景信息;第一电子设备对二维码进行扫描,得到第二场景信息,第一电子设备还可以获取第一电子设备相关的第一场景信息;第一电子设备将与第一电子设备相关的第一场景信息、与第二电子设备相关的第二场景信息,两者进行比对,以确定两者是否匹配;若确定匹配,则第一电子设备可以确定所扫描到的二维码是第二电子设备所生成的,二维码不是其他恶意设备所发出的;然后,第一电子设备就可以对扫描到的二维码进行处理了。可以基于场景信息对二维码进行自动验证,比对两个需要进行二维码交互的电子设备的场景信息,进而对二维码完成验证;可以有效的保证所扫描到的二维码不是被恶意攻击的二维码,可以识别出恶意二维码;从而保证用户的财产安全。
在一种可能的设计中,所述第二电子设备的***中部署有富执行环境;所述获取第二场景信息,包括:
基于所述富执行环境,获取所述第二场景信息。可以基于富执行环境完成场景信息的验证,比对两个需要进行二维码交互的电子设备的场景信息,进而对二维码完成验证;可以有效的保证所扫描到的二维码不是被恶意攻击的二维码,可以识别出恶意二维码;从而保证用户的财产安全。
在一种可能的设计中,所述第二电子设备中设置有第二场景器件;基于所述富执行环境,获取所述第二场景信息,包括:
基于所述富执行环境向所述第二场景器件发送第一请求消息,其中,所述第一请求消息用于指示获取所述第二场景器件所检测的所述第二场景信息;
基于所述富执行环境接收所述第二场景器件发送的所述第二场景信息。
通过第二电子设备在富执行环境***侧执行各步骤,即,在富执行环境环境下完成第二场景信息的获取,生成携带有第二场景信息的二维码;从而第一电子设备可以基于场景信息对二维码进行自动验证,比对两个需要进行二维码交互的电子设备的场景信息,进而对二维码完成验证;可以有效的保证所扫描到的二维码不是被恶意攻击的二维码,可以识别出恶意二维码;从而保证用户的财产安全。处理过程简单、快速。
在一种可能的设计中,所述第二电子设备的***中还部署有可信执行环境,所述第二电子设备中设置有第二场景器件;基于所述富执行环境,获取所述第二场景信息,包括:
基于所述富执行环境向所述可信执行环境发送第二请求消息,其中,所述第二请求消息用于指示获取所述第二场景信息;
基于所述富执行环境接收所述可信执行环境返回的所述第二场景信息,其中,所述第二场景信息是所述可信执行环境从所述第二场景器件中所获取到的。
由于可信执行环境是安全世界,第二电子设备的可信执行环境所获取的第二场景信息是较为安全的。
在一种可能的设计中,所述第二请求消息为基于富执行环境所检测到的触发指令,或者,所述第二请求消息包括所述触发指令;所述触发指令用于指示生成所述二维码信息。
在一种可能的设计中,所述第二场景信息为所述可信执行环境采用公钥进行过签名处理的场景信息;在基于所述富执行环境接收所述可信执行环境返回的所述第二场景信息之后,还包括:
基于所述富执行环境采用私钥对所述第二场景信息进行校验,得到校验结果,其中,所述校验结果表征所述第二场景信息通过校验。第二电子设备的可信执行环境可以对第二场景信息进行签名,保证将第二场景信息传递给第二电子设备的富执行环境的时候,第二场景信息不被篡改。
在一种可能的设计中,根据所述第二场景信息和预设的二维码数据,生成并显示二维码信息,包括:
基于富执行环境根据所述第二场景信息和所述二维码数据,生成待处理数据,其中,所述待处理数据为包括所述第二场景信息的二维码数据;
基于富执行环境将所述待处理数据发送给所述可信执行环境,其中,所述待处理数据用于所述可信执行环境生成并显示所述二维码信息。
第二电子设备的富执行环境将包括第二场景信息的二维码数据,发送给第二电子设备的可信执行环境;第二电子设备的可信执行环境在TUI中绘制并显示二维码界面;由于可信执行环境的安全性很高,在可信执行环境中绘制并显示二维码界面,进一步的保证了第二场景信息和二维码数据,不会被恶意设备或者恶意应用程序所攻击或篡改,保证了第二场景信息和二维码数据的安全性。
在一种可能的设计中,在基于富执行环境将所述待处理数据发送给所述可信执行环境之前,还包括:基于富执行环境对所述待处理数据进行加密,得到加密后的待处理数据。
在一种可能的设计中,所述第二场景信息是所述可信执行环境将所述第二场景器件设置为预设配置之后所获取的,所述预设配置表征所述第二场景器件第二场景信息只可被所述可信执行环境所获取。在第二电子设备的可信执行环境读取第二场景器件所检测的第二场景信息之前,第二电子设备的可信执行环境将第二场景器件设置为只可被可信执行环境读取,从而保证了第二电子设备所检测到的第二场景信息不会被富执行环境环境下的恶意应用程序所篡改,保证了第二场景信息的安全性。
在一种可能的设计中,在所述获取第二场景信息之前,还包括:接收触发指令,其中,所述触发指令用于指示生成所述二维码信息。
在一种可能的设计中,所述第一场景信息包括以下的至少一种:全球定位***信息、无线局域网络信息、蓝牙信息、自然环境信息;所述第二场景信息包括以下的至少一种:全球定位***信息、无线局域网络信息、蓝牙信息、自然环境信息。
在一种可能的设计中,在所述第一场景信息为全球定位***信息,所述第二场景信息为全球定位***信息时,所述预设条件为所述第一场景信息与所述第二场景信息 均属于预设地理范围;
在所述第一场景信息为无线局域网络信息,所述第二场景信息为无线局域网络信息时,所述预设条件为所述第二场景信息所表征的无线局域网络标识,存在于所述第一场景信息所表征的无线局域网络列表中;
在所述第一场景信息为蓝牙信息,所述第二场景信息为蓝牙信息时,所述预设条件为所述第二场景信息所表征的蓝牙标识,存在于所述第一场景信息所表征的蓝牙列表中;
在所述第一场景信息为自然环境信息,所述第二场景信息为自然环境信息时,所述预设条件为所述第一场景信息与所述第二场景信息均属于预设数值范围。
第三方面,本申请提供一种第一电子设备,所述第一电子设备包括:
第一获取单元,用于获取第二电子设备显示的二维码信息;
第二获取单元,用于获取第一场景信息;
确定单元,用于根据所述二维码信息,确定二维码数据和第二场景信息,其中,所述第一场景信息为与所述第一电子设备相关的场景信息,所述第二场景信息为与所述第二电子设备相关的场景信息;
处理单元,用于在确定所述第一场景信息和所述第二场景信息符合预设条件时,对所述二维码数据进行预设处理。
本申请,通过在二维码中加入电子设备的场景信息,进而第二电子设备所显示的二维码中的场景信息,是与第二电子设备相关的;然后,第一电子设备可以获取到二维码中的与第二电子设备相关的第二场景信息;并且,第一电子设备可以获取到与第一电子设备相关的第一场景信息;第一电子设备将与第一电子设备相关的第一场景信息、与第二电子设备相关的第二场景信息,两者进行比对,以确定两者是否匹配;若确定匹配,则第一电子设备可以确定所扫描到的二维码是第二电子设备所生成的,二维码不是其他恶意设备所发出的;然后,第一电子设备就可以对扫描到的二维码进行处理了。可以基于场景信息对二维码进行自动验证,比对两个需要进行二维码交互的电子设备的场景信息,进而对二维码完成验证;可以有效的保证所扫描到的二维码不是被恶意攻击的二维码,可以识别出恶意二维码;从而保证用户的财产安全。
在一种可能的设计中,所述第一电子设备的***中部署有富执行环境;所述第二获取单元,具体用于:
基于所述富执行环境获取所述第一场景信息。可以基于富执行环境获取第一场景信息。
在一种可能的设计中,所述第一电子设备中设置有第一场景器件;所述第二获取单元,包括:
第一发送模块,用于基于所述富执行环境向所述第一场景器件发送第一请求消息,其中,所述第一请求消息用于指示获取所述第一场景器件所检测得到的所述第一场景信息;
第一接收模块,用于基于所述富执行环境接收所述第一场景器件发送的所述第一场景信息。
通过第一电子设备在富执行环境***侧执行各步骤,可以基于场景信息对二维码 进行自动验证,比对两个需要进行二维码交互的电子设备的场景信息,进而对二维码完成验证;可以有效的保证所扫描到的二维码不是被恶意攻击的二维码,可以识别出恶意二维码;从而保证用户的财产安全。
在一种可能的设计中,所述第一电子设备中设置有第一场景器件;所述第一电子设备的***中还部署有可信执行环境;所述第二获取单元,包括:
第二发送模块,用于基于所述富执行环境向所述可信执行环境发送第二请求消息,其中,所述第二请求消息用于指示获取所述第一场景信息;
第二接收模块,用于基于所述富执行环境接收所述可信执行环境返回的返回消息,其中所述返回消息用于指示所述第一场景信息,其中,所述第一场景信息是所述可信执行环境从所述第一场景器件中所获取到的。
由于可信执行环境是安全世界,第一电子设备的可信执行环境对第一场景信息和第二场景信息进行验证,可以保证验证结果的有效性和准确性,保证第一场景信息和第二场景信息不会被篡改。
在一种可能的设计中,所述第二请求消息包括所述第二场景信息,或者,所述第二请求信息用于指示所述第二场景信息;
所述返回消息为验证结果;所述第二接收模块,具体用于:
基于所述富执行环境接收所述可信执行环境返回的验证结果,其中,所述验证结果为所述可信执行环境对所述第一场景信息和所述第二场景信息进行比较之后生成,所述验证结果表征所述第一场景信息和所述第二场景信息符合所述预设条件。
通过第一电子设备的可信执行环境对第一场景信息和第二场景信息进行验证;第一电子设备的可信执行环境将验证结果,发送给第一电子设备的富执行环境;由于可信执行环境是安全世界,保证了验证过程中第一场景信息和第二场景信息不会被恶意攻击。
在一种可能的设计中,所述第二获取单元,还包括:
签名模块,用于在所述第二发送模块基于所述富执行环境向所述可信执行环境发送第二请求消息之前,采用公钥对所述第二场景信息进行签名处理,得到签名后的第二场景信息;
所述第一场景信息是所述可信执行环境采用私钥确定所述签名后的第二场景信息通过验证之后所获取的。在一种可能的设计中,
在一种可能的设计中,所述第一场景信息是所述可信执行环境将所述第一场景器件设置为预设配置之后所获取的,所述预设配置表征所述第一场景信息只可被所述可信执行环境所获取。可信执行环境是安全世界,需要将第一场景器件配置为只有可信执行环境可以读取,那么可信执行环境读取第一场景器件所检测的信息,会出现可信执行环境被恶意攻击的情况,可信执行环境所读取的第一场景信息不会被恶意篡改,保证了第一场景信息的准确性和安全性。
在一种可能的设计中,所述第一电子设备,还包括:
提示单元,用于在确定所述第一场景信息和所述第二场景信息不符合预设条件时,生成并显示提示信息。进而在场景信息没有通过验证时,可以提示用户场景信息被攻击。
在一种可能的设计中,所述确定单元,具体用于:
对所述二维码信息进行解密,得到所述二维码数据和所述第二场景信息。
在一种可能的设计中,所述第一场景信息包括以下的至少一种:全球定位***信息、无线局域网络信息、蓝牙信息、自然环境信息;所述第二场景信息包括以下的至少一种:全球定位***信息、无线局域网络信息、蓝牙信息、自然环境信息。
在一种可能的设计中,在所述第一场景信息为全球定位***信息,所述第二场景信息为全球定位***信息时,所述预设条件为所述第一场景信息与所述第二场景信息均属于预设地理范围;
在所述第一场景信息为无线局域网络信息,所述第二场景信息为无线局域网络信息时,所述预设条件为所述第二场景信息所表征的无线局域网络标识,存在于所述第一场景信息所表征的无线局域网络列表中;
在所述第一场景信息为蓝牙信息,所述第二场景信息为蓝牙信息时,所述预设条件为所述第二场景信息所表征的蓝牙标识,存在于所述第一场景信息所表征的蓝牙列表中;
在所述第一场景信息为自然环境信息,所述第二场景信息为自然环境信息时,所述预设条件为所述第一场景信息与所述第二场景信息均属于预设数值范围。
第四方面,本申请提供一种第二电子设备,所述第二电子设备包括:
获取单元,用于获取第二场景信息,其中,所述第二场景信息为与所述第二电子设备相关的场景信息;
生成单元,用于根据所述第二场景信息和预设的二维码数据,生成显示二维码信息;
显示单元,用于显示二维码信息,其中,所述二维码信息用于第一电子设备获取后在确定第一场景信息和所述第二场景信息符合预设条件时,对所述二维码数据进行预设处理,所述第一场景信息为与所述第一电子设备相关的场景信息。
本实施例,通过第二电子设备获取第二场景信息,其中,所述第二场景信息为与所述第二电子设备相关的场景信息;第二电子设备根据所述第二场景信息和预设的二维码数据,生成并显示二维码信息,其中,所述二维码信息用于第一电子设备获取后在确定第一场景信息和所述第二场景信息符合预设条件时,对所述二维码数据进行预设处理,所述第一场景信息为与所述第一电子设备相关的场景信息。第二电子设备在需要生成二维码的时候,第二电子设备可以获取与第二电子设备相关的第二场景信息;第二电子设备将第二场景信息,加入到二维码中;进而,第二电子设备所显示的二维码中携带有与第二电子设备相关的第二场景信息;第一电子设备对二维码进行扫描,得到第二场景信息,第一电子设备还可以获取第一电子设备相关的第一场景信息;第一电子设备将与第一电子设备相关的第一场景信息、与第二电子设备相关的第二场景信息,两者进行比对,以确定两者是否匹配;若确定匹配,则第一电子设备可以确定所扫描到的二维码是第二电子设备所生成的,二维码不是其他恶意设备所发出的;然后,第一电子设备就可以对扫描到的二维码进行处理了。可以基于场景信息对二维码进行自动验证,比对两个需要进行二维码交互的电子设备的场景信息,进而对二维码完成验证;可以有效的保证所扫描到的二维码不是被恶意攻击的二维码,可以识别出 恶意二维码;从而保证用户的财产安全。
在一种可能的设计中,所述第二电子设备的***中部署有富执行环境;所述获取单元,具体用于:
基于所述富执行环境,获取所述第二场景信息。可以基于富执行环境完成场景信息的验证,比对两个需要进行二维码交互的电子设备的场景信息,进而对二维码完成验证;可以有效的保证所扫描到的二维码不是被恶意攻击的二维码,可以识别出恶意二维码;从而保证用户的财产安全。
在一种可能的设计中,所述第二电子设备中设置有第二场景器件;所述获取单元,包括:
第一发送模块,用于基于所述富执行环境向所述第二场景器件发送第一请求消息,其中,所述第一请求消息用于指示获取所述第二场景器件所检测的所述第二场景信息;
第一接收模块,用于基于所述富执行环境接收所述第二场景器件发送的所述第二场景信息。
通过第二电子设备在富执行环境***侧执行各步骤,即,在富执行环境环境下完成第二场景信息的获取,生成携带有第二场景信息的二维码;从而第一电子设备可以基于场景信息对二维码进行自动验证,比对两个需要进行二维码交互的电子设备的场景信息,进而对二维码完成验证;可以有效的保证所扫描到的二维码不是被恶意攻击的二维码,可以识别出恶意二维码;从而保证用户的财产安全。处理过程简单、快速。
在一种可能的设计中,所述第二电子设备的***中还部署有可信执行环境,所述第二电子设备中设置有第二场景器件;所述获取单元,包括:
第二发送模块,用于基于所述富执行环境向所述可信执行环境发送第二请求消息,其中,所述第二请求消息用于指示获取所述第二场景信息;
第二接收模块,用于基于所述富执行环境接收所述可信执行环境返回的所述第二场景信息,其中,所述第二场景信息是所述可信执行环境从所述第二场景器件中所获取到的。
由于可信执行环境是安全世界,第二电子设备的可信执行环境所获取的第二场景信息是较为安全的。
在一种可能的设计中,所述第二请求消息为基于富执行环境所检测到的触发指令,或者,所述第二请求消息包括所述触发指令;所述触发指令用于指示生成所述二维码信息。
在一种可能的设计中,所述第二场景信息为所述可信执行环境采用公钥进行过签名处理的场景信息;所述获取单元,还包括:
校验模块,用于在所述第二接收模块基于所述富执行环境接收所述可信执行环境返回的所述第二场景信息之后基于所述富执行环境采用私钥对所述第二场景信息进行校验,得到校验结果,其中,所述校验结果表征所述第二场景信息通过校验。第二电子设备的可信执行环境可以对第二场景信息进行签名,保证将第二场景信息传递给第二电子设备的富执行环境的时候,第二场景信息不被篡改。
在一种可能的设计中,所述生成单元,包括:
生成模块,用于基于富执行环境根据所述第二场景信息和所述二维码数据,生成 待处理数据,其中,所述待处理数据为包括所述第二场景信息的二维码数据;
发送模块,用于基于富执行环境将所述待处理数据发送给所述可信执行环境,其中,所述待处理数据用于所述可信执行环境生成并显示所述二维码信息。
第二电子设备的富执行环境将包括第二场景信息的二维码数据,发送给第二电子设备的可信执行环境;第二电子设备的可信执行环境在TUI中绘制并显示二维码界面;由于可信执行环境的安全性很高,在可信执行环境中绘制并显示二维码界面,进一步的保证了第二场景信息和二维码数据,不会被恶意设备或者恶意应用程序所攻击或篡改,保证了第二场景信息和二维码数据的安全性。
在一种可能的设计中,所述生成单元,还包括:
加密模块,用于在所述发送模块基于富执行环境将所述待处理数据发送给所述可信执行环境之前,基于富执行环境对所述待处理数据进行加密,得到加密后的待处理数据。
在一种可能的设计中,所述第二场景信息是所述可信执行环境将所述第二场景器件设置为预设配置之后所获取的,所述预设配置表征所述第二场景器件的第二场景信息只可被所述可信执行环境所获取。在第二电子设备的可信执行环境读取第二场景器件所检测的第二场景信息之前,第二电子设备的可信执行环境将第二场景器件设置为只可被可信执行环境读取,从而保证了第二电子设备所检测到的第二场景信息不会被富执行环境环境下的恶意应用程序所篡改,保证了第二场景信息的安全性。
在一种可能的设计中,所述第二电子设备,还包括:
接收单元,用于在所述获取单元获取第二场景信息之前,接收触发指令,其中,所述触发指令用于指示生成所述二维码信息。
在一种可能的设计中,所述第一场景信息包括以下的至少一种:全球定位***信息、无线局域网络信息、蓝牙信息、自然环境信息;所述第二场景信息包括以下的至少一种:全球定位***信息、无线局域网络信息、蓝牙信息、自然环境信息。
在一种可能的设计中,在所述第一场景信息为全球定位***信息,所述第二场景信息为全球定位***信息时,所述预设条件为所述第一场景信息与所述第二场景信息均属于预设地理范围;
在所述第一场景信息为无线局域网络信息,所述第二场景信息为无线局域网络信息时,所述预设条件为所述第二场景信息所表征的无线局域网络标识,存在于所述第一场景信息所表征的无线局域网络列表中;
在所述第一场景信息为蓝牙信息,所述第二场景信息为蓝牙信息时,所述预设条件为所述第二场景信息所表征的蓝牙标识,存在于所述第一场景信息所表征的蓝牙列表中;
在所述第一场景信息为自然环境信息,所述第二场景信息为自然环境信息时,所述预设条件为所述第一场景信息与所述第二场景信息均属于预设数值范围。
第五方面,本申请提供一种第一电子设备,包括图像采集器和处理器;
其中,所述图像采集器,用于采集第一方面提供的方法中的二维码信息;
所述处理器,用于获取所述图像采集器采集的二维码信息,并执行计算机可执行程序代码中的指令;当所述处理器执行所述指令时,所述指令使所述成像设备执行第 一方面提供的方法。
第六方面,本申请提供一种第二电子设备,包括处理器;
所述处理器,用于执行计算机可执行程序代码中的指令;当所述处理器执行所述指令时,所述指令使所述成像设备执行第二方面提供的方法。
第七方面,本申请提供一种第一电子设备,包括处理器、图像采集器和第一场景器件;
其中,所述图像采集器,用于采集以上第一方面的任一实现方式中的二维码信息;
所述处理器,用于获取所述图像采集器采集的的二维码信息,并执行计算机可执行程序代码中的指令;当所述处理器执行所述指令时,所述指令使所述成像设备执行以上第一方面的任一实现方式。
第八方面,本申请提供一种成像设备,包括用于执行以上第一方面的任一实现方式的至少一个处理元件或芯片。
第九方面,本申请提供一种程序,包括程序代码,当计算机运行所述计算机程序时,所述程序代码执行以上第一方面的任一实现方式。
第十方面,本申请提供一种计算机可读存储介质,包括第九方面的程序。
第十一方面,本申请提供一种第一电子设备,包括处理器和第二场景器件;
所述处理器,用于执行计算机可执行程序代码中的指令;当所述处理器执行所述指令时,所述指令使所述成像设备执行以上第二方面的任一实现方式。
第十二方面,本申请提供一种成像设备,包括用于执行以上第二方面的任一实现方式的至少一个处理元件或芯片。
第十三方面,本申请提供一种程序,包括程序代码,当计算机运行所述计算机程序时,所述程序代码执行以上第二方面的任一实现方式。
第十四方面,本申请提供一种计算机可读存储介质,包括第十三方面的程序。
第十五方面,本申请提供一种计算机程序,包括程序代码,当计算机运行所述计算机程序时,所述程序代码执行以上第一方面的任一实现方式或者第二方面的任一实现方式。
第十六方面,本申请提供一种计算机程序产品,所述计算机程序产品包括:计算机程序,所述计算机程序存储在可读存储介质中,电子设备的至少一个处理器可以从所述可读存储介质读取所述计算机程序,所述至少一个处理器执行所述计算机程序使得电子设备执行第一方面所述的方法或者第二方面所述的方法。其中,电子设备可以是上述第一电子设备或者第二电子设备。
附图说明
图1为本申请实施例提供的一种应用场景示意图一;
图2为本申请实施例提供的一种应用场景示意图二;
图3为本申请实施例提供的一种应用场景示意图三;
图4为本申请实施例提供的一种二维码处理方法的流程示意图;
图5为本申请实施例提供的另一种二维码处理方法的流程示意图;
图6为本申请实施例提供的第一电子设备的显示示意图;
图7为本申请实施例提供的又一种二维码处理方法的流程示意图;
图8为本申请实施例提供的再一种二维码处理方法的流程示意图;
图9为本申请实施例提供的其他一种二维码处理方法的流程示意图;
图10为本申请实施例提供ARMv7的***架构的示意图;
图11为本申请实施例提供REE***中的指令示意图;
图12为本申请实施例提供第一电子设备的***部署示意图;
图13为本申请实施例提供第一电子设备的REE与TEE的交互图;
图14为本申请实施例提供的其他另一种二维码处理方法的流程示意图;
图15为本申请实施例提供的其他又一种二维码处理方法的流程示意图;
图16为本申请实施例提供的其他再一种二维码处理方法的流程示意图;
图17为本申请实施例提供的又有一种二维码处理方法的流程示意图;
图18为本申请实施例提供第二电子设备的***部署示意图;
图19为本申请实施例提供第二电子设备的REE与TEE的交互图;
图20为本申请实施例提供的另有一种二维码处理方法的流程示意图;
图21为本申请实施例提供的再有一种二维码处理方法的流程示意图;
图22为本申请实施例提供的其他有一种二维码处理方法的流程示意图;
图23为本申请实施例提供的还有一种二维码处理方法的流程示意图;
图24为本申请实施例提供的一种第一电子设备的结构示意图;
图25为本申请实施例提供的另一种第一电子设备的结构示意图;
图26为本申请实施例提供的又一种第一电子设备的结构示意图;
图27为本申请实施例提供的一种第二电子设备的结构示意图;
图28为本申请实施例提供的另一种第二电子设备的结构示意图;
图29为本申请实施例提供的又一种第二电子设备的结构示意图;
图30为本申请实施例提供的再一种第一电子设备的结构示意图;
图31为本申请实施例提供的再一种第二电子设备的结构示意图;
图32为本申请实施例提供的其他一种第一电子设备的结构示意图;
图33为本申请实施例提供的其他一种第二电子设备的结构示意图。
具体实施方式
本申请实施例应用于电子设备。电子设备包括但不限于:终端设备、固定电子设备、网络设备。其中,终端设备可以是移动终端设备、固定终端设备。电子设备可以是现有技术中的电子设备,也可以是未来出现的电子设备。
以下对本申请中的部分用语进行解释说明,以便于本领域技术人员理解。需要说明的是,当本申请实施例的方案应用于成像设备时,成像设备的名称可能发生变化,但这并不影响本申请实施例方案的实施。
1)电子设备,可以是生成和显示二维码的设备;或者,可以是扫描和处理二维码的设备;或者,可以是同时具备生成和显示二维码的功能、扫描和处理二维码的功能的设备。
2)终端设备,是一种向用户提供语音和/或数据连通性的设备。本申请中终端设 备主要指但不限于移动终端、车辆终端、车载终端、车辆设备、公共终端、无线通信功能的手持式设备、可穿戴设备、计算设备、具备POS(pointofsales)机功能的终端、等等,其中,车载终端包括但不限于车载导航仪等,移动终端包括但不限于手机、可穿戴设备、平板电脑等。示例性地,终端设备还可以是虚拟现实(virtual reality,VR)终端设备、增强现实(augmented reality,AR)终端设备、工业控制中的无线终端、无人驾驶中的无线终端、远程医疗中的无线终端、智能电网中的无线终端、智慧城市(smart city)中的无线终端、智慧家庭(smart home)中的无线终端等等。
3)网络设备,又称为无线接入网(radio access network,RAN)设备是一种将终端设备接入到无线网络的设备,其包括各种通信制式中的设备;网络设备可能有多种形式,比如宏基站、微基站、中继站和接入点等;网络设备包括但不限于新空口网络中的网络设备、长期演进网络中的网络设备。示例性地,网络设备包括但不限于:传输点(transmission reception point,TRP)、下一代节点B(next generation Node B,gNB)、全球移动通信***(global system for mobile communication,GSM)或码分多址(code division multiple access,CDMA)中的基站收发台(base transceiver station,BTS)、宽带码分多址(wideband code division multiple access,WCDMA)***中的节点B(nodeB,NB)、长期演进***中的演进型节点B(evolutional Node B,eNB或eNodeB)、无线网络控制器(radio network controller,RNC)、基站控制器(base station controller,BSC)、HeNB(home evolved NodeB),或HNB(home Node B)、基带单元(baseband uit,BBU)等。
4)固定电子设备,例如是可以读取二维码和/或生成二维码的公交车扫描仪,例如是可以读取二维码和/或生成二维码的地铁云闸机。地铁云闸机,可以简称为云闸机。
5)“多个”是指两个或两个以上,其它量词与之类似。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。
6)“对应”可以指的是一种关联关系或绑定关系,A与B相对应指的是A与B之间是一种关联关系或绑定关系。
需要指出的是,本申请实施例中涉及的名词或术语可以相互参考,不再赘述。
图1为本申请实施例提供的一种应用场景示意图一,图2为本申请实施例提供的一种应用场景示意图二。如图1和图2所示,本申请实施例的方案,可以应用到图1和图2所示的移动终端中。移动终端可以读取其他电子设备所显示的二维码;如图2所示,移动终端还可以生成和显示二维码。
图3为本申请实施例提供的一种应用场景示意图三。如图3所示,本申请实施例的方案,可以应用到图3所示的闸机中。闸机可以读取其他电子设备所显示的二维码。在一种示例中,闸机也可以生成并显示二维码。另外,本申请实施例还可以应用在支付场景下的移动终端或扫码枪等设备中。
随着终端技术的发展,电子设备已经成为人们生活和工作中必不可少的工具。在电子设备中,终端设备的使用尤其的广泛。为了增强用户生活的便捷性,电子设备可以提供二维码,进而用户使用二维码完成支付行为等。电子设备在生成二维码的时候,电子设备可能会收到恶意软件等攻击,进而电子设备所需要显示的二维码,被恶意软 件所生成的二维码所替代,从而,电子设备显示出被替换的二维码,进而,用户的财产被盗走。进而,现有技术中存在二维码被恶意替换,给用户的财产带来损失。
一个示例中,电子设备可以是移动终端设备。移动终端设备的出现和发展,为用户的生活和工作的带来了极大的便利性,例如,用户可以使用移动终端设备进行拍摄、导航、支付等等。随着移动终端设备的功能、存储量、运算能力的强大,需要更好的保证移动终端设备中的用户隐私信息和财产安全。一旦移动终端设备被恶意攻击,移动终端设备中的用户隐私信息和财产会被盗取。
之前,移动终端设备中的操作***并不安全,攻击设备可以利用安全漏洞控制移动终端设备中的操作***内核,进而攻击设备可以盗取移动终端设备中的用户隐私信息和财产。例如,攻击设备利用安全漏洞控制移动终端设备中的操作***内核,进而攻击移动终端设备所生成的二维码,进而,攻击设备采用恶意的二维码,替换掉移动终端设备所生成的二维码。
在终端设备的应用程序显示界面的过程中,终端设备的后台程序允许主动弹出一个界面(activity)到前台,进而成为运行在前台的应用程序;当用户操作正常的前台应用程序,用户触发切换应用程序界面,在终端设备切换界面的那一瞬间,后台恶意应用程序可以弹出自己的界面,进而恶意的界面,替换掉正常应用程序所需要显示的界面;而上述过程,对于用户而言,是很难觉察到的。
基于以上原因,在终端设备需要生成并显示二维码的时候,用户触发终端设备的正常应用程序去生成并显示二维码;此时,终端设备的后台的恶意应用程序,可以利用线程检查到用户的触发行为;然后,恶意应用程序显示一个恶意二维码,去替换掉正常应用程序所需要显示的二维码。当这一过程发生在支付场景的时候,恶意二维码中会携带有攻击者收款信息,进而,用户的财产被盗走,给用户的财产带来损失。
举例来说,终端设备的后台的恶意应用程序,可以通过ps-At命令,查看其它应用程序的线程信息,并且,这个查看操作不需要任何额外的权限。恶意应用程序可以不断地查看支付应用程序的线程信息,从而,恶意应用程序可以通过侧信道(side channel)检查到表征为支付行为的线程的启动时刻,恶意应用程序通过后台执行am命令,去替换正常的收款二维码的界面。
为了抵御恶意应程序对于正常二维码的攻击,在远程支付的场景中,当终端设备需要扫描网页上所显示到二维码的时候,网页上所显示的二维码中携带有收款方的位置信息,进而终端设备扫描到网页上所显示的二维码的时候,终端设备可以解析出二维码中的位置信息;终端设备显示二维码中的位置信息;然后,用户人工的判别二维码中的位置信息,是否为收款方的位置信息。但是,这样的方式只适合于远程支付的场景。并且,需要保证不同的收款方的二维码中的位置信息,是各不相同;否则,用户对于位置信息的验证,也无法保证二维码中的收款信息是准确的。
本申请提供了二维码处理方法和设备,可以解决上述问题。
图4为本申请实施例提供的一种二维码处理方法的流程示意图。图4所示的实施例,该方法应用于第一电子设备,该方法包括:
101、获取第二电子设备显示的二维码信息。
示例性地,第一电子设备可以是移动终端设备,可以是具有POS机功能的终端设 备,可以是云闸机;或者,第一电子设备可以是其他可以执行本实例方案的装置或设备。
本实施例中,第一电子设备可以采用富执行环境(rich execution environment,REE)***完成各个步骤,或者,第一电子设备可以采用可信执行环境(trusted execution environment,TEE)***完成各个步骤,或者,第一电子设备可以采用其他操作***完成各个步骤,本实施例对于第一电子设备所基于的架构和***,不做限制。
第二电子设备可以采用REE***完成各个步骤,或者,第二电子设备可以采用TEE***完成各个步骤,或者,第二电子设备可以采用其他操作***完成各个步骤,本实施例对于第二电子设备所基于的架构和***,不做限制。
第一电子设备与第二电子设备可以在近距离的范围内进行交互。第二电子设备在接收到触发指令之后,第二电子设备确定需要生成并显示二维码。将第二电子设备所显示的二维码,称为二维码信息;二维码信息为黑白或者彩色的界面。
第二电子设备可以获取与第二电子设备相关的场景信息,将与第二电子设备相关的场景信息,称为第二场景信息;并且,第二电子设备获取二维码数据;二维码数据表征了与第二电子设备对应的用户的用户信息。然后,第二电子设备根据第二场景信息和二维码数据,生成二维码信息;从而,二维码信息中携带有与第二电子设备相关的场景信息、二维码数据。
一个示例中,第二电子设备可以根据预存的二维码数据和所获取到的第二场景信息,生成二维码信息。
一个示例中,第二电子设备可以从网络设备中获取二维码数据;然后,根据二维码数据和所获取到的第二场景信息,生成二维码信息。
一个示例中,在支付场景中,二维码数据包括但不限于作为收款方的用户的用户信息;或者,在支付场景中,二维码数据包括但不限于作为支付方的用户的用户信息。在加好友的场景中,二维码数据包括但不限于用户信息、用户标识。
一个示例中,第二场景信息包括但不限于以下信息:第二电子设备的全球定位***(global positioning system,GPS)信息、第二电子设备的蓝牙信息、第二电子设备的无线局域网(wireless fidelity,wifi)信息、第二电子设备所处的自然环境信息。第二电子设备的蓝牙信息,是第二电子设备所发出的蓝牙连接的蓝牙信息。第二电子设备的wifi信息,是第二电子设备所连接的无线局域网络的信息。第二电子设备所处的自然环境信息,包括但不限于以下信息:环境噪音信息、环境光照信息、环境湿度信息、环境温度信息。
第二电子设备显示二维码信息,然后,第一电子设备可以扫描第二电子设备所显示的二维码。
102、获取第一场景信息,其中,第一场景信息为与第一电子设备相关的场景信息。
示例性地,在第一电子设备获取到二维码信息之后,第一电子设备还可以获取与第一电子设备相关的场景信息;将与第一电子设备相关的场景信息,称为第一场景信息。
一个示例中,第一场景信息包括但不限于以下信息:第一电子设备的全球定位***(global positioning system,GPS)信息、第一电子设备的蓝牙信息、第一电子设备 的无线局域网(wireless fidelity,wifi)信息、第一电子设备所处的自然环境信息。第一电子设备的蓝牙信息,是第一电子设备所发出的蓝牙连接的蓝牙信息。第一电子设备的wifi信息,是第一电子设备所连接的无线局域网络的信息。第一电子设备所处的自然环境信息,包括但不限于以下信息:环境噪音信息、环境光照信息、环境湿度信息、环境温度信息。
103、根据二维码信息,确定二维码数据和第二场景信息,其中,第二场景信息为与第二电子设备相关的场景信息。
示例性地,由于第二电子设备所生成的二维码信息中加入了第二场景信息,第一电子设备在对扫描到的二维码信息进行解析之后,可以得到二维码数据和第二场景信息。
并且,第一电子设备解析二维码信息的过程、第一电子设备获取第一场景信息的过程,两者的执行次序不做限制。即,对步骤102和步骤103的执行次序不做限制。可以现在还行步骤102,然后执行步骤103;也可以先执行步骤103,再执行步骤102;也可以同时执行步骤102和步骤103。
104、在确定第一场景信息和第二场景信息符合预设条件时,对二维码数据进行预设处理。
示例性地,在步骤102中,第一电子设备已经获取了与第一电子设备相关的第一场景信息,并且在步骤103中,第一电子设备获取到了与第二电子设备相关的第二场景信息;然后,第一电子设备可以对第一场景信息和第二场景信息进行验证,进而判断第一场景信息和第二场景信息,是否符合预设条件。
一个示例中,若场景信息为GPS信息,即,第一场景信息为第一电子设备所在的位置,第二场景信息为第二电子设备所在的位置,则预设条件可以是第一电子设备和第二电子设备位于同一个地理范围之内。
一个示例中,若场景信息为wifi信息,即,第一场景信息为第一电子设备所连接的无线局域网络的信息,第二场景信息为第二电子设备所连接的无线局域网络的信息,则预设条件可以是第一电子设备和第二电子设备均连接了同一个无线局域网络;或者,预设条件可以是第一电子设备所连接的无线局域网络、第二电子设备所连接的无线局域网络,两者归属于同一网络范围。
一个示例中,若场景信息为蓝牙信息,即第二场景信息为第二电子设备所发出的蓝牙连接,第一场景信息为第一电子设备可以连接蓝牙的蓝牙列表,则预设条件为第二场景信息所表征的蓝牙连接,位于第一场景信息所表征的蓝牙列表中。
一个示例中,若场景信息为光照信息,即,第一场景信息为第一电子设备所处环境的光照强度,第二场景信息为第二电子设备所处环境的光照强度,则预设条件可以是第一场景信息所表征的光照强度、第二场景信息所表征的光照强度,两者是相同的。
一个示例中,若场景信息为噪音信息,即,第一场景信息为第一电子设备所处环境的噪音强度,第二场景信息为第二电子设备所处环境的光照强度,则预设条件可以是第一场景信息所表征的光照强度、第二场景信息所表征的光照强度,两者是相同的。
第一电子设备在确定第一场景信息和第二场景信息符合预设条件时,就可以对获取到二维码数据进行预设处理。预设处理包括但不限于:向二维码数据表征的收款方 进行转账处理、向二维码数据表征的付款方进行是扣费处理、向二维码数据表征的用户发出预设请求;预设请求,例如是加好友的请求。
本实施例,通过第一电子设备获取第二电子设备显示的二维码信息;第一电子设备获取第一场景信息,并根据二维码信息,确定二维码数据和第二场景信息,其中,第一场景信息为与第一电子设备相关的场景信息,第二场景信息为与第二电子设备相关的场景信息;第一电子设备在确定第一场景信息和第二场景信息符合预设条件时,对二维码数据进行预设处理。在二维码中加入电子设备的场景信息,进而第二电子设备所显示的二维码中的场景信息,是与第二电子设备相关的;然后,第一电子设备可以获取到二维码中的与第二电子设备相关的第二场景信息;并且,第一电子设备可以获取到与第一电子设备相关的第一场景信息;第一电子设备将与第一电子设备相关的第一场景信息、与第二电子设备相关的第二场景信息,两者进行比对,以确定两者是否匹配;若确定匹配,则第一电子设备可以确定所扫描到的二维码是第二电子设备所生成的,二维码不是其他恶意设备所发出的;然后,第一电子设备就可以对扫描到的二维码进行处理了。可以基于场景信息对二维码进行自动验证,比对两个需要进行二维码交互的电子设备的场景信息,进而对二维码完成验证;可以有效的保证所扫描到的二维码不是被恶意攻击的二维码,可以识别出恶意二维码;从而保证用户的财产安全。
图5为本申请实施例提供的另一种二维码处理方法的流程示意图。图4所示的实施例,该方法应用于第一电子设备,该方法包括:
201、获取第二电子设备显示的二维码信息。
示例性地,第一电子设备可以是移动终端设备,可以是具有POS机功能的终端设备,可以是云闸机;或者,第一电子设备可以是其他可以执行本实例方案的装置或设备。
本实施例中,第一电子设备可以采用REE***完成各个步骤,或者,第一电子设备可以采用可信执行环境(trusted execution environment,TEE)***完成各个步骤,或者,第一电子设备可以采用其他操作***完成各个步骤,本实施例对于第一电子设备所基于的架构和***,不做限制。
第二电子设备可以采用REE***完成各个步骤,或者,第二电子设备可以采用TEE***完成各个步骤,或者,第二电子设备可以采用其他操作***完成各个步骤,本实施例对于第二电子设备所基于的架构和***,不做限制。
本步骤可以参见图4所示步骤101,不再赘述。
202、获取第一场景信息,其中,第一场景信息为与第一电子设备相关的场景信息。
示例性地,本步骤可以参见图4所示步骤102,不再赘述。
203、根据二维码信息,确定二维码数据和第二场景信息,其中,第二场景信息为与第二电子设备相关的场景信息。
示例性地,本步骤可以参见图4所示步骤103,不再赘述。对步骤202和步骤203的执行次序不做限制。可以现在还行步骤202,然后执行步骤203;也可以先执行步骤203,再执行步骤202;也可以同时执行步骤202和步骤203。
204、在确定第一场景信息和第二场景信息符合预设条件时,对二维码数据进行预设处理。
示例性地,本步骤可以参见图4所示步骤104,不再赘述。
205、在确定第一场景信息和第二场景信息不符合预设条件时,生成并显示提示信息。
示例性地,示例性地,在步骤202中,第一电子设备已经获取了与第一电子设备相关的第一场景信息,并且在步骤203中,第一电子设备获取到了与第二电子设备相关的第二场景信息;然后,第一电子设备可以对第一场景信息和第二场景信息进行验证,进而判断第一场景信息和第二场景信息,是否符合预设条件。
第一电子设备在确定第一场景信息和第二场景信息符合预设条件时,确定所获取到的二维码数据是被篡改或替换过的,第一电子设备不会对二维码数据进行预设处理。
此时,第一电子设备需要提示用户,第一电子设备提示用户二维码被替换过;第一电子设备生成提示信息,并且,第一电子设备向持有第一电子设备的用户显示提示信息,提示信息表征二维码是具有危险性的二维码。一个示例中,第一电子设备还可以向第二电子设备发送提示信息,用于提示第二电子设备所生成的二维码被恶意替换了。
提示信息包括但不限于以下信息:文字信息、图像信息、语音信息、震动信息。一个示例中,图6为本申请实施例提供的第一电子设备的显示示意图,如图6所示,第一电子设备可以弹出一个显示界面,该显示界面用于提示用户所得到的二维码被恶意替换了。用户可以选择显示界面上按键,去关闭该显示界面;或者,第一电子设备可以控制显示界面逐渐消息。
一个示例中,若场景信息为GPS信息,即,第一场景信息为第一电子设备所在的位置,第二场景信息为第二电子设备所在的位置;第一电子设备若确定第一场景信息所表征的位置与第二电子设备所在的位置,不再同一个地理范围之内,则第一电子设备向用户发出提示信息,以提示二维码被恶意替换了,进而提示用户不要进行后续的操作了。
一个示例中,若场景信息为wifi信息,即,第一场景信息为第一电子设备所连接的无线局域网络的信息,第二场景信息为第二电子设备所连接的无线局域网络的信息;第一电子设备若确定第一电子设备所连接的无线局域网络、第二电子设备所连接的无线局域网络,两者是不同的无线局域网络,则第一电子设备向用户发出提示信息,以提示二维码被恶意替换了,进而提示用户不要进行后续的操作了。
一个示例中,若场景信息为蓝牙信息,即第二场景信息为第二电子设备所发出的蓝牙连接,第一场景信息为第一电子设备可以连接蓝牙的蓝牙列表;第一电子设备若确定第二电子设备所发出的蓝牙连接,不再第一电子设备的蓝牙列表中,则第一电子设备向用户发出提示信息,以提示二维码被恶意替换了,进而提示用户不要进行后续的操作了。
本实施例,在上述实施例的基础上,第一电子设备将与第一电子设备相关的第一场景信息、与第二电子设备相关的第二场景信息,两者进行比对,以确定两者是否匹配;若确定不匹配,则第一电子设备可以确定所扫描到的二维码不是第二电子设备所 生成的,而是恶意设备所生成之后替换到第二电子设备中的;从而,第一电子设备可以发出提示信息,以提示用户或第二电子设备。可以基于场景信息对二维码进行自动验证,在确定所扫描到的二维码是被恶意攻击的二维码的时候,发出提示信息,保障用户的财产安全。
图7为本申请实施例提供的又一种二维码处理方法的流程示意图。图7所示的实施例,该方法应用于第一电子设备,第一电子设备的***中部署有富执行环境(rich execution environment,REE);该方法包括:
301、获取第二电子设备显示的二维码信息。
示例性地,第一电子设备可以是移动终端设备,可以是具有POS机功能的终端设备,可以是云闸机;或者,第一电子设备可以是其他可以执行本实例方案的装置或设备。
在电子设备的***中可以部署REE***。REE***可以包括以下几种运行模式:用户模式、内核模式、等等。
第二电子设备可以采用REE***完成各个步骤,或者,第二电子设备可以采用TEE***完成各个步骤,或者,第二电子设备可以采用其他操作***完成各个步骤,本实施例对于第二电子设备所基于的架构和***,不做限制。
参见图4步骤101,第二电子设备可以获取与第二电子设备相关的第二场景信息;第二电子设备根据第二场景信息和二维码数据,生成并显示二维码信息。
302、基于REE获取第一场景信息,其中,第一场景信息为与第一电子设备相关的场景信息。
示例性地,第一电子设备的REE***可以在用户模式或者内核模式下,获取第一场景信息。或者,第一电子设备中配置了其他运行***,第一电子设备的REE***与其他运行***之间进行交互,进而获取到第一场景信息。
第一场景信息为与第一电子设备相关的场景信息。
303、根据二维码信息,确定二维码数据和第二场景信息,其中,第二场景信息为与第二电子设备相关的场景信息。
一个示例中,步骤303具体包括:对二维码信息进行解密,得到二维码数据和第二场景信息。
示例性地,第一电子设备的REE***可以在用户模式或者内核模式下,对扫描到的二维码信息进行解密和解析,得到二维码数据和第二场景信息。或者,第一电子设备中配置了其他运行***,第一电子设备的其他运行***,对扫描到的二维码信息进行解密和解析。
对步骤302和步骤303的执行次序不做限制。可以现在还行步骤302,然后执行步骤303;也可以先执行步骤303,再执行步骤302;也可以同时执行步骤302和步骤303。
304、在确定第一场景信息和第二场景信息符合预设条件时,对二维码数据进行预设处理。
示例性地,第一电子设备的REE***可以在用户模式或者内核模式下,对第一场 景信息和第二场景信息进行分析。或者,第一电子设备中配置了其他运行***,第一电子设备的其他运行***,对第一场景信息和第二场景信息进行分析。
对第一场景信息和第二场景信息进行分析的具体过程,可以参见图4所示的步骤104,不再赘述。
本实施例,通过第一电子设备在REE***侧执行各步骤,可以基于场景信息对二维码进行自动验证,比对两个需要进行二维码交互的电子设备的场景信息,进而对二维码完成验证;可以有效的保证所扫描到的二维码不是被恶意攻击的二维码,可以识别出恶意二维码;从而保证用户的财产安全。
图8为本申请实施例提供的再一种二维码处理方法的流程示意图。图8所示的实施例,该方法应用于第一电子设备,第一电子设备的***中部署有REE,第一电子设备中设置有第一场景器件;该方法包括:
401、获取第二电子设备显示的二维码信息。
示例性地,第一电子设备可以是移动终端设备,可以是具有POS机功能的终端设备,可以是云闸机;或者,第一电子设备可以是其他可以执行本实例方案的装置或设备。
在电子设备的***中可以部署REE***。REE***可以包括以下几种运行模式:用户模式、内核模式、等等。
第二电子设备可以采用REE***完成各个步骤,或者,第二电子设备可以采用TEE***完成各个步骤,或者,第二电子设备可以采用其他操作***完成各个步骤,本实施例对于第二电子设备所基于的架构和***,不做限制。
参见图4步骤101,第二电子设备可以获取与第二电子设备相关的第二场景信息;第二电子设备根据第二场景信息和二维码数据,生成并显示二维码信息。
402、基于REE向第一场景器件发送第一请求消息,其中,第一请求消息用于指示获取第一场景器件所检测得到的第一场景信息;第一场景信息为与第一电子设备相关的场景信息。
示例性地,第一电子设备的REE***可以在用户模式或者内核模式下,获取第一场景信息。第一场景信息为与第一电子设备相关的场景信息。
可以在第一电子设备中配置第一场景器件。示例性地,第一场景器件是GPS芯片,则第一场景信息为GPS信息。第一场景器件是wifi模块,则第一场景信息为wifi信息。第一场景器件是蓝牙芯片,则第一场景信息为蓝牙信息。第一场景器件是温度传感器,则第一场景信息为环境温度信息。第一场景器件是声音传感器,则第一场景信息为环境噪音信息。第一场景器件是光敏传感器,则第一场景信息为环境光照信息。
第一电子设备的REE***与第一场景器件之间是可以直接交互的,第一电子设备的REE***可以获取到第一场景器件所检测到第一场景信息。
从而,第一电子设备的REE***可以直接向第一场景器件发送指令,以获取第一场景信息。一个示例中,第一电子设备的REE***向第一场景器件发送第一请求消息;然后,第一场景器件将所检测得到的第一场景信息,发送给第一电子设备的REE***。
403、基于REE接收第一场景器件发送的第一场景信息。
示例性地,参见步骤402,第一电子设备的REE***可以接收到第一场景器件返回的第一场景信息。在步骤402之后执行步骤403。
404、根据二维码信息,确定二维码数据和第二场景信息,其中,第二场景信息为与第二电子设备相关的场景信息。
一个示例中,步骤404具体包括:对二维码信息进行解密,得到二维码数据和第二场景信息。
示例性地,第一电子设备的REE***可以在用户模式或者内核模式下,对扫描到的二维码信息进行解密和解析,得到二维码数据和第二场景信息。即,第一电子设备在REE***中完成对二维码信息的解析。
对步骤402和步骤404的执行次序不做限制。可以现在还行步骤402,然后执行步骤404;也可以先执行步骤404,再执行步骤402;也可以同时执行步骤402和步骤404。
405、在确定第一场景信息和第二场景信息符合预设条件时,对二维码数据进行预设处理。
示例性地,第一电子设备的REE***可以在用户模式或者内核模式下,对第一场景信息和第二场景信息进行分析。即,第一电子设备在REE***中完成对第一场景信息和第二场景信息的分析。
第一场景信息和第二场景信息的分析,可以参见图4所示的步骤104,不再赘述。
本实施例,通过第一电子设备在REE***侧执行各步骤,即,在REE环境下完成场景信息的获取、验证,可以基于场景信息对二维码进行自动验证,比对两个需要进行二维码交互的电子设备的场景信息,进而对二维码完成验证;可以有效的保证所扫描到的二维码不是被恶意攻击的二维码,可以识别出恶意二维码;从而保证用户的财产安全。处理过程简单、快速。
图9为本申请实施例提供的其他一种二维码处理方法的流程示意图。图9所示的实施例,该方法应用于第一电子设备,第一电子设备的***中部署有富执行环境(rich execution environment,REE)和可信执行环境(trusted execution environment,TEE);第一电子设备中设置有第一场景器件;该方法包括:
501、获取第二电子设备显示的二维码信息。
示例性地,第一电子设备可以是移动终端设备,可以是具有POS机功能的终端设备,可以是云闸机;或者,第一电子设备可以是其他可以执行本实例方案的装置或设备。
为了保证电子设备的安全性,引入了TrustZone技术和ARM(advanced RISC machines)硬件虚拟化技术,移动终端设备可以采用ARM TrustZone技术,保证移动终端设备不轻易被攻击。ARM中央处理器(central processing unit,CPU)中的硬件安全特性,可以支持TrustZone技术和ARM硬件虚拟化技术;ARM TrustZone技术,比起操作***具备更高的权限,从而不会被轻易攻击。
ARM TrustZone技术将硬件资源划分为两个***侧,分别为REE***侧和TEE***侧;进而,ARM TrustZone技术将硬件资源划分为两个世界,分别为非安全世界 和安全世界;REE侧为非安全世界,TEE侧为安全世界。
在REE***中可以运行与用户关系密切的操作***;TrustZone技术作为保障***安全的技术,运行在TEE***中。
非安全世界,并不是指运行在REE***中的操作***或者软件是恶意的,而指的是REE***的安全性比TEE***的安全性低。因为当中央处理器(central processing unit,CPU)工作在TEE***中的时候,TEE***侧的资源是不允许被中央处理器所访问的;TEE***侧的资源,例如有寄存器、内存、Cache、外接设备等等;当中央处理器访问TEE***侧的资源的时候,导致REE***崩溃。但是,运行TEE***中的硬件和软件,可以有更高的访问权限。
一个示例中,采用TrustZone技术的硬件可以通过配置TZASC(TrustZone address space contoller)寄存器和TZMA(TrustZone memory adapter)寄存器,把敏感的内存设置为安全内存(Secure Memory);进而REE***无法对安全内存进行访问。当中央处理器工作在TEE***时,中央处理器既可以访问TEE***中的资源,又可以访问REE***中的资源。
一个示例中,REE***和TEE***可以运行在ARMv7***架构中。图10为本申请实施例提供ARMv7的***架构的示意图。
如图10所示,做为非安全世界的REE***包括了以下几层架构(CPU模式):用户模式(user mode,USR)、内核模式(kernel mode,SVC)、Hypervisor模式(hypervisor mode,HYP)。REE***中的用户模式和内核模式下,可以运行与用户、用户操作关系紧密的操作***;HYP模式是REE***中的访问权限最高的模式。一个示例中,当中央处理器在HYP模式下进行工作的时候,中央处理器可以访问用户模式、内核模式和HYP模式的所有硬件资源;当中央处理器在用户模式或者内核模式下进行工作的时候,中央处理器是不能访问HYP模式的所有硬件资源的。如图10所示,做为非安全世界的REE包含三个权限等级,分别为PL0、PL1、PL2。PL0为用户模式,PL1为内核模式,PL2为HYP模式。
如图10所示,做为安全世界的TEE***包括了以下几层架构(CPU模式):用户模式(user mode,USR)、内核模式(kernel mode,SVC)、监控模式(monitor mode,MON)。可能性的,TEE***也可以包括Hypervisor模式(hypervisor mode,HYP)。其中,监控模式是TEE***中的访问权限最高的一个模式。一个示例中,当中央处理器工作在监控模式下的时候,中央处理器可以访问安全世界所有的硬件资源,还可以访问非安全世界所有的硬件资源。并且,可以在监控模式下采用TrustZone技术,配置Hypervisor相关的控制寄存器来初始化并激活Hypervisor模式。
并且,TEE中的监控模式也是非安全世界进入安全世界的一个门户。一个示例中,在REE***的内核模式或者HYP模式下,可以执行REE进入TEE的指令(secure monitor call,SMC)指令,进而可以主动地从REE***,切换到TEE***的监控模式。
一个示例中,在TEE***的监控模式下,可以执行ERET指令,进而中央处理器可以检查SCR(secure control register)寄存器的NS位,进而确定是否继续停留在TEE***中;当NS位置为1时,监控模式下的返回操作返回REE***的内核,进而执 行***(世界)切换(world switch)的操作;当NS位置为0时,监控模式下的返回操作返回TEE***的内核,不执行***(世界)切换的操作。
图11为本申请实施例提供REE***中的指令示意图。如图11所示,可以在REE***的内核模式下执行HVC(hypervisor call)指令,进入REE***的HYP模式;可以在REE***的HYP模式下执行ERET指令,进而从HYP模式返回REE***的内核模式。
ARM引入了第二层内存地址翻译(Stage-2translation)的内存虚拟化技术;利用该技术,虚拟地址到物理地址(VA->PA)的一层内存地址翻译,就转变为了以下过程:首先从虚拟地址到中间地址(VA->IPA)的地址翻译,然后再从中间地址到物理地址(IPA->PA)的地址翻译。即,经过了VA->IPA->PA的两层内存地址翻译。其中,第二层内存地址翻译(IPA->PA)的过程,是由Hypervisor完全控制的,对于操作***来说是透明的;进而对于操作***而言,IPA就是Hypervisor所使用的“物理地址”。
还可以设置一个第二层地址翻译页表项(page table descriptor);利用该第二层地址翻译页表项可以访问监控位的属性,进而Hypervisor对操作***的内存访问进行访问控制。其中,第二层地址翻译页表项包含:读(R)控制位、写(W)控制位、执行(X)控制位。读写控制位与内存的数据保护相关,执行控制位与内存代码执行相关。可以通过对读控制位、写和控制位执行控制位的配置,Hypervisor能够实现以页粒度去监控物理内存的访问,进而保护敏感信息。
为了使得设备可以支持TEE***,用于支持TEE的芯片和芯片技术已经开始得到发展和应用。进而,指纹识别、人脸识别、秘钥和证书的管理、对REE侧内核代码段和关键数据的完整性保护等等,可以在TEE***的保护下完成。并且,在硬件虚拟化技术方面,可以利用Hypervisor抵御手机root攻击和内核代码篡改的攻击,利用Hypervisor对内核进行实时的保护。
一个示例中,移动终端设备在支付场景中,可以利用TEE生成二维码。移动终端设备的应用程序运行在移动终端设备的REE侧;当移动终端设备的应用程序需要绘制二维码的时候,移动终端设备的应用程序通过REE与TEE之间通信接口,向移动终端设备的内核发送SMC(secure monitor call)指令,SMC指令用于请求TEE绘制二维码。移动终端设备的TEE绘制并显示二维码。
但是上面这个示例的过程中,恶意设备或者恶意应用程序,依然可以攻击二维码的生成过程。当移动终端设备的应用程序通过REE与TEE之间通信接口,向移动终端设备的内核发送SMC指令的时候,恶意应用程序可以发起拒绝服务攻击(denial of service,Dos),进而恶意应用程序通过Dos拒绝SMC请求;并且,恶意应用程序生成恶意的二维码,将恶意的二维码替换掉正常的二维码,例如,恶意应用程序生成假的二维码界面,将假的二维码界面,替换到正常的二维码界面。进而,仅仅在TEE侧生成二维码的方式,依然会收到恶意设备或者恶意应用程序的共计,依然不能保证二维码不被恶意替换,存在用户财产被盗走的可能性。
本实施例中,可以在第一电子设备的***中部署REE***和TEE***。图12为本申请实施例提供第一电子设备的***部署示意图。如图12所示,第一电子设备中部署REE***和TEE***。第一电子设备的REE侧,包括了以下几层架构:用户模式 (user mode,USR)、内核模式(kernel mode,SVC)、Hypervisor模式(hypervisor mode,HYP)。第一电子设备的TEE侧,包括了以下几层架构:用户模式(user mode,USR)、内核模式(kernel mode,SVC)、监控模式(monitor mode,MON)。
第二电子设备可以采用REE***完成各个步骤,或者,第二电子设备可以采用TEE***完成各个步骤,或者,第二电子设备可以采用其他操作***完成各个步骤,本实施例对于第二电子设备所基于的架构和***,不做限制。
参见图4步骤101,第二电子设备可以获取与第二电子设备相关的第二场景信息;第二电子设备根据第二场景信息和二维码数据,生成并显示二维码信息。
需要扫描和处理二维码的应用程序可以运行在第一电子设备的REE侧,一个示例中,该应用程序运行在第一电子设备的REE侧的用户模式下。从而,第一电子设备是在REE侧扫描到第二电子设备所显示的二维码信息。
一个示例中,用户触发第一电子设备进行扫描行为;第一电子设备的REE,向第一电子设备的摄像头发送扫描指令,进而第一电子设备通过摄像头扫描到写的有第二场景信息的二维码信息。
502、根据二维码信息,确定二维码数据和第二场景信息,其中,第二场景信息为与第二电子设备相关的场景信息。
一个示例中,步骤502具体包括:对二维码信息进行解密,得到二维码数据和第二场景信息。
示例性地,第一电子设备在REE侧对二维码信息进行解密和解析,得到二维码数据和第二场景信息,其中,第二场景信息为与第二电子设备相关的场景信息。
一个示例中,在步骤504之前,可以包括步骤503:
503、采用公钥对第二场景信息进行签名处理,得到签名后的第二场景信息。
示例性地,第一电子设备为了保证所获取到的第二场景信息,不被第一电子设备中的恶意应用程序攻击或篡改,第一电子设备的REE采用公钥,对第二场景信息进行签名处理,得到签名后的第二场景信息。
504、基于REE向TEE发送第二请求消息,其中,第二请求消息用于指示获取第一场景信息。第一场景信息为与第一电子设备相关的场景信息。
一个示例中,第二请求消息包括第二场景信息,或者,第二请求信息用于指示第二场景信息。
示例性地,第一电子设备的REE触发SMC指令,进入第一电子设备的TEE。然后,第一电子设备的REE基于第二场景信息,向第一电子设备的TEE请求第一电子设备的第一场景信息。
第一电子设备的REE,向第一电子设备的TEE发送第二请求消息,该第二请求消息用于指示需要获取与第一电子设备相关的第一场景信息。
一个示例中,还需要第一电子设备的TEE对与第二电子设备相关的第二场景信息进行验证,从而第一电子设备的REE需要将第二场景信息,发送给第一电子设备的TEE。
一个示例中,第一电子设备的REE,直接将签名后的第二场景信息,发送给第一电子设备的TEE的TA。
一个示例中,第一电子设备的REE将签名后的第二场景信息放入第二请求消息中,第一电子设备的REE将第二请求消息,发送给第一电子设备的TEE的TA。
一个示例中,第二请求消息可以指示出签名后的第二场景信息;第一电子设备的REE将第二请求消息,发送给第一电子设备的TEE的TA。
505、基于REE接收TEE返回的返回消息,其中返回消息用于指示第一场景信息,其中,第一场景信息是TEE从第一场景器件中所获取到的。
一个示例中,返回消息为验证结果;步骤505具体包括:基于REE接收TEE返回的验证结果,其中,验证结果为TEE对第一场景信息和第二场景信息进行比较之后生成,验证结果表征第一场景信息和第二场景信息符合预设条件。
一个示例中,第一场景信息是TEE采用私钥确定签名后的第二场景信息通过验证之后所获取的。
一个示例中,第一场景信息是TEE将第一场景器件设置为预设配置之后所获取的,预设配置表征第一场景信息只可被TEE所获取。
一个示例中,第一场景信息包括以下的至少一种:GPS信息、wifi信息、蓝牙信息、自然环境信息;第二场景信息包括以下的至少一种:GPS信息、wifi信息、蓝牙信息、自然环境信息。
一个示例中,在第一场景信息为GPS信息,第二场景信息为GPS信息时,预设条件为第一场景信息与第二场景信息均属于预设地理范围。
在第一场景信息为wifi信息,第二场景信息为wifi信息时,预设条件为第二场景信息所表征的wifi标识,存在于第一场景信息所表征的wifi列表中。
在第一场景信息为蓝牙信息,第二场景信息为蓝牙信息时,预设条件为第二场景信息所表征的蓝牙标识,存在于第一场景信息所表征的蓝牙列表中。
在第一场景信息为自然环境信息,第二场景信息为自然环境信息时,预设条件为第一场景信息与第二场景信息均属于预设数值范围。
示例性地,第一电子设备的TEE的TA在基于第二请求消息,获取到签名后的第二场景信息之后,需要验证信息的来源。第一电子设备的TEE的TA采用与公钥对应的私钥,对签名后的第二场景信息进行签名、验证。并且,第一电子设备的TEE需要获取第一场景器件所检测到的第一场景信息。
一个示例中,第一电子设备的TEE的TA在确定签名后的第二场景信息通过验证之后,第一电子设备的TEE的TA,向TEE的内核发送获取请求,获取请求用于指示获取第一场景信息。
一个示例中,第一电子设备的TEE的TA在对签名后的第二场景信息通过验证的同时,就向TEE的内核发送获取请求,获取请求用于指示获取第一场景信息。
一个示例中,第一电子设备中的第一场景器件可以采集第一场景信息,在第一电子设备的TEE的内核读取第一场景信息之前,第一电子设备的TEE需要将第一场景器件配置为只有TEE可以读取。这是由于第一场景器件,可以被第一电子设备的REE和TEE所读取;但是,REE是非安全世界,若REE读取第一场景器件所检测的信息,有可能会出现REE被恶意攻击的情况,会导致REE所读取的第一场景信息被恶意篡改了;TEE是安全世界,需要将第一场景器件配置为只有TEE可以读取,那么TEE 读取第一场景器件所检测的信息,会出现TEE被恶意攻击的情况,TEE所读取的第一场景信息不会被恶意篡改,保证了第一场景信息的准确性和安全性。此时,第一电子设备的TEE的内核,对第一场景器件设置为预设配置;预设配置表征第一场景器件所检测到的第一场景信息,只可被第一电子设备的TEE所获取。
第一电子设备的TEE的内核,读取第一场景器件所检测到的第一场景信息。
第一电子设备的TEE的内核将第一场景信息,发送给第一电子设备的TEE的TA。
然后,第一电子设备的TEE的TA依据预设条件,对第一场景信息和第二场景信息进行验证,生成验证结果。在第一场景信息和第二场景信息,符合预设条件时,验证结果表征为第一场景信息和第二场景信息符合预设条件,即,第二场景信息通过验证;在第一场景信息和第二场景信息,不符合预设条件时,验证结果表征为第一场景信息和第二场景信息不符合预设条件,即,第二场景信息不通过验证。
一个示例中,场景信息为GPS信息,即,第一场景信息为第一电子设备所在的位置,第二场景信息为第二电子设备所在的位置。第一电子设备的TEE可以判断第一场景信息所表征的位置、第二场景信息所表征的位置,两者是否属于同一个预设地理范围;若属于,则第一电子设备的TEE确定第二场景信息通过验证;若不属于,则第一电子设备的TEE确定第二场景信息不通过验证。
一个示例中,场景信息为wifi信息,即,第一场景信息为第一电子设备所连接的无线局域网络的信息,第二场景信息为第二电子设备所连接的无线局域网络的信息。第一电子设备的TEE可以判断第一场景信息所表征的无线局域网络、第二场景信息所表征的无线局域网络,两者是否归属于同一网络范围;若是,则第一电子设备的TEE确定第二场景信息通过验证;若否,则第一电子设备的TEE确定第二场景信息不通过验证。
一个示例中,场景信息为wifi信息,即,第一场景信息为第一电子设备所连接的无线局域网络的信息,第二场景信息为第二电子设备中的无线局域网络的列表。第一电子设备的TEE可以判断第二场景信息所表征的无线局域网络,是否存在于第以场景信息所表征的无线局域网络的列表中;若是,则第一电子设备的TEE确定第二场景信息通过验证;若否,则第一电子设备的TEE确定第二场景信息不通过验证。
一个示例中,场景信息为蓝牙信息,即,第一场景信息为第一电子设备所连接的蓝牙的信息,第二场景信息为第二电子设备中的蓝牙的列表。第一电子设备的TEE可以判断第二场景信息所表征的蓝牙,是否存在于第以场景信息所表征的蓝牙的列表中;若是,则第一电子设备的TEE确定第二场景信息通过验证;若否,则第一电子设备的TEE确定第二场景信息不通过验证。
一个示例中,场景信息为自然环境信息,即,第一场景信息为第一电子设备所处环境的环境信息,第二场景信息为第二电子设备所处环境的环境信息。第一电子设备的TEE可以判断第一场景信息所表征的环境信息、第二场景信息所表征的环境信息,两者是否归属于同一个范围;若是,则第一电子设备的TEE确定第二场景信息通过验证;若否,则第一电子设备的TEE确定第二场景信息不通过验证。自然环境信息,包括但不限于以下信息:光照信息、噪音信息、温度信息、湿度信息。
第一电子设备的TEE的TA通过***内核,将验证结果发送给第一电子设备的 REE。
第一电子设备的REE接收第一电子设备的发送的验证结果。
506、在确定第一场景信息和第二场景信息符合预设条件时,对二维码数据进行预设处理。
示例性地,第一电子设备的REE在确定验证结果,表征为第一场景信息和第二场景信息符合预设条件时,第一电子设备的REE就可以二维码数据进行预设处理。
一个示例中,图13为本申请实施例提供第一电子设备的REE与TEE的交互图,如图13所示,第一电子设备的REE侧的用户模式下,运行了多个应用程序(application,APP),应用层序扫描第二电子设备上显示的二维码信息;REE对二维码信息进行解密,得到二维码数据和第二场景信息;REE采用公钥对第二场景信息进行签名处理,得到签名后的第二场景信息。然后,步骤1、REE触发SMC指令进入TEE,并将签名后的第二场景信息发送给TEE的TA。步骤2、TEE的TA,采用私钥对签名后的第二场景信息进行验证;TEE的TA在确定签名后的第二场景信息通过验证之后,TEE的TA向TEE的内核发送获取请求,获取请求用于指示获取第一场景信息。步骤3、TEE的内核设置第一电子设备中的第一场景信息为预设配置,预设配置表征第一场景信息只可被TEE的内核所获取。步骤4、TEE的内核读取第一场景信息。步骤5、TEE的内核将第一场景信息,发送给TEE的TA。步骤6、TEE的TA根据预设条件对确定第一场景信息和第二场景信息进行验证,生成验证结果;TEE的TA通过***内核,将验证结果发送给REE,其中,验证结果表征第二场景信息通过验证,或者,验证结果表征第二场景信息未通过验证。
本实施例,通过第一电子设备的REE获取第二电子设备显示的二维码信息;第一电子设备的REE根据二维码信息,确定二维码数据、与第二电子设备相关的第二场景信息;第一电子设备的REE,向第一电子设备的TEE发送第二请求消息,其中,第二请求消息用于指示获取与第一电子设备相关的第一场景信息,第二请求消息可以包括或者指示出第二场景信息;第一电子设备的TEE获取第一场景信息,第一电子设备的TEE对第一场景信息和第二场景信息进行验证;第一电子设备的TEE将验证结果,发送给第一电子设备的REE。进而,第一电子设备的REE指示第一电子设备的TEE,读取与第一电子设备相关的第一场景信息;第一电子设备的TEE可以将第一场景器件设置为只可被TEE读取,进而保证了第一电子设备所检测到的第一场景信息不会被REE环境下的恶意应用程序所篡改,保证了第一场景信息的安全性;由于TEE是安全世界,第一电子设备的TEE对第一场景信息和第二场景信息进行验证,可以保证验证结果的有效性和准确性,保证第一场景信息和第二场景信息不会被篡改;进而第一电子设备的TEE,将准确的验证结果发送给第一电子设备的REE;第一电子设备的REE在确定验证结果表征为第二场景信息通过验证之后,对二维码进行预设处理,例如进行支付或者扣款处理。可以基于场景信息对二维码进行自动验证,比对两个需要进行二维码交互的电子设备的场景信息,进而对二维码完成验证;可以有效的保证所扫描到的二维码不是被恶意攻击的二维码,可以识别出恶意二维码;从而保证用户的财产安全。并且由于TEE环境的安全性,保证了对于场景信息的获取和验证过程,不会被恶意攻击,进一步的保证了有效的对二维码完成验证,有效的识别出恶意二维码。
图14为本申请实施例提供的其他另一种二维码处理方法的流程示意图。图14所示的实施例,该方法应用于第二电子设备;该方法包括:
601、获取第二场景信息,其中,第二场景信息为与第二电子设备相关的场景信息。
示例性地,第二电子设备可以是移动终端设备,可以是具有POS机功能的终端设备,可以是云闸机;或者,第二电子设备可以是其他可以执行本实例方案的装置或设备。
本实施例中,第一电子设备可以采用REE***完成各个步骤,或者,第一电子设备可以采用TEE***完成各个步骤,或者,第一电子设备可以采用其他操作***完成各个步骤,本实施例对于第一电子设备所基于的架构和***,不做限制。
第二电子设备可以采用REE***完成各个步骤,或者,第二电子设备可以采用TEE***完成各个步骤,或者,第二电子设备可以采用其他操作***完成各个步骤,本实施例对于第二电子设备所基于的架构和***,不做限制。
第一电子设备与第二电子设备可以在近距离的范围内进行交互。第二电子设备在接收到触发指令之后,第二电子设备确定需要生成并显示二维码。将第二电子设备所显示的二维码,称为二维码信息;二维码信息为黑白或者彩色的界面。
第二电子设备可以获取与第二电子设备相关的场景信息,将与第二电子设备相关的场景信息,称为第二场景信息。
一个示例中,第二场景信息包括但不限于以下信息:第二电子设备的GPS信息、第二电子设备的蓝牙信息、第二电子设备的wifi信息、第二电子设备所处的自然环境信息。第二电子设备的蓝牙信息,是第二电子设备所发出的蓝牙连接的蓝牙信息。第二电子设备的wifi信息,是第二电子设备所连接的无线局域网络的信息。第二电子设备所处的自然环境信息,包括但不限于以下信息:环境噪音信息、环境光照信息、环境湿度信息、环境温度信息。
602、根据第二场景信息和预设的二维码数据,生成并显示二维码信息,其中,二维码信息用于第一电子设备获取后在确定第一场景信息和第二场景信息符合预设条件时,对二维码数据进行预设处理,第一场景信息为与第一电子设备相关的场景信息。
一个示例中,第一场景信息包括以下的至少一种:GPS信息、wifi信息、蓝牙信息、自然环境信息;第二场景信息包括以下的至少一种:GPS信息、wifi信息、蓝牙信息、自然环境信息。
一个示例中,在第一场景信息为GPS信息,第二场景信息为GPS信息时,预设条件为第一场景信息与第二场景信息均属于预设地理范围。
在第一场景信息为wifi信息,第二场景信息为wifi信息时,预设条件为第二场景信息所表征的wifi标识,存在于第一场景信息所表征的wifi列表中。
在第一场景信息为蓝牙信息,第二场景信息为蓝牙信息时,预设条件为第二场景信息所表征的蓝牙标识,存在于第一场景信息所表征的蓝牙列表中。
在第一场景信息为自然环境信息,第二场景信息为自然环境信息时,预设条件为第一场景信息与第二场景信息均属于预设数值范围。
示例性地,第二电子设备获取二维码数据;二维码数据表征了与第二电子设备对 应的用户的用户信息。然后,第二电子设备根据第二场景信息和二维码数据,生成二维码信息;从而,二维码信息中携带有与第二电子设备相关的场景信息、二维码数据。
一个示例中,第二电子设备可以根据预存的二维码数据和所获取到的第二场景信息,生成二维码信息。
一个示例中,第二电子设备可以从网络设备中获取二维码数据;然后,根据二维码数据和所获取到的第二场景信息,生成二维码信息。
一个示例中,在支付场景中,二维码数据包括但不限于作为收款方的用户的用户信息;或者,在支付场景中,二维码数据包括但不限于作为支付方的用户的用户信息。在加好友的场景中,二维码数据包括但不限于用户信息、用户标识。
第二电子设备显示二维码信息,然后,第一电子设备可以扫描第二电子设备所显示的二维码。
由于第二电子设备所生成的二维码信息中加入了第二场景信息,第一电子设备在对扫描到的二维码信息进行解析之后,可以得到二维码数据和第二场景信息。
在第一电子设备获取到二维码信息之后,第一电子设备还可以获取与第一电子设备相关的场景信息;将与第一电子设备相关的场景信息,称为第一场景信息。
一个示例中,第一场景信息包括但不限于以下信息:第一电子设备的GPS信息、第一电子设备的蓝牙信息、第一电子设备的wifi信息、第一电子设备所处的自然环境信息。第一电子设备的蓝牙信息,是第一电子设备所发出的蓝牙连接的蓝牙信息。第一电子设备的wifi信息,是第一电子设备所连接的无线局域网络的信息。第一电子设备所处的自然环境信息,包括但不限于以下信息:环境噪音信息、环境光照信息、环境湿度信息、环境温度信息。
由于第二电子设备所生成的二维码信息中加入了第二场景信息,第一电子设备在对扫描到的二维码信息进行解析之后,可以得到二维码数据和第二场景信息。第一电子设备可以对第一场景信息和第二场景信息进行验证,进而判断第一场景信息和第二场景信息,是否符合预设条件。
第一电子设备在确定第一场景信息和第二场景信息符合预设条件时,就可以对获取到二维码数据进行预设处理。预设处理包括但不限于:向二维码数据表征的收款方进行转账处理、向二维码数据表征的付款方进行是扣费处理、向二维码数据表征的用户发出预设请求;预设请求,例如是加好友的请求。第一电子设备的动作,可以参见上述实施例,不再赘述。
本实施例,通过第二电子设备获取第二场景信息,其中,第二场景信息为与第二电子设备相关的场景信息;第二电子设备根据第二场景信息和预设的二维码数据,生成并显示二维码信息,其中,二维码信息用于第一电子设备获取后在确定第一场景信息和第二场景信息符合预设条件时,对二维码数据进行预设处理,第一场景信息为与第一电子设备相关的场景信息。第二电子设备在需要生成二维码的时候,第二电子设备可以获取与第二电子设备相关的第二场景信息;第二电子设备将第二场景信息,加入到二维码中;进而,第二电子设备所显示的二维码中携带有与第二电子设备相关的第二场景信息;第一电子设备对二维码进行扫描,得到第二场景信息,第一电子设备还可以获取第一电子设备相关的第一场景信息;第一电子设备将与第一电子设备相关 的第一场景信息、与第二电子设备相关的第二场景信息,两者进行比对,以确定两者是否匹配;若确定匹配,则第一电子设备可以确定所扫描到的二维码是第二电子设备所生成的,二维码不是其他恶意设备所发出的;然后,第一电子设备就可以对扫描到的二维码进行处理了。可以基于场景信息对二维码进行自动验证,比对两个需要进行二维码交互的电子设备的场景信息,进而对二维码完成验证;可以有效的保证所扫描到的二维码不是被恶意攻击的二维码,可以识别出恶意二维码;从而保证用户的财产安全。
图15为本申请实施例提供的其他又一种二维码处理方法的流程示意图。图15所示的实施例,该方法应用于第二电子设备;第二电子设备的***中部署有REE;该方法包括:
701、基于REE,获取第二场景信息,其中,第二场景信息为与第二电子设备相关的场景信息。
示例性地,第二电子设备可以是移动终端设备,可以是具有POS机功能的终端设备,可以是云闸机;或者,第二电子设备可以是其他可以执行本实例方案的装置或设备。
本实施例中,第一电子设备可以采用REE***完成各个步骤,或者,第一电子设备可以采用TEE***完成各个步骤,或者,第一电子设备可以采用其他操作***完成各个步骤,本实施例对于第一电子设备所基于的架构和***,不做限制。
在第二电子设备的***中可以部署REE***。REE***可以包括以下几种运行模式:用户模式、内核模式、等等。
第二电子设备的REE***可以在用户模式或者内核模式下,获取第二场景信息。或者,第二电子设备中配置了其他运行***,第二电子设备的REE***与其他运行***之间进行交互,进而获取到第二场景信息。
第二场景信息为与第二电子设备相关的场景信息。
第一电子设备的动作可以参见图14所示步骤601,不再赘述。
702、根据第二场景信息和预设的二维码数据,生成并显示二维码信息,其中,二维码信息用于第一电子设备获取后在确定第一场景信息和第二场景信息符合预设条件时,对二维码数据进行预设处理,第一场景信息为与第一电子设备相关的场景信息。
示例性地,第二电子设备可以基于REE***,生成并显示二维码信息的过程。具体过程,可以参见图14所示的步骤602,不再赘述。
本实施例,通过第二电子设备可以基于REE获取到与第二电子设备相关的第二场景信息;第二电子设备将第二场景信息,加入到二维码中;进而,第二电子设备所显示的二维码中携带有与第二电子设备相关的第二场景信息;第一电子设备对二维码进行扫描,得到第二场景信息,第一电子设备还可以获取第一电子设备相关的第一场景信息;第一电子设备将与第一电子设备相关的第一场景信息、与第二电子设备相关的第二场景信息,两者进行比对,以确定两者是否匹配;若确定匹配,则第一电子设备可以确定所扫描到的二维码是第二电子设备所生成的,二维码不是其他恶意设备所发出的;然后,第一电子设备就可以对扫描到的二维码进行处理了。可以基于场景信息 对二维码进行自动验证,比对两个需要进行二维码交互的电子设备的场景信息,进而对二维码完成验证;可以有效的保证所扫描到的二维码不是被恶意攻击的二维码,可以识别出恶意二维码;从而保证用户的财产安全。
图16为本申请实施例提供的其他再一种二维码处理方法的流程示意图。图16所示的实施例,该方法应用于第二电子设备;第二电子设备的***中部署有REE,第二电子设备中设置有第二场景器件;该方法包括:
801、接收触发指令,其中,触发指令用于指示生成二维码信息。
示例性地,第二电子设备可以是移动终端设备,可以是具有POS机功能的终端设备,可以是云闸机;或者,第二电子设备可以是其他可以执行本实例方案的装置或设备。
本实施例中,第一电子设备可以采用REE***完成各个步骤,或者,第一电子设备可以采用TEE***完成各个步骤,或者,第一电子设备可以采用其他操作***完成各个步骤,本实施例对于第一电子设备所基于的架构和***,不做限制。
在第二电子设备的***中可以部署REE***。REE***可以包括以下几种运行模式:用户模式、内核模式、等等。
用户可以通过触控、语音、手势等方式向第二电子设备发出触发指令,触发指令用于指示第二电子设备生成二维码信息。
第二电子设备的REE在用户模式或内核模式下接收到触发指令。
802、基于REE向第二场景器件发送第一请求消息,其中,第一请求消息用于指示获取第二场景器件所检测的第二场景信息,第二场景信息为与第二电子设备相关的场景信息。
示例性地,第二电子设备的REE***可以在用户模式或者内核模式下,获取第二场景信息。第二场景信息为与第二电子设备相关的场景信息。
可以在第二电子设备中配置第二场景器件。示例性地,第二场景器件是GPS芯片,则第二场景信息为GPS信息。第二场景器件是wifi模块,则第二场景信息为wifi信息。第二场景器件是蓝牙芯片,则第二场景信息为蓝牙信息。第二场景器件是温度传感器,则第二场景信息为环境温度信息。第二场景器件是声音传感器,则第二场景信息为环境噪音信息。第二场景器件是光敏传感器,则第二场景信息为环境光照信息。
第二电子设备的REE***与第二场景器件之间是可以直接交互的,第二电子设备的REE***可以获取到第二场景器件所检测到第二场景信息。
从而,第二电子设备的REE***可以直接向第二场景器件发送指令,以获取第二场景信息。一个示例中,第二电子设备的REE***向第二场景器件发送第一请求消息;然后,第二场景器件将所检测得到的第二场景信息,发送给第二电子设备的REE***。
803、基于REE接收第二场景器件发送的第二场景信息。
示例性地,参见步骤802,第二电子设备的REE***可以接收到第二场景器件返回的第二场景信息。在步骤802之后执行步骤803。
804、根据第二场景信息和预设的二维码数据,生成并显示二维码信息,其中,二维码信息用于第一电子设备获取后在确定第一场景信息和第二场景信息符合预设条件 时,对二维码数据进行预设处理,第一场景信息为与第一电子设备相关的场景信息。
示例性地,第二电子设备的REE***在用户模式或者内核模式下,根据第二场景信息和二维码数据,生成并显示二维码信息。
然后,第一电子设备可以扫描第二电子设备所显示的二维码信息。第一电子设备的动作可以参见图14所示的步骤602,不再赘述。
本实施例,通过第二电子设备在REE***侧执行各步骤,即,在REE环境下完成第二场景信息的获取,生成携带有第二场景信息的二维码;从而第一电子设备可以基于场景信息对二维码进行自动验证,比对两个需要进行二维码交互的电子设备的场景信息,进而对二维码完成验证;可以有效的保证所扫描到的二维码不是被恶意攻击的二维码,可以识别出恶意二维码;从而保证用户的财产安全。处理过程简单、快速。
图17为本申请实施例提供的又有一种二维码处理方法的流程示意图。图17所示的实施例,该方法应用于第二电子设备;第二电子设备的***中部署有REE和TEE,第二电子设备中设置有第二场景器件;该方法包括:
901、接收触发指令,其中,触发指令用于指示生成二维码信息。
示例性地,第二电子设备可以是移动终端设备,可以是具有POS机功能的终端设备,可以是云闸机;或者,第二电子设备可以是其他可以执行本实例方案的装置或设备。
本实施例中,第一电子设备可以采用REE***完成各个步骤,或者,第一电子设备可以采用TEE***完成各个步骤,或者,第一电子设备可以采用其他操作***完成各个步骤,本实施例对于第一电子设备所基于的架构和***,不做限制。
本实施例中,可以在第二电子设备的***中部署REE***和TEE***。图18为本申请实施例提供第二电子设备的***部署示意图。如图18所示,第二电子设备中部署REE***和TEE***。第二电子设备的REE侧,包括了以下几层架构:用户模式(user mode,USR)、内核模式(kernel mode,SVC)、Hypervisor模式(hypervisor mode,HYP)。第二电子设备的TEE侧,包括了以下几层架构:用户模式(user mode,USR)、内核模式(kernel mode,SVC)、监控模式(monitor mode,MON)。
第二电子设备的REE的用户模式下可以运行多个应用程序,应用程序可以接收到用户发出的触发指令,其中,触发指令用于指示生成二维码信息。
902、基于REE向TEE发送第二请求消息,其中,第二请求消息用于指示获取第二场景信息。
一个示例中,第二请求消息为基于REE所检测到的触发指令,或者,第二请求消息包括触发指令;触发指令用于指示生成二维码信息。
示例性地,第二电子设备的REE的应用程序,通过SMC指令进入第二电子设备的TEE中。第二电子设备的REE向第二电子设备的TEE,发送第二请求消息,用于请求获取与第二电子设备相关的第二场景信息。
903、基于REE接收TEE返回的第二场景信息,其中,第二场景信息是TEE从第二场景器件中所获取到的。
一个示例中,第二场景信息是TEE将第二场景器件设置为预设配置之后所获取的, 预设配置表征第二场景器件的第二场景信息只可被TEE所获取。
一个示例中,第二场景信息为TEE采用公钥进行过签名处理的场景信息。
示例性地,第二电子设备中配置有第二场景器件,第二场景器件可以检测第二电子设备的当前的第二场景信息;第二电子设备的TEE可以读取第二场景器件所检测到的第二场景信息。
一个示例中,第二电子设备的TEE的TA,向TEE内核发送请求指令,请求指令用于指示获取第二场景信息。第二电子设备的TEE的TA就可以基于TEE内核,获取到第二场景信息。
一个示例中,第二电子设备中的第二场景器件可以采集第二场景信息,在第二电子设备的TEE的内核读取第二场景信息之前,第二电子设备的TEE需要将第二场景器件配置为只有TEE可以读取。这是由于第二场景器件,可以被第二电子设备的REE和TEE所读取;但是,REE是非安全世界,若REE读取第二场景器件所检测的信息,有可能会出现REE被恶意攻击的情况,会导致REE所读取的第二场景信息被恶意篡改了;TEE是安全世界,需要将第二场景器件配置为只有TEE可以读取,那么TEE读取第二场景器件所检测的信息,会出现TEE被恶意攻击的情况,TEE所读取的第二场景信息不会被恶意篡改,保证了第二场景信息的准确性和安全性。此时,第二电子设备的TEE的内核,对第二场景器件设置为预设配置;预设配置表征第二场景器件所检测到的第二场景信息,只可被第二电子设备的TEE所获取。
进而,一个示例中,第二电子设备的TEE的内核,将第二场景器件设置为只有TEE可以访问;第二电子设备的TEE的内核,读取第二场景器件所检测到的第二场景信息。
并且,第二电子设备为了保证所读取的第二场景信息,不被第二电子设备中的恶意应用程序攻击或篡改,第二电子设备的TEE的内核,还可以采用公钥对第二场景信息进行签名处理,得到签名后的第二场景信息。第二电子设备的TEE的内核将签名后的第二场景信息,发送给第二电子设备的TEE的TA。第二电子设备的TEE的TA通过***内核,将签名后的第二场景信息发送给第二电子设备的REE的应用程序。
进而第二电子设备的REE,接收到第二电子设备的TEE所发出的第二场景信息。
904、基于REE采用私钥对第二场景信息进行校验,得到校验结果,其中,校验结果表征第二场景信息通过校验。
示例性地,第二电子设备的REE接收到第二场景信息之后,需要验证信息的来源。第二电子设备的REE,采用与公钥对应私钥对签名后的第二场景信息进行签名、校验,得到校验结果。
905、基于REE根据第二场景信息和二维码数据,生成待处理数据,其中,待处理数据为包括第二场景信息的二维码数据。
示例性地,第二电子设备的REE在确定校验结果表征第二场景信息通过验证之后,第二电子设备的REE根据第二场景信息和二维码数据,生成待处理数据,进而将第二场景信息加入到二维码数据中。即,待处理数据中为包括第二场景信息的二维码数据。
906、基于REE对待处理数据进行加密,得到加密后的待处理数据。
示例性地,第二电子设备的REE对待处理数据进行加密。本实施例中,对于加密 的方法,不做限定。
907、基于REE将待处理数据发送给TEE,其中,待处理数据用于TEE生成并显示二维码信息。
示例性地,第二电子设备的REE,再通过SMC指令将加密后的待处理数据,通过***内核发送给第二电子设备的TEE的TA。
第二电子设备的TEE的TA对加密后的待处理数据进行解密。然后,第二电子设备的TEE的TA在用户与设备交互的可信界面(Trusted User Interface,TUI)中,对携带有第二场景信息的二维码数据进行绘制,得到二维码信息;第二电子设备的TEE显示二维码信息,即,第二电子设备的TEE显示一个二维码界面。
然后,第一电子设备扫描第二电子设备显示的二维码信息,第一电子设备就可以解析出第二场景信息;第一电子设备获取与第一电子设备相关的第一场景信息;第一电子设备可以对第一场景信息和第二场景信息进行验证,进而判断第一场景信息和第二场景信息,是否符合预设条件。第一电子设备在确定第一场景信息和第二场景信息符合预设条件时,就可以对获取到二维码数据进行预设处理。
第一电子设备的动作,可以参见上述实施例,不再赘述。
一个示例中,图19为本申请实施例提供第二电子设备的REE与TEE的交互图,如图19所示,第二电子设备的REE侧的用户模式下,运行了多个应用程序(application,APP);第二电子设备的REE的应用程序,接收用户的触发指令,触发指令用于指示生成二维码信息。然后,步骤1、第二电子设备的REE的应用程序,通过SMC指令进入第二电子设备的TEE中。步骤2、第二电子设备的TEE的TA向TEE内核发送请求指令,请求指令用于指示获取第二场景信息。步骤3、第二电子设备的TEE的内核将第二场景器件设置为只有TEE可以访问。步骤4、第二电子设备的TEE的内核读取第二场景器件所检测到的第二场景信息。步骤5、第二电子设备的TEE的内核采用公钥对第二场景信息进行签名;第二电子设备的TEE的内核将签名后的第二场景信息,发送给TEE的TA。步骤6、第二电子设备的TEE的TA通过***内核,将签名后的第二场景信息发送给REE的应用程序。步骤7、第二电子设备的REE的应用程序采用私钥对签名后的第二场景信息进行验证;第二电子设备的REE的应用程序在确定第二场景信息通过验证之后,根据第二场景信息和二维码数据,生成待处理数据,待处理数据中为包括第二场景信息的二维码数据;并且,第二电子设备的REE的应用程序对待处理数据进行加密,将加密后的待处理数据,通过***内核发送给第二电子设备的TEE的TA。最后,第二电子设备的TEE的TA对加密后的待处理数据进行解密,根据待处理数据,在TUI中绘制并显示二维码信息。
本实施例,通过第二电子设备的REE向第二电子设备的TEE发送第二请求消息,其中,第二请求消息用于指示获取第二场景信息;第二电子设备的REE接收第二电子设备的TEE返回的第二场景信息,其中,第二场景信息是第二电子设备的TEE从第二场景器件中所获取到的。从而,由于TEE是安全世界,第二电子设备的TEE所获取的第二场景信息是较为安全的;进一步的,在第二电子设备的TEE读取第二场景器件所检测的第二场景信息之前,第二电子设备的TEE将第二场景器件设置为只可被TEE读取,从而保证了第二电子设备所检测到的第二场景信息不会被REE环境下的恶 意应用程序所篡改,保证了第二场景信息的安全性。第二电子设备的TEE还可以对第二场景信息进行签名,保证将第二场景信息传递给第二电子设备的REE的时候,第二场景信息不被篡改。第二电子设备的REE根据第二场景信息和二维码数据,生成包括第二场景信息的二维码数据,第二电子设备的REE将包括第二场景信息的二维码数据,发送给第二电子设备的TEE;第二电子设备的TEE在TUI中绘制并显示二维码界面;由于TEE的安全性很高,在TEE中绘制并显示二维码界面,进一步的保证了第二场景信息和二维码数据,不会被恶意设备或者恶意应用程序所攻击或篡改,保证了第二场景信息和二维码数据的安全性。
图20为本申请实施例提供的另有一种二维码处理方法的流程示意图。图20所示的实施例,该方法包括:
1001、第二电子设备的REE接收触发指令,其中,触发指令用于指示生成二维码信息。
示例性地,第二电子设备可以是移动终端设备,可以是具有POS机功能的终端设备,可以是云闸机;或者,第二电子设备可以是其他可以执行本实例方案的装置或设备。
可以在第二电子设备的***中部署REE***和TEE***。
本步骤可以参见图17的步骤901,不再赘述。
1002、第二电子设备的REE向第二电子设备的TEE发送第二请求消息,其中,第二请求消息用于指示获取第二场景信息。
一个示例中,第二请求消息为基于REE所检测到的触发指令,或者,第二请求消息包括触发指令;触发指令用于指示生成二维码信息。
示例性地,本步骤可以参见图17的步骤902,不再赘述。
1003、第二电子设备的REE接收第二电子设备的TEE返回的第二场景信息,其中,第二场景信息是TEE从第二场景器件中所获取到的。
一个示例中,第二场景信息是TEE将第二场景器件设置为预设配置之后所获取的,预设配置表征第二场景器件的第二场景信息只可被TEE所获取。
一个示例中,第二场景信息为TEE采用公钥进行过签名处理的场景信息。
示例性地,本步骤可以参见图17的步骤903,不再赘述。
1004、第二电子设备的REE采用私钥对第二场景信息进行校验,得到校验结果,其中,校验结果表征第二场景信息通过校验。
示例性地,本步骤可以参见图17的步骤904,不再赘述。
1005、第二电子设备的REE根据第二场景信息和二维码数据,生成待处理数据,其中,待处理数据为包括第二场景信息的二维码数据。
示例性地,本步骤可以参见图17的步骤905,不再赘述。
1006、第二电子设备的REE对待处理数据进行加密,得到加密后的待处理数据。
示例性地,本步骤可以参见图17的步骤906,不再赘述。
1007、第二电子设备的REE将待处理数据发送给第二电子设备的TEE,其中,待处理数据用于第二电子设备的TEE生成并显示二维码信息。
示例性地,本步骤可以参见图17的步骤907,不再赘述。
1008、第一电子设备的REE获取第二电子设备显示的二维码信息。
示例性地,第一电子设备可以是移动终端设备,可以是具有POS机功能的终端设备,可以是云闸机;或者,第一电子设备可以是其他可以执行本实例方案的装置或设备。
可以在第一电子设备的***中部署REE***和TEE***。本步骤可以参见图9的步骤501,不再赘述。
1009、第一电子设备的REE根据二维码信息,确定二维码数据和第二场景信息,其中,第二场景信息为与第二电子设备相关的场景信息。
示例性地,本步骤可以参见图9的步骤502,不再赘述。
1010、第一电子设备的REE采用公钥对第二场景信息进行签名处理,得到签名后的第二场景信息。
示例性地,本步骤可以参见图9的步骤503,不再赘述。
1011、第一电子设备的REE向第一电子设备的TEE发送第二请求消息,其中,第二请求消息用于指示获取第一场景信息。第一场景信息为与第一电子设备相关的场景信息。
一个示例中,第二请求消息包括第二场景信息,或者,第二请求信息用于指示第二场景信息。
示例性地,本步骤可以参见图9的步骤504,不再赘述。
1012、第一电子设备的REE接收第一电子设备的TEE返回的返回消息,其中返回消息用于指示第一场景信息,其中,第一场景信息是第一电子设备的TEE从第一场景器件中所获取到的。
一个示例中,返回消息为验证结果;步骤505具体包括:基于第一电子设备的REE接收第一电子设备的TEE返回的验证结果,其中,验证结果为第一电子设备的TEE对第一场景信息和第二场景信息进行比较之后生成,验证结果表征第一场景信息和第二场景信息符合预设条件。
一个示例中,第一场景信息是第一电子设备的TEE采用私钥确定签名后的第二场景信息通过验证之后所获取的。
一个示例中,第一场景信息是第一电子设备的TEE将第一场景器件设置为预设配置之后所获取的,预设配置表征第一场景信息只可被第一电子设备的TEE所获取。
示例性地,本步骤可以参见图9的步骤505,不再赘述。
1013、第一电子设备的REE在确定第一场景信息和第二场景信息符合预设条件时,对二维码数据进行预设处理。
示例性地,本步骤可以参见图9的步骤506,不再赘述。
本实施例提供的方案,可以抵御共谋攻击。共谋攻击,指的是,二维码生成端和二维码扫码端上同时被安装了恶意应用程序,进而二维码生成端中的恶意应用程序对二维码的生成过程进行恶意攻击,二维码扫码端中的恶意应用程序对二维码的扫码过程进行恶意攻击。
一个示例中,二维码生成端中的恶意应用程序可以生成恶意二维码,恶意二维码 中包括了攻击者收款二维码数据和攻击者所处的场景信息。需要注意的是,在二维码生成端的场景信息是由二维码生成端的TEE获取的时候,恶意应用程序是无法伪造二维码生成端的正确场景信息的,进而,恶意应用程序无法伪造带有攻击者二维码数据和二维码生成端的正确场景信息的二维码。二维码生成端的恶意应用程序显示恶意二维码;并且,二维码生成端的恶意应用程序可以将攻击者所处的场景信息,发送给二维码扫码端的恶意应用程序。
然后,二维码扫码端的恶意应用程序可以获取到恶意二维码中的攻击者所处的场景信息,进而,二维码扫码端的恶意应用程序可以将二维码扫码端所获取的二维码扫码端的场景信息,进行恶意篡改,可以将二维码扫码端的场景信息,替换为攻击者所处的场景信息;进而,二维码扫码端的正常应用程序就获取到了恶意的场景信息,即,获取到了攻击者所处的场景信息。从而,在二维码扫码端在扫码二维码生成端所显示的恶意二维码之后,由于恶意二维码中包括了攻击者所处的场景信息;此时,二维码扫码端的正常应用程序也获取到了恶意的场景信息,进而,二维码扫码端的正常应用程序比对获取到的恶意的场景信息、恶意二维码中的恶意的场景信息,两者是一致;然后,二维码扫码端的正常应用程序对二维码数据进行处理,例如,进行支付处理。可知,场景信息的比对就被绕过了;攻击者对二维码的处理过程进行了攻击,可以获取到用户的财产信息。
但是,上述共谋攻击的过程,首先,二维码生成端和二维码扫码端需要同时被安装恶意应用程序;其次,二维码生成端中的恶意应用程序与二维码扫码端中的恶意应用程序,两者需要进行共谋,即,进行消息的传递,二维码生成端中的恶意应用程序需要将攻击者所处的场景信息,发送给二维码扫码端中的恶意应用程序;二维码扫码端的恶意应用场景还需要具有修改场景信息的权限。从而,、共谋攻击的过程是复杂的,实现是困难的。
本实施例,第二电子设备的TEE将第二场景器件设置为只可被TEE读取,第二电子设备的TEE获取与第二电子设备相关的第二场景信息;保证了第二电子设备所检测到的第二场景信息不会被REE环境下的恶意应用程序所篡改,保证了第二场景信息的安全性。第二电子设备的REE根据第二场景信息和二维码数据,生成包括第二场景信息的二维码数据,第二电子设备的REE将包括第二场景信息的二维码数据,发送给第二电子设备的TEE;第二电子设备的TEE在TUI中绘制并显示二维码界面;由于TEE的安全性很高,在TEE中绘制并显示二维码界面,进一步的保证了第二场景信息和二维码数据,不会被恶意设备或者恶意应用程序所攻击或篡改,保证了第二场景信息和二维码数据的安全性。然后,第一电子设备的REE扫描第二电子设备显示的二维码信息;第一电子设备的TEE将第一场景器件设置为只可被TEE读取,第一电子设备的TEE获取与第一电子设备相关的第一场景信息;进而保证了第一电子设备所检测到的第一场景信息不会被REE环境下的恶意应用程序所篡改,保证了第一场景信息的安全性。第一电子设备的TEE对第一场景信息和第二场景信息进行验证,由于TEE是安全世界,保证第一场景信息和第二场景信息不会被篡改。第一电子设备的REE在确定验证结果表征为第二场景信息通过验证之后,对二维码进行预设处理。可以基于场景信息对二维码进行自动验证,可以基于场景信息保证所扫描到的二维码不是被恶 意攻击的二维码,可以识别出恶意二维码;从而保证用户的财产安全。本实施例提供的方式中,做为二维码生成端的第二电子设备、做为二维码扫码端的第一电子设备都使用TEE来获取动态的场景数据(各自的场景信息),可以保证场景信息的有效性、安全性;增强整个流程的安全性,高校的抵御高权限、共谋的恶意攻击。
图21为本申请实施例提供的再有一种二维码处理方法的流程示意图。图21所示的实施例,该方法包括:
1101、第二电子设备的REE接收触发指令,其中,触发指令用于指示生成二维码信息。
示例性地,第二电子设备可以是移动终端设备,可以是具有POS机功能的终端设备,可以是云闸机;或者,第二电子设备可以是其他可以执行本实例方案的装置或设备。
可以在第二电子设备的***中部署REE***和TEE***。第二电子设备中配置有第二场景器件。
本步骤可以参见图17的步骤901,不再赘述。
1102、第二电子设备的REE向第二电子设备的TEE发送第二请求消息,其中,第二请求消息用于指示获取第二场景信息。
一个示例中,第二请求消息为基于REE所检测到的触发指令,或者,第二请求消息包括触发指令;触发指令用于指示生成二维码信息。
示例性地,本步骤可以参见图17的步骤902,不再赘述。
1103、第二电子设备的REE接收第二电子设备的TEE返回的第二场景信息,其中,第二场景信息是TEE从第二场景器件中所获取到的。
一个示例中,第二场景信息是TEE将第二场景器件设置为预设配置之后所获取的,预设配置表征第二场景器件的第二场景信息只可被TEE所获取。
一个示例中,第二场景信息为TEE采用公钥进行过签名处理的场景信息。
示例性地,本步骤可以参见图17的步骤903,不再赘述。
1104、第二电子设备的REE采用私钥对第二场景信息进行校验,得到校验结果,其中,校验结果表征第二场景信息通过校验。
示例性地,本步骤可以参见图17的步骤904,不再赘述。
1105、第二电子设备的REE根据第二场景信息和二维码数据,生成待处理数据,其中,待处理数据为包括第二场景信息的二维码数据。
示例性地,本步骤可以参见图17的步骤905,不再赘述。
1106、第二电子设备的REE对待处理数据进行加密,得到加密后的待处理数据。
示例性地,本步骤可以参见图17的步骤906,不再赘述。
1107、第二电子设备的REE将待处理数据发送给第二电子设备的TEE,其中,待处理数据用于第二电子设备的TEE生成并显示二维码信息。
示例性地,本步骤可以参见图17的步骤907,不再赘述。
1108、第一电子设备的REE扫描第二电子设备显示的二维码信息。
示例性地,在第一电子设备的***中可以部署REE***;第一电子设备中配置有 第一场景器件。
。本步骤可以参见图8的步骤401,不再赘述。
1109、第一电子设备的REE向第一场景器件发送第一请求消息,其中,第一请求消息用于指示获取第一场景器件所检测得到的第一场景信息;第一场景信息为与第一电子设备相关的场景信息。
示例性地,本步骤可以参见图8的步骤402,不再赘述。
1110、第一电子设备的REE接收第一场景器件发送的第一场景信息。
示例性地,本步骤可以参见图8的步骤403,不再赘述。
1111、第一电子设备的REE根据二维码信息,确定二维码数据和第二场景信息,其中,第二场景信息为与第二电子设备相关的场景信息。
示例性地,本步骤可以参见图8的步骤404,不再赘述。
1112、第一电子设备的REE在确定第一场景信息和第二场景信息符合预设条件时,对二维码数据进行预设处理。
示例性地,本步骤可以参见图8的步骤405,不再赘述。
本实施例,第二电子设备的TEE将第二场景器件设置为只可被TEE读取,第二电子设备的TEE获取与第二电子设备相关的第二场景信息;保证了第二电子设备所检测到的第二场景信息不会被REE环境下的恶意应用程序所篡改,保证了第二场景信息的安全性。第二电子设备的REE根据第二场景信息和二维码数据,生成包括第二场景信息的二维码数据,第二电子设备的REE将包括第二场景信息的二维码数据,发送给第二电子设备的TEE;第二电子设备的TEE在TUI中绘制并显示二维码界面;由于TEE的安全性很高,在TEE中绘制并显示二维码界面,进一步的保证了第二场景信息和二维码数据,不会被恶意设备或者恶意应用程序所攻击或篡改,保证了第二场景信息和二维码数据的安全性。然后,第一电子设备的REE扫描第二电子设备显示的二维码信息;第一电子设备的REE获取第一场景信息;第一电子设备的REE对第一场景信息和第二场景信息进行验证,在第二场景信息通过验证之后,第一电子设备的REE对二维码进行预设处理。可以基于场景信息对二维码进行自动验证,可以基于场景信息保证所扫描到的二维码不是被恶意攻击的二维码,可以识别出恶意二维码;从而保证用户的财产安全。本实施例提供的方式中,做为二维码生成端的第二电子设备使用TEE来获取动态的场景数据,做为二维码扫码端的第一电子设备都使用REE来获取动态的场景数据;这一过程可以在一定程度上抵御恶意攻击。本实施例的方案,虽然做为二维码扫码端的第一电子设备在REE环境下,去获取第一场景信息,去验证场景信息,但是由于共谋攻击需要二维码生成端和二维码扫码端进行协商共谋、消息传递等,共谋攻击的过程较为复杂,本实施例的方案可以在一定程度上抵御共谋的恶意攻击。
图22为本申请实施例提供的其他有一种二维码处理方法的流程示意图。图22所示的实施例,该方法包括:
1201、第二电子设备的REE接收触发指令,其中,触发指令用于指示生成二维码信息。
示例性地,示例性地,第二电子设备可以是移动终端设备,可以是具有POS机功 能的终端设备,可以是云闸机;或者,第二电子设备可以是其他可以执行本实例方案的装置或设备。第二电子设备中配置有第二场景器件。
在第一电子设备的***中可以部署REE***。本步骤可以参见图16的步骤801,不再赘述。
1202、第二电子设备的REE向第二场景器件发送第一请求消息,其中,第一请求消息用于指示获取第二场景器件所检测的第二场景信息,第二场景信息为与第二电子设备相关的场景信息。
示例性地,本步骤可以参见图16的步骤802,不再赘述。
1203、第二电子设备的REE接收第二场景器件发送的第二场景信息。
示例性地,本步骤可以参见图16的步骤803,不再赘述。
1204、第二电子设备的REE根据第二场景信息和预设的二维码数据,生成并显示二维码信息。
示例性地,本步骤可以参见图16的步骤804,不再赘述。
1205、第一电子设备的REE扫描第二电子设备显示的二维码信息。
示例性地,在第一电子设备的***中可以部署REE***;第一电子设备中配置有第一场景器件。本步骤可以参见图8的步骤401,不再赘述。
1206、第一电子设备的REE向第一场景器件发送第一请求消息,其中,第一请求消息用于指示获取第一场景器件所检测得到的第一场景信息;第一场景信息为与第一电子设备相关的场景信息。
示例性地,本步骤可以参见图8的步骤402,不再赘述。
1207、第一电子设备的REE接收第一场景器件发送的第一场景信息。
示例性地,本步骤可以参见图8的步骤403,不再赘述。
1208、第一电子设备的REE根据二维码信息,确定二维码数据和第二场景信息,其中,第二场景信息为与第二电子设备相关的场景信息。
示例性地,本步骤可以参见图8的步骤404,不再赘述。
1209、第一电子设备的REE在确定第一场景信息和第二场景信息符合预设条件时,对二维码数据进行预设处理。
示例性地,本步骤可以参见图8的步骤405,不再赘述。
本实施例提供的方案可以基于场景信息,对二维码进行验证。但是依然存在被恶意攻击的可能性。攻击者只需要在二维码生成端安装恶意软件,就可以完成二维码的替换攻击。
一个示例中,二维码生成端的恶意应用程序,可以获取二维码生成端的场景数据;二维码生成端的恶意应用程序,可以将二维码生成端的场景数据发送给远端的攻击者设备;攻击者设备可以root攻击者设备,篡改二维码生成端中的场景数据;攻击者设备可以生成带有攻击者信息、二维码生成端的场景数据的恶意二维码。然后,当二维码生成端需要生成二维码的时候,攻击者设备可以将恶意二维码,替换到二维码生成端所生成的二维码。从而,本实施例对于这种情况,可能不能避免被恶意攻击。
本实施例,第二电子设备的REE获取与第二电子设备相关的第二场景信息;第二电子设备的REE生成并显示携带有第二场景信息的二维码;第一电子设备的REE扫 描第二电子设备显示的二维码信息;第一电子设备的REE获取第一场景信息;第一电子设备的REE对第一场景信息和第二场景信息进行验证,在第二场景信息通过验证之后,第一电子设备的REE对二维码进行预设处理。可以基于场景信息对二维码进行自动验证,可以基于场景信息保证所扫描到的二维码不是被恶意攻击的二维码,可以识别出恶意二维码;从而保证用户的财产安全。
进一步地,以上各实施例可以应用到各类场景中。
一个示例中,以上各实施例,可以应用到支付场景中。做为二维码生成端的第二电子设备,可以获取与第二电子设备相关的第二场景信息;做为二维码扫码端的第一电子设备,可以获取与第一电子设备相关的第一场景信息;第一电子设备对第一场景信息和第二场景信息,进行验证之后;第一电子设备对扫码到的二维码进行支付处理或者扣款处理。从而,在面对面扫码转账的过程中,可以基于场景信息对二维码支付过程进行验证,保证用户的财产安全。
举例来说,第一电子设备中可以按照有第三方支付软件;或者,第一电子设备具有POS机功能。
一个示例中,以上各实施例,可以应用到地铁出行场景中。地铁已经成为了人们出行的重要交通工具,用户可以扫码进行乘坐地铁。但是现在出现了换卡攻击的现象。换卡攻击,指的是:乘客A从站点1乘地铁去站点2,乘客B从站点2乘地铁去站点1,可知,乘客A和B都需要花费C元;乘客A的移动终端设备在站点1出示二维码1,站点1的云闸机扫码乘客A的移动终端设备的二维码1;乘客B的移动终端设备在站点2出示二维码2,站点2的云闸机扫码乘客B的移动终端设备的二维码2;但是,当地铁行驶至站点1和站点2之间的站点3的时候,乘客A和B同时下车,然后乘客A和乘客B交换各自的二维码,然后继续乘车;从而,乘客A的移动终端设备在站点2出示二维码2,站点2的云闸机扫码乘客A的移动终端设备的二维码2;乘客B的移动终端设备在站点1出示二维码1,站点1的云闸机扫码乘客B的移动终端设备的二维码1。由于,地铁的云闸机根据乘客的里程进行扣费,但是乘客A的移动终端设备所显示的二维码2,依然表征为站点2,站点2的云闸机对乘客A的移动终端设备扣费,会少于C元;乘客B的移动终端设备所显示的二维码1,依然表征为站点1,站点1的云闸机对乘客B的移动终端设备扣费,会少于C元。进而对地铁造成财产和经济损失。
在地铁出行场景中,可以采用以上实施例。图23为本申请实施例提供的还有一种二维码处理方法的流程示意图。图23所示的实施例,该方法包括:
1301、移动终端设备在进站位置上,接收到触发指令,触发指令用于指示生成二维码。
1302、移动终端设备获取移动终端设备的场景器件所检测的终端场景信息,终端场景信息与进站位置之间是相关的。
1303、移动终端设备根据终端场景信息和预设的二维码数据,生成并显示二维码。
1304、进站位置上的第一云闸机,扫码二维码,并确定运行移动终端设备进站。
1305、移动终端设备在出站位置上显示步骤3所生成的二维码。
1306、进站位置上的第二云闸机,扫码二维码。
1307、进站位置上的第二云闸机解析二维码,得到终端场景信息。
1308、进站位置上的第二云闸机确定终端场景信息与第二云闸机的场景信息,是否符合预设条件;其中,第二云闸机的场景信息,是固定不变的。
1309、若符合,则进站位置上的第二云闸机,对二维码进行扣费处理。
一个示例中,在地铁场景中,预设条件为终端场景信息与第二云闸机的场景信息,不一致。例如,场景信息为GPS信息,即,终端场景信息是移动终端设备在进站位置上所获取的GPS信息,第二云闸机的场景信息是做为出站位置的GPS信息;预设条件为终端场景信息与第二云闸机的场景信息,两者不属于同一地理范围。
再例如,场景信息为wifi信息,即,终端场景信息是移动终端设备在进站位置上所获取的wifi信息,第二云闸机的场景信息是做为出站位置的wifi信息;预设条件为终端场景信息与第二云闸机的场景信息,两者不同;或者,预设条件为终端场景信息表征的wifi标识,在第二云闸机的场景信息表征的wifi列表中。
再例如,场景信息为蓝牙信息,即,终端场景信息是移动终端设备在进站位置上所获取的蓝牙信息,第二云闸机的场景信息是做为出站位置的蓝牙信息;预设条件为终端场景信息与第二云闸机的场景信息,两者不同;或者,预设条件为终端场景信息表征的蓝牙标识,在第二云闸机的场景信息表征的蓝牙列表中。
再例如,场景信息为自然环境信息,即,终端场景信息是移动终端设备在进站位置上所获取的自然环境信息,第二云闸机的场景信息是做为出站位置的自然环境信息;预设条件为终端场景信息与第二云闸机的场景信息,两者不同。
举例来说,乘客A从站点1乘地铁去站点2。乘客A的移动终端可以做为二维码生成端,站点的云闸机可以做为二维码扫码端。乘客A在站点1进站,乘客A的移动终端在站点1的位置处,获取与移动终端对应的场景信息1;乘客A的移动终端根据与移动终端对应的场景信息1、二维码数据,生成并显示二维码。站点1的云闸机扫描乘客A的移动终端所显示的二维码,站点1的云闸机可以直接确认运行乘客A进站。乘客A在站点2出站,乘客A的移动终端显示在站点1上生成的二维码。站点2的云闸机扫码乘客A的移动终端显示的二维码。站点2的云闸机可以获取与站点2的云闸机对应的场景信息;与站点2的云闸机对应的场景信息,可以是运存在站点2的云闸机中的;由于站点2的云闸机的位置固定,从而,站点2的云闸机不需要动态的获取场景信息,可以直接调取预存的场景信息。站点2的云闸机解析出二维码中的场景信息,二维码中的场景信息为与移动终端对应的场景信息1,即,二维码中的场景信息为乘客A的移动终端在站点1的位置处所获取的。站点2的云闸机对二维码中的场景信息、与站点2的云闸机对应的场景信息,进行比对;在确定两者不一致时,站点2的云闸机对二维码进行扣费。
乘客B在站点2入站;乘客B的移动终端在站点2的位置处,获取与移动终端对应的场景信息2;乘客B的移动终端根据与移动终端对应的场景信息2、二维码数据,生成乘客B的二维码。乘客B的移动终端将乘客B的二维码,发送给乘客A的移动终端。乘客A在站点2出站的时候,若乘客A的移动终端获取的是乘客B的二维码, 乘客B的二维码中的场景信息,是站点2处所获取的场景信息;站点2的云闸机扫码到乘客B的二维码,可以解析出乘客B的二维码中的场景信息;站点2的云闸机将乘客B的二维码中的场景信息、与站点2的云闸机对应的场景信息,进行比对;站点2的云闸机可以确定两者是一致的,从而,站点2的云闸机可以确定二维码,被恶意换码了。进而抵御了地铁换码。
图24为本申请实施例提供的一种第一电子设备的结构示意图。如图24所示,第一电子设备包括:
第一获取单元241,用于获取第二电子设备显示的二维码信息。此时,第一获取单元241可以执行图4所示方法的步骤101;或者,第一获取单元241可以执行图5所示方法的步骤201;或者,第一获取单元241可以执行图7所示方法的步骤301。
第二获取单元242,用于获取第一场景信息。此时,第二获取单元242可以执行图4所示方法的步骤102;或者,第二获取单元242可以执行图5所示方法的步骤202;或者,第二获取单元242可以执行图7所示方法的步骤302。
确定单元243,用于根据二维码信息,确定二维码数据和第二场景信息,其中,第一场景信息为与第一电子设备相关的场景信息,第二场景信息为与第二电子设备相关的场景信息。此时,确定单元243可以执行图4所示方法的步骤103;或者,确定单元243可以执行图5所示方法的步骤203;或者,确定单元243可以执行图7所示方法的步骤303。
处理单元244,用于在确定第一场景信息和第二场景信息符合预设条件时,对二维码数据进行预设处理。此时,处理单元244可以执行图4所示方法的步骤104;或者,处理单元244可以执行图5所示方法的步骤204;或者,处理单元244可以执行图7所示方法的步骤304。
一个示例中,第一电子设备的***中部署有REE;第二获取单元242,具体用于:基于REE获取第一场景信息。此时,第二获取单元242可以执行图7所示方法的步骤302。
一个示例中,第一电子设备,还包括:提示单元245,用于在确定第一场景信息和第二场景信息不符合预设条件时,生成并显示提示信息。此时,提示单元245可以执行图5所示方法的步骤205。
一个示例中,确定单元243,具体用于:对二维码信息进行解密,得到二维码数据和第二场景信息。
一个示例中,第一场景信息包括以下的至少一种:全球定位***信息、无线局域网络信息、蓝牙信息、自然环境信息;第二场景信息包括以下的至少一种:全球定位***信息、无线局域网络信息、蓝牙信息、自然环境信息。
一个示例中,在第一场景信息为全球定位***信息,第二场景信息为全球定位***信息时,预设条件为第一场景信息与第二场景信息均属于预设地理范围。
在第一场景信息为无线局域网络信息,第二场景信息为无线局域网络信息时,预设条件为第二场景信息所表征的无线局域网络标识,存在于第一场景信息所表征的无线局域网络列表中。
在第一场景信息为蓝牙信息,第二场景信息为蓝牙信息时,预设条件为第二场景信息所表征的蓝牙标识,存在于第一场景信息所表征的蓝牙列表中。
在第一场景信息为自然环境信息,第二场景信息为自然环境信息时,预设条件为第一场景信息与第二场景信息均属于预设数值范围。
在本实施例中,图24所示实施例的第一电子设备可用于执行上述方法中图4-图5、图7-图9、图20-图22所示实施例的技术方案,其实现原理和技术效果类似,此处不再赘述。
图25为本申请实施例提供的另一种第一电子设备的结构示意图。在图24所示实施例的基础上,如图25所示,第一电子设备中,第一电子设备中设置有第一场景器件251;第二获取单元242,包括:
第一发送模块2421a,用于基于REE向第一场景器件251发送第一请求消息,其中,第一请求消息用于指示获取第一场景器件251所检测得到的第一场景信息。此时,第一发送模块2421a可以执行图8所示方法的步骤402。
第一接收模块2422a,用于基于REE接收第一场景器件发送的第一场景信息。此时,第一接收模块2422a可以执行图8所示方法的步骤403。
在本实施例中,图25所示实施例的第一电子设备可用于执行上述方法中图8所示实施例的技术方案,其实现原理和技术效果类似,此处不再赘述。
图26为本申请实施例提供的又一种第一电子设备的结构示意图。在图24所示实施例的基础上,如图26所示,第一电子设备中,第一电子设备中设置有第一场景器件261;第一电子设备的***中还部署有可信执行环境;第二获取单元242,包括:
第二发送模块2421b,用于基于REE向可信执行环境发送第二请求消息,其中,第二请求消息用于指示获取第一场景信息。此时,第二发送模块2421b可以执行图9所示方法的步骤504。
第二接收模块2422b,用于基于REE接收可信执行环境返回的返回消息,其中返回消息用于指示第一场景信息,其中,第一场景信息是可信执行环境从第一场景器件中所获取到的。此时,第二接收模块2422b可以执行图9所示方法的步骤505。
一个示例中,第二请求消息包括第二场景信息,或者,第二请求信息用于指示第二场景信息;返回消息为验证结果;第二接收模块2422b,具体用于:
基于REE接收可信执行环境返回的验证结果,其中,验证结果为可信执行环境对第一场景信息和第二场景信息进行比较之后生成,验证结果表征第一场景信息和第二场景信息符合预设条件。此时,第二接收模块2422b可以执行图9所示方法的步骤505。
一个示例中,第二获取单元242,还包括:
签名模块2423b,用于在第二发送模块2421b基于REE向可信执行环境发送第二请求消息之前,采用公钥对第二场景信息进行签名处理,得到签名后的第二场景信息;第一场景信息是可信执行环境采用私钥确定签名后的第二场景信息通过验证之后所获取的。此时,签名模块2423b可以执行图9所示方法的步骤503。
一个示例中,第一场景信息是可信执行环境将第一场景器件设置为预设配置之后 所获取的,预设配置表征第一场景信息只可被可信执行环境所获取。
在本实施例中,图26所示实施例的第一电子设备可用于执行上述方法中图9所示实施例的技术方案,其实现原理和技术效果类似,此处不再赘述。
图27为本申请实施例提供的一种第二电子设备的结构示意图。如图27所示,第二电子设备,包括:
获取单元271,用于获取第二场景信息,其中,第二场景信息为与第二电子设备相关的场景信息。此时,获取单元271可以执行图14所示方法的步骤601;或者,获取单元271可以执行图15所示方法的步骤701。
生成单元272,用于根据第二场景信息和预设的二维码数据,生成显示二维码信息。此时,生成单元272可以执行图14所示方法的步骤602;或者,生成单元272可以执行图15所示方法的步骤702;或者,生成单元272可以执行图16所示方法的步骤804。
显示单元273,用于显示二维码信息,其中,二维码信息用于第一电子设备获取后在确定第一场景信息和第二场景信息符合预设条件时,对二维码数据进行预设处理,第一场景信息为与第一电子设备相关的场景信息。此时,显示单元273可以执行图14所示方法的步骤602;或者,显示单元273可以执行图15所示方法的步骤702;或者,显示单元273可以执行图16所示方法的步骤804。
一个示例中,第二电子设备的***中部署有REE;获取单元271,具体用于:基于REE,获取第二场景信息。此时,获取单元271可以执行图15所示方法的步骤701。
一个示例中,第一场景信息包括以下的至少一种:全球定位***信息、无线局域网络信息、蓝牙信息、自然环境信息;第二场景信息包括以下的至少一种:全球定位***信息、无线局域网络信息、蓝牙信息、自然环境信息。
一个示例中,在第一场景信息为全球定位***信息,第二场景信息为全球定位***信息时,预设条件为第一场景信息与第二场景信息均属于预设地理范围。
在第一场景信息为无线局域网络信息,第二场景信息为无线局域网络信息时,预设条件为第二场景信息所表征的无线局域网络标识,存在于第一场景信息所表征的无线局域网络列表中。
在第一场景信息为蓝牙信息,第二场景信息为蓝牙信息时,预设条件为第二场景信息所表征的蓝牙标识,存在于第一场景信息所表征的蓝牙列表中。
在第一场景信息为自然环境信息,第二场景信息为自然环境信息时,预设条件为第一场景信息与第二场景信息均属于预设数值范围。
在本实施例中,图27所示实施例的第二电子设备可用于执行上述方法中图14-图17、图20-图22所示实施例的技术方案,其实现原理和技术效果类似,此处不再赘述。
图28为本申请实施例提供的另一种第二电子设备的结构示意图。在图27所示实施例的基础上,如图28所示,第二电子设备中设置有第二场景器件281;获取单元271,包括:
第一发送模块2711a,用于基于REE向第二场景器件281发送第一请求消息,其 中,第一请求消息用于指示获取第二场景器件281所检测的第二场景信息。此时,第一发送模块2711a可以执行图16所示方法的步骤802。
第一接收模块2712b,用于基于REE接收第二场景器件281发送的第二场景信息。此时,第一接收模块2712b可以执行图16所示方法的步骤803。
在本实施例中,图28所示实施例的第二电子设备可用于执行上述方法中图17所示实施例的技术方案,其实现原理和技术效果类似,此处不再赘述。
图29为本申请实施例提供的又一种第二电子设备的结构示意图。在图27所示实施例的基础上,如图29所示,第二电子设备的***中还部署有可信执行环境,第二电子设备中设置有第二场景器件291;获取单元271,包括:
第二发送模块2711b,用于基于REE向可信执行环境发送第二请求消息,其中,第二请求消息用于指示获取第二场景信息。此时,第二发送模块2711b可以执行图17所示方法的步骤902。
第二接收模块2712b,用于基于REE接收可信执行环境返回的第二场景信息,其中,第二场景信息是可信执行环境从第二场景器件291中所获取到的。此时,第二接收模块2712b可以执行图17所示方法的步骤903。
一个示例中,第二请求消息为基于REE所检测到的触发指令,或者,第二请求消息包括触发指令;触发指令用于指示生成二维码信息。
一个示例中,第二场景信息为可信执行环境采用公钥进行过签名处理的场景信息;获取单元271,还包括:
校验模块2713b,用于在第二接收模块2712b基于REE接收可信执行环境返回的第二场景信息之后基于REE采用私钥对第二场景信息进行校验,得到校验结果,其中,校验结果表征第二场景信息通过校验。此时,校验模块2713b可以执行图17所示方法的步骤904。
一个示例中,生成单元272,包括:
生成模块2721,用于基于REE根据第二场景信息和二维码数据,生成待处理数据,其中,待处理数据为包括第二场景信息的二维码数据。此时,生成单元272可以执行图17所示方法的步骤905。
发送模块2722,用于基于REE将待处理数据发送给可信执行环境,其中,待处理数据用于可信执行环境生成并显示二维码信息。此时,发送模块2722可以执行图17所示方法的步骤907。
一个示例中,生成单元272,还包括:
加密模块2723,用于在发送模块2722基于REE将待处理数据发送给可信执行环境之前,基于REE对待处理数据进行加密,得到加密后的待处理数据。此时,加密模块2723可以执行图17所示方法的步骤906。
一个示例中,第二场景信息是可信执行环境将第二场景器件291设置为预设配置之后所获取的,预设配置表征第二场景器件291的第二场景信息只可被可信执行环境所获取。
一个示例中,第二电子设备,还包括:
接收单元292,用于在获取单元271获取第二场景信息之前,接收触发指令,其中,触发指令用于指示生成二维码信息。此时,接收单元292可以执行图17所示方法的步骤901。
在本实施例中,图29所示实施例的第二电子设备可用于执行上述方法中图17所示实施例的技术方案,其实现原理和技术效果类似,此处不再赘述。
图30为本申请实施例提供的再一种第一电子设备的结构示意图。如图30所示,于第一电子设备,包括:处理器311和图像采集器312。
图像采集器312,用于扫描第二电子设备显示的二维码信息。
处理器311,用于获取第二电子设备显示的二维码信息;获取第一场景信息,并根据二维码信息,确定二维码数据和第二场景信息,其中,第一场景信息为与第一电子设备相关的场景信息,第二场景信息为与第二电子设备相关的场景信息;在确定第一场景信息和第二场景信息符合预设条件时,对二维码数据进行预设处理。此时,处理器311可以执行图4所示放的步骤101-104;或者,处理器311可以执行图5所示放的步骤201-204;或者,处理器311可以执行图7所示放的步骤301-304。
一个示例中,第一电子设备的***中部署有REE;处理器311在获取第一场景信息时,具体用于:基于REE获取第一场景信息。此时,处理器311可以执行图7所示方法的步骤302。
一个示例中,第一电子设备中设置有第一场景器件313;处理器311在基于REE获取第一场景信息时,具体用于:
基于REE向第一场景器件313发送第一请求消息,其中,第一请求消息用于指示获取第一场景器件313所检测得到的第一场景信息;此时,处理器311可以执行图8所示方法的步骤402。
基于REE接收第一场景器件313发送的第一场景信息。此时,处理器311可以执行图8所示方法的步骤403。
一个示例中,第一电子设备中设置有第一场景器件313;第一电子设备的***中还部署有可信执行环境;处理器31在基于REE获取第一场景信息时,具体用于:
基于REE向可信执行环境发送第二请求消息,其中,第二请求消息用于指示获取第一场景信息;此时,处理器311可以执行图9所示方法的步骤504。
基于REE接收可信执行环境返回的返回消息,其中返回消息用于指示第一场景信息,其中,第一场景信息是可信执行环境从第一场景器件313中所获取到的。此时,处理器311可以执行图9所示方法的步骤505。
一个示例中,第二请求消息包括第二场景信息,或者,第二请求信息用于指示第二场景信息;返回消息为验证结果;处理器311在基于REE接收可信执行环境返回的返回消息时,具体用于:
基于REE接收可信执行环境返回的验证结果,其中,验证结果为可信执行环境对第一场景信息和第二场景信息进行比较之后生成,验证结果表征第一场景信息和第二场景信息符合预设条件。此时,处理器311可以执行图9所示方法的步骤505。
一个示例中,处理器311在基于REE,向可信执行环境发送第二请求消息之前, 还用于:采用公钥对第二场景信息进行签名处理,得到签名后的第二场景信息;第一场景信息是可信执行环境采用私钥确定签名后的第二场景信息通过验证之后所获取的。此时,处理器311可以执行图9所示方法的步骤503。
一个示例中,第一场景信息是可信执行环境将第一场景器件313设置为预设配置之后所获取的,预设配置表征第一场景信息只可被可信执行环境所获取。
一个示例中,处理器311,还用于:在确定第一场景信息和第二场景信息不符合预设条件时,生成并显示提示信息。此时,处理器311可以执行图5所示方法的步骤205。
一个示例中,处理器311在根据二维码信息,确定二维码数据和第二场景信息时,具体用于:对二维码信息进行解密,得到二维码数据和第二场景信息。
一个示例中,第一场景信息包括以下的至少一种:全球定位***信息、无线局域网络信息、蓝牙信息、自然环境信息;第二场景信息包括以下的至少一种:全球定位***信息、无线局域网络信息、蓝牙信息、自然环境信息。
一个示例中,在第一场景信息为全球定位***信息,第二场景信息为全球定位***信息时,预设条件为第一场景信息与第二场景信息均属于预设地理范围。
在第一场景信息为无线局域网络信息,第二场景信息为无线局域网络信息时,预设条件为第二场景信息所表征的无线局域网络标识,存在于第一场景信息所表征的无线局域网络列表中。
在第一场景信息为蓝牙信息,第二场景信息为蓝牙信息时,预设条件为第二场景信息所表征的蓝牙标识,存在于第一场景信息所表征的蓝牙列表中。
在第一场景信息为自然环境信息,第二场景信息为自然环境信息时,预设条件为第一场景信息与第二场景信息均属于预设数值范围。
在本实施例中,图30所示实施例的第一电子设备可用于执行上述方法中图4-图5、图7-图9、图20-图22所示实施例的技术方案,其实现原理和技术效果类似,此处不再赘述。
图31为本申请实施例提供的再一种第二电子设备的结构示意图。如图31所示,第二电子设备,包括:处理器321。
处理器321,用于获取第二场景信息,其中,第二场景信息为与第二电子设备相关的场景信息;根据第二场景信息和预设的二维码数据,生成并显示二维码信息,其中,二维码信息用于第一电子设备获取后在确定第一场景信息和第二场景信息符合预设条件时,对二维码数据进行预设处理,第一场景信息为与第一电子设备相关的场景信息。此时,处理器321可以执行图14所示方法的步骤601-602;或者,处理器321可以执行图15所示方法的步骤701-702。
一个示例中,第二电子设备的***中部署有REE;处理器321在获取第二场景信息时,具体用于:基于REE,获取第二场景信息。此时,处理器321可以执行图15所示方法的步骤701。
一个示例中,第二电子设备中设置有第二场景器件322;处理器321在基于REE,获取第二场景信息时,具体用于:
基于REE向第二场景器件322发送第一请求消息,其中,第一请求消息用于指示获取第二场景器件322所检测的第二场景信息;此时,处理器321可以执行图16所示方法的步骤802。
基于REE接收第二场景器件322发送的第二场景信息。此时,处理器321可以执行图16所示方法的步骤803。
一个示例中,第二电子设备的***中还部署有可信执行环境,第二电子设备中设置有第二场景器件322;处理器321在基于REE,获取第二场景信息时,具体用于:
基于REE向可信执行环境发送第二请求消息,其中,第二请求消息用于指示获取第二场景信息;此时,处理器321可以执行图17所示方法的步骤902。
基于REE接收可信执行环境返回的第二场景信息,其中,第二场景信息是可信执行环境从第二场景器件322中所获取到的。此时,处理器321可以执行图17所示方法的步骤903。
一个示例中,第二请求消息为基于REE所检测到的触发指令,或者,第二请求消息包括触发指令;触发指令用于指示生成二维码信息。
一个示例中,第二场景信息为可信执行环境采用公钥进行过签名处理的场景信息;处理器321在基于REE接收可信执行环境返回的第二场景信息之后,还用于:
基于REE采用私钥对第二场景信息进行校验,得到校验结果,其中,校验结果表征第二场景信息通过校验。此时,处理器321可以执行图17所示方法的步骤904。
一个示例中,处理器321在根据第二场景信息和预设的二维码数据,生成并显示二维码信息时,具体用于:
基于REE根据第二场景信息和二维码数据,生成待处理数据,其中,待处理数据为包括第二场景信息的二维码数据;此时,处理器321可以执行图17所示方法的步骤905。
基于REE将待处理数据发送给可信执行环境,其中,待处理数据用于可信执行环境生成并显示二维码信息。此时,处理器321可以执行图17所示方法的步骤907。
一个示例中,处理器321在基于REE将待处理数据发送给可信执行环境之前,还用于:基于REE对待处理数据进行加密,得到加密后的待处理数据。此时,处理器321可以执行图17所示方法的步骤906。
一个示例中,第二场景信息是可信执行环境将第二场景器件322设置为预设配置之后所获取的,预设配置表征第二场景器件322第二场景信息只可被可信执行环境所获取。
一个示例中,处理器321在获取第二场景信息之前,还用于:接收触发指令,其中,触发指令用于指示生成二维码信息。此时,处理器321可以执行图17所示方法的步骤901。
一个示例中,第一场景信息包括以下的至少一种:全球定位***信息、无线局域网络信息、蓝牙信息、自然环境信息;第二场景信息包括以下的至少一种:全球定位***信息、无线局域网络信息、蓝牙信息、自然环境信息。
一个示例中,在第一场景信息为全球定位***信息,第二场景信息为全球定位***信息时,预设条件为第一场景信息与第二场景信息均属于预设地理范围。
在第一场景信息为无线局域网络信息,第二场景信息为无线局域网络信息时,预设条件为第二场景信息所表征的无线局域网络标识,存在于第一场景信息所表征的无线局域网络列表中。
在第一场景信息为蓝牙信息,第二场景信息为蓝牙信息时,预设条件为第二场景信息所表征的蓝牙标识,存在于第一场景信息所表征的蓝牙列表中。
在第一场景信息为自然环境信息,第二场景信息为自然环境信息时,预设条件为第一场景信息与第二场景信息均属于预设数值范围。
在本实施例中,图31所示实施例的第二电子设备可用于执行上述方法中图14-图17、图20-图22所示实施例的技术方案,其实现原理和技术效果类似,此处不再赘述。
图32为本申请实施例提供的其他一种第一电子设备的结构示意图。图32所示的实施例,介绍了:第一电子设备可以由处理器331和图像采集器332构成,可选的,第一电子设备还可以具有存储器333和第一场景器件334。如图32所示,该第一电子设备包括:处理器331、图像采集器332、存储器333和第一场景器件334。
图像采集器332、存储器333、第一场景器件334,可以耦合至处理器331。
其中,图像采集器332,用于采集上述图4-图5、图7-图9、图20-图22中所示方法实施例的二维码信息。
处理器331,用于获取图像采集器332采集的二维码信息,并执行计算机可执行程序代码中的指令;当处理器331执行指令时,指令使第一电子设备执行上述图4-图5、图7-图9、图20-图22中所示方法实施例的技术方案。
图32所示实施例的第一电子设备可以用于上述图4-图5、图7-图9、图20-图22中所示方法实施例的技术方案,或者执行图24-图26所示实施例各个单元和模块的程序,其实现原理和技术效果类似,此处不再赘述。在本申请实施例中,上述各实施例之间可以相互参考和借鉴,相同或相似的步骤以及名词均不再一一赘述。
一个示例中,图32所示实施例的第一电子设备还可以包括存储器333。该存储器333用于存储用于实现以上方法实施例的程序,或者该存储器333用于存储图24-图26所示实施例各个单元和模块的程序,处理器331调用该程序,执行以上方法实施例的操作,以实现图24-图26所示的各个单元和模块。
或者,以上各个单元和模块的部分或全部也可以通过集成电路的形式内嵌于该用设备的某一个芯片上来实现。且它们可以单独实现,也可以集成在一起。即以上这些模块可以被配置成实施以上方法的一个或多个集成电路,例如:一个或多个特定集成电路(application specific integrated circuit,ASIC),或,一个或多个微处理器(digital singnal processor,DSP),或,一个或者多个现场可编程门阵列(field programmable gate array,FPGA)等。
图33为本申请实施例提供的其他一种第二电子设备的结构示意图。图33所示的实施例,介绍了:第二电子设备可以由处理器341构成,可选的,第二电子设备还可以具有图像采集器342、存储器343、第二场景器件344。如图33所示,该第二电子设备包括:处理器341、图像采集器342、存储器343和第二场景器件344。
图像采集器342、存储器343、第二场景器件344,可以耦合至处理器341。
其中,图像采集器342,用于采集上述图14-图17、图20-图22中所示方法实施例的二维码信息。
处理器341,用于执行计算机可执行程序代码中的指令;当处理器341执行指令时,指令使第二电子设备执行上述图14-图17、图20-图22中所示方法实施例的技术方案。
图33所示实施例的第二电子设备可以用于上述图14-图17、图20-图22中所示方法实施例的技术方案,或者执行图27-图29所示实施例各个单元和模块的程序,其实现原理和技术效果类似,此处不再赘述。在本申请实施例中,上述各实施例之间可以相互参考和借鉴,相同或相似的步骤以及名词均不再一一赘述。
一个示例中,图33所示实施例的第二电子设备还可以包括存储器343。该存储器343用于存储用于实现以上方法实施例的程序,或者该存储器343用于存储图27-图29所示实施例各个单元和模块的程序,处理器341调用该程序,执行以上方法实施例的操作,以实现图27-图29所示的各个单元和模块。
或者,以上各个单元和模块的部分或全部也可以通过集成电路的形式内嵌于该用设备的某一个芯片上来实现。且它们可以单独实现,也可以集成在一起。即以上这些模块可以被配置成实施以上方法的一个或多个集成电路,例如:一个或多个特定集成电路(application specific integrated circuit,ASIC),或,一个或多个微处理器(digital singnal processor,DSP),或,一个或者多个现场可编程门阵列(field programmable gate array,FPGA)等。
本申请实施例提供了一种程序,包括程序代码,当计算机运行计算机程序时,程序代码执行上述图4-图5、图7-图9、图20-图22所示实施例的各步骤。
本申请实施例提供了一种计算机可读存储介质,包括指令,当其在计算机上运行时,使得计算机执行上述图14-图17、图20-图22所示实施例的各步骤。
根据本申请的实施例,本申请还提供了一种计算机程序产品,计算机程序产品包括:计算机程序,计算机程序存储在可读存储介质中,电子设备的至少一个处理器可以从可读存储介质读取计算机程序,至少一个处理器执行计算机程序使得电子设备执行上述任一实施例提供的方案。其中,电子设备可以是上述第一电子设备或者第二电子设备。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行计算机程序指令时,全部或部分地产生按照本申请实施例的流程或功能。计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如,同轴电缆、 光纤、数字用户线(digital subscriber line,DSL))或无线(例如,红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如,固态硬盘(solid state disk,SSD))等。
本领域技术人员应该可以意识到,在上述一个或多个示例中,本申请实施例所描述的功能可以用硬件、软件、固件或它们的任意组合来实现。当使用软件实现时,可以将这些功能存储在计算机可读介质中或者作为计算机可读介质上的一个或多个指令或代码进行传输。计算机可读介质包括计算机存储介质和通信介质,其中通信介质包括便于从一个地方向另一个地方传送计算机程序的任何介质。存储介质可以是通用或专用计算机能够存取的任何可用介质。
以上,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。

Claims (51)

  1. 一种二维码处理方法,其特征在于,所述方法应用于第一电子设备,所述方法包括:
    获取第二电子设备显示的二维码信息;
    获取第一场景信息,并根据所述二维码信息,确定二维码数据和第二场景信息,其中,所述第一场景信息为与所述第一电子设备相关的场景信息,所述第二场景信息为与所述第二电子设备相关的场景信息;
    在确定所述第一场景信息和所述第二场景信息符合预设条件时,对所述二维码数据进行预设处理。
  2. 根据权利要求1所述的方法,其特征在于,所述第一电子设备的***中部署有富执行环境;所述获取第一场景信息,包括:
    基于所述富执行环境获取所述第一场景信息。
  3. 根据权利要求2所述的方法,其特征在于,所述第一电子设备中设置有第一场景器件;基于所述富执行环境获取所述第一场景信息,包括:
    基于所述富执行环境向所述第一场景器件发送第一请求消息,其中,所述第一请求消息用于指示获取所述第一场景器件所检测得到的所述第一场景信息;
    基于所述富执行环境接收所述第一场景器件发送的所述第一场景信息。
  4. 根据权利要求2所述的方法,其特征在于,所述第一电子设备中设置有第一场景器件;所述第一电子设备的***中还部署有可信执行环境;基于所述富执行环境获取所述第一场景信息,包括:
    基于所述富执行环境向所述可信执行环境发送第二请求消息,其中,所述第二请求消息用于指示获取所述第一场景信息;
    基于所述富执行环境接收所述可信执行环境返回的返回消息,其中所述返回消息用于指示所述第一场景信息,其中,所述第一场景信息是所述可信执行环境从所述第一场景器件中所获取到的。
  5. 根据权利要求4所述的方法,其特征在于,所述第二请求消息包括所述第二场景信息,或者,所述第二请求信息用于指示所述第二场景信息;
    所述返回消息为验证结果;基于所述富执行环境接收所述可信执行环境返回的所述返回消息,包括:
    基于所述富执行环境接收所述可信执行环境返回的验证结果,其中,所述验证结果为所述可信执行环境对所述第一场景信息和所述第二场景信息进行比较之后生成,所述验证结果表征所述第一场景信息和所述第二场景信息符合所述预设条件。
  6. 根据权利要求5所述的方法,其特征在于,在基于所述富执行环境,向所述可信执行环境发送第二请求消息之前,还包括:采用公钥对所述第二场景信息进行签名处理,得到签名后的第二场景信息;
    所述第一场景信息是所述可信执行环境采用私钥确定所述签名后的第二场景信息通过验证之后所获取的。
  7. 根据权利要求4-6任一项所述的方法,其特征在于,所述第一场景信息是所述可信执行环境将所述第一场景器件设置为预设配置之后所获取的,所述预设配置表征 所述第一场景信息只可被所述可信执行环境所获取。
  8. 根据权利要求1-7任一项所述的方法,其特征在于,所述方法,还包括:
    在确定所述第一场景信息和所述第二场景信息不符合预设条件时,生成并显示提示信息。
  9. 根据权利要求1-8任一项所述的方法,其特征在于,根据所述二维码信息,确定二维码数据和第二场景信息,包括:
    对所述二维码信息进行解密,得到所述二维码数据和所述第二场景信息。
  10. 根据权利要求1-9任一项所述的方法,其特征在于,所述第一场景信息包括以下的至少一种:全球定位***信息、无线局域网络信息、蓝牙信息、自然环境信息;
    所述第二场景信息包括以下的至少一种:全球定位***信息、无线局域网络信息、蓝牙信息、自然环境信息。
  11. 根据权利要求10所述的方法,其特征在于,在所述第一场景信息为全球定位***信息,所述第二场景信息为全球定位***信息时,所述预设条件为所述第一场景信息与所述第二场景信息均属于预设地理范围;
    在所述第一场景信息为无线局域网络信息,所述第二场景信息为无线局域网络信息时,所述预设条件为所述第二场景信息所表征的无线局域网络标识,存在于所述第一场景信息所表征的无线局域网络列表中;
    在所述第一场景信息为蓝牙信息,所述第二场景信息为蓝牙信息时,所述预设条件为所述第二场景信息所表征的蓝牙标识,存在于所述第一场景信息所表征的蓝牙列表中;
    在所述第一场景信息为自然环境信息,所述第二场景信息为自然环境信息时,所述预设条件为所述第一场景信息与所述第二场景信息均属于预设数值范围。
  12. 一种二维码处理方法,其特征在于,所述方法应用于第二电子设备,所述方法包括:
    获取第二场景信息,其中,所述第二场景信息为与所述第二电子设备相关的场景信息;
    根据所述第二场景信息和预设的二维码数据,生成并显示二维码信息,其中,所述二维码信息用于第一电子设备获取后在确定第一场景信息和所述第二场景信息符合预设条件时,对所述二维码数据进行预设处理,所述第一场景信息为与所述第一电子设备相关的场景信息。
  13. 根据权利要求12所述的方法,其特征在于,所述第二电子设备的***中部署有富执行环境;所述获取第二场景信息,包括:
    基于所述富执行环境,获取所述第二场景信息。
  14. 根据权利要求13所述的方法,其特征在于,所述第二电子设备中设置有第二场景器件;基于所述富执行环境,获取所述第二场景信息,包括:
    基于所述富执行环境向所述第二场景器件发送第一请求消息,其中,所述第一请求消息用于指示获取所述第二场景器件所检测的所述第二场景信息;
    基于所述富执行环境接收所述第二场景器件发送的所述第二场景信息。
  15. 根据权利要求13所述的方法,其特征在于,所述第二电子设备的***中还部 署有可信执行环境,所述第二电子设备中设置有第二场景器件;基于所述富执行环境,获取所述第二场景信息,包括:
    基于所述富执行环境向所述可信执行环境发送第二请求消息,其中,所述第二请求消息用于指示获取所述第二场景信息;
    基于所述富执行环境接收所述可信执行环境返回的所述第二场景信息,其中,所述第二场景信息是所述可信执行环境从所述第二场景器件中所获取到的。
  16. 根据权利要求15所述的方法,其特征在于,所述第二请求消息为基于富执行环境所检测到的触发指令,或者,所述第二请求消息包括所述触发指令;所述触发指令用于指示生成所述二维码信息。
  17. 根据权利要求15或16所述的方法,其特征在于,所述第二场景信息为所述可信执行环境采用公钥进行过签名处理的场景信息;在基于所述富执行环境接收所述可信执行环境返回的所述第二场景信息之后,还包括:
    基于所述富执行环境采用私钥对所述第二场景信息进行校验,得到校验结果,其中,所述校验结果表征所述第二场景信息通过校验。
  18. 根据权利要求17所述的方法,其特征在于,根据所述第二场景信息和预设的二维码数据,生成并显示二维码信息,包括:
    基于富执行环境根据所述第二场景信息和所述二维码数据,生成待处理数据,其中,所述待处理数据为包括所述第二场景信息的二维码数据;
    基于富执行环境将所述待处理数据发送给所述可信执行环境,其中,所述待处理数据用于所述可信执行环境生成并显示所述二维码信息。
  19. 根据权利要求18所述的方法,其特征在于,在基于富执行环境将所述待处理数据发送给所述可信执行环境之前,还包括:
    基于富执行环境对所述待处理数据进行加密,得到加密后的待处理数据。
  20. 根据权利要求15-19任一项所述的方法,其特征在于,所述第二场景信息是所述可信执行环境将所述第二场景器件设置为预设配置之后所获取的,所述预设配置表征所述第二场景器件第二场景信息只可被所述可信执行环境所获取。
  21. 根据权利要求12-20任一项所述的方法,其特征在于,在所述获取第二场景信息之前,还包括:
    接收触发指令,其中,所述触发指令用于指示生成所述二维码信息。
  22. 根据权利要求12-21任一项所述的方法,其特征在于,所述第一场景信息包括以下的至少一种:全球定位***信息、无线局域网络信息、蓝牙信息、自然环境信息;
    所述第二场景信息包括以下的至少一种:全球定位***信息、无线局域网络信息、蓝牙信息、自然环境信息。
  23. 根据权利要求22所述的方法,其特征在于,在所述第一场景信息为全球定位***信息,所述第二场景信息为全球定位***信息时,所述预设条件为所述第一场景信息与所述第二场景信息均属于预设地理范围;
    在所述第一场景信息为无线局域网络信息,所述第二场景信息为无线局域网络信息时,所述预设条件为所述第二场景信息所表征的无线局域网络标识,存在于所述第 一场景信息所表征的无线局域网络列表中;
    在所述第一场景信息为蓝牙信息,所述第二场景信息为蓝牙信息时,所述预设条件为所述第二场景信息所表征的蓝牙标识,存在于所述第一场景信息所表征的蓝牙列表中;
    在所述第一场景信息为自然环境信息,所述第二场景信息为自然环境信息时,所述预设条件为所述第一场景信息与所述第二场景信息均属于预设数值范围。
  24. 一种第一电子设备,其特征在于,所述第一电子设备包括:
    第一获取单元,用于获取第二电子设备显示的二维码信息;
    第二获取单元,用于获取第一场景信息;
    确定单元,用于根据所述二维码信息,确定二维码数据和第二场景信息,其中,所述第一场景信息为与所述第一电子设备相关的场景信息,所述第二场景信息为与所述第二电子设备相关的场景信息;
    处理单元,用于在确定所述第一场景信息和所述第二场景信息符合预设条件时,对所述二维码数据进行预设处理。
  25. 根据权利要求24所述的第一电子设备,其特征在于,所述第一电子设备的***中部署有富执行环境;所述第二获取单元,具体用于:
    基于所述富执行环境获取所述第一场景信息。
  26. 根据权利要求25所述的第一电子设备,其特征在于,所述第一电子设备中设置有第一场景器件;所述第二获取单元,包括:
    第一发送模块,用于基于所述富执行环境向所述第一场景器件发送第一请求消息,其中,所述第一请求消息用于指示获取所述第一场景器件所检测得到的所述第一场景信息;
    第一接收模块,用于基于所述富执行环境接收所述第一场景器件发送的所述第一场景信息。
  27. 根据权利要求25所述的第一电子设备,其特征在于,所述第一电子设备中设置有第一场景器件;所述第一电子设备的***中还部署有可信执行环境;所述第二获取单元,包括:
    第二发送模块,用于基于所述富执行环境向所述可信执行环境发送第二请求消息,其中,所述第二请求消息用于指示获取所述第一场景信息;
    第二接收模块,用于基于所述富执行环境接收所述可信执行环境返回的返回消息,其中所述返回消息用于指示所述第一场景信息,其中,所述第一场景信息是所述可信执行环境从所述第一场景器件中所获取到的。
  28. 根据权利要求27所述的第一电子设备,其特征在于,所述第二请求消息包括所述第二场景信息,或者,所述第二请求信息用于指示所述第二场景信息;
    所述返回消息为验证结果;所述第二接收模块,具体用于:
    基于所述富执行环境接收所述可信执行环境返回的验证结果,其中,所述验证结果为所述可信执行环境对所述第一场景信息和所述第二场景信息进行比较之后生成,所述验证结果表征所述第一场景信息和所述第二场景信息符合所述预设条件。
  29. 根据权利要求28所述的第一电子设备,其特征在于,所述第二获取单元,还 包括:
    签名模块,用于在所述第二发送模块基于所述富执行环境向所述可信执行环境发送第二请求消息之前,采用公钥对所述第二场景信息进行签名处理,得到签名后的第二场景信息;
    所述第一场景信息是所述可信执行环境采用私钥确定所述签名后的第二场景信息通过验证之后所获取的。
  30. 根据权利要求27-29任一项所述的第一电子设备,其特征在于,所述第一场景信息是所述可信执行环境将所述第一场景器件设置为预设配置之后所获取的,所述预设配置表征所述第一场景信息只可被所述可信执行环境所获取。
  31. 根据权利要求24-30任一项所述的第一电子设备,其特征在于,所述第一电子设备,还包括:
    提示单元,用于在确定所述第一场景信息和所述第二场景信息不符合预设条件时,生成并显示提示信息。
  32. 根据权利要求24-31任一项所述的第一电子设备,其特征在于,所述确定单元,具体用于:
    对所述二维码信息进行解密,得到所述二维码数据和所述第二场景信息。
  33. 根据权利要求24-32任一项所述的第一电子设备,其特征在于,所述第一场景信息包括以下的至少一种:全球定位***信息、无线局域网络信息、蓝牙信息、自然环境信息;
    所述第二场景信息包括以下的至少一种:全球定位***信息、无线局域网络信息、蓝牙信息、自然环境信息。
  34. 根据权利要求33所述的第一电子设备,其特征在于,在所述第一场景信息为全球定位***信息,所述第二场景信息为全球定位***信息时,所述预设条件为所述第一场景信息与所述第二场景信息均属于预设地理范围;
    在所述第一场景信息为无线局域网络信息,所述第二场景信息为无线局域网络信息时,所述预设条件为所述第二场景信息所表征的无线局域网络标识,存在于所述第一场景信息所表征的无线局域网络列表中;
    在所述第一场景信息为蓝牙信息,所述第二场景信息为蓝牙信息时,所述预设条件为所述第二场景信息所表征的蓝牙标识,存在于所述第一场景信息所表征的蓝牙列表中;
    在所述第一场景信息为自然环境信息,所述第二场景信息为自然环境信息时,所述预设条件为所述第一场景信息与所述第二场景信息均属于预设数值范围。
  35. 一种第二电子设备,其特征在于,所述第二电子设备包括:
    获取单元,用于获取第二场景信息,其中,所述第二场景信息为与所述第二电子设备相关的场景信息;
    生成单元,用于根据所述第二场景信息和预设的二维码数据,生成显示二维码信息;
    显示单元,用于显示二维码信息,其中,所述二维码信息用于第一电子设备获取后在确定第一场景信息和所述第二场景信息符合预设条件时,对所述二维码数据进行 预设处理,所述第一场景信息为与所述第一电子设备相关的场景信息。
  36. 根据权利要求35所述的第二电子设备,其特征在于,所述第二电子设备的***中部署有富执行环境;所述获取单元,具体用于:
    基于所述富执行环境,获取所述第二场景信息。
  37. 根据权利要求36所述的第二电子设备,其特征在于,所述第二电子设备中设置有第二场景器件;所述获取单元,包括:
    第一发送模块,用于基于所述富执行环境向所述第二场景器件发送第一请求消息,其中,所述第一请求消息用于指示获取所述第二场景器件所检测的所述第二场景信息;
    第一接收模块,用于基于所述富执行环境接收所述第二场景器件发送的所述第二场景信息。
  38. 根据权利要求36所述的第二电子设备,其特征在于,所述第二电子设备的***中还部署有可信执行环境,所述第二电子设备中设置有第二场景器件;所述获取单元,包括:
    第二发送模块,用于基于所述富执行环境向所述可信执行环境发送第二请求消息,其中,所述第二请求消息用于指示获取所述第二场景信息;
    第二接收模块,用于基于所述富执行环境接收所述可信执行环境返回的所述第二场景信息,其中,所述第二场景信息是所述可信执行环境从所述第二场景器件中所获取到的。
  39. 根据权利要求38所述的第二电子设备,其特征在于,所述第二请求消息为基于富执行环境所检测到的触发指令,或者,所述第二请求消息包括所述触发指令;所述触发指令用于指示生成所述二维码信息。
  40. 根据权利要求38或39所述的第二电子设备,其特征在于,所述第二场景信息为所述可信执行环境采用公钥进行过签名处理的场景信息;所述获取单元,还包括:
    校验模块,用于在所述第二接收模块基于所述富执行环境接收所述可信执行环境返回的所述第二场景信息之后基于所述富执行环境采用私钥对所述第二场景信息进行校验,得到校验结果,其中,所述校验结果表征所述第二场景信息通过校验。
  41. 根据权利要求40所述的第二电子设备,其特征在于,所述生成单元,包括:
    生成模块,用于基于富执行环境根据所述第二场景信息和所述二维码数据,生成待处理数据,其中,所述待处理数据为包括所述第二场景信息的二维码数据;
    发送模块,用于基于富执行环境将所述待处理数据发送给所述可信执行环境,其中,所述待处理数据用于所述可信执行环境生成并显示所述二维码信息。
  42. 根据权利要求41所述的第二电子设备,其特征在于,所述生成单元,还包括:
    加密模块,用于在所述发送模块基于富执行环境将所述待处理数据发送给所述可信执行环境之前,基于富执行环境对所述待处理数据进行加密,得到加密后的待处理数据。
  43. 根据权利要求38-42任一项所述的第二电子设备,其特征在于,所述第二场景信息是所述可信执行环境将所述第二场景器件设置为预设配置之后所获取的,所述预设配置表征所述第二场景器件的第二场景信息只可被所述可信执行环境所获取。
  44. 根据权利要求35-43任一项所述的第二电子设备,其特征在于,所述第二电 子设备,还包括:
    接收单元,用于在所述获取单元获取第二场景信息之前,接收触发指令,其中,所述触发指令用于指示生成所述二维码信息。
  45. 根据权利要求35-44任一项所述的第二电子设备,其特征在于,所述第一场景信息包括以下的至少一种:全球定位***信息、无线局域网络信息、蓝牙信息、自然环境信息;
    所述第二场景信息包括以下的至少一种:全球定位***信息、无线局域网络信息、蓝牙信息、自然环境信息。
  46. 根据权利要求45所述的第二电子设备,其特征在于,在所述第一场景信息为全球定位***信息,所述第二场景信息为全球定位***信息时,所述预设条件为所述第一场景信息与所述第二场景信息均属于预设地理范围;
    在所述第一场景信息为无线局域网络信息,所述第二场景信息为无线局域网络信息时,所述预设条件为所述第二场景信息所表征的无线局域网络标识,存在于所述第一场景信息所表征的无线局域网络列表中;
    在所述第一场景信息为蓝牙信息,所述第二场景信息为蓝牙信息时,所述预设条件为所述第二场景信息所表征的蓝牙标识,存在于所述第一场景信息所表征的蓝牙列表中;
    在所述第一场景信息为自然环境信息,所述第二场景信息为自然环境信息时,所述预设条件为所述第一场景信息与所述第二场景信息均属于预设数值范围。
  47. 一种第一电子设备,其特征在于,包括图像采集器和处理器;
    其中,所述图像采集器,用于采集权利要求1至12任一项所述的方法中的二维码信息;
    所述处理器,用于获取所述图像采集器采集的二维码信息,并执行计算机可执行程序代码中的指令;当所述处理器执行所述指令时,所述指令使所述成像设备执行权利要求1至11任一项所述的方法。
  48. 一种第二电子设备,其特征在于,包括处理器;
    所述处理器,用于执行计算机可执行程序代码中的指令;当所述处理器执行所述指令时,所述指令使所述成像设备执行权利要求12至23任一项所述的方法。
  49. 一种计算机可读存储介质,其特征在于,包括指令,当其在计算机上运行时,使得计算机执行如权利要求1至23任一项所述的方法。
  50. 一种计算机程序,其特征在于,包括程序代码,当计算机运行所述计算机程序时,所述程序代码执行如权利要求1至23任一项所述的方法。
  51. 一种计算机程序产品,包括计算机程序,所述计算机程序在被处理器执行时实现根据权利要求1至23中任一项所述的方法。
PCT/CN2020/139990 2019-12-26 2020-12-28 二维码处理方法和设备 WO2021129859A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US17/846,199 US11989618B2 (en) 2019-12-26 2022-06-22 Two-dimensional code processing method and device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911368922.7A CN113051542A (zh) 2019-12-26 2019-12-26 二维码处理方法和设备
CN201911368922.7 2019-12-26

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/846,199 Continuation US11989618B2 (en) 2019-12-26 2022-06-22 Two-dimensional code processing method and device

Publications (1)

Publication Number Publication Date
WO2021129859A1 true WO2021129859A1 (zh) 2021-07-01

Family

ID=76505543

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/139990 WO2021129859A1 (zh) 2019-12-26 2020-12-28 二维码处理方法和设备

Country Status (3)

Country Link
US (1) US11989618B2 (zh)
CN (1) CN113051542A (zh)
WO (1) WO2021129859A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115175003A (zh) * 2022-07-11 2022-10-11 聚好看科技股份有限公司 媒资播放方法、显示设备、电子设备及服务器

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114168953A (zh) * 2021-12-06 2022-03-11 安天科技集团股份有限公司 一种恶意代码检测方法、装置、电子设备及存储介质
CN116484438B (zh) * 2022-01-17 2024-07-02 荣耀终端有限公司 信息处理方法和装置
US11971806B2 (en) 2022-02-23 2024-04-30 Bank Of America Corporation System and method for dynamic monitoring of changes in coding data

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110296508A1 (en) * 2010-05-26 2011-12-01 Apple Inc. Digital handshake for authentication of devices
CN104834839A (zh) * 2014-02-11 2015-08-12 阿里巴巴集团控股有限公司 一种条码生成方法、基于条码的鉴权方法及相关终端
CN106228360A (zh) * 2016-07-11 2016-12-14 腾讯科技(深圳)有限公司 一种信息处理方法及第一终端
CN107632758A (zh) * 2017-08-09 2018-01-26 珠海市魅族科技有限公司 一种快捷支付方法、装置、计算机装置及计算机可读存储介质
CN107992729A (zh) * 2016-10-26 2018-05-04 ***通信有限公司研究院 一种控制方法、终端及用户识别模块卡
CN109871722A (zh) * 2019-01-10 2019-06-11 深圳市雄帝科技股份有限公司 基于光学图形码的身份验证方法、***、终端及存储介质
CN109918168A (zh) * 2019-03-19 2019-06-21 上海掌门科技有限公司 显示图形码的方法、电子设备和计算机可读介质

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160027042A1 (en) * 2009-11-17 2016-01-28 Thomas W. Heeter Electronic brand authentication method using scannable codes
WO2014134514A1 (en) 2013-02-28 2014-09-04 Gramling Richard Dynamic payment authorization system and method
KR102460459B1 (ko) * 2015-02-27 2022-10-28 삼성전자주식회사 전자 장치를 이용한 카드 서비스 방법 및 장치
CN104796258A (zh) 2015-03-24 2015-07-22 百度在线网络技术(北京)有限公司 一种用于移动认证的方法、设备与***
CN107563769A (zh) * 2017-08-02 2018-01-09 平安科技(深圳)有限公司 一种现场营销客户实时追踪方法、设备及存储介质
CN207182396U (zh) 2017-09-28 2018-04-03 重庆三果云科技有限公司 物流溯源信息跟踪服务***
CN109102280A (zh) * 2018-08-01 2018-12-28 福州市晋安区绿奇鑫环保科技有限公司 一种扫码支付环境的安全确认方法及服务器
CN109493023B (zh) * 2018-10-17 2022-01-25 珠海横琴井通容智科技信息有限公司 基于防篡改加密算法的移动支付清结算方法

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110296508A1 (en) * 2010-05-26 2011-12-01 Apple Inc. Digital handshake for authentication of devices
CN104834839A (zh) * 2014-02-11 2015-08-12 阿里巴巴集团控股有限公司 一种条码生成方法、基于条码的鉴权方法及相关终端
CN106228360A (zh) * 2016-07-11 2016-12-14 腾讯科技(深圳)有限公司 一种信息处理方法及第一终端
CN107992729A (zh) * 2016-10-26 2018-05-04 ***通信有限公司研究院 一种控制方法、终端及用户识别模块卡
CN107632758A (zh) * 2017-08-09 2018-01-26 珠海市魅族科技有限公司 一种快捷支付方法、装置、计算机装置及计算机可读存储介质
CN109871722A (zh) * 2019-01-10 2019-06-11 深圳市雄帝科技股份有限公司 基于光学图形码的身份验证方法、***、终端及存储介质
CN109918168A (zh) * 2019-03-19 2019-06-21 上海掌门科技有限公司 显示图形码的方法、电子设备和计算机可读介质

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115175003A (zh) * 2022-07-11 2022-10-11 聚好看科技股份有限公司 媒资播放方法、显示设备、电子设备及服务器
CN115175003B (zh) * 2022-07-11 2023-10-13 聚好看科技股份有限公司 媒资播放方法、显示设备及服务器

Also Published As

Publication number Publication date
US20220318538A1 (en) 2022-10-06
US11989618B2 (en) 2024-05-21
CN113051542A (zh) 2021-06-29

Similar Documents

Publication Publication Date Title
WO2021129859A1 (zh) 二维码处理方法和设备
US10623954B2 (en) AP connection method, terminal, and server
CN108632253B (zh) 基于移动终端的客户数据安全访问方法及装置
KR101671351B1 (ko) 통합 보안 엔진을 사용하는 웹 서비스 제공자를 위한 프라이버시 강화 키 관리
EP3061027B1 (en) Verifying the security of a remote server
US20200260278A1 (en) Method and apparatus for authenticating network access of terminal
KR102442269B1 (ko) 클라우드 컴퓨팅 프로세스의 위임을 위한 시스템 및 방법
US9762567B2 (en) Wireless communication of a user identifier and encrypted time-sensitive data
US10659226B2 (en) Data encryption method, decryption method, apparatus, and system
US20160125180A1 (en) Near Field Communication Authentication Mechanism
US20190245832A1 (en) Data response method, terminal device, and server
CN105493097A (zh) 用于远程存储的数据的保护方案
KR101403626B1 (ko) 클라우드 컴퓨팅 환경에서의 스마트 단말 통합 보안 관리 방법
Damopoulos et al. User privacy and modern mobile services: are they on the same path?
US10880091B2 (en) Control method for enrolling face template data and related product
US9524394B2 (en) Method and apparatus for providing provably secure user input/output
CN107317680B (zh) 安全账号的标记方法、***及计算机可读存储介质
CN106713315B (zh) 插件应用程序的登录方法和装置
CN104104650A (zh) 数据文件访问方法及终端设备
WO2016026333A1 (zh) 终端连接pc时的数据保护方法及装置、存储介质
CN108769989B (zh) 一种无线网连接方法、无线接入装置和设备
CN106534047A (zh) 一种基于Trust应用的信息传输方法及装置
US11792649B2 (en) Radio base station apparatus, non-transitory computer readable medium storing radio base station program, and radio communication system
CN117932573A (zh) 一种二维码防伪***、方法及相关设备
Pal et al. CYBER SECURITY

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20904400

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20904400

Country of ref document: EP

Kind code of ref document: A1