Page character voice reading method and device and electronic equipment

By monitoring the mouse movement trajectory and reading the content of web page elements, the problem of lack of reading function on web pages is solved, visual fatigue relief and support for visually impaired users is achieved, and web page intelligence and user experience are improved.

CN118885104APending Publication Date: 2024-11-01SHAANXI ZHIYUAN INTERNET SOFTWARE CO LTD

Patent Information

Application Number
CN202411105583.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-13
Publication Date
2024-11-01

AI Technical Summary

Technical Problem

The lack of reading function of existing web pages leads to visual fatigue during long browsing and cannot meet the needs of users who cannot browse the web pages visually.

Method used

Provide a speech reading method and device for page text. By monitoring the mouse movement trajectory, determine the page elements where the mouse is located, and read aloud according to the element content, supporting two reading modes: the first reading mode reads aloud when the mouse stops moving, 2 Read aloud mode reads aloud in real time when the mouse moves.

Benefits of technology

It realizes that users can learn the text content of web pages through hearing, alleviate visual fatigue, meet the needs of visually impaired users, improve the intelligence of web pages, and provide flexible reading mode selection to improve user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118885104A_ABST
    Figure CN118885104A_ABST
Patent Text Reader

Abstract

The invention discloses a voice reading method for page characters. The method comprises the following steps: receiving a reading mode starting instruction; when the instruction is received, reading characters in the page according to a first reading mode; the first reading mode is to monitor the movement track of the mouse; when the mouse stops moving, acquiring pixel point coordinates of the mouse; determining the current page element of the mouse; determining the page element where the mouse is located at present as a target page element, and judging whether the element content in the target page element contains characters or not; if yes, determining a starting character according to the pixel point coordinates of the mouse; sequentially and backwards obtaining characters in the target page element by taking the starting character as a starting point; if not, judging that the element content in the target page element is a picture; if yes, identifying the picture and sequentially obtaining all characters in the picture; and converting the obtained characters into voice for reading. The invention further discloses a device and electronic equipment for implementing the method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method, device and electronic device for voice reading of page text. Background Art

[0002] Existing web pages usually do not have the function of reading the text on the page aloud. Therefore, users can only read the text on the page visually. However, after browsing the web for a long time, users will experience problems such as visual fatigue. In addition, existing pages cannot meet the browsing requirements of users who cannot browse the web visually (such as the blind). Summary of the invention

[0003] The embodiments of the present invention provide a method, device and electronic device for voice reading of page text, which are used to enable users to know the text content in a web page through hearing, relieve users' visual fatigue, and meet the browsing requirements of users who cannot browse web pages visually, thereby improving the intelligence of web pages.

[0004] The specific technical solutions are as follows:

[0005] In a first aspect, an embodiment of the present invention provides a method for voice reading of page text, the method comprising:

[0006] Receive the command to start the reading mode;

[0007] When receiving the reading mode start instruction, reading the text in the page according to the first reading mode;

[0008] The first reading mode is:

[0009] Real-time monitoring of the mouse movement trajectory on the page;

[0010] When it is detected that the mouse stops moving, obtaining the pixel coordinates of the mouse;

[0011] Determine the page element where the mouse is currently located according to the pixel coordinates of the page origin, the pixel coordinates of the mouse and the coordinate areas of each page element in the page; wherein the pixel coordinates of the page origin are the pixel coordinates of the vertex in the upper left corner of the page; each page element in the page corresponds to a fixed coordinate area in the two-dimensional coordinate system where the page is located;

[0012] Confirm the page element where the mouse is currently located as the target page element, and determine whether the element content in the target page element contains text;

[0013] If yes, determine the starting text according to the pixel coordinates of the mouse; take the starting text as the starting point, and sequentially obtain the text in the target page element;

[0014] If not, determine whether the element content in the target page element is a picture; if so, identify the picture to determine whether the picture contains text, and if so, obtain all the text in the picture in sequence;

[0015] The acquired text is converted into speech for reading aloud.

[0016] Optionally, the step of determining the starting text according to the pixel coordinates of the mouse includes:

[0017] Obtain the font and size of the text in the target page element;

[0018] Determine the element corresponding to the pixel coordinates of the mouse according to the font and size of the characters in the target page element, the pixel coordinates of the page origin, and the pixel coordinates of the mouse;

[0019] When the element corresponding to the pixel point coordinates of the mouse is a text, confirming that the text is the starting text;

[0020] When the element corresponding to the pixel point coordinates of the mouse is not a character, it is confirmed that the first character after the element corresponding to the pixel point coordinates of the mouse is the starting character.

[0021] Optionally, the method further includes: a second reading mode;

[0022] The second reading mode is:

[0023] During the movement of the mouse, the pixel coordinates of the mouse are obtained in real time;

[0024] Determine the page element where the mouse is currently located according to the pixel coordinates of the page origin, the pixel coordinates of the mouse and the coordinate areas of each page element in the page;

[0025] Determine whether the element corresponding to the pixel coordinates of the mouse in the target page is text;

[0026] If yes, the text corresponding to the pixel coordinates of the mouse is obtained, the text is converted into speech, and the text is read aloud.

[0027] Optionally, the method further includes:

[0028] Receive reading mode switching instructions;

[0029] Determine the type of the current reading mode; if the type of the current reading mode is the first reading mode, switch the reading mode from the first reading mode to the second reading mode; if the type of the current reading mode is the second reading mode, switch the reading mode from the second reading mode to the first reading mode.

[0030] Optionally, the method further includes:

[0031] When the current reading mode is the first reading mode, during the reading process, whether the mouse position moves is monitored in real time;

[0032] If yes, the reading is stopped, the movement track of the mouse on the page is monitored, and the process returns to the step of obtaining the pixel coordinates of the mouse when the mouse stops moving and continues to execute.

[0033] Optionally, the receiving of the reading mode start instruction includes:

[0034] Determine whether a preset reading mode on button in the page is pressed by the user;

[0035] If the button is pressed by the user, it means that a reading mode start instruction is received;

[0036] The receiving of the reading mode switching instruction comprises:

[0037] Determine whether a preset reading mode switching button in the page is pressed by the user;

[0038] If the button is pressed by the user, it means that a reading mode switching instruction is received.

[0039] In a second aspect, an embodiment of the present invention provides a device for voice reading of page text, the device comprising:

[0040] A receiving module, used for receiving a command to start the reading mode;

[0041] A reading module, configured to read aloud the text in the page according to the first reading mode when receiving the reading mode start instruction;

[0042] The first reading mode is:

[0043] Real-time monitoring of the mouse movement trajectory on the page;

[0044] When it is detected that the mouse stops moving, obtaining the pixel coordinates of the mouse;

[0045] Determine the page element where the mouse is currently located according to the pixel coordinates of the page origin, the pixel coordinates of the mouse and the coordinate areas of each page element in the page; wherein the pixel coordinates of the page origin are the pixel coordinates of the vertex in the upper left corner of the page; each page element in the page corresponds to a fixed coordinate area in the two-dimensional coordinate system where the page is located;

[0046] Confirm the page element where the mouse is currently located as the target page element, and determine whether the element content in the target page element contains text;

[0047] If yes, determine the starting text according to the pixel coordinates of the mouse; take the starting text as the starting point, and sequentially obtain the text in the target page element;

[0048] If not, determine whether the element content in the target page element is a picture; if so, identify the picture to determine whether the picture contains text, and if so, obtain all the text in the picture in sequence;

[0049] The acquired text is converted into speech for reading aloud.

[0050] Optionally, the reading module is further specifically used for:

[0051] Obtain the font and size of the text in the target page element;

[0052] Determine the element corresponding to the pixel coordinates of the mouse according to the font and size of the characters in the target page element, the pixel coordinates of the page origin, and the pixel coordinates of the mouse;

[0053] When the element corresponding to the pixel point coordinates of the mouse is a text, confirming that the text is the starting text;

[0054] When the element corresponding to the pixel point coordinates of the mouse is not a character, it is confirmed that the first character after the element corresponding to the pixel point coordinates of the mouse is the starting character.

[0055] Optionally, the device further includes: a second reading mode;

[0056] The second reading mode is:

[0057] During the movement of the mouse, the pixel coordinates of the mouse are obtained in real time;

[0058] Determine the page element where the mouse is currently located according to the pixel coordinates of the page origin, the pixel coordinates of the mouse and the coordinate areas of each page element in the page;

[0059] Determine whether the element corresponding to the pixel coordinates of the mouse in the target page is text;

[0060] If yes, the text corresponding to the pixel coordinates of the mouse is obtained, the text is converted into speech, and the text is read aloud.

[0061] Optionally, the receiving module is also used to:

[0062] Receive reading mode switching instructions;

[0063] Determine the type of the current reading mode; if the type of the current reading mode is the first reading mode, switch the reading mode from the first reading mode to the second reading mode; if the type of the current reading mode is the second reading mode, switch the reading mode from the second reading mode to the first reading mode.

[0064] Optionally, the device further includes: a monitoring module, configured to:

[0065] When the current reading mode is the first reading mode, during the reading process, whether the mouse position moves is monitored in real time;

[0066] If yes, the reading is stopped, the movement track of the mouse on the page is monitored, and the reading module is started, so that the reading module continues to execute from the step of obtaining the pixel coordinates of the mouse when the mouse stops moving.

