Scanning mode switching method, device, electronic device and storage medium

By detecting the contact between the electronic device and the text page and setting the mode switching conditions, the scanning mode is automatically switched, which solves the problem of false triggering of scanning mode switching due to shaking of electronic devices such as dictionary pens during use, and improves the accuracy of scanning mode switching. sex and user experience.

CN117857708BActive Publication Date: 2024-09-24东莞市步步高教育软件有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311864014.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-29
Publication Date
2024-09-24
Estimated Expiration
2043-12-29

AI Technical Summary

Technical Problem

When using existing electronic devices such as dictionary pens, shaking the pen body can easily cause false triggering of scanning mode switching, affecting the user experience and accuracy.

Method used

By detecting the contact between the target part of the electronic device and the text page, the mode switching conditions are set, such as the number of contacts and text image or content characteristics within the set time period, and the scanning mode is automatically switched to reduce false triggers.

Benefits of technology

It effectively reduces the false triggering of scanning mode switching due to shaking, improves the accuracy and user experience of scanning mode switching, and ensures that the scanning mode is not misjudged during normal use.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117857708B
    Figure CN117857708B
Patent Text Reader

Abstract

The present application relates to the technical field of teaching equipment, and proposes a scanning mode switching method, device, electronic device and storage medium. The method includes: if it is detected that the target part of the electronic device contacts the text page, the electronic device is controlled to enter the first scanning mode; in the process of the electronic device scanning the text page based on the first scanning mode, if it is determined that the mode switching condition is met, the electronic device is controlled to switch to the second scanning mode. Through such a setting, the shaking phenomenon that occurs when the user uses the electronic device normally will not lead to misjudgment, thereby reducing the problem of false triggering of scanning mode switching.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of teaching equipment, and in particular to a scanning mode switching method, device, electronic device and storage medium. Background Art

[0002] At present, many parents will buy electronic devices such as dictionary pens for their children to help them learn foreign languages. Dictionary pens generally have multiple scanning modes when in use, such as single-line scanning mode and multi-line scanning mode, etc. Among them, the single-line scanning mode means that the dictionary pen only recognizes one line of content after the recognition is started, and the multi-line scanning mode means that the dictionary pen can recognize multiple lines of content within the visible range of the camera after the recognition is started. Conventional dictionary pens usually switch scanning modes by shaking the pen body. However, users will also shake the pen body when actually using the dictionary pen, which may cause the problem of false triggering of scanning mode switching. Summary of the invention

[0003] In view of this, embodiments of the present application provide a scanning mode switching method, device, electronic device and storage medium, which can reduce the problem of false triggering of scanning mode switching when a user uses an electronic device to scan.

[0004] A first aspect of an embodiment of the present application provides a scanning mode switching method applied to an electronic device, comprising:

[0005] If it is detected that the target part of the electronic device contacts the text page, the electronic device is controlled to enter a first scanning mode;

[0006] During the process of the electronic device scanning the text page based on the first scanning mode, if it is determined that the mode switching condition is met, the electronic device is controlled to switch to the second scanning mode.

[0007] When a user reads a text page, he or she can use an electronic device such as a dictionary pen to scan the content of the text page to obtain a corresponding translation or explanation. When a user uses an electronic device such as a dictionary pen to scan, the user generally needs to make the target part such as the pen tip contact the text page. In an embodiment of the present application, if it is detected that the target part of the electronic device contacts the text page, the electronic device is controlled to enter one of the scanning modes. During the process of the electronic device scanning the text page based on the scanning mode, it continuously monitors whether the mode switching conditions are met, such as whether line feed scanning and other operations occur. If so, the electronic device is controlled to switch to another scanning mode. Through such a setting, the shaking phenomenon that occurs when the user normally uses the electronic device will not lead to misjudgment, thereby reducing the problem of false triggering of scanning mode switching.

