Display method and device

By inputting the first text content into the big model in application scenarios such as chat to obtain multiple third text contents marked by the separator, the problem of increasing resource consumption of electronic devices caused by multiple calls to the big model is solved, and resource conservation and user experience improvement is achieved.

CN119537536APending Publication Date: 2025-02-28VIVO MOBILE COMM CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411574413.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-06
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

In application scenarios such as chat, since each call of the big model requires a large amount of computing resources, the consumption of electronic device resources increases.

Method used

By entering the first text content into the big model, the second text content of its output includes a separator, thereby determining and displaying a plurality of third text contents matching the first text content, avoiding multiple calls to the big model.

Benefits of technology

It realizes that without increasing the number of large-scale model calls, reduces the consumption of electronic devices and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119537536A_ABST
    Figure CN119537536A_ABST
Patent Text Reader

Abstract

The invention discloses a display method and device, and belongs to the technical field of communication. The method comprises the steps of obtaining first text content displayed in a first page; the first text content is input into a first model, second text content output by the first model based on the first text content is obtained, and the second text content comprises at least two separators; determining at least two third text contents from the second text contents based on the at least two separators, and displaying the at least two third text contents in the first page; wherein the third text content is matched with the first text content.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of communication technology, and specifically relates to a display method and a device thereof. Background Art

[0002] With the rapid development of large model technology, streaming output packet processing has become increasingly important in real-time applications. Streaming packet processing technology can perform real-time analysis and processing while data is being generated, thereby achieving real-time response to data, reducing response time, and improving user experience. It has broad application prospects in text conversations, content creation, intelligent customer service and other fields.

[0003] In some application scenarios (e.g., chat scenarios), a user input needs to generate multiple results from the big model. For example, when the user inputs "Well, you take a rest", the big model can call the big model once to generate result 1 "Well, safety is important, then you take a good rest", and call the big model again to generate result 2 "Take a good rest, have you gone to the hospital for a check-up", etc. However, since each call of the model consumes a lot of computing resources, the resource consumption of the electronic device is increased when the model is called multiple times. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a display method and device thereof, which can avoid calling a model multiple times, thereby reducing resource consumption of an electronic device.

[0005] In a first aspect, an embodiment of the present application provides a display method, the method comprising: obtaining first text content displayed in a first page; inputting the first text content into a first model, obtaining second text content output by the first model based on the first text content, the second text content including at least two separators; based on the at least two separators, determining at least two third text contents from the second text content, and displaying the at least two third text contents in the first page; wherein the third text content matches the first text content.

[0006] In a second aspect, an embodiment of the present application provides a display device, which includes: an acquisition module and a processing module. The acquisition module is used to acquire a first text content displayed in a first page. The processing module is used to input the first text content acquired by the acquisition module into a first model, acquire a second text content output by the first model based on the first text content, wherein the second text content includes at least two separators; and based on the at least two separators, determine at least two third text contents from the second text content, and display the at least two third text contents in the first page; wherein the third text content matches the first text content.

[0007] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.

[0008] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0009] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.

[0010] In a sixth aspect, an embodiment of the present application provides a computer program / program product, wherein the computer program / program product is stored in a storage medium, and the program / program product is executed by at least one processor to implement the method described in the first aspect.

[0011] In an embodiment of the present application, a first text content displayed in a first page is obtained; the first text content is input into a first model, and a second text content output by the first model based on the first text content is obtained, wherein the second text content includes at least two separators; based on the at least two separators, at least two third text contents are determined from the second text content, and at least two third text contents are displayed in the first page; wherein the third text content matches the first text content. In this solution, since the second text content output by the first model can be separated by separators, the electronic device can obtain at least two third text contents matching the first text content by calling the first model once, thereby avoiding the consumption of electronic device resources caused by calling the first model multiple times, thereby reducing the resource consumption of the electronic device. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Figure 1 This is one of the flow charts of a display method provided in an embodiment of the present application;

[0013] Figure 2 is a schematic diagram of an example of inputting into a smart reply control provided in an embodiment of the present application;

[0014] Figure 3 This is a second flow chart of a display method provided in an embodiment of the present application;

[0015] Figure 4 This is a third flow chart of a display method provided in an embodiment of the present application;

[0016] Figure 5 This is a fourth flow chart of a display method provided in an embodiment of the present application;

[0017] Figure 6 This is a fifth flow chart of a display method provided in an embodiment of the present application;

[0018] FIG. 7(A) is one of the schematic diagrams of an example of displaying the output results of a model provided in an embodiment of the present application;

[0019] FIG. 7(B) is a second example schematic diagram of a display model output result provided in an embodiment of the present application;

[0020] FIG. 7(C) is a third example schematic diagram of a display model output result provided in an embodiment of the present application;

[0021] FIG. 7(D) is a fourth example schematic diagram of a display model output result provided in an embodiment of the present application;

[0022] FIG. 7(E) is a fifth example schematic diagram of a display model output result provided in an embodiment of the present application;

[0023] FIG. 7(F) is a sixth example schematic diagram of a display model output result provided in an embodiment of the present application;

[0024] FIG. 7(G) is a seventh example schematic diagram of a display model output result provided in an embodiment of the present application;

[0025] FIG. 7(H) is an eighth example schematic diagram of a display model output result provided in an embodiment of the present application;

[0026] Figure 8 is a structural schematic diagram of a display device provided in an embodiment of the present application;

[0027] Fig. 9 This is one of the hardware structure diagrams of an electronic device provided in an embodiment of the present application;

[0028] Fig.10 This is the second schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0029] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0030] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way are interchangeable where appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0031] The terms "at least one (item)", "at least one of" and the like in the specification and claims of the present application refer to any one, any two or a combination of more than two of the objects included therein. For example, at least one (item) of a, b, and c can be represented by: "a", "b", "c", "a and b", "a and c", "b and c" and "a, b and c", where a, b, and c can be single or multiple. Similarly, "at least two (items)" refers to two or more, and its meaning is similar to that of "at least one (item)".

[0032] The display method provided in the embodiment of the present application is described in detail below through specific embodiments and their application scenarios in conjunction with the accompanying drawings.

[0033] The following is an explanation of some concepts and / or terms involved in the display method provided in the embodiments of the present application.

[0034] 1. Streaming output:

[0035] Streaming output means that when interacting with a large language model (such as GPT-3.5 or other similar models), the model starts reasoning immediately after receiving user input and gradually generates a response. Specifically, the model generates answers token by token instead of outputting a complete response result at one time. This streaming method allows users to start receiving and processing partial data before the model generates a complete response, thereby significantly reducing waiting time and improving interaction efficiency and user experience. This method is particularly suitable for application scenarios that require fast feedback, such as real-time conversations and online Q&A. Through streaming output, users can obtain information faster, adjust questions in a timely manner or ask further questions, thereby achieving a more natural and efficient interaction experience.

[0036] 2. Data Packet:

[0037] In the streaming output process of the large model, the content is usually generated token by token. The content returned each time can be a character, a subword, or a complete word, depending on how the model is trained and the tokenizer used. We call the content output by the large model each time a data packet. Each data packet contains the content generated by the large model and the corresponding token information. By splicing the content of all received data packets together, users can obtain the complete response results generated by the large model. This way of receiving data step by step helps to better manage and process information flows. The concept of data packets is not only crucial in technical implementation, but also provides users with more detailed control and monitoring capabilities, making information processing more flexible and efficient.

[0038] 3. Separator prefix string:

[0039] The delimiter prefix string is a part of the delimiter that identifies the delimiter position in the text. If the specified delimiter is "#!#", then this delimiter prefix string can be a string containing the following: "#", "#!". When the large model processes text, any string that starts with these characters can be regarded as a delimiter prefix.

[0040] The display method provided in the embodiment of the present application is described in detail below through specific embodiments and their application scenarios in conjunction with the accompanying drawings.

[0041] The display method in the embodiment of the present application can be applied to the scenario of quick input (for example, quick reply to messages when chatting with contacts, or quick query when searching for information in a browser).

[0042] In the display method and device provided in the embodiments of the present application, since the second text content output by the first model can be separated by a separator, the electronic device can obtain at least two third text contents matching the first text content by calling the first model once, thereby avoiding the consumption of electronic device resources caused by multiple calls to the first model, thereby reducing the resource consumption of the electronic device.