[0067] Optionally, the receiving of the reading mode start instruction includes:

[0068] Determine whether a preset reading mode on button in the page is pressed by the user;

[0069] If the button is pressed by the user, it means that a reading mode start instruction is received;

[0070] The receiving of the reading mode switching instruction comprises:

[0071] Determine whether a preset reading mode switching button in the page is pressed by the user;

[0072] If the button is pressed by the user, it means that a reading mode switching instruction is received.

[0073] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0074] The memory is used to store computer programs;

[0075] The processor is used to implement the method steps of voice reading of page text described in the first aspect when executing the program stored in the memory.

[0076] In a fourth aspect, an embodiment of the present invention 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 method steps for voice reading of page text described in the first aspect above are implemented.

[0077] It can be seen that the method provided by the embodiment of the present invention can realize reading aloud the text in the web page, so that the user can know the text content in the web page through hearing, relieve the user's visual fatigue, and at the same time meet the browsing requirements of those users who cannot browse the web page through vision, and improve the intelligence of the web page. In addition, the method provided by the embodiment of the present invention also provides different reading aloud modes, and the user can choose the mode according to actual needs or personal preferences, which not only increases the flexibility of the web page, but also helps to improve user satisfaction.

[0078] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings.

[0079] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0080] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:

[0081] Figure 1 A schematic diagram of a flow chart of a method for voice reading of page text provided by an embodiment of the present invention;

[0082] Figure 2 A schematic diagram of a process after the mouse moves during the reading process under the first reading model;

[0083] Figure 3 A schematic diagram of a flow chart after a user presses a reading mode switching button during reading in the first reading model;

[0084] Figure 4 A schematic diagram of a flow chart after a user presses a reading mode switching button during reading in the second reading model;

[0085] Figure 5 A schematic diagram of a structure of a device for voice reading of page text provided by an embodiment of the present invention;

[0086] Figure 6A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0087] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.

[0088] The embodiment of the present invention provides a page, which includes a pre-set read-aloud mode start button. When the user presses the read-aloud mode start button, the read-aloud mode start instruction issued by the user is received. Based on the page, the embodiment of the present invention provides a method for voice reading of page text, such as Figure 1 As shown, the method includes:

[0089] S101: receiving a reading mode start instruction;

[0090] The web page provided by the embodiment of the present invention includes a pre-set read-aloud mode start button. When the user presses the button, the read-aloud mode start instruction sent by the user is received.

[0091] S102: When a reading mode start instruction is received, the text in the page is read aloud according to the first reading mode.

[0092] Among them, the first reading mode is:

[0093] Real-time monitoring of the mouse movement trajectory on the page;

[0094] When the mouse stops moving, the pixel coordinates of the mouse are obtained;

[0095] Determine the page element where the mouse is currently located according to the pixel coordinates of the page origin, the pixel coordinates of the mouse and the coordinate areas of each page element in the page; wherein the pixel coordinates of the page origin are the pixel coordinates of the vertex in the upper left corner of the page; each page element in the page corresponds to a fixed coordinate area in the two-dimensional coordinate system where the page is located;

[0096] Confirm the page element where the mouse is currently located as the target page element, and determine whether the element content in the target page element contains text;

[0097] If yes, determine the starting text according to the pixel coordinates of the mouse; take the starting text as the starting point, and get the text in the target page element backward in sequence;

[0098] If not, determine whether the element content in the target page element is a picture; if so, identify the picture to determine whether the picture contains text, and if so, obtain all the text in the picture in sequence;

[0099] The acquired text is converted into speech for reading aloud.

[0100] In practical applications, when it is detected that the mouse stays at a certain place for a period exceeding a preset period, it is considered that the mouse has stopped moving.

[0101] The pixel coordinates of the mouse refer to the coordinates of the mouse pointer on the page. This position is determined by taking the vertex in the upper left corner of the screen as the origin (0,0), horizontally to the right as the positive direction of the X axis, and vertically downward as the positive direction of the Y axis. In a computer system, through the movement of the mouse and related hardware and software monitoring mechanisms, the current position of the mouse pointer can be obtained in real time and used for various operations, such as clicking icons, selecting text, dragging windows, etc. Obtaining the pixel coordinates of the mouse means obtaining the X and Y coordinates of the coordinate point where the mouse pointer is located on the page.

[0102] A coordinate region refers to a spatial range defined by a specific coordinate range in a given coordinate system. Taking a common two-dimensional rectangular coordinate system as an example, assuming that the range of the horizontal coordinate (X axis) is from a to b, and the range of the vertical coordinate (Y axis) is from c to d, then the area determined by these two sets of ranges is a coordinate region.

