Riding code display method and device, electronic equipment and storage medium

By obtaining the current position and posture on the electronic device, and directly displaying the ride code if specific conditions are met, the problem of cumbersome display operation in the prior art is solved and efficiency is improved.

CN119271038APending Publication Date: 2025-01-07GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202310822871.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-05
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

The operation process of existing electronic equipment displaying ride codes is cumbersome, resulting in low efficiency.

Method used

By obtaining the current position and attitude of the electronic device, if the distance from the preset ride position is less than the threshold and the posture satisfies the preset attitude, the ride code will be displayed directly to reduce the operation steps.

Benefits of technology

The operation process of riding code display is simplified, the efficiency of riding code display is improved, and the cumbersome operation steps for users are reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119271038A_ABST
    Figure CN119271038A_ABST
Patent Text Reader

Abstract

The invention discloses a riding code display method and device, electronic equipment and a storage medium, and relates to the technical field of electronic equipment. The method comprises the steps that the current position of the electronic equipment is obtained, if the distance between the current position and a preset riding position is smaller than a distance threshold value, the current posture of the electronic equipment is obtained, and if the current posture meets a preset posture, a riding code is displayed. According to the invention, when it is determined that the electronic equipment meets the code scanning riding scene based on the current position and the current posture of the electronic equipment, the riding code is directly displayed, the tedious operation process of bright code riding can be reduced, and the efficiency of bright code riding is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of electronic devices, and more specifically, to a method, device, electronic device and storage medium for displaying a boarding code. Background Art

[0002] With the development of science and technology, electronic devices are used more and more widely and have more and more functions. They have become one of the necessities in people's daily life. At present, electronic devices can be used to display boarding codes so that users can take the subway or bus through the boarding codes. However, the path for electronic devices to trigger the display of boarding codes is relatively deep, and users need to perform cumbersome operations to trigger it, resulting in low efficiency of electronic devices displaying boarding codes. Summary of the invention

[0003] In view of the above problems, the present application proposes a method, device, electronic device and storage medium for displaying a boarding code to solve the above problems.

[0004] In the first aspect, an embodiment of the present application provides a method for displaying a boarding code, which is applied to an electronic device, and the method includes: obtaining the current position of the electronic device; if the distance between the current position and a preset boarding position is less than a distance threshold, obtaining the current posture of the electronic device; if the current posture meets the preset posture, displaying the boarding code.

[0005] In a second aspect, an embodiment of the present application provides a device for displaying a boarding code, which is applied to an electronic device, and the device includes: a current position acquisition module, used to obtain the current position of the electronic device; a current posture acquisition module, used to obtain the current posture of the electronic device if the distance between the current position and a preset boarding position is less than a distance threshold; and a boarding code display module, used to display the boarding code if the current posture meets the preset posture.

[0006] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory and a processor, wherein the memory is coupled to the processor, the memory stores instructions, and when the instructions are executed by the processor, the processor executes the above method.

[0007] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a program code is stored, and the program code can be called by a processor to execute the above method.

[0008] The method, device, electronic device and storage medium for displaying the boarding code provided in the embodiments of the present application obtain the current position of the electronic device. If the distance between the current position and the preset boarding position is less than a distance threshold, the current posture of the electronic device is obtained. If the current posture meets the preset posture, the boarding code is displayed. By directly displaying the boarding code when it is determined that the electronic device meets the scenario of scanning the code to board the bus based on the current position and current posture of the electronic device, the tedious operation process of showing the code to board the bus can be reduced, thereby improving the efficiency of showing the code to board the bus. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.

[0010] Figure 1 A schematic diagram showing a flow chart of a method for displaying a boarding code provided in an embodiment of the present application is shown;

[0011] Figure 2 A first structural schematic diagram of a subway gate provided in an embodiment of the present application is shown;

[0012] Figure 3 A second structural schematic diagram of a subway gate provided in an embodiment of the present application is shown;

[0013] Figure 4 A third structural schematic diagram of a subway gate provided in an embodiment of the present application is shown;

[0014] Figure 5 A schematic diagram showing a flow chart of a method for displaying a boarding code provided in an embodiment of the present application is shown;

[0015] Figure 6 This application shows Figure 5 The schematic diagram of the process of step S260 of the method for displaying the boarding code shown in FIG.

[0016] Figure 7 A schematic diagram showing a flow chart of a method for displaying a boarding code provided in an embodiment of the present application is shown;

[0017] Figure 8 A schematic diagram showing a flow chart of a method for displaying a boarding code provided in an embodiment of the present application is shown;

[0018] Fig. 9 A schematic diagram showing a flow chart of a method for displaying a boarding code provided in an embodiment of the present application is shown;

[0019] Fig.10A schematic diagram showing a flow chart of a method for displaying a boarding code provided in an embodiment of the present application is shown;

[0020] Fig.11 A schematic diagram showing a flow chart of a method for displaying a boarding code provided in an embodiment of the present application is shown;

[0021] Fig.12 A schematic diagram showing a flow chart of a method for displaying a boarding code provided in an embodiment of the present application is shown;

[0022] Fig.13 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown;

[0023] Fig.14 A module block diagram of a display device for a boarding code provided by an embodiment of the present application is shown;

[0024] Fig.15 A block diagram of an electronic device for executing a method for displaying a boarding code according to an embodiment of the present application is shown;

[0025] Fig.16 A storage unit of an embodiment of the present application is shown for storing or carrying program code for implementing a method for displaying a boarding code according to an embodiment of the present application. DETAILED DESCRIPTION

[0026] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.

[0027] At present, the process of electronic devices displaying (showing) the boarding code is rather cumbersome. Taking the display of the boarding code triggered by an application as an example, at least three steps are required. The first step is to open the application, the second step is to find the "Mini Program" column in the application, and the third step is to click on the "Boarding Code" applet in the applet. This is still an ideal situation. Assuming that the user is using other applications at this time, he needs to exit the current application and return to the desktop, and then find the corresponding application to perform the above steps. Therefore, the current operation process of triggering the display of the boarding code is cumbersome, resulting in low efficiency of electronic devices in displaying the boarding code.

[0028] In view of the above problems, the inventors have discovered after long-term research and proposed the method, device, electronic device and storage medium for displaying the boarding code provided in the embodiments of the present application. By directly displaying the boarding code when the electronic device is determined to meet the scenario of scanning the code for boarding based on the current position and current posture of the electronic device, the cumbersome operation process of showing the code for boarding can be reduced and the efficiency of showing the code for boarding can be improved. Among them, the specific method for displaying the boarding code is described in detail in the subsequent embodiments.

[0029] See also Figure 1 , Figure 1 The flowchart of the method for displaying a boarding code provided by an embodiment of the present application is shown. The method is used to directly display the boarding code when the electronic device is determined to meet the scenario of scanning the code for boarding based on the current position and current posture of the electronic device, which can reduce the cumbersome operation process of showing the code for boarding and improve the efficiency of showing the code for boarding. In a specific embodiment, the method for displaying the boarding code is applied to Fig.14 The boarding code display device 200 and the electronic device equipped with the boarding code display device 200 ( Fig.15 ). The following will take an electronic device as an example to illustrate the specific process of this embodiment. Of course, it can be understood that the electronic device used in this embodiment may include a smart phone, a tablet computer, a wearable electronic device, etc., which is not limited here. Figure 1 The process shown in the figure is described in detail, and the method for displaying the boarding code may specifically include the following steps:

[0030] Step S110: Acquire the current location of the electronic device.

[0031] In this embodiment, the current location of the electronic device can be obtained.

[0032] Optionally, the longitude information and latitude information of the electronic device may be acquired, and the current location of the electronic device may be determined based on the longitude information and latitude information.

[0033] In some embodiments, the electronic device may have a built-in positioning module, based on which the current position of the electronic device may be obtained through the positioning module. As one way, the positioning module may include a global positioning system (GPS) module, and the current position of the electronic device may be obtained through the GPS module. As another way, the positioning module may include a Beidou Navigation Satellite System (BDS) module, and the current position of the electronic device may be obtained through the BDS module.