[0043] The display method provided in the embodiment of the present application may be executed by a display device, which may be an electronic device, or a functional module or entity in an electronic device. The technical solution provided in the embodiment of the present application is described below using an electronic device as an example.

[0044] The present application embodiment provides a display method. Figure 1 FIG. 1 is a flow chart of a display method provided by an embodiment of the present application, which can be applied to electronic devices. Figure 1 As shown, the display method provided in the embodiment of the present application may include the following steps 201 to 203.

[0045] Step 201: The electronic device obtains first text content displayed on a first page.

[0046] In some embodiments of the present application, the first page may be at least one of the following: a chat page, a search page, which is not limited in the present application.

[0047] In some embodiments of the present application, the first text content may include at least one of the following: content entered by the user in the text input box of the first page, and content displayed on the first page.

[0048] Exemplarily, when the first page is a chat page, the first text content may include content input by the user in a text input box of the chat page and historical chat information in the chat page.

[0049] In some embodiments of the present application, the electronic device may receive a first input from a user and obtain first text content displayed on a first page.

[0050] In some examples, the first input may be an input to a first control in the first page.

[0051] For example, the first control can be understood as an artificial intelligence (AI) function control. When the electronic device receives the user's input to the first control, the electronic device can intelligently generate multiple third text contents based on the displayed first text content to help the user quickly reply to information or query information.

[0052] For example, Figure 2 As shown, the electronic device displays a group chat page 11. When the user enters "Come on" in the text box, if the user feels that his reply is a bit concise, he can click the "Reply" control 12 in the group chat page 11, that is, the first control mentioned above, so that the electronic device obtains the content "Come on" entered by the user in the text box on page 11 and the chat content displayed on page 11 (that is, the first text content mentioned above), and calls the first model to intelligently generate multiple third text contents to help users quickly reply to messages.

[0053] Step 202: The electronic device inputs the first text content into the first model, and obtains the second text content output by the first model based on the first text content.

[0054] In an embodiment of the present application, the second text content includes at least two separators.

[0055] In some embodiments of the present application, the first model may be a large language model GPT-3.5, or other models with the same specific functions, which is not limited in the embodiments of the present application.

[0056] In some embodiments of the present application, the electronic device may input the first information and the first text content into the above-mentioned first model to determine and output the second text content based on the first information and the first text content through the first model.

[0057] In some examples, the first information is used to indicate a delimiter style output by the first model and the amount of third text content required to be output by the first model.

[0058] Exemplarily, the separator pattern may be any of the following: “#*#”, “#!#”, “&*&”. The present application embodiment does not limit this.

[0059] In some embodiments of the present application, after the client of the electronic device obtains the above-mentioned first text content, it can pass the first text content to the server of the electronic device. The server of the electronic device can input the first information and the first text content into the first model to determine and output the second text content based on the first information and the first text content through the first model. The number of third text contents included in the second text content is the same as the number of third text contents required to be output by the first model as indicated by the first information, and the third text content in the second text content is segmented and separated using the delimiter style indicated by the first information.

[0060] For example: when the first information indicates that the separator style of the first model output is "#*#", and the number of third text contents required to be output by the first model is 2, the second text content output by the electronic device based on the first text content can be: "#*#Well, safety is important, so you should have a good rest#*#Have a good rest, have you been to the hospital for a check-up", wherein the second text content includes two third text contents separated by the separator "#*#": "Well, safety is important, so you should have a good rest" and "Have a good rest, have you been to the hospital for a check-up".

[0061] Step 203: The electronic device determines at least two third text contents from the second text content based on at least two separators, and displays the at least two third text contents on the first page.

[0062] In an embodiment of the present application, the third text content matches the first text content.

[0063] It can be understood that after acquiring the second text content, the electronic device can acquire at least two third text contents from the second text content based on the separator in the second text content.

[0064] In some embodiments of the present application, each third text content corresponds to a separator.

[0065] Exemplarily, each third text content in the second text content is separated by a separator.

[0066] For example: when the two third text contents are "Well, safety is important, so you should have a good rest" and "Have a good rest, have you gone to the hospital for a check-up", they can be separated by a separator as "#*#Well, safety is important, so you should have a good rest#*#Have a good rest, have you gone to the hospital for a check-up".

[0067] In some embodiments of the present application, the matching of the third text content with the first text content can be understood as: the third text content and the first text content are similar in meaning.

[0068] In some embodiments of the present application, after the server of the electronic device determines the second text content through the first model, it can determine at least two third text contents from the second text content based on at least two separators, and then pass the at least two third text contents to the client of the electronic device. The client of the electronic device can display the at least two third text contents on the first page.

[0069] In the display method provided in the embodiment of the present application, since the second text content output by the first model can be separated by a separator, the electronic device can obtain at least two third text contents matching the first text content by calling the first model once, thereby avoiding the consumption of electronic device resources caused by multiple calls to the first model, thereby reducing the resource consumption of the electronic device.

[0070] In some embodiments of the present application, when the first model outputs the third text content based on the first text content, it outputs it in a streaming manner, that is, it generates and outputs it at the same time. For example: the first model can output "#*# um", ", safety", "important", ", then", "you", "have a good rest#", "*# have a good rest", ", you", "go to the hospital", "have you checked" in sequence. The electronic device can obtain the content of the streaming output of the first model while processing the content output by the first model, and finally obtain the two third text contents generated by the first model "um, safety is important, then you have a good rest" and "have a good rest, have you gone to the hospital for a check-up".

[0071] In some embodiments of the present application, the second text content includes M text segments and separators corresponding to the third text content, where M is an integer greater than 1; Figure 1 ,like Figure 3 As shown, the above step 203 can be specifically implemented through the following steps 301 and 302.

[0072] Step 301: When obtaining a second text segment output by a first model, the electronic device stores the second text segment in a first area.

[0073] In an embodiment of the present application, the above second text segment is a text segment among M text segments.

[0074] It can be understood that after the first text content is input into the first model, the first model can stream out M text segments and at least two delimiters based on the first text content. The electronic device can continuously monitor and receive the M text segments and at least two delimiters streamed out by the first model, so as to display at least two third text contents on the first page based on the M text segments and at least two delimiters.

[0075] In some embodiments of the present application, at least two third text contents are obtained by merging M text segments.

[0076] In some embodiments of the present application, the above first area can be understood as a buffer (buffer), and the first area is used to temporarily store the text segments output by the first model.

[0077] In some embodiments of the present application, the first model can encapsulate the second text segment into a data packet and then output it.

[0078] In some embodiments of the present application, after the electronic device obtains the first data packet output by the first model, it can parse the first data packet to extract the second text segment in the first data packet, and then temporarily store the second text segment in the first area.

[0079] Step 302: When the text segment in the first area carries a delimiter, if the first variable is greater than a preset value, the electronic device displays the text segment before the delimiter in the first area in the second display area of the first page.

[0080] In some embodiments of the present application, since each third text content is separated by a delimiter, the first text segment output by the first model will carry the delimiter corresponding to the first third text content.

[0081] For example: when the first third text content is "#*# Well, safety is important. Then you have a good rest", the first text segment output by the first model can be "#*# Well".

[0082] In some embodiments of the present application, the electronic device can first determine whether the text segment in the first area carries a delimiter. When the text segment in the first area carries a delimiter, the electronic device can determine that the text segment in the first area includes at least one of the following: the starting content of any third text content, the ending content of any third text content.

[0083] In some embodiments of the present application, since there is a delimiter separating each third text content, when a text segment output by the first model carries a delimiter, the electronic device can determine that the text segment contains at least one of the starting content of any third text content and the ending content of any third text content.

[0084] It should be noted that when the text segment contains both the starting content of a third text content and the ending content of a third text content, the starting content and the ending content are from different third text contents.

[0085] For example: when the text segment in the first region is "#*# Well", the electronic device can determine that the text segment in the first region carries a delimiter, and the text segment in the first region contains the starting content of any third text content.

[0086] For example: when the text segment in the first region is "Rest #*#", the electronic device can determine that the text segment in the first region carries a delimiter, and the text segment in the first region contains the ending content of any third text content.

[0087] For example: when the text segment in the first region is "Rest #*# Good", the electronic device can determine that the text segment in the first region carries a delimiter, and the text segment in the first region contains the ending content of any third text content and the starting content of another any third text content.