[0103] In the embodiment of the present invention, the page may be a web page, such as an HTML page or an XML page, and the position attribute of each page element in the page is in percentage form, which is equivalent to the distance percentage of the page border. That is to say, in a coordinate system with the vertex at the upper left corner of the page as the origin (0,0) of the two-dimensional coordinate system, the right side is the positive direction of the X axis, and the downward side is the positive direction of the Y axis, corresponding coordinates are set for each page element in the page and all contents in the page element.

[0104] Page elements refer to the various elements that make up the content of a web page, including but not limited to text, pictures, videos, links, tables, buttons, navigation bars, footers, etc. These elements together constitute the overall layout and structure of the web page, helping users browse and understand the content of the web page, and also providing support for the interactivity and functionality of the web page.

[0105] Element content refers to the specific information or data that makes up a page element. For example, the content of a text element is the text that is presented; the content of an image element is the specific image; the content of a form element is the value entered by the user or preset; the content of a link element is usually clickable text or an icon displayed to the user.

[0106] In a specific embodiment, the step of determining the starting text according to the pixel coordinates of the mouse may include:

[0107] Get the font and size of the text in the target page element;

[0108] Determine the element corresponding to the pixel coordinates of the mouse according to the font and size of the characters in the target page element, the pixel coordinates of the page origin, and the pixel coordinates of the mouse;

[0109] When the element corresponding to the pixel coordinates of the mouse is a text, confirm that the text is the starting text;

[0110] When the element corresponding to the pixel point coordinates of the mouse is not a text, the first text after the element corresponding to the pixel point coordinates of the mouse is confirmed to be the starting text.

[0111] In actual applications, you can use the getComputedStyle() method to get the calculated style of an element, and then get the font and font size values ​​of the text in the page element.

[0112] In a specific embodiment, when the element corresponding to the pixel coordinates of the mouse is text, the text corresponding to the pixel coordinates of the mouse and all the text after the pixel coordinates of the mouse in the target page element are obtained. When the element corresponding to the pixel coordinates of the mouse is not text, all the text after the pixel coordinates of the mouse in the target page element are obtained. For example, the target page element is a text box, which contains a paragraph of text. If the mouse falls on a certain word in the paragraph, all the remaining words in the text box are obtained from the word. If the mouse falls before a certain word in the paragraph, all the words in the text box are obtained from the word.

[0113] In a specific embodiment, the method provided by the embodiment of the present invention further includes: a second reading mode;

[0114] The second reading mode is:

[0115] When the mouse moves, the pixel coordinates of the mouse are obtained in real time;

[0116] Determine the page element where the mouse is currently located based on the pixel coordinates of the page origin, the pixel coordinates of the mouse, and the coordinate areas of each page element in the page;

[0117] Determine whether the element corresponding to the pixel coordinates of the mouse in the target page element is text;

[0118] If yes, the text corresponding to the pixel coordinates of the mouse is obtained, the text is converted into speech, and the text is read aloud.

[0119] That is, the second reading mode is to read aloud following the movement of the mouse, and reading stops when the mouse stops.

[0120] In a specific embodiment, the method provided by the embodiment of the present invention further includes:

[0121] Receive reading mode switching instructions;

[0122] Determine the type of the current reading mode; if the type of the current reading mode is the first reading mode, switch the reading mode from the first reading mode to the second reading mode; if the type of the current reading mode is the second reading mode, switch the reading mode from the second reading mode to the first reading mode.

[0123] In a specific embodiment, the webpage provided by the embodiment of the present invention may also include a pre-set reading mode switching button. When the user presses the button, the reading mode switching instruction is received. In the embodiment of the present invention, the first reading mode is the default reading mode, that is, when the user clicks the reading mode on button, the first reading mode is turned on by default.

[0124] In a specific embodiment, the method provided by the embodiment of the present invention further includes:

[0125] When the current reading mode is the first reading mode, during the reading process, whether the mouse position moves is monitored in real time;

[0126] If yes, the reading is stopped, the movement track of the mouse on the page is monitored, and the process returns to the step of obtaining the pixel coordinates of the mouse when the mouse stops moving and continues to execute.

[0127] That is to say, the method provided by the embodiment of the present invention monitors in real time whether the mouse position moves during the reading process in the first reading mode; if so, the reading is stopped, and the pixel coordinates of the mouse are obtained according to the current position of the mouse; the page element where the mouse is currently located is determined according to the pixel coordinates of the page origin, the pixel coordinates of the mouse and the coordinate area of ​​each page element in the page; the page element where the mouse is currently located is confirmed as the target page element, and it is determined whether the element content in the target page element contains text; if so, the starting text is determined according to the pixel coordinates of the mouse; taking the starting text as the starting point, the text in the target page element is obtained backward in sequence; if not, it is determined that the element content in the target page element is a picture; if so, the picture is identified to determine whether the picture contains text, and if so, all the text in the picture is obtained in sequence; the obtained text is converted into speech for reading.

