Information transmission method and electronic device

By encoding information in images and utilizing the color sequence display of particle points and image processing technology, the problem of long information transmission and interaction paths between electronic devices is solved, enabling convenient and efficient information acquisition and device connection.

WO2025261389A1PCT designated stage Publication Date: 2025-12-26HUAWEI TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/101701
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-09-23
Filing Date
2025-06-18
Publication Date
2025-12-26

AI Technical Summary

Technical Problem

In existing technologies, the information transmission and interaction paths between electronic devices are relatively long and inconvenient, especially when connecting and pairing via scanning QR codes.

Method used

The method employs image encoding to obtain encoded information by scanning the image displayed by the second electronic device with the first electronic device. The positioning points and information points of the particles are displayed cyclically in a preset color order. Combined with image processing techniques such as sampling, differential processing, and filtering, the target information is extracted.

Benefits of technology

It shortens the device interaction path, enhances the convenience and technological feel of information transmission, and improves the success rate and speed of information acquisition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025101701_26122025_PF_FP_ABST
    Figure CN2025101701_26122025_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the present application are an information transmission method and an electronic device. The method comprises: acquiring N first image frames, wherein each of the N first image frames comprises particle dots having target information encoded therein, the particle dots comprise positioning dots for positioning a display region and information dots for indicating data, and within a same first image frame, the positioning dots are cyclically displayed in a first preset color order and the information dots are cyclically displayed in a second preset color order; determining, in a first image, a target region that contains the particle dots; on the basis of the target region, extracting the particle dots from the first image; and on the basis of the distribution of the particle dots, determining the encoded target information in the particle dots. In the technical solution, a first electronic device can scan an image displayed on a second electronic device to acquire encoded information in the image, thereby realizing information transmission between the first electronic device and the second electronic device. For example, during device connection, the path for device interaction is shortened, and the high-tech feel is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Information transmission methods and electronic devices

[0001] This application claims priority to the following Chinese patent applications filed on June 20, 2024, with application number 202410804850.0 and entitled "Method and Electronic Device for Information Transmission"; filed on June 28, 2024, with application number 202410865237.X and entitled "Method and Electronic Device for Information Transmission"; and filed on September 23, 2024, with application number 202411336391.4 and entitled "Method and Electronic Device for Information Transmission", the entire contents of which are incorporated herein by reference. Technical Field

[0002] This application relates to the field of electronic technology, and more specifically, to a method and electronic device for information transmission. Background Technology

[0003] In scenarios where information needs to be transferred between electronic devices, QR code scanning is commonly used for device pairing, account login, and other similar tasks. For example, when a first electronic device needs to connect with a second electronic device, the second electronic device needs to scan the QR code displayed on the first electronic device to complete the pairing. However, scanning QR codes involves a lengthy and inconvenient interaction process. Summary of the Invention

[0004] This application provides an information transmission method and an electronic device. In this technical solution, a second electronic device can encode the information to be transmitted in an image, and a first electronic device can scan the image displayed by the second electronic device to obtain the encoded information therein, so as to realize information transmission between the two. For example, when connecting devices, the interaction path between devices can be shortened and the sense of technology can be enhanced.

[0005] In a first aspect, a method for information transmission is provided, the method being applied to a first electronic device, the method comprising: acquiring N frames of first images, each frame of the N frames including particle points encoded with target information, the particle points including positioning points for locating a display area and information points for indicating data, wherein, in the same frame of the first image, the positioning points are displayed cyclically according to a first preset color order, and the information points are displayed cyclically according to a second preset color order, and N is greater than or equal to 3; determining a target area in the first image containing the particle points; extracting the particle points from the first image according to the target area; and determining the target information encoded in the particle points according to the distribution of the particle points.

[0006] Based on the embodiments of this application, the first electronic device can acquire N frames of first images, and the first images include particle points encoded with target information. In the same frame image, the positioning points and information points in the particle points are displayed cyclically in a preset color order, thereby enabling the encoded particle points to have a better hiding effect.

[0007] Furthermore, the first electronic device only needs to scan the first image to extract the particle points and further determine the target information encoded therein. For example, this target information is a connection pairing code (such as a PIN code) used for device connection. The first electronic device can obtain this connection pairing code in this convenient way and establish a device connection with the second electronic device, thereby shortening the device interaction path and enhancing the sense of technology.

[0008] In some implementations, before determining the target region containing the particle points in the first image, the method further includes: determining that a first distance between the first electronic device and the second electronic device is less than or equal to a preset distance.

[0009] The specific value of the preset distance is not limited in the embodiments of this application. For example, the preset distance can be 30 cm or 60 cm, etc.

[0010] Based on the embodiments of this application, when the first distance between the first electronic device and the second electronic device is less than a preset distance, a target area containing particle points in the first image is determined, thereby enabling the information transmission method in this application to be executed when the distance between the two electronic devices is appropriate, thereby increasing the probability of successful decoding by the first electronic device.

[0011] In some implementations, determining the target region containing the particle points in the first image includes: downsampling the first frame of the first image in the N frames of the first image according to the first distance to obtain a second image; binarizing the second image to obtain a binary image; and determining the target region based on the binary image.

[0012] Based on the embodiments of this application, the first electronic device downsamples the first image according to the first distance between itself and the second electronic device, and performs binarization processing on the downsampled second image. The target region is determined based on the binary image, thereby making the downsampling ratio more appropriate and reducing the workload of the first electronic device in processing the image to determine the target region.

[0013] Optionally, the first frame image can be replaced with any frame image from the first few frames of the N frames, which is not limited in this embodiment. Alternatively, the first frame image can be replaced with one frame image from the N frames.

[0014] In some implementations, the method further includes: downsampling the N frames of the first image according to the target region to obtain N frames of the third image; performing intra-frame difference processing on the N frames of the third image using the first intra-frame difference parameter to obtain N frames of the first grayscale image; and cropping the N frames of the first grayscale image according to the target region to obtain the N frames of the second grayscale image.

[0015] Based on the embodiments of this application, the first electronic device downsamples N frames of the first image according to a first distance, which can reduce the workload of the first electronic device in processing images. Furthermore, by performing intra-frame difference processing on the images, the particle points included in the resulting first grayscale image can be made more prominent, which is beneficial for the first electronic device to obtain the encoded information therein. Further, by cropping the first grayscale image using the previously obtained target region, the first electronic device can ensure that the size of the cropped second grayscale image is the same as the target region. This allows the first electronic device to process only the portion of the second grayscale image containing the particle points, thereby improving the decoding speed of the first electronic device.

[0016] In some implementations, extracting the particle points from the first image based on the target region includes: filtering M frames of second grayscale images out of N frames of second grayscale images using an annular region capable of covering the target region to obtain M frames of third grayscale images, wherein each frame of the M frames of grayscale images retains the portion covered by the annular region, and M is less than or equal to N; performing inter-frame difference processing on the M frames of third grayscale images to obtain M frames of fourth grayscale images; performing binarization processing on the M frames of fourth grayscale images to obtain M frames of binary images; performing an OR operation on the M frames of binary images to obtain a first target binary image; filtering interference points on the first target binary image to obtain a second target binary image; and extracting the particle points from the second target binary image.

[0017] For example, the annular region that can cover the target area can be used as a mask to filter the second grayscale image to retain the portion covered by the annular region.

[0018] Based on the embodiments of this application, by using a ring-shaped region that covers the target area to filter the second grayscale image, particle points corresponding to the ring-shaped region can be obtained, and particle points outside the ring-shaped region can be filtered out. In this way, the M-frame third grayscale image obtained by the first electronic device contains particle points within the ring-shaped region, while noise in other regions is filtered out.

[0019] In addition, the first electronic device can retain the parts that differ between multiple frames of images through differential processing. Since the second electronic device displays the positioning points and information points in different colors in a cycle during encoding, while the image background and noise are the same, differential processing can retain the positioning points and information points in the image as much as possible, and filter out the noise.

[0020] Furthermore, by filtering interference points from the first target binary image, the first electronic device can obtain a better quality second target binary image, which is beneficial for the first electronic device to successfully extract the particle points with encoded information.

[0021] In some implementations, the method further includes: determining multiple sets of first information based on the N frames of the first image; fusing the multiple sets of first information to obtain a first fusion result containing the target information.

[0022] It should be understood that the first information is the target information determined by the first electronic device based on N frames of the first image.

[0023] For example, taking N=5 as an example, the first electronic device can determine a set of first information based on the first frame image, the second frame image, and the third frame image; determine another set of first information based on the second frame image, the third frame image, and the fourth frame image; and determine yet another set of first information based on the third frame image, the fourth frame image, and the fifth frame image. Then, the first electronic device can fuse these three sets of first information to obtain the final target information.

[0024] Based on the embodiments of this application, the first electronic device can determine multiple sets of first information based on N frames of first images, and fuse the multiple sets of first information to obtain the final target information, thereby making the final target information more accurate.

[0025] In some implementations, the method further includes: acquiring a second N-frame first image; determining multiple sets of second information based on the second N-frame first image; fusing the multiple sets of second information to obtain a second fusion result containing the target information; fusing the first fusion result and the second fusion result to obtain a third fusion result, wherein the third fusion result includes the finally determined target information.

[0026] Based on the embodiments of this application, the first electronic device can also fuse the results of multiple rounds of fusion, thereby making the final determined target information more accurate.

[0027] In some implementations, determining the target information encoded in the particle points based on their distribution includes: determining multiple display areas based on the distribution of positioning points in the particle points; determining the information encoded in each of the multiple display areas based on the distribution of information points included in the multiple display areas; and fusing the information encoded in each display area in a preset order to obtain the target information.

[0028] Based on the embodiments of this application, the first electronic device can determine multiple display areas by the distribution of positioning points, determine the encoded information in each display area, and then fuse the encoded information in the multiple display areas to obtain the encoded target information. With this technical solution, the first electronic device can successfully decode and obtain the target information encoded by the second electronic device.

[0029] In some implementations, the target information includes at least one of the following: a connection pairing code for the second electronic device, account login information, a product serial number, and a media access control MAC address.

[0030] In other examples, the target information may also include other content, such as meeting links, which are not limited in the embodiments of this application.

[0031] In some implementations, the particle points are distributed in a ring-shaped region.

[0032] In other examples, the particle points can also be distributed in other shapes, such as rectangles or other regular or irregular shapes.

[0033] In some implementations, the positioning points include external positioning points and internal positioning points, wherein the positioning points are displayed cyclically according to a first preset color order, including: the external positioning points are displayed cyclically according to a first color, a second color, and a third color, and the internal positioning points are displayed cyclically according to a second color, a third color, and a first color, wherein the first color, the second color, and the third color are all different.

[0034] Optionally, the information points are displayed cyclically according to a second preset color order, including: the information points are displayed cyclically according to a third color, a first color, and a third color.

[0035] For example, the first color is yellow, the second color is blue, and the third color is gray. Alternatively, the first, second, and third colors can be other colors.

[0036] In some implementations, the method further includes: determining a positioning display area based on the positioning point in the particle points; and determining the version number of the second electronic device based on the number of information points in the display area, wherein different version numbers correspond to different numbers of information points in the display area.

[0037] For example, the number of information points contained in the display area is different, and the corresponding version number of the second electronic device is different.

[0038] It should be understood that the first electronic device can also determine the version number of the second electronic device based on the number of information points in the display area included in multiple frames.

[0039] It should be understood that the version number of the second electronic device can be the system version number of the second electronic device, or it can be the version number of the second electronic device used to encode information.

[0040] Based on the embodiments of this application, the first electronic device can determine the version number of the second electronic device by the number of information points in the decoded display area, thus enabling the first electronic device to conveniently and quickly determine the version number of the second electronic device. In this way, the method by which the first electronic device determines the version number of the second electronic device is relatively simple and efficient.

[0041] In some implementations, the particle dots also include version number dots that indicate the version number of the second electronic device, wherein the version number dots are displayed cyclically in a third preset color order within the same frame of the first image.

[0042] Optionally, the number of version number points is a preset number. For example, the version number points are 4, 5, etc.

[0043] The third preset color order is different from the first and second preset color orders. For example, the third preset color order is the fourth color, the fifth color, and the sixth color, and each of the fourth, fifth, and sixth colors is different.

[0044] For example, the fourth, fifth, and sixth colors correspond to one of green, red, and gray, respectively. For instance, the fourth color is green, the fifth color is red, and the sixth color is gray. Or, the fourth color is red, the fifth color is gray, and the sixth color is green.

[0045] It should be understood that the fourth, fifth, and sixth colors can also be other colors, and this application embodiment does not limit them.

[0046] Optionally, the difference between the centroid of the triangle formed by the fourth, fifth, and sixth colors in the color gamut diagram and the centroid of the triangle formed by the first, second, and third colors in the color gamut diagram is less than a preset difference. This allows the information points and positioning points to be closer to the color of the version number, enabling them to be better hidden in the background.

[0047] Based on the embodiments of this application, the particle dots may also include version number dots for indicating the version number. In the same frame image, the version number is displayed cyclically according to a preset color order. In this way, the version number dots can be well hidden in the background, so that the user cannot perceive the existence of these particle dots with the naked eye.

[0048] In some implementations, the method further includes: performing intra-frame difference processing on the N-frame third image using a second intra-frame difference parameter to obtain an N-frame fifth grayscale image; and cropping the N-frame fifth grayscale image according to the target region to obtain the N-frame sixth grayscale image.

[0049] It should be understood that the intra-frame differential parameters in the second frame are different from those in the first frame. Alternatively, the different differential parameters can be understood as the first electronic device using a different differential mode for information points and location points than it uses for version number points. This allows the first electronic device to filter out version number points when extracting information points and location points, and vice versa, thereby increasing the likelihood of successful decoding.

[0050] In some implementations, extracting the particle points from the first image based on the target region includes: filtering M frames of sixth grayscale images in the N frames of sixth grayscale images using a second annular region capable of covering the version number point to obtain M frames of seventh grayscale images, wherein each frame of the M frames of seventh grayscale images retains the portion covered by the second annular region, and M is less than or equal to N; performing inter-frame difference processing on the M frames of seventh grayscale images to obtain M frames of eighth grayscale images; performing binarization processing on the M frames of eighth grayscale images to obtain M frames of binary images B; performing an OR operation on the M frames of binary images B to obtain a third target binary image; filtering interference points on the third target binary image to obtain a fourth target binary image; and extracting the version number point from the particle points in the fourth target binary image.

[0051] For example, the second annular region that can cover the version number point can be used as a mask to filter the sixth grayscale image, so as to retain the part covered by the second annular region (including the version number point).

[0052] In some examples, if the version number point is encoded on the inner circle of the positioning point, then the second annular region can be an annular region that covers the inner circle.

[0053] In some examples, if the version number point is encoded on the outer circle of the outer circle of the positioning point, then the second annular region can be an annular region covering the outer circle.

[0054] Based on the embodiments of this application, the first electronic device can successfully extract the version number point from the particle points.

[0055] In some implementations, determining the target information encoded in the particle points based on their distribution includes: determining an angle sequence based on the angle between every two adjacent version number points; and determining the version number of the second electronic device based on the relationship between the angle sequence and a preset angle sequence, wherein different version numbers correspond to different preset angle sequences.

[0056] It should be understood that the first electronic device can determine the angle sequence between every two adjacent version number points in a preset order. For example, if there are 4 version number points, the angle sequence can include 4 angle values.

[0057] For example, version number 1 corresponds to preset angle sequence 1, version number 2 corresponds to preset angle sequence 2, and version number 3 corresponds to preset angle sequence 3.

[0058] Based on the embodiments of this application, the first electronic device can determine the angle sequence according to the distribution of version number points, and match the angle sequence with a preset angle sequence to determine the version number of the second electronic device.

[0059] In some implementations, determining the version number of the second electronic device based on the relationship between the angle sequence and a preset angle sequence includes: matching the angles in the angle sequence with the corresponding angles in the preset angle sequence to determine the number of valid angles in the angle sequence; when the number of valid angles in the angle sequence is greater than a first preset number, determining the version number of the second electronic device to be the version number corresponding to the preset angle sequence.

[0060] For example, when the difference between the first angle in the angle sequence and the first angle in the preset angle sequence is small (e.g., the difference is less than the preset value), the first angle can be determined to be a valid angle.

[0061] For example, if the angle sequence includes 4 angles, then the first preset quantity can be 2.

[0062] Based on the embodiments of this application, when an angle sequence is matched with a certain preset angle sequence, if the number of effective angles is greater than a first preset number, the version number of the second electronic device can be determined to be the version number corresponding to the preset angle sequence.

[0063] In some implementations, the version number point is located on the circle where the positioning point is located, and each version number point is located between two adjacent positioning points.

[0064] It should be understood that the circle containing the positioning point can be either the inner circle or the outer circle.

[0065] In other examples, the two version number points in this version number point may also be located between two adjacent positioning points, which is not limited in the embodiments of this application.

[0066] Based on the embodiments of this application, when the version number point is located on the inner or outer circle of the positioning point, the version number point can be made to not affect the encoding of the information point.

[0067] Furthermore, when the version number point is located on the inner circle, the image obtained by the second cropping of the first electronic device can be smaller, thus reducing the amount of data of the first electronic device.

[0068] In some implementations, the method further includes: when it is determined that the version number of the second electronic device is higher than the version number of the first electronic device, displaying a first prompt message, the first prompt message being used to prompt the first electronic device to be upgraded, or the first prompt message being used to prompt the user to establish a connection relationship with the second electronic device using a connection pairing code.

[0069] For example, the first prompt message could be the text "Scan failed" and "The current version is too low and cannot parse the pattern of the other device. Please connect via connection code or upgrade and try again."

[0070] Based on the embodiments of this application, when the first electronic device determines that the version number of the second electronic device is higher than the version number of the first electronic device, it can display a first prompt message, thereby prompting the user that the current version of the first electronic device is low and needs to be upgraded. Alternatively, when scanning a pattern to connect devices, the first prompt message can also be used to prompt the user to establish a connection relationship with the second electronic device using a connection pairing code or manually.

[0071] In a second aspect, a method for information transmission is provided, the method being applied to a second electronic device, the method comprising: generating particle points encoded with target information; displaying a first image, the first image including particle points encoded with target information, the particle points including positioning points for locating a display area and information points for indicating data, wherein, in the same frame of the first image, the positioning points are displayed cyclically according to a first preset color order, and the information points are displayed cyclically according to a second preset color order.

[0072] Based on the embodiments of this application, the coded particles in the first image displayed by the second electronic device include positioning points and information points. In the same frame of the first image, the positioning points are displayed cyclically according to a first preset color order, and the information points are displayed cyclically according to a second preset color order. In this way, the positioning points and information points can be displayed cyclically according to different colors, thereby increasing the concealment of the particle points.

[0073] In some implementations, the particle dots also include version number dots that indicate the version number of the second electronic device, wherein the version number dots are displayed cyclically in a third preset color order within the same frame of the first image.

[0074] Based on the embodiments of this application, the particle dots encoded by the second electronic device may further include version number dots for indicating the version number. In the same frame image, the version number is displayed cyclically according to a preset color order. In this way, the version number dots can be well hidden in the background, making the existence of these particle dots imperceptible to the user's naked eye.

[0075] Thirdly, this application provides an electronic device, including: one or more processors; one or more memories; the one or more memories storing one or more programs, which, when executed by one or more processors, cause the information transmission method as described in the first to second aspects and any possible implementation thereof to be executed.

[0076] Fourthly, this application provides an apparatus including modules for implementing information transmission methods as described in the first to second aspects and any possible implementation thereof.

[0077] Fifthly, this application provides a chip including a processor and a communication interface. The communication interface is used to receive signals and transmit signals to the processor, and the processor processes the signals so that the information transmission method as described in the first to second aspects and any possible implementation thereof is executed.

[0078] In a sixth aspect, this application provides a readable storage medium storing instructions that, when executed on an electronic device, cause the information transmission method as described in the first to second aspects and any possible implementation thereof to be performed.

[0079] In a seventh aspect, this application provides a program product comprising program code that, when executed on an electronic device, causes the information transmission method as described in the first to second aspects and any possible implementation thereof to be performed. Attached Figure Description

[0080] Figure 1 is a schematic diagram of the structure of the electronic device provided in an embodiment of this application.

[0081] Figure 2 is a schematic diagram of the software structure of the electronic device provided in an embodiment of this application.

[0082] Figure 3 is a schematic diagram of a scenario to which the embodiments of this application can be applied.

[0083] Figure 4 is a schematic diagram of an electronic device dividing a ring pattern into regions according to an embodiment of this application.

[0084] Figure 5 is a schematic diagram of another electronic device provided in this application for dividing a ring pattern into regions.

[0085] Figure 6 is a schematic diagram of a possible distribution of information points provided in an embodiment of this application.

[0086] Figure 7 is a schematic diagram of the particle points included in a ring pattern provided in an embodiment of this application.

[0087] Figure 8 is a schematic flowchart of a decoding method provided in an embodiment of this application.

[0088] Figure 9 is a schematic diagram of a distance determination method provided in an embodiment of this application.

[0089] Figure 10 is a schematic flowchart of an embodiment of this application for extracting ROI.