[0088] In the embodiments of the present application, the above first variable is used to indicate the serial number of the third text content being processed by the electronic device.

[0089] In some embodiments of the present application, when the above first variable is 0, it means that the electronic device has not started processing the third text content yet; when the first variable is 1, it means that the electronic device is processing the first third text content; when the first variable is i, it means that the electronic device is processing the i-th third text content.

[0090] In some embodiments of the present application, the above preset value can be 0.

[0091] In some embodiments of the present application, when inputting the first text content into the first model, the electronic device can initialize the first variable to make the first variable 0. After processing the first text segment output by the first model, the first variable can be adjusted from 0 to 1, indicating that the electronic device is processing the first third text content; after determining that the first third text content is processed, the first variable can be adjusted from 1 to 2, indicating that the electronic device is processing the second third text content; after determining that the (i - 1)-th third text content is processed, the first variable can be adjusted from i - 1 to i, indicating that the electronic device is processing the i-th third text content.

[0092] In some embodiments of the present application, when the text segment in the first area carries a separator, the electronic device can further determine whether the first variable is greater than a preset value. When the first variable is greater than the preset value, the electronic device can determine that the first text segment is not the first text segment among the M text segments. Then, when the text segment is contained before the separator in the first area (for example: "Rest#*#good", or "Rest#*#"), the electronic device can display the text segment before the separator in the first area in the second display area of ​​the first page to complete the processing of the third text content corresponding to the first variable.

[0093] It can be understood that since the first variable is greater than the preset value, the electronic device can determine that the electronic device has at least processed the first text segment output by the first model, and then when the text segment is included before the separator in the first area, the electronic device can determine that the text segment in the first area contains the ending content of a third text content. Therefore, the electronic device can first display the text segment before the separator in the second display area of ​​the first page to complete the processing of the third text content corresponding to the first variable.

[0094] Exemplarily, when the first variable is i, the third text content corresponding to the first variable is the i-th third text content among the at least two third text contents.

[0095] In an embodiment of the present application, the second display area is used to display a third text content corresponding to the first variable.

[0096] Exemplarily, when the first variable is i, it indicates that the electronic device is processing the i-th third text content, and thus the electronic device may display the text segment before the separator in the first area in the display area corresponding to the i-th third text content.

[0097] In some embodiments of the present application, the server of the electronic device can store the second text segment output by the first model in the first area, and when it is determined that the text segment in the first area carries a separator and the first variable is greater than a preset value, pass the text segment before the separator in the first area to the client, and the client of the electronic device can display the received text segment in the second display area.

[0098] Specifically, the server of the electronic device can encapsulate the text segment before the separator in the first area and the first variable into a second data packet, and then pass the second data packet to the client. After the client receives the second data packet, it can display the text segment in the second data packet in the second display area based on the first variable in the second data packet.

[0099] In some embodiments of the present application, when the text segment in the first region carries a delimiter and the first variable is greater than a preset value, if there is no text segment before the delimiter in the first region (for example, "#*#good"), the electronic device may determine that the text segment in the first region is the starting content of a third text content other than the first third text content. Further, the electronic device may determine that the third text content corresponding to the first variable has been processed.

[0100] In this way, since when the text segment temporarily stored in the first region carries a delimiter and the first variable is greater than a preset value, the electronic device may determine that the text segment in the first region contains the ending content of any third text content and / or the starting content of another third text content other than the first third text content, the electronic device may first display the text segment before the delimiter in the corresponding display region, thereby improving the accuracy of the display output result of the electronic device.

[0101] In some embodiments of the present application, when the server in the electronic device determines that the third text content corresponding to the first variable has been processed, it may encapsulate an end flag and the first variable into a data packet and transmit it to the client. After receiving the data packet, the client may, based on the end flag and the first variable, end the on-screen display of the third text content corresponding to the first variable and prepare for the on-screen display of the next third text content.

[0102] In some embodiments of the present application, when the electronic device determines that the third text content corresponding to the first variable has been processed, it may perform step 303 below.

[0103] In some embodiments of the present application, after step 302 above, the display method provided by the embodiments of the present application further includes step 303 below.

[0104] Step 303: The electronic device deletes the text segment before the delimiter and the delimiter in the first region to obtain a third text segment and adjusts the first variable.

[0105] In the embodiments of the present application, the adjusted first variable is greater than a preset value.

[0106] In some embodiments of the present application, the above third text segment may be understood as the content to be processed next.

[0107] In some embodiments of the present application, when there is a text segment before the delimiter in the first region, after the electronic device displays the text segment before the delimiter in the first region in the second display region of the first page, the electronic device may delete the text segment before the delimiter and the delimiter in the first region to obtain a third text segment and adjust the first variable.

[0108] In some embodiments of the present application, the electronic device may extract the content after the delimiter in the first region, then clear the first region, and store the extracted content after the delimiter into the first region to obtain the above-mentioned third text segment. It can be understood that through this step, only the content to be processed in the next step can be retained.

[0109] In some embodiments of the present application, since the electronic device determines that the third text content corresponding to the first variable has been processed, the electronic device can adjust the first variable to identify the next third text content to be processed through the adjusted first variable.

[0110] Exemplarily, the electronic device may increment the value of the first variable by one.

[0111] For example: when the first variable is 1, if the electronic device determines that the third text content corresponding to the first variable has been processed, that is, the first third text content has been processed, the electronic device may increment the value of the first variable by one, so that the first variable becomes 2, indicating that the electronic device is processing the second third text content.

[0112] In some embodiments of the present application, when the text segment before the delimiter in the first region does not contain a text segment (for example: "#*#good"), the electronic device only deletes the delimiter in the first region to obtain the third text segment and adjusts the first variable.

[0113] In some embodiments of the present application, after the electronic device deletes the text segment and the delimiter before the delimiter in the first region, if the first region is empty, the electronic device may adjust the first variable and continue to obtain the text segment output by the first model.

[0114] For example: when the text segment in the first region is "rest#*#", after deleting the text segment and the delimiter before the delimiter in the first region, the first region does not contain content, so the electronic device may adjust the first variable and continue to obtain the text segment output by the first model.

[0115] In this way, since after the electronic device displays the text segment before the delimiter in the corresponding display region, the electronic device can delete the processed content and only retain the unprocessed content after the delimiter in the first region, the accuracy of the electronic device in processing the content output by the first model is improved.

[0116] It should be noted that after step 303 is executed, the electronic device may continue to execute step 602 below, which will not be elaborated here.

[0117] In some embodiments of the present application, the second text content includes M text segments and the delimiter corresponding to the third text content, where M is an integer greater than 1; combined Figure 1 , such as Figure 4As shown, the above step 203 can be specifically implemented through the following steps 401 and 402.

[0118] Step 401: When obtaining a fourth text segment output by the first model, the electronic device stores the fourth text segment in the first area.

[0119] In an embodiment of the present application, the fourth text segment is a text segment among the M text segments.

[0120] It should be noted that the detailed steps for the fourth text segment can refer to the description of the second text segment in the above embodiment, which will not be repeated here.

[0121] Step 402: When the text segment in the first area does not carry a separator and the first variable is greater than a preset value, if the end of the text segment in the first area carries a second character, the electronic device displays the text segment before the second character in the third display area of ​​the first page.

[0122] In an embodiment of the present application, the first variable is used to indicate the sequence number of the third text content being processed by the electronic device.

[0123] In an embodiment of the present application, the third display area is used to display a third text content corresponding to the first variable.

[0124] It should be noted that, for the detailed steps of the third display area, reference may be made to the description of the second display area in the above embodiment, and no further description will be given here.

[0125] In some embodiments of the present application, the electronic device can first determine whether the text segment in the first area carries a separator. If the text segment in the first area does not carry a separator, the electronic device can determine that the third text content corresponding to the first variable has not been processed, that is, the third text content currently being processed has not been processed.

[0126] It can be understood that, since each third text content is separated by a separator, when a text segment output by the first model does not carry a separator, the electronic device can determine that the third text content corresponding to the first variable is being processed.

[0127] In an embodiment of the present application, the second character includes a separator prefix string.

[0128] In some embodiments of the present application, when the separator is “#*#”, the second character may be any one of the following: “#”, “#*”.