[0034] In some embodiments, the current position of the electronic device can be obtained in real time, at a preset time interval, at a preset time point, in response to the flipping of the electronic device, in response to the shaking of the electronic device, or according to other preset rules, etc., which are not limited here. Optionally, when the current position of the electronic device is obtained at a preset time interval, the preset time interval may include 3 seconds, 4 seconds, etc., which are not limited here.

[0035] Step S120: If the distance between the current position and the preset riding position is less than a distance threshold, the current posture of the electronic device is obtained.

[0036] Optionally, the electronic device may be pre-set and store a preset boarding location, or the cloud connected to the electronic device in communication may be pre-set and store a preset boarding location, wherein the preset boarding location may include the location of a subway station and / or the location of a bus stop. It is understandable that, in general, subway stations and bus stops are kept at fixed locations after construction, so the electronic device or the cloud connected to the electronic device in communication may obtain the location of the set subway station and / or the location of the bus stop in advance, and determine the obtained location of the set subway station and / or the location of the bus stop as the preset boarding location.

[0037] In some embodiments, the electronic device may pre-set and store a distance threshold value, which is used as a basis for determining the distance between the current position and the preset boarding position. Therefore, in this embodiment, when the current position of the electronic device is obtained, the current position may be compared with the preset boarding position to determine the distance between the current position and the preset boarding position, and the distance may be compared with the distance threshold value to determine whether the distance between the current position and the preset boarding position is less than the distance threshold value.

[0038] Optionally, taking into account that electronic devices may sometimes have inaccurate positioning problems, and in order to ensure that the electronic device smoothly enters the subsequent steps of obtaining the current posture of the electronic device and determining whether the current posture meets the preset posture, the present embodiment may allow positioning detection errors, that is, the distance threshold may be set as large as possible, such as the distance threshold may be set to 300 meters, 200 meters, etc., without limitation here.

[0039] Optionally, when the current position and the preset riding position are obtained, the horizontal and vertical coordinates of the current position in the target coordinate system can be determined, and the horizontal and vertical coordinates of the preset riding position in the target coordinate system can be determined. The distance between the horizontal coordinate of the current position in the target coordinate system and the horizontal coordinate of the preset riding position in the target coordinate system is calculated as the first distance, and the distance between the vertical coordinate of the current position in the target coordinate system and the vertical coordinate of the preset riding position in the target coordinate system is calculated as the second distance. Based on the first distance and the second distance, the distance between the current position and the preset riding position is determined.

[0040] Among them, if it is determined that the distance between the current position and the preset boarding position is less than the distance threshold, it can be determined that the user corresponding to the electronic device has entered the range where the vehicle can be boarded (such as a subway station or a bus stop), and the subsequent steps of obtaining the current posture of the electronic device and judging whether the current posture meets the preset posture can be entered. If it is determined that the distance between the current position and the preset boarding position is greater than or equal to (not less than) the distance threshold, it can be determined that the user corresponding to the electronic device has not entered the range where the vehicle can be boarded (such as a subway station or a bus stop), and the subsequent steps of obtaining the current posture of the electronic device and judging whether the current posture meets the preset posture can be skipped, and the current position of the electronic device can be continued to be obtained.

[0041] In some embodiments, the electronic device may be built with a posture detection module, and the current posture of the electronic device may be detected and acquired through the posture detection module disposed in the electronic device, such as a gyroscope, an acceleration sensor, a gravity sensor, and other sensors capable of posture detection. Specifically, taking the gyroscope as an example, according to the axis fixity of the gyroscope and the known preset posture of the electronic device relative to the rotation axis direction of the gyroscope, when there is a difference between the posture of the electronic device and the preset posture, and a movement in a certain direction of pitch, yaw or roll occurs, because the rotation axis of the gyroscope maintains an unchanged direction, it is detected that the angle relationship of the electronic device relative to the rotation axis and the angle relationship of the preset posture relative to the rotation axis have changed, and then the posture change of the electronic device can be determined, and the current posture of the electronic device can be determined.

[0042] Step S130: If the current posture meets the preset posture, the boarding code is displayed.