[0090] Figure 11 is a schematic diagram of ROI extraction provided in an embodiment of this application.

[0091] Figure 12 is a schematic diagram of analyzing pixels in an image to extract the Region of Interest (ROI) according to an embodiment of this application.

[0092] Figure 13 is a schematic diagram of determining an image containing particle points according to an embodiment of this application.

[0093] Figure 14 is a schematic flowchart illustrating the determination of positioning points and information points according to an embodiment of this application.

[0094] Figure 15 is a schematic diagram of the result of determining positioning points and information points provided in an embodiment of this application.

[0095] Figure 16 is a schematic flowchart of an embodiment of this application for filtering interference points.

[0096] Figure 17 is a schematic diagram of sorting based on the product of the target brightness difference and the number of target connected regions provided in an embodiment of this application.

[0097] Figure 18 is a schematic diagram of a positioning point completion method provided in an embodiment of this application.

[0098] Figure 19 is a schematic flowchart of determining a connection pairing code based on a location point and an information point according to an embodiment of this application.

[0099] Figure 20 is a schematic diagram of determining the location of an information point according to an embodiment of this application.

[0100] Figure 21 is a schematic diagram of information point extraction in an embodiment of this application.

[0101] Figure 22 is a schematic diagram of obtaining a connection pairing code through multi-frame fusion according to an embodiment of this application.

[0102] Figures 23 and 24 are schematic diagrams of a multi-round fusion provided in an embodiment of this application.

[0103] Figure 25 is a schematic diagram of decoding between different versions of electronic devices provided in an embodiment of this application.

[0104] Figure 26 is a schematic diagram of a set of GUIs provided in an embodiment of this application.

[0105] Figure 27 is a schematic diagram of an encoding version number point provided in an embodiment of this application.

[0106] Figure 28 is a schematic flowchart of determining the version number of an electronic device according to an embodiment of this application.

[0107] Figure 29 is a schematic diagram of determining an image containing a version number point according to an embodiment of this application.

[0108] Figure 30 is a schematic diagram of determining a binary image according to an embodiment of this application.

[0109] Figure 31 is a schematic flowchart of a method for filtering interference points provided in an embodiment of this application.

[0110] Figure 32 is a schematic diagram illustrating various possibilities of the decoding angle sequence of an electronic device provided in an embodiment of this application.

[0111] Figure 33 is a schematic flowchart of determining the version number based on the version number point provided in an embodiment of this application.

[0112] Figure 34 is a schematic flowchart of an embodiment of this application for determining a version number by angle sequence.

[0113] Figure 35 is a schematic diagram of a precise mask filtering of particle points provided in an embodiment of this application.

[0114] Figure 36 is a schematic diagram of determining information points according to an embodiment of this application.

[0115] Figure 37 is a schematic flowchart of an information transmission method provided in an embodiment of this application. Detailed Implementation

[0116] The technical solutions in this application will now be described with reference to the accompanying drawings.

[0117] The methods in this application embodiment can be applied to electronic devices such as smartphones, tablets, laptops, personal computers (PCs), ultra-mobile personal computers (UMPCs), netbooks, in-vehicle devices, smart TVs, wearable devices, foldable devices, and Internet of Things (IoT) devices.

[0118] Figure 1 shows a schematic diagram of the structure of electronic device 100. Electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, antenna 1, antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0119] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0120] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0121] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction opcode and timing signals to complete the control of fetching and executing instructions.

[0122] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0123] In some embodiments, the processor 110 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus interface, etc.

[0124] The I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL).

[0125] The I2S interface can be used for audio communication. In some embodiments, the processor 110 may include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to realize communication between the processor 110 and the audio module 170.

[0126] The PCM interface can also be used for audio communication, sampling, quantizing, and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via the PCM bus interface.

[0127] The UART interface is a universal serial data bus used for asynchronous communication. This bus can be a bidirectional communication bus. It converts the data to be transmitted between serial and parallel communication. In some embodiments, the UART interface is typically used to connect the processor 110 and the wireless communication module 160.

[0128] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display 194 and the camera 193.

[0129] The GPIO interface can be configured via software. It can be configured as a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to a camera 193, a display screen 194, a wireless communication module 160, an audio module 170, a sensor module 180, etc.

[0130] USB interface 130 is an interface that conforms to the USB standard specification, specifically it can be a Mini USB interface, Micro USB interface, USB Type C interface, etc. USB interface 130 can be used to connect a charger to charge electronic device 100, and it can also be used for data transfer between electronic device 100 and peripheral devices.

[0131] It is understood that the interface connection relationships between the modules illustrated in the embodiments of this application are merely illustrative and do not constitute a structural limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.

[0132] The charging management module 140 receives charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 receives charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 receives wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also supply power to the electronic device via the power management module 141.

[0133] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110.

[0134] The wireless communication function of electronic device 100 can be realized through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.

[0135] The mobile communication module 150 can provide wireless communication solutions, including 2G / 3G / 4G / 5G, for use on electronic devices 100.

[0136] The modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After processing by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs sound signals through an audio device (not limited to speaker 170A, receiver 170B, etc.) or displays images or videos through the display screen 194. In some embodiments, the modem processor may be a separate device. In other embodiments, the modem processor may be independent of the processor 110 and may be housed in the same device as the mobile communication module 150 or other functional modules.

[0137] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), Bluetooth low energy (BLE), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies.

[0138] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, so that electronic device 100 can communicate with networks and other devices through wireless communication technology.

[0139] Electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0140] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), or a display panel made of materials selected from organic light-emitting diodes (OLEDs), active-matrix organic light-emitting diodes (AMOLEDs), flexible light-emitting diodes (FLEDs), miniled, microled, micro-oled, or quantum dot light-emitting diodes (QLEDs). In some embodiments, electronic device 100 may include one or N displays 194, where N is a positive integer greater than 1.

[0141] Electronic device 100 can perform shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.

[0142] The ISP is used to process the data fed back by camera 193. Camera 193 is used to capture still images or videos.

[0143] A digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals.

[0144] Video codecs are used to compress or decompress digital video.

[0145] The external storage interface 120 can be used to connect an external storage card, such as a Micro SD card, to expand the storage capacity of the electronic device 100.

[0146] Internal memory 121 can be used to store computer executable program code, which includes instructions. Processor 110 executes various functional applications and data processing of electronic device 100 by running the instructions stored in internal memory 121.

[0147] Electronic device 100 can implement audio functions through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor.

[0148] The audio module 170 is used to convert digital audio information into analog audio signal output, and also to convert analog audio input into digital audio signal.

[0149] The loudspeaker 170A, also known as a "loudspeaker", is used to convert audio electrical signals into sound signals.

[0150] The receiver 170B, also known as the "earpiece", is used to convert audio electrical signals into sound signals.

[0151] The microphone 170C, also known as a "microphone" or "voice transducer," is used to convert sound signals into electrical signals.

[0152] The 170D headphone jack is used to connect wired headphones.

[0153] The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, an accelerometer sensor 180E, a distance sensor 180F, a fingerprint sensor 180H, a touch sensor 180K, a bone conduction sensor 180M, etc.

[0154] Button 190 includes the power button, volume buttons, etc.

[0155] Motor 191 can generate vibration alerts.

[0156] Indicator 192 can be an indicator light, used to indicate charging status, power changes, or to indicate messages, missed calls, notifications, etc.

[0157] The SIM card interface 195 is used to connect the SIM card.

[0158] Figure 2 is a software structure block diagram of an electronic device 100 according to an embodiment of this application. The layered architecture divides the software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the operating system is divided into four layers, from top to bottom: the application layer, the application framework layer, the system library, and the kernel layer. The application layer may include a series of application packages.

[0159] As shown in Figure 2, the application package may include applications (Apps) such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, SMS, and wallet.

[0160] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.

[0161] As shown in Figure 2, the application framework layer may include a window manager, content provider, view system, phone manager, resource manager, notification manager, etc.

[0162] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots, among other things.

[0163] Content providers store and retrieve data, making that data accessible to applications. This data may include videos, images, audio, made and received phone calls, browsing history and bookmarks, phone books, etc.

[0164] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.

[0165] The phone manager is used to provide communication functions for electronic device 100. For example, it manages call status (including connection and disconnection).

[0166] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.

[0167] The notification manager allows applications to display notifications in the status bar. These notifications can be used to deliver informational messages and can disappear automatically after a short pause, requiring no user interaction. For example, the notification manager can be used to notify users of download completion or message alerts. The notification manager can also display notifications as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating electronic devices, and flashing indicator lights.

[0168] The core library consists of two parts: one part contains the functionalities that the Java language needs to call, and the other part is the core library itself.

[0169] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.

[0170] System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.

[0171] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.

[0172] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.

[0173] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0174] A 2D graphics engine is a graphics engine for 2D drawing.

[0175] The kernel layer is the layer between hardware and software. The kernel layer contains at least the display driver, camera driver, audio driver, and sensor driver.

[0176] Before introducing the technical solutions in the embodiments of this application, the following is a brief introduction to some of the technical terms that may be involved in this application.

[0177] Image binarization: Setting the grayscale value of pixels in an image to 0 or 255. After image binarization, the entire image presents a visual effect with only black and white.

[0178] In scenarios where information needs to be transferred between electronic devices, QR code scanning is commonly used for device pairing, account login, and other similar tasks. For example, when a first electronic device needs to connect with a second electronic device, the second electronic device needs to scan the QR code displayed on the first electronic device to complete the pairing. However, scanning QR codes involves a lengthy and inconvenient interaction process.

[0179] In view of this, embodiments of this application provide a method and an electronic device for information transmission. In this technical solution, a second electronic device can encode the information to be transmitted in an image, and a first electronic device can scan the image displayed by the second electronic device to obtain the encoded information therein, so as to realize information transmission between the two. For example, when connecting devices, this method can conveniently realize the transmission of connection pairing codes, thereby shortening the path of device interaction and enhancing the sense of technology.

[0180] The technical solution for information transmission in the embodiments of this application will be described below with reference to Figures 3 to 21.

[0181] It should be understood that the embodiments of this application are illustrated using the transmission of device connection information between electronic devices as an example, but this should not limit the scenarios to which this application can be adapted.

[0182] For example, Figure 3 is a schematic diagram of a scenario to which the embodiments of this application can be applied.

[0183] In a device connection scenario, referring to Figure 3(a), the electronic device 200 can display a display interface 210, which can be used for device connection.

[0184] The display interface 210 may include specially designed patterns 211 (such as animated patterns). These specially designed patterns 211 can be used for device connection, account login, data transmission, and seamless connection between the electronic device 200 and other electronic devices. They can also be used for screen projection and meeting participation by the electronic device 200. For example, the display interface 210 may also include text prompts for user operation, such as "Connection Verification" or "Place the following pattern in the viewfinder of another device that is currently in use."

[0185] For example, the dynamic pattern can be a ring, such as the Hongmeng Ring (also known as the Galaxy Ring). The dynamic pattern can also be other shapes, such as rectangles, circles, ellipses, etc. For ease of description, this application embodiment uses a ring as an example to illustrate the dynamic pattern. The ring can be composed of multiple yellow, blue, and gray alternating particles, and the multiple yellow, blue, and gray alternating particles can encode the information that the electronic device 200 needs to transmit.

[0186] For example, the information to be transmitted may include device connection information, verification codes, account login information, screen sharing information, meeting information, etc. The device connection information can be a connection pairing code, such as the 6-digit number "147258". In other examples, the connection pairing code may also include English letters, or it may be 4 or 8 digits, etc.

[0187] Alternatively, the device connection information may also include other information about the electronic device 200, such as device identifier, model, media access control (MAC) address, etc.

[0188] For ease of description, this application uses a 6-digit connection pairing code as an example to illustrate the device connection information.

[0189] It should be understood that the electronic device 200 can encode the connection pairing information in a ring pattern using a certain encoding method. The implementation method of the electronic device 200 encoding the connection pairing information in a ring pattern will be described below with reference to specific embodiments, and will not be detailed here.

[0190] When electronic device 300 needs to connect with electronic device 200, electronic device 300 can scan the pattern 211 in the display interface 210 of electronic device 200 to obtain the connection pairing information encoded therein, and use the connection pairing information to establish a connection relationship with electronic device 200.

[0191] Referring to Figure 3(b), when electronic device 300 needs to connect to electronic device 200, electronic device 300 can display display interface 310. This display interface 310 may include a viewfinder 311 and text prompts such as "Scan to verify" and "Aim the viewfinder at the pattern on the new device".

[0192] It should be understood that the viewfinder 311 may be located at the center of the display interface 310 or at other locations on the display interface 310, and this application embodiment does not limit it.

[0193] It should also be understood that when the viewfinder 311 frames the pattern 211 in the display interface 210 of the electronic device 200, it can also display breathing effects or loading effects, which are not limited in the embodiments of this application.

[0194] For example, the breathing animation effect can be understood as the viewfinder 311 gradually capturing the pattern 211 from large to small when framing it. Furthermore, the viewfinder 311 can also display a dynamic change effect of the colored outline. It should be understood that the colored outline can be regular or irregular, and it can also rotate in a preset direction, or it can dynamically change from large to small and from small to large. Alternatively, when framing, the viewfinder 311 can also display a dynamic icon in the captured pattern 211 to indicate the loading content. Alternatively, when framing, the viewfinder 311 can also display a dynamic change effect of the loading process in the captured pattern 211.

[0195] For example, the new device may be an electronic device 200.

[0196] In other examples, the display interface 310 may also be a viewfinder display interface for a camera or a viewfinder display interface for a camera, but this application embodiment does not limit this.

[0197] In other examples, the display interface 310 may also be displayed in a semi-modal manner. For example, the display interface 310 may cover a portion of the previous display interface.

[0198] It should also be understood that the following description, in conjunction with specific embodiments, will introduce how the electronic device 300 obtains device connection information through ring pattern decoding, which will not be detailed here.

[0199] The following section will describe, with reference to Figures 4-7, the technical solution of encoding the connection pairing code in a ring pattern in the electronic device of this application embodiment.

[0200] For example, Figure 4 is a schematic diagram of an electronic device dividing a ring pattern into regions according to an embodiment of this application. As shown in Figure 4, the electronic device can divide the ring pattern into n display regions in a preset order, namely display region 1, display region 2, display region 3 to display region N, where N is greater than or equal to 6.

[0201] The electronic device can encode the 6-digit connection pairing code into the above N display areas in a preset order, with each display area encoding one digit.

[0202] For ease of description, we will take an example with N being 6 and the 6-digit connection pairing code being "318031".

[0203] For example, the electronic device encodes the first digit "3" in display area 1, the second digit "1" in display area 2, the third digit "8" in display area 3, the fourth digit "0" in display area 4, the fifth digit "3" in display area 5, and the sixth digit "1" in display area 6.

[0204] In some cases, electronic devices can also perform redundant encoding of the connection pairing code during encoding. This allows the peer device to still successfully obtain the connection pairing code even when some areas in regions 1 to n cannot be recognized by the peer device, thus increasing the likelihood of successful decoding by the peer device.

[0205] For example, N is 12, where display areas 1 to 6 encode a set of connection pairing codes "318031", and display areas 7 to 12 encode another set of the same connection pairing codes "318031".

[0206] In other examples, the electronic device may encode more sets of connection pairing codes, which is not limited to the embodiments of this application. This redundant encoding method can increase the likelihood of successful decoding by the peer device.

[0207] It should be understood that the electronic device can be the electronic device 200 mentioned above.

[0208] In other examples, continuing to refer to Figure 4, the sizes of the N display areas described above are not limited in this embodiment. In some examples, the N display areas may be the same size, or the N display areas may be different sizes.

[0209] For example, the electronic device divides the ring pattern into 12 equal display areas. This technical solution will be described below with reference to Figure 5.

[0210] Figure 5 is a schematic diagram of another electronic device providing an embodiment of this application dividing a ring pattern into regions. As shown in Figure 5, the electronic device can divide the ring pattern into 12 display areas, namely display area 1, display area 2 to display area 12.

[0211] For example, each display area can be positioned using a positioning structure. This positioning structure may include several positioning points.

[0212] The following explanation uses a positioning structure comprising four positioning points as an example. For display area 1, this positioning structure may include two external positioning points and two internal positioning points. The external positioning points are positioning points A1 and A2, and the internal positioning points are positioning points B1 and B2.

[0213] As can be understood, referring to Figure 5, the external positioning points of the positioning structure of all display areas are distributed on the same outer circle, and the internal positioning points of the positioning structure of all display areas are distributed on the same inner circle, and the outer circle and the inner circle have the same center.

[0214] In some examples, adjacent display areas may share two of the four positioning points. For example, adjacent display areas 1 and 2 may share an outer positioning point A2 and an inner positioning point B2. In other examples, adjacent display areas may not share positioning points.

[0215] In other examples, the positioning structure may also include two positioning points, which may be located diagonally across the display area. These two positioning points may include an outer positioning point and an inner positioning point. For example, for display area 1, the positioning structure may include positioning point A1 and positioning point B2, or the positioning structure may include positioning point A2 and positioning point B1.

[0216] It should also be understood that, in this embodiment of the application, the electronic device may further divide the 12 display areas into multiple encoding areas. For example, referring to Figure 5, display area 1 and display area 2 can be encoding area 0, display area 3 and display area 4 can be encoding area 1, and display area 5 and display area 6 can be encoding area 2.

[0217] Specifically, the first digit of the coded connection pairing code in display area 1, the second digit of the coded connection pairing code in display area 2, the third digit of the coded connection pairing code in display area 3, the fourth digit of the coded connection pairing code in display area 4, the fifth digit of the coded connection pairing code in display area 5, and the sixth digit of the coded connection pairing code in display area 6.

[0218] It should be understood that different encoding regions can correspond to different encoding methods, and different encoding methods have different code tables. That is, encoding region 0 has one code table, encoding region 1 has one code table, and encoding region 2 has one code table. Based on the code table, electronic devices can encode and decode data.

[0219] Referring again to Figure 5, display area 7 can be encoded area 1, where the fourth digit of the encoding connection pairing code is used. Display areas 8 and 9 are encoded areas 2, where the fifth digit of the encoding connection pairing code is used in display area 8, and the sixth digit is used in display area 9. Display areas 10 and 11 are encoded areas 0, where the first digit of the encoding connection pairing code is used in display area 10, and the second digit is used in display area 11. Display area 12 can be encoded area 1, where the third digit of the encoding connection pairing code is used.

[0220] Thus, in the example shown in Figure 5, the order of the encoded areas of the ring pattern from display area 1 to display area 12 is "001122122001", corresponding to the sequence number of the connection pairing code "123456456123". Taking the connection pairing code "318031" as an example, the numbers encoded in display areas 1 to 12 are "318031031318". This redundant encoding method increases the likelihood that the peer device will successfully obtain the correct connection pairing code.

[0221] It should be understood that in other examples, the order of the above-mentioned encoding regions may be other orders, or the order of the sequence numbers of the connection pairing codes may be other orders, which are not limited in the embodiments of this application.

[0222] In some cases, the display area defined by the above positioning structure may include several information points. Electronic devices can encode different numbers based on different distribution patterns of these information points. The distribution pattern of information points in this application will be described below with reference to Figure 6.

[0223] For example, Figure 6 is a schematic diagram of a possible distribution of information points provided in an embodiment of this application. As shown in Figure 6, each display area may include a rows and b columns, for a*b possible distributions of information points.

[0224] For ease of description, this application embodiment uses 4 for a and 5 for b, that is, each display area includes 20 possibly distributed information points as an example.

[0225] For example, display area 1 includes four positioning points and 20 potentially distributed information points, which are numbered from 0 to 19. Referring to Figure 6, the information point closest to the internal positioning point B1 is numbered 0, and the other information points are numbered sequentially according to the row order.

[0226] It should be understood that the specific numbering order of the information points is not limited in the embodiments of this application. In other examples, the numbering order of the information points can also be the reverse of that in Figure 6. For example, the information point closest to the internal positioning point B1 is numbered 19, and the other information points are numbered sequentially according to the row order.

[0227] It should be understood that in the embodiments of this application, the information points appearing in different positions in the above numbering represent different digits of the code.

[0228] For example, Table 1 shows a code table containing a link pairing code with multiple coding regions. In Table 1, the coding regions include coding region 0, coding region 1, and coding region 2. The coding data corresponding to each coding region is 0-9, and the possible information points corresponding to each coding data are numbered 0-19.

[0229] Table 1

[0230] It is understandable that the sequence number of the encoded data in Table 1 can be 0-29, where encoded area 0 corresponds to sequence number 0-9, encoded area 1 corresponds to sequence number 10-19, and encoded area 2 corresponds to sequence number 20-29.

[0231] Based on Table 1, the electronic device can generate information points at corresponding locations in different display areas according to the numbers to be transmitted. The value of each information point can be 1 or 0, where a value of 1 indicates that there is an information point at that location, and a value of 0 indicates that there is no information point at that location.