[0129] In some embodiments of the present application, when the text segment in the first area does not carry a separator, the electronic device can further determine whether the first variable is greater than a preset threshold value. When the first variable is greater than the preset value, the electronic device can determine that the electronic device has processed at least the first text segment output by the first model. Therefore, the text segment in the first area can include any of the following items: the middle content of any third text content (for example: "safety"), the ending content of any third text content (for example: "have a good rest#"), and the starting content of a third text content other than the first third text content (for example: "*#have a good rest").

[0130] In some embodiments of the present application, when the text segment in the first area does not carry a separator and the first variable is greater than a preset value, the electronic device can further determine whether the end of the text segment in the first area carries a second character. When the end of the text segment in the first area carries the second character, the electronic device can determine that the text segment in the first area may contain the ending content of any third text content, and therefore the electronic device can first display the text segment before the second character in the third display area of ​​the first page.

[0131] In some embodiments of the present application, the server of the electronic device can store the fourth text segment output by the first model in the first area, and when it is determined that the text segment in the first area does not carry a separator, the first variable is greater than a preset value, and the end of the text segment in the first area carries a second character, the server of the electronic device can pass the text segment before the second character in the first area to the client, and the client of the electronic device can display the received text segment in the third display area.

[0132] Specifically, the server of the electronic device can encapsulate the text segment before the second character in the first area and the first variable into a third data packet, and then pass the third data packet to the client. After the client receives the third data packet, it can display the text segment in the third data packet in the third display area based on the first variable in the third data packet.

[0133] In some embodiments of the present application, since the end of the text segment in the first area carries a second character, the second character may not be a separator prefix string, but a part of the third text content. Therefore, it is impossible to determine whether the third text content corresponding to the first variable has been processed, and further judgment is required in combination with the next text segment output by the first model.

[0134] In this way, since the text segment temporarily stored in the first area does not carry a separator and the first variable is greater than a preset value, the electronic device can first determine that the third text content corresponding to the first variable has not been processed, and then when the end of the text segment in the first area carries the second character, the electronic device can determine that the text segment in the first area may contain the ending content of any third text content, so the electronic device can first display the text segment before the second character in the corresponding display area, thereby improving the accuracy of the output results displayed by the electronic device.

[0135] In some embodiments of the present application, after the above step 402, the display method provided by the embodiment of the present application further includes the following steps 501 to 503.

[0136] Step 501: The electronic device deletes the text segment before the second character in the first area to obtain the second character.

[0137] It can be understood that the electronic device can delete the text segment in the first area that has been displayed in the first page, so that only unprocessed content is retained in the first area.

[0138] Step 502: When obtaining the fifth text segment output by the first model, the electronic device stores the fifth text segment in the first area.

[0139] In an embodiment of the present application, the fifth text segment is a text segment among the M text segments.

[0140] In some embodiments of the present application, the fifth text segment is a text segment newly output by the first model after the fourth text segment.

[0141] It should be noted that the detailed steps for the fifth text segment can refer to the description of the second text segment in the above embodiment, which will not be repeated here.

[0142] Step 503: The electronic device merges the second character in the first area with the fifth text segment, deletes the separator in the first area if the merged content contains a separator and the first variable is greater than a preset value, obtains the sixth text segment, and adjusts the first variable.

[0143] In an embodiment of the present application, the adjusted first variable is greater than a preset value.

[0144] In some embodiments of the present application, when the merged content includes a separator and the first variable is greater than a preset value, the electronic device can exclude the fifth text segment as the starting content of the first third text content, and determine the text segment before the second character as the ending content of the third text content corresponding to the first variable, that is, the electronic device can determine that the third text content corresponding to the first variable has been processed.

[0145] For example: when the second character is “#” and the fifth text segment is “*#Have a good rest”, the electronic device can obtain the merged content as “#*#Have a good rest”. When the merged content includes a separator and the first variable is greater than a preset value, the electronic device can determine that the third text content corresponding to the first variable has been processed.

[0146] In some embodiments of the present application, when it is determined that the third text content corresponding to the first variable has been processed, the electronic device can encapsulate the end mark and the first variable into a data packet and transmit it to the client. After receiving the data packet, the client can end the on-screen display of the third text content corresponding to the first variable based on the end mark and the first variable, and prepare for the next on-screen display of the third text content.

[0147] In some embodiments of the present application, when the merged content contains a separator and the first variable is greater than a preset value, the electronic device can delete the separator in the first area, obtain the sixth text segment, and adjust the first variable.

[0148] It can be understood that the electronic device can retain only the content to be processed in the next step in the first area by deleting the separator in the first area.

[0149] In some embodiments of the present application, since the electronic device determines that the third text content corresponding to the first variable has been processed, the electronic device can adjust the first variable to indicate that the next third text content to be processed is the next one through the adjusted first variable.

[0150] Exemplarily, the electronic device may increase the value of the first variable by one.

[0151] For example: when the first variable is 2, if the electronic device determines that the third text content corresponding to the first variable has been processed, that is, the second third text content has been processed, the electronic device can add one to the value of the first variable, so that the first variable is 3, indicating that the electronic device is processing the third third text content.

[0152] In this way, after the electronic device displays the text segment before the second character in the corresponding display area, the electronic device can delete the processed content and only retain the second character in the first area, and then store the newly acquired text segment in the first area. When it is further determined that the first area contains a separator, the electronic device can determine that the current third text content has been processed and then process the new third text content, thereby improving the accuracy of the electronic device in processing the output content of the first model.

[0153] It should be noted that after executing step 503, the electronic device may continue to execute the following step 602, which will not be described in detail here.

[0154] In some embodiments of the present application, after the electronic device stores the fourth text segment in the first area, if the text segment in the first area does not carry a separator and the first variable is equal to a preset value, the electronic device can determine that the electronic device has not yet started processing the third text content, and then the electronic device can continue to obtain the text segment output by the first model.

[0155] Exemplarily, the text segment in the first area may be a separator prefix string.

[0156] For example, the fourth text segment can be “#*” or “#”.

[0157] In some embodiments of the present application, the second text content includes M text segments and separators corresponding to the third text content, where M is an integer greater than 1; Figure 1 ,like Figure 5 As shown, the above step 203 can be specifically implemented through the following steps 601 and 602.

[0158] Step 601: When obtaining a first text segment output by a first model, the electronic device stores the first text segment in a first area.

[0159] In an embodiment of the present application, the first text segment is a text segment among M text segments.

[0160] It should be noted that, for the detailed steps of the first text segment, reference may be made to the description of the second text segment in the above embodiment, and no further details will be given here.

[0161] Step 602: When the text segment in the first area does not carry a separator and the first variable is greater than a preset value, if the end of the text segment in the first area does not carry a first character, the electronic device displays the text segment in the first area in the first display area of ​​the first page.

[0162] In an embodiment of the present application, the above-mentioned first variable is used to indicate the serial number of the third text content being processed by the electronic device, the first character includes a separator prefix string, and the first display area is used to display the third text content corresponding to the first variable.

[0163] In some embodiments of the present application, when the separator is “#*#”, the first character may be any one of the following: “#”, “#*”.

[0164] It should be noted that, for the detailed steps of the first display area, reference may be made to the description of the second display area in the above embodiment, and will not be repeated here.

[0165] It should be noted that, referring to the description in the above step 402, when the text segment in the first area does not carry a separator and the first variable is greater than a preset value, the electronic device can determine that the text segment in the first area includes any of the following items: the middle content of any third text content (for example, "safety"), the ending content of any third text content (for example, "have a good rest#"), and the starting content of a third text content other than the first third text content (for example, "*#have a good rest");

[0166] The electronic device can then further determine whether the end of the text segment in the first area carries the first character. If the end of the text segment in the first area does not carry the first character, the electronic device can determine that the text segment in the first area may contain the middle content of any third text content, and thus the electronic device can display the text segment in the first area in the first display area.

[0167] In some embodiments of the present application, the server of the electronic device can store the first text segment output by the first model in the first area, and when it is determined that the text segment in the first area does not carry a separator, the first variable is greater than a preset value, and the end of the text segment in the first area does not carry a first character, the server of the electronic device can pass the text segment in the first area to the client, and the client of the electronic device can display the received text segment in the first display area.