[0008] In an implementation of the embodiment of the present application, the first scanning mode is a single-line scanning mode, and the second scanning mode is a multi-line scanning mode; whether the mode switching condition is met is determined in the following manner:

[0009] If the target part of the electronic device contacts the text page at least twice within a set time period, it is determined that the mode switching condition is met.

[0010] In one implementation of the embodiment of the present application, if the target part of the electronic device contacts the text page at least twice within a set time period, it is determined that the mode switching condition is met, including:

[0011] If the target part of the electronic device contacts the text page at least twice within a set time period, then an image of the text scanned during the process is acquired;

[0012] If the number of text lines included in the text image exceeds a first threshold, it is determined that the mode switching condition is met.

[0013] In another implementation of the embodiment of the present application, if the target part of the electronic device contacts the text page at least twice within a set time period, it is determined that the mode switching condition is met, including:

[0014] If the target part of the electronic device contacts the text page at least twice within the set time period, the text content scanned during the process is obtained;

[0015] If the text content is not a complete sentence, it is determined that the mode switching condition is met.

[0016] In an implementation of the embodiment of the present application, the first scanning mode is a multi-line scanning mode, and the second scanning mode is a single-line scanning mode; whether the mode switching condition is met is determined in the following manner:

[0017] If the target part of the electronic device does not touch the text page at least twice within the set time period, it is determined that the mode switching condition is met.

[0018] In one implementation of the embodiment of the present application, if the target part of the electronic device does not contact the text page at least twice within a set time period, it is determined that the mode switching condition is met, including:

[0019] If the target part of the electronic device does not contact the text page at least twice within the set time period, acquiring the text image scanned during the process;

[0020] If the number of text lines contained in the text image is a single line, it is determined that the mode switching condition is met.

[0021] In an implementation of the embodiment of the present application, after controlling the electronic device to switch to the second scanning mode, the method further includes:

[0022] If the duration that the target part of the electronic device leaves the text page exceeds a second threshold, the electronic device is controlled to switch to the first scanning mode.

[0023] A second aspect of an embodiment of the present application provides a scanning mode switching device applied to an electronic device, comprising:

[0024] A scanning mode entry module, used to control the electronic device to enter a first scanning mode if it is detected that a target part of the electronic device contacts the text page;

[0025] The scanning mode switching module is used to control the electronic device to switch to the second scanning mode if it is determined that the mode switching condition is met during the process of the electronic device scanning the text page based on the first scanning mode.

[0026] A third aspect of an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the scanning mode switching method provided in the first aspect of the embodiment of the present application is implemented.

[0027] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the scanning mode switching method provided in the first aspect of the embodiment of the present application is implemented.

[0028] A fifth aspect of the embodiments of the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes the scanning mode switching method provided in the first aspect of the embodiments of the present application.

[0029] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 is a flow chart of a scanning mode switching method provided in an embodiment of the present application;

[0031] Figure 2 is an operation schematic diagram of the scanning mode switching method provided in an embodiment of the present application in an actual application scenario;

[0032] Figure 3 It is a structural framework diagram of a scanning mode switching device provided in an embodiment of the present application;

[0033] Figure 4 It is a schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0034] In the following description, for the purpose of illustration rather than limitation, specific details such as specific system structures, technologies, etc. are proposed, so as to thoroughly understand the embodiments of the present application. However, it should be clear to those skilled in the art that the present application can also be implemented in other embodiments without these specific details. In other cases, the detailed description of well-known systems, devices, circuits and methods is omitted to prevent unnecessary details from hindering the description of the present application. In addition, in the description of the present application specification and the attached claims, the terms "first", "second", "third" etc. are only used to distinguish the description, and cannot be interpreted as indicating or suggesting relative importance.