[0128] In summary, the method provided by the embodiment of the present invention can realize reading aloud the text in the web page, so that the user can know the text content in the web page through hearing, relieve the user's visual fatigue, and meet the browsing requirements of those users who cannot browse the web page through vision, thereby improving the intelligence of the web page. In addition, the method provided by the embodiment of the present invention also provides different reading modes, and the user can select the mode according to actual needs or personal preferences, which not only increases the flexibility of the web page, but also helps to improve user satisfaction.

[0129] Three practical examples are given below to further illustrate the method provided in the embodiment of the present invention in more detail.

[0130] In this embodiment, the web page includes a pre-set read-aloud mode start button and a pre-set read-aloud mode switch button. When the user presses the read-aloud mode start button, the read-aloud mode start instruction issued by the user is received, and the first read-aloud mode is turned on. When the user presses the read-aloud mode switch button, the read-aloud mode switch instruction issued by the user is received, and the read-aloud mode is switched.

[0131] In this embodiment, the pixel coordinates of the origin of the web page are the pixel coordinates of the vertex in the upper left corner of the web page; each page element in the web page corresponds to a fixed coordinate area in the two-dimensional coordinate system where the page is located.

[0132] In this embodiment, the first reading mode is:

[0133] Real-time monitoring of the mouse movement trajectory on the page;

[0134] When the mouse stops moving, the pixel coordinates of the mouse are obtained;

[0135] Determine the page element where the mouse is currently located according to the pixel coordinates of the page origin, the pixel coordinates of the mouse and the coordinate areas of each page element in the page; wherein the pixel coordinates of the page origin are the pixel coordinates of the vertex in the upper left corner of the page; each page element in the page corresponds to a fixed coordinate area in the two-dimensional coordinate system where the page is located;

[0136] Confirm the page element where the mouse is currently located as the target page element, and determine whether the element content in the target page element contains text;

[0137] If yes, determine the starting text according to the pixel coordinates of the mouse; take the starting text as the starting point, and get the text in the target page element backward in sequence;

[0138] If not, determine whether the element content in the target page element is a picture; if so, identify the picture to determine whether the picture contains text, and if so, obtain all the text in the picture in sequence;

[0139] The acquired text is converted into speech for reading aloud.

[0140] The second reading mode is:

[0141] When the mouse moves, the pixel coordinates of the mouse are obtained in real time;

[0142] Determine the page element where the mouse is currently located based on the pixel coordinates of the page origin, the pixel coordinates of the mouse, and the coordinate areas of each page element in the page;

[0143] Determine whether the element corresponding to the pixel coordinates of the mouse in the target page element is text;

[0144] If yes, the text corresponding to the pixel coordinates of the mouse is obtained, the text is converted into speech, and the text is read aloud.

[0145] Example 1 is a scene in which the mouse moves during reading in the first reading model, see Figure 2 , the process of this embodiment is:

[0146] S201: receiving a reading mode start instruction from a user;

[0147] S202: When receiving the reading mode start instruction, monitor the movement track of the mouse on the page in real time;

[0148] S203: When it is detected that the mouse stops moving, the pixel coordinates of the mouse are obtained;

[0149] S204: determining the page element where the mouse is currently located according to the pixel coordinates of the page origin, the pixel coordinates of the mouse, and the coordinate areas of each page element in the page;

[0150] S205: confirming the page element where the mouse is currently located as the target page element, and determining whether the element content in the target page element contains text; if yes, executing step S206; if no, executing step S207;

[0151] If in the target page element, the content corresponding to the pixel coordinates of the mouse and the content corresponding to the pixel coordinates after the pixel coordinates of the mouse do not contain text, no text will be read aloud.

[0152] S206: Determine the starting text according to the pixel coordinates of the mouse; take the starting text as the starting point, and sequentially obtain the text in the target page element;

[0153] Specifically, the step of determining the starting text according to the pixel coordinates of the mouse includes:

[0154] Get the font and size of the text in the target page element;

[0155] Determine the element corresponding to the pixel coordinates of the mouse according to the font and size of the characters in the target page element, the pixel coordinates of the page origin, and the pixel coordinates of the mouse;

[0156] When the element corresponding to the pixel coordinates of the mouse is a text, confirm that the text is the starting text;

[0157] When the element corresponding to the pixel point coordinates of the mouse is not a text, the first text after the element corresponding to the pixel point coordinates of the mouse is confirmed to be the starting text.