[0168] Specifically, the server of the electronic device can encapsulate the text segment and the first variable in the first area into a fourth data packet, and then pass the fourth data packet to the client. After the client receives the fourth data packet, it can display the text segment in the fourth data packet in the first display area based on the first variable in the fourth data packet.

[0169] In this way, since the text segment temporarily stored in the first area does not carry a separator and the first variable is greater than a preset value, the electronic device can first determine that the third text content corresponding to the first variable has not been processed, and then when the end of the text segment in the first area does not carry the second character, the electronic device can determine that the text segment in the first area may contain the middle content of any third text content, so the electronic device can display the text segment in the first area in the corresponding display area, thereby improving the accuracy of the output results displayed by the electronic device.

[0170] In some embodiments of the present application, after the electronic device displays the text segment in the first area in the first display area of ​​the first page, the electronic device may delete the text segment in the first area in order to receive and process the text segment newly output by the first model.

[0171] In some embodiments of the present application, before the above step 602, the display method provided by the embodiment of the present application also includes the following steps 701 and 702.

[0172] Step 701: When a text segment in a first area carries a separator and a first variable is equal to a preset value, the electronic device determines that the first text segment is the first text segment among M text segments.

[0173] In some embodiments of the present application, determining that the first text segment is the first text segment among the M text segments may also be understood as: determining that the first text segment includes the starting content of the first third text content.

[0174] It should be noted that, referring to the description in the above step 302, when the text segment in the first area carries a separator, the electronic device may determine that the text segment in the first area includes at least one of the following: the starting content of any third text content, the ending content of any third text content;

[0175] The electronic device can then further determine whether the first variable is greater than a preset value. When the first variable is equal to the preset value, the electronic device can determine that the electronic device has not yet started processing the third text content, so the electronic device can determine that the first text segment is the first text segment among the M text segments.

[0176] Step 702: The electronic device deletes the separator in the first area and adjusts the first variable.

[0177] In an embodiment of the present application, the adjusted first variable is greater than a preset value.

[0178] In some embodiments of the present application, the electronic device may extract the content after the separator in the first area, and then after clearing the first area, store the extracted content after the separator in the first area. It is understandable that only the content to be processed in the next step can be retained through this step.

[0179] In some embodiments of the present application, since the electronic device starts to process the first text segment, the electronic device may adjust the first variable to indicate the sequence number of the third text content being processed through the adjusted first variable.

[0180] Exemplarily, the electronic device may increase the value of the first variable by one.

[0181] For example, when the first variable has an initial value of 0, the electronic device may add one to the value of the first variable so that the first variable is 1, indicating that the electronic device is processing the first third text content.

[0182] In this way, when it is determined that the text segment temporarily stored in the first area is the first text segment output by the first model, the electronic device can only retain the content after the separator in the first area, and increase the value of the first variable by one, and then when the text segment in the first area does not carry a separator and the first variable is greater than a preset value, the electronic device can first determine that the third text content corresponding to the first variable has not been processed, and then when the end of the text segment in the first area does not carry a second character, the electronic device can display the text segment in the first area in the corresponding display area, thereby improving the accuracy of the electronic device displaying the output results.

[0183] It should be noted that after the electronic device completes step 702 , the electronic device may execute the above step 602 .

[0184] In some embodiments of the present application, when an electronic device obtains a data packet encapsulated with a text segment output by a first model, it can determine whether the data packet is an end packet. When the data packet is an end packet, the electronic device can determine that the output of the first model ends. When the data packet is a normal packet, the electronic device parses the data packet.

[0185] In some embodiments of the present application, when determining that the output of the first model is completed, the server of the electronic device can notify the client that all the third text content has been generated.

[0186] Specifically, the server of the electronic device can create an end mark and encapsulate the end mark into a data packet and transmit it to the client. The end mark is used to notify the client to end the current third text content display. After passing the data packet encapsulated with the end mark to the client, the server can end the processing of the entire request.

[0187] In some embodiments of the present application, when the above-mentioned first page is a chat page, the electronic device can receive the user's input of any third text content and send any third text content in the chat page.

[0188] In some examples, when the electronic device receives user input for any third text content, it can display the any third text content in a text input box in the first page, and then send any third text content in the chat page when receiving user input for a send control.

[0189] Exemplarily, when the electronic device displays any third text content in the text input box in the first page, the electronic device can receive the user's input, edit the third text content in the text input box, and then send the edited third text content in the chat page when receiving the user's input to the send control.

[0190] In some embodiments of the present application, when the first page is a search page, the electronic device may receive a user input of any third text content and search for the any third text content.

[0191] In some examples, when the electronic device receives user input for any third text content, it can display the any third text content in a text input box in the first page, and then search for any third text content when receiving user input for a search control.

[0192] Exemplarily, when the electronic device displays any third text content in the text input box in the first page, the electronic device can receive the user's input, edit the third text content in the text input box, and then search for the edited third text content when receiving the user's input to the search control.

[0193] In some embodiments of the present application, Figure 6 As shown, the display method provided in the embodiment of the present application may include the following steps S1 to S16.

[0194] S1. The electronic device obtains first text content displayed on a first page.

[0195] S2. The electronic device calls the first model and inputs the first text content into the first model.

[0196] S3. The electronic device initializes a buffer buffer and initializes the first variable to 0.

[0197] S4. The electronic device receives the data packet streamed output by the first model.

[0198] S5. The electronic device determines whether the output of the first model is completed.

[0199] When the first model output is not completed, the electronic device may execute S6 and S8; when the first model output is completed, the electronic device may execute S7;

[0200] S6. The electronic device parses the data packet and stores the content in the data packet into a buffer.

[0201] S7. The server of the electronic device returns an end mark to the client.

[0202] S8. The electronic device determines whether there is a delimiter in the buffer.

[0203] When there is a delimiter in the buffer, the electronic device executes S9-S12; when there is no delimiter in the buffer, the electronic device executes S13;

[0204] S9. The electronic device determines whether the first variable is greater than 0.

[0205] When the first variable is greater than 0, the electronic device executes S10; when the first variable is equal to 0, the electronic device executes S12;

[0206] S10. The electronic device extracts the content before the separator, and displays the extracted content on the screen.

[0207] S11. The electronic device determines that processing of a current third text content is completed.

[0208] S12: The electronic device refreshes the content after the delimiter into the buffer, and increases the first variable by one.

[0209] After the electronic device executes S12, it executes S8;

[0210] S13. The electronic device determines whether the first variable is greater than 0.

[0211] When the first variable is greater than 0, the electronic device executes S14; when the first variable is equal to 0, the electronic device executes S4;

[0212] S14. The electronic device determines whether there is a separator prefix character string in the buffer.

[0213] When the delimiter prefix string exists in the buffer, the electronic device executes S15; when the delimiter prefix string does not exist in the buffer, the electronic device executes S16;

[0214] S15. The electronic device displays the content before the separator prefix character string on the screen, and refreshes the content after the separator prefix character string to the buffer.

[0215] After executing S15, the electronic device may execute S4;

[0216] S16. The electronic device displays the content in the buffer on the screen and clears the buffer.

[0217] After executing S16, the electronic device may execute S4.

[0218] It should be noted that for the relevant description of step S1 to step S16, reference can be made to the contents of the above embodiment, which will not be repeated here.

[0219] For example, assume that the second text content generated by the first model is: "#*#Come on, let's play together in a group of five#*#Go online, add me#*#Come on, guys, let's play". When the first model streams out text segment 1 as "#*#Come on", the electronic device can store text segment 1 in the buffer (i.e., the above-mentioned first area). At this time, the first variable is still the initial value 0. Therefore, when the electronic device determines that the buffer contains a delimiter and the first variable is equal to the preset value, the electronic device can determine that text segment 1 is the first text segment output by the first model. Then the electronic device can delete the delimiter in the buffer, so that only the content to be processed "Come on" remains in the buffer, and adjust the first variable from 0 to 1, indicating that the electronic device is processing the first third text content; then when the electronic device detects that the text segment in the buffer does not carry a delimiter and the first variable is greater than 0, the electronic device can determine whether the end of the text segment in the buffer carries a delimiter prefix string. When the end of the text segment in the buffer does not carry a delimiter prefix string, combined with Figure 2 , as shown in FIG. 7(A), the electronic device can display the text segment "Come on" in the buffer in the display area 21 (i.e., the display area for displaying the first third text content corresponding to variable 1) on the group chat page 11; then, the electronic device can clear the buffer and then continue to receive the content output by the first model;