[0035] At present, electronic devices such as dictionary pens on the market usually use a "shake" method to switch scanning modes. For example, when a user wants to switch the scanning mode of a dictionary pen, he can shake the pen body. After the sensor of the pen body senses the shaking action, the dictionary pen completes the scanning mode switching operation. However, when users actually use the dictionary pen, they will also shake the pen body, which may cause the scanning mode switching to be triggered by mistake.

[0036] To address this problem, the embodiments of the present application provide a scanning mode switching method, device, electronic device, and storage medium, which can reduce the problem of false triggering of scanning mode switching when a user uses an electronic device to scan. For more specific technical implementation details of the embodiments of the present application, please refer to the various embodiments described below.

[0037] It should be understood that the execution subjects of the various method embodiments of the present application are various types of electronic devices, such as dictionary pens, translation pens, learning machines, tutoring machines, tablet computers, mobile phones, wearable devices, augmented reality (AR) / virtual reality (VR) devices, laptops, netbooks, personal digital assistants (PDA), etc. The embodiments of the present application do not impose any restrictions on the specific type of the electronic device.

[0038] See also Figure 1 , shows a scanning mode switching method provided by an embodiment of the present application, including:

[0039] 101. If it is detected that a target part of the electronic device contacts a text page, control the electronic device to enter a first scanning mode;

[0040] When reading a text page, the user can use an electronic device such as a dictionary pen to scan the content of the text page to obtain the corresponding translation or explanation. When the user uses an electronic device to scan, it is generally necessary to make a certain target part of the electronic device contact with the text page, such as making the tip of the dictionary pen contact with the text page, so that a clearer text image can be scanned, thereby improving the accuracy of content recognition.

[0041] In an embodiment of the present application, if the electronic device detects that the target part is in contact with the text page, it will enter a default scanning mode, recorded as the first scanning mode. Under normal circumstances, the first scanning mode can be a single-line scanning mode or a multi-line scanning mode. Among them, the single-line scanning mode means that the electronic device only recognizes the content of one line after starting the recognition, and can perform a quick scan query of a single line of text or image; the multi-line scanning mode means that the electronic device can recognize multiple lines of content within the visible range of the camera after starting the recognition, and can perform a quick scan query of multiple lines of text or images, thereby improving the query efficiency.

[0042] In one implementation of the embodiment of the present application, the electronic device may be provided with a sensor component and a scanning component, wherein the sensor component may include a pressure sensor, an optical sensor, etc., which is mainly used to detect whether the target part (such as the pen tip part) of the electronic device contacts a text page such as paper; the scanning component may include an image sensor, an optical lens, etc., which is mainly used to scan the image of the text page. After the electronic device is started, the sensor component and the scanning component may be initialized first. The sensor component can detect whether the target part contacts the text page. If the text page is contacted, the electronic device enters a first scanning mode and can scan the content of the text page through the scanning component. For example, when the pen tip of the dictionary pen contacts the paper, the pressure sensor of the sensor component will receive a pressure signal, thereby determining that a contact action has occurred. At this time, the dictionary pen can enter a single-line scanning mode and perform a single-line scan of the content of the text page through the scanning component.

[0043] 102. During a process in which the electronic device scans a text page based on the first scanning mode, if it is determined that a mode switching condition is met, control the electronic device to switch to a second scanning mode.

[0044] After entering the first scanning mode, the electronic device will scan the text page based on the first scanning mode. During this process, the electronic device will continuously monitor whether the mode switching condition is met. If the mode switching condition is met, it will switch to the second scanning mode, otherwise it will remain in the first scanning mode. The second scanning mode is a scanning mode different from the first scanning mode. For example, if the first scanning mode is a single-line scanning mode, the second scanning mode can be a multi-line scanning mode; if the first scanning mode is a multi-line scanning mode, the second scanning mode can be a single-line scanning mode. There can be multiple mode switching conditions here, please refer to the description below for details.

[0045] In an implementation of the embodiment of the present application, the first scanning mode is a single-line scanning mode, and the second scanning mode is a multi-line scanning mode; whether the mode switching condition is met is determined in the following manner:

[0046] If the target part of the electronic device contacts the text page at least twice within a set time period, it is determined that the mode switching condition is met.

[0047] In the case where the first scanning mode is a single-line scanning mode and the second scanning mode is a multi-line scanning mode, the electronic device will first enter the single-line scanning mode and perform a single-line scan on the content of the text page. If the text that the user wants to recognize is a single-line text, the user only needs to control the target part of the electronic device to touch the text page once in a short time. For example, if the electronic device is a dictionary pen, the user only needs to make the pen tip of the dictionary pen touch the single-line text, and lift the pen tip after the text scanning is completed. There is no need to make the pen tip touch the text page twice in a short time. On the contrary, if the text that the user wants to recognize is a multi-line text, the user needs to control the target part of the electronic device to touch the text page multiple times in a short time, that is, to complete multiple scans. For example, if the electronic device is a dictionary pen and the text to be recognized is a 2-line text, the user needs to first make the pen tip of the dictionary pen touch the first line of text to complete a scan, and then lift the pen tip, and make the pen tip of the dictionary pen touch the second line of text within a set time (for example, within 2 seconds) to complete the second scan, that is, the pen tip will touch the text page twice within the set time. Therefore, the electronic device can complete the judgment by detecting whether the target part touches the text page at least twice within the set time length. If the target part does not touch the text page at least twice within the set time length, it means that the text that the user wants to recognize is a single line of text. At this time, it is appropriate to use the single-line scanning mode, and there is no need to switch the scanning mode. Therefore, it can be determined that the mode switching condition is not met. If the target part touches the text page at least twice within the set time length, it means that the text that the user wants to recognize is a multi-line text. At this time, it would be more appropriate to use the multi-line scanning mode. Therefore, it can be determined that the mode switching condition is met, thereby controlling the electronic device to switch from the single-line scanning mode to the multi-line scanning mode.

[0048] In one implementation of the embodiment of the present application, if the target part of the electronic device contacts the text page at least twice within a set time period, it is determined that the mode switching condition is met, including:

[0049] (1) if the target part of the electronic device contacts the text page at least twice within a set time period, obtaining a text image scanned during the process;

[0050] (2) If the number of text lines contained in the text image exceeds a first threshold, it is determined that the mode switching condition is met.

[0051] In some cases, the user may also make an erroneous operation that causes the target part of the electronic device to contact the text page multiple times in a short period of time. For example, when the user operates the pen tip of the dictionary pen to contact a single line of text, after the text scan is completed and the pen tip is lifted, the user may accidentally put down the dictionary pen in a short period of time, which will cause the pen tip to contact the text page multiple times in a short period of time, thereby misjudging that the scanning mode needs to be switched. In order to solve this problem, after detecting that the target part of the electronic device contacts the text page at least twice within a set time, a judgment operation can be added, specifically, the text image scanned by the electronic device during the single-line scanning process can be obtained, and the number of text lines in the text image can be identified. If the number of text lines exceeds the first threshold (for example, 2 lines), it means that the text that the user wants to identify is indeed a multi-line text, so it is determined that the mode switching condition is met, thereby controlling the electronic device to switch to a multi-line scanning mode. On the contrary, if the text that the user wants to identify is a single-line text, it is due to an erroneous operation that causes the target part of the electronic device to contact the text page multiple times in a short period of time, then the number of text lines in the scanned text image is only 1 line, and the mode switching condition is not met at this time, so the electronic device will not be controlled to switch to a multi-line scanning mode. It can be seen that such a setting can reduce misjudgment and further improve the accuracy of scanning mode switching.

[0052] In another implementation of the embodiment of the present application, if the target part of the electronic device contacts the text page at least twice within a set time period, it is determined that the mode switching condition is met, including:

[0053] (1) if the target part of the electronic device contacts the text page at least twice within a set time period, the text content scanned during the process is obtained;