[0232] For example, taking the distribution of the annular area in Figure 6 as an example, it shows that area 1 belongs to the coding area 0, and the first number in the pairing code is "0". According to the code table corresponding to the coding area 0 in Table 1, it can be determined that the value of the information point numbered "0 and 1" corresponding to the coded data "0" is 1, and the rest are 0.

[0233] The encoding result is shown in Figure 6. In display area 1, solid circles are displayed at the information points numbered 0 and 1, while hollow circles are displayed in the remaining positions. This means that a specific graphic can be displayed in a first manner at the locations with information points, and in a second manner (different from the first manner) at other locations. In other examples, solid circles are displayed at the information points numbered 0 and 1 in display area 1, while no circles are displayed in the remaining positions; that is, display area 1 only contains the specific graphic displayed at the information points numbered 0 and 1.

[0234] For example, if the first digit in the pairing code is "1", then according to the code table corresponding to encoding area 0 in Table 1, it can be determined that the encoded data "1" corresponds to the information points numbered "2" and "3" with a value of 1, and the rest with 0. This encoding result is not shown in the figure, but can be deduced by referring to the example in Figure 6. For example, solid circles can be displayed at the information points numbered 2 and 3 in display area 1, and hollow circles can be displayed at the other positions, and so on.

[0235] It should be understood that the encoding process for other numbers in the pairing code can be completed in the same way, which will not be detailed here.

[0236] It should be understood that, for ease of illustration, the solid circle of the information point in Figure 6 is depicted as black. In other examples, the color of the information point can also be other colors, such as yellow, blue, gray, etc., which are not limited in the embodiments of this application.

[0237] It should also be understood that the shape of the information point is not limited in the embodiments of this application. In other examples, the information point may also be a rectangle, triangle or other irregular shape.

[0238] In some cases, to better conceal the location points and encoded information points, making them less visible to the user, the electronic device in this embodiment can use random colors when generating the location points and information points. This technical solution will be described below with reference to Figure 7.

[0239] For example, FIG7 is a schematic diagram of a ring pattern including particle points provided in an embodiment of this application. As shown in FIG7, the particle points may include positioning points and information points.

[0240] The positioning points can include 12 outer circle positioning points and 12 inner circle positioning points. The outer circle positioning points are A1, A2, A3, ..., A12, and the inner circle positioning points are B1, B2, B3, ..., B12.

[0241] Each display area can include two information points, for a total of 24 information points. The information points are numbered C1, C2, C3, ..., C12 from display area 1 to display area 12.

[0242] When the electronic device displays the aforementioned particle points, in the same frame of the image, the 12 outer circular positioning points A1, A2, A3, ..., A12 are displayed in a cycle according to the first color, the second color, and the third color, respectively; the 12 outer circular positioning points B1, B2, B3, ..., B12 are displayed in a cycle according to the second color, the third color, and the first color, respectively; and the 24 information points C1, C2, C3, ..., C12 are displayed in a cycle according to the third color, the first color, and the second color, respectively. Moreover, the first color, the second color, and the third color are all different.

[0243] For example, the first color is yellow, the second color is blue, and the third color is gray. In the same frame, A1 is displayed as yellow, A2 as blue, A3 as gray, ..., A10 as yellow, A11 as blue, and A12 as gray. B1 is displayed as blue, B2 as gray, B3 as yellow, ..., B10 as blue, B11 as gray, and B12 as yellow. C1 is displayed as gray, C2 as yellow, C3 as blue, ..., C22 as gray, C23 as yellow, and C24 as blue.

[0244] In other examples, in the same frame of the image, the positioning points can be displayed in the manner described above, but the information points in display areas 1 to 12 are displayed in a cycle of the third color, the first color, and the second color, and the first color, the second color, and the third color are all different.

[0245] For example, the first color is yellow, the second color is blue, and the third color is gray. In this case, information points C1 and C2 in display area 1 are displayed in gray, information points C3 and C4 in display area 2 are displayed in yellow, information points C5 and C6 in display area 3 are displayed in blue, ..., information points C19 and C20 in display area 10 are displayed in gray, information points C21 and C22 in display area 11 are displayed in yellow, and information points C23 and C24 in display area 12 are displayed in blue.

[0246] It should be understood that the first color, the second color, and the third color can also be other colors, and this application embodiment does not limit them.

[0247] It should be understood that when displaying the above-mentioned particle points, the electronic device can also display other particle points that do not contain information. See Figure 3(a) above. The display interface 210 can be a frame of image displayed by the electronic device. The ring pattern in the image hides the above-mentioned positioning points, information points and other particle points that do not contain information, and has the effect of multiple particle points converging into a ring.

[0248] In this way, the outer circle positioning point, the inner circle positioning point, and the information point are displayed in a cycle according to different colors, which can better hide the particle points in the image and achieve a display effect that is imperceptible to the user's naked eye.

[0249] The encoding process of the electronic device has been described above with reference to Figures 4-7. In this embodiment, after the electronic device encodes the connection pairing code, the peer electronic device can use a camera to capture or scan the display interface of the electronic device that contains the encoded connection pairing code, and decode the acquired image to determine the encoded connection pairing code, and establish a connection relationship with the electronic device based on the connection pairing code. The decoding process of the peer electronic device in this embodiment will be described below with reference to Figures 8-24.

[0250] For example, FIG8 is a schematic flowchart of a decoding method provided in an embodiment of this application. As shown in FIG8, the method 400 may include steps 410 to 470.

[0251] 410, The first electronic device acquires image A1.

[0252] For example, the first electronic device can capture an image A1 by using a camera to photograph the display interface of the second electronic device used for device connection. It should be understood that this image A1 can be used to perform a display interface 210, which may be the electronic device 200 mentioned above.

[0253] It should be understood that the first electronic device may be the electronic device 300 mentioned above, and the second electronic device may be the electronic device 200 mentioned above.

[0254] 420, the first electronic device determines whether the distance A between itself and the second electronic device is greater than a preset distance.

[0255] In some examples, when the first electronic device determines that the distance A between itself and the second electronic device is greater than a preset distance, it can be understood that the distance between the first electronic device and the second electronic device is too far. In this case, the first electronic device may not execute the process in the embodiments of this application.

[0256] It should be understood that the execution order of steps 410-420 is not limited in the embodiments of this application. In other examples, step 410 may be executed after step 420, or steps 410 and 420 may be executed simultaneously.

[0257] In some examples, when the first electronic device determines that the distance A between itself and the second electronic device is less than or equal to a preset distance, step 430 in the embodiments of this application can continue to be executed.

[0258] It should be understood that the specific value of the preset distance is not limited in the embodiments of this application. For example, the preset distance is 60 cm or 50 cm, etc.

[0259] For example, the first electronic device can determine the distance between itself and the second electronic device using depth of time flight (DToF). See Figure 9, which is a schematic diagram illustrating a distance determination method according to an embodiment of this application.

[0260] As shown in Figure 9, when measuring the distance between the first electronic device and the second electronic device, the first electronic device can emit a light pulse signal at time T1. After the light pulse signal encounters the second electronic device, it is reflected back. Assuming that the first electronic device receives the reflected signal at time T2, the distance between the first electronic device and the second electronic device can be expressed by the following formula.

[0261] Where d represents the distance between the first electronic device and the second electronic device; c represents the speed of light in the medium; and Δt represents the time difference between transmitting the light pulse signal and receiving the return signal, which is T2-T1 in this case.

[0262] For example, the first electronic device may include a DToF sensor and emit light pulse signals through the DToF sensor. For example, the carrier of the light pulse signal may be laser light or infrared light.

[0263] In other examples, the first electronic device may also determine the distance to the second electronic device by means of camera ranging, which is not limited in the embodiments of this application.

[0264] In some examples, the first electronic device can also determine the distance to the second electronic device by the size of the annular region in the acquired image A1.

[0265] For example, the first electronic device may include a correspondence between the size of the annular region and the distance. When the first electronic device acquires image A1, it can determine the corresponding distance based on the size of the annular region in image A1.

[0266] In other examples, when the first electronic device determines that the distance between itself and the second electronic device is greater than a preset distance, the first electronic device may also scale the image A1. For example, after the first electronic device scales the image A1, the annular region in the image A1 is magnified by X times, so that the distance corresponding to the magnified annular region is less than or equal to the preset distance.

[0267] Furthermore, if the first electronic device fails to decode the ring-shaped area even after magnifying it by a preset magnification, it can display prompt message 1. Prompt message 1 instructs the user to shorten the distance between the first and second electronic devices. For example, prompt message 1 may include text such as "Please place the ring-shaped pattern within the viewfinder" or "Please move closer to the new device and place the complete pattern within the scanning frame," etc. It should be understood that the specific text content of prompt message 1 is not limited in this embodiment.

[0268] In other examples, when the camera performance of the first electronic device is not high, scaling image A1 may result in low image quality after scaling, affecting the decoding result. In this case, when the first electronic device determines that the distance between it and the second electronic device is greater than the preset distance, the first electronic device may also directly display the prompt message 1.

[0269] In other examples, when the first electronic device determines that the distance between itself and the second electronic device is greater than a preset distance, the first electronic device may also directly display the prompt message 1.

[0270] 430, The first electronic device extracts the region of interest (ROI) from image A1.

[0271] It should be understood that the ROI is the region in image A1 that contains the aforementioned location points and information points. For example, referring to Figure 3(a), the ROI is the region containing the annular pattern 211.

[0272] In this embodiment of the application, the first electronic device can extract the region of interest (ROI) from the image A1, which is beneficial for subsequent processing of the ROI to obtain the encoded location points and information points therein.

[0273] As shown in Figures 10 and 11, Figure 10 is a schematic flowchart of ROI extraction provided by an embodiment of this application, and Figure 11 is a schematic diagram of ROI extraction provided by an embodiment of this application.

[0274] Referring to Figure 10, step 430 may include at least steps 431 to 436.

[0275] 431. The first electronic device crops image A1 to obtain image B1.

[0276] Because there is a certain distance between the first electronic device and the second electronic device, when the first electronic device captures the display interface displayed by the second electronic device for device connection, the resulting image A1 includes not only the display interface of the second electronic device but also other areas such as the border of the second electronic device. If the first electronic device processes the entire image A1, it will increase the decoding workload of the first electronic device. Therefore, step 431 can be understood as the first electronic device pre-cropping image A1 to roughly obtain image B1 containing a ring-shaped region, where the ring-shaped region is the area of ​​encoding positioning points and information points. The following section describes the technical solution for the first electronic device to crop image A1 to obtain image B1 with reference to Figure 11.

[0277] As shown in Figure 11, assuming image A1 has a length of w and a width of h, after cropping image A1, the resulting image B1 has a length w' = w - (Δw0 + Δw1) and a width h' = h - (Δh0 + Δh1). Here, Δw0 is the length of the cropped left portion of image A1, Δw1 is the length of the cropped right portion of image A1, Δh0 is the width of the cropped upper portion of image A1, and Δh1 is the width of the cropped lower portion of image A1. It should be understood that Δw0, Δw1, Δh0, and Δh1 can be preset values, and the specific values ​​of these preset values ​​are not limited in this embodiment.

[0278] For example, referring to (a) to (b) in Figure 11, (a) in Figure 11 is image A1. After the first electronic device crops image A1, it obtains image B1 in (b) in Figure 11.

[0279] 432. The first electronic device downsamples image B1 based on distance A to obtain image C1.

[0280] After obtaining image B1, the first electronic device can downsample image B1 according to the distance A determined in step 420 to obtain image C1.

[0281] It should be understood that after downsampling image B1, the resulting image C1 is smaller than the image B1, but image C1 still includes the aforementioned annular pattern.

[0282] For example, the first electronic device can set different downsampling ratios for different distances. For instance, when the distance A is less than the distance d0, the first electronic device can set the downsampling ratio to ratio 1, and when the distance A is greater than d0 and less than or equal to d1, the first electronic device can set the downsampling ratio to ratio 2, where d0 is less than d1 and ratio 1 is greater than ratio 2.

[0283] It should be understood that the embodiments of this application do not limit the specific values ​​of the distances d0 and d1. For example, d0 can be 30 or 25 cm, and d1 can be 60 or 55 cm, etc. The embodiments of this application do not limit the specific values ​​of the distance multiplier 1 and multiplier 2. For example, multiplier 1 can be 8 times or 7 times, and multiplier 2 can be 4 times or 3 times, etc.

[0284] Referring to Figure 11(c), after downsampling image B1, the first electronic device obtains image C1 as shown in Figure 11(c), and the size of image C1 is smaller than that of image B1.

[0285] In this way, the first electronic device can dynamically set the downsampling rate according to different distances between it and the second electronic device, so that the first electronic device can obtain a suitable image C1 at different distances.

[0286] 433, The first electronic device blurs image C1 to obtain image D1.

[0287] It should be understood that the specific means used by the first electronic device to blur image C1 in the embodiments of this application are not limited.

[0288] For example, the first electronic device can perform Gaussian blur processing on image C1 to obtain the high-frequency information portion of image C1. By blurring image C1, noise and detail information in image C1 can be reduced, making subsequent image processing by the first electronic device more accurate and stable.

[0289] Referring to Figure 11(d), the first electronic device blurs the image C1 to obtain the image D1 shown in Figure 11(d).

[0290] It should be understood that step 433 is an optional step, and in some examples, step 433 may not be performed. This application embodiment does not limit this.

[0291] 434. The first electronic device performs high-pass filtering on image C1 through image D1 to obtain image E1.

[0292] It should be understood that step 434 is an optional step, and in some examples, step 434 may not be performed. This application embodiment does not limit this.

[0293] 435. The first electronic device performs binarization processing on image E1 to obtain binary image F1.

[0294] For example, the first electronic device converts image E1 from the red, green, and blue (RGB) color space to the hue, saturation, and value (HSV) color space and performs binarization. For instance, the first electronic device can set pixel grayscale thresholds in the H, S, and V domains respectively. When the pixel value of a pixel in image E1 is greater than or equal to a grayscale threshold in the H, S, or V domains, the grayscale value of that pixel is set to 255. When the pixel value of a pixel is less than one of the grayscale thresholds in the H, S, or V domains, the pixel value of that pixel is set to 0. Therefore, the grayscale values ​​of the pixels in image F1 are either 0 or 255, and the binary image F1 visually presents a black-and-white effect.

[0295] 436. The first electronic device performs closing and opening operations on the binary image F1 to obtain image G1.

[0296] For example, the first electronic device can set the kernel functions for closing and opening operations according to the distance A, so that the first electronic device can perform closing and opening operations quickly, thereby reducing the processing and computational load of the first electronic device.

[0297] For example, the opening operation can first erode the image F1 and then dilate it so that the discrete points form a connected region.

[0298] For example, eroding an image F1 can be understood as using a first rectangle (m pixels wide and n pixels high), placing each pixel X in the image F1 at the center of the first rectangle, traversing all other pixels covered by the first rectangle, and modifying the value of pixel X to the minimum value among the pixels covered by the first rectangle.

[0299] Dilatation of image F1 can be understood as using a first rectangle (m pixels wide and n pixels high). For each pixel X in image F1, pixel X is placed at the center of the first rectangle. All other pixels covered by the first rectangle are traversed, and the value of pixel X is modified to the largest value among the pixels covered by the first rectangle.

[0300] For example, the closing operation can first dilate the image F1 and then erode it so that the discrete points form a connected region.

[0301] The first rectangle can be dynamically set according to the distance A between the first electronic device and the second electronic device.

[0302] It should be understood that, referring to (e) in Figure 11, after the first electronic device performs closing and opening operations on the binary image, the resulting image G1 has a connected region composed of particle points in the annular region.

[0303] 437, The first electronic device extracts the ROI from image G1.

[0304] For example, referring to (f) in Figure 11, the first electronic device can perform ellipse fitting on the connected components in image G1 to obtain a ROI containing a circular region.

[0305] It should be understood that the embodiments of this application are not limited to a specific fitting method. In other examples, the first electronic device may also employ other fitting methods, etc.

[0306] In this way, the first electronic device can successfully provide the ROI containing the annular region, so that when decoding the image displayed by the second electronic device, it can be decoded according to the ROI, thereby saving the computational workload of the first electronic device.

[0307] In other examples, the first electronic device can also extract the ROI by analyzing the pixels in image G1. Referring to Figure 12, which is a schematic diagram of analyzing pixels in image G1 to extract the ROI according to an embodiment of this application, the first electronic device can, for example, accumulate the pixel values ​​in the same column on the x-axis of the pixel matrix in image G1 and plot them as a line graph on the y-axis.

[0308] This line graph exhibits a double-hump characteristic. The area with dramatic changes in the hump is a ring-shaped region, while the area in the middle of the hump with a gentler change is the inner diameter region of the ring. The center of this inner diameter region is the x-axis coordinate of the circle. Since the ratio of the inner diameter to the outer diameter of the ring-shaped region is fixed, the size of the outer diameter of the ring-shaped region can be determined.

[0309] Similarly, by summing the pixel values ​​in the same column along the y-axis of the pixel matrix in image G1 and plotting the sum as the x-axis value to create a line graph, the inner and outer diameters of the annular region, as well as the y-axis coordinates of the center, can be determined. Thus, the coordinates of the center and the location of the annular region can be determined, successfully extracting the ROI containing the annular region.

[0310] In other examples, the first electronic device may also extract the ROI in other ways, such as by clustering the particle points to extract the ROI containing the annular region.

[0311] 440. The first electronic device crops the acquired n-frame image A2 according to the ROI to obtain n-frame image E2 containing particle points.

[0312] In some examples, see Figure 13, which is a schematic diagram of determining an image containing particle points according to an embodiment of this application. As shown in Figure 13, step 440 may include steps 441 to 446.

[0313] 441, The first electronic device acquires n frames of image A2.

[0314] For example, the first electronic device can acquire n frames of image A2 via a camera.

[0315] It should be understood that image A2 includes the display interface of the second electronic device for device connection. The n-frame image A2 may also include image A1.

[0316] 442. The first electronic device pre-crops the n-frame image A2 to obtain the n-frame image B2.

[0317] For example, the first electronic device can pre-crop each frame of the n-frame image A2 to obtain the n-frame image B2.

[0318] It should be understood that the process of the first electronic device pre-cropping each frame of image A2 can be referred to in step 431 above, and will not be repeated here for the sake of brevity.

[0319] 443. The first electronic device downsamples the n-frame image B2 according to the ROI to obtain the n-frame image C2.

[0320] Since the first electronic device has already processed image A1 in step 430 to obtain the ROI containing the annular region, it can downsample n frames of the image based on this ROI to more accurately set the downsampling rate.

[0321] For example, referring to (f) in Figure 11, the ROI has a bounding rectangle. The first electronic device can downsample each frame of the n-frame image B2 according to the length of the bounding rectangle of the ROI.

[0322] The following explanation uses the example of a first electronic device downsampling one frame of image B2 out of n frames. For instance, when the larger of the length or width of the bounding rectangle of the ROI is greater than a preset value, the first electronic device downsamples image B2 by a factor of one. If the larger of the length or width of the bounding rectangle of the ROI in the downsampled image is still greater than the preset value, downsampling by a factor of one continues until the larger of the length or width of the bounding rectangle of the ROI is still less than or equal to the preset value, resulting in one frame of image C2.

[0323] It should be understood that the specific value of the preset value is not limited in the embodiments of this application.

[0324] 444. The first electronic device performs intra-frame difference on each frame image C2 to obtain n frames of grayscale images D2.

[0325] For example, the explanation will be based on the example of the first electronic device performing intra-frame difference on one frame of image C2 in n frames of image C2.

[0326] Image C2 has three RGB channels. The first electronic device first decomposes image C2 into three RGB channels to obtain the R channel image, G channel image and B channel image respectively, and the corresponding values ​​are denoted as R1, G1 and B1 respectively.

[0327] In one example, the first electronic device can use the formula D2=|(B1-R1)+(B1-G1)| to perform intra-frame difference processing to obtain a grayscale image D2.

[0328] In another example, the first electronic device can use the formula D2=|(G1-R1)+(G1-B1)| to perform intra-frame difference processing to obtain the grayscale image D2.

[0329] In this way, by performing intra-frame difference processing on each frame of image C2, the particle points included in the resulting grayscale image can be made more obvious, which is beneficial for the first electronic device to obtain the encoded connection pairing code therein.

[0330] 445, The first electronic device performs multi-frame alignment processing on n-frame grayscale image D2.

[0331] For example, let's take n=3 as an example. The first electronic device can use the intermediate image as a reference to align the previous frame image and the next frame image of the intermediate image.

[0332] The first electronic device can reduce the misalignment caused by jitter when acquiring the ROI image by performing multi-frame alignment processing on n frames of grayscale images.

[0333] It should be understood that step 445 is an optional step, and in some examples, step 445 may not be performed.

[0334] 446. The first electronic device performs a second cropping on the aligned n-frame grayscale image D2 according to the ROI to obtain n-frame image E2.

[0335] The following is an example of a second cropping of one grayscale image D2 from n frames of grayscale images D2 by a first electronic device.

[0336] For example, when the first electronic device performs a second cropping on image D2, it can crop according to ROI so that the cropped image E2 is the size corresponding to the ROI. This allows image E2 to contain the annular region while minimizing its size, further reducing the computational load of subsequent image processing by the first electronic device.