[0220] When the first model streams out text segment 2 as ", let's play together", the electronic device can store text segment 2 in the buffer. At this time, the first variable is 1. Therefore, when the electronic device determines that the buffer does not contain a delimiter and the first variable is greater than the preset value, the electronic device can determine whether the end of the text segment in the buffer carries a delimiter prefix string. When the end of the text segment in the buffer does not carry a delimiter prefix string, as shown in FIG. 7(B), the electronic device can display the text segment ", let's play together" in the first area in the display area 21 on the group chat page 11; then, the electronic device can clear the buffer and then continue to receive the content output by the first model;

[0221] When the first model streams out text segment 3 as "in a group of five#*#Go online", the electronic device can store text segment 3 in the buffer. At this time, the first variable is 1. Therefore, when the electronic device determines that the buffer contains a delimiter and the first variable is greater than the preset value, the electronic device can determine that text segment 3 contains the ending content of the current third text content; as shown in FIG. 7(C), the electronic device can display the text segment "in a group of five" before the delimiter in the display area 21 of the chat page 11; then, the electronic device can only retain the text segment "Go online" after the delimiter in the buffer, and adjust the first variable from 1 to 2, indicating that the electronic device is processing the second third text content;

[0222] Also, as shown in FIG. 7(D), the electronic device may display "..." in the display area 31 (i.e., the display area for displaying the second third text content corresponding to variable 2), indicating that the generation of the first third text content has ended and the generation of the second third text content is in progress;

[0223] Then, when the electronic device detects that the text segment "go online" in the buffer does not carry a delimiter and the first variable is greater than 0, the electronic device may determine whether the end of the text segment in the buffer carries a delimiter prefix string. When the end of the text segment in the buffer does not carry a delimiter prefix string, as shown in FIG. 7(E), the electronic device may display the text segment "go online" in the first area in the display area 31 on the group chat page 11; then, the electronic device may clear the buffer and then continue to receive the content output by the first model;... It should be noted that for the processing steps of the text segment 4 "bar," and the text segment 5 "add me" output by the first model in a streaming manner, reference may be made to the description of the text segment 2 ", together", which will not be elaborated here;

[0224] Then, when the first model streams out the text segment 6 as "a #", the electronic device may store the text segment 6 in the buffer. At this time, the first variable is 2. Therefore, when the electronic device determines that the buffer does not contain a delimiter and the first variable is greater than a preset value, the electronic device may determine whether the end of the text segment in the buffer carries a delimiter prefix string. When the end of the text segment in the buffer carries a delimiter prefix string, as shown in FIG. 7(F), the electronic device may display the text segment "a" before the delimiter prefix string in the display area 31 on the group chat page 11; then, the electronic device may clear the text segment before the delimiter prefix string in the buffer and only retain "#" in the buffer; then continue to receive the content output by the first model;

[0225] When the first model streams out the text segment 7 as "*#come", the electronic device may store the text segment 7 in the buffer. At this time, the first variable is 2, and the buffer contains "#*#come". The electronic device may delete the delimiter in the buffer and only retain "come" in the buffer; and adjust the first variable from 2 to 3, indicating that the electronic device is processing the third third text content;

[0226] As shown in FIG. 7(G), the electronic device may display "..." in the display area 41 (i.e., the display area for displaying the third third text content corresponding to variable 3), indicating that the generation of the second third text content has ended and the generation of the third third text content is in progress;

[0227] Then, when the electronic device detects that the text segment in the buffer does not carry a separator and the first variable is greater than 0, the electronic device can determine whether the end of the text segment in the buffer carries a separator prefix string. When the end of the text segment in the buffer does not carry a separator prefix string, as shown in Figure 7 (H), the electronic device can display the text segment "Come" in the buffer in the display area 41 in the group chat page 11; then, the electronic device can clear the buffer and then continue to receive the content output by the first model; it should be noted that, for the processing steps of the text segment 8 ", brothers" and the text segment 9 "Play together" streamed output by the first model, please refer to the above description of the text segment 2 ", together", which will not be repeated here; finally, when the electronic device receives the end data packet output by the first model, the electronic device determines that the output of the first model is completed, and the electronic device ends the display on the group chat page 11.

[0228] In the embodiment of the present application, in the related art, the large model (i.e., the first model mentioned above) needs to fully analyze and understand the context of the input after receiving the input, including parsing the input text, establishing the initial internal state and attention mechanism, etc. This process needs to consume certain computing resources and time, so the first word generation of the large model streaming data is often time-consuming. The display method provided by the embodiment of the present application can significantly improve the real-time performance of the data packet processing of the model streaming output and reduce the delay of data processing. The time consumption for the first word generated by the result has been significantly reduced. If the time consumption of the first word of the single call large model is m, then the time consumption of the first word of the original call n large model to generate n results is n*m, and the display method provided by the embodiment of the present application can reduce the time consumption of the first word from n*m to m.

[0229] In the embodiments of the present application, in the related art, the computing and storage requirements of the large model are very high. In the case of multiple calls, each call consumes a large amount of computing resources and memory. This places high demands on the hardware of the system, resulting in increased operating costs. In order to address this problem, it may be necessary to optimize the computing efficiency of the model or adopt a more efficient hardware solution, but this will also bring additional technical challenges and economic burdens. The display method provided in the embodiment of the present application, for the large model server, simplifies multiple calls into one call, and can also significantly reduce the consumption of computing resources and memory at the same time, saving the cost of generating large model content.

[0230] In the embodiments of the present application, in the related art, when the generated results are shorter, calling the large model multiple times for the same input may result in duplicate results. Since the information density is higher in shorter texts, the large model tends to choose direct and most relevant words to express the output content. In this case, the model may choose the same high-probability word combination, resulting in duplicate results. In addition, when the large model is called multiple times, due to limited context information and no correlation between results, the large model cannot fully utilize context changes to generate diverse content, and the model's selection space is relatively small. Although the repeatability of the results can be reduced to a certain extent by adjusting temperature parameters, sampling strategies, and introducing randomness, this may also affect the output effect. The display method provided in the embodiment of the present application, since in the case of a single call to the large model, the multiple results of the large model are themselves in the same context, the token prediction of the large model can avoid outputting duplicate results, thereby solving the problem of duplicate results generated when the large model is called multiple times.

[0231] It should be noted that the display method provided in this application is not only applicable to scenarios where content is generated by large language models, but can also be applied to streaming output scenarios such as large speech models and multimodal models to achieve real-time parsing and processing of data packets.

[0232] It should be noted that the above-mentioned method embodiments, or various possible implementation methods in each method embodiment, can be executed separately, or, under the premise that there is no contradiction, can also be executed in combination with each other. The specific implementation can be determined according to actual usage requirements, and the embodiments of the present application do not limit this.

[0233] It should be noted that the display method provided in the embodiment of the present application can be executed by a display device. In the embodiment of the present application, the display device provided in the embodiment of the present application is described by taking the display device executing the touch screen data adjustment method as an example.

[0234] Figure 8 FIG. 1 shows a possible structural diagram of a display device involved in an embodiment of the present application. Figure 8 As shown, the display device 70 may include: an acquisition module 71 and a processing module 72 .

[0235] The acquisition module 71 is used to acquire the first text content displayed on the first page;

[0236] A processing module 72, configured to input the first text content acquired by the acquisition module 71 into a first model;

[0237] The acquisition module 71 is further used to acquire second text content output by the first model based on the first text content, where the second text content includes at least two separators;

[0238] The processing module 72 is further used to determine at least two third text contents from the second text content based on the at least two separators obtained by the obtaining module 71; and display at least two third text contents in the first page; wherein the third text content matches the first text content.

[0239] An embodiment of the present application provides a display device. Since the second text content output by the first model can be separated by a separator, the display device can obtain at least two third text contents matching the first text content by calling the first model once, thereby avoiding the consumption of display device resources caused by multiple calls to the first model, thereby reducing the resource consumption of the display device.

