Text processing and text display method, device, electronic device and storage medium

By obtaining and processing text view information of the first terminal device, and generating and sending target data to ensure that the display effect of the second terminal device is consistent with the first terminal device, the problem of inconsistency in text display caused by device differences is solved, and the teaching live broadcast is improved Quality and data transmission efficiency.

CN116016962BActive Publication Date: 2024-11-01DOUYIN VISION CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111234238.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-22
Publication Date
2024-11-01
Estimated Expiration
2041-10-22

AI Technical Summary

Technical Problem

During the live teaching process, due to the size or pixel difference between the first terminal device and the second terminal device, the effect presented by the text information on the second terminal device is inconsistent with the first terminal device, which affects the quality of live teaching.

Method used

By obtaining the text view position information and size information of the first terminal device, the position and attribute information of the text area are determined, the target data is generated and sent to the second terminal device to ensure that its display effect is consistent with the first terminal device and the same Font library and data normalization is performed to reduce display errors.

Benefits of technology

The consistency of text display between the first terminal device and the second terminal device is achieved, the quality of live teaching is improved, maintenance costs are reduced, and data transmission efficiency is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116016962B_ABST
    Figure CN116016962B_ABST
Patent Text Reader

Abstract

The present disclosure provides a text processing and text display method, device, electronic device and storage medium, the text processing method includes: obtaining view position information and view size information of a first text view of a first terminal device; determining the text area position information and text attribute information of a first text area in the first text view relative to the first text view; obtaining target data based on the view position information, view size information, text area position information and text attribute information; sending the target data to at least one second terminal device, so that at least one second terminal device displays a second text view matching the first text view based on the target data, and the second text view contains a second text area matching the first text area. The embodiments of the present application can improve the consistency of text display between different devices during live broadcast.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of Internet live broadcast technology, and in particular to a text processing method, a text display method, a device, an electronic device and a storage medium. Background Art

[0002] As a network interaction mode, live broadcasting has been widely used in shopping, entertainment, learning, etc. For example, on the teaching live broadcast platform, teachers can conduct live teaching in their respective live classrooms, and students can enter the live classrooms to study.

[0003] During the live teaching process, there may be various modules such as the courseware area, teacher video area and student video area. In order to ensure that teachers and students can establish a unified understanding of the teaching content, it is necessary to present a consistent display effect on the first terminal device (teacher end) and the second terminal device (student end) to avoid blocking the teaching content due to device differences.

[0004] However, due to the differences between the first terminal device and different second terminal devices (such as size differences or pixel differences), during the live broadcast process, the effect of the text information presented on the second terminal device is different from that presented on the first terminal device. That is, during the live broadcast process, the effects presented by the first terminal device and the second terminal device are not consistent, which in turn affects the quality of live teaching. Summary of the invention

[0005] The embodiments of the present disclosure at least provide a text processing and text display method, device, electronic device and storage medium.

[0006] In a first aspect, an embodiment of the present disclosure provides a text processing method, including:

[0007] Acquire view position information and view size information of a first text view of a first terminal device;

[0008] Determine text area position information and text attribute information of a first text area in the first text view relative to the first text view;

[0009] Obtaining target data based on the view position information, the view size information, the text area position information and the text attribute information;

[0010] The target data is sent to at least one second terminal device, so that the at least one second terminal device displays a second text view matching the first text view based on the target data, wherein the second text view includes a second text area matching the first text area.

[0011] In the disclosed embodiment, the view position information and the view size information of the first text view are first obtained, and then the text area position information and the text attribute information of the first text area in the first text view relative to the first text view are determined to obtain display data, and the display data is processed and sent, so that the second terminal device receives the display data including both the position information and the text attribute information, thereby ensuring the consistency of the display effect of the second terminal device with that of the first terminal device.

[0012] According to the first aspect, in a possible implementation manner, the text content in the first text area and the text content in the second text area adopt the same font library.

[0013] In the disclosed embodiment, since the text content in the first text area and the text content in the second text area adopt the same font library, the display error of the second terminal device and the first terminal device for the same text content can be further reduced.

[0014] According to the first aspect, in a possible implementation, determining text area position information and text attribute information of a first text area in the first text view relative to the first text view includes:

[0015] Establishing a view coordinate system based on the first text view;

[0016] Determining text region position information of the first text region based on the view coordinate system;

[0017] Acquire text attribute information of the text content in the first text area.

[0018] In the disclosed embodiment, a view coordinate system is established based on the first text view, and the text area position information of the first text area is determined through the view coordinate system. This not only enables the acquisition of the text area position information, but also improves the determination accuracy of the text area position information.

[0019] According to the first aspect, in a possible implementation, the text attribute information includes: at least one of text position, text type, text line height, text width, text font size, text color, and text font.