[0054] (2) If the text content is not a complete sentence, determine that the mode switching condition is met.

[0055] This implementation is similar to the previous implementation, and both add a judgment operation after detecting that the target part of the electronic device contacts the text page at least twice within the set time, but the added judgment operation is different. The electronic device can scan and obtain a text image during a single-line scan, and recognize the corresponding text content based on the text image, and the text content can also be used to determine whether the mode switching condition is met. Specifically, it can be detected whether the text content is a complete sentence. If it is not a complete sentence, it means that the text that the user wants to recognize is indeed a multi-line text, so it is determined that the mode switching condition is met, so that the electronic device is controlled to switch to a multi-line scanning mode. On the contrary, if the text that the user wants to recognize is a single-line text, it is due to an erroneous operation that causes the target part of the electronic device to contact the text page multiple times in a short period of time, then the scanned text content will be a complete sentence, and the mode switching condition is not met at this time, so the electronic device will not be controlled to switch to a multi-line scanning mode. It can be seen that by setting it in this way, it can also reduce misjudgments and further improve the accuracy of scanning mode switching.

[0056] In one embodiment of the present application, whether the text content is a complete sentence can be determined in the following manner:

[0057] (1) Perform NLP semantic recognition processing on the text content to obtain the corresponding semantic recognition results;

[0058] (2) Based on the semantic recognition results, determine whether the text content is a complete sentence.

[0059] NLP refers to natural language processing. After NLP semantic recognition processing is performed on the text content, the corresponding semantic recognition results can be obtained. According to the semantic recognition results, it can be determined whether the meaning of the text content is complete, thereby determining whether the text content is a complete sentence. Among them, the specific principles of NLP semantic recognition can refer to the existing technology and will not be repeated here.

[0060] In another embodiment of the present application, whether the text content is a complete sentence can be determined in the following manner:

[0061] (1) Detect whether the end of the text content has a specified character;

[0062] (2) If the end of the text content has a designated character, it is determined that the text content is a complete sentence; otherwise, it is determined that the text content is not a complete sentence.

[0063] Generally speaking, a complete sentence has certain designated characters at the end, such as a period, a semicolon, a question mark, an ellipsis, etc. Therefore, whether the text content is a complete sentence can be determined by detecting whether the end of the text content has designated characters. Specifically, if the end of the text content has the above designated characters, it is determined that the text content is a complete sentence, otherwise it is determined that the text content is not a complete sentence.

[0064] In an implementation of the embodiment of the present application, the first scanning mode is a multi-line scanning mode, and the second scanning mode is a single-line scanning mode; whether the mode switching condition is met is determined in the following manner:

[0065] If the target part of the electronic device does not touch the text page at least twice within the set time period, it is determined that the mode switching condition is met.

[0066] In the case where the first scanning mode is a multi-line scanning mode and the second scanning mode is a single-line scanning mode, the electronic device will first enter the multi-line scanning mode and perform a multi-line scan on the content of the text page. According to the description above, the electronic device can complete the judgment by detecting whether the target part touches the text page at least twice within the set time length. If it does not touch the text page at least twice within the set time length, it means that the text that the user wants to recognize is a single-line text. At this time, it is not appropriate to use the multi-line scanning mode, so it can be determined that the mode switching condition is met, thereby controlling the electronic device to switch from the multi-line scanning mode to the single-line scanning mode. On the contrary, if the text page is touched at least twice within the set time length, it means that the text that the user wants to recognize is a multi-line text. At this time, it is appropriate to use the multi-line scanning mode, and there is no need to switch the scanning mode, so it can be determined that the mode switching condition is not met.

[0067] In one implementation of the embodiment of the present application, if the target part of the electronic device does not contact the text page at least twice within a set time period, it is determined that the mode switching condition is met, including:

[0068] (1) if the target part of the electronic device does not contact the text page at least twice within a set time period, obtaining a text image scanned during the process;