[0043] It is understandable that the gates at subway stations and bus stations are almost all the same. The boarding code scanning device (scanning port) of the gate is generally set about one meter above the ground. When the boarding code is displayed on the electronic device for scanning, the boarding code displayed by the electronic device needs to face the boarding code scanning device. Moreover, after investigation, taking the gates at subway stations as an example, most of their scanning ports are facing diagonally upwards (such as Figure 2 As shown in the figure), a few scanning ports are perpendicular to the ground (such as Figure 3 As shown), and some are slanted upward to the left and right (as shown Figure 4 Based on this, when the electronic device faces the code scanning port of the gate, it generally presents a specific posture, as shown above Figure 3 The electronic device is in a vertical static posture.

[0044] In this embodiment, a preset posture can be pre-set, wherein the preset posture can be the posture of the electronic device when it faces the code scanning port to display the boarding code for the boarding code scanning device to scan the code. Optionally, the historical postures of multiple electronic devices facing the code scanning port to display the boarding code for the boarding code scanning device to scan the code can be collected, and the rules can be summarized to obtain the preset posture; or the historical postures of the electronic device facing the code scanning port to display the boarding code for the boarding code scanning device to scan the code can be collected, and the rules can be summarized to obtain the preset posture.

[0045] In some embodiments, the electronic device may be pre-set and stored with a preset posture, and the preset posture is used as a basis for judging the current posture of the electronic device. Therefore, in this embodiment, when the current posture of the electronic device is obtained, the current posture can be compared with the preset posture to determine whether the current posture satisfies the preset posture. Among them, if it is determined that the current posture satisfies the preset posture, it can be considered that the user corresponding to the electronic device expects the electronic device to display the boarding code for the boarding code scanning device to scan the code for boarding, and the boarding code can be displayed. If it is determined that the current posture does not meet the preset posture, it can be considered that the user corresponding to the electronic device may be passing by the boarding location, and does not expect the electronic device to display the boarding code for the boarding code scanning device to scan the code for boarding, and the boarding code may not be displayed.

[0046] As an implementable manner, when the current posture of the electronic device is obtained, the current posture can be compared with the preset posture to determine whether the current posture matches the preset posture. If it is determined that the current posture matches the preset posture, it can be determined that the current posture satisfies the preset posture; if it is determined that the current posture does not match the preset posture, it can be determined that the current posture does not satisfy the preset posture.

[0047] As an implementable manner, displaying the boarding code may include: lighting up the screen of the electronic device and displaying the boarding code.

[0048] As an implementable manner, displaying the boarding code may include: displaying the boarding code in full screen, or displaying the boarding code in non-full screen.

[0049] In some embodiments, when displaying the boarding code, the electronic device may simultaneously display a first target control, wherein the first target control is used to trigger a switch from displaying the boarding code to displaying the payment code. Based on this, during the process of displaying the boarding code and the first target control, if a touch operation acting on the first target control is detected, the display of the boarding code may be switched to displaying the payment code.

[0050] In some embodiments, when the electronic device displays the payment code, it can also display a second target control, wherein the second target control is used to trigger the switch from displaying the payment code to displaying the boarding code. Based on this, during the process of displaying the payment code and the second target control, if a touch operation acting on the second target control is detected, the display of the payment code can be switched to displaying the boarding code.

[0051] A method for displaying a boarding code provided in an embodiment of the present application obtains the current position of the electronic device. If the distance between the current position and the preset boarding position is less than a distance threshold, the current posture of the electronic device is obtained. If the current posture meets the preset posture, the boarding code is displayed. By directly displaying the boarding code when it is determined that the electronic device meets the scenario of scanning the code for boarding based on the current position and current posture of the electronic device, the tedious operation process of showing the code for boarding can be reduced, thereby improving the efficiency of showing the code for boarding.

[0052] See also Figure 5 , Figure 5 The schematic diagram of the process of displaying the boarding code provided by an embodiment of the present application is shown. The method is applied to the above electronic device. Figure 5 The process shown in the figure is described in detail, and the method for displaying the boarding code may specifically include the following steps:

[0053] Step S210: Acquire the current location of the electronic device.

[0054] Step S220: If the distance between the current position and the preset riding position is less than a distance threshold, the current posture of the electronic device is obtained.

[0055] For the detailed description of step S210 to step S220, please refer to step S110 to step S120, which will not be repeated here.

[0056] Step S230: If the current posture satisfies the preset posture, the front camera of the electronic device is turned on, and a first image captured by the front camera is acquired.

[0057] In this embodiment, if it is determined that the current posture of the electronic device meets the preset posture, it can be considered that the electronic device is in a posture with the screen facing the code scanning port. At this time, the front camera of the electronic device (the camera on the side of the screen) can be turned on, and the image captured by the front camera can be obtained, and the image captured by the front camera can be used as the first image.

[0058] Among them, it can be understood that even if it is determined that the distance between the current position of the electronic device and the preset boarding position is less than the distance threshold, and the current posture of the electronic device meets the preset posture, the user corresponding to the electronic device may not really intend to enter the subway gate or take the bus. For example, the user corresponding to the electronic device may purchase goods from a vending machine placed in a subway station in this way. Therefore, if the boarding code is directly displayed when it is determined that the distance between the current position of the electronic device and the preset boarding position is less than the distance threshold, and the current posture of the electronic device meets the preset posture, there may be a problem of erroneous display. Based on this, this embodiment adds the acquisition of images by the front camera of the electronic device for further identification and judgment to improve the accuracy of displaying the boarding code.

[0059] In some embodiments, when the front camera of the electronic device is turned on, the first image captured by the front camera can be acquired in real time, the first image captured by the front camera can be acquired at a preset time interval, the first image captured by the front camera can be acquired at a preset time point, the first image captured by the front camera can be acquired according to other preset rules, etc., which are not limited here.

[0060] Step S240: Input the multiple frames of images into the on-board code scanning device recognition network in order from front to back in terms of acquisition time, and obtain the first probability values ​​output by the on-board code scanning device recognition network in sequence, wherein the first probability value is used to characterize the probability that the first image includes a on-board code scanning device.

[0061] The first image includes multiple frames of images captured by the front camera within a preset time. Optionally, the preset time may include 2 seconds, 3 seconds, etc., and the multiple frames of images may include 20 frames of images, 30 frames of images, etc., which are not limited here. For example, the front camera of the electronic device can capture images at a frame rate of 10 frames per second for a total of 2 seconds, thereby forming 20 frames of images as the first image. Optionally, the image captured by the front camera can be a 240*240 size picture.

[0062] In this embodiment, when multiple frames of images are obtained, the multiple frames of images can be sequentially input into the trained vehicle code scanning device recognition network (trained deep learning neural network) in the order of acquisition time from front to back, and the first probability values ​​sequentially output by the vehicle code scanning device recognition network are obtained, wherein the first probability value is used to characterize the probability that the vehicle code scanning device is included in the first image. For example, the input of the vehicle code scanning device recognition network can be multiple frames of 240*240 images, and the output can be a probability value in the range of [0, 1], and the closer the probability value is to 1, the higher the probability that the vehicle code scanning device is included in the frame image.

[0063] As an example, assuming that multiple frames of images include the first frame image, the second frame image and the third frame image in order from the acquisition time, the first frame image can be first input into the vehicle code scanning device recognition network to obtain the first probability value corresponding to the first frame image output by the vehicle code scanning device recognition network; then, the second frame image is input into the vehicle code scanning device recognition network to obtain the first probability value corresponding to the second frame image output by the vehicle code scanning device recognition network; finally, the third frame image is input into the vehicle code scanning device recognition network to obtain the first probability value corresponding to the third frame image output by the vehicle code scanning device recognition network.

[0064] Step S250: If the number of the output first probability values ​​that are greater than the first probability threshold reaches the quantity threshold, it is determined that the first image includes the on-board code scanning device, and the remaining images in the multiple frames of images are stopped from being input into the on-board code scanning device recognition network.

[0065] Optionally, the electronic device may pre-set and store a first probability threshold value, which is used as a basis for judging the first probability value. If the first probability value is greater than the first probability threshold value, it can be determined that the probability that the image corresponding to the first probability value includes a boarding code scanning device is extremely high, that is, it can be considered that the image corresponding to the first probability value includes a boarding code scanning device; if the first probability value is less than or equal to the first probability threshold value, it can be determined that the probability that the image corresponding to the first probability value includes a boarding code scanning device is low, that is, it can be considered that the image corresponding to the first probability value does not include a boarding code scanning device. The first probability threshold value may include 0.7, 0.8, etc., which are not limited here.

[0066] Optionally, the electronic device may pre-set and store a quantity threshold, which is used as a basis for judging the number of corresponding first probability values ​​in multiple-frame images that are greater than the first probability threshold. If the number of corresponding first probability values ​​in multiple-frame images that are greater than the first probability threshold reaches the quantity threshold, it can be considered that the probability of including a boarding code scanning device in the multiple-frame image (first image) is extremely high, that is, it can be considered that the first image includes a boarding code scanning device; if the number of corresponding first probability values ​​in multiple-frame images that are greater than the first probability threshold does not reach the quantity threshold, it can be considered that the probability of including a boarding code scanning device in the multiple-frame image (first image) is low, that is, it can be considered that the first image does not include a boarding code scanning device. The quantity threshold may include 3, 4, etc., which are not limited here.

[0067] In this embodiment, if the number of the output first probability values ​​that are greater than the first probability threshold reaches the number threshold, it is determined that the first image includes a boarding code scanning device, and the input of the remaining images in the multiple frames of images into the boarding code scanning device recognition network is stopped. As an example, the front camera of the electronic device is set to capture images at a frame rate of 10 frames per second within a duration of 2 seconds. At the same time, each frame of the captured image is sequentially input into the boarding code scanning device recognition network in chronological order from front to back. During this process, if it is recognized that 3 frames of images include boarding code scanning devices, the boarding code is displayed. At this time, there is no need to wait for 2 seconds. As long as the images including the boarding code scanning device include 3 frames, the boarding code can be displayed, and the subsequent images do not need to be detected again, thereby reducing the power consumption of the electronic device.

[0068] Step S260: If it is determined that the first image includes a boarding code scanning device, the boarding code is displayed.

[0069] In this embodiment, when the first image is acquired, it can be determined whether the first image includes a boarding code scanning device. If it is determined that the first image includes a boarding code scanning device, it can be considered that the user corresponding to the electronic device does want to scan the code to board the bus, and the boarding code can be displayed; if it is determined that the first image does not include a boarding code scanning device, it can be considered that the user corresponding to the electronic device does not want to scan the code to board the bus, and the boarding code can be not displayed.

[0070] As an implementable method, when a first image is acquired, image recognition can be performed on the first image, and the target image included in the recognized first image can be compared with the image of a pre-set on-board code scanning device to obtain a comparison result, and based on the comparison result, it can be determined whether the first image includes a on-board code scanning device.

[0071] See also Figure 6 , Figure 6 This application shows Figure 5 The flow chart of step S260 of the method for displaying the boarding code shown in FIG. Figure 6 The process shown is described in detail, and the method may specifically include the following steps:

[0072] Step S261: If it is determined that the first image includes the on-board code scanning device, the on-board code scanning device is identified.

[0073] It is understandable that the boarding code scanning device may include a subway boarding code scanning device, a bus boarding code scanning device, etc. Among them, if the boarding code scanning device included in the first image is a subway boarding code scanning device or a bus boarding code scanning device, it can be considered that the user expects to board the bus by scanning the boarding code. Based on this, if it is determined that the boarding code scanning device is included in the first image, it can be identified whether the boarding code scanning device includes a subway boarding code scanning device or a bus boarding code scanning device to improve the accuracy of displaying the boarding code.

[0074] In this embodiment, if it is determined that the first image includes a boarding code scanning device, the boarding code scanning device can be identified, for example, image recognition can be performed on the boarding code scanning device.

[0075] Step S262: If it is identified that the boarding code scanning device includes a subway boarding code scanning device or a bus boarding code scanning device, the boarding code is displayed.

[0076] In some embodiments, if it is recognized that the boarding code scanning device includes a subway boarding code scanning device or a bus boarding code scanning device, it can be determined that the user corresponding to the electronic device wishes to board the bus by scanning the boarding code, and the boarding code can be displayed.

[0077] As an implementable method, the electronic device may pre-acquire and store images of subway boarding code scanning devices and bus boarding code scanning devices. Based on this, when it is determined that the first image includes a boarding code scanning device, the image of the boarding code scanning device in the first image may be acquired, and the image of the boarding code scanning device may be compared with the image of the subway boarding code scanning device and the image of the bus boarding code scanning device, respectively. Among them, if the image of the boarding code scanning device matches the image of the subway boarding code scanning device, it can be determined that the boarding code scanning device includes a map boarding code scanning device, and the boarding code is displayed, or if the image of the boarding code scanning device matches the image of the bus boarding code scanning device, it can be determined that the boarding code scanning device includes a bus boarding code scanning device, and the boarding code is displayed.

[0078] Compared with the method for displaying the boarding code provided in one embodiment of the present application, Figure 1The method for displaying the boarding code shown in the embodiment also turns on the front camera of the electronic device and obtains the first image captured by the front camera when the current posture of the electronic device meets the preset posture. When the boarding code scanning device is included in the first image, the boarding code is displayed, thereby improving the accuracy of displaying the boarding code. In addition, the embodiment also inputs multiple frames of images into the boarding code scanning device recognition network in order from front to back in the acquisition time, obtains the first probability values ​​input into the boarding code scanning device recognition network in sequence, and if the number of the output first probability values ​​greater than the first probability threshold reaches the quantity threshold, it is determined that the boarding code scanning device is included in the first image, and stops inputting the remaining images in the multiple frames of images into the boarding code scanning device recognition network, thereby balancing the accuracy of the boarding code scanning device recognition and the power consumption of the electronic device.

[0079] See also Figure 7 , Figure 7 The schematic diagram of the process of displaying the boarding code provided by an embodiment of the present application is shown. The method is applied to the above electronic device. Figure 7 The process shown in the figure is described in detail, and the method for displaying the boarding code may specifically include the following steps:

[0080] Step S310: Acquire the current location of the electronic device.

[0081] Step S320: If the distance between the current position and the preset riding position is less than a distance threshold, the current posture of the electronic device is obtained.

[0082] For the detailed description of step S310 to step S320, please refer to step S110 to step S120, which will not be repeated here.

[0083] Step S330: If the current posture satisfies the preset posture, the front camera and the rear camera of the electronic device are turned on, and a second image captured by the front camera and a third image captured by the rear camera are acquired.

[0084] In this embodiment, if it is determined that the current posture of the electronic device meets the preset posture, it can be considered that the electronic device is in a posture with the screen facing the code scanning port. At this time, the front camera (the camera on the side of the screen) and the rear camera (the camera on the side opposite to the screen) of the electronic device can be turned on, and the image captured by the front camera can be obtained, and the image captured by the front camera can be used as the second image, and the image captured by the rear camera can be obtained, and the image captured by the rear camera can be used as the third image.

[0085] Among them, it can be understood that even if it is determined that the distance between the current position of the electronic device and the preset boarding position is less than the distance threshold, and the current posture of the electronic device meets the preset posture, the user corresponding to the electronic device may not really intend to enter the subway gate or take the bus. For example, the user corresponding to the electronic device may purchase goods from a vending machine placed in a subway station in this way. Therefore, if the boarding code is directly displayed when it is determined that the distance between the current position of the electronic device and the preset boarding position is less than the distance threshold, and the current posture of the electronic device meets the preset posture, there may be a problem of erroneous display. Based on this, this embodiment adds further recognition and judgment by collecting images through the front camera and the rear camera of the electronic device to improve the accuracy of displaying the boarding code.

[0086] In some embodiments, when the front camera and rear camera of the electronic device are turned on, the second image captured by the front camera and the third image captured by the rear camera can be acquired in real time, the second image captured by the front camera and the third image captured by the rear camera can be acquired at preset time intervals, the second image captured by the front camera and the third image captured by the rear camera can be acquired at preset time points, the second image captured by the front camera and the third image captured by the rear camera can be acquired according to other preset rules, etc., which are not limited here.

[0087] Step S340: If it is determined that the second image includes a boarding code scanning device and the third image includes a target logo, the boarding code is displayed, wherein the target logo is used to identify a subway station or a bus stop.

[0088] In this embodiment, when the second image and the third image are acquired, it can be determined whether the second image includes a boarding code scanning device, and whether the third image includes a target identifier for identifying a subway station or a bus stop. If it is determined that the second image includes a boarding code scanning device and the third image includes a target identifier, it can be considered that the user corresponding to the electronic device does want to display the boarding code for the boarding code scanning device to scan the code for boarding, and the boarding code can be displayed; if it is determined that the second image does not include a boarding code scanning device and / or the third image does not include a target identifier, it can be considered that the user corresponding to the electronic device does not want to display the boarding code for the boarding code scanning device to scan the code for boarding, and the boarding code may not be displayed.

[0089] As an implementable method, when the second image and the third image are acquired, image recognition can be performed on the second image and the third image, and the target image included in the recognized second image can be compared with the image of a pre-set on-board code scanning device, and the target image included in the recognized third image can be compared with the image of a pre-set target logo to obtain a comparison result, and based on the comparison result, it can be determined whether the second image includes the on-board code scanning device and whether the third image includes the target logo.

[0090] Optionally, the target identification may include: subway pillars, subway walls, subway railway signs, subway ceilings, bus stops, bus handrails, etc., which are not limited here.

[0091] Compared with the method for displaying the boarding code provided in one embodiment of the present application, Figure 1 The method for displaying the boarding code shown in the figure, this embodiment also turns on the front camera and the rear camera of the electronic device when the current posture of the electronic device meets the preset posture, and obtains the second image captured by the front camera and the third image captured by the rear camera. If it is determined that the second image includes a boarding code scanning device and the third image includes a target logo for identifying a subway station or a bus stop, the boarding code is displayed, thereby improving the accuracy of displaying the boarding code.

[0092] See also Figure 8 , Figure 8 The schematic diagram of the process of displaying the boarding code provided by an embodiment of the present application is shown. The method is applied to the above electronic device. Figure 8 The process shown is described in detail. In this embodiment, the electronic device is a foldable electronic device, and the method for displaying the boarding code may specifically include the following steps:

[0093] Step S410: Acquire the current location of the electronic device.

[0094] Step S420: If the distance between the current position and the preset riding position is less than a distance threshold, the current posture of the electronic device is obtained.

[0095] For the detailed description of step S410 to step S420, please refer to step S110 to step S120, which will not be repeated here.

[0096] Step S430: If the current posture satisfies the preset posture, determining the device state of the foldable electronic device, wherein the device state includes a folded state or an unfolded state.

[0097] Optionally, the electronic device may be a foldable electronic device, that is, the electronic device may include a foldable display screen. The foldable electronic device may be in a folded state or in an unfolded state. When the foldable electronic device is in the unfolded state, the display screen of the foldable electronic device is larger and two display areas of the display screen face the same direction. When the foldable electronic device is in the folded state, the display screen of the foldable electronic device is smaller and the two display areas of the display screen face opposite directions.

[0098] Among them, it can be understood that for a foldable electronic device with screens on both the front and back when in a folded state, the user does not even need to flip the electronic device (that is, the user does not need to flip the electronic device to face the screen to the boarding code scanning device), and the boarding code can be directly displayed to the boarding code scanning device through its rear screen. Therefore, in this embodiment, if it is determined that the current posture of the electronic device meets the preset posture, the device state of the foldable electronic device can be determined, wherein the device state can include a folded state or an unfolded state, that is, it can be determined whether the foldable electronic device is in a folded state or an unfolded state.

[0099] In some embodiments, when the foldable electronic device is in different device states, the corresponding broadcast state value is different. For example, when the foldable electronic device is in a folded state, the corresponding broadcast state value is 0, and when the foldable electronic device is in an unfolded state, the corresponding broadcast state value is 1. Based on this, if the current posture satisfies the preset posture, the state value broadcasted by the foldable electronic device can be determined, wherein, if it is determined that the state value broadcasted by the foldable electronic device is 0, it can be determined that the foldable electronic device is in a folded state, and if it is determined that the state value broadcasted by the foldable electronic device is 1, it can be determined that the foldable electronic device is in an unfolded state.

[0100] Step S440: If the device state is the folded state, turn on the front camera and the rear camera of the foldable electronic device, and obtain a fourth image captured by the front camera and a fifth image captured by the rear camera.

[0101] Among them, it can be understood that even if it is determined that the distance between the current position of the foldable electronic device and the preset boarding position is less than the distance threshold, and the current posture of the foldable electronic device meets the preset posture, the user corresponding to the foldable electronic device may not really intend to enter the subway gate or take the bus. For example, the user corresponding to the foldable electronic device may purchase goods from a vending machine placed in a subway station in this way. Therefore, if the boarding code is directly displayed when it is determined that the distance between the current position of the foldable electronic device and the preset boarding position is less than the distance threshold, and the current posture of the foldable electronic device meets the preset posture, there may be a problem of erroneous display. Based on this, this embodiment adds further recognition and judgment through the front camera and rear camera of the foldable electronic device to improve the accuracy of displaying the boarding code.

[0102] In this embodiment, when it is determined that the device state of the foldable electronic device is the folded state, it can be determined that the screen on the side of the rear camera of the foldable electronic device faces the boarding code scanning device, and the screen on the side of the front camera is away from the boarding code scanning device. The front camera and the rear camera of the foldable electronic device can be turned on, and the image captured by the front camera can be obtained, and the image captured by the front camera can be used as the fourth image, and the image captured by the rear camera can be obtained, and the image captured by the rear camera can be used as the fifth image.

[0103] In some embodiments, when the front camera and rear camera of the electronic device are turned on, the fourth image captured by the front camera and the fifth image captured by the rear camera can be acquired in real time, the fourth image captured by the front camera and the fifth image captured by the rear camera can be acquired at preset time intervals, the fourth image captured by the front camera and the fifth image captured by the rear camera can be acquired at preset time points, the fourth image captured by the front camera and the fifth image captured by the rear camera can be acquired according to other preset rules, and the like are not limited here.

[0104] Step S450: If it is determined that the fifth image includes a boarding code scanning device and the fourth image includes a target logo, the boarding code is displayed, wherein the target logo is used to identify a subway station or a bus stop.

[0105] In this embodiment, when the fourth image and the fifth image are acquired, it can be determined whether the fifth image includes a boarding code scanning device, and whether the fourth image includes a target identifier for identifying a subway station or a bus stop. If it is determined that the fifth image includes a boarding code scanning device and the fourth image includes a target identifier, it can be considered that the user corresponding to the foldable electronic device does want to display the boarding code for the boarding code scanning device to scan the code for boarding, and the boarding code can be displayed; if it is determined that the fifth image does not include a boarding code scanning device and / or the fourth image does not include a target identifier, it can be considered that the user corresponding to the foldable electronic device does not want to display the boarding code for the boarding code scanning device to scan the code for boarding, and the boarding code can be not displayed.

[0106] As an implementable method, when the fourth image and the fifth image are acquired, image recognition can be performed on the fourth image and the fifth image, and the target image included in the identified fifth image can be compared with the image of a pre-set on-board code scanning device, and the target image included in the identified fourth image can be compared with the image of a pre-set target logo to obtain a comparison result, and based on the comparison result, it can be determined whether the fifth image includes the on-board code scanning device and whether the fourth image includes the target logo.

[0107] Optionally, the target identification may include: subway pillars, subway walls, subway railway signs, subway ceilings, bus stops, bus handrails, etc., which are not limited here.

[0108] Compared with the method for displaying the boarding code provided in one embodiment of the present application, Figure 1 The method for displaying the boarding code shown in the figure, this embodiment also determines the device state of the foldable electronic device when the current posture of the foldable electronic device meets the preset posture, and if the device state is the folded state, the front camera and the rear camera of the foldable electronic device are turned on, and the fourth image captured by the front camera and the fifth image captured by the rear camera are obtained. If it is determined that the fifth image includes a boarding code scanning device and the fourth image includes a target mark for identifying a subway station or a bus stop, the boarding code is displayed, thereby improving the convenience and accuracy of the foldable electronic device in displaying the boarding code.

[0109] See also Fig. 9 , Fig. 9 The schematic diagram of the process of displaying the boarding code provided by an embodiment of the present application is shown. The method is applied to the above electronic device. Fig. 9 The process shown in the figure is described in detail, and the method for displaying the boarding code may specifically include the following steps:

[0110] Step S510: Acquire the current location of the electronic device.

[0111] Step S520: If the distance between the current position and the preset riding position is less than a distance threshold, the current posture of the electronic device is obtained.

[0112] For the detailed description of step S510 to step S520, please refer to step S110 to step S120, which will not be repeated here.

[0113] Step S530: If the current posture satisfies the preset posture, the duration for which the electronic device maintains the current posture is obtained.

[0114] In this embodiment, if the current posture of the electronic device meets the preset posture, the duration of the electronic device maintaining the current posture can be obtained. Optionally, the electronic device can have a built-in timer, and the duration of the electronic device maintaining the current posture can be obtained through the timer.

[0115] In some implementations, when the current posture of the electronic device remains unchanged, it can be determined that the electronic device maintains the current posture; or, when the change amplitude of the current posture of the electronic device is lower than a preset amplitude, it can be determined that the electronic device maintains the current posture.

[0116] Step S540: If the duration reaches the duration threshold, the boarding code is displayed.

[0117] In some embodiments, the electronic device may be set and stored with a duration threshold, which is used as a basis for determining the duration. Therefore, in this embodiment, when the duration of the electronic device maintaining the current posture is obtained, the duration may be compared with the duration threshold to determine whether the duration reaches the duration threshold. If the duration reaches the duration threshold, it can be determined that the electronic device meets the state of hovering and waiting for code scanning, and the boarding code may be displayed; if the duration does not reach the duration threshold, it can be determined that the electronic device does not meet the state of hovering and waiting for code scanning, and the boarding code may not be displayed.

[0118] Compared with the method for displaying the boarding code provided in one embodiment of the present application, Figure 1 The method for displaying the boarding code shown in the figure, this embodiment also obtains the duration of the electronic device maintaining the current posture when the current posture of the electronic device meets the preset posture. If the duration reaches the duration threshold, the boarding code is displayed, thereby improving the accuracy of displaying the boarding code.

[0119] See also Fig.10 , Fig.10 The schematic diagram of the process of displaying the boarding code provided by an embodiment of the present application is shown. The method is applied to the above electronic device. Fig.10The process shown in the figure is described in detail, and the method for displaying the boarding code may specifically include the following steps:

[0120] Step S610: Acquire the current location of the electronic device.

[0121] For the detailed description of step S610 , please refer to step S110 , which will not be repeated here.

[0122] Step S620: If the distance between the current position and the preset riding position is less than the distance threshold, the posture change of the electronic device is obtained.

[0123] In this embodiment, if the distance between the current position and the preset riding position is less than the distance threshold, the posture change of the electronic device can be obtained. Optionally, the electronic device can be built with a posture detection module, and the posture change of the electronic device can be obtained through the posture detection module.

[0124] As an implementable method, if the distance between the current position and the preset boarding position is less than a distance threshold, the posture change of the electronic device can be obtained in real time, the posture change of the electronic device can be obtained at a preset time interval, the posture change of the electronic device can be obtained at a preset time point, or the posture change of the electronic device can be obtained according to other preset rules, etc., which are not limited here.

[0125] Step S630: If it is determined that the electronic device is flipped based on the posture change, the current posture of the electronic device is obtained.

[0126] In some embodiments, when a posture change of the electronic device is obtained, it can be determined whether the electronic device has flipped based on the posture change. Optionally, if it is determined that the electronic device has flipped based on the posture change, it can be considered that the user has triggered the pre-step of displaying the boarding code through the electronic device for the boarding code scanning device to scan the code, and the current posture of the electronic device can be obtained; if it is determined that the electronic device has not flipped based on the posture change, it can be considered that the user has not triggered the pre-step of scanning the code through the electronic device, and the current posture of the electronic device may not be obtained.

[0127] As an implementable manner, when the posture change of the electronic device is obtained, the rotation angle of the electronic device can be determined based on the posture change of the electronic device. If the rotation angle of the electronic device reaches a preset angle, it can be determined that the electronic device has flipped. If the rotation angle of the electronic device does not reach the preset angle, it can be determined that the electronic device has not flipped. Optionally, the preset angle can be 180°, that is, when the electronic device rotates from a screen facing a first direction to a second direction facing the opposite direction, it can be determined that the electronic device has flipped.

[0128] Step S640: If the current posture meets the preset posture, the boarding code is displayed.

[0129] For the detailed description of step S640, please refer to step S130, which will not be repeated here.

[0130] Compared with the method for displaying the boarding code provided in one embodiment of the present application, Figure 1 The method for displaying the boarding code shown in the figure, this embodiment also obtains the posture change of the electronic device when the distance between the current position of the electronic device and the preset boarding position is less than a distance threshold. If it is determined based on the posture change that the electronic device is flipped, the current posture of the electronic device is obtained, thereby improving the accuracy of displaying the boarding code.

[0131] See also Fig.11 , Fig.11 The schematic diagram of the process of displaying the boarding code provided by an embodiment of the present application is shown. The method is applied to the above electronic device. Fig.11 The process shown in the figure is described in detail, and the method for displaying the boarding code may specifically include the following steps:

[0132] Step S710: Acquire the current location of the electronic device.

[0133] For the detailed description of step S710, please refer to step S110, which will not be repeated here.

[0134] Step S720: If the distance between the current position and the preset boarding position is less than the distance threshold, the ambient sound around the electronic device is collected.

[0135] It is understandable that it is sometimes not very accurate to only rely on the positioning information of the electronic device to determine whether the electronic device is located at the preset boarding location (such as a subway station or a bus stop). For example, the positioning information of the electronic device is sometimes inaccurate, and for example, the electronic device is located in a shopping mall around the subway station but has not entered the subway. Based on this, this embodiment increases the collection and judgment of the ambient sound around the electronic device, which can increase the accuracy of displaying the boarding code.

[0136] In this embodiment, if the distance between the current position of the electronic device and the preset riding position is less than the distance threshold, the ambient sound around the electronic device can be collected. Optionally, the electronic device can be equipped with a sound collection device (such as a pickup, microphone, etc.), and the electronic device can collect the ambient sound around the electronic device through the sound collection device.

[0137] Step S730: If the ambient sound includes a target sound, the current posture of the electronic device is obtained, wherein the target sound is used to represent being at a subway station or a bus stop.

[0138] Optionally, the electronic device may be pre-set and stored with a target sound for characterizing a subway station or bus station. For example, the electronic device may be pre-set and stored with a station announcement sound for characterizing a subway station or bus station, such as a target sound of "XX station is here". Among them, the target sound can be used as a basis for judging whether the electronic device is located at a preset boarding position. Therefore, in this embodiment, when the ambient sound around the electronic device is collected, it can be determined whether the ambient sound includes the target sound. Optionally, if it is determined that the ambient sound includes the target sound, it can be considered that the electronic device is located at a subway station or bus station, and the current posture of the electronic device can be obtained for subsequent judgment of the display of the boarding code. If it is determined that the ambient sound does not include the target sound, it can be considered that the electronic device is not located at a subway station or bus station, and the current posture of the electronic device may not be obtained. For another example, the electronic device may be pre-set and stored with a conversation sound for characterizing a subway station or bus station, such as the target sound of a user conversation of "We have arrived at XX station". For another example, the electronic device may be pre-set and stored with a security inspection sound for characterizing a subway station or bus station, such as "Please pass the security inspection", "Please open the water cup", etc. for security inspection.

[0139] In some embodiments, the electronic device may be pre-set and store a trained sound scene recognition model. The electronic device may input the ambient sound collected within a preset time length into the sound scene recognition model at a preset time interval, obtain the value output by the sound scene recognition model, and determine whether the ambient sound includes the target sound based on the value. Optionally, the electronic device may input the ambient sound of the last 3 seconds into the sound scene recognition model every 0.5 seconds. For example, during the period from the 0th second to the 3rd second, the model is not run because it is less than 3 seconds. At the 3.0th second, the 3 seconds of ambient sound generated during the period from the 0th second to the 3rd second is sent to the sound scene recognition model. If the return value of the sound scene recognition model is 1, it is considered that the user is in the subway station or bus stop scene and proceeds to the next step. If the return value of the sound scene recognition model is 0, no operation is performed. Then, wait until the 3.5th second, send the data from the 0.5th second to the 3.5th second into the sound scene recognition model, and continue the same steps. And so on...

[0140] Optionally, the sound scene recognition model can be a neural network model based on deep learning. The input of the sound scene recognition model can be speech signal data, such as a list of 3*16000. The input can be a value, where 3*16000 means: the audio acquisition device of the electronic device produces data at a frequency of 16kHZ per second, so the length of the speech signal data collected by the audio acquisition device for 1 second is 16000, and 3 represents 3 seconds.

[0141] Step S740: If the current posture meets the preset posture, the boarding code is displayed.

[0142] For the detailed description of step S740, please refer to step S130, which will not be repeated here.

[0143] Compared with the method for displaying the boarding code provided in one embodiment of the present application, Figure 1 The method for displaying the boarding code shown in the figure, this embodiment also collects the ambient sound around the electronic device when the distance between the current position of the electronic device and the preset boarding position is less than a distance threshold. If the ambient sound includes a target sound used to characterize a subway station or a bus stop, the current posture of the electronic device is obtained, thereby improving the accuracy of displaying the boarding code.

[0144] See also Fig.12 , Fig.12 The schematic diagram of the process of displaying the boarding code provided by an embodiment of the present application is shown. The method is applied to the above electronic device. Fig.12 The process shown in the figure is described in detail, and the method for displaying the boarding code may specifically include the following steps:

[0145] Step S810: Acquire the current location of the electronic device.

[0146] Step S820: If the distance between the current position and the preset riding position is less than a distance threshold, the current posture of the electronic device is obtained.

[0147] For the detailed description of step S810 to step S820, please refer to step S110 to step S120, which will not be repeated here.

[0148] Step S830: inputting the current posture into a motion recognition network to obtain a second probability value output by the motion recognition network, wherein the second probability value is used to characterize the probability that the electronic device is in a code scanning posture.

[0149] Optionally, the electronic device may be pre-set and store a trained action recognition network, wherein the action recognition network may be a neural network model based on deep learning.

[0150] In some embodiments, when the current posture of the electronic device is obtained, the current posture of the electronic device can be input into a motion recognition network to obtain a second probability value input by the motion recognition network, wherein the second probability value is used to characterize the probability that the electronic device is in a code scanning posture.

[0151] As an implementable method, the electronic device can input the current posture acquired within a preset time length into the action recognition network at a preset time interval, obtain the second probability value output by the action recognition network, and determine whether the current posture meets the preset posture based on the second probability value. Optionally, the electronic device can pass the data of the last 3 seconds into the action recognition network every 0.1 seconds. For example, for example, during the period from the 0th second to the 1st second, the model is not run because it is less than 1 second. At the 1.0th second, the 100 frames of data generated during the period from the 0th second to the 1st second are sent to the action recognition network. If the return value of the action recognition network is 1, it is considered that the current posture meets the preset posture. If the return value of the action recognition network is 0, the subsequent steps are not entered. Then, wait until the 1.1th second, send the data from the 0.1th second to the 1.1th second into the action recognition network, and continue the same steps. Then, by analogy, at 1.2 seconds, the data from 0.2 seconds to 1.2 seconds is fed into the action recognition network, at 1.3 seconds, the data from 0.3 seconds to 1.3 seconds is fed into the action recognition network, and so on…

[0152] In some embodiments, obtaining the current posture of the electronic device may include: obtaining multiple frames of gravity acceleration data of the electronic device continuously collected by the acceleration sensor of the electronic device at preset time intervals, wherein each frame of gravity acceleration data includes acceleration values ​​in three-axis directions, and obtaining the current posture of the electronic device based on the multiple frames of gravity acceleration data. Based on this, the input of the action recognition network can be 3*100 data, and the output is a second probability value, wherein 3*100 means: 100 is the 100 frames of gravity acceleration data in the most recent second, and each frame of data contains 3 dimensions: the gravity acceleration value in the x-axis direction, the gravity acceleration value in the y-axis direction, and the gravity acceleration value in the z-axis direction. Fig.13 As shown, the left-right direction of the electronic device is the direction of the x-axis, the up-down direction of the electronic device is the direction of the y-axis, and the front-back direction of the electronic device is the direction of the z-axis.

[0153] Step S840: If the second probability value is greater than a second probability threshold, it is determined that the current posture satisfies the preset posture.

[0154] Optionally, the electronic device may be pre-set and stored with a second probability threshold, which is used as a basis for judging the second probability value. If the second probability value is greater than the second probability threshold, it can be determined that the current posture of the electronic device meets the preset posture, and if the second probability value is less than or equal to the second probability threshold, it can be determined that the current posture does not meet the preset posture.

[0155] As a method, the second probability value has a value range of (0, 1), representing the probability that the electronic device is in a code scanning posture. The value of the second probability threshold can be 0.5. If the second probability value is greater than 0.5, it can be determined that the current posture meets the preset posture. If the second probability value is less than or equal to 0.5, it can be determined that the current posture does not meet the preset posture.

[0156] Step S850: If the current posture meets the preset posture, the boarding code is displayed.

[0157] For the detailed description of step S850, please refer to step S130, which will not be repeated here.

[0158] Compared with the method for displaying the boarding code provided in one embodiment of the present application, Figure 1 The method for displaying the boarding code shown in the figure, this embodiment also inputs the current posture into the motion recognition network when obtaining the current posture of the electronic device, obtains a second probability value output by the motion recognition network, and if the second probability value is greater than the second probability threshold, it is determined that the current posture meets the preset posture, thereby improving the accuracy of the judgment of whether the current posture meets the preset posture, so as to improve the accuracy of displaying the boarding code.

[0159] See also Fig.14 , Fig.14 The module block diagram of the display device of the boarding code provided by an embodiment of the present application is shown. The display device 200 of the boarding code is applied to the above electronic device. Fig.14 The block diagram shown in the figure is used to illustrate that the boarding code display device 200 includes: a current position acquisition module 210, a current posture acquisition module 220 and a boarding code display module 230, wherein:

[0160] The current location acquisition module 210 is used to acquire the current location of the electronic device.

[0161] The current posture acquisition module 220 is used to acquire the current posture of the electronic device if the distance between the current position and the preset riding position is less than a distance threshold.

[0162] Furthermore, the current posture acquisition module 220 includes: a posture change acquisition submodule and a first current posture acquisition submodule, wherein:

[0163] The posture change acquisition submodule is used to acquire the posture change of the electronic device if the distance between the current position and the preset riding position is less than the distance threshold.

[0164] The first current posture acquisition submodule is used to acquire the current posture of the electronic device if it is determined that the electronic device is flipped based on the posture change.

[0165] Furthermore, the current posture acquisition module 220 includes: an environmental sound collection submodule and a second current posture acquisition submodule, wherein:

[0166] The environmental sound collection submodule is used to collect the environmental sound around the electronic device if the distance between the current position and the preset riding position is less than the distance threshold.

[0167] The second current posture acquisition submodule is used to acquire the current posture of the electronic device if the ambient sound includes a target sound, wherein the target sound is used to represent being at a subway station or a bus stop.

[0168] The boarding code display module 230 is used to display the boarding code if the current posture meets the preset posture.

[0169] Furthermore, the boarding code display module 230 includes: a first image acquisition submodule and a first boarding code display submodule, wherein:

[0170] The first image acquisition submodule is used to turn on the front camera of the electronic device and acquire a first image acquired by the front camera if the current posture meets the preset posture.

[0171] The first boarding code display submodule is used to display the boarding code if it is determined that the first image includes a boarding code scanning device.

[0172] Furthermore, the first boarding code display submodule includes: a boarding code scanning device recognition unit and a first boarding code display unit, wherein:

[0173] The vehicle code scanning device identification unit is used to identify the vehicle code scanning device if it is determined that the vehicle code scanning device is included in the first image.

[0174] The first boarding code display unit is used to display the boarding code if it is recognized that the boarding code scanning device includes a subway boarding code scanning device or a bus boarding code scanning device.

[0175] Furthermore, the first image includes multiple frames of images collected by the front camera within a preset time period, and the boarding code display module 230 also includes: a first probability value acquisition submodule and a boarding code scanning device determination submodule, wherein:

[0176] The first probability value obtaining submodule is used to input the multiple frame images into the on-board code scanning device recognition network in order from front to back in the acquisition time, and obtain the first probability values ​​output by the on-board code scanning device recognition network in sequence, wherein the first probability value is used to characterize the probability that the first image includes a on-board code scanning device.

[0177] The on-board code scanning device determination submodule is used to determine that the on-board code scanning device is included in the first image if the number of the output first probability values ​​that are greater than the first probability threshold reaches a quantity threshold, and stop inputting the remaining images in the multiple frames of images into the on-board code scanning device recognition network.

[0178] Furthermore, the boarding code display module 230 includes: a second image acquisition submodule and a second boarding code display submodule, wherein:

[0179] The second image acquisition submodule is used to turn on the front camera and the rear camera of the electronic device if the current posture meets the preset posture, and obtain the second image captured by the front camera and the third image captured by the rear camera.

[0180] The second boarding code display submodule is used to display the boarding code if it is determined that the second image includes a boarding code scanning device and the third image includes a target logo, wherein the target logo is used to identify a subway station or a bus stop.

[0181] Further, the electronic device is a foldable electronic device, and the boarding code display module 230 includes: a device state determination submodule, a third image acquisition submodule and a third boarding code display submodule, wherein:

[0182] The device state determination submodule is used to determine the device state of the foldable electronic device if the current posture meets the preset posture, wherein the device state includes a folded state or an unfolded state.

[0183] The third image acquisition submodule is used to turn on the front camera and the rear camera of the foldable electronic device if the device state is the folded state, and obtain a fourth image captured by the front camera and a fifth image captured by the rear camera.

[0184] The third boarding code display submodule is used to display the boarding code if it is determined that the fifth image includes a boarding code scanning device and the fourth image includes a target logo, wherein the target logo is used to identify a subway station or a bus stop.

[0185] Furthermore, the boarding code display module 230 includes: a duration acquisition submodule and a fourth boarding code display submodule, wherein:

[0186] The duration acquisition submodule is used to acquire the duration for which the electronic device maintains the current posture if the current posture satisfies the preset posture.

[0187] The fourth boarding code display submodule is used to display the boarding code if the duration reaches a duration threshold.

[0188] Furthermore, the boarding code display device 200 further includes: a second probability value acquisition submodule and a current posture determination submodule, wherein:

[0189] The second probability value acquisition module is used to input the current posture into the action recognition network to obtain a second probability value output by the action recognition network, wherein the second probability value is used to represent the probability that the electronic device is in a code scanning posture.

[0190] The current posture determination submodule is used to determine whether the current posture satisfies the preset posture if the second probability value is greater than a second probability threshold.

[0191] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.

[0192] In several embodiments provided in the present application, the coupling between modules may be electrical, mechanical or other forms of coupling.

[0193] In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or software functional modules.

[0194] See also Fig.15 , which shows a structural block diagram of an electronic device 100 provided in an embodiment of the present application. The electronic device 100 may be an electronic device capable of running applications, such as a smart phone, a tablet computer, an e-book, etc. The electronic device 100 in the present application may include one or more of the following components: a processor 110, a memory 120, and one or more applications, wherein the one or more applications may be stored in the memory 120 and configured to be executed by one or more processors 110, and the one or more programs are configured to execute the method described in the aforementioned method embodiment.

[0195] Among them, the processor 110 may include one or more processing cores. The processor 110 uses various interfaces and lines to connect various parts of the entire electronic device 100, and executes various functions and processes data of the electronic device 100 by running or executing instructions, programs, code sets or instruction sets stored in the memory 120, and calling data stored in the memory 120. Optionally, the processor 110 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 110 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 110, but may be implemented separately through a communication chip.

[0196] The memory 120 may include a random access memory (RAM) or a read-only memory (ROM). The memory 120 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing functions (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc. The data storage area may also store data (such as a phone book, audio and video data, chat record data) created by the electronic device 100 during use.

[0197] See also Fig.16 , which shows a block diagram of a computer-readable storage medium provided in an embodiment of the present application. The computer-readable medium 300 stores program codes, which can be called by a processor to execute the method described in the above method embodiment.

[0198] The computer readable storage medium 300 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer readable storage medium 300 includes a non-transitory computer-readable storage medium. The computer readable storage medium 300 has storage space for program code 310 that performs any method steps in the above method. These program codes can be read from or written to one or more computer program products. The program code 310 can be compressed, for example, in an appropriate form.

[0199] To summarize, the method, device, electronic device, and storage medium for displaying the boarding code provided in the embodiments of the present application obtain the current position of the electronic device. If the distance between the current position and the preset boarding position is less than a distance threshold, the current posture of the electronic device is obtained. If the current posture meets the preset posture, the boarding code is displayed. By directly displaying the boarding code when it is determined that the electronic device meets the scenario of scanning the code for boarding based on the current position and current posture of the electronic device, the tedious operation process of showing the code for boarding can be reduced, thereby improving the efficiency of showing the code for boarding.

[0200] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for displaying a boarding code, characterized in that: Applied to electronic equipment, the method comprises: Obtaining the current location of the electronic device; If the distance between the current position and the preset riding position is less than a distance threshold, obtaining the current posture of the electronic device; If the current posture meets the preset posture, the boarding code is displayed.

2. The method according to claim 1, characterized in that If the current posture meets the preset posture, the boarding code is displayed, including: If the current posture satisfies the preset posture, turning on the front camera of the electronic device and acquiring a first image captured by the front camera; If it is determined that the first image includes a boarding code scanning device, the boarding code is displayed.

3. The method according to claim 2, characterized in that The first image includes multiple frames of images collected by the front camera within a preset time period, and after obtaining the first image collected by the front camera, the method further includes: Inputting the multiple frames of images into a vehicle code scanning device recognition network in order from the front to the back of the acquisition time, and obtaining first probability values ​​sequentially output by the vehicle code scanning device recognition network, wherein the first probability value is used to represent the probability that the first image includes a vehicle code scanning device; If the number of the output first probability values ​​that are greater than the first probability threshold reaches the quantity threshold, it is determined that the first image includes the on-board code scanning device, and the remaining images in the multiple frames of images are stopped from being input into the on-board code scanning device recognition network.

4. The method according to claim 2, characterized in that: If it is determined that the first image includes a boarding code scanning device, then displaying the boarding code includes: If it is determined that the first image includes the vehicle code scanning device, identifying the vehicle code scanning device; If it is recognized that the boarding code scanning device includes a subway boarding code scanning device or a bus boarding code scanning device, the boarding code is displayed.

5. The method according to claim 1, characterized in that If the current posture satisfies the preset posture, displaying the boarding code includes: If the current posture satisfies the preset posture, turning on the front camera and the rear camera of the electronic device, and acquiring a second image captured by the front camera and a third image captured by the rear camera; If it is determined that the second image includes a boarding code scanning device and the third image includes a target logo, the boarding code is displayed, wherein the target logo is used to identify a subway station or a bus stop.

6. The method according to claim 1, characterized in that The electronic device is a foldable electronic device, and if the current posture satisfies a preset posture, displaying a boarding code includes: If the current posture satisfies the preset posture, determining the device state of the foldable electronic device, wherein the device state includes a folded state or an unfolded state; If the device state is the folded state, turning on the front camera and the rear camera of the foldable electronic device, and acquiring a fourth image captured by the front camera and a fifth image captured by the rear camera; If it is determined that the fifth image includes a boarding code scanning device and the fourth image includes a target logo, the boarding code is displayed, wherein the target logo is used to identify a subway station or a bus stop.

7. The method according to claim 1, characterized in that If the current posture satisfies the preset posture, displaying the boarding code includes: If the current posture satisfies the preset posture, obtaining the duration for which the electronic device maintains the current posture; If the duration reaches the duration threshold, the boarding code will be displayed.

8. The method according to claim 1, characterized in that If the distance between the current position and the preset boarding position is less than a distance threshold, obtaining the current posture of the electronic device includes: If the distance between the current position and the preset boarding position is less than the distance threshold, acquiring the posture change of the electronic device; If it is determined that the electronic device is flipped over based on the posture change, the current posture of the electronic device is acquired.

9. The method according to claim 1, characterized in that: If the distance between the current position and the preset boarding position is less than a distance threshold, obtaining the current posture of the electronic device includes: If the distance between the current position and the preset boarding position is less than the distance threshold, collecting ambient sound around the electronic device; If the ambient sound includes a target sound, the current posture of the electronic device is acquired, wherein the target sound is used to represent being located at a subway station or a bus stop.

10. The method according to any one of claims 1 to 8, characterized in that: After acquiring the current posture of the electronic device, the method further includes: Inputting the current posture into a motion recognition network to obtain a second probability value output by the motion recognition network, wherein the second probability value is used to represent the probability that the electronic device is in a code scanning posture; If the second probability value is greater than a second probability threshold, it is determined that the current posture satisfies the preset posture.

11. A display device for boarding code, characterized in that: Applied to electronic equipment, the device comprises: A current location acquisition module, used to acquire the current location of the electronic device; A current posture acquisition module, used for acquiring the current posture of the electronic device if the distance between the current position and the preset riding position is less than a distance threshold; The boarding code display module is used to display the boarding code if the current posture meets the preset posture.

12. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory is coupled to the processor, the memory stores instructions, and when the instructions are executed by the processor, the processor executes the method according to any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program codes, which can be called by a processor to execute the method according to any one of claims 1 to 10.

Citation Information

Cited By

  • Riding code recommendation method and device, equipment, storage medium and program product

    CN120011647A