[0020] According to the first aspect, in a possible implementation, the first text area is rectangular, and determining text area position information of the first text area based on the view coordinate system includes:

[0021] The step of determining coordinate information of vertices on a diagonal line of the first text region based on the view coordinate system.

[0022] In the disclosed embodiment, the text region position information can be determined by using the coordinate information of the vertices on the diagonal line of the first text region, thereby improving the efficiency of confirming the text region position information.

[0023] According to the first aspect, in a possible implementation manner, obtaining target data based on the view position information, the view size information, the text area position information, and the text attribute information includes:

[0024] Get the data normalization accuracy value;

[0025] Based on the data normalization precision value, the view position information, the view size information, the text area position information and the text attribute information are processed to obtain the target data.

[0026] In the disclosed embodiment, data compression processing is achieved by normalizing the data precision value, thereby improving data transmission efficiency.

[0027] According to the first aspect, in a possible implementation manner, sending the target data to at least one second terminal device includes:

[0028] Filling the target data into a predefined target data type;

[0029] The target data filled into the target data type is sent to the at least one second terminal device.

[0030] In the embodiment of the present disclosure, data transmission is achieved through predefined target data types.

[0031] According to the first aspect, in a possible implementation manner, sending the target data filled into the target data type to the at least one second terminal device includes:

[0032] Convert the target data filled into the target data type into binary data;

[0033] The target data of the binary data type is sent to the at least one second terminal device.

[0034] In the disclosed embodiment, the target data is converted into binary data before transmission, thereby avoiding the server from reprocessing the target data and reducing maintenance costs.

[0035] In a second aspect, an embodiment of the present disclosure provides a text display method, including:

[0036] receiving target data sent by a first terminal device; the target data includes display data, the display data includes view position information and view size information of a first text view, and text area position information and text attribute information of a first text area relative to the first text view, the first text view is displayed on the first terminal device, and the first text view includes the first text area;

[0037] Processing the target data to obtain the display data;

[0038] Based on the display data, a second text view matching the first text view is displayed, wherein the second text view includes a second text area matching the first text area.

[0039] In the disclosed embodiment, since the display data received by the second terminal device includes both position information and text attribute information, the display effect of the second terminal device is consistent with that of the first terminal device.

[0040] According to the second aspect, in a possible implementation manner, the text content in the first text area and the text content in the second text area adopt the same font library.

[0041] According to the second aspect, in a possible implementation, the text attribute information includes: at least one of text position, text type, text line height, text width, text font size, text color, and text font.

[0042] According to the second aspect, in a possible implementation, displaying a second text view matching the first text view based on the display data includes:

[0043] Based on the display data, determining a text display error;

[0044] Based on the text display error, the second text view is presented.

[0045] In the disclosed embodiment, the display error is first determined, and then the second text view is displayed based on the display error. In this way, the display effect of the text content in the second text view can be improved.

[0046] According to the second aspect, in a possible implementation manner, determining a text display error based on the display data includes:

[0047] Determining the text display error based on the width information of the text area and the total width information of each line of text;

[0048] The step of displaying the second text view based on the text display error includes:

[0049] The second text view is displayed based on the text display error, the width information of the text area, and the number of each line of text.

[0050] In the disclosed embodiment, the text display error is filled between the character spacings of all texts in each line of text, thereby aligning the text effect displayed by the second terminal device with the text effect displayed by the first terminal device.

[0051] In a third aspect, an embodiment of the present disclosure provides a text processing device, including:

[0052] An acquisition module, used to acquire view position information and view size information of a first text view of a first terminal device;

[0053] A determination module, configured to determine text area position information and text attribute information of a first text area in the first text view relative to the first text view;

[0054] A first processing module, configured to obtain target data based on the view position information, the view size information, the text area position information and the text attribute information;

[0055] A sending module is used to send the target data to at least one second terminal device, so that the at least one second terminal device displays a second text view matching the first text view based on the target data, and the second text view contains a second text area matching the first text area.

[0056] According to the third aspect, in a possible implementation manner, the text content in the first text area and the text content in the second text area adopt the same font library.

[0057] According to the third aspect, in a possible implementation manner, the determining module is specifically configured to:

[0058] Establishing a view coordinate system based on the first text view;

[0059] Determining text region position information of the first text region based on the view coordinate system;

[0060] Acquire text attribute information of the text content in the first text area.

[0061] According to the third aspect, in a possible implementation, the text attribute information includes: at least one of text position, text type, text line height, text width, text font size, text color, and text font.

[0062] According to the third aspect, in a possible implementation, the first text area is rectangular, and the determining module is specifically configured to:

[0063] The step of determining coordinate information of vertices on a diagonal line of the first text region based on the view coordinate system.

[0064] According to the third aspect, in a possible implementation manner, the first processing module is specifically configured to:

[0065] Get the data normalization accuracy value;