[0069] (2) If the number of text lines contained in the text image is a single line, it is determined that the mode switching condition is satisfied.

[0070] In some cases, the user may also make an erroneous operation, causing the target part of the electronic device to not contact the text page multiple times in a short period of time. For example, when the user operates the pen tip of the dictionary pen to scan multiple lines of text, the operation may be irregular, or the operation may be paused due to thinking, which will cause the pen tip of the dictionary pen to not contact the text page at least twice within the set time, thereby misjudging the need to switch the scanning mode. In order to solve this problem, after detecting that the target part of the electronic device has not contacted the text page at least twice within the set time, a judgment operation can be added, specifically, the text image scanned by the electronic device during the single-line scanning process can be obtained, and the number of text lines in the text image can be identified. If the number of text lines is a single line, it means that the text that the user wants to recognize is indeed a single-line text, so it can be determined that the mode switching condition is met, thereby controlling the electronic device to switch to the single-line scanning mode. On the contrary, if the text that the user wants to recognize is a multi-line text, it is due to an erroneous operation that the target part of the electronic device does not contact the text page multiple times in a short period of time, then the number of text lines in the scanned text image will exceed one line, and the mode switching condition is not met at this time, so the electronic device will not be controlled to switch to the single-line scanning mode. It can be seen that such a setting can reduce misjudgment and further improve the accuracy of scanning mode switching.

[0071] In an implementation of the embodiment of the present application, after controlling the electronic device to switch to the second scanning mode, the method further includes:

[0072] If the duration that the target part of the electronic device leaves the text page exceeds a second threshold, the electronic device is controlled to switch to the first scanning mode.

[0073] After the scan is completed, the user usually lifts the electronic device such as the dictionary pen, so that the target part of the electronic device leaves the text page. If the duration of the target part of the electronic device leaving the text page exceeds the second threshold, for example, more than 2 seconds, the electronic device can stop scanning and return to the default scanning mode, that is, control the electronic device to switch from the second scanning mode back to the first scanning mode and wait for the next scan.

[0074] In the embodiment of the present application, if it is detected that the target part of the electronic device contacts the text page, the electronic device is controlled to enter one of the scanning modes. During the process of the electronic device scanning the text page based on the scanning mode, it continuously monitors whether the mode switching condition is met, such as whether a line feed scanning operation occurs. If the condition is met, the electronic device is controlled to switch to another scanning mode. With such a setting, the shaking phenomenon that occurs when the user normally uses the electronic device will not lead to misjudgment, thereby reducing the problem of mis-triggered scanning mode switching.

[0075] To facilitate understanding of the scanning mode switching method provided in the embodiment of the present application, actual application scenarios are listed below. Figure 2 , which is a schematic diagram of the operation of the scanning mode switching method provided in an embodiment of the present application in an actual application scenario. Figure 2 The scenario shown is that a user uses a dictionary pen to scan multiple lines of text on a paper. After starting the dictionary pen, the sensor component and scanning component of the dictionary pen will be initialized. When the sensor component detects that the pen tip is touching the paper, the dictionary pen will start the single-line scanning mode. At this time, the scanning component is controlled to turn on the camera and fill light to perform a single-line scan. During the single-line scanning process, if the user lifts the dictionary pen and continues scanning a new line, the dictionary pen will detect that the pen tip has touched the paper multiple times in a short period of time (for example, within 2 seconds). At this time, it can be further detected whether the number of text lines in the scanned text image exceeds 2 lines. Figure 2 In the scenario described above, the user is scanning multiple lines of text, so the number of text lines in the scanned text image will exceed 2 lines, and the mode switching condition is determined to be met. The dictionary pen switches from the single-line scanning mode to the multi-line scanning mode. At this time, the scanning component is controlled to perform multi-line scanning and identify multiple results within the camera range. When the user completes the scan and lifts the dictionary pen, the dictionary pen will detect that the pen tip has partially left the paper, stop scanning after a certain period of time, and return to the initial state, that is, switch back to the single-line scanning mode.