[0337] The image E2 includes the location points, information points, and possible noise information encoded by the second electronic device.

[0338] 450, The first electronic device determines the positioning points and information points in the n-frame image E2.

[0339] In some cases, the first electronic device can determine the location points and information points of each frame in the n-frame image E2. Alternatively, the first electronic device can also determine the location points and information points of multiple frames in the n-frame image E2, and use the location points and information points of the multiple frames as the final determined location points and information points.

[0340] In some examples, see Figure 14, which is a schematic flowchart illustrating the determination of location points and information points according to an embodiment of this application. As shown in Figure 13, step 450 may include steps 451 to 457.

[0341] 451, The first electronic device determines an annular region A that can cover the ROI.

[0342] For example, since the first electronic device has already acquired the ROI in step 430 above, in this step, the first electronic device can determine the annular region A that can cover the ROI.

[0343] 452. The first electronic device uses the annular region A to filter the m-frame image E2 to obtain the m-frame image F2.

[0344] Where m is less than n, the m-frame image E2 can be a part of the n-frame image E2. For example, n is 5 and m is 3.

[0345] For example, the annular region A is a mask. The first electronic device can filter the m-frame image E2 using the mask to obtain the particle points corresponding to the mask region, and the particle points outside the mask region are filtered out.

[0346] Thus, the m-frame image F2 obtained by the first electronic device contains particle points within the annular region A, filtering out other noise.

[0347] For example, let's take m=3 as an example. Figure 15 is a schematic diagram of the result of determining the positioning point and information point according to an embodiment of this application.

[0348] Referring to Figure 15, the three frames E2 are img1, img2 and img3 respectively. After the first electronic device filters img1, img2 and img3 using the annular region A, it obtains three frames F2, namely img1-1, img2-1 and img3-1 respectively.

[0349] 453. The first electronic device performs inter-frame difference on the m-frame image F2 to obtain the m-frame grayscale image G2.

[0350] For example, the first electronic device can perform pairwise difference processing on each of the m-frame images F2.

[0351] For example, taking m=3 as an example to illustrate the process of inter-frame differencing, assuming that the three frames F2 are F2-1, F2-2, and F2-3 respectively. The first electronic device can perform a difference operation between F2-1 and F2-1 to obtain a grayscale image; the first electronic device can perform a difference operation between F2-1 and F2-3 to obtain a grayscale image; the first electronic device can perform a difference operation between F2-2 and F2-3 to obtain a grayscale image.

[0352] It should be understood that the difference operation can be understood as the process of subtracting the gray values ​​of corresponding pixels in two frames of images and taking the absolute value.

[0353] Referring to Figure 15, after the first electronic device performs inter-frame difference on the three frames of images img1-1, img2-1 and img3-1, it obtains three grayscale images G2, namely img1-2, img2-2 and img3-2.

[0354] In this way, by differential processing between multiple frames, the parts that differ between the multiple frames can be preserved. Since the positioning points and information points are displayed in different colors in a cycle during the encoding of the second electronic device, while the background and noise of the image are the same, differential processing can preserve the positioning points and information points in the image as much as possible, and filter out the noise.

[0355] 454. The first electronic device uses a binarization threshold to filter the m-frame grayscale image G2 to obtain the m-frame binary image H2.

[0356] The following explanation uses the filtering of a single grayscale image G2 by the first electronic device as an example. In grayscale image G2, pixels with values ​​greater than or equal to the binarization threshold have their grayscale value set to 255, while pixels with values ​​less than the binarization threshold have their pixel value set to 0. Thus, by traversing all pixels in grayscale image G2, a binary image H2 can be obtained.

[0357] It should be understood that by performing the above processing on each frame G2 in the m-frame grayscale image G2, an m-frame binary image H2 can be obtained.

[0358] Referring again to Figure 15, the first electronic device uses a binarization threshold filter to filter three grayscale images img1-2, img2-2, and img3-2, resulting in three binary images H2, namely img1-3, img2-3, and img2-3.

[0359] It should be understood that the specific value of the binarization threshold is not limited in the embodiments of this application. The binarization threshold may be set by the developer based on experience, or it may be determined by the first electronic device through image analysis.

[0360] 455. The first electronic device performs an OR operation on the m-frame binary image H2 to obtain image I2.

[0361] After the first electronic device performs an OR operation on the m-frame binary image H2, the image I2 contains all the particle points in the m-frame binary image, thereby enabling the image I2 to contain as many positioning points and information points as possible, increasing the probability of the first electronic device successfully decoding.

[0362] Referring again to Figure 15, the first electronic device performs an OR operation on the three binary images img1-3, img2-3, and img2-3 to obtain image I2, i.e., img-a1. Image I2 contains all the particle points in the three binary images img1-3, img2-3, and img2-3.

[0363] 456. The first electronic device filters out interference points in image I2 to obtain image J2.

[0364] It should be understood that the first electronic device can also perform pixel fusion processing on the m-frame grayscale image G2 to obtain a grayscale image G2-1. Then, image I2 is used to filter the grayscale image G2-1 to remove interference points in the grayscale image G2-1, resulting in a grayscale image G2-a.

[0365] For example, the first electronic device can add m frames of grayscale image G2 pixel by pixel to obtain grayscale image G2-1. Then, it can use image I2 as a mask to filter grayscale image G2-1 to obtain grayscale image G2-a.

[0366] For example, FIG16 is a schematic flowchart of filtering interference points provided in an embodiment of this application. Referring to FIG16, step 456 may include at least steps 4561 to 4566.

[0367] 4561, the first electronic device marks the connected components in image I2.

[0368] For example, since image I2 is a binary image, the first electronic device can label the connected components containing pixels to obtain a set of coordinates for each connected component. Furthermore, the first electronic device can also determine other attributes of each connected component, such as area size, center point, etc.

[0369] 4562, The first electronic device sorts the brightness values ​​of connected components in the grayscale image G2-a according to the marked connected components.

[0370] For example, the first electronic device can determine the location of the connected components based on the set of coordinates of the connected components marked in step 4561. Therefore, the first electronic device can sort the connected components in the grayscale image G2-a by brightness according to the set of coordinates of the connected components.

[0371] For example, for each connected component, the first electronic device can add up the pixel values ​​of all pixels in the connected component to obtain the brightness value of the connected component, and sort them in descending order of brightness value.

[0372] 4563, The first electronic device determines the target connected component in the grayscale image G2-a.

[0373] For example, the target connected region can be understood as the region containing information particle points (location points, information points) determined by the first electronic device.

[0374] Since areas with larger brightness values ​​may experience greater brightness variations, potentially affecting subsequent decoding processes, the first electronic device can exit the decoding process when it determines that the number of connected components (or the number of brightness values) is less than or equal to a threshold (e.g., 19), indicating a smaller number of information-containing particle points.

[0375] When the number of brightness values ​​exceeds a threshold, the first electronic device can start selecting from the brightness values ​​that are greater than the threshold.

[0376] For example, if the threshold is 19, the first electronic device can start selecting from the 20th brightness value in the sort to determine the corresponding target connected component.

[0377] It is understandable that the number of target connected domains determined by the first electronic device is less than or equal to 48 (the sum of the number of location points and information points).

[0378] In one implementation, the first electronic device selects from the 20th brightness value, and selects 48 brightness values ​​less than or equal to the 20th brightness value in descending order of brightness value, and uses the connected component corresponding to the selected brightness value as the target connected component.

[0379] Alternatively, the first electronic device can start selecting from the 20th brightness value, select the first 48 brightness values ​​in descending order of brightness value, and use the connected components corresponding to the selected brightness values ​​as the target connected components.

[0380] In another implementation, the first electronic device starts selecting brightness values ​​from the 20th brightness value, choosing values ​​based on the principle that the brightness value is greater than a preset brightness value. For example, if the first electronic device starts selecting from the 20th brightness value and the first 45 brightness values ​​are all greater than the preset brightness value, then the connected components corresponding to these 45 brightness values ​​are taken as the target connected components.

[0381] 4564, The first electronic device performs binarization processing on the grayscale image G2-a according to the target connected component to obtain image J2.

[0382] For example, the first electronic device can set the pixel value in the target connected component of the grayscale image G2-a to 255 and the pixel value at other locations to 0 to obtain the binary image J2.

[0383] Understandably, the first electronic device can determine multiple binary images J2 from n frames of image E2 using the above method. For example, if n is 5 and m is 3, the first electronic device can use a sliding window method to acquire 3 frames of binary images J2, namely J2-1, J2-2, and J2-3. The first electronic device can also determine the product of the target brightness difference and the number of target connected components in images J2-1, J2-2, and J2-3 respectively, and sort images J2-1, J2-2, and J2-3 according to the size of the product. The larger the product, the more particle points the image contains and the larger the brightness difference, thus the higher the quality of the binary image, which is beneficial for the first electronic device to successfully decode it subsequently.

[0384] Here, the target brightness difference represents the maximum difference between two adjacent brightness differences in the target connected component. Alternatively, the brightness differences between two adjacent brightness differences in the target connected component are stored in a list, where the maximum difference is m, and the target brightness difference is the brightness difference corresponding to the largest index of the brightness difference greater than 0.7*m in the list.

[0385] For example, referring to Figure 17, Figure 17 is a schematic diagram of sorting based on the product of the target brightness difference and the number of target connected components provided by an embodiment of this application. For example, if the products of the target brightness difference and the number of target connected components in the above images J2-1, J2-2, and J2-3 are sorted from largest to smallest as images J2-1, J2-2, and J2-3, then (a) in Figure 17 corresponds to image J2-1, (b) in Figure 17 corresponds to image J2-2, and (c) in Figure 17 corresponds to image J2-3.

[0386] Understandably, the first electronic device can select the image with the largest product of the target brightness difference and the number of target connected components for identification in order to determine the location points and information points within it.

[0387] 457, The first electronic device determines the positioning points and information points in image J2.

[0388] It should be understood that the first electronic device may also use steps 451-457 above to determine the multi-frame image J2, and further determine the positioning points and information points in the multi-frame image J2. Alternatively, the first electronic device may determine the positioning points and information points in the frame image with more particle points in the multi-frame image J2, or the first electronic device may determine the positioning points and information points in the frame image with more particle points and larger brightness differences in the multi-frame image J2.

[0389] For example, the first electronic device may first determine the positioning points in the image J2, and the determined positioning points may be used to determine each display area (such as display area 1 to display area 12 mentioned above).

[0390] For example, the first electronic device can determine the coordinates of all positioning points by using the previously acquired center coordinates of the ROI and the coordinates of all particle points in image J2, based on the geometric relationship between the positioning points distributed within the inner and outer circles. Then, the first electronic device performs ellipse fitting on the inner and outer circle positioning points respectively to determine the precise center coordinates. Thus, the first electronic device can determine each display area based on the distribution of the positioning points.

[0391] In some cases, there may be partial missing positioning points in image J2. The first electronic device can fill in the missing positioning points according to the geometric relationship of the partial positioning points. For example, see Figure 18, which is a schematic diagram of positioning point filling provided by an embodiment of this application.

[0392] Figure 18(a) shows the distribution of positioning points determined by the first electronic device based on the coordinates of the particle points in image J2. The points indicated by the circles on the circle are the positioning points. There are 9 positioning points on the outer circle and 9 positioning points on the inner circle, with 3 missing in both the inner and outer circles. To fill in the missing positioning points, the first electronic device can use the coordinates of the already positioned points and the distribution of the positioning points to fill in the missing positioning points.

[0393] For example, since all the positioning points are symmetrically distributed around the center of the circle, the first electronic device can use this distribution relationship to determine the coordinates of the missing positioning points, thereby completing the filling of the positioning points. For example, referring to Figure 18(b), the first electronic device fills in three missing positioning points in the inner circle and the outer circle respectively.

[0394] Referring to Figure 18(c), after the first electronic device fills in the missing positioning points, all the inner circle positioning points and outer circle positioning points can be determined.

[0395] In other examples, the first electronic device can also determine multiple sets of images J2 through steps 451 to 456 described above. In step 457, the first electronic device can extract positioning points and information points from the multiple sets of images J2 respectively, thereby increasing the likelihood that the first electronic device can find all positioning points and information points.

[0396] 460, the first electronic device determines the coded connection pairing code based on the positioning point and information point.

[0397] It should be understood that the distribution of information points in the first electronic device can determine each display area, and the coded numbers can be determined based on the distribution of information points in each display area.

[0398] For example, referring to FIG19, FIG19 is a schematic flowchart of determining a connection pairing code based on a positioning point and an information point according to an embodiment of the present application. Step 460 may include steps 461 to 462.

[0399] 461. The first electronic device determines the coded numbers for each display area based on the positioning point and the information point.

[0400] For example, referring to Figure 5, the first electronic device can determine the display area 1 by the outer circular positioning points A1 and A2 and the inner circular positioning points B1 and B2, and determine the display area 2 by the outer circular positioning points A2 and A3 and the inner circular positioning points B2 and B3.

[0401] It should be understood that the first electronic device can use a similar method to determine display areas 3 to 12, which will not be elaborated further.

[0402] In this embodiment of the application, after determining the display area, the first electronic device needs to further determine the distribution of information points within the display area. For example, referring to Figure 6, the first electronic device needs to further determine the number of the location of each information point in the display area, and then look up the coded number in Table 1.

[0403] The following explanation uses the example of the first electronic device determining the encoded numbers in display area 7.

[0404] Referring to Figure 20, which is a schematic diagram of determining the location of an information point according to an embodiment of this application.

[0405] For ease of description, the two outer circular positioning points in display area 7 will be named A and B, and the two inner circular positioning points will be named C and D. The center of the annular area is O. It should be understood that positioning point A can be positioning point A8 mentioned earlier, positioning point B can be positioning point A7 mentioned earlier, positioning point C can be positioning point B7 mentioned earlier, and positioning point D can be positioning point B8 mentioned earlier.

[0406] For example, the process of the first electronic device determining the location of the information point may include steps S1 to S8.

[0407] S1: Determine the intersection point E of line segments AC and BD.

[0408] S2: Determine the intersection point M of the line containing OE and the arc containing AB, and the intersection point N of the arc containing CD.

[0409] S3: Determine the intersection point P1 of line segment AN and DM, and the intersection point P2 of line segment CM and BN (not shown in the figure).

[0410] Let the information points be named F and G.

[0411] S4: Determine the polar coordinates of OA, OB, OE, OP1, OP2, OF, and OG respectively, and obtain α. OA α OB α OE α OP1 α OP2 α OF α OG .

[0412] S5: According to α OF α OG With α OA α OB α OE α OP1 α OP2 The angular relationship determines the column where the information point is located.

[0413] Taking the determination of the position of F as an example, by determining the angle of the polar coordinates of each point, we can determine which column of the display area point F is located in.

[0414] For example, α OF Between α OA and α OP1 If we can determine that point F is located in the same column as information points numbered 4, 9, 14, and 19, then we can identify that point F is located in the same column as information points numbered 4, 9, 14, and 19.

[0415] S6: Determine the row where the information point is located based on the relationship between the line segment lengths of points F and G and the positioning point.

[0416] For example, to determine the position of F, by determining the lengths of line segments FA and FD, we can determine that point F is located in the row where information points numbered 5, 6, 7, 8, and 9 are located.

[0417] S7: Determine the number of the information point.

[0418] For example, through steps S5 and S6, point F can be determined to be numbered 9. The first electronic device can also determine point G to be numbered 11 in the same way.

[0419] S8: Determine the coded number based on the information point number.

[0420] For example, the first electronic device can look up information from Table 1 based on the determined information point number. Since display area 7 belongs to encoding area 1, the code table corresponding to encoding area 1 in Table 1 is searched. The information point numbers are 9 and 11, that is, the value corresponding to number 9 and 11 in the code table is "1", and the value of the other positions is "0". By looking up Table 1, the coded number can be determined to be "5".

[0421] It should be understood that for information points in other display areas, the first electronic device can use the same method to determine the number of the information point and the coded number therein.

[0422] In other examples, after determining the information point number of the display area, the first electronic device can also obtain the demodulation information corresponding to that display area, such as "00000000101000000000", where the number of the information point is 1 and the other numbers are 0. Then, the first electronic device compares the demodulation information "00000000101000000000" with Table 1. The comparison result determines that the display area belongs to encoding area 1, and the encoded number is "5".

[0423] It should be understood that the first electronic device can determine the encoding area and the encoded numbers corresponding to the remaining display areas in this way.

[0424] In other examples, after the first electronic device determines a binary image (such as image J2) containing location points and information points, the first electronic device can also filter the binary image using an annular region B to obtain all the information points contained therein.

[0425] For example, referring to FIG21, FIG21 is a schematic diagram of information point extraction in an embodiment of the present application. As shown in (a) of FIG21, the first electronic device can use the annular region B to filter the particle points in order to extract the information points contained therein.

[0426] For example, the annular region B can be a mask, which can be obtained by expanding the inner circle positioning point and contracting the outer circle positioning point. For example, the radius s of the expansion and contraction can be a preset radius.

[0427] For example, s can be represented by the following formula.

[0428] Where a is the major axis radius of the outer circle.

[0429] In other examples, the radius s can also be a fixed value, which is not limited in the embodiments of this application.

[0430] Referring to Figure 21(b), after filtering the particle points using the annular region B, the outer and inner circle positioning points in the binary image are filtered out, while all information points are retained.

[0431] It should be understood that the first electronic device can determine the serial number of the information point in the manner described above, and determine the coded number therein by looking up Table 1.

[0432] For example, the first electronic device determines that the coded numbers are "318031031318".

[0433] 462, The first electronic device obtains a connection pairing code by fusing the numbers encoded in each display area in a preset order.

[0434] For example, the first electronic device has determined the coded numbers in each display area through step 461. For instance, the first electronic device can merge the coded numbers in each display area in the order of display area 1 to display area 12 in FIG. 5 to obtain a connection pairing code.

[0435] For example, the numbers encoded in display areas 1 to 12 determined by the first electronic device are “318031031318”, as shown in Figure 5. Since display areas 1 to 6 encode the first to sixth digits of the connection pairing code respectively, the connection pairing code can be determined to be “318031”.

[0436] Because the second electronic device uses redundant encoding during encoding—for example, two identical connection pairing codes are encoded in display areas 1 to 12—in some cases, even if information points are missing in some display areas after the first electronic device has determined the display area, the first electronic device may still successfully obtain the complete connection pairing code.

[0437] For example, if all or part of the information points in display area 2 are missing, the first electronic device cannot determine the coded numbers in display area 2. In this case, since the coded numbers in display area 11 are the same as those in display area 2, the first electronic device can determine the coded numbers in display area 11, and thus the first electronic device can still determine the complete connection pairing code.

[0438] In other examples, the first electronic device may also determine the connection pairing code in the following manner.

[0439] As shown in Table 1, the coding region of the annular region in the embodiments of this application may include coding region 0, coding region 1 and coding region 2.

[0440] For example, the sequence of the encoded regions in a ring region is [0,0,1,1,2,2,1,2,2,0,0,1], and the order of the corresponding bit positions of the linking pair code is [1,2,3,4,5,6,4,5,6,1,2,3]. Specifically, the third encoded region 0 is a redundant backup of the first encoded region 0 (encoding the first digit), the fourth encoded region 0 is a redundant backup of the second encoded region 0 (encoding the second digit), the third encoded region 1 is a redundant backup of the first encoded region 1 (encoding the third digit), the fourth encoded region 1 is a redundant backup of the second encoded region 1 (encoding the fourth digit), the third encoded region 2 is a redundant backup of the first encoded region 2 (encoding the fifth digit), and the fourth encoded region 2 is a redundant backup of the second encoded region 2 (encoding the sixth digit).

[0441] For example, the first electronic device determines the number of information points in each display area as shown in Figure 20, and obtains the demodulation information of all display areas, which is a 12*20 matrix. By comparing each piece of demodulation information with Table 1, the encoding area and the corresponding encoded number for each piece of demodulation information can be determined.

[0442] When a demodulation message is not found in Table 1, the encoding region to which the demodulation message belongs is encoding region "3". Therefore, if encoding region 3 exists in the decoding result, it can be determined that the corresponding display area was not successfully decoded.

[0443] For example, the first electronic device compares the demodulated information of all display areas with Table 1 to obtain the encoded region sequence [1,2,2,0,0,1,0,0,1,1,2,3], while the encoded region sequence of the ring area encoded by the second electronic device is [0,0,1,1,2,2,1,2,2,0,0,1]. At this time, the first electronic device can perform a cyclic shift on the decoded encoded region sequence so that the cyclically shifted sequence is equal to the encoded region sequence of the ring area encoded by the second electronic device.

[0444] Correspondingly, the first electronic device performs the same cyclic shift process on the corresponding numbers to obtain the correct sequence of connection pairing codes.

[0445] In this way, regardless of the angle from which the first electronic device obtains the ring-shaped area displayed by the second electronic device, the correct order of the connection pairing codes can be obtained through cyclic shifting, thereby increasing the likelihood of the first electronic device decoding correctly.