[0240] In one possible implementation, the second text content includes M text segments and a separator corresponding to the third text content, where M is an integer greater than 1; the processing module 72 is specifically used to store the first text segment in the first area when the first text segment output by the first model is obtained, and the first text segment is a text segment among the M text segments; and when the text segment in the first area does not carry a separator and the first variable is greater than a preset value, if the end of the text segment in the first area does not carry a first character, then the text segment in the first area is displayed in the first display area of ​​the first page; wherein the first variable is used to indicate the serial number of the third text content being processed by the electronic device, the first character includes a separator prefix string, and the first display area is used to display the third text content corresponding to the first variable.

[0241] In one possible implementation, the processing module 72 is also used to, when the text segment in the first area does not carry a separator and the first variable is greater than a preset value, if the text segment in the first area does not carry a first character, then before displaying the text segment in the first area in the first display area of ​​the first page, when the text segment in the first area carries a separator and the first variable is equal to a preset value, determine that the first text segment is the first text segment among M text segments; and delete the separator in the first area and adjust the first variable, so that the adjusted first variable is greater than the preset value.

[0242] In one possible implementation, the second text content includes M text segments and a separator corresponding to the third text content, where M is an integer greater than 1; the processing module 72 is specifically used to store the second text segment in the first area when the second text segment output by the first model is obtained, and the second text segment is a text segment among the M text segments; and when the text segment in the first area carries a separator, if the first variable is greater than a preset value, the text segment before the separator in the first area is displayed in the second display area of ​​the first page; wherein the first variable is used to indicate the serial number of the third text content being processed by the electronic device, and the second display area is used to display the third text content corresponding to the first variable.

[0243] In one possible implementation, the processing module 72 is also used to delete the text segment before the separator in the first area and the separator after displaying the text segment before the separator in the first area in the second display area of ​​the first page, to obtain a third text segment, and to adjust the first variable, and the adjusted first variable is greater than a preset value.

[0244] In one possible implementation, the second text content includes M text segments and a separator corresponding to the third text content, where M is an integer greater than 1; the processing module 72 is specifically used to store the fourth text segment in the first area when obtaining the fourth text segment output by the first model, and the fourth text segment is a text segment among the M text segments; and when the text segment in the first area does not carry a separator and the first variable is greater than a preset value, if the end of the text segment in the first area carries a second character, then the text segment before the second character is displayed in the third display area of ​​the first page; wherein the first variable is used to indicate the serial number of the third text content being processed by the electronic device, the second character includes a separator prefix string, and the third display area is used to display the third text content corresponding to the first variable.

[0245] In one possible implementation, the processing module 72 is also used to delete the text segment before the second character in the first area after the text segment before the second character is displayed in the third display area of ​​the first page to obtain the second character; and when obtaining the fifth text segment output by the first model, store the fifth text segment in the first area, the fifth text segment being a text segment among the M text segments; and merge the second character and the fifth text segment in the first area, and when the merged content contains a separator and the first variable is greater than a preset value, delete the separator in the first area to obtain a sixth text segment, and adjust the first variable, the adjusted first variable being greater than the preset value.

[0246] The display device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or it can be other devices other than the terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (Augmented Reality, AR) / virtual reality (Virtual Reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (Ultra-Mobile Personal Computer, UMPC), a netbook or a personal digital assistant (Personal Digital Assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (Personal Computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0247] The display device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0248] The display device provided in the embodiment of the present application can implement each process implemented in the above method embodiment, and will not be described again here to avoid repetition.

[0249] Alternatively, if Fig. 9 As shown, an embodiment of the present application also provides an electronic device 900, including a processor 901 and a memory 902, wherein the memory 902 stores programs or instructions that can be executed on the processor 901, and when the program or instructions are executed by the processor 901, the various steps of the above-mentioned method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, they are not described here.

[0250] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.

[0251] Fig.10 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.

[0252] The electronic device 100 includes but is not limited to components such as a radio frequency unit 101, a network module 102, an audio output unit 103, an input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, and a processor 110.

[0253] Those skilled in the art will appreciate that the electronic device 100 may also include a power source (such as a battery) for supplying power to various components, and the power source may be logically connected to the processor 110 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Fig.10 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.

[0254] Among them, the processor 110 is used to obtain the first text content displayed in the first page; and input the first text content into the first model, obtain the second text content output by the first model based on the first text content, and the second text content includes at least two separators; and based on the at least two separators, determine at least two third text contents from the second text content; and display at least two third text contents in the first page; wherein the third text content matches the first text content.

[0255] An embodiment of the present application provides an electronic device. Since the second text content output by the first model can be separated by a separator, the electronic device can obtain at least two third text contents matching the first text content by calling the first model once, thereby avoiding the consumption of electronic device resources caused by multiple calls to the first model, thereby reducing the resource consumption of the electronic device.

[0256] In some embodiments of the present application, the second text content includes M text segments and a separator corresponding to the third text content, where M is an integer greater than 1; the processor 110 is specifically used to store the first text segment in the first area when obtaining the first text segment output by the first model, and the first text segment is a text segment among the M text segments; and when the text segment in the first area does not carry a separator and the first variable is greater than a preset value, if the end of the text segment in the first area does not carry the first character, then the text segment in the first area is displayed in the first display area of ​​the first page; wherein the first variable is used to indicate the serial number of the third text content being processed by the electronic device, the first character includes a separator prefix string, and the first display area is used to display the third text content corresponding to the first variable.

[0257] In some embodiments of the present application, the processor 110 is also used to, when the text segment in the first area does not carry a separator and the first variable is greater than a preset value, if the text segment in the first area does not carry a first character, then before displaying the text segment in the first area in the first display area of ​​the first page, when the text segment in the first area carries a separator and the first variable is equal to a preset value, determine that the first text segment is the first text segment among M text segments; and delete the separator in the first area and adjust the first variable, so that the adjusted first variable is greater than the preset value.

[0258] In some embodiments of the present application, the second text content includes M text segments and a separator corresponding to the third text content, where M is an integer greater than 1; the processor 110 is specifically used to store the second text segment in the first area when obtaining the second text segment output by the first model, and the second text segment is a text segment among the M text segments; and when the text segment in the first area carries a separator, if the first variable is greater than a preset value, the text segment before the separator in the first area is displayed in the second display area of ​​the first page; wherein the first variable is used to indicate the serial number of the third text content being processed by the electronic device, and the second display area is used to display the third text content corresponding to the first variable.

[0259] In some embodiments of the present application, the processor 110 is also used to delete the text segment before the separator in the first area and the separator after displaying the text segment before the separator in the first area in the second display area of ​​the first page, obtain a third text segment, and adjust the first variable, and the adjusted first variable is greater than a preset value.

[0260] In some embodiments of the present application, the second text content includes M text segments and a separator corresponding to the third text content, where M is an integer greater than 1; the processor 110 is specifically used to store the fourth text segment in the first area when obtaining the fourth text segment output by the first model, and the fourth text segment is a text segment among the M text segments; and when the text segment in the first area does not carry a separator and the first variable is greater than a preset value, if the end of the text segment in the first area carries a second character, then the text segment before the second character is displayed in the third display area of ​​the first page; wherein the first variable is used to indicate the serial number of the third text content being processed by the electronic device, the second character includes a separator prefix string, and the third display area is used to display the third text content corresponding to the first variable.

[0261] In some embodiments of the present application, the processor 110 is also used to delete the text segment before the second character in the first area after displaying the text segment before the second character in the third display area of ​​the first page to obtain the second character; and when obtaining the fifth text segment output by the first model, store the fifth text segment in the first area, the fifth text segment being a text segment among the M text segments; and merge the second character and the fifth text segment in the first area, and when the merged content contains a separator and the first variable is greater than a preset value, delete the separator in the first area to obtain a sixth text segment, and adjust the first variable, the adjusted first variable being greater than the preset value.

[0262] The electronic device provided in the embodiment of the present application can implement each process implemented in the above method embodiment and can achieve the same technical effect. To avoid repetition, it will not be described here.

[0263] The beneficial effects of various implementations in this embodiment can be specifically referred to the beneficial effects of the corresponding implementations in the above method embodiment. To avoid repetition, they will not be described again here.

[0264] It should be understood that in the embodiment of the present application, the input unit 104 may include a graphics processor (Graphics Processing Unit, GPU) 1041 and a microphone 1042, and the graphics processor 1041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 106 may include a display panel 1061, and the display panel 1061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 107 includes a touch panel 1071 and at least one of other input devices 1072. The touch panel 1071 is also called a touch screen. The touch panel 1071 may include two parts: a touch detection device and a touch controller. Other input devices 1072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.

[0265] The memory 109 can be used to store software programs and various data. The memory 109 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 109 may include a volatile memory or a non-volatile memory, or the memory 109 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 109 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.

[0266] The processor 110 may include one or more processing units; optionally, the processor 110 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 110.

[0267] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0268] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0269] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0270] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0271] An embodiment of the present application provides a computer program / program product, which is stored in a storage medium. The program / program product is executed by at least one processor to implement the various processes of the above-mentioned method embodiment and can achieve the same technical effect. To avoid repetition, it will not be described here.