[0076] Obviously, through such a setting, the electronic device can automatically switch the scanning mode according to actual needs without manual operation by the user, which is very convenient and quick, and can also avoid the situation where the user misses the scanning of important information due to negligence. In addition, the shaking phenomenon that occurs when the user normally uses the electronic device will not lead to misjudgment, so the problem of false triggering of scanning mode switching can also be reduced.

[0077] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0078] A scanning mode switching method is mainly described above, and a scanning mode switching device will be described below.

[0079] See also Figure 3 , an embodiment of a scanning mode switching device in an embodiment of the present application includes:

[0080] The scanning mode entry module 301 is used to control the electronic device to enter a first scanning mode if it is detected that a target part of the electronic device contacts a text page;

[0081] The scanning mode switching module 302 is used to control the electronic device to switch to the second scanning mode if it is determined that the mode switching condition is met during the process of the electronic device scanning the text page based on the first scanning mode.

[0082] In an implementation of the embodiment of the present application, the first scanning mode is a single-line scanning mode, and the second scanning mode is a multi-line scanning mode; the scanning mode switching module includes:

[0083] The first condition judgment unit is used to determine that the mode switching condition is satisfied if the target part of the electronic device contacts the text page at least twice within a set time period.

[0084] In one implementation of the embodiment of the present application, the first condition judgment unit includes:

[0085] A first text image acquisition subunit is used to acquire a text image scanned in the process if the target part of the electronic device contacts the text page at least twice within a set time period;

[0086] The first condition judgment subunit is used to determine that the mode switching condition is met if the number of text lines contained in the text image exceeds a first threshold.

[0087] In another implementation of the embodiment of the present application, the first condition judgment unit includes:

[0088] A text content acquisition subunit, configured to acquire text content scanned during the process if the target part of the electronic device contacts the text page at least twice within a set time period;

[0089] The second condition judgment subunit is used to determine whether the mode switching condition is met if the text content is not a complete sentence.

[0090] In an implementation of the embodiment of the present application, the first scanning mode is a multi-line scanning mode, and the second scanning mode is a single-line scanning mode; the scanning mode switching module includes:

[0091] The second condition judgment unit is used to determine that the mode switching condition is met if the target part of the electronic device does not touch the text page at least twice within a set time period.

[0092] In one implementation of the embodiment of the present application, the second condition judgment unit includes:

[0093] A second text image acquisition subunit is used to acquire a text image scanned during the process if the target part of the electronic device does not contact the text page at least twice within a set time period;

[0094] The third condition judgment subunit is used to determine that the mode switching condition is met if the number of text lines contained in the text image is a single line.

[0095] In one implementation of the embodiment of the present application, the scanning mode switching device further includes:

[0096] The scanning mode returning module is used to control the electronic device to switch to the first scanning mode if the duration of the target part of the electronic device leaving the text page exceeds a second threshold.

[0097] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the scanning mode switching method described in any of the above embodiments is implemented.

[0098] An embodiment of the present application also provides a computer program product. When the computer program product is executed on an electronic device, the electronic device executes the scanning mode switching method described in any of the above embodiments.

[0099] Figure 4 is a schematic diagram of an electronic device provided by an embodiment of the present application. Figure 4 As shown, the electronic device 4 of this embodiment includes: a processor 40, a memory 41, and a computer program 42 stored in the memory 41 and executable on the processor 40. When the processor 40 executes the computer program 42, the steps in the above-mentioned embodiments of the scanning mode switching method are implemented, such as Figure 1 Alternatively, when the processor 40 executes the computer program 42, the functions of each module / unit in the above-mentioned device embodiments are realized, for example, Figure 3 Functions of modules 301 to 302 are shown.