[0066] Based on the data normalization accuracy value, the view position information, the view size information, the text area position information and the text attribute information are processed to obtain the target data.

[0067] According to the third aspect, in a possible implementation manner, the sending module is specifically configured to:

[0068] Filling the target data into a predefined target data type;

[0069] The target data filled into the target data type is sent to the at least one second terminal device.

[0070] According to the third aspect, in a possible implementation manner, the sending module is specifically configured to:

[0071] Convert the target data filled into the target data type into binary data;

[0072] The target data of the binary data type is sent to the at least one second terminal device.

[0073] In a fourth aspect, an embodiment of the present disclosure provides a text display device, including:

[0074] a receiving module, configured to receive target data sent by a first terminal device; the target data includes display data, the display data includes view position information and view size information of a first text view, and text area position information and text attribute information of a first text area relative to the first text view, the first text view is displayed on the first terminal device, and the first text view includes the first text area;

[0075] A second processing module, used for processing the target data to obtain the display data;

[0076] A display module is used to display a second text view matching the first text view based on the display data, wherein the second text view includes a second text area matching the first text area.

[0077] According to the fourth aspect, in a possible implementation manner, the text content in the first text area and the text content in the second text area adopt the same font library.

[0078] According to the fourth aspect, in a possible implementation, the text attribute information includes: at least one of text position, text type, text line height, text width, text font size, text color, and text font.

[0079] According to the fourth aspect, in a possible implementation manner, the display module is specifically used for:

[0080] Based on the display data, determining a text display error;

[0081] Based on the text display error, the second text view is presented.

[0082] According to the fourth aspect, in a possible implementation manner, the display module is specifically used for:

[0083] Determining the text display error based on the width information of the text area and the total width information of each line of text;

[0084] The second text view is displayed based on the text display error, the width information of the text area, and the number of each line of text.

[0085] In a fifth aspect, an embodiment of the present disclosure provides an electronic device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate through the bus, and when the machine-readable instructions are executed by the processor, the text processing method as described in the first aspect or the text display method as described in the second aspect is performed.

[0086] In a sixth aspect, an embodiment of the present disclosure provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the text processing method as described in the first aspect or the text display method as described in the second aspect is executed.

[0087] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0088] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following is a brief introduction to the drawings required for use in the embodiments. The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used together with the specification to illustrate the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure and should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can also be obtained based on these drawings without creative work.

[0089] Figure 1 A schematic diagram of the architecture of a teaching live broadcast system provided by an embodiment of the present disclosure is shown;

[0090] Figure 2 A flowchart of a text processing method provided by an embodiment of the present disclosure is shown;

[0091] Figure 3 A schematic diagram showing a display interface of a first terminal device provided in an embodiment of the present disclosure is shown;

[0092] Figure 4 A flow chart of a method for determining text area position information and text attribute information provided by an embodiment of the present disclosure is shown;

[0093] Figure 5 A schematic diagram of determining text area position information provided by an embodiment of the present disclosure is shown;

[0094] Figure 6 A flow chart of a method for sending target data to at least one second terminal device provided by an embodiment of the present disclosure is shown;

[0095] Figure 7 A flowchart of a text display method provided by an embodiment of the present disclosure is shown;

[0096] Figure 8 A flowchart of a text processing and display method provided by an embodiment of the present disclosure is shown.

[0097] Fig. 9 A schematic diagram showing a display effect comparison before error checking provided by an embodiment of the present disclosure is shown;

[0098] Fig.10 A flow chart of a method for displaying a second text view provided by an embodiment of the present disclosure is shown;

[0099] Fig.11 A schematic diagram showing a display effect comparison after error checking provided by an embodiment of the present disclosure is shown;

[0100] Fig.12A schematic diagram of the structure of a text processing device provided by an embodiment of the present disclosure is shown;

[0101] Fig.13 A structural schematic diagram of a text display device provided by an embodiment of the present disclosure is shown;

[0102] Fig.14 A schematic diagram of an electronic device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0103] In order to make the purpose, technical scheme and advantages of the embodiments of the present disclosure clearer, the technical scheme in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. The components of the embodiments of the present disclosure generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure provided in the drawings is not intended to limit the scope of the present disclosure for protection, but merely represents the selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present disclosure.

[0104] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0105] The term "and / or" herein only describes an association relationship, indicating that three relationships may exist. For example, A and / or B may represent the following three situations: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C may represent including any one or more elements selected from the set consisting of A, B, and C.

[0106] As a network interaction mode, live broadcasting has been widely used in shopping, entertainment, learning, etc. For example, on the teaching live broadcast platform, teachers can conduct live teaching in their respective live classrooms, and students can enter the live classrooms to study.

[0107] During the live teaching process, there may be various modules such as the courseware area, teacher video area and student video area. In order to ensure that teachers and students can establish a unified understanding of the teaching content, it is necessary to present a consistent display effect on the first terminal device (teacher end) and the second terminal device (student end) to avoid blocking the teaching content due to device differences.