[0446] In other examples, due to different shooting conditions, the first electronic device may display incomplete or redundant information points in the demodulated area during decoding. In this case, the first electronic device can also perform error correction processing on the demodulated information to obtain the correct demodulated information.

[0447] In one example, for display area A, if there is only one information point, then the number of "1"s in the demodulated information of display area A obtained by the first electronic device is only one, and the rest are 0.

[0448] For example, the demodulation information of display area A, which belongs to encoding area 0, is [0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]. Compared with the correct demodulation information, it is missing one "1". The first electronic device can replace one "0" in the demodulation information with "1". Only when the corrected demodulation information is [0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] will the demodulation information exist in Table 1. Therefore, the corrected demodulation information is [0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], which is the correct demodulation information of display area A, where the encoded number is "1".

[0449] In another example, for display area B, there are three information points. Therefore, the number of "1"s in the demodulated information of display area B obtained by the first electronic device is three, and the rest are 0.

[0450] For example, the demodulation information of display area B, which belongs to encoding area 0, is [1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]. Compared with the correct demodulation information, it has one more "1". The first electronic device can replace one "1" in the demodulation information with "0". Only when the demodulation information after error correction is [1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] will this demodulation information exist in Table 1. Therefore, the demodulation information after error correction is [1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], which is the correct demodulation information of display area B, where the encoded number is "0".

[0451] This error correction method can increase the likelihood of the first electronic device decoding correctly.

[0452] 470, The first electronic device performs multi-level fusion of the connection pairing code to determine the final connection pairing code.

[0453] In some examples, the first electronic device determines the encoded connection pairing code 1 in image J2 by ​​analyzing it. Image J2 is obtained by processing m frames of image E2 from n frames. The first electronic device can fuse the connection pairing codes obtained from multiple frames of image J2 to determine the final connection pairing code.

[0454] For example, taking n = 5 and m = 3 as an example, the 5 frames E2 are E2-1, E2-2, E2-3, E2-4, and E2-5 respectively, and the m frames can be 3 consecutive frames from the 5 frames.

[0455] For example, the three frames are E2-1, E2-2, and E2-3. The first electronic device processes E2-1, E2-2, and E2-3 to obtain image J2-1 and determines a set of connection pairing codes 1 encoded in image J2-1.

[0456] To improve the accuracy of the determined connection pairing code, the first electronic device can further process E2-2, E2-3, and E2-4 to obtain image J2-2, and determine a set of connection pairing codes 2 encoded in image J2-2. The first electronic device can also process E2-3, E2-4, and E2-5 to obtain image J2-3, determine a set of connection pairing codes 3 encoded in image J2-3, and fuse connection pairing codes 1, 2, and 3 to obtain the determined connection pairing code.

[0457] It should be understood that the process of the first electronic device acquiring 5 frames of images, determining 3 sets of connection pairing codes through these 5 frames, and fusing them to obtain a set of connection pairing codes can be called one round of connection pairing code fusion. This technical solution will be described below with reference to Figure 22.

[0458] For example, Figure 22 is a schematic diagram of obtaining a connection pairing code through multi-frame fusion according to an embodiment of this application. Referring to Figure 22, in addition to the connection pairing code, the decoding result of each image by the first electronic device may also include information such as the number of cyclic shifts, the number of valid feature points, and the check error flag bit.

[0459] The number of cyclic shifts can be used to restore the correct order of the linker codes. During the fusion of linker codes in one round, the reliability of the decoding results of the multi-frame images can be determined based on the value of the number of cyclic shifts in the multi-frame images.

[0460] For example, continuing to refer to Figure 22, the value of the number of cyclic shifts in the decoding results of the three frames J2-1, J2-2, and J2-3 is 6. Therefore, the decoding result is reliable, and the first electronic device can fuse the decoding results of the three frames.

[0461] In other examples, if the number of cyclic shifts in the decoding results of images J2-2 and J2-3 is 6, while the number of cyclic shifts in the decoding result of image J2-1 is a value other than 6 (e.g., 5), then the first electronic device can determine that the decoding results of images J2-2 and J2-3 are reliable. Therefore, the first electronic device can fuse the decoding results of images J2-2 and J2-3 to determine the connection pairing code for this round of fusion.

[0462] In some cases, the number of cyclic shifts may differ in the decoding results of multiple frames. In such cases, the first electronic device can use the value of the number of effective feature points to determine whether the decoding result is reliable.

[0463] For example, in the decoding result of image J2-1, the number of cyclic shifts is 5; in the decoding result of image J2-2, the number of cyclic shifts is 6; and in the decoding result of image J2-3, the number of cyclic shifts is 7. Therefore, the first electronic device cannot determine which images' decoding results are reliable solely based on the number of cyclic shifts. In this case, the first electronic device can combine the numerical value of the effective feature points of each frame image to determine whether the decoding result is reliable.

[0464] When the first electronic device determines that the number of valid feature points in the image decoding result is greater than the preset value B, it can determine that the image decoding result is reliable; otherwise, it determines that the image result is unreliable.

[0465] For example, although the number of cyclic shifts in the decoding results of images J2-2 and J2-3 are different, the number of their effective feature points is greater than the preset value B. Therefore, the first electronic device can also determine that the decoding results of images J2-2 and J2-3 are reliable. The first electronic device can then fuse the decoding results of images J2-2 and J2-3 to determine the connection pairing code for this round of fusion.

[0466] The error check flag has three values: 0, 1, and 2. A value of 0 indicates an invalid result, a value of 1 indicates a correct result, and a value of 2 indicates a questionable result. If the decoding results of two frames both show a value of 2 for the same digit, the error check flag for that digit will be set to 1 after fusion.

[0467] For example, referring to the decoding result of image J2-1, the error flag bits are "1, 1, 1, 2, 1, 0", which respectively indicate that the first digit of the connection pairing code 1 is correct, the second digit is correct, the third digit is correct, the fourth digit is doubtful, the fifth digit is correct, and the sixth digit is invalid.

[0468] It should be understood that for invalid or decoded numbers, the number in the connection pairing code is "-1". Referring to the decoding result of image J2-1, the sixth digit of connection pairing code 1 is "-1", indicating that the first electronic device failed to decode the sixth digit.

[0469] Referring to Figure 22, in the decoding results of images J2-1, J2-2, and J2-3, the number of cyclic shifts is 6 in all cases. This indicates that the decoding results of images J2-1, J2-2, and J2-3 are all reliable. The first electronic device can obtain the connection pairing code "318031" for this round of fusion based on the decoding results of images J2-1, J2-2, and J2-3. The verification error flag bit is "111111" after fusion, which means that every bit of the connection pairing code is correct.

[0470] In other examples, the first electronic device may perform a single round of connection pairing code fusion, which may result in an incorrect fusion result. To improve the accuracy of the determined connection pairing code, the first electronic device may also fuse multiple rounds of determined connection pairing codes.

[0471] In this case, the connection pairing code determined in the first round can be used as the baseline connection pairing code, the connection pairing code determined in the second round is the check pairing code, and the connection pairing code obtained after fusion is the fused connection pairing code. This technical solution will be described below with reference to Figures 23 and 24.

[0472] Figures 23 and 24 are schematic diagrams of a multi-round fusion provided in an embodiment of this application.

[0473] Referring to Figure 23, the following explanation uses the connection pairing code determined by the first electronic device in two rounds as an example.

[0474] In this embodiment of the application, the fusion result of each round may include not only the connection pairing code and the verification error flag, but also an array of suspicious flags.

[0475] The suspicious flag array is a two-dimensional array, with each dimension storing the suspicious number.

[0476] The error flag can take the values ​​0, 1, or 2. A value of 0 indicates an invalid result, a value of 1 indicates a questionable result, and a value of 2 indicates a valid result.

[0477] Referring to Figure 23, the connection pairing code of the first round of fusion results is used as the baseline connection pairing code, with a value of "582676". The error check flag is "111111", and the suspicious flag array is empty.

[0478] The connection pairing code from the second round of fusion results is used as the verification connection pairing code, with a value of "582676". The verification error flag is "111111", and the suspicious flag array is empty.

[0479] The first electronic device then merges the first round fusion result with the second round fusion result. Since the connection pairing codes of the two rounds are the same, the merged connection pairing code "582676" is obtained. The merged connection pairing code "582676" is the final determined connection pairing code.

[0480] In some cases, it may be necessary to fuse more rounds of results before the final connection pairing code can be determined. See Figure 24 for an example of a first electronic device requiring the fusion of connection pairing codes determined in four rounds.

[0481] The connection pairing code from the first round of fusion is used as the baseline connection pairing code, with a value of "2, -1, 2, 6, 7, 6". The error check flag is "1, 0, 1, 1, 1, 1". The suspicious flag array is empty, indicating that the second digit in the connection pairing code was not successfully decoded, while the digits in the other positions are accurate.

[0482] The connection pairing code and verification error flag in the second round of fusion results are both none, and the suspicious flag array is empty. This can be interpreted as the first electronic device possibly failing to acquire the positioning point and information point during the second round of fusion, resulting in decoding failure.

[0483] In this case, since there is no data in the second round of fusion results, the first electronic device merges the first round of fusion results with the second round of fusion results to obtain multi-round fusion result 1, which is the same as the first round of fusion result.

[0484] The connection pairing code in the third round of fusion result is "5, 8, 2, 6, 7, 6", the error check flag is "1, 1, 1, 1, 1, 1", and the suspicious flag array is empty. The first electronic device merges the multi-round fusion result 1 with the third round fusion result to obtain the multi-round fusion result 2.

[0485] During the fusion process, because the first digit "2" in the multi-round fusion result 1 is different from the first digit "5" in the third-round fusion result, the first electronic device cannot determine whether the first digit is "2" or "5". Therefore, the first electronic device can store both "2" and "5" in the suspicious identifier array. Similarly, the second digit in the multi-round fusion result 1 was not successfully decoded, while the second digit in the third-round fusion result is "8". The first electronic device cannot determine that the second digit is "8". Therefore, the first electronic device can store both "8" and the second digit in the suspicious identifier array.

[0486] Referring to the multi-round fusion result 2, the obtained connection pairing code is "-1, -1, 2, 6, 2, 7", the error check flag is "1, 1, 1, 1, 1, 1", and the first array of the suspicious flag array is [2, 5], the second array is [8], and the rest are empty. Therefore, the first electronic device still cannot determine the final connection pairing code.

[0487] In the fourth round of fusion results, the connection pairing code is "5, 8, 2, 6, 7, 6", the verification error flag is "1, 1, 1, 1, 1, 1", and the suspicious flag array is empty.

[0488] When the first electronic device merges the multi-round fusion result 2 with the fourth-round fusion result, since the first digit in the multi-round fusion result 2 is either "2" or "5", and the first digit in the fourth-round fusion result is "5", the first electronic device can determine that the first digit is "5". Similarly, since the second digit in the multi-round fusion result 2 is suspected to be "8", and the second digit in the fourth-round fusion result is "8", the first electronic device can determine that the second digit is "8", and the remaining digits are correct.

[0489] Therefore, in the multi-round fusion result 3 obtained by the first electronic device fusion, the final connection pairing code is "582676", that is, the connection pairing code finally determined by the multi-round fusion is "582676".

[0490] Based on this, the first electronic device has determined the connection pairing code encoded by the second electronic device. Therefore, the first electronic device can establish a device connection relationship with the second electronic device based on the connection pairing code.

[0491] In some cases, in embodiments of this application, to avoid the first electronic device continuously performing the aforementioned multi-round fusion process when decoding conditions are poor (such as severe reflection or obstruction), the first electronic device may also set a threshold for the number of fusion rounds. For example, when the number of fusion rounds performed by the first electronic device exceeds this threshold, the decoding process will end, and the device connection process will be terminated.

[0492] It should be understood that the specific value of the threshold is not limited in the embodiments of this application. For example, the threshold can be 5 or 6, etc.

[0493] It should be understood that the embodiments of this application do not limit the operations performed after the first electronic device and the second electronic device establish a connection relationship.

[0494] In some cases, as business demands increase, it may be necessary to increase the amount of data to be encoded. This will change the encoding and decoding rules mentioned above, and may even involve modifications to the code table. In such situations, when different versions of electronic devices transmit information, the electronic devices need to obtain the version number of the encoding end. The following section will describe this technical solution with reference to Figures 25 to 36.

[0495] It should be understood that the version number can be the system version number of the electronic device, or it can be the version number used inside the electronic device for the above encoding and decoding. This application embodiment does not limit this.

[0496] For example, Figure 25 is a schematic diagram of decoding between different versions of electronic devices provided in an embodiment of this application. As shown in Figure 25, the second electronic device at the encoding end may be a higher version or a lower version, and the first electronic device at the decoding end may also be a higher version or a lower version.

[0497] Under normal circumstances, a higher-version first electronic device can successfully decode the pattern displayed by a higher-version second electronic device. Similarly, a higher-version first electronic device can successfully decode the pattern displayed by a lower-version second electronic device. Conversely, a lower-version first electronic device can successfully decode the pattern displayed by a lower-version second electronic device.

[0498] When the older version of the first electronic device attempts to decode the pattern displayed by the newer version of the second electronic device, it will fail. In this case, the first electronic device can display a prompt message, which may be used to advise the user to upgrade the first electronic device or use a connection code to connect the devices.

[0499] The following section, in conjunction with Figure 26, will describe a technical solution for displaying a prompt message when the first electronic device of a lower version fails to decode the image displayed by the second electronic device of a higher version.

[0500] For example, FIG26 is a schematic diagram of a set of GUIs provided in an embodiment of this application. In FIG26, (a) to (c) show the process of electronic device 300 scanning the image displayed by electronic device 200 and displaying a prompt message when decoding fails.

[0501] The first electronic device may be electronic device 300, and the second electronic device may be electronic device 200.

[0502] It should be understood that (a) to (b) in Figure 26 can be found in the relevant descriptions of (a) to (b) in Figure 3 above, and will not be repeated here for the sake of brevity.

[0503] When the version of electronic device 300 is lower than that of electronic device 200, electronic device 300 will be unable to decode the pattern 211 encoded by electronic device 200. After electronic device 300 scans the pattern 211 in the display interface 210 of electronic device 200, electronic device 300 can display the GUI shown in Figure 26(c).

[0504] Referring to Figure 26(c), a prompt card 312 can be displayed on the display interface 310. The prompt card 312 may include the text "Scan failed" and "The current version is too low and cannot parse the pattern of the peer device. Please connect via the connection code or upgrade and try again."

[0505] It should be understood that the content in the prompt card 312 is merely illustrative. The prompt card 312 can be used to inform the user that decoding is currently unsuccessful and the electronic device needs an upgrade. In other examples, the prompt card 312 may include other content, or the above content may be replaced with other content.

[0506] Based on the embodiments of this application, when a lower version electronic device scans the pattern encoded by a higher version electronic device for decoding, the lower version electronic device will display graphic information to prompt the user to upgrade the electronic device.

[0507] The following section will describe, with reference to Figures 27 to 36, the technical solution for how electronic devices obtain version numbers in the embodiments of this application.

[0508] For example, Figure 27 is a schematic diagram of an encoding version number point provided in an embodiment of this application. As shown in Figure 27(a), when the electronic device performs encoding, it can encode the version number point on the inner circle where the inner circle positioning point is located, based on the encoding in Figure 6.

[0509] In this embodiment, the second electronic device can encode a preset number of version number points on the inner circle where the inner circle positioning point is located. For ease of description, this embodiment uses four version number points as an example. In other examples, the number of version number points can also be five or six, etc.

[0510] In some implementations, each of the four version number points can be distributed between two adjacent inner circle positioning points.

[0511] For example, continuing to refer to Figure 27(a), the four version number points are denoted as V1, V2, V3, and V4, respectively. Version number point V1 is located between inner circle positioning points B6 and B7, version number point V2 is located between inner circle positioning points B7 and B8, V3 is located between inner circle positioning points B10 and B11, and V4 is located between inner circle positioning points B11 and B12. Each version number point can be located at the center of the arc containing two inner circle positioning points.

[0512] For example, the four version number points can also be distributed among other adjacent inner circle positioning points, which is not limited in this application embodiment.

[0513] In some implementations, two of the four version number points (such as V1 and V2) can be distributed between two adjacent inner circle positioning points (such as B7 and B8), and the remaining two version number points (such as V3 and V4) can be distributed between another two adjacent inner circle positioning points (such as B10 and B11).

[0514] In some cases, when the second electronic device encodes the four version number points, the four version number points can be displayed in a cycle of the fourth, fifth, and sixth colors in the same frame image, and the fourth, fifth, and sixth colors are all different.

[0515] For example, the fourth, fifth, and sixth colors correspond to one of green, red, and gray, respectively. For instance, the fourth color is green, the fifth color is red, and the sixth color is gray. Or, the fourth color is red, the fifth color is gray, and the sixth color is green.

[0516] It should be understood that the fourth, fifth, and sixth colors can also be other colors, and this application embodiment does not limit them.

[0517] In this way, the version number dots are displayed in a cycle of different colors, which can better hide the version number dots in the image and achieve a display effect that is imperceptible to the naked eye.

[0518] In another example, as shown in Figure 27(b), the four version number points can also be encoded on the outer circle where the outer circle positioning point is located. The encoding rules are the same as those in Figure 27(a), and will not be repeated here.

[0519] In some cases, there is a preset angle between two adjacent version number points among the four version number points.

[0520] For example, referring to (c) in Figure 27, the angle between version number points V1 and V2 is α1, the angle between V2 and V3 is α2, the angle between V3 and V4 is α3, and the angle between V4 and V1 is α4.

[0521] In this embodiment of the application, the second electronic device can also form an angle sequence (α1, α2, α3, α4) by arranging the preset included angles between two adjacent version number points in the order of the above version number points V1, V2, V3, V4. This angle sequence can correspond to the version number of the second electronic device, and the correspondence can be found in Table 2.

[0522] Table 2

[0523] It should be understood that the system of the first electronic device may include the contents of Table 2, so that when the first electronic device obtains that the version number of the second electronic device on the other end is higher, it can display a prompt message to remind the user to upgrade the first electronic device.

[0524] In other examples, the version number of the second electronic device can also be related to the number of encoded information points. For example, in the technical solution of Figure 7, two information points are encoded in each display area, which corresponds to version number 1. In version number 2, the second electronic device can encode three information points in each display area, and in version number 3, the second electronic device can encode four information points in each display area.

[0525] When decoding, the first electronic device can determine the version number of the second electronic device based on the number of encoded information points in the display area of ​​one or more frames of images.

[0526] For example, referring to Figure 7, the second electronic device encodes 12 display areas for each frame of image. When the ratio of the number of display areas with two information points in each frame of image decoded by the first electronic device to the 12 display areas is greater than or equal to a preset ratio, it is determined that the second electronic device encodes two information points in each display area, and the version number of the second electronic device is determined to be version number 1.

[0527] For example, if the ratio of the number of display areas with three information points in each frame of image decoded by the first electronic device to the number of display areas is greater than or equal to a preset ratio, then the second electronic device is determined to encode three information points in each display area, and the version number of the second electronic device is determined to be version number 2.

[0528] For example, if the second electronic device encodes 12 display areas for each frame of image, then the m frames of image decoded by the first electronic device include 12*m display areas. If the ratio of the number of display areas including two information points to 12*m is greater than or equal to a preset ratio, then the second electronic device is determined to encode two information points in each display area, and the version number of the second electronic device is determined to be version number 1.

[0529] In some examples, due to interference from some noise, the information points included in each display area of ​​the m-frame image decoded by the first electronic device may have multiple cases.

[0530] For example, if the ratio of the number of display areas containing two information points to 12*m in the m-frame image decoded by the first electronic device is less than a preset ratio, and the ratio of the number of display areas containing three information points to 12*m is less than a preset ratio, then the first electronic device determines that it cannot decode the version number of the second electronic device, and the first electronic device can determine that the version of the second electronic device is an unknown version.

[0531] It should be understood that the specific value of the preset ratio is not limited in the embodiments of this application. For example, the preset ratio can be 0.8 or 0.7, etc.

[0532] It should be understood that the embodiments of this application are illustrated by taking the second electronic device encoding 12 display areas for each frame of image as an example. In other examples, the second electronic device may also encode other numbers of display areas for each frame of image.

[0533] The following section will describe, with reference to Figure 28, the technical solution by which the first electronic device determines the version number of the second electronic device in an embodiment of this application.

[0534] For example, FIG28 is a schematic flowchart of determining the version number of an electronic device according to an embodiment of the present application. As shown in FIG28, the method 500 can be applied to a first electronic device, and the method 500 may include steps 510 to 560.

[0535] 510, The first electronic device acquires image VA1.

[0536] 520, the first electronic device determines whether the distance A between itself and the second electronic device is greater than a preset distance.

[0537] 530, the first electronic device extracts the ROI from image A1.

[0538] It should be understood that the image VA1 can be the same as the image A1 mentioned above. In this case, steps 510 to 530 can be the same as steps 410 to 430, and for the sake of brevity, they will not be described again here.

[0539] In some cases, the image VA1 may be a different image from image A1. In this case, the first electronic device processes image VA1 in a similar way to it processes image A1. Steps 510 to 530 can be found in the description of steps 410 to 430 above, and will not be repeated here for the sake of brevity.