[0100] The computer program 42 may be divided into one or more modules / units, which are stored in the memory 41 and executed by the processor 40 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program 42 in the electronic device 4.

[0101] The processor 40 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0102] The memory 41 may be an internal storage unit of the electronic device 4, such as a hard disk or memory of the electronic device 4. The memory 41 may also be an external storage device of the electronic device 4, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 4. Further, the memory 41 may also include both an internal storage unit and an external storage device of the electronic device 4. The memory 41 is used to store the computer program and other programs and data required by the electronic device. The memory 41 may also be used to temporarily store data that has been output or is to be output.

[0103] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

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

[0105] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0106] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0107] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the system embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0108] The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of the present application.

[0109] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0110] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0111] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A scanning mode switching method, applied to an electronic device, characterized in that: The method comprises: If it is detected that the target part of the electronic device contacts the text page, controlling the electronic device to enter a first scanning mode; In the process of the electronic device scanning the text page based on the first scanning mode, if it is determined that a mode switching condition is met, controlling the electronic device to switch to a second scanning mode; When the first scanning mode is a single-line scanning mode and the second scanning mode is a multi-line scanning mode, the multi-line scanning mode means that after the electronic device starts the recognition, it can recognize multiple lines of content within the visible range of the camera; whether the mode switching condition is met is determined in the following manner: If the target part of the electronic device contacts the text page at least twice within a set time period, it is determined that the mode switching condition is met.

2. The method according to claim 1, characterized in that If the target part of the electronic device contacts the text page at least twice within a set time period, determining that the mode switching condition is satisfied includes: If the target part of the electronic device contacts the text page at least twice within a set time period, acquiring a text image scanned in the process; If the number of text lines contained in the text image exceeds a first threshold, it is determined that the mode switching condition is met.

3. The method according to claim 1, characterized in that If the target part of the electronic device contacts the text page at least twice within a set time period, determining that the mode switching condition is satisfied includes: If the target part of the electronic device contacts the text page at least twice within a set time period, then acquiring the text content scanned in the process; If the text content is not a complete sentence, it is determined that the mode switching condition is met.

4. The method according to claim 1, characterized in that When the first scanning mode is a multi-line scanning mode and the second scanning mode is a single-line scanning mode, determining whether the mode switching condition is met is performed in the following manner: If the target part of the electronic device does not contact the text page at least twice within a set time period, it is determined that the mode switching condition is met.

5. The method according to claim 4, characterized in that If the target part of the electronic device does not contact the text page at least twice within a set time period, determining that the mode switching condition is satisfied includes: If the target part of the electronic device does not contact the text page at least twice within the set time period, acquiring a text image scanned during the process; If the number of text lines contained in the text image is a single line, it is determined that the mode switching condition is satisfied.

6. The method according to any one of claims 1 to 3, characterized in that: After controlling the electronic device to switch to the second scanning mode, the method further includes: If the duration that the target part of the electronic device leaves the text page exceeds a second threshold, the electronic device is controlled to switch to the first scanning mode.

7. A scanning mode switching device, applied to an electronic device, characterized in that: The device comprises: a scanning mode entry module, configured to control the electronic device to enter a first scanning mode if it is detected that a target portion of the electronic device contacts a text page; a scanning mode switching module, configured to control the electronic device to switch to a second scanning mode if it is determined that a mode switching condition is satisfied during the process in which the electronic device scans the text page based on the first scanning mode; When the first scanning mode is a single-line scanning mode and the second scanning mode is a multi-line scanning mode, the multi-line scanning mode means that after the electronic device starts the recognition, it can recognize multiple lines of content within the visible range of the camera; the scanning mode switching module includes: The first condition judgment unit is used to determine that the mode switching condition is satisfied if the target part of the electronic device contacts the text page at least twice within a set time period.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the scanning mode switching method according to any one of claims 1 to 6 is implemented.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the scanning mode switching method according to any one of claims 1 to 6 is implemented.