[0108] However, research has found that due to differences between the first terminal device and different second terminal devices (such as size differences or pixel differences), during the live broadcast, the effect of text information presented on the second terminal device is different from that presented on the first terminal device. That is, during the live broadcast, the effects presented by the first terminal device and the second terminal device are not consistent, which in turn affects the quality of live teaching.

[0109] Combine the following Figure 1 The architecture of a teaching live broadcast system provided by the embodiment of the present disclosure is introduced. Figure 1 As shown, the teaching system architecture 1000 may include a server 100, a first terminal device 200, and a plurality of second terminal devices 300. Among them, a communication connection is established between the first terminal device 200 and the server 100, and between the server 100 and the plurality of second terminal devices 300 through a network 400. That is, the network 400 is used to provide a medium for a communication link between the first terminal device 200 and the second terminal device 300.

[0110] The network 400 may include various types of wired communication links or wireless communication links, for example: the wired communication link includes optical fiber, twisted pair or coaxial cable, and the wireless communication link includes Bluetooth communication link, Wireless-Fidelity (Wi-Fi) communication link or microwave communication link, etc.

[0111] The first terminal device 200 and the second terminal device 300 can interact with the server 100 through the network 400 to receive messages from the server 100 or send messages to the server 100. Various communication client applications can be installed on the first terminal device 200 and the second terminal device 300, such as: drawing applications, video recording applications, video playback applications, voice collection applications, voice interaction applications, search applications, instant messaging tools, email clients, and social platform software.

[0112] In the embodiment of the present disclosure, the first terminal device 200 and the second terminal device 300 are various electronic devices with display screens, including but not limited to smart phones, tablet computers, laptop portable computers, and desktop computers, etc. The user can use the display screens on the first terminal device 200 and the second terminal device 300 to view displayed text, pictures, videos, and other information.

[0113] Server 100 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud storage, big data and artificial intelligence platforms.

[0114] It should be understood that Figure 1 The number of the first terminal device 200, the second terminal device 300, the server 100 and the network 400 is only illustrative. According to the implementation requirements, there can be any number of first terminal devices, second terminal devices, servers and networks.

[0115] To solve the above problems, the embodiments of the present disclosure provide a first text processing method and a text display method. The text processing method is applied to the above system architecture. Specifically, the executor of the text processing method can be the first terminal device 200. In some embodiments, the text processing method can be implemented by a processor calling computer-readable instructions stored in a memory.

[0116] See also Figure 2 , which is a flowchart of a text processing method provided by an embodiment of the present disclosure, the method is applied to a first terminal device side, and the method includes steps S101 to S104:

[0117] S101, obtaining view position information and view size information of a first text view of a first terminal device.

[0118] See also Figure 3 , Figure 3 A schematic diagram of a display interface of a first terminal device provided in an embodiment of the present disclosure. The following takes the teaching live broadcast scenario as an example for explanation. Figure 3 As shown, the content displayed on the display interface of the first terminal device side includes a teacher video area 10, a student video area 20 and a courseware area 30. The courseware area 30 displays at least one text view 31. In this embodiment, the courseware area 30 displays two first text views 31. A first text area 32 is also displayed in the text view 31, wherein the first text area 32 is used to display the corresponding text content. The position of the first text view 31 relative to the courseware area 30 can change based on the corresponding drag operation of the teacher.

[0119] Understandably, Figure 3 The layout positions of the teacher video area 10, the student video area 20 and the courseware area 30 are merely illustrative. In other implementations, the teacher video area 10, the student video area 20 and the courseware area 30 can be laid out and displayed in any form, which is not limited here. In addition, the number of student video areas 20 can vary according to the number of students participating in the live broadcast. For example, if five students participate in the teaching live broadcast, the student video areas corresponding to the five students can be displayed separately.

[0120] The view position information of the first text view 31 refers to the real-time position information of the first text view 31 relative to the courseware area 30, and the view size information may be different according to the shape of the first text view 31. For example, in the embodiment of the present disclosure, since the first text view 31 is a rectangle, the view size information of the first text view 31 includes length information and width information. If the first text view 31 is in other shapes, such as a triangle, it is necessary to obtain the length information, height information and angle information of the base of the triangle.

[0121] S102: Determine text area position information and text attribute information of a first text area in the first text view relative to the first text view.

[0122] Please refer again Figure 3 Since the position of the courseware area 30 is fixed, the real-time coordinates of the first text view 31 relative to the courseware area 30 are determined. Therefore, by obtaining the text area position information of the first text area 32 relative to the first text view 31, the position of the first text area 32 in the courseware area 31 can be determined.

