Interaction method and device, electronic equipment, storage medium and program product
By establishing a virtual coordinate system for position mapping, the problem of not being able to accurately locate selected content is solved, the toolbar is accurately displayed and the user experience is improved.
Patent Information
- Application Number
- CN202411997695.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-18
AI Technical Summary
In some content editing scenarios, such as digital live broadcast scenarios, it is impossible to accurately locate the fine location of the selected content, resulting in the inability to accurately locate the display area of the toolbar, reducing the user experience.
By establishing a virtual coordinate system based on editable content, performing position mapping, determining the position of the selected content under the virtual coordinate system, thereby accurately determining the display position of the toolbar.
It realizes the accurate display of the toolbar, improving the operation efficiency and experience of users when editing content.
Smart Images

Figure CN119849451A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, in particular to the field of human-computer interaction, NLP (Natural Language Processing) and intelligent generation technology, and specifically to an interaction method, device, electronic device, storage medium and program product. Background Art
[0002] With the continuous progress and innovation of information technology, intelligent editing tools use artificial intelligence technology to create content. With its high efficiency, convenience and intelligence, it can significantly improve editing efficiency and editing quality, making editing work easy and accurate. However, there is still room for improvement in further improving its intelligence. Summary of the invention
[0003] The present disclosure provides an interaction method, an apparatus, an electronic device, a storage medium, and a program product.
[0004] According to one aspect of the present disclosure, an interaction method is provided, comprising: in response to a selection instruction for selecting content from editable content, determining a first reference position of the selected content in the editable content; based on a position mapping relationship, position mapping the first reference position to obtain a second reference position of the selected content in a virtual coordinate system, wherein the virtual coordinate system is established based on a content area of the editable content; based on the second reference position of the selected content, determining a display position of a toolbar in the virtual coordinate system, wherein the toolbar includes functional controls for assisting in editing the selected content; and displaying the toolbar based on the display position.
[0005] According to another aspect of the present disclosure, an interactive device is provided, including: a first determination module, for determining a first reference position of the selected content in the editable content in response to a selection instruction for selecting content from the editable content; a mapping module, for mapping the first reference position based on a position mapping relationship to obtain a second reference position of the selected content in a virtual coordinate system, wherein the virtual coordinate system is established based on a content area of the editable content; a second determination module, for determining a display position of a toolbar in the virtual coordinate system based on the second reference position of the selected content, wherein the toolbar includes a functional control for assisting in editing the selected content; and a display module, for displaying the toolbar based on the display position.
[0006] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute a method as disclosed in the present disclosure.
[0007] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause a computer to execute the method of the present disclosure.
[0008] According to another aspect of the present disclosure, a computer program product is provided, comprising a computer program, and when the computer program is executed by a processor, the method of the present disclosure is implemented.
[0009] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0011] Figure 1 An exemplary system architecture to which the interactive method and device according to an embodiment of the present disclosure can be applied is schematically shown;
[0012] Figure 2 A flowchart of an interaction method according to an embodiment of the present disclosure is schematically shown;
[0013] Figure 3 A schematic diagram schematically shows a schematic diagram of establishing a virtual coordinate system based on a content area of editable content according to an embodiment of the present disclosure;
[0014] Figure 4 The effect diagram of the toolbar display according to the embodiment of the present disclosure is schematically shown;
[0015] Figure 5 A diagram schematically shows the effect of displaying a toolbar after updating the reference position according to an embodiment of the present disclosure;
[0016] Figure 6 A diagram schematically shows the effect of the toolbar display after the setting method between the toolbar and the selected content is updated according to an embodiment of the present disclosure;
[0017] Figure 7 A block diagram schematically shows an interaction device according to another embodiment of the present disclosure; and
[0018] Figure 8 A block diagram of an electronic device suitable for implementing an interaction method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0019] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0020] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision, disclosure and application of user personal information involved comply with the provisions of relevant laws and regulations, take necessary confidentiality measures, and do not violate public order and good morals.
[0021] In the technical solution of the present disclosure, the user's authorization or consent is obtained before obtaining or collecting the user's personal information.
[0022] In some content editing scenarios, for example, in digital live broadcast scenarios, when calling the toolbar to edit the broadcast script in the input box, since only the character position of the selected content in the input box can be determined, such as the content position of the start character and the end character of the selected content in the broadcast script, the coordinate position of the selected content cannot be determined, such as the fine position of the selected content in the input box. Therefore, the display area of the toolbar determined based on the selected content in the input box cannot be accurately located, which reduces the user experience.
[0023] An embodiment of the present disclosure provides an interaction method, comprising: in response to a selection instruction for selecting content from editable content, determining a first reference position of the selected content in the editable content; based on a position mapping relationship, position mapping the first reference position to obtain a second reference position of the selected content in a virtual coordinate system, wherein the virtual coordinate system is established based on a content area of the editable content; based on the second reference position of the selected content, determining a display position of a toolbar in the virtual coordinate system, wherein the toolbar includes functional controls for assisting in editing the selected content; and displaying the toolbar based on the display position.
[0024] According to an embodiment of the present disclosure, by performing coordinate transformation on the first reference position of the selected content, a second reference position in a virtual coordinate system is obtained. Since the virtual coordinate system is established based on the editable content, the display position of the toolbar can be accurately determined based on the coordinate position in the virtual coordinate system. This enables the user to edit the selected content conveniently and quickly through the toolbar, thereby improving the user experience.
[0025] Figure 1 An exemplary system architecture to which the interaction method and device according to an embodiment of the present disclosure can be applied is schematically shown.
[0026] It should be noted that Figure 1 The examples shown are only examples of system architectures to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but do not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios. For example, in another embodiment, the exemplary system architecture to which the interactive method and apparatus can be applied may include a terminal device, but the terminal device may implement the interactive method and apparatus provided by the embodiments of the present disclosure without interacting with the server.
[0027] like Figure 1 As shown, the system architecture 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.
[0028] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, 103, such as knowledge reading applications, web browser applications, search applications, instant messaging tools, email clients and / or social platform software, etc. (only as examples).
[0029] The terminal devices 101 , 102 , and 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.
[0030] The server 105 may be a server that provides various services, such as a background management server (only an example) that provides support for the content browsed by the user using the terminal devices 101, 102, and 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to the user request) to the terminal device.
[0031] It should be noted that the interaction method provided in the embodiment of the present disclosure can generally be executed by the terminal device 101, 102, or 103. Accordingly, the interaction device provided in the embodiment of the present disclosure can also be set in the terminal device 101, 102, or 103.
[0032] Alternatively, the interactive method provided in the embodiment of the present disclosure may also be generally executed by the server 105. Accordingly, the interactive device provided in the embodiment of the present disclosure may generally be arranged in the server 105. The interactive method provided in the embodiment of the present disclosure may also be executed by a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105. Accordingly, the interactive device provided in the embodiment of the present disclosure may also be arranged in a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105.
[0033] For example, when a user selects content in the editable content, the terminal devices 101, 102, and 103 can obtain the selected content, and then send the selected content to the server 105, and the server 105 analyzes the selected content to determine the first reference position of the selected content; determines the second reference position of the selected content in the virtual coordinate system based on the first reference position; and determines the display position of the toolbar in the virtual coordinate system based on the second reference position of the selected content. Alternatively, a server or server cluster that can communicate with the terminal devices 101, 102, 103 and / or the server 105 analyzes the selected content and finally determines the display position of the toolbar in the virtual coordinate system.
[0034] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0035] It should be noted that the sequence numbers of the operations in the following method are only used as representations of the operations for the purpose of description, and should not be regarded as representing the execution order of the operations. Unless explicitly stated, the method does not need to be executed completely in the order shown.
[0036] Figure 2 The flowchart of the interaction method according to the embodiment of the present disclosure is schematically shown.
[0037] like Figure 2 As shown, the method includes operations S210 to S240.
[0038] In operation S210 , in response to a selection instruction for selecting content from editable content, a first reference position of the selected content in the editable content is determined.
[0039] In operation S220, based on the position mapping relationship, the first reference position is position mapped to obtain a second reference position of the selected content in a virtual coordinate system, where the virtual coordinate system is established based on the content area of the editable content.
[0040] In operation S230, based on the second reference position of the selected content, a display position of the toolbar in the virtual coordinate system is determined, and the toolbar includes a functional control for assisting in editing the selected content.
[0041] In operation S240, based on the display position, a tool bar is displayed.
[0042] Optionally, the embodiments of the present disclosure may be applicable to a scenario where the precise position of a selected element in the editable content cannot be directly determined.
[0043] The editable content is located in an interactive interface, which may be an interactive interface of an application running on a terminal device or an interactive interface of a web page accessed through a browser, and the present disclosure is not limited thereto.
[0044] The editable content may be text, table, image or other types of data that can be edited. The user may trigger the selection instruction by dragging the mouse, using keyboard shortcuts or touching the screen. In response to the selection instruction, the selected content may be determined in the editable content. The selected content may be at least a portion of the editable content.
[0045] The first reference position represents the content position of the selected content in the editable content. For example, the first reference position can be measured in units such as characters or lines. For example, the selected content can be from the 5th character on the 10th line to the 20th character on the 10th line, and the first reference position can be obtained by combining a certain character position or multiple character positions. The second reference position is a position mapping of the first reference position, and the position mapping is represented in the virtual coordinate system. For example, the second reference position can be represented by the coordinates (x, y).
[0046] A corner of the content area of the editable content can be used as the origin of the virtual coordinate system, such as the upper left corner of the content area, and each point in the content area can be mapped to a position in the virtual coordinate system. Each point in the content area corresponds to a unique position in the virtual coordinate system.
[0047] When a user selects editable content, he can obtain which characters the selected content is between, but cannot obtain the specific position coordinates of the selected content in the entire editable content. By establishing a virtual coordinate system based on the content area of the editable content, each position of the editable content can be mapped to the virtual coordinate system, so that each position in the editable content corresponds to the position in the virtual coordinate system one by one. When determining the first reference position of the selected content, the second reference position corresponding to the first reference position is determined in the virtual coordinate system through the position mapping relationship, and then the specific position coordinates of the selected content are determined through the position coordinates of the second reference position. The toolbar is displayed according to the specific position coordinates.
[0048] After the second reference position is determined, the toolbar may be set near the second reference position, for example, above or below the second reference position, etc., which is not limited in the present disclosure.
[0049] The toolbar may include at least one function control for assisting editing of the selected content, and each function control may perform intelligent editing of different functions on the selected content. For example, the function control may include at least one of a simplification control for simplifying the selected content, an expansion control for expanding the selected content, and a polish control for polishing the selected content.
[0050] In some embodiments, the toolbar can be used as an interface for calling the large model. By operating the toolbar, the large model can be called to edit the selected content.
[0051] According to an embodiment of the present disclosure, by performing coordinate transformation on the first reference position of the selected content, a second reference position in a virtual coordinate system is obtained. Since the virtual coordinate system is established based on the editable content, the display position of the toolbar can be accurately determined based on the coordinate position in the virtual coordinate system, thereby enabling the user to conveniently and quickly edit the selected content through the toolbar, thereby improving the user experience.
[0052] According to an embodiment of the present disclosure, before determining the first reference position of the selected content in the editable content, it may include: determining the position of the editable content in the interactive interface, so that when it is determined that the editable content is in the input box of the interactive interface, the operation of determining the first reference position of the selected content in the editable content is performed.
[0053] In the embodiments of the present disclosure, the interactive interface may include multiple interface elements, such as input boxes, historical interactive content, graphic elements, navigation bars, menu bars, etc. The multiple interface elements are respectively set at different positions of the interactive interface.
[0054] The input box is editable content on the interactive interface for receiving user input. When the editable content is in the input box, it indicates that the user may need to edit the editable content, thereby performing an operation of determining the first reference position of the selected content in the editable content, and then performing subsequent operations of mapping the first reference position based on the position mapping relationship to obtain the second reference position of the selected content in the virtual coordinate system, and determining the display position of the toolbar in the virtual coordinate system based on the second reference position of the selected content.
[0055] In some embodiments, the position or size of the input box can be adjusted, and the virtual coordinate system can be adjusted accordingly according to the changes in the input box, thereby achieving accurate mapping of the second reference position to the first reference position based on the position mapping relationship.
[0056] According to the embodiments of the present disclosure, by determining the position of the editable content, the floating position of the toolbar can be accurately determined, thereby making the toolbar automatically displayed near the selected content, so as to quickly respond to the user's selection operation and improve the accuracy of the response.
[0057] Optionally, the editable content of the input box in the display interface cannot accurately locate the fine position of the selected content in the editable content, and can only determine the content position of the selected content in the input box, such as the character position. Therefore, by establishing a position mapping relationship, the content position of the selected content is mapped to the coordinate position in the virtual coordinate system, thereby improving the refinement of the positioning of the selected content in the input box, thereby improving the refinement of the display position of the toolbar, and improving the standardization of the display interface and the intelligence of the interaction.
[0058] Figure 3 A schematic diagram of establishing a virtual coordinate system based on a content area of editable content according to an embodiment of the present disclosure is schematically shown.
[0059] like Figure 3 As shown, a virtual coordinate system 320 can be established with the position of the upper left corner of the editable content 310 as the origin (0, 0) of the coordinates. After the editable content 310 is selected to obtain the selected content 330, the first reference position of the selected content 330 can be determined as the character position between character A and character B, but the fine position of the first reference position cannot be determined. By establishing the virtual coordinate system 320, based on the position mapping relationship, the character position between character A and character B is respectively mapped to the virtual coordinate system 320, and the second reference position of the virtual coordinate system is obtained, that is, the coordinates of point A (x1, y1) and point B (x2, y2), thereby determining the fine position of the selected content 330 in the virtual coordinate system, and then determining the display position of the toolbar.
[0060] According to an embodiment of the present disclosure, before performing position mapping on the first reference position, the interaction method may include: generating a position mapping relationship based on editable area boundaries and content attributes of editable content. The editable area boundaries are determined based on the editable content.
[0061] In the embodiments of the present disclosure, the editable region boundary can be determined according to the position and range of the editable content. For example, for an input box, the region boundary of the editable content can be determined according to the position of the input box in the interactive page and the range of the input box.
[0062] The content attributes of the editable content may include attribute information such as the type, size, format, and layout of the editable content. According to the content attributes of the editable content, the actual arrangement and display method of the editable content in the editable area may be determined.
[0063] Based on the position mapping relationship generated by the editable area boundary and the content attributes of the editable content, each element in the editable text can be mapped to the virtual coordinate system in the same arrangement manner, so that the position of each element in the editable text is consistent with the position in the virtual coordinate system, ensuring the accuracy of the second reference position.
[0064] According to an embodiment of the present disclosure, generating a position mapping relationship based on the content attributes of the editable area boundary and the editable content may include: when the editable content includes text, generating a position mapping relationship based on the editable area boundary and the font attributes and paragraph attributes of the editable content.
[0065] In the embodiments of the present disclosure, font attributes may include font size, character spacing, and line spacing. Font size may directly affect the size of the text in the editable content. Character spacing and line spacing affect the spatial distribution within and between text lines.
[0066] Paragraph properties include alignment, paragraph spacing, and indentation. Paragraph properties determine the overall layout of a text paragraph. Alignment, such as left alignment, right alignment, and center alignment, affects the horizontal position of the text; indentation and paragraph spacing affect the vertical position of the text.
[0067] The mapping relationship generated based on the font attributes and paragraph attributes of the editable area boundaries and the editable content can accurately map each character or paragraph in the editable content to the corresponding position in the virtual coordinate system, ensuring that the virtual coordinate system can accurately reflect the layout of the text content.
[0068] According to an embodiment of the present disclosure, determining a first reference position of the selected content in the editable content may include: determining a content boundary of the selected content based on the selected content; and determining the first reference position of the selected content in the editable content based on the content boundary of the selected content.
[0069] The content boundary may refer to the range of the selected content, and the content boundary of the selected content may be determined by the selected starting element position and the selected ending element position of the selected content.
[0070] In some embodiments, after determining the content boundary, the starting element position and the ending element position may be used as the first reference position. The present disclosure is not limited thereto, and the starting element position or the ending element position may be offset, and the offset position may be used as the first reference position.
[0071] In some embodiments, the first reference position may include multiple first reference sub-positions, and the multiple first reference sub-positions may include, for example, a starting point element position and an end point element position. The present disclosure is not limited thereto. For example, if the editable content includes multiple lines of content, the first reference position may also include the line number position of the line where the selected content is located.
[0072] According to an embodiment of the present disclosure, by determining the first reference position of the selected content in the editable content, the content scope of the content selected by the user can be accurately defined, and accordingly accurately positioned in the overall editable content, thereby providing an accurate reference point for subsequent determination of the display position of the toolbar.
[0073] According to an embodiment of the present disclosure, the first reference position includes a plurality of first reference sub-positions for indicating the content boundary of the selected content. Based on the position mapping relationship, position mapping is performed on the first reference position to obtain a second reference position of the selected content in the virtual coordinate system, which may include: based on the position mapping relationship, position mapping is performed on the plurality of first reference sub-positions respectively to obtain a plurality of second reference sub-positions in the virtual coordinate system; and based on the plurality of second reference sub-positions, determining the second reference position.
[0074] In an embodiment of the present disclosure, the plurality of first reference sub-positions may be positions of key elements on the content boundary of the selected content, such as the starting element position, the ending element position, the first element position of a line, and the last element position of a line.
[0075] In some embodiments, when the selected content includes only one line, the starting element position and the ending element position can be mapped based on the position mapping relationship to obtain multiple second reference sub-positions including the starting second reference sub-position and the ending second reference sub-position.
[0076] In some embodiments, when the selected content includes multiple lines, based on the mapping relationship, the starting element position, the ending element position, the beginning element position of the line and the end element position of the line can be mapped respectively, thereby obtaining multiple second reference sub-positions including the starting second reference sub-position, the ending second reference sub-position, the beginning second reference sub-position of the line and the end second reference sub-position of the line.
[0077] In the embodiment of the present disclosure, the second reference position refers to the overall position of the selected content determined based on a plurality of second reference sub-positions in a virtual coordinate system, integrating information of the plurality of second reference sub-positions.
[0078] According to an embodiment of the present disclosure, by mapping multiple first reference sub-positions to obtain multiple second reference sub-positions, and obtaining the second reference position based on the multiple second reference sub-positions, the range of the selected content can be accurately identified, thereby achieving more precise positioning of the selected content.
[0079] According to an embodiment of the present disclosure, determining the display position of the toolbar in the virtual coordinate system based on the second reference position of the selected content may include: determining the reference position of the selected content in the first direction based on the second reference position of the selected content; and determining the display position of the toolbar in the virtual coordinate system based on the toolbar size, the reference position and the preset spacing in the second direction of the toolbar. The preset spacing includes the spacing distance between the toolbar and the selected content in the second direction, and the first direction is perpendicular to the second direction.
[0080] In the embodiments of the present disclosure, the first direction may be a horizontal direction, that is, an X-axis direction in a virtual coordinate system; and the corresponding second direction may be a vertical direction, that is, a Y-axis direction in the virtual coordinate system.
[0081] The reference position may be a specific position of the selected content determined in the first direction based on the second reference position. The reference position may be used to initially position the toolbar, for example, the position of the end of the toolbar may be determined based on the reference position, or the center position of the toolbar may be determined based on the reference position.
[0082] In some embodiments, when the selected content includes only one line, the reference position can be determined based on the second reference sub-position of the starting point and the second reference sub-position of the ending point. For example, the reference position can be the middle point between the second reference sub-position of the starting point and the second reference sub-position of the ending point.
[0083] In some embodiments, when the selected content includes multiple lines, the reference position can be determined based on the second reference sub-position of the starting point, the second reference sub-position of the ending point, the second reference sub-position of the beginning of the line, and the second reference sub-position of the end of the line. For example, the reference position can be the midpoint between the second reference sub-position of the beginning of the line and the second reference sub-position of the end of the line where the second reference sub-position of the ending point is located, or the reference position can be the midpoint between the second reference sub-position of the beginning of the line and the second reference sub-position of the end of the line where the second reference sub-position of the starting point is located.
[0084] In some embodiments, the end point second reference sub-position may also be used as a reference position.
[0085] The toolbar size includes the toolbar size in a first direction, such as width, and the toolbar size in a second direction, such as height. The size in the first direction and the size in the second direction determine the space occupied by the toolbar in the virtual coordinate system.
[0086] The preset spacing is the spacing distance between the toolbar and the selected content in the second direction. When the second direction is the vertical direction, the preset spacing can be the spacing of the selected content extending upward, and the toolbar is set above the selected content. The preset spacing can also be the spacing of the selected content extending downward, and the toolbar is set below the selected content. The preset spacing can be set according to the design requirements of the interactive interface and the user experience. This ensures that the toolbar does not block the selected content and facilitates the user to perform editing operations. The present disclosure does not limit the toolbar and the preset spacing.
[0087] In some embodiments, a preliminary position of the toolbar can be determined in the virtual coordinate system based on the reference position and the toolbar size. Then, the position of the toolbar is adjusted in the second direction according to the preset spacing so that it maintains an appropriate interval with the selected content. Finally, the final display position of the toolbar in the virtual coordinate system is obtained.
[0088] According to the embodiments of the present disclosure, by determining the reference position based on the second reference position of the selected content and combining the size of the toolbar and the preset spacing, the display position of the toolbar can be accurately determined in the virtual coordinate system. In this way, the toolbar can be closely associated with the selected content, thereby facilitating the user to perform efficient editing operations.
[0089] Figure 4 The effect diagram of the toolbar display according to the embodiment of the present disclosure is schematically shown.
[0090] like Figure 4 As shown, in response to a selection instruction to select content from the editable content 410, the first reference position of the selected content 420 in the editable content 410 is determined. The first reference position may include a starting point first reference sub-position 431 (such as point A position) and an end point first sub-position 432 (such as point B position). Based on the position mapping relationship, the starting point first reference sub-position 431 and the end point first reference sub-position 432 are mapped to obtain the starting point second reference sub-position and the end point second reference sub-position in the virtual coordinate system. According to the starting point second reference sub-position and the end point second reference sub-position, a reference position 440 (such as point C position) is determined. Schematically, the reference position 440 may be the midpoint position of the starting point second reference sub-position and the end point second reference sub-position. According to the reference position 440, the toolbar size of the toolbar and the preset spacing in the second direction, the position of the toolbar 450 is determined. In this way, the toolbar can be closely associated with the selected content, so as to facilitate the user to perform efficient editing operations.
[0091] According to an embodiment of the present disclosure, based on the toolbar size, reference position, and preset spacing in the second direction of the toolbar, determining the display position of the toolbar in the virtual coordinate system may include: determining the adjusted reference position based on the reference position and the first conditional spacing when a first conditional spacing in the first direction between the reference position and the editing area boundary of the editable content satisfies a first predetermined condition. Based on the toolbar size, reference position, and preset spacing of the toolbar, determining the display position of the toolbar in the virtual coordinate system.
[0092] When the first direction is horizontal, the first conditional spacing is the distance between the reference position and the editing area boundary in the horizontal direction. The first conditional spacing may include the distance between the reference position and the left editing area boundary and the distance between the reference position and the right editing area boundary.
[0093] The first predetermined condition is a standard or threshold for determining whether the first condition spacing is appropriate. By setting the first predetermined condition, the toolbar can be prevented from being too close to the border of the editing area or exceeding the border area, thereby avoiding interference with the user's vision or operation.
[0094] If the first condition spacing does not meet the first predetermined condition, for example, the spacing is too small, the reference position needs to be adjusted to ensure that there is enough space between the toolbar and the editing area boundary. If the spacing is too small, the reference position can be offset a certain distance away from the editing area boundary to increase the spacing, thereby obtaining an adjusted reference position.
[0095] After obtaining the adjusted reference position, combined with the size of the toolbar and the preset spacing, the display position of the toolbar in the virtual coordinate system can be accurately determined, so that the display position will not block the selected content and can also facilitate the user to perform editing operations.
[0096] According to an embodiment of the present disclosure, by considering whether the distance between the reference position and the boundary of the editing area meets a predetermined condition and adjusting the reference position accordingly, and then combining the size of the toolbar and the preset distance, the display position of the toolbar in the virtual coordinate system can be flexibly determined, thereby ensuring smooth editing operations.
[0097] According to an embodiment of the present disclosure, determining the display position of the toolbar in the virtual coordinate system based on the toolbar size, reference position and preset spacing in the second direction of the toolbar may also include: determining that the first conditional spacing satisfies a first predetermined condition when it is determined that the first conditional spacing is less than half of the toolbar size of the toolbar in the first direction.
[0098] When the first conditional spacing is less than half of the size of the toolbar in the first direction, it means that the reference position of the toolbar is relatively close to the boundary of the editing area. Based on the display position determined by the current reference position, after the toolbar is displayed, the toolbar may exceed the boundary of the editing content, which may affect the user's operation of the toolbar.
[0099] For example, when the reference position is used as the reference position of the center position of the toolbar, if the first conditional spacing is less than half of the toolbar size in the first direction, the toolbar will exceed the editing area boundary. Therefore, the reference position needs to be adjusted to prevent the toolbar from exceeding the editing area boundary.
[0100] By comparing the first conditional spacing with half of the size of the toolbar in the first direction, it is possible to quickly determine whether the reference position is appropriate, thereby ensuring a reasonable layout of the toolbar and a good user experience.
[0101] Figure 5 The diagram schematically shows the effect of toolbar display after the reference position is updated according to an embodiment of the present disclosure.
[0102] like Figure 5 As shown, in response to a selection instruction to select content from the editable content 510, the first reference position of the selected content in the editable content is determined. The first reference position may include a first reference sub-position of the starting point and a first sub-position of the end point. Based on the position mapping relationship, the first reference sub-position of the starting point and the first reference sub-position of the end point are mapped respectively to obtain a second reference sub-position of the starting point and a second reference sub-position of the end point in the virtual coordinate system. According to the second reference sub-position of the starting point and the second reference sub-position of the end point, a reference position 521 (such as the position of point D) is determined. Schematically, the reference position 521 may be the midpoint position of the second reference sub-position of the starting point and the second reference sub-position of the end point. When it is determined that the first conditional spacing between the reference position 521 and the editing area boundary of the editable content in the first direction is less than half of the size of the toolbar size in the first direction, the reference position is adjusted to obtain an adjusted reference position 522 (such as the position of point F). According to the reference position 522, the toolbar size of the toolbar and the preset spacing in the second direction, the position of the toolbar 530 is determined. In this way, the display position of the toolbar in the virtual coordinate system can be flexibly determined, thereby ensuring the smooth progress of the editing operation.
[0103] In an embodiment of the present disclosure, based on the toolbar size, reference position, and preset spacing in the second direction of the toolbar, determining the display position of the toolbar in the virtual coordinate system may also include: when it is determined that the toolbar satisfies the second predetermined condition, updating the setting mode between the toolbar and the selected content, so as to perform the operation of determining the display position of the toolbar in the virtual coordinate system based on the second reference position of the selected content according to the updated setting mode. The setting mode is used to characterize the relative position relationship between the toolbar and the selected content in the second direction.
[0104] In some embodiments, the second preset condition may be a judgment condition for judging whether the toolbar exceeds the boundary of the editing area in the second direction. When the display position determined based on the toolbar size, the reference position and the preset spacing in the second direction of the toolbar exceeds the boundary of the editing area in the second direction, it is determined that the toolbar meets the second preset condition.
[0105] In some embodiments, when performing an operation based on the toolbar size, reference position, and display position determined by the preset spacing in the second direction, the preset spacing in the second direction is set to the spacing of the selected content extending downward. At this time, the setting method between the toolbar and the selected content is that the toolbar is located below the selected content. Under this setting method, when the selected content is close to the lower boundary of the editing area boundary, for example, the selected content is the last line, the toolbar will exceed the lower boundary of the editing area boundary, and the toolbar may even fail to be displayed, affecting the user's operation of the toolbar. For this reason, the setting method between the toolbar and the selected content can be updated, for example, the preset spacing in the second direction is set to the spacing of the selected content extending upward, so that the toolbar is located above the selected content, thereby preventing the toolbar from exceeding the editing area boundary in the second direction.
[0106] According to an embodiment of the present disclosure, by updating the setting mode between the toolbar and the selected content when it is determined that the toolbar satisfies the second predetermined condition, the setting mode of the toolbar can be adaptively adjusted when the toolbar exceeds the boundary of the editing area in the second direction, thereby improving the integrity and adaptability of the displayed toolbar.
[0107] According to an embodiment of the present disclosure, when it is determined that the second conditional spacing between the second reference position of the selected content and the editable area boundary of the editable content in the second direction is smaller than the toolbar size of the toolbar in the second direction, it is determined that the toolbar meets the second predetermined condition.
[0108] In some embodiments, when the toolbar and the selected content are arranged in such a manner that the toolbar is located above the selected content, the second conditional spacing may be the spacing between the second reference position and the upper boundary of the editing area boundary. At this time, the ordinate of the second reference position may be characterized as the second conditional spacing, and when the ordinate of the second reference position is smaller than the toolbar size of the toolbar in the second direction, it indicates that the toolbar may exceed the upper boundary of the editing area boundary, and it may be determined that the toolbar satisfies the second predetermined condition.
[0109] In some embodiments, when the toolbar and the selected content are arranged in such a manner that the toolbar is located below the selected content, the second conditional spacing may be the spacing between the second reference position and the lower boundary of the editing area boundary. At this time, the difference between the ordinate of the lower boundary of the editing area boundary and the ordinate of the second reference position may be characterized as the second conditional spacing. When the difference between the ordinate of the lower boundary of the editing area boundary and the ordinate of the second reference position is smaller than the toolbar size of the toolbar in the second direction, it indicates that the toolbar may exceed the lower boundary of the editing area boundary, and it is determined that the toolbar meets the second predetermined condition.
[0110] Figure 6 The diagram schematically shows the effect of the toolbar display after the setting mode between the toolbar and the selected content is updated according to an embodiment of the present disclosure.
[0111] like Figure 6 As shown, in the case where it is determined that the second conditional spacing between the second reference position of the selected content and the editable area boundary of the editable content in the second direction is smaller than the toolbar size of the toolbar in the second direction, for example, when the selected content 620 is in the last line of the editable content 610, if the toolbar 630 is still set below the selected content 620, it will cause the toolbar to exceed the editing area boundary. By updating the setting method between the toolbar 630 and the selected content 620, the toolbar 630 is located above the selected content 620, so that the toolbar can adaptively adjust the setting method, thereby improving the integrity and adaptability of the displayed toolbar.
[0112] According to an embodiment of the present disclosure, after displaying the toolbar based on the display position, the method may further include: in response to the editing instruction, based on the previous content and the following content of the selected content, performing editing processing corresponding to the editing instruction on the selected content to obtain the edited target content. The previous content and the following content are determined from the editable content based on the selected content, and the editing instruction is generated by operating the function control in the toolbar. The selected content is updated with the target content and displayed.
[0113] In the embodiments of the present disclosure, the preceding content may be all the content before the starting element position of the selected content, and the succeeding content may be all the content after the ending element position of the selected content, and the preceding content, the selected content, and the succeeding content constitute the entire editable content. The present disclosure is not limited thereto, and the preceding content may also be the content between the beginning position of the paragraph where the selected content is located and the starting element position of the selected content, and the succeeding content may be the content between the end position of the paragraph where the selected content is located and the ending element position of the selected content.
[0114] Users can trigger different editing commands by clicking on different functional controls in the toolbar. For example, clicking on the simplification control can trigger the command to simplify the selected content, and obtain the simplified target content based on the previous and next content; clicking on the expansion control can trigger the command to expand the selected content, and obtain the expanded target content based on the previous and next content; clicking on the polishing space can trigger the command to polish the selected content, and obtain the polished target content based on the previous and next content, and so on.
[0115] In some embodiments, after obtaining the target content, the selected content can be directly updated. The present disclosure is not limited thereto, and after obtaining the target content, an editing window can be generated to display the target content, and the user can choose to update the selected content with the target content, or continue the editing operation.
[0116] According to an embodiment of the present disclosure, the preceding content and the succeeding content provide a contextual semantic relationship. When editing the selected content, the semantics of the preceding content and the succeeding content are considered so that the style or logic of the target content after editing is consistent with that of the content before editing, thereby improving the editing effect.
[0117] According to an embodiment of the present disclosure, based on the preceding content and following content of the selected content, the selected content is edited in accordance with the editing instruction, and the edited target content obtained may include: generating content prompt information based on the preceding content, the selected content and the following content; generating function prompt information based on the editing function corresponding to the editing instruction; and inputting the content prompt information and the function prompt information into the large model to obtain the target content.
[0118] In the embodiments of the present disclosure, the prompt information may include key information, context, style, etc. of the context of the selected content, which is used to guide the big model to understand the background and requirements of the current editing, thereby helping the big model to better grasp the overall context and style of the editing.
[0119] The function prompt information represents the specific editing goals and requirements for the selected content. The purpose of the function prompt information is to ensure that the large model can accurately understand and execute the user's editing instructions, thereby generating editing results that meet the requirements.
[0120] A large model may refer to a deep learning model with large-scale model parameters. A large model usually contains hundreds of millions, tens of billions, hundreds of billions, trillions, or even more than ten trillion model parameters. A large model may be a large language model, a large visual model, or a multimodal large model. The large model involved in the embodiments of the present disclosure may be a general large model, or may be an expert large model obtained after fine-tuning (Fine Tune) based on demand, and the embodiments of the present disclosure do not limit this. The large model can be used to process information of any modality such as images, text, video, audio, etc.
[0121] The content prompt information and the function prompt information are provided as input to the big model, and the big model can generate target content that meets the requirements based on the input content prompt information and the function prompt information combined with its internal language knowledge and processing capabilities.
[0122] In some embodiments, in response to editing instructions, the previous content, the selected content, and the subsequent content can be input into the large model to directly output the target content.
[0123] According to the embodiments of the present disclosure, by combining context information, editing instructions and the language processing capabilities of a large model, intelligent and accurate text editing of selected content can be achieved, which not only improves editing efficiency but also ensures the accuracy and quality of editing results.
[0124] According to an embodiment of the present disclosure, after obtaining the target information, at least one of the following items may be included: wrapping the target content; changing the font of the target content to a font different from that of the editable content; changing the color of the target content to a color different from that of the editable content.
[0125] In some embodiments, when the target content is long or contains multiple paragraphs, the target content may be wrapped to make the structure of the target content clearer and facilitate users to quickly locate and understand key information.
[0126] In some embodiments, when the target content is short or in the middle of some long paragraphs, the target content can be changed to a different font or displayed in a different color, so that the target content can be highlighted, making it easier for users to quickly identify the edited target content and improving the readability and attractiveness of the target content.
[0127] The above-mentioned manner is only illustrative, and the present disclosure is not limited thereto. A plurality of manners may also be combined to display the target content in the editable content, and the like.
[0128] Figure 7 The block diagram of the interaction device 700 according to the embodiment of the present disclosure is schematically shown.
[0129] like Figure 7 As shown, the interaction device includes a first determination module 710 , a mapping module 720 , a second determination module 730 and a display module 740 .
[0130] The first determining module 710 is configured to determine a first reference position of the selected content in the editable content in response to a selection instruction for selecting content from the editable content.
[0131] The mapping module 720 is used to perform position mapping on the first reference position based on the position mapping relationship to obtain a second reference position of the selected content in a virtual coordinate system, wherein the virtual coordinate system is established based on the content area of the editable content.
[0132] The second determining module 730 is used to determine the display position of the toolbar in the virtual coordinate system based on the second reference position of the selected content, wherein the toolbar includes a functional control for assisting in editing the selected content.
[0133] The display module 740 is used to display a toolbar based on the display position.
[0134] According to an embodiment of the present disclosure, the first reference position includes a plurality of first reference sub-positions for indicating content boundaries of the selected content.
[0135] The mapping module 720 includes a mapping submodule and a determining submodule.
[0136] The mapping submodule is used to perform position mapping on the multiple first reference sub-positions respectively based on the position mapping relationship to obtain multiple second reference sub-positions in the virtual coordinate system.
[0137] The determination submodule is used to determine the second reference position based on the multiple second reference sub-positions.
[0138] According to an embodiment of the present disclosure, the interaction device further includes a generation module.
[0139] The generating module is used to generate a position mapping relationship based on the editable area boundary and the content attribute of the editable content, wherein the editable area boundary is determined based on the editable content.
[0140] According to an embodiment of the present disclosure, the generation module includes a mapping relationship generation submodule.
[0141] The mapping relationship generating submodule is used to generate a position mapping relationship based on the editable area boundary and the font attributes and paragraph attributes of the editable content when the editable content includes text.
[0142] According to an embodiment of the present disclosure, the first determination module 710 includes a boundary determination submodule and a reference position determination submodule.
[0143] The boundary determination submodule is used to determine the content boundary of the selected content based on the selected content.
[0144] The reference position determination submodule is used to determine a first reference position in the editable content based on the content boundary of the selected content.
[0145] According to an embodiment of the present disclosure, the interaction device further includes a third determination module.
[0146] The third determination module is used to determine the position of the editable content in the interactive interface, so as to determine the first reference position of the selected content in the editable content when it is determined that the editable content is in the input box of the interactive interface.
[0147] According to an embodiment of the present disclosure, the second determination module 730 includes a reference position determination submodule and a display position determination submodule.
[0148] The reference position determination submodule is used to determine the reference position of the selected content in the first direction based on the second reference position of the selected content.
[0149] The display position determination submodule determines the display position of the toolbar in the virtual coordinate system based on the toolbar size, reference position and preset spacing in the second direction of the toolbar, wherein the preset spacing includes the spacing distance between the toolbar and the selected content in the second direction, and the first direction is perpendicular to the second direction.
[0150] According to an embodiment of the present disclosure, the display position determining submodule includes a reference position determining unit and a display position determining unit.
[0151] The reference position determining unit is used to determine the adjusted reference position based on the reference position and the first conditional distance when it is determined that a first conditional distance between the reference position and the editing area boundary of the editable content in a first direction satisfies a first predetermined condition.
[0152] The display position determining unit is used to determine the display position of the toolbar in the virtual coordinate system based on the toolbar size, the adjusted reference position and the preset spacing of the toolbar.
[0153] According to an embodiment of the present disclosure, the display position determination submodule further includes a condition determination unit.
[0154] The condition determination unit is used to determine that the first conditional spacing satisfies a first predetermined condition when it is determined that the first conditional spacing is less than half of the toolbar size in the first direction.
[0155] According to an embodiment of the present disclosure, the display device further includes a first updating module.
[0156] The first updating module is used to update the setting mode between the toolbar and the selected content when it is determined that the toolbar satisfies the second predetermined condition, so as to perform the operation of determining the display position of the toolbar in the virtual coordinate system based on the second reference position of the selected content according to the updated setting mode, wherein the setting mode is used to characterize the relative position relationship between the toolbar and the selected content in the second direction.
[0157] According to an embodiment of the present disclosure, the first updating module further includes a condition determination submodule.
[0158] The condition determination submodule is used to determine that the toolbar meets the second predetermined condition when it is determined that the second conditional spacing between the second reference position of the selected content and the editable area boundary of the editable content in the second direction is smaller than the toolbar size of the toolbar in the second direction.
[0159] According to an embodiment of the present disclosure, the interaction device further includes an editing module and a second updating module.
[0160] The editing module is used to respond to the editing instruction and perform editing processing on the selected content corresponding to the editing instruction based on the previous content and the following content of the selected content to obtain the edited target content, wherein the previous content and the following content are determined from the editable content based on the selected content, and the editing instruction is generated by the function control in the operation toolbar.
[0161] The second updating module is used to update the selected content with the target content and display it.
[0162] According to an embodiment of the present disclosure, the editing module includes a first generating submodule, a second generating submodule and a third generating submodule.
[0163] The first generating submodule is used to generate content prompt information based on the previous content, the selected content and the subsequent content.
[0164] The second generating submodule is used to generate function prompt information based on the editing function corresponding to the editing instruction.
[0165] The third generation submodule is used to input the content prompt information and the function prompt information into the large model to obtain the target content.
[0166] According to an embodiment of the present disclosure, the interactive device further includes at least one of the following modules:
[0167] The first processing module is used to wrap the target content.
[0168] The second processing module is used to change the font of the target content to a font different from that of the editable content.
[0169] The third processing module is used to change the color of the target content to a color different from that of the editable content.
[0170] According to an embodiment of the present disclosure, any multiple modules among the first determination module 710, the mapping module 720, the second determination module 730 and the display module 740 may be combined into one module for implementation, or any one of the modules may be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules may be combined with at least part of the functions of other modules and implemented in one module.
[0171] According to an embodiment of the present disclosure, at least one of the first determination module 710, the mapping module 720, the second determination module 730 and the display module 740 may be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or may be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or by any one of the three implementation methods of software, hardware and firmware or by a proper combination of any of them. Alternatively, at least one of the first determination module 710, the mapping module 720, the second determination module and the display module may be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding function may be executed.
[0172] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0173] According to an embodiment of the present disclosure, an electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute a method as in the embodiment of the present disclosure.
[0174] According to an embodiment of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause a computer to execute a method as described in an embodiment of the present disclosure.
[0175] According to an embodiment of the present disclosure, a computer program product includes a computer program, and when the computer program is executed by a processor, the method according to the embodiment of the present disclosure is implemented.
[0176] Figure 8 A schematic block diagram of an example electronic device 800 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0177] like Figure 8 As shown, the device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 to a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0178] A number of components in the device 800 are connected to an input / output (I / O) interface 805, including: an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a disk, an optical disk, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0179] The computing unit 801 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 801 performs the various methods and processes described above, such as the interactive method. For example, in some embodiments, the interactive method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 800 via the ROM 802 and / or the communication unit 809. When the computer program is loaded into the RAM 803 and executed by the computing unit 801, one or more steps of the interactive method described above may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to perform the interactive method in any other appropriate manner (e.g., by means of firmware).
[0180] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0181] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0182] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0183] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0184] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0185] A computer system may include a client and a server. The client and the server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises through computer programs running on respective computers and having a client-server relationship to each other. The server may be a cloud server, a server in a distributed system, or a server combined with a blockchain.
[0186] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0187] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. An interactive method, comprising: In response to a selection instruction for selecting content from the editable content, determining a first reference position of the selected content in the editable content; Based on the position mapping relationship, position mapping is performed on the first reference position to obtain a second reference position of the selected content in a virtual coordinate system, wherein the virtual coordinate system is established based on the content area of the editable content; Determining a display position of a toolbar in the virtual coordinate system based on a second reference position of the selected content, wherein the toolbar includes a functional control for assisting in editing the selected content; and Based on the display position, the toolbar is displayed.
2. The method according to claim 1, wherein: The first reference position includes a plurality of first reference sub-positions for indicating content boundaries of the selected content; The performing position mapping on the first reference position based on the position mapping relationship to obtain a second reference position of the selected content in a virtual coordinate system includes: Based on the position mapping relationship, position mapping is performed on the plurality of first reference sub-positions respectively to obtain a plurality of second reference sub-positions in the virtual coordinate system; as well as The second reference position is determined based on the plurality of second reference sub-positions.
3. The method according to claim 1 or 2, further comprising: The position mapping relationship is generated based on an editable area boundary and a content attribute of the editable content, wherein the editable area boundary is determined based on the editable content.
4. The method according to claim 3, wherein: The generating the position mapping relationship based on the editable area boundary and the content attribute of the editable content includes: In the case where the editable content includes text, the position mapping relationship is generated based on the editable area boundary and the font attributes and paragraph attributes of the editable content.
5. The method according to any one of claims 1 to 4, wherein: The determining of a first reference position of the selected content in the editable content includes: Based on the selected content, determining a content boundary of the selected content; and Based on a content boundary of the selected content, the first reference position in the editable content is determined.
6. The method according to any one of claims 1 to 5, further comprising: The position of the editable content in the interactive interface is determined, so that when it is determined that the editable content is in an input box of the interactive interface, the operation of determining a first reference position of the selected content in the editable content is performed.
7. The method according to any one of claims 1 to 6, wherein: The determining the display position of the toolbar in the virtual coordinate system based on the second reference position of the selected content includes: determining a reference position of the selected content in a first direction based on a second reference position of the selected content; and Based on the toolbar size of the toolbar, the reference position and a preset spacing in the second direction, the display position of the toolbar in the virtual coordinate system is determined, wherein the preset spacing includes the spacing distance between the toolbar and the selected content in the second direction, and the first direction is perpendicular to the second direction.
8. The method according to claim 7, wherein: The determining the display position of the toolbar in the virtual coordinate system based on the toolbar size, the reference position, and the preset spacing in the second direction includes: In a case where it is determined that a first conditional spacing in a first direction between the reference position and a boundary of an editing area of the editable content satisfies a first predetermined condition, determining an adjusted reference position based on the reference position and the first conditional spacing; and Based on the toolbar size of the toolbar, the adjusted reference position, and a preset spacing, a display position of the toolbar in the virtual coordinate system is determined.
9. The method according to claim 8, further comprising: In the case where it is determined that the first conditional spacing is smaller than half of the toolbar size of the toolbar in the first direction, it is determined that the first conditional spacing satisfies the first predetermined condition.
10. The method according to any one of claims 1 to 9, further comprising: When it is determined that the toolbar satisfies the second predetermined condition, the setting mode between the toolbar and the selected content is updated so that the operation of determining the display position of the toolbar in the virtual coordinate system based on the second reference position of the selected content is performed according to the updated setting mode, wherein the setting mode is used to characterize the relative position relationship between the toolbar and the selected content in the second direction.
11. The method according to claim 10, further comprising: When it is determined that a second conditional spacing in the second direction between the second reference position of the selected content and the editable area boundary of the editable content is smaller than the toolbar size of the toolbar in the second direction, it is determined that the toolbar satisfies the second predetermined condition.
12. The method according to any one of claims 1 to 11, further comprising: In response to an editing instruction, based on preceding content and succeeding content of the selected content, performing editing processing corresponding to the editing instruction on the selected content to obtain edited target content, wherein the preceding content and succeeding content are determined from the editable content based on the selected content, and the editing instruction is generated by operating a function control in the toolbar; and The selected content is updated using the target content and displayed.
13. The method according to claim 12, wherein: The step of performing editing processing corresponding to the editing instruction on the selected content based on the preceding content and the succeeding content of the selected content to obtain the edited target content includes: Generate content prompt information based on the preceding content, the selected content and the succeeding content; generating function prompt information based on the editing function corresponding to the editing instruction; and The content prompt information and the function prompt information are input into the macro model to obtain the target content.
14. The method according to claim 12 or 13, further comprising at least one of the following: Wrap the target content; Changing the font of the target content to a font different from that of the editable content; The color of the target content is changed to a color different from that of the editable content.
15. An interactive device, comprising: A first determining module, configured to determine a first reference position of the selected content in the editable content in response to a selection instruction for selecting content from the editable content; A mapping module, configured to perform position mapping on the first reference position based on a position mapping relationship to obtain a second reference position of the selected content in a virtual coordinate system, wherein the virtual coordinate system is established based on a content area of the editable content; a second determining module, configured to determine a display position of a toolbar in the virtual coordinate system based on a second reference position of the selected content, wherein the toolbar includes a function control for assisting in editing the selected content; and The display module is used to display the toolbar based on the display position.
16. The device according to claim 15, wherein: The first reference position includes a plurality of first reference sub-positions for indicating content boundaries of the selected content; The mapping module comprises: a mapping submodule, configured to perform position mapping on the plurality of first reference sub-positions respectively based on the position mapping relationship to obtain a plurality of second reference sub-positions in the virtual coordinate system; and The determination submodule is configured to determine the second reference position based on a plurality of the second reference sub-positions.
17. The device according to claim 15 or 16, further comprising: A generating module is used to generate the position mapping relationship based on an editable area boundary and a content attribute of the editable content, wherein the editable area boundary is determined based on the editable content.
18. The device according to claim 17, wherein: The generation module comprises: The mapping relationship generating submodule is used to generate the position mapping relationship based on the editable area boundary and the font attributes and paragraph attributes of the editable content when the editable content includes text.
19. The device according to any one of claims 15 to 18, wherein: The first determining module comprises: a boundary determination submodule, configured to determine a content boundary of the selected content based on the selected content; and The reference position determination submodule is used to determine the first reference position in the editable content based on the content boundary of the selected content.
20. The device according to any one of claims 15 to 19, further comprising: The third determination module is used to determine the position of the editable content in the interactive interface, so as to perform the operation of determining the first reference position of the selected content in the editable content when it is determined that the editable content is in the input box of the interactive interface.
21. The device according to any one of claims 15 to 20, wherein: The second determining module comprises: a reference position determination submodule, configured to determine a reference position of the selected content in a first direction based on a second reference position of the selected content; and The display position determination submodule determines the display position of the toolbar in the virtual coordinate system based on the toolbar size of the toolbar, the reference position and a preset spacing in the second direction, wherein the preset spacing includes the spacing distance between the toolbar and the selected content in the second direction, and the first direction is perpendicular to the second direction.
22. The device according to claim 21, wherein The display position determination submodule includes: a reference position determining unit, configured to determine an adjusted reference position based on the reference position and the first conditional distance when it is determined that a first conditional distance between the reference position and a boundary of an editing area of the editable content in a first direction satisfies a first predetermined condition; and The display position determining unit is used to determine the display position of the toolbar in the virtual coordinate system based on the toolbar size, the adjusted reference position and the preset spacing of the toolbar.
23. The device according to claim 22, wherein the display position determination submodule further comprises: The condition determination unit is used to determine that the first conditional spacing satisfies the first predetermined condition when it is determined that the first conditional spacing is smaller than half of the toolbar size of the toolbar in the first direction.
24. The apparatus according to any one of claims 15 to 23, further comprising: The first updating module is used to update the setting mode between the toolbar and the selected content when it is determined that the toolbar satisfies the second predetermined condition, so as to perform the operation of determining the display position of the toolbar in the virtual coordinate system based on the second reference position of the selected content according to the updated setting mode, wherein the setting mode is used to characterize the relative position relationship between the toolbar and the selected content in the second direction.
25. The apparatus according to claim 24, wherein the first update module further comprises: The condition determination submodule is used to determine that the toolbar satisfies the second predetermined condition when it is determined that the second conditional spacing between the second reference position of the selected content and the editable area boundary of the editable content in the second direction is smaller than the toolbar size of the toolbar in the second direction.
26. The apparatus according to any one of claims 15 to 25, further comprising: an editing module, configured to, in response to an editing instruction, perform editing processing corresponding to the editing instruction on the selected content based on preceding content and succeeding content of the selected content, so as to obtain edited target content, wherein the preceding content and succeeding content are determined from the editable content based on the selected content, and the editing instruction is generated by operating a function control in the toolbar; and The second updating module is used to update the selected content using the target content and display it.
27. The device according to claim 26, wherein: The editing module comprises: A first generating submodule, configured to generate content prompt information based on the preceding content, the selected content and the succeeding content; A second generating submodule, configured to generate function prompt information based on the editing function corresponding to the editing instruction; and The third generation submodule is used to input the content prompt information and the function prompt information into the large model to obtain the target content.
28. The apparatus according to claim 26 or 27, further comprising at least one of the following modules: A first processing module, used for wrapping the target content; A second processing module, configured to change the font of the target content to a font different from that of the editable content; The third processing module is used to change the color of the target content to a color different from that of the editable content.
29. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 14.
30. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 14.
31. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 14.