[0540] 540, The first electronic device extracts the version number point from the acquired n-frame image VA2 according to the ROI.

[0541] In some examples, see Figure 29, which is a schematic diagram of determining an image containing a version number point according to an embodiment of this application. As shown in Figure 29, step 540 may include steps 5401 to 5406.

[0542] 5401, The first electronic device acquires n frames of image VA2.

[0543] 5402, The first electronic device pre-crops the n-frame image VA2 to obtain the n-frame image VB2.

[0544] 5403, The first electronic device downsamples the n-frame image VB2 according to the ROI to obtain the n-frame image VC2.

[0545] It should be understood that steps 5401 to 5403 can be the same as steps 441 and 443. In other examples, the image VA2 can also be an image different from image A2 acquired by the first electronic device, but the first electronic device processes the image VA2 in the same way as image A2.

[0546] 5404, The first electronic device performs intra-frame difference on each frame image VC2 to obtain an n-frame grayscale image VD2 containing the version number point.

[0547] In some examples, image VC2 is the same as image C2 mentioned earlier. However, in step 5404, the first electronic device processes image VC2 in a different way than it processes image C2.

[0548] For example, in the same frame of an image, the color of the version number point is displayed cyclically according to the fourth, fifth, and sixth colors. The color of the same version number point may be different in different images. For instance, the fourth color is green, with RGB values ​​of (0, 119, 81), where the R component is 0, the green component is 119, and the blue component is 81; the fifth color is red, with RGB values ​​of (147, 60, 117), where the R component is 147, the green component is 60, and the blue component is 117; and the sixth color is gray, with RGB values ​​of (98, 99, 98), where the R component is 98, the green component is 99, and the blue component is 98. In the image displayed by the second electronic device, the version number point will display a superposition of the fourth, fifth, and sixth colors, color 1. The RGB value of this superposition color 1 is the RGB value corresponding to the centroid of the triangle formed by the fourth, fifth, and sixth colors in the color gamut diagram.

[0549] For example, if the RGB values ​​of the first color are (98, 99, 99), the RGB values ​​of the second color are (110, 100, 0), and the RGB values ​​of the third color are (3, 100, 180), then the superposition color 2 of the first color, the second color, and the third color has an RGB value corresponding to the centroid of the triangle formed by the first color, the second color, and the third color in the color gamut diagram.

[0550] In this way, the color values ​​of overlay color 1 and overlay color 2 are close, allowing the version number point, information point, and positioning point to be hidden in the background, making these particle points almost imperceptible to the user's naked eye. However, by setting different parameters for intra-frame difference and inter-frame difference, the first electronic device can distinguish the version number point from the information point and positioning point in the obtained grayscale image.

[0551] For example, the first electronic device uses the formula D2=-R-G+2B to perform intra-frame difference processing (intra-frame difference mode 1) on image C2, and uses the formula VD2=-1.2R+1.5G-0.8B to perform intra-frame difference processing (intra-frame difference mode 2) on image VC2. The results of the intra-frame difference can be seen in Table 3.

[0552] Table 3

[0553] 5405, The first electronic device performs multi-frame alignment processing on n-frame image VD2.

[0554] 5406, The first electronic device performs secondary cropping on the aligned n-frame grayscale image VD2 according to the ROI to obtain n-frame image VE2.

[0555] In some examples, see Figure 27(b), the version number point is located on the outer circle where the outer circle positioning point is located. In this case, steps 5405-5406 can refer to the relevant descriptions of steps 445-446 above. For the sake of brevity, they will not be repeated here.

[0556] In some examples, see Figure 27(a), where the version number point is located on the inner circle where the inner circle positioning point is located, when the first electronic device performs a secondary cropping of the aligned n-frame grayscale image VD2 according to the ROI, the size of the cropped n-frame image VE2 is the size including the inner circle region. For example, the radius of the inscribed circle of the n-frame image VE2 is X1 pixels larger than the radius of the inner circle. This X1 can be a preset value.

[0557] In this way, the n-frame image includes the version number point, and the size of the n-frame image is small, thereby reducing the amount of data that the first electronic device will need to decode later.

[0558] Furthermore, the first electronic device can determine the version number point in the n-frame image VE2. Therefore, step 540 may also include steps 5407 to 5413.

[0559] 5407, The first electronic device determines that it can cover the annular region VA of the version number point.

[0560] In some implementations, referring to Figure 27(a), the version number point is located on the inner circle where the inner circle positioning point is located. Since the first electronic device has already obtained the radius of the inner circle and the center O, the annular region VA can be centered on the center O. The inner diameter of the annular region VA can be smaller than the radius of the inner circle by X1 pixels, and the outer diameter can be larger than the radius of the inner circle by X1 pixels.

[0561] In other cases, the annular region may also be elliptical, which is not limited in the embodiments of this application.

[0562] In some implementations, see Figure 27(b), the version number point is located on the outer circle where the outer circle positioning point is located. In this case, the annular region VA can be the same as the annular region A in step 451 above, which will not be repeated here.

[0563] 5408, The first electronic device uses the annular region VA to filter the m-frame image VE2 to obtain the m-frame image VF2.

[0564] Where m is less than n, the m-frame image VE2 can be a part of the n-frame image VE2. For example, n is 5 and m is 3.

[0565] For example, the annular region VA is a mask. The first electronic device uses this mask to filter the m-frame image VE2, thereby obtaining the particle points corresponding to the mask region, and the particle points outside the mask region are filtered out.

[0566] In some cases, the m-frame image VF2 obtained by the first electronic device contains the version number point within the annular region VA and the inner circle positioning point, filtering out other noise.

[0567] In other cases, the m-frame image VF2 obtained by the first electronic device contains particle points within the annular region VA, from the inner circle positioning point to the outer circle positioning point, filtering out other noise.

[0568] 5409, The first electronic device performs inter-frame difference processing on the m-frame image VF2 to obtain the m-frame grayscale image VG2.

[0569] It should be understood that the first electronic device can perform inter-frame differential processing on image VF2 so that the gray value of the version number point in the m-frame grayscale image VG2 is higher, and the gray values ​​of the information point and the positioning point are lower. Thus, by setting a threshold, the version number point can be retained and other particle points can be filtered out.

[0570] Based on Table 3, the results of inter-frame difference analysis of image F2 and image VF2 by the electronic device can be seen in Table 4. The different intra-frame difference modes mentioned above will lead to different results of inter-frame difference analysis.

[0571] Table 4

[0572] It should be understood that electronic devices will display pixel values ​​exceeding 255 in the inter-frame difference results as pixel values ​​of 255.

[0573] As shown in Table 4, in intra-frame differential mode 1, the grayscale values ​​of information points and location points are relatively high, while the grayscale value of the version number point is relatively low. In intra-frame differential mode 2, the grayscale values ​​of information points and location points are relatively low, while the grayscale value of the version number point is relatively high.

[0574] In this way, the first electronic device can filter out the version number point in intra-frame differential mode 1 and filter out the information point and positioning point in intra-frame differential mode 2 by setting different filtering thresholds.

[0575] 5410, The first electronic device uses binarization thresholding to filter m-frame grayscale image VG2 to obtain m-frame binary image VH2.

[0576] The following explanation uses the filtering of a single grayscale image VG2 by the first electronic device as an example. In grayscale image VG2, pixel values ​​greater than or equal to the binarization threshold are set to a grayscale value of 255, while pixel values ​​less than the binarization threshold are set to a pixel value of 0. Thus, by traversing all pixels in grayscale image VG2, a binary image VH2 can be obtained.

[0577] 5411, The first electronic device performs an OR operation on the m-frame binary image VH2 to obtain image VI2.

[0578] After the first electronic device performs an OR operation on the m-frame binary image VH2, the resulting image VI2 contains all the particle points in the m-frame binary image. This allows the image VI2 to contain as many version number points as possible, thereby increasing the likelihood that the first electronic device will successfully decode and obtain the version number.

[0579] For example, referring to Figure 30, which is a schematic diagram of determining a binary image according to an embodiment of this application. Taking m as 3 as an example, the three binary images are denoted as VH2-1, VH2-2, and VH2-3, respectively. The first electronic device performs an OR operation on the three binary images VH2-1, VH2-2, and VH2-3 to obtain image VI2. Image VI2 contains all the particle points in the three binary images VH2-1, VH2-2, and VH2-3.

[0580] 5412, The first electronic device filters out interference points in image VI2 to obtain image VJ2.

[0581] It should be understood that the first electronic device can also perform pixel fusion processing on the m-frame grayscale image VG2 to obtain a grayscale image VG2-1. Then, image VI2 is used to filter the grayscale image VG2-1 to remove interference points in the grayscale image VG2-1, resulting in a grayscale image VG2-a.

[0582] For example, the first electronic device can add m frames of grayscale image VG2 pixel by pixel to obtain grayscale image VG2-1. Then, it can use image VI2 as a mask to filter grayscale image VG2-1 to obtain grayscale image VG2-a.

[0583] In some examples, Figure 31 is a schematic flowchart of filtering interference points provided by an embodiment of this application. Referring to Figure 31, step 5412 may include at least steps 54121 to 54126.

[0584] 54121, Connected components in image VI2 of the first electronic device.

[0585] 54122, The first electronic device sorts the brightness values ​​of connected components in the grayscale image VG2-a according to the marked connected components.

[0586] It should be understood that steps 54121-54122 can be found in the description of steps 4561-4562 above.

[0587] In other examples, the first electronic device may also take the same number of brightness values ​​as the number of version number points based on the result of sorting the brightness values ​​from largest to smallest, and use the corresponding connected components as the target connected components.

[0588] For example, if there are 4 version number points, the first electronic device can also take the connected components corresponding to the first 4 brightness values ​​as the target connected components based on the sorting result of the brightness values. In this way, the first electronic device can quickly determine the target connected components.

[0589] 54123, The first electronic device acquires the pixel values ​​of the region corresponding to the connected component in the m-frame image VA2.

[0590] In this step, the first electronic device can map the position of the marked connected component to the corresponding position in the m-frame image VA2 and determine the score of the connected component in the RGB color gamut.

[0591] Taking m=3 as an example, the first electronic device maps one of the connected components 1. The first electronic device can take 3*3 pixels in the middle part of the connected component 1. The average color value of these 3*3 pixels can be (r, g, b). The positions of these 3*3 pixels are mapped to the 3 frames of image VA2, and the pixel values ​​at the corresponding positions are (r0, g0, b0), (r1, g1, b1), and (r2, g2, b2).

[0592] It should be understood that the embodiments of this application use the 3*3 pixels as an example for illustration. In other examples, the 3*3 pixels can also be replaced by 2*2 or 2*3 pixels, and the embodiments of this application are not limited thereto.

[0593] 54124, The first electronic device sorts the connected components according to the brightness value of the connected components and the pixel value of the corresponding region of the connected components.

[0594] The first electronic device can determine the minimum difference between the color of the 3*3 pixels and the corresponding position of the 3 frames of image VA2, thus determining which frame of image the color of the 3*3 pixels is closer to.

[0595] The first electronic device can determine the minimum difference between colors using the following formula:

[0596] The normalized result of the fraction of connected component 1 in the RGB color gamut can be determined by the following formula:

[0597] The normalized result of the brightness value of the connected component 1 can be expressed as:

[0598] The final score S of the connected component 1 can be determined using the following formula: S = 0.6S l +0.4S c .

[0599] It should be understood that the first electronic device can determine the final score S of all connected components using the above method. Then, the first electronic device can sort the connected components in descending order of the value of S.

[0600] 54125, The first electronic device determines VX target connected components based on the sorting results.

[0601] It should be understood that the number of target connected components can be the same as the number of version number points. For example, if the number of version number points is 4, then the VX is 4.

[0602] Since there are 4 version number points, the first electronic device can select the first 4 target connected components based on the sorting result.

[0603] In this way, the first electronic device comprehensively considers the brightness value of the connected components and the pixel value at the corresponding position of the connected components in image VA2, so that the result of determining the VX target connected components with the highest scores as version number points is more accurate.

[0604] 54126, The first electronic device performs binarization processing on the grayscale image G2-a based on VX target connected components to obtain image VJ2.

[0605] For example, the first electronic device can set the pixel values ​​in VX target connected components of the grayscale image G2-a to 255, and set the pixel values ​​at other locations to 0, to obtain the binary image VJ2.

[0606] It should be understood that the location points and information points mentioned above can also be determined in the way shown in Figure 31. The scheme is similar and will not be repeated here.

[0607] 5413, The first electronic device determines the version number point in image VJ2.

[0608] Since there are four target connected components, the first electronic device can determine that the particle point at the corresponding position of the four target connected components is the version number point.

[0609] 550, the first electronic device determines the version number of the second electronic device based on the version number point.

[0610] For example, the first electronic device can determine the version number of the second electronic device based on the angle information between the version number points. For example, referring to Table 2, different version numbers can correspond to different angle sequences (α1, α2, α3, α4).

[0611] For example, the first electronic device determines the angle sequence between two adjacent version number points as (30°, 90°, 30°, 210°) based on the version number points. By looking up Table 2, the first electronic device can determine that the version number corresponding to this angle sequence is version number 1, and thus the version number of the second electronic device can be determined to be version number 1.

[0612] For example, referring to FIG32, FIG32 is a schematic diagram of various possibilities for decoding the included angle sequence of an electronic device according to an embodiment of the present application.

[0613] Referring to Figure 32(a), assuming the four version number points obtained by the first electronic device through decoding are V1, V2, V3, and V4, and starting from the X-axis, each version number point is traversed counterclockwise to obtain a sequence of angles between each pair of adjacent version number points (α1, α2, α3, α4). For example, the first electronic device can look up Table 2 to obtain the version number corresponding to this angle sequence as version number 1.

[0614] In other examples, the first electronic device may also traverse the version number points clockwise. Alternatively, the first electronic device may use the Y-axis as the starting point, which is not limited in the embodiments of this application.

[0615] In some cases, due to lighting conditions or different user habits, the first electronic device may capture the image displayed by the second electronic device from different angles. Thus, even for the same version number, the angle sequence decoded by the first electronic device may be different. To improve the stability of the decoding result, the first electronic device can also perform a cyclic shift process on the angles in the decoded angle sequence to determine whether the decoded angle sequence is the same as the angle sequence corresponding to the version number.

[0616] Referring to Figure 32(b), assuming the four version number points decoded by the first electronic device are V1, V2, V3, and V4, the first electronic device traverses each version number point counterclockwise from the X-axis, obtaining an angle sequence (α2, α3, α4, α1) formed by the angles between each pair of adjacent version number points. However, by looking up Table 2, no version number corresponding to this angle sequence (α2, α3, α4, α1) is found. The first electronic device can perform cyclic shifting on the angles in the angle sequence (α2, α3, α4, α1). For example, in one cyclic shift, the first electronic device moves the element at the end of the sequence to the beginning, and the remaining elements are shifted sequentially to the next position.

[0617] Thus, the first electronic device can obtain the angle sequence (α1, α2, α3, α4, α1) by performing a cyclic shift on the angle sequence (α2, α3, α4).

[0618] For example, Figure 33 is a schematic flowchart of determining a version number based on a version number point provided in an embodiment of this application. As shown in Figure 33, step 550 may include steps 551 to 556.

[0619] 551, The first electronic device determines whether the number of version number points is greater than or equal to the preset number.

[0620] For example, when the version number points of the original code of the second electronic device are 4, the preset number can be 3. When the version number points of the code of the second electronic device are other values, the preset number can also be other values, wherein the preset number is less than or equal to the number of version number points of the original code of the second electronic device.

[0621] In this embodiment, when the number of version number points is less than a preset number, it means that the number of version number points is small, and the first electronic device will not be able to successfully obtain the corresponding version number through the version number point. Therefore, when the first electronic device determines that the number of version number points is less than the preset number, it can execute step 555. When the first electronic device determines that the number of version number points is greater than or equal to the preset number, it can execute step 552.

[0622] 552, the interference point in the first electronic device filter version number point.

[0623] In some implementations, the first electronic device can filter out interfering points in the version number point by comparing the coordinates of the version number point with the previously obtained center coordinates of the circle.

[0624] For example, the first electronic device can determine the distance between each version number point and the center of the circle. When the absolute value of the difference between the distance of a certain version number point and the distance of other version number points and the center of the circle is greater than a preset difference, the version number point may be an interference point, and the first electronic device can filter out the version number point.

[0625] For example, the first electronic device can use the previously obtained center of the circle as the center to fit each version number point to obtain a circle or ellipse. When a certain version number point deviates significantly, that version number point may be an interference point, and the first electronic device can filter out that version number point.

[0626] In some optional embodiments, after the first electronic device filters out interference points for the version number, it can further determine whether the number of remaining version number points is greater than or equal to a preset number. If the number of version number points is less than the preset number, it will be determined that the version number cannot be determined. If the number of version number points is still greater than or equal to the preset number, step 553 can continue to be executed.

[0627] 553. Can the first electronic device determine the version number by using the candidate angle sequence composed of version number points?

[0628] In some implementations, when the first electronic device cannot determine the version number using the candidate angle sequence composed of version number points, step 555 can be executed. When the first electronic device can determine the version number using the candidate angle sequence composed of version number points, step 554 can be executed.

[0629] For example, referring to Figures 32(a) and (b), the candidate angle sequence can be the angle sequence obtained by the first electronic device starting from the X-axis and traversing all version number points counterclockwise. If the version number points obtained by the first electronic device are as shown in Figure 32(a), the candidate angle sequence is (α1, α2, α3, α4); if the version number points obtained by the first electronic device are as shown in Figure 32(b), the candidate angle sequence is (α2, α3, α4, α1).

[0630] In some examples, Figure 34 is a schematic flowchart illustrating how an angular sequence is used to determine a version number according to an embodiment of this application. As shown in Figure 34, step 553 may include steps 5531 to 5544.

[0631] 5531, the first electronic device selects a target version number from a plurality of known version numbers, the target version number having a corresponding standard angle sequence.

[0632] Since the first electronic device cannot directly determine which version number the candidate angle sequence corresponds to after determining the candidate angle sequence, the first electronic device can select a target version number from multiple known versions and compare the standard angle sequence of the target version number with the candidate angle sequence to determine whether the candidate angle sequence matches the standard angle sequence.

[0633] It should be understood that the first electronic device may randomly select one of multiple known version numbers as the target version number. Alternatively, the first electronic device may also select the target version number from multiple known version numbers in a preset order, for example, the preset order is from low to high version numbers, or from high to low version numbers.

[0634] For example, referring to Table 2, the contents of Table 2 may be included in the first electronic device. For example, the target version number is version number 1, and its corresponding standard angle sequence is (30°, 90°, 30°, 210°).

[0635] 5532, the first electronic device determines whether the number of angles in the candidate angle sequence is a preset number of 1.

[0636] Taking version number 4 as an example, the preset quantity 1 can be 4.

[0637] When the first electronic device determines that the number of angles in the candidate angle sequence is a preset number of 1, step 5533 can be executed. When the first electronic device determines that the number of angles in the candidate angle sequence is not a preset number of 1, step 5538 can be executed.

[0638] 5533, the first electronic device determines the number of valid angles in the candidate angle sequence.

[0639] Taking a standard angle sequence of (θ1, θ2, θ3, θ4) and a candidate angle sequence of (α1, α2, α3, α4) as an example, the first electronic device can determine the number of valid angles in the candidate angle sequence in the following way.

[0640] For example, the first electronic device determines whether |αi-θi|≤εθi holds true. Here, i is 1 to 4, and ε is a preset value, such as ε = 0.3 or 0.2.

[0641] Let's take the example of a first electronic device determining whether the first angle in a candidate angle sequence is valid. When the first electronic device determines that |α1-θ1|≤εθ1, it can determine that the first angle is valid; otherwise, it determines that the first angle is invalid. The first electronic device can use this method to determine whether other angles in the candidate angle sequence are valid.

[0642] 5534, The first electronic device determines whether the number of effective angles is greater than or equal to the preset number 3.

[0643] For example, taking version number 4 as an example, the preset quantity 1 can be 4, and the preset quantity 3 can be 2.

[0644] In some alternative implementations, steps 5533 and 5534 may be performed in the same step, which is not limited in the embodiments of this application.

[0645] When the electronic device determines that the number of effective angles is greater than or equal to the preset number 3, step 5535 can be executed. When the electronic device determines that the number of effective angles is less than the preset number 3, step 5536 can be executed.

[0646] 5535, the first electronic device determines the version number corresponding to the version number point as the target version number.

[0647] When the number of angles in the candidate angle sequence is 4, when the first electronic device determines that the number of valid angles is greater than or equal to 2, it can be determined that the candidate angle sequence is the same as the standard angle sequence. Then the version number corresponding to the candidate angle sequence is the target version number corresponding to the standard angle sequence.

[0648] For example, the standard angle sequence is (30°, 90°, 30°, 210°). The first electronic device determines that there are two valid angles in the version number points: the angle between version number points V1 and V2 is 30°, and the angle between version number points V2 and V3 is 90°. This means that version number points V1, V2, and V3 are all correct, and only version number point V4 is incorrect. Therefore, the version number corresponding to this candidate angle sequence can still be determined as version number 1, which corresponds to the standard angle sequence.