[0123] Exemplarily, the text attribute information includes at least one of text position, text type, text line height, text width, text font size, text color, and text font. Among them, the text position refers to the position of each character, the text type includes Chinese, English, digital symbols and other types, the text line height refers to the height of the characters, the text width includes the width of each character and the total width of each line of text, the text font size refers to the size of the characters, the text color refers to the font color of the characters, and the text fonts include Songti, Lishu, Kaiti, etc.

[0124] In some embodiments, see Figure 4 As shown, for the above step S102, the following steps S1021 to S1023 may be specifically included:

[0125] S1021: Establish a view coordinate system based on the first text view.

[0126] S1022: Determine text region position information of the first text region based on the view coordinate system.

[0127] S1023: Acquire text attribute information of the text content in the first text area.

[0128] For example, the first text view can be regarded as a parent container, and the first text area can be regarded as a child container in the parent container. In this way, a coordinate system is established with the parent container, and then the coordinate system of the child container is located by the coordinate system. Figure 5As shown, a coordinate system is established with the parent container A, wherein the coordinate origin is a vertex of the parent container, so that the coordinate position of the child container B can be obtained, that is, the position information of the first text area is obtained.

[0129] In some embodiments, the first text region is rectangular, so in order to reduce the amount of data transmission, only the coordinate information of the vertices on the diagonal of the first text region can be determined. That is, although the first text region has four vertices, since the first text region is rectangular, the position information of the first text region can be determined by obtaining the coordinates of the vertices m and n on the diagonal. For example, in this embodiment, the coordinates of vertex m are (0.15, 0.2, 1), and the coordinates of vertex n are (0.4, 0.6, 1).

[0130] It should be noted that since the display interface has a hierarchical concept, the rendering level of parent container A is 0, and the rendering level of child container B is 1. If parent container A needs to display a picture in the place of child container B, it will be covered. Therefore, there is a concept of z-axis, that is, the value of the z-axis represents the hierarchical relationship of rendering.

[0131] S103, performing processing based on the view position information, the view size information, the text area position information and the text attribute information to obtain target data.

[0132] It can be understood that during the live broadcast process, the data of the first terminal device needs to be sent to different second terminal devices. In order to realize data transmission and improve the efficiency of data transmission, the acquired view position information, view size information, text area position information and text attribute information need to be compressed to obtain the target data.

[0133] Exemplarily, in order to achieve data transmission, a data normalization precision value (such as 10000) can be set in advance. The data normalization precision value is used to reduce the data of the first terminal device. For example, the current data is proportionally compressed with the normalized precision value, and then the second terminal device restores (enlarges) it using the same precision. Data outside the precision can be balanced according to specific needs using algorithms such as discarding / carrying / rounding. In the embodiment of the present disclosure, data outside the precision is discarded.

[0134] For example, please refer again to Figure 3 , the first terminal device can measure the width SWidth and height SHeight of the courseware area 30, and then measure the coordinates (realX, realY) of the upper left corner M and the lower right corner N of the first text view 31, and then calculate the processed coordinate values ​​of the upper left corner M and the lower right corner N through the following algorithm (1) using the defined normalized precision value RATIO:

[0135] (RATIO*realX / SWidth,RATIO*realY / SHeight)(1)

[0136] Other data can be processed similarly, for example, font size data and line height data are also converted into [RATIO*real Text Size / SWidth] and [RATIO*real Line Height / SHeight] according to the same algorithm. Among them, realText Size is the font size, and real Line Height is the line height.

[0137] Therefore, in some implementations, the data normalization accuracy value may be first obtained, and then based on the data normalization accuracy value, the view position information, the view size information, the text area position information and the text attribute information may be compressed to obtain the target data.

[0138] S104: Send the target data to at least one second terminal device, so that the at least one second terminal device displays a second text view matching the first text view based on the target data, wherein the second text view includes a second text area matching the first text area.

[0139] It is understandable that since live teaching is real-time, the content displayed in the first terminal device needs to be sent to different second terminal devices in real time for display, so that the teacher and students can see the same display screen at the same time, thereby realizing the interaction between the teacher and students based on the same teaching content. Figure 3 The first text view and the first text area are shown.

[0140] In the disclosed embodiment, the view position information and the view size information of the first text view are first obtained, and then the text area position information and the text attribute information of the first text area in the first text view relative to the first text view are determined to obtain display data, and the display data is sent, so that the second terminal device receives the display data including both the position information and the text attribute information, thereby ensuring the consistency of the display effect of the second terminal device with that of the first terminal device.

[0141] In some implementations, the text content in the first text area and the text content in the second text area use the same font library, which can reduce display errors of the second terminal device and the first terminal device for the same text content.

[0142] For step S104, see Figure 6As shown, when the target data is sent to at least one second terminal device, the following S1041 to S1042 may be included:

[0143] S1041, filling the target data into a predefined target data type.

[0144] S1042: Send the target data filled into the target data type to the at least one second terminal device.