[0158] Among them, the font and font size of the text in the target page element are obtained, that is, the font and font size of the text contained in the content corresponding to the pixel point coordinates of the mouse in the target page element, and the font and font size of the text contained in the content corresponding to the pixel point coordinates after the pixel point coordinates of the mouse are obtained respectively.

[0159] S207: Determine whether the element content in the target page element is a picture; if so, identify the picture to determine whether the picture contains text, and if so, obtain all the text in the picture in sequence;

[0160] In practical applications, open source image text recognition algorithms can be used, such as the CNOCR algorithm, TesseractOCR algorithm, etc. to recognize text in images.

[0161] S208: Convert the acquired text into speech for reading aloud;

[0162] S209: During the reading process, monitor in real time whether the mouse position moves; if so, stop reading, monitor the movement track of the mouse on the page, and return to step S203 to continue execution.

[0163] The embodiment of the present invention provides two reading modes. In the first reading mode, when the mouse stops moving, the text at the mouse position and all the text after the mouse position in the target page element is obtained, the obtained text is converted into speech, and the text is read aloud. In the second reading mode, during the mouse movement, the text at the mouse position is obtained in real time, the obtained text is converted into speech, and the text is read aloud.

[0164] Embodiment 2 is a scenario in which the user presses the reading mode switching button during reading in the first reading model. Figure 3 , the process of this embodiment is:

[0165] S301: During the reading process, monitor in real time whether the mouse position moves; if so, stop reading and monitor the movement track of the mouse on the page; when it is detected that the mouse stops moving, execute step S302;

[0166] The type of the current reading mode is the first reading mode.

[0167] If the mouse position does not move, the current reading continues.

[0168] S302: Determine the page element where the mouse is currently located according to the pixel coordinates of the page origin, the pixel coordinates of the mouse, and the coordinate areas of each page element in the page;

[0169] S303: confirming the page element where the mouse is currently located as the target page element, and determining whether the element content in the target page element contains text; if yes, executing step S304; if no, executing step S305;

[0170] S304: Determine the starting text according to the pixel coordinates of the mouse; take the starting text as the starting point, and sequentially obtain the text in the target page element;

[0171] S305: Determine whether the element content in the target page element is a picture; if so, identify the picture to determine whether the picture contains text, and if so, obtain all the text in the picture in sequence;

[0172] S306: Convert the acquired text into speech for reading aloud.

[0173] Embodiment 3 is a scenario in which the user presses the reading mode switching button during reading in the second reading model. Figure 4 , the process of this embodiment is:

[0174] S401: receiving a reading mode switching instruction;

[0175] The type of the current reading mode is the second reading mode.

[0176] S402: Determine the type of the current reading mode, and obtain that the type of the current reading mode is the second reading mode;

[0177] S403: Switching the reading mode from the second reading mode to the first reading mode.

[0178] Depend on Figure 2-4As can be seen from the embodiments shown, the method provided by the embodiments of the present invention can realize reading aloud the text in the web page, so that the user can know the text content in the web page through hearing, relieve the user's visual fatigue, and meet the browsing requirements of those users who cannot browse the web page through vision, thereby improving the intelligence of the web page. In addition, the method provided by the embodiments of the present invention also provides different reading aloud modes, and the user can select the mode according to actual needs or personal preferences, which not only increases the flexibility of the web page, but also helps to improve user satisfaction.

[0179] and Figure 1 Corresponding to the embodiment shown, the embodiment of the present invention also provides a device for reading text on a page by voice. Figure 5 As shown, the device includes: a receiving module 501, a reading module 502, wherein:

[0180] A receiving module 501 is used to receive a reading mode start instruction;

[0181] The reading module 502 is used to read the text in the page according to the first reading mode when receiving the reading mode start instruction;

[0182] The first reading mode is:

[0183] Real-time monitoring of the mouse movement trajectory on the page;

[0184] When the mouse stops moving, the pixel coordinates of the mouse are obtained;

[0185] Determine the page element where the mouse is currently located according to the pixel coordinates of the page origin, the pixel coordinates of the mouse and the coordinate areas of each page element in the page; wherein the pixel coordinates of the page origin are the pixel coordinates of the vertex in the upper left corner of the page; each page element in the page corresponds to a fixed coordinate area in the two-dimensional coordinate system where the page is located;

[0186] Confirm the page element where the mouse is currently located as the target page element, and determine whether the element content in the target page element contains text;

[0187] If yes, determine the starting text according to the pixel coordinates of the mouse; take the starting text as the starting point, and get the text in the target page element backward in sequence;

[0188] If not, determine whether the element content in the target page element is a picture; if so, identify the picture to determine whether the picture contains text, and if so, obtain all the text in the picture in sequence;

[0189] The acquired text is converted into speech for reading aloud.