[0649] In this way, even if one of the four version number points determined by the first electronic device is incorrect, the first electronic device can still correctly decode the corresponding version number, thereby improving the fault tolerance of the first electronic device.

[0650] 5536, The first electronic device performs a cyclic shifting process on the angles in the standard angle sequence to obtain the standard angle sequence B.

[0651] For example, if the standard angle sequence is (30°, 90°, 30°, 210°), then the standard angle sequence B obtained after the first cyclic shift process can be (210°, 30°, 90°, 30°), and the standard angle sequence B obtained after the second cyclic shift process can be (30°, 210°, 30°, 90°).

[0652] 5537, The first electronic device determines whether the standard angle sequence B after cyclic shift is the same as the standard angle sequence.

[0653] When the first electronic device determines that the standard angle sequence B is the same as the standard angle sequence, it means that the first electronic device has performed multiple cyclic shifts on the standard angle sequence, completed all possible cyclic shifts, and the candidate angle sequence still cannot match the standard angle sequence B. Therefore, the first electronic device needs to select the next version number from the known multiple version numbers for matching. At this time, the first electronic device can execute step 5531.

[0654] 5538, The first electronic device determines whether the number of angles in the candidate angle sequence is the preset number 2.

[0655] Taking version number 4 as an example, the preset quantity 1 can be 4, and the preset quantity 2 can be 3. For example, the candidate angle sequence is (α1, α2, α3).

[0656] When the first electronic device determines that the number of angles in the candidate angle sequence is a preset number of 2, step 5539 can be executed. When the first electronic device determines that the number of angles in the candidate angle sequence is not a preset number of 2, step 5544 can be executed.

[0657] 5539, the first electronic device updates the standard angle sequence to obtain standard angle sequence 2.

[0658] Taking the standard angle sequence as (θ1, θ2, θ3, θ4) and the candidate angle sequence as (α1, α2, α3) as an example, since there are 3 candidate angles, the first electronic device successfully extracts 3 version number points but loses one. In this case, there is an angle in the candidate angle sequence that is the sum of the angle values ​​of two originally adjacent angles. The first electronic device can update the standard angle sequence in the following way.

[0659] The first electronic device adds two adjacent angle values ​​in the standard angle sequence to obtain the following possible standard angle sequence 2:

[0660] (θ1+θ2, θ3, θ4), (θ1, θ2+θ3, θ4), (θ1, θ2, θ3+θ4), (θ1+θ4, θ2, θ3).

[0661] 5540, The first electronic device determines the number of valid angles in the candidate angle sequence.

[0662] It should be understood that the first electronic device may use the method in step 5533 to match the candidate angle sequence with each standard angle sequence 2 to determine the number of valid angles in the candidate angle sequence.

[0663] It should be understood that the first electronic device can match the angle sequences included in the standard angle sequence 2 in a preset order to determine the number of valid angles in the candidate angle sequence.

[0664] 5541, The first electronic device determines whether the number of effective angles is greater than or equal to the preset number 3.

[0665] When the first electronic device determines that the number of valid angles is greater than or equal to the preset number 3, step 5535 can be executed. In this way, even if the first electronic device is missing one version number point, it can still successfully determine the version number of the second electronic device, thereby improving the fault tolerance of the first electronic device.

[0666] When the number of effective angles determined by the first electronic device is less than the preset number 3, step 5542 can be executed.

[0667] 5542, The first electronic device performs a cyclic shifting process on the angles in the standard angle sequence 2 to obtain the standard angle sequence C.

[0668] Taking (θ1+θ2, θ3, θ4) in standard angle sequence 2 as an example, after the first cyclic shift process, the standard angle sequence C is (θ4, θ1+θ2, θ3), and after the second cyclic shift process, the standard angle sequence C is (θ3, θ4, θ1+θ2).

[0669] 5543, The first electronic device determines whether the standard angle sequence C is the same as the standard angle sequence 2.

[0670] For example, after the first electronic device performs the first cyclic shift process on (θ1+θ2, θ3, θ4), the standard angle sequence C obtained is (θ4, θ1+θ2, θ3). This standard angle sequence C is different from the original standard angle sequence in standard angle sequence 2. Then, the first electronic device can execute step 5540 to further determine the number of valid angles in the candidate angle sequence.

[0671] In some examples, when the first electronic device determines that the standard angle sequence C is the same as the standard angle sequence 2, step 5531 can be executed so that the first electronic device continues to select the next target version number for matching.

[0672] It should be understood that if the first electronic device has exhausted all known version numbers and still cannot successfully match the version number corresponding to the candidate angle sequence, then the first electronic device can decode the next set of images, obtain a new version number, and perform the above matching process in order to successfully match the corresponding version number. If the first electronic device performs the above matching process multiple times and still cannot successfully match the version number corresponding to the candidate angle sequence, then this decoding fails.

[0673] 5544, The first electronic device is unable to determine the version number.

[0674] When the number of angles in the candidate angle sequence is less than the preset number 2, the first electronic device will be unable to determine the version number.

[0675] 554, the first electronic device determines the version number corresponding to the version number point as the version number of the second electronic device.

[0676] After determining the version number based on the candidate angle sequence composed of version number points, the first electronic device can determine that the version number is the version number of the second electronic device.

[0677] 555, the first electronic device is unable to obtain the version number.

[0678] If the first electronic device cannot determine the version number from the candidate angle sequence composed of the extracted version number points, the first electronic device will determine that it cannot obtain the version number of the second electronic device. That is, the first electronic device cannot determine the code table used by the second electronic device for information encoding, which may subsequently prevent the first electronic device from obtaining the corresponding device connection information and establishing a connection with the second electronic device by scanning the pattern encoded by the second electronic device. To further improve the probability of successful decoding by the first electronic device, the first electronic device can also execute step 556.

[0679] 556, the first electronic device decodes the next set of images containing version number points.

[0680] For example, if n=5 and m=3, the first electronic device cannot obtain the version number from these 3 frames of images. The first electronic device can also use a sliding window method to obtain the next set of 3 frames of images and extract the version number point. After that, the first electronic device can execute step 551 in order to successfully decode, thereby improving the fault tolerance of the first electronic device in decoding.

[0681] 560. The method by which the first electronic device determines the encoding information of the second electronic device based on the version number of the second electronic device.

[0682] In this embodiment of the application, after determining the version number of the second electronic device, the first electronic device can determine the corresponding encoding information of the second electronic device based on the version number.

[0683] For example, different version numbers can correspond to different code tables. In this way, after the first electronic device decodes and obtains the version number of the second electronic device, it can determine which encoding method the second electronic device uses to encode the information. For example, it can guide the first electronic device to successfully decode and obtain the device connection information encoded by the second electronic device.

[0684] For example, when the first electronic device determines that the version number of the second electronic device is version 1, and the code table corresponding to version 1 can be Table 2 mentioned above, then when the first electronic device decodes the device connection information encoded by the second electronic device, it can determine the encoding method of the second electronic device, namely 12 inner circle positioning points, 12 outer circle positioning points, and 24 information points. Therefore, when the first electronic device determines the target connected components in step 4563, it can directly determine that the number of target connected components is 48, thereby reducing the complexity of data processing for the first electronic device.

[0685] Furthermore, after determining the encoding method of the second electronic device, the first electronic device can also create a precise mask when filtering out interference points in the particle points.

[0686] For example, referring to FIG35, FIG35 is a schematic diagram of a precise mask filtering of particle points provided in an embodiment of the present application.

[0687] For example, the second electronic device encodes the particle points using the methods shown in Figures 5 and 7, with a total of 48 valid particle points and the encoding area divided into 12 regions. The first electronic device can obtain this information after determining the version number of the second electronic device.

[0688] As shown in Figure 35, the precise mask can include the location distribution of 48 particle points. In step 4564, the first electronic device can directly filter the grayscale image G2-a based on the precise mask. This ensures that the particle points at the locations of the 48 particle points are retained, while other noise is filtered out, resulting in a more accurate filtering result and improving the decoding accuracy of the first electronic device.

[0689] The principle by which the first electronic device determines the precise mask is as follows:

[0690] The 24 location points (p0 to p) of the second electronic device encoding 23 The transposes of the coordinates of are as follows:

[0691] The 24 positioning points extracted by the first electronic device (q0 to q 23 The transposes of the coordinates of are as follows:

[0692] Through perspective transformation, the perspective transformation matrix from the encoded positioning point to the extracted positioning point can be obtained. And the 24 information points encoded by the second electronic device (r0 to r) 23 Given the coordinates of ), then through this perspective transformation matrix... It can obtain the precise location of information points in the mask.

[0693] In other examples, the annular region B in Figure 21 above can also be a mask determined by such a precise mask, which can enable the first electronic device to obtain accurate information points and increase the probability of successful decoding by the first electronic device.

[0694] In other examples, the first electronic device can also filter the image using this precise mask when determining the location point to obtain the precise location of the location point.

[0695] For example, referring to Figure 36, which is a schematic diagram of determining information points according to an embodiment of this application. By determining the position of information points in this way, when the first electronic device acquires the image displayed by the second electronic device, even if the second electronic device is partially tilted, the first electronic device can obtain the accurate position of the information points, determine the precise mask, and complete the effective filtering of noise.

[0696] It should be understood that step 560 is an optional step, and in some examples, step 560 may not be performed. This application embodiment does not limit this.

[0697] Figure 37 is a schematic flowchart of an information transmission method provided in an embodiment of this application. As shown in Figure 37, the method 800 can be applied to a first electronic device, and the method 800 may include steps 810 to 840.

[0698] 810, the first electronic device acquires N frames of first images. Each frame of the N frames of first images includes particle points encoded with target information. The particle points include positioning points for locating the display area and information points for indicating data. In the same frame of the first image, the positioning points are displayed cyclically in a first preset color order, and the information points are displayed cyclically in a second preset color order. N is greater than or equal to 3.

[0699] For example, referring to Figure 5, positioning points are used to locate display areas 1 to 12. Referring to 7, the display areas may include information points for indicating data.

[0700] It should be understood that the embodiments of this application do not limit the specific color order or the number of colors included in the first preset color order and the second preset color order. The first preset color order is different from the second preset color order.

[0701] For example, the first preset color order can be a first color and a second color, or the first preset color order can be a second color and a first color.

[0702] Alternatively, the first preset color order can be the first color, the second color, and the third color, and the second preset color order can be the third color, the second color, and the first color.

[0703] For example, the positioning point may also include an external positioning point and an internal positioning point.

[0704] The positioning points are displayed cyclically according to a first preset color order, including:

[0705] External positioning points are displayed in a cycle of first color, second color, and third color, while internal positioning points are displayed in a cycle of second color, third color, and first color, with each of the first, second, and third colors being different.

[0706] For example, the information points are displayed cyclically according to a second preset color order, including:

[0707] The information points are displayed in a cycle of third color, first color, and third color.

[0708] For example, the first color is yellow, the second color is blue, and the third color is gray. Alternatively, the first, second, and third colors can be other colors.

[0709] 820, The first electronic device determines the target region containing particle points in the first image.

[0710] In some examples, the particle points can be distributed in a ring, and the target region can be a rectangular area containing the particle points. For example, the target region can be the ROI in step 430 above.

[0711] In other examples, the particle points may also be distributed in other shapes, which are not limited in the embodiments of this application.

[0712] 830, The first electronic device extracts particle points from the first image based on the target region.

[0713] It should be understood that by pre-determining the target area, the first electronic device can determine that the particle points in the first image are distributed in the target area, and then process the image in the target area to extract the corresponding particle points.

[0714] 840, The first electronic device determines the target information encoded in the particle points based on the distribution of the particle points.

[0715] For example, the first electronic device can determine each display area based on the distribution of positioning points, and can determine the encoded information in each display area based on the distribution of information points in each display area, and can determine the final target information based on the encoded information in each display area.

[0716] Based on the embodiments of this application, the first electronic device can acquire N frames of first images, and the first images include particle points encoded with target information. In the same frame image, the positioning points and information points in the particle points are displayed cyclically in a preset color order, thereby enabling the encoded particle points to have a better hiding effect.

[0717] Furthermore, the first electronic device only needs to scan the first image to extract the particle points and further determine the target information encoded therein. For example, this target information is a connection pairing code (such as a PIN code) used for device connection. The first electronic device can obtain this connection pairing code in this convenient way and establish a device connection with the second electronic device, thereby shortening the device interaction path and enhancing the sense of technology.

[0718] In some implementations, before determining the target region containing the particle points in the first image, the method 800 further includes: determining that a first distance between the first electronic device and the second electronic device is less than or equal to a preset distance.

[0719] For example, the first electronic device may determine the first distance between itself and the second electronic device in the manner shown in FIG9.

[0720] The specific value of the preset distance is not limited in the embodiments of this application. For example, the preset distance can be 30 cm or 60 cm, etc.

[0721] Based on the embodiments of this application, when the first distance between the first electronic device and the second electronic device is less than a preset distance, a target area containing particle points in the first image is determined, thereby enabling the information transmission method in this application to be executed when the distance between the two electronic devices is appropriate, thereby increasing the probability of successful decoding by the first electronic device.

[0722] In some implementations, determining the target region containing particle points in the first image includes:

[0723] The first electronic device downsamples the first frame of the first image in N frames of the first image according to the first distance to obtain the second image;

[0724] The first electronic device performs binarization processing on the second image to obtain a binary image;

[0725] The first electronic device determines the target region based on the binary image.

[0726] Optionally, the first electronic device may also crop the first image of the first frame and downsample the cropped image to obtain the second image.

[0727] For example, referring to Figure 10, the first image of the first frame can be image A1, and the second image can be image C1. The binary image can be image F1, and the target region can be a Region of Interest (ROI).

[0728] Based on the embodiments of this application, the first electronic device downsamples the first image according to the first distance between itself and the second electronic device, and performs binarization processing on the downsampled second image. The target region is determined based on the binary image, thereby making the downsampling ratio more appropriate and reducing the workload of the first electronic device in processing the image to determine the target region.

[0729] Optionally, the first frame image can be replaced with any frame image from the first few frames of the N frames, which is not limited in this embodiment. Alternatively, the first frame image can be replaced with one frame image from the N frames.

[0730] In some examples, the first electronic device determines the target region based on a binary image, including:

[0731] The first electronic device performs closing and opening operations on the binary image and determines the target region based on the image obtained from the closing and opening operations.

[0732] In some implementations, method 800 also includes:

[0733] Based on the target region, N frames of the first image are downsampled to obtain N frames of the third image;

[0734] The first frame intra-differential parameters are used to perform intra-frame difference processing on the N frames of the third image to obtain the N frames of the first grayscale image;

[0735] N frames of the first grayscale image are cropped from the target region to obtain N frames of the second grayscale image.

[0736] For example, referring to Figure 13, the first N-frame image can be an n-frame image A2, or it can be an n-frame image B2 cropped from the n-frame image A2. The third N-frame image can be an n-frame image C2, the first grayscale image can be a grayscale image D2, and the second grayscale image can be image E2.

[0737] Based on the embodiments of this application, since the target region has been determined, the first electronic device downsamples N frames of the first image according to the target region, which can accurately determine the downsampling factor and reduce the workload of the first electronic device in processing images. Furthermore, by performing intra-frame difference processing on the image, the particle points included in the resulting first grayscale image can be made more obvious, which is beneficial for the first electronic device to obtain the encoded information therein. Further, by cropping the first grayscale image using the previously obtained target region, the first electronic device can ensure that the size of the cropped second grayscale image is the same as the target region. This allows the first electronic device to process only the portion of the second grayscale image containing the particle points, thereby improving the decoding speed of the first electronic device.

[0738] In some implementations, particle points are extracted from the first image based on the target region, including:

[0739] Using an annular region that can cover the target area, filter the M frames of second grayscale images in the N frames of second grayscale images to obtain the M frames of third grayscale images. Each frame of grayscale image in the M frames retains the part covered by the annular region.

[0740] Inter-frame difference processing is performed on the third grayscale image of frame M to obtain the fourth grayscale image of frame M;

[0741] Binarize the fourth grayscale image of frame M to obtain a binary image of frame M.

[0742] Perform an OR operation on the M-frame binary images to obtain the first target binary image;

[0743] By filtering out interference points from the first target binary image, a second target binary image is obtained.

[0744] Extract particle points from the binary image of the second target.

[0745] For example, referring to Figure 14, the annular region that can cover the target area can be an annular region A, the third grayscale image can be image F2, the fourth grayscale image can be image G2, the binary image can be H2, the first target binary image can be image I2, and the second target binary image can be image J2.

[0746] Based on the embodiments of this application, by using a ring-shaped region that covers the target area to filter the second grayscale image, particle points corresponding to the ring-shaped region can be obtained, and particle points outside the ring-shaped region can be filtered out. In this way, the M-frame third grayscale image obtained by the first electronic device contains particle points within the ring-shaped region, while noise in other regions is filtered out.

[0747] In addition, the first electronic device can retain the parts that differ between multiple frames of images through differential processing. Since the second electronic device displays the positioning points and information points in different colors in a cycle during encoding, while the image background and noise are the same, differential processing can retain the positioning points and information points in the image as much as possible, and filter out the noise.

[0748] Furthermore, by filtering interference points from the first target binary image, the first electronic device can obtain a better quality second target binary image, which is beneficial for the first electronic device to successfully extract the particle points with encoded information.

[0749] In some implementations, method 800 also includes:

[0750] Multiple sets of first information are determined based on N frames of the first image;

[0751] By fusing multiple sets of first information, a first fusion result containing the target information is obtained.

[0752] It should be understood that the first information is the target information determined by the first electronic device based on N frames of the first image. For example, the target information encoded by the second electronic device is the connection pairing code 147258. Since the first electronic device needs to decode the acquired image to obtain the correct connection pairing code, but due to environmental influences and decoding capabilities, the first information decoded by the first electronic device may not be exactly the same as the target information encoded by the second electronic device. Therefore, the first electronic device can fuse multiple sets of first information to obtain the target information.

[0753] For example, taking N=5 as an example, the first electronic device can determine a set of first information based on the first frame image, the second frame image, and the third frame image; determine another set of first information based on the second frame image, the third frame image, and the fourth frame image; and determine yet another set of first information based on the third frame image, the fourth frame image, and the fifth frame image. Then, the first electronic device can fuse these three sets of first information to obtain the final target information.

[0754] For example, referring to Figure 22, the first information can be the decoding results of J2-1, J2-2, and J2-3. The first fusion result can be the fusion result.

[0755] Based on the embodiments of this application, the first electronic device can determine multiple sets of first information based on N frames of first images, and fuse the multiple sets of first information to obtain the final target information, thereby making the final target information more accurate.

[0756] In some implementations, method 800 also includes:

[0757] Obtain the first image of the second Nth frame;

[0758] Based on the first image in the second Nth frame, determine multiple sets of second information;

[0759] By fusing multiple sets of second information, a second fusion result containing target information is obtained;

[0760] The first fusion result and the second fusion result are combined to obtain the third fusion result, which includes the final determined target information.

[0761] Understandably, the second fusion result can be determined in the same way as the first fusion result.

[0762] For example, referring to Figure 23, the second fusion result can be the second round fusion result, the first fusion result can be the first round fusion result, and the third fusion result is the fusion result in Figure 23.

[0763] Based on the embodiments of this application, the first electronic device can also fuse the results of multiple rounds of fusion, thereby making the final determined target information more accurate.

[0764] In some implementations, the target information encoded in the particle points is determined based on the distribution of the particle points, including: determining multiple display areas based on the positioning points in the particle points;

[0765] The information encoded in each of the multiple display areas is determined based on the distribution of information points included in the multiple display areas.

[0766] The information encoded in each display area is merged in a preset order to obtain the target information.

[0767] For example, referring to Figure 5, the positioning points may include internal positioning points and external positioning points, and the distribution of the positioning points can determine display areas 1 to 12. Referring to Figure 7, each display area may have information points distributed thereon, and the distribution of different information points encodes different information.

[0768] Referring to Figure 20, the first electronic device can determine the distribution of information points in each display area in the manner shown in Figure 20, obtain the demodulation information of all display areas, and determine the encoded information in each display area by querying Table 1.

[0769] Based on the embodiments of this application, the first electronic device can determine multiple display areas by the distribution of positioning points, determine the encoded information in each display area, and then fuse the encoded information in the multiple display areas to obtain the encoded target information. With this technical solution, the first electronic device can successfully decode and obtain the target information encoded by the second electronic device.

[0770] In some implementations, the first information includes at least one of the following: connection pairing code of the second electronic device, account login information, product serial number, and media access control MAC address.

[0771] In other examples, the target information may also include other content, such as meeting links, which are not limited in the embodiments of this application.

[0772] In some implementations, the particle points are distributed in a ring-shaped region.

[0773] In other examples, the particle points can also be distributed in other shapes, such as rectangles or other regular or irregular shapes.

[0774] In some implementations, the method 800 may also include:

[0775] The display area for positioning is determined based on the positioning points in the particle dots;