[0145] Exemplarily, in order to achieve data transmission, a target data type may be predefined, and then the compressed data may be filled into the target data type, thereby achieving data transmission. In addition, in some embodiments, the target data filled into the target data type may be converted into binary data, and the target data of the binary data type may be sent to the at least one second terminal device. In this way, the server does not need to participate in the subsequent extension of the field, and the server may directly forward the received target data to the second terminal device, thereby reducing maintenance costs.

[0146] See also Figure 7 , is a flowchart of a text display method provided by an embodiment of the present disclosure, the method is applied to a second terminal device, and the method includes steps S201 to S203:

[0147] S201, receiving target data sent by a first terminal device; the target data includes display data, the display data includes view position information and view size information of a first text view, and text area position information and text attribute information of a first text area relative to the first text view, the first text view is displayed on the first terminal device, and the first text view includes the first text area.

[0148] This step is similar to the aforementioned steps S101 to S103 and will not be described again here.

[0149] S202: Process the target data to obtain the display data.

[0150] It can be understood that since the received target data is processed (such as compressed) data, the target data needs to be further processed (such as decompressed) and restored to the original display data so that the same content as the first terminal device can be displayed on the second terminal device based on the display data.

[0151] For example, please refer again to Figure 3 The second terminal device can first measure the actual width CWidth and actual height CHeight of the courseware area 30 on the terminal, and then calculate the coordinate values ​​of the upper left corner M and the lower right corner N of the first text view 31 by the following algorithm (2):

[0152] (x / RATIO*CWidth, y / RATIO*CHeight)(2)

[0153] Similarly, the font size and line height are also converted to [text Size / RATIO*CWidth] and [line Height / RATIO*CHeight]. RATIO is the normalized precision value, text Size is the font size, and line Height is the line height.

[0154] S203: Based on the display data, display a second text view that matches the first text view, where the second text view includes a second text area that matches the first text area.

[0155] In order to clearly express the specific process of the text display method in the embodiment of the present disclosure, please refer to Figure 8 , Figure 8 The following is a flowchart of a text processing and text display method provided by an embodiment of the present disclosure. Figure 8 As shown, after the first terminal device obtains the target data, it can be sent to the second terminal device via the server, and then the second terminal device processes the target data, and the same content as the classroom terminal device can be displayed on the second terminal device.

[0156] In the disclosed embodiment, since the display data received by the second terminal device includes both position information and text attribute information, the display effect of the second terminal device is consistent with that of the first terminal device.

[0157] It is understandable that in actual use, due to the large pixel gap between personal computers (such as laptops) and mobile devices (such as mobile phones), and the data normalization accuracy value is a fixed value, it is impossible to achieve the required accuracy effect on each device. When the gap between the first terminal device and the second terminal device is too large, distortion will occur, and the data will also be distorted during transmission, which will lead to a deviation between the actual effect and the expected effect of the text content displayed on the second terminal device (hereinafter referred to as error).

[0158] See also Fig. 9 Due to the existence of errors, there is a deviation of 1-2 pixels on each text. Although the pixel deviation of each text has little effect on the effect, the entire line of text (such as Fig. 9Therefore, in order to improve the display effect and make the text display effect of the second terminal device consistent with the text display effect of the first terminal device, in some embodiments, for the above step S203, based on the display data, when displaying the second text view matching the first text view, it includes the following: S2031-S2032:

[0159] S2031: Determine a text display error based on the display data.

[0160] Exemplarily, the text display error may be determined based on the width information of the text area and the total width information of each line of text.

[0161] S2032: Based on the text display error, display the second text view.

[0162] For example, the second text view may be displayed based on the text display error, the width information of the text area, and the number of each line of text. Fig.11 As shown, the error value can be filled in the word spacing of all texts in each line of text, so that the text effect displayed by the second terminal device is aligned with the text effect displayed by the first terminal device, that is, the verified effect after verification is aligned with the expected effect. In the disclosed embodiment, the alignment of each text can be achieved, which can be applicable to high-precision scenarios such as alignment of painting traces, thereby improving the applicability of the method.

[0163] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.

[0164] Based on the same technical concept, the embodiments of the present disclosure also provide a text processing device and a text display device corresponding to the text processing method and the text display method respectively. Since the principle of solving the problem by the device in the embodiments of the present disclosure is similar to the above-mentioned text processing method and text display method in the embodiments of the present disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0165] Reference Fig.12 FIG. 5 is a schematic diagram of a text processing device 500 provided in an embodiment of the present disclosure, wherein the device includes:

[0166] An acquisition module 501 is used to acquire view position information and view size information of a first text view of a first terminal device;

[0167] A determination module 502, configured to determine text area position information and text attribute information of a first text area in the first text view relative to the first text view;