[0190] Optionally, the reading module 502 is further specifically used for:

[0191] Get the font and size of the text in the target page element;

[0192] Determine the element corresponding to the pixel coordinates of the mouse according to the font and size of the characters in the target page element, the pixel coordinates of the page origin, and the pixel coordinates of the mouse;

[0193] When the element corresponding to the pixel coordinates of the mouse is a text, confirm that the text is the starting text;

[0194] When the element corresponding to the pixel point coordinates of the mouse is not a text, the first text after the element corresponding to the pixel point coordinates of the mouse is confirmed to be the starting text.

[0195] Optionally, the device further includes: a second reading mode;

[0196] The second reading mode is:

[0197] When the mouse moves, the pixel coordinates of the mouse are obtained in real time;

[0198] Determine the page element where the mouse is currently located based on the pixel coordinates of the page origin, the pixel coordinates of the mouse, and the coordinate areas of each page element in the page;

[0199] Determine whether the element corresponding to the pixel coordinates of the mouse in the target page element is text;

[0200] If yes, the text corresponding to the pixel coordinates of the mouse is obtained, the text is converted into speech, and the text is read aloud.

[0201] Optionally, the receiving module 501 is further configured to:

[0202] Receive reading mode switching instructions;

[0203] Determine the type of the current reading mode; if the type of the current reading mode is the first reading mode, switch the reading mode from the first reading mode to the second reading mode; if the type of the current reading mode is the second reading mode, switch the reading mode from the second reading mode to the first reading mode.

[0204] Optionally, the device further includes: a monitoring module, configured to:

[0205] When the current reading mode is the first reading mode, during the reading process, whether the mouse position moves is monitored in real time;

[0206] If yes, the reading is stopped, the movement track of the mouse on the page is monitored, and the reading module 502 is started, so that the reading module continues to execute from the step of obtaining the pixel coordinates of the mouse when the mouse stops moving.

[0207] Optionally, receive a command to start the reading mode, including:

[0208] Determine whether the preset reading mode on button on the page is pressed by the user;

[0209] If the button is pressed by the user, it means that a command to start the reading mode has been received;

[0210] Receive reading mode switching instructions, including:

[0211] Determine whether the preset reading mode switch button on the page is pressed by the user;

[0212] If the button is pressed by the user, it means that a reading mode switching instruction has been received.

[0213] Depend on Figure 5 As can be seen from the embodiments shown, the device provided by the embodiments of the present invention can realize reading aloud the text in the web page, so that the user can know the text content in the web page through hearing, relieve the user's visual fatigue, and meet the browsing requirements of users who cannot browse the web page through vision, thereby improving the intelligence of the web page. In addition, the device provided by the embodiments of the present invention also provides different reading modes, and the user can select the mode according to actual needs or personal preferences, which not only increases the flexibility of the web page, but also helps to improve user satisfaction.

[0214] and Figure 1 Corresponding to the embodiment shown, the embodiment of the present invention further provides an electronic device, see Figure 6 , including a processor 601, a communication interface 602, a memory 603 and a communication bus 604, wherein the processor 601, the communication interface 602, and the memory 603 communicate with each other through the communication bus 604;

[0215] Memory 603, used for storing computer programs;

[0216] The processor 601 is used to implement the method steps of voice reading of any page text described in the above embodiments when executing the program stored in the memory.

[0217] The electronic device provided by the embodiment of the present invention can realize reading aloud the text in the web page, so that the user can know the text content in the web page through hearing, relieve the user's visual fatigue, and meet the browsing requirements of users who cannot browse the web page through vision, thereby improving the intelligence of the web page. In addition, the electronic device provided by the embodiment of the present invention also provides different reading aloud modes, and the user can select the mode according to actual needs or personal preferences, which not only increases the flexibility of the web page, but also helps to improve the user's satisfaction.

[0218] and Figure 1 Corresponding to the embodiment shown, an embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the method steps for voice reading of text on any page described in the above embodiments are implemented.

[0219] The storage medium provided by the embodiment of the present invention can realize reading aloud the text in the page, so that the user can know the text content in the web page through hearing, relieve the user's visual fatigue, and meet the browsing requirements of those users who cannot browse the web page through vision, thereby improving the intelligence of the web page. In addition, the storage medium provided by the embodiment of the present invention also provides different reading aloud modes, and the user can select the mode according to actual needs or personal preferences, which not only increases the flexibility of the web page, but also helps to improve user satisfaction.

[0220] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program code.