[0776] The version number of the second electronic device is determined based on the number of information points in the display area, wherein different version numbers correspond to different numbers of information points in the display area.

[0777] For example, the number of information points contained in the display area is different, and the corresponding version number of the second electronic device is different.

[0778] It should be understood that the first electronic device can also determine the version number of the second electronic device based on the number of information points in the display area included in multiple frames.

[0779] For example, in the technical solution shown in Figure 7, two information points are encoded in each display area, which corresponds to version 1. In version 2, the second electronic device can encode three information points in each display area, and in version 3, the second electronic device can encode four information points in each display area.

[0780] For example, referring to Figure 7, the second electronic device encodes 12 display areas for each frame of image. When the ratio of the number of display areas with two information points in each frame of image decoded by the first electronic device to the 12 display areas is greater than or equal to a preset ratio, it is determined that the second electronic device encodes two information points in each display area, and the version number of the second electronic device is determined to be version number 1.

[0781] For example, if the ratio of the number of display areas with three information points in each frame of image decoded by the first electronic device to the number of display areas is greater than or equal to a preset ratio, then the second electronic device is determined to encode three information points in each display area, and the version number of the second electronic device is determined to be version number 2.

[0782] For example, if the second electronic device encodes 12 display areas for each frame of image, then the m frames of image decoded by the first electronic device include 12*m display areas. If the ratio of the number of display areas including two information points to 12*m is greater than or equal to a preset ratio, then the second electronic device is determined to encode two information points in each display area, and the version number of the second electronic device is determined to be version number 1.

[0783] In some examples, due to interference from some noise, the information points included in each display area of ​​the m-frame image decoded by the first electronic device may have multiple cases.

[0784] For example, if the ratio of the number of display areas containing two information points to 12*m in the m-frame image decoded by the first electronic device is less than a preset ratio, and the ratio of the number of display areas containing three information points to 12*m is less than a preset ratio, then the first electronic device determines that it cannot decode the version number of the second electronic device, and the first electronic device can determine that the version of the second electronic device is an unknown version.

[0785] It should be understood that the specific value of the preset ratio is not limited in the embodiments of this application. For example, the preset ratio can be 0.8 or 0.7, etc.

[0786] It should be understood that the version number of the second electronic device can be the system version number of the second electronic device, or it can be the version number of the second electronic device used to encode information.

[0787] Based on the embodiments of this application, the first electronic device can determine the version number of the second electronic device by the number of information points in the decoded display area, thus enabling the first electronic device to conveniently and quickly determine the version number of the second electronic device. In this way, the method by which the first electronic device determines the version number of the second electronic device is relatively simple and efficient.

[0788] In some implementations, the particle dots also include version number dots that indicate the version number of the second electronic device, wherein the version number dots are displayed cyclically in a third preset color order within the same frame of the first image.

[0789] Optionally, the number of version number points is a preset number. For example, the version number points are 4, 5, etc.

[0790] The third preset color order is different from the first and second preset color orders. For example, the third preset color order is the fourth color, the fifth color, and the sixth color, and each of the fourth, fifth, and sixth colors is different.

[0791] For example, the fourth, fifth, and sixth colors correspond to one of green, red, and gray, respectively. For instance, the fourth color is green, the fifth color is red, and the sixth color is gray. Or, the fourth color is red, the fifth color is gray, and the sixth color is green.

[0792] It should be understood that the fourth, fifth, and sixth colors can also be other colors, and this application embodiment does not limit them.

[0793] Optionally, the difference between the centroid of the triangle formed by the fourth, fifth, and sixth colors in the color gamut diagram and the centroid of the triangle formed by the first, second, and third colors in the color gamut diagram is less than a preset difference. This allows the information points and positioning points to be closer to the color of the version number, enabling them to be better hidden in the background.

[0794] Based on the embodiments of this application, the particle dots may also include version number dots for indicating the version number. In the same frame image, the version number is displayed cyclically according to a preset color order. In this way, the version number dots can be well hidden in the background, so that the user cannot perceive the existence of these particle dots with the naked eye.

[0795] In some implementations, the method 800 may also include:

[0796] The N frames of the third image are processed by intra-frame difference using the second intra-frame difference parameter to obtain the N frames of the fifth grayscale image.

[0797] N frames of the fifth grayscale image are cropped from the target region to obtain N frames of the sixth grayscale image.

[0798] It should be understood that the second intra-frame differential parameter is different from the first intra-frame differential parameter. Alternatively, the difference in differential parameters can be understood as the intra-frame differential mode used by the first electronic device for information points and positioning points being different from the intra-frame differential mode used for version number points.

[0799] For example, the differential mode corresponding to the first intra-frame differential parameter can be the intra-frame differential mode 1 mentioned above, and the differential mode corresponding to the second intra-frame differential parameter can be the intra-frame differential mode 2 mentioned above. For details, please refer to the relevant descriptions mentioned above.

[0800] This allows the first electronic device to filter out version number points when extracting information points and location points, thereby increasing the likelihood of successful decoding.

[0801] In some implementations, the first electronic device extracts particle points from the first image based on the target region, including:

[0802] The M sixth grayscale images in the N frames of the sixth grayscale images are filtered using a second annular region that can cover the version number point to obtain M seventh grayscale images. Each grayscale image in the M seventh grayscale images retains the part covered by the second annular region, and M is less than or equal to N.

[0803] Inter-frame difference processing is performed on the seventh grayscale image of frame M to obtain the eighth grayscale image of frame M;

[0804] Binarize the eighth grayscale image of frame M to obtain binary image B of frame M;

[0805] Perform an OR operation on the M-frame binary image B to obtain the third target binary image;

[0806] By filtering out interference points from the binary image of the third target, a binary image of the fourth target is obtained.

[0807] Extract the version number points from the particle points in the binary image of the fourth target.

[0808] For example, referring to Figure 29, the sixth grayscale image can be image VE2, the seventh grayscale image can be image VF2, the eighth grayscale image can be image VG2, the binary image B can be binary image VH2, the third target binary image can be VI2, and the fourth target binary image can be image VJ2.

[0809] It should be understood that the first electronic device can filter interference points from the third target binary image in the manner shown in Figure 31 to obtain the fourth target binary image.

[0810] For example, the second annular region that can cover the version number point can be used as a mask to filter the sixth grayscale image so as to retain the part covered by the second annular region (including the version number point).

[0811] In some examples, if the version number point is encoded on the inner circle of the positioning point, then the second annular region can be an annular region that covers the inner circle.

[0812] For example, the second annular region could be the annular region VA mentioned earlier.

[0813] In some examples, if the version number point is encoded on the outer circle of the outer circle of the positioning point, then the second annular region can be an annular region covering the outer circle.

[0814] Based on the embodiments of this application, the first electronic device uses the second annular region to filter the sixth grayscale image, thereby filtering out particle points outside the second annular region, and the first electronic device can successfully extract the version number points in the particle points.

[0815] Furthermore, by filtering interference points from the binary image of the third target, the first electronic device can obtain a better quality binary image of the fourth target, which is beneficial for the first electronic device to successfully extract the version number point from the particle points.

[0816] In some implementations, the first electronic device determines the target information encoded in the particle points based on the distribution of the particle points, including:

[0817] Determine the angle sequence based on the angle between every two adjacent version number points in the version number point;

[0818] The version number of the second electronic device is determined based on the relationship between the angle sequence and the preset angle sequence, wherein different version numbers correspond to different preset angle sequences.

[0819] It should be understood that the first electronic device can determine the angle sequence between every two adjacent version number points in a preset order. For example, if there are 4 version number points, the angle sequence can include 4 angle values.

[0820] For example, referring to Figure 27, the version number point can be V1, V2, V3, V4, and the angle sequence can be (α1, α2, α3, α4).

[0821] For example, referring to Table 2, version number 1 corresponds to preset angle sequence 1 (30°, 90°, 30°, 210°), version number 2 corresponds to preset angle sequence 2 (15°, 60°, 15°, 270°), version number 3 corresponds to preset angle sequence 3 (45°, 30°, 45°, 240°), etc.

[0822] Based on the embodiments of this application, the first electronic device can determine the angle sequence according to the distribution of version number points, and match the angle sequence with a preset angle sequence to determine the version number of the second electronic device.

[0823] In some implementations, the first electronic device determines the version number of the second electronic device based on the relationship between the angle sequence and a preset angle sequence, including:

[0824] The angles in the angle sequence are matched with the corresponding angles in the preset angle sequence to determine the number of valid angles in the angle sequence.

[0825] When the number of valid angles in the angle sequence is greater than the first preset number, the version number of the second electronic device is determined to be the version number corresponding to the preset angle sequence.

[0826] For example, when the difference between the first angle in the angle sequence and the first angle in the preset angle sequence is small (e.g., the difference is less than the preset value), the first angle can be determined to be a valid angle.

[0827] For example, referring to Figure 34, the angle sequence is a candidate angle sequence, the preset angle sequence is a standard angle sequence, and the first electronic device can also use the method of determining the effective angle in step 5533 to determine the effective angle in the angle sequence.

[0828] For example, if the angle sequence includes 4 angles, then the first preset quantity can be 2.

[0829] Based on the embodiments of this application, when an angle sequence is matched with a certain preset angle sequence, if the number of effective angles is greater than a first preset number, the version number of the second electronic device can be determined to be the version number corresponding to the preset angle sequence.

[0830] In some implementations, the version number point is located on the circle where the positioning point is located, and each version number point is located between two adjacent positioning points.

[0831] It should be understood that the circle containing the positioning point can be either the inner circle or the outer circle.

[0832] For example, referring to (a) in Figure 27, the version number point is located on the inner circle where the positioning point is located, and is located between two adjacent positioning points for each version number point.

[0833] For example, see Figure 27(b), where the version number point is located on the outer circle of the positioning point and between two adjacent positioning points.

[0834] In other examples, the two version number points in this version number point may also be located between two adjacent positioning points, which is not limited in the embodiments of this application.

[0835] Based on the embodiments of this application, when the version number point is located on the inner or outer circle of the positioning point, the version number point can be made to not affect the encoding of the information point.

[0836] Furthermore, when the version number point is located on the inner circle, the image obtained by the second cropping of the first electronic device can be smaller, thus reducing the amount of data of the first electronic device.

[0837] In some implementations, the method 800 may also include:

[0838] When it is determined that the version number of the second electronic device is higher than that of the first electronic device, a first prompt message is displayed. The first prompt message is used to prompt the user to upgrade the first electronic device, or to prompt the user to establish a connection with the second electronic device using a connection pairing code.

[0839] For example, referring to (c) in Figure 26, the first prompt message can be a prompt card 312, which may include the text content "scan failed" and "the current version is too low and cannot parse the pattern of the peer device. Please connect via connection code or upgrade and try again".

[0840] Based on the embodiments of this application, when the first electronic device determines that the version number of the second electronic device is higher than the version number of the first electronic device, it can display a first prompt message, thereby prompting the user that the current version of the first electronic device is low and needs to be upgraded. Alternatively, when scanning a pattern to connect devices, the first prompt message can also be used to prompt the user to establish a connection relationship with the second electronic device using a connection pairing code or manually.

[0841] This application also provides an information transmission method applied to a second electronic device. The method includes: generating particle points encoded with target information; displaying a first image, the first image including particle points encoded with target information, the particle points including positioning points for locating a display area and information points for indicating data, wherein in the same frame of the first image, the positioning points are displayed cyclically according to a first preset color order, and the information points are displayed cyclically according to a second preset color order.

[0842] Based on the embodiments of this application, the coded particles in the first image displayed by the second electronic device include positioning points and information points. In the same frame of the first image, the positioning points are displayed cyclically according to a first preset color order, and the information points are displayed cyclically according to a second preset color order. In this way, the positioning points and information points can be displayed cyclically according to different colors, thereby increasing the concealment of the particle points.

[0843] In some implementations, the particle dots also include version number dots that indicate the version number of the second electronic device, wherein the version number dots are displayed cyclically in a third preset color order within the same frame of the first image.

[0844] Based on the embodiments of this application, the particle dots encoded by the second electronic device may further include version number dots for indicating the version number. In the same frame image, the version number is displayed cyclically according to a preset color order. In this way, the version number dots can be well hidden in the background, making the existence of these particle dots imperceptible to the user's naked eye.

[0845] This application also provides an electronic device, including one or more processors; one or more memories; the one or more memories storing one or more instructions, which, when executed by one or more processors, cause the information transmission method as described in any of the possible implementations above to be executed.

[0846] This application also provides an apparatus including a processor and a communication interface. The communication interface is used to receive signals and transmit the signals to the processor. The processor processes the signals so that the information transmission method described in any of the possible implementations above is executed.

[0847] The device can be a chip. For example, the chip can be a chip system or a standalone chip.

[0848] This application also provides a readable storage medium storing instructions that, when executed on an electronic device, cause the electronic device to perform the aforementioned method steps to implement the information transmission method described above.

[0849] This application also provides a program product that, when run on an electronic device, causes the electronic device to perform the aforementioned steps to realize the information transmission method described in the above embodiments.

[0850] This application also provides an apparatus including a module for implementing the information transmission method as described in any of the foregoing embodiments.

[0851] In addition, embodiments of this application also provide an apparatus, which may specifically be a chip, component or module. The apparatus may include a connected processor and a memory; wherein the memory is used to store instructions, and when the apparatus is running, the processor may execute the instructions stored in the memory to cause the apparatus to perform the information transmission methods in the above-described method embodiments.

[0852] In this embodiment, the device, readable storage medium, program product or apparatus are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects of the corresponding methods provided above, and will not be repeated here.

[0853] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0854] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0855] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0856] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0857] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0858] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory, random access memory, magnetic disks, or optical disks.

[0859] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for information transmission, characterized in that, The method is applied to a first electronic device, and the method includes: N frames of first images are acquired. Each frame of the first image includes particle points encoded with target information. The particle points include positioning points for locating the display area and information points for indicating data. In the same frame of the first image, the positioning points are displayed cyclically according to a first preset color order, and the information points are displayed cyclically according to a second preset color order. N is greater than or equal to 3. Determine the target region in the first image that contains the particle points; Extract the particle points from the first image based on the target region; Based on the distribution of the particle points, the target information encoded in the particle points is determined.

2. The method according to claim 1, characterized in that, Before determining the target region containing the particle points in the first image, the method further includes: It is determined that the first distance between the first electronic device and the second electronic device is less than or equal to a preset distance.

3. The method according to claim 2, characterized in that, Determining the target region containing the particle points in the first image includes: The first image in the first frame of the N frames of the first image is downsampled according to the first distance to obtain the second image; The second image is binarized to obtain a binary image; The target region is determined based on the binary image.

4. The method according to claim 3, characterized in that, The method further includes: The N frames of the first image are downsampled according to the target region to obtain the N frames of the third image; The N frames of the third image are subjected to intra-frame difference processing using the first intra-frame difference parameters to obtain the N frames of the first grayscale image; The N frames of the first grayscale image are cropped according to the target region to obtain the N frames of the second grayscale image.

5. The method according to claim 4, characterized in that, Extracting the particle points from the first image based on the target region includes: Using an annular region that can cover the target area, M frames of second grayscale images in the N frames of second grayscale images are filtered to obtain M frames of third grayscale images. Each frame of the M frames of third grayscale images retains the part covered by the annular region, and M is less than or equal to N. Inter-frame difference processing is performed on the third grayscale image of the M frames to obtain the fourth grayscale image of the M frames; The fourth grayscale image of the M-frame is binarized to obtain the M-frame binary image; Perform an OR operation on the M-frame binary images to obtain the first target binary image; The first target binary image is filtered for interference points to obtain the second target binary image; Extract the particle points from the second target binary image.

6. The method according to any one of claims 1-5, characterized in that, The method further includes: Multiple sets of first information are determined based on the N frames of the first image; By fusing the multiple sets of first information, a first fusion result containing the target information is obtained.

7. The method according to claim 6, characterized in that, The method further includes: Obtain the first image of the second Nth frame; Based on the first image of the second Nth frame, multiple sets of second information are determined; By fusing the multiple sets of second information, a second fusion result containing the target information is obtained; The first fusion result and the second fusion result are fused to obtain a third fusion result, wherein the third fusion result includes the finally determined target information.

8. The method according to any one of claims 1-7, characterized in that, The step of determining the target information encoded in the particle points based on their distribution includes: Multiple display areas are determined based on the distribution of positioning points in the particle points; The information encoded in each of the plurality of display areas is determined based on the distribution of information points included in the plurality of display areas; The target information is obtained by fusing the encoded information in each display area in a preset order.

9. The method according to any one of claims 1-8, characterized in that, The target information includes at least one of the following: the connection pairing code of the second electronic device, account login information, product serial number, and media access control MAC address.

10. The method according to any one of claims 1-9, characterized in that, The particle points are distributed in a ring-shaped region.

11. The method according to claim 5, characterized in that, The method further includes: The display area for positioning is determined based on the positioning point among the particle points; The version number of the second electronic device is determined based on the number of information points in the display area, wherein different version numbers correspond to different numbers of information points in the display area.

12. The method according to any one of claims 1-10, characterized in that, The particle dots also include version number dots that indicate the version number of the second electronic device, wherein the version number dots are displayed cyclically in the same frame of the first image according to a third preset color order.

13. The method according to claim 12, characterized in that, The method further includes: The N frames of the third image are subjected to intra-frame difference processing using the second intra-frame difference parameter to obtain the N frames of the fifth grayscale image; The N frames of the fifth grayscale image are cropped according to the target region to obtain the N frames of the sixth grayscale image.

14. The method according to claim 13, characterized in that, Extracting the particle points from the first image based on the target region includes: The M sixth grayscale images in the N frames of the sixth grayscale images are filtered using a second annular region that can cover the version number point to obtain M seventh grayscale images. Each grayscale image in the M seventh grayscale images retains the part covered by the second annular region, and M is less than or equal to N. Inter-frame difference processing is performed on the seventh grayscale image of the M-frame to obtain the eighth grayscale image of the M-frame; The eighth grayscale image of the M-frame is binarized to obtain the M-frame binary image B; Perform an OR operation on the M-frame binary images B to obtain the third target binary image; Interference point filtering is performed on the third target binary image to obtain the fourth target binary image; Extract the version number point from the particle points in the binary image of the fourth target.

15. The method according to any one of claims 12-14, characterized in that, The step of determining the target information encoded in the particle points based on their distribution includes: Determine the angle sequence based on the angle between every two adjacent version number points in the version number points; The version number of the second electronic device is determined based on the relationship between the angle sequence and the preset angle sequence, wherein different version numbers correspond to different preset angle sequences.

16. The method according to claim 15, characterized in that, Determining the version number of the second electronic device based on the relationship between the angle sequence and a preset angle sequence includes: The angles in the angle sequence are matched with the corresponding angles in the preset angle sequence to determine the number of valid angles in the angle sequence. When the number of valid angles in the angle sequence is greater than the first preset number, the version number of the second electronic device is determined to be the version number corresponding to the preset angle sequence.

17. The method according to any one of claims 12-16, characterized in that, The version number point is located on the circle where the positioning point is located, and each version number point is located between two adjacent positioning points.

18. The method according to any one of claims 11-17, characterized in that, The method further includes: When it is determined that the version number of the second electronic device is higher than the version number of the first electronic device, a first prompt message is displayed. The first prompt message is used to prompt the user to upgrade the first electronic device, or the first prompt message is used to prompt the user to establish a connection with the second electronic device using a connection pairing code.

19. A method for transmitting information, characterized in that, The method is applied to a second electronic device, and the method includes: Generate particle points encoded with target information; The first image is displayed, which includes particle points encoded with target information. The particle points include positioning points for locating the display area and information points for indicating data. In the same frame of the first image, the positioning points are displayed cyclically in a first preset color order, and the information points are displayed cyclically in a second preset color order.

20. The method according to claim 19, characterized in that, The particle dots also include version number dots that indicate the version number of the second electronic device, wherein the version number dots are displayed cyclically in the same frame of the first image according to a third preset color order.

21. An electronic device, characterized in that, include: One or more processors; One or more memories; the one or more memories storing one or more programs that, when executed by the one or more processors, cause the method of information transmission as described in any one of claims 1 to 19 to be performed.

22. A chip, characterized in that, The chip includes a processor and a communication interface, the communication interface being used to receive signals and transmit the signals to the processor, the processor processing the signals such that the information transmission method as described in any one of claims 1 to 19 is executed.

23. A readable storage medium, characterized in that, The readable storage medium stores instructions that, when executed on the device, cause the method of information transmission as described in any one of claims 1 to 19 to be performed.

24. A program product, characterized in that, The program product includes program code that, when run on an electronic device, causes the method of information transmission as described in any one of claims 1 to 19 to be executed.

Citation Information

Patent Citations

  • Information transmission method and electronic equipment

    CN121193728A

  • Dynamic two-dimension code and decoding method thereof

    CN102750564A

  • Two-dimensional code display method and device, equipment and medium

    CN112651475A

  • Unidirectional transfer of data from sender to receiver

    US20230419063A1

  • Information transfer system, transmission device, receiving device, information transfer method and program

    WO2024121928A1