[0168] A first processing module 503, configured to obtain target data based on the view position information, the view size information, the text area position information and the text attribute information;

[0169] The sending module 504 is used to send the target data to at least one second terminal device, so that the at least one second terminal device displays a second text view matching the first text view based on the target data, and the second text view includes a second text area matching the first text area.

[0170] In a possible implementation manner, the text content in the first text area and the text content in the second text area adopt the same font library.

[0171] In a possible implementation manner, the determining module 502 is specifically configured to:

[0172] Establishing a view coordinate system based on the first text view;

[0173] Determining text region position information of the first text region based on the view coordinate system;

[0174] Acquire text attribute information of the text content in the first text area.

[0175] In a possible implementation, the text attribute information includes: at least one of text position, text type, text line height, text width, text font size, text color, and text font.

[0176] In a possible implementation manner, the first text area is rectangular, and the determining module 502 is specifically configured to:

[0177] The step of determining coordinate information of vertices on a diagonal line of the first text region based on the view coordinate system.

[0178] In a possible implementation manner, the first processing module 503 is specifically configured to:

[0179] Get the data normalization accuracy value;

[0180] Based on the data normalization accuracy value, the view position information, the view size information, the text area position information and the text attribute information are processed to obtain the target data.

[0181] In a possible implementation manner, the sending module 504 is specifically configured to:

[0182] Filling the target data into a predefined target data type;

[0183] The target data filled into the target data type is sent to the at least one second terminal device.

[0184] In a possible implementation manner, the sending module 504 is specifically configured to:

[0185] Convert the target data filled into the target data type into binary data;

[0186] The target data of the binary data type is sent to the at least one second terminal device.

[0187] Reference Fig.13 FIG. 6 is a schematic diagram of a text display device 600 provided in an embodiment of the present disclosure, wherein the device includes:

[0188] A receiving module 601 is used to receive target data sent by a first terminal device; the target data includes display data, the display data includes view position information and view size information of a first text view, and text area position information and text attribute information of a first text area relative to the first text view, the first text view is displayed on the first terminal device, and the first text view includes the first text area;

[0189] A second processing module 602 is used to process the target data to obtain the display data;

[0190] The display module 603 is configured to display a second text view matching the first text view based on the display data, wherein the second text view includes a second text area matching the first text area.

[0191] In a possible implementation manner, the text content in the first text area and the text content in the second text area adopt the same font library.

[0192] In a possible implementation, the text attribute information includes: at least one of text position, text type, text line height, text width, text font size, text color, and text font.

[0193] In a possible implementation, the display module 603 is specifically used for:

[0194] Based on the display data, determining a text display error;

[0195] Based on the text display error, the second text view is presented.

[0196] In a possible implementation, the display module 603 is specifically used for:

[0197] Determining the text display error based on the width information of the text area and the total width information of each line of text;

[0198] The second text view is displayed based on the text display error, the width information of the text area, and the number of each line of text.

[0199] For descriptions of the processing flow of each module in the device and the interaction flow between each module, reference may be made to the relevant descriptions in the above method embodiment, which will not be described in detail here.

[0200] Based on the same technical concept, the embodiment of the present disclosure also provides an electronic device. Fig.14 , which is a schematic diagram of the structure of an electronic device 700 provided in an embodiment of the present disclosure, including a processor 701, a memory 702, and a bus 703. The memory 702 is used to store execution instructions, including a memory 7021 and an external memory 7022; the memory 7021 is also called an internal memory, which is used to temporarily store the operation data in the processor 701 and the data exchanged with the external memory 7022 such as a hard disk. The processor 701 exchanges data with the external memory 7022 through the memory 7021.

[0201] In the embodiment of the present application, the memory 702 is specifically used to store the application code for executing the solution of the present application, and the execution is controlled by the processor 701. That is, when the electronic device 700 is running, the processor 701 communicates with the memory 702 through the bus 703, so that the processor 701 executes the application code stored in the memory 702, and then executes the method described in any of the above embodiments.

[0202] Among them, the memory 702 can be, but is not limited to, random access memory (Random Access Memory, RAM), read only memory (Read Only Memory, ROM), programmable read-only memory (Programmable Read-Only Memory, PROM), erasable programmable read-only memory (Erasable Programmable Read-Only Memory, EPROM), electrically erasable read-only memory (Electric Erasable Programmable Read-Only Memory, EEPROM), etc.

[0203] The processor 701 may be an integrated circuit chip with signal processing capabilities. The above-mentioned processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The disclosed methods, steps and logic block diagrams in the embodiments of the present invention may be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0204] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 700. In other embodiments of the present application, the electronic device 700 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0205] The present disclosure also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the text processing method or text display method in the above method embodiment are executed. The storage medium can be a volatile or non-volatile computer-readable storage medium.