[0221] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0222] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0223] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0224] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A method for voice reading of page text, characterized in that: The method comprises: Receive the command to start the reading mode; When receiving the reading mode start instruction, reading the text in the page according to the first reading mode; The first reading mode is: Real-time monitoring of the mouse movement trajectory on the page; When it is detected that the mouse stops moving, obtaining the pixel coordinates of the mouse; Determine the page element where the mouse is currently located according to the pixel coordinates of the page origin, the pixel coordinates of the mouse and the coordinate areas of each page element in the page; wherein the pixel coordinates of the page origin are the pixel coordinates of the vertex in the upper left corner of the page; each page element in the page corresponds to a fixed coordinate area in the two-dimensional coordinate system where the page is located; Confirm the page element where the mouse is currently located as the target page element, and determine whether the element content in the target page element contains text; If yes, determine the starting text according to the pixel coordinates of the mouse; take the starting text as the starting point, and sequentially obtain the text in the target page element; If not, determine whether the element content in the target page element is a picture; if so, identify the picture to determine whether the picture contains text, and if so, obtain all the text in the picture in sequence; The acquired text is converted into speech for reading aloud.

2. The method according to claim 1, characterized in that: The step of determining the starting text according to the pixel coordinates of the mouse comprises: Obtain the font and size of the text in the target page element; Determine the element corresponding to the pixel coordinates of the mouse according to the font and size of the characters in the target page element, the pixel coordinates of the page origin, and the pixel coordinates of the mouse; When the element corresponding to the pixel point coordinates of the mouse is a text, confirming that the text is the starting text; When the element corresponding to the pixel point coordinates of the mouse is not a character, it is confirmed that the first character after the element corresponding to the pixel point coordinates of the mouse is the starting character.

3. The method according to claim 1, characterized in that: The method further includes: a second reading mode; The second reading mode is: During the movement of the mouse, the pixel coordinates of the mouse are obtained in real time; Determine the page element where the mouse is currently located according to the pixel coordinates of the page origin, the pixel coordinates of the mouse and the coordinate areas of each page element in the page; Determine whether the element corresponding to the pixel coordinates of the mouse is text in the target page element; If yes, the text corresponding to the pixel coordinates of the mouse is obtained, the text is converted into speech, and the text is read aloud.

4. The method according to claim 3, characterized in that The method further comprises: Receive reading mode switching instructions; Determine the type of the current reading mode; if the type of the current reading mode is the first reading mode, switch the reading mode from the first reading mode to the second reading mode; if the type of the current reading mode is the second reading mode, switch the reading mode from the second reading mode to the first reading mode.

5. The method according to claim 1, characterized in that The method further comprises: When the current reading mode is the first reading mode, during the reading process, real-time monitoring is performed to determine whether the mouse position moves; If yes, the reading is stopped, the movement track of the mouse on the page is monitored, and the process returns to the step of obtaining the pixel coordinates of the mouse when the mouse stops moving and continues to execute.

6. The method according to claim 4, characterized in that The receiving of the reading mode start instruction includes: Determine whether a preset reading mode on button in the page is pressed by the user; If the button is pressed by the user, it means that a reading mode start instruction is received; The receiving of the reading mode switching instruction comprises: Determine whether a preset reading mode switching button in the page is pressed by the user; If the button is pressed by the user, it means that a reading mode switching instruction is received.

7. A device for reading text on a page by voice, characterized in that: The device comprises: A receiving module, used for receiving a command to start the reading mode; A reading module, configured to read aloud the text in the page according to the first reading mode when receiving the reading mode start instruction; The first reading mode is: Real-time monitoring of the mouse movement trajectory on the page; When it is detected that the mouse stops moving, obtaining the pixel coordinates of the mouse; Determine the page element where the mouse is currently located according to the pixel coordinates of the page origin, the pixel coordinates of the mouse and the coordinate areas of each page element in the page; wherein the pixel coordinates of the page origin are the pixel coordinates of the vertex in the upper left corner of the page; each page element in the page corresponds to a fixed coordinate area in the two-dimensional coordinate system where the page is located; Confirm the page element where the mouse is currently located as the target page element, and determine whether the element content in the target page element contains text; If yes, determine the starting text according to the pixel coordinates of the mouse; take the starting text as the starting point, and sequentially obtain the text in the target page element; If not, determine whether the element content in the target page element is a picture; if so, identify the picture to determine whether the picture contains text, and if so, obtain all the text in the picture in sequence; The acquired text is converted into speech for reading aloud.

8. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; The memory is used to store computer programs; The processor is used to implement the method steps described in any one of claims 1-6 when executing the program stored in the memory.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Mobile phone with reading function and realization method thereof

    CN102111915A

  • Control method for browsing system convenient for disabled for surf Internet

    CN106126639A

  • Online document barrier-free reading method and device, electronic equipment and storage medium

    CN116679857A

Cited By

  • Tab welding detection method and device, storage medium and program product

    CN120046118A