[0272] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0273] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0274] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A display method, characterized in that: The method comprises: Get the first text content displayed on the first page; Inputting the first text content into a first model, obtaining second text content output by the first model based on the first text content, wherein the second text content includes at least two separators; Based on at least two of the separators, determining at least two third text contents from the second text contents, and displaying at least two of the third text contents on the first page; The third text content matches the first text content.

2. The method according to claim 1, characterized in that The second text content includes M text segments and separators corresponding to the third text content, where M is an integer greater than 1; The determining at least two third text contents from the second text contents based on at least two separators, and displaying at least two third text contents on the first page, comprises: In the case of obtaining a first text segment output by the first model, storing the first text segment in a first area, wherein the first text segment is a text segment among the M text segments; In the case where the text segment in the first area does not carry a separator and the first variable is greater than a preset value, if the end of the text segment in the first area does not carry a first character, displaying the text segment in the first area in the first display area of ​​the first page; The first variable is used to indicate the serial number of the third text content being processed by the electronic device, the first character includes a separator prefix string, and the first display area is used to display the third text content corresponding to the first variable.

3. The method according to claim 2, characterized in that In the case where the text segment in the first area does not carry a separator and the first variable is greater than a preset value, if the text segment in the first area does not carry a first character, before displaying the text segment in the first area in the first display area of ​​the first page, the method further includes: In a case where the text segment in the first region carries a separator and the first variable is equal to the preset value, determining that the first text segment is the first text segment among the M text segments; The separator in the first area is deleted, and the first variable is adjusted, and the adjusted first variable is greater than the preset value.

4. The method according to claim 1, characterized in that The second text content includes M text segments and separators corresponding to the third text content, where M is an integer greater than 1; and determining at least two third text contents from the second text content based on at least two of the separators, and displaying at least two third text contents on the first page, comprises: In the case of obtaining a second text segment output by the first model, storing the second text segment in the first area, the second text segment being a text segment among the M text segments; In the case where the text segment in the first area carries a separator, if the first variable is greater than a preset value, the text segment before the separator in the first area is displayed in the second display area of ​​the first page; The first variable is used to indicate the serial number of the third text content being processed by the electronic device, and the second display area is used to display the third text content corresponding to the first variable.

5. The method according to claim 4, characterized in that After displaying the text segment before the separator in the first area in the second display area of ​​the first page, the method further includes: The text segment before the delimiter in the first area and the delimiter are deleted to obtain a third text segment, and the first variable is adjusted, and the adjusted first variable is greater than the preset value.

6. The method according to claim 1, characterized in that The second text content includes M text segments and separators corresponding to the third text content, where M is an integer greater than 1; and determining at least two third text contents from the second text content based on at least two of the separators, and displaying at least two third text contents on the first page, comprises: When a fourth text segment output by the first model is obtained, the fourth text segment is stored in the first area, wherein the fourth text segment is a text segment among the M text segments; In the case where the text segment in the first area does not carry a separator and the first variable is greater than a preset value, if the end of the text segment in the first area carries a second character, the text segment before the second character is displayed in the third display area of ​​the first page; The first variable is used to indicate the serial number of the third text content being processed by the electronic device, the second character includes a separator prefix string, and the third display area is used to display the third text content corresponding to the first variable.

7. The method according to claim 6, characterized in that After displaying the text segment before the second character in the third display area of ​​the first page, the method further includes: Deleting the text segment before the second character in the first area to obtain the second character; When a fifth text segment output by the first model is obtained, the fifth text segment is stored in the first region, wherein the fifth text segment is one of the M text segments; The second character in the first area and the fifth text segment are merged. If the merged content contains a separator and the first variable is greater than the preset value, the separator in the first area is deleted to obtain the sixth text segment, and the first variable is adjusted. The adjusted first variable is greater than the preset value.

8. A display device, characterized in that: The device comprises: an acquisition module and a processing module; The acquisition module is used to acquire the first text content displayed on the first page; The processing module is used to input the first text content acquired by the acquisition module into a first model; The acquisition module is further used to acquire second text content output by the first model based on the first text content, wherein the second text content includes at least two separators; The processing module is further configured to determine at least two third text contents from the second text content based on the at least two separators acquired by the acquisition module; and display at least two third text contents on the first page; The third text content matches the first text content.

9. The device according to claim 8, characterized in that The second text content includes M text segments and separators corresponding to the third text content, where M is an integer greater than 1; The processing module is specifically configured to, when obtaining a first text segment output by the first model, store the first text segment in a first area, wherein the first text segment is a text segment among the M text segments; and when the text segment in the first area does not carry a separator and the first variable is greater than a preset value, if the end of the text segment in the first area does not carry a first character, display the text segment in the first area in a first display area of ​​the first page; The first variable is used to indicate the serial number of the third text content being processed by the electronic device, the first character includes a separator prefix string, and the first display area is used to display the third text content corresponding to the first variable.

10. The device according to claim 9, characterized in that The processing module is also used for, when the text segment in the first area does not carry a separator and the first variable is greater than a preset value, if the text segment in the first area does not carry a first character, then before displaying the text segment in the first display area of ​​the first page, when the text segment in the first area carries a separator and the first variable is equal to the preset value, determining that the first text segment is the first text segment among the M text segments; and deleting the separator in the first area and adjusting the first variable, so that the adjusted first variable is greater than the preset value.

11. The device according to claim 8, characterized in that The second text content includes M text segments and separators corresponding to the third text content, where M is an integer greater than 1; The processing module is specifically configured to, when obtaining a second text segment output by the first model, store the second text segment in the first area, where the second text segment is a text segment among the M text segments; and when the text segment in the first area carries a separator, if the first variable is greater than a preset value, display the text segment before the separator in the first area in the second display area of ​​the first page; The first variable is used to indicate the serial number of the third text content being processed by the electronic device, and the second display area is used to display the third text content corresponding to the first variable.

12. The device according to claim 11, characterized in that The processing module is also used to delete the text segment before the separator in the first area and the separator after displaying the text segment before the separator in the first area in the second display area of ​​the first page, obtain a third text segment, and adjust the first variable, and the adjusted first variable is greater than the preset value.

13. The device according to claim 8, characterized in that The second text content includes M text segments and separators corresponding to the third text content, where M is an integer greater than 1; The processing module is specifically configured to, when a fourth text segment output by the first model is obtained, store the fourth text segment in the first area, wherein the fourth text segment is a text segment among the M text segments; and when the text segment in the first area does not carry a separator and the first variable is greater than a preset value, if the end of the text segment in the first area carries a second character, display the text segment before the second character in the third display area of ​​the first page; The first variable is used to indicate the serial number of the third text content being processed by the electronic device, the second character includes a separator prefix string, and the third display area is used to display the third text content corresponding to the first variable.

14. The device according to claim 13, characterized in that The processing module is also used to delete the text segment before the second character in the first area after displaying the text segment before the second character in the third display area of ​​the first page to obtain the second character; and when obtaining the fifth text segment output by the first model, store the fifth text segment in the first area, the fifth text segment being a text segment among the M text segments; and merge the second character and the fifth text segment in the first area, and when the merged content contains a separator and the first variable is greater than the preset value, delete the separator in the first area to obtain a sixth text segment, and adjust the first variable, the adjusted first variable being greater than the preset value.

15. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the display method according to any one of claims 1 to 7 are implemented.

16. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the steps of the display method according to any one of claims 1 to 7 are implemented.

17. A computer program product, characterized in that The computer program product is stored in a storage medium, and the program product is executed by at least one processor to implement the steps of the display method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Display method and apparatus therefor

    WO2026098324A1