[0206] The embodiments of the present disclosure also provide a computer program product, which carries a program code. The instructions included in the program code can be used to execute the steps of the text processing method or text display method in the above method embodiments. For details, please refer to the above method embodiments, which will not be repeated here.

[0207] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is implemented as a computer storage medium. In another optional embodiment, the computer program product is implemented as a software product, such as a software development kit (SDK).

[0208] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In the several embodiments provided in the present disclosure, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, 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 through some communication interfaces, and the indirect coupling or communication connection of the device or unit can be electrical, mechanical or other forms.

[0209] The units described as separate components may or may not be physically separated, and the components shown 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 solution of this embodiment.

[0210] In addition, each functional unit in each embodiment of the present disclosure 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.

[0211] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0212] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.

Claims

1. A text processing method, characterized in that: include: Acquire view position information and view size information of a first text view of a first terminal device; Determine text area position information and text attribute information of a first text area in the first text view relative to the first text view; Obtaining target data based on the view position information, the view size information, the text area position information and the text attribute information; The target data is sent to at least one second terminal device, so that the at least one second terminal device displays a second text view matching the first text view based on the target data, wherein the second text view includes a second text area matching the first text area.

2. The method according to claim 1, characterized in that The text content in the first text area and the text content in the second text area adopt the same font library.

3. The method according to claim 1 or 2, characterized in that: The determining text area position information and text attribute information of the first text area in the first text view relative to the first text view includes: Establishing a view coordinate system based on the first text view; Determining text region position information of the first text region based on the view coordinate system; Acquire text attribute information of the text content in the first text area.

4. The method according to claim 3, characterized in that The text attribute information includes: at least one of text position, text type, text line height, text width, text font size, text color, and text font.

5. The method according to claim 3, characterized in that: The first text area is rectangular, and determining text area position information of the first text area based on the view coordinate system includes: Based on the view coordinate system, coordinate information of vertices on a diagonal line of the first text region is determined.

6. The method according to claim 1, characterized in that The obtaining target data based on the view position information, the view size information, the text area position information and the text attribute information includes: Get the data normalization accuracy value; Based on the data normalization precision value, the view position information, the view size information, the text area position information and the text attribute information are processed to obtain the target data.

7. The method according to claim 1, characterized in that The sending the target data to at least one second terminal device comprises: Filling the target data into a predefined target data type; The target data filled into the target data type is sent to the at least one second terminal device.

8. The method according to claim 7, characterized in that The step of sending the target data filled into the target data type to the at least one second terminal device includes: Convert the target data filled into the target data type into binary data; The target data of the binary data type is sent to the at least one second terminal device.

9. A text display method, characterized in that: include: Receiving target data sent by the first terminal device; The target data includes display data, the display data including view position information and view size information of a first text view, and text area position information and text attribute information of a first text area relative to the first text view, the first text view is displayed on a first terminal device, and the first text view includes the first text area; Processing the target data to obtain the display data; Based on the display data, a second text view matching the first text view is displayed, wherein the second text view includes a second text area matching the first text area.

10. The method according to claim 9, characterized in that The text content in the first text area and the text content in the second text area adopt the same font library.

11. The method according to claim 9, characterized in that The text attribute information includes: at least one of text position, text type, text line height, text width, text font size, text color, and text font.

12. The method according to claim 9, characterized in that The step of displaying a second text view matching the first text view based on the display data includes: Based on the display data, determining a text display error; Based on the text display error, the second text view is presented.

13. The method according to claim 12, characterized in that The determining of the text display error based on the display data comprises: Determining the text display error based on the width information of the text area and the total width information of each line of text; The step of displaying the second text view based on the text display error includes: The second text view is displayed based on the text display error, the width information of the text area, and the number of each line of text.

14. A text processing device, characterized in that: include: An acquisition module, used to acquire view position information and view size information of a first text view of a first terminal device; A determination module, configured to determine text area position information and text attribute information of a first text area in the first text view relative to the first text view; A first processing module, configured to obtain target data based on the view position information, the view size information, the text area position information and the text attribute information; A sending module is used to send the target data to at least one second terminal device, so that the at least one second terminal device displays a second text view matching the first text view based on the target data, and the second text view contains a second text area matching the first text area.

15. A text display device, characterized in that: include: A receiving module, used for receiving target data sent by the first terminal device; The target data includes display data, the display data including view position information and view size information of a first text view, and text area position information and text attribute information of a first text area relative to the first text view, the first text view is displayed on the first terminal device, and the first text view includes the first text area; A second processing module, used for processing the target data to obtain the display data; A display module is used to display a second text view matching the first text view based on the display data, wherein the second text view includes a second text area matching the first text area.

16. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the text processing method as described in any one of claims 1 to 8 or the text display method as described in any one of claims 9 to 13 is executed.

17. 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 text processing method as described in any one of claims 1 to 8 or the text display method as described in any one of claims 9 to 13 is executed.