A method, apparatus, display device, and medium for editing formulas.

CN116126193BActive Publication Date: 2026-08-14GUANGZHOU SHIYUAN ELECTRONICS CO LTD +1
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-09
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

[0004]然而,在现有的应用软件中,若要对一个整体的公式进行拆分,即将公式的一部分取出,拆分成两个新的公式,或者,若要将多条公式合并成一个新的公式,只能重新编辑公式,而重新编辑公式是一个非常繁琐耗时的工作,影响工作效率

Benefits of technology

[0023]本发明实施例提供了一种编辑公式的方法、装置、显示设备及介质,该方法获取用户在公式编辑界面上对待处理公式的选择操作;确定所述选择操作对应的所选内容;获取所述用户在所述公式编辑界面上对所述所选内容的移动操作;响应于所述移动操作,完成对所述所选内容的编辑;其中,对所选内容的编辑包括合并至目标公式和/或从所述待处理公式中拆分,所述目标公式和所述待处理公式为所述公式编辑界面内的两个公式。利用上述技术方案,通过响应用户在公式编辑界面上对所选内容的移动操作能够简便地实现对所选内容的编辑,从而提高了编辑公式的效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116126193B_ABST
    Figure CN116126193B_ABST
Patent Text Reader

Abstract

This invention discloses a method, apparatus, display device, and medium for editing formulas. The method includes: acquiring a user's selection operation on a formula to be processed on a formula editing interface; determining the selected content corresponding to the selection operation; acquiring the user's movement operation on the selected content on the formula editing interface; and, in response to the movement operation, completing the editing of the selected content; wherein, editing the selected content includes merging it into a target formula and / or splitting it from the formula to be processed, and the target formula and the formula to be processed are two formulas within the formula editing interface. Using this method, editing of the selected content can be easily achieved by responding to the user's movement operation on the formula editing interface, thereby improving the efficiency of formula editing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method, apparatus, display device and medium for editing formulas. Background Technology

[0002] Formulas can generally be divided into left-right structures, top-bottom structures, superscript and subscript structures, etc. At the same time, the composition of formulas is diverse, ranging from a single character to multiple characters combined according to various formats.

[0003] In existing application software, formulas are generally processed through editing functions, such as formula editing in Word or formula editors.

[0004] However, in existing application software, if you want to split a whole formula, that is, take out a part of the formula and split it into two new formulas, or if you want to merge multiple formulas into a new formula, you can only re-edit the formula. Re-editing the formula is a very tedious and time-consuming task, which affects work efficiency. Summary of the Invention

[0005] This invention provides a method, apparatus, display device, and medium for editing formulas, enabling easy editing of formulas, such as merging and / or splitting.

[0006] In a first aspect, embodiments of the present invention provide a method for editing formulas, including:

[0007] Get the user's selection of the formula to be processed in the formula editing interface;

[0008] Determine the selected content corresponding to the selection operation;

[0009] The user's movement operation on the selected content in the formula editing interface is obtained;

[0010] In response to the movement operation, the selected content is edited.

[0011] The editing of the selected content includes merging into the target formula and / or splitting from the formula to be processed, wherein the target formula and the formula to be processed are two formulas within the formula editing interface.

[0012] Secondly, embodiments of the present invention also provide an apparatus for editing formulas, comprising:

[0013] The selection operation acquisition module is used to acquire the user's selection operation on the formula to be processed in the formula editing interface;

[0014] The content determination module is used to determine the selected content corresponding to the selection operation;

[0015] A movement operation acquisition module is used to acquire the user's movement operation on the selected content on the formula editing interface;

[0016] A response module is used to respond to the movement operation and complete the editing of the selected content;

[0017] The editing of the selected content includes merging into the target formula and / or splitting from the formula to be processed, wherein the target formula and the formula to be processed are two formulas within the formula editing interface.

[0018] Thirdly, embodiments of the present invention also provide a display device, comprising:

[0019] One or more processors;

[0020] Storage device for storing one or more programs;

[0021] The one or more programs are executed by the one or more processors, causing the one or more processors to implement the formula editing method provided in the embodiments of the present invention.

[0022] Fourthly, embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the formula editing method provided in embodiments of the present invention.

[0023] This invention provides a method, apparatus, display device, and medium for editing formulas. The method acquires a user's selection operation on a formula editing interface; determines the selected content corresponding to the selection operation; acquires the user's movement operation on the selected content on the formula editing interface; and, in response to the movement operation, completes the editing of the selected content. The editing of the selected content includes merging it into a target formula and / or splitting it from the formula to be processed, wherein the target formula and the formula to be processed are two formulas within the formula editing interface. Using the above technical solution, editing of the selected content can be easily achieved by responding to the user's movement operation on the formula editing interface, thereby improving the efficiency of formula editing. Attached Figure Description

[0024] Figure 1 This is a flowchart illustrating a method for editing formulas according to Embodiment 1 of the present invention;

[0025] Figure 1a This is a schematic diagram of the tree structure in a method for editing formulas provided in Embodiment 1 of the present invention;

[0026] Figure 1bThis is a schematic diagram of the structure of the formula to be processed in a method for editing formulas provided in Embodiment 1 of the present invention;

[0027] Figure 2 This is a flowchart illustrating a method for editing formulas according to Embodiment 2 of the present invention;

[0028] Figure 2a This is a flowchart illustrating the process of selecting content in a splitting formula method provided in Embodiment 2 of the present invention;

[0029] Figure 2b This is a flowchart illustrating the process of updating layer content in a splitting formula method provided in Embodiment 2 of the present invention;

[0030] Figure 2c This is a flowchart illustrating the process of moving selected content in a splitting formula method provided in Embodiment 2 of the present invention;

[0031] Figure 2d This is a flowchart illustrating the process of selecting content and updating layer content in a merging formula method provided in Embodiment 2 of the present invention;

[0032] Figure 2e This is a flowchart illustrating the merging formula in a merging formula method provided in Embodiment 2 of the present invention;

[0033] Figure 2f This is a flowchart illustrating the merging strategy in a merging formula method provided in Embodiment 2 of the present invention;

[0034] Figure 2g This is a schematic diagram illustrating the effect of selecting selected content according to Embodiment 2 of the present invention;

[0035] Figure 2h This is a schematic diagram illustrating the effect after the selected content is determined, as provided in Embodiment 2 of the present invention.

[0036] Figure 2i This is a schematic diagram illustrating the effect of splitting a formula to be processed according to Embodiment 2 of the present invention;

[0037] Figure 2j This is a schematic diagram illustrating the effect of selecting a formula to be processed, provided in Embodiment 2 of the present invention.

[0038] Figure 2k This is a schematic diagram illustrating the effect of moving a formula to be processed according to Embodiment 2 of the present invention;

[0039] Figure 2l This is a schematic diagram illustrating the effect of formula merging according to Embodiment 2 of the present invention;

[0040] Figure 3 This is a schematic diagram of the structure of an editing formula device provided in Embodiment 3 of the present invention;

[0041] Figure 4 This is a schematic diagram of the structure of a display device provided in Embodiment 4 of the present invention. Detailed Implementation

[0042] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, the accompanying drawings show only the parts relevant to the present invention, and not all of the structures.

[0043] Before discussing the exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe the operations (or steps) as sequential processes, many of these operations can be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the operations can be rearranged. The process can be terminated when its operation is completed, but may also have additional steps not included in the figures. The process can correspond to a method, function, procedure, subroutine, subroutine, etc. Moreover, embodiments and features in the embodiments of the present invention can be combined with each other without conflict.

[0044] The term "comprising" and its variations as used in this invention are open-ended, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment".

[0045] It should be noted that the concepts of "first" and "second" mentioned in this invention are only used to distinguish the corresponding contents and are not used to limit the order or interdependence.

[0046] It should be noted that the terms "a" and "a plurality of" used in this invention are illustrative rather than restrictive. Those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".

[0047] Example 1

[0048] Figure 1 This is a flowchart illustrating a method for editing formulas according to Embodiment 1 of the present invention. This method is applicable to situations where formulas are edited. The method can be executed by a formula editing device, which can be implemented by software and / or hardware and is generally integrated into a display device. In this embodiment, the display device includes, but is not limited to, devices such as computers, laptops, tablets, and mobile phones.

[0049] like Figure 1As shown in the schematic diagram of a method for editing formulas provided in Embodiment 1 of the present invention, the method includes the following steps:

[0050] S110. Obtain the user's selection operation for the formula to be processed on the formula editing interface.

[0051] The formula editing interface can refer to the interface for editing formulas. It can be embedded in application software to enable formula editing within the application software, or it can exist in the formula editing software to generate formulas.

[0052] In this embodiment, the formula mainly includes the content generated in the formula editing interface. It can be a single character, such as "=", "A", "0", etc.; or it can be a combination of multiple characters, such as "a i "、 "s = vt", etc.; it can also be an expression that expresses the relationship between variables, such as Formulas can generally be categorized into single-symbol structures, left-right structures, top-bottom structures, and superscript-subscript structures.

[0053] The formula to be processed can be considered as a formula that needs to be edited, such as a formula that needs to be split. The type of formula to be processed is not limited. For example, it can be a mathematical formula, a chemical formula, or a physical formula.

[0054] The selection operation mainly refers to the operation performed to select the formula to be processed. For example, the selection operation can be the operation of the user selecting the formula to be processed by clicking, or the operation of the user selecting the formula to be processed by sliding, such as sliding from the top left corner to the bottom right corner. There is no limitation on the sliding method here. It can also be the operation of circling the formula to be processed, etc.

[0055] The user's selection operation for the formula to be processed can select all or part of the formula. In one embodiment, when merging the formula to be processed and the target formula, the entire formula to be processed can be selected; when splitting the formula to be processed, a portion of the formula to be processed can be selected.

[0056] Before editing the formula, this step can first divide the symbol structure of the formula into tree-like nodes. Each tree node includes: references to its parent and child nodes, its own size (also known as node size), its own position (also known as node position), and its own content (also known as node content). Specifically, the tree nodes can be divided into different types based on different symbol structures: for example, they can be divided into single-symbol nodes "=", subscript / superscript structure nodes "a", etc. i ", fractional structure node Upper, middle and lower structural nodes Then, each node is decomposed layer by layer, and the formula to be processed is expressed in a tree structure. The size of the node itself can be considered the size of the content it represents, its position can represent the position of the content it represents in the formula to be processed, and its content can be the content it represents.

[0057] With formula For example, Figure 1a This is a schematic diagram of the tree structure in a method for editing formulas provided in Embodiment 1 of the present invention, as shown below. Figure 1a As shown, for the formula The symbols used to construct the tree structure nodes were divided. When expressing the formula to be processed through a tree structure, the tree nodes were divided into different types based on the structure of the formula symbols. The leaf nodes of the tree structure of the formula to be processed can be single-symbol nodes.

[0058] Then calculate the size and position of each node. Figure 1b This is a schematic diagram of the structure of the formula to be processed in a method for editing formulas provided in Embodiment 1 of the present invention, as shown below. Figure 1b As shown, each rectangle represents the size and position of each node. The node size can be calculated based on the text size calculation of different systems, while the node position needs to be calculated based on the relationships between nodes. For example, when calculating 'a'... i Location requires relying on nodes Given the position and size, calculate node a i At the node The center position on the right.

[0059] This step obtains the user's selection actions on the formula to be processed in the formula editing interface, in order to determine the selected content corresponding to the subsequent selection actions, and thus realize the editing of the formula.

[0060] S120. Confirm the selected content corresponding to the selection operation.

[0061] The selected content can refer to the content that the user selects through the selection operation of the formula to be processed. The selected content can include the entire formula to be processed or a part of the formula to be processed.

[0062] Specifically, the selected content can be determined based on the selected operation. This embodiment does not limit the steps for determining the selected content; different selection operations can correspond to different determination methods. For example, if the selection operation is a point selection, the selected content can be the content that was pointed to; if the selection operation is a swipe selection, the selected content can be the content that was swiped over; if the selection operation is a circle selection, the selected content can be the content that was circled.

[0063] For example, the steps to determine the selected content can be: first, determine the selection position corresponding to the selection operation on the formula to be processed; then, based on the selection position and the formula to be processed, the specific selected content can be determined. Taking a point selection operation as an example, when the user performs a point selection operation on the formula to be processed in the formula editing interface, if the selection position corresponding to the point selection operation falls within the area corresponding to all nodes of the formula to be processed, the formula to be processed can be considered as the selected content. If the selection position corresponding to the point selection operation falls within the area corresponding to some nodes of the formula to be processed, those nodes in the formula to be processed can be considered as the selected content. The nodes of the formula to be processed can be considered as nodes expressed in a tree structure, where each character in the formula to be processed can correspond to a node, such as... Figure 1b As shown, the content selected by the rectangle can all be treated as a node.

[0064] In this embodiment, after determining the selected content corresponding to the selection operation, the selected content can be marked to distinguish it from the unselected content. For example, UI marking can be performed, and the attributes of the selected content can be set, such as increasing the font size, changing the font, highlighting and / or emphasizing the selected content.

[0065] In this embodiment, the layer on which the selected content can be drawn may be different from the layer on which the formula to be processed is drawn. For example, a new layer can be created to draw the selected content.

[0066] S130. Obtain the user's movement operation on the selected content in the formula editing interface.

[0067] It is important to understand that after selecting the content, you need to move the selected content to complete the editing. The editing performed in this embodiment includes splitting and merging.

[0068] The movement operation can be, for example, moving the selected content by dragging the mouse, or moving the selected content by touching the position of the selected content with a finger. When moving the selected content, the position touched by the mouse or finger can be the center point of the selected content, or a point other than the center point of the selected content. This embodiment does not limit this.

[0069] In this embodiment, the target location can be the location of the selected content when the movement stops.

[0070] For example, when splitting a formula, after selecting the content, you need to drag the selected content away from the formula to be processed. That is, the distance between the target position and the formula area corresponding to the formula to be processed is greater than a set threshold, which is not limited. When merging formula A and formula B, that is, merging formula B (i.e., the formula to be processed) into formula A (i.e., the target formula), after selecting formula B, you need to move formula B in a direction closer to formula A. The distance between the target position and the formula area corresponding to formula A is less than or equal to a set threshold. Here, the formula area can be considered as the smallest area including the formula to be processed.

[0071] During the movement operation, from its start to its end, the selected content can be moved according to the operation, meaning its display position is updated based on the movement location. Specifically, during the movement process, before the operation ends, if the selected content's area enters the formula area corresponding to another formula (including but not limited to the target formula) on the formula editing interface, or if the distance to the formula area corresponding to another formula is less than a set threshold, feedback can be provided in the formula editing interface indicating whether merging is possible. This could be done by directly displaying the selected content on other formulas or by highlighting other formulas to indicate that they can be merged with the selected content.

[0072] In one embodiment, when merging two formulas, if the formula region of the formula to be processed enters the formula region corresponding to the formula to be merged, or if the distance between the two formula regions is less than a set threshold, a mergeable session notification will appear to indicate that the formula to be merged can be merged with the formula to be processed. This embodiment does not limit how to determine whether merging is possible; for example, it may determine whether merging is possible through formula analysis of the formula to be processed and the formula to be merged.

[0073] Specifically, when the display device begins to detect movement of the selected content, the movement operation can be considered to have started; when the display device detects a lift-up action, the movement operation can be considered to have ended.

[0074] S140. In response to the move operation, complete the editing of the selected content; wherein, the editing of the selected content includes merging into the target formula and / or splitting from the formula to be processed, and the target formula and the formula to be processed are two formulas within the formula editing interface.

[0075] After receiving the user's movement operation on the selected content in the formula editing interface, the system responds to the movement operation to complete the editing of the selected content. Responding to the movement operation can be considered as performing the corresponding editing operation on the formula to be processed.

[0076] In one embodiment, the structure of the formula to be processed after editing the selected content is different from the structure of the formula to be processed before editing the selected content is completed.

[0077] In one embodiment, the content of the formula to be processed after editing the selected content is different from the content of the formula to be processed before editing the selected content.

[0078] In one embodiment, the content of the formula to be processed after editing the selected content is different from the content of the formula to be processed before editing the selected content.

[0079] Editing the selected content includes merging it into the target formula and / or splitting it from the formula to be processed. The target formula and the formula to be processed are two formulas within the formula editing interface. Specifically, the editing operation can be determined based on the specific position of the selected content after the move operation and the formula area corresponding to the included formulas within the formula editing interface. If the distance between the target position corresponding to the move operation and the formula area corresponding to the target formula within the formula editing interface is less than or equal to a set threshold, a merge operation can be performed. If the distance between the target position corresponding to the move operation and the formula area corresponding to any formula within the formula editing interface is greater than the set threshold, a split operation can be performed.

[0080] In this embodiment, the number of formulas on the formula editing interface remains unchanged or changes before and after editing the selected content. For example, when merging two formulas in the formula editing interface, if the selected content is a part of the formula to be processed, the number of formulas in the formula editing interface before and after editing the selected content remains the same; if the selected content is the entire formula to be processed, i.e., the selected content is the entire formula to be processed, the number of formulas in the formula editing interface after editing the selected content is less than the number of formulas in the formula editing interface before editing the selected content.

[0081] For example, there are formulas to be processed in the formula editing interface. If the selected content is a part of the formula to be processed (n+1), i.e., the selected content is n, then after performing the merge operation, the formula in the formula editing interface will be: And n(n+1), at this time, the number of formulas in the formula editing interface before and after editing the selected content remains unchanged, both being 2; if the selected content is the entire formula to be processed, that is, the selected content is After performing the merge operation, the formula in the formula editing interface will be: Before editing the selected content, the number of formulas in the formula editing interface was 2. After editing the selected content, the number of formulas in the formula editing interface was 1. That is, the number of formulas in the formula editing interface after editing the selected content is less than the number of formulas in the formula editing interface before editing the selected content.

[0082] This invention provides a method for editing formulas. First, it acquires a user's selection operation on a formula to be processed within a formula editing interface. Second, it determines the selected content corresponding to the selection operation. Then, it acquires the user's movement operation on the selected content within the formula editing interface. Finally, in response to the movement operation, it completes the editing of the selected content. The editing of the selected content includes merging it into a target formula and / or splitting it from the formula to be processed, where the target formula and the formula to be processed are two formulas within the formula editing interface. Using this method, editing of the selected content can be easily achieved by responding to the user's movement operation on the formula editing interface, thereby improving the efficiency of formula editing.

[0083] Based on the above embodiments, modified embodiments of the above embodiments are proposed. It should be noted that, in order to keep the description brief, only the differences from the above embodiments are described in the modified embodiments.

[0084] In one embodiment, determining the selected content corresponding to the selection operation includes:

[0085] Determine the selection position corresponding to the selection operation;

[0086] The selected content is determined based on the selected location and the formula to be processed. The selected content is drawn on a newly created layer, and the selected content is removed from the original layer displaying the formula to be processed.

[0087] Here, "selection location" refers to the position where the formula to be processed is selected. The selection location can be the position where the selection operation is applied on the formula editing interface. For example, when the selection operation is a point selection, the selection location can be the selected position; when the selection operation is a circle selection, the selection location can be the circled position, such as the location of the circle; when the selection operation is a swipe selection, the selection location is the position the swipe passes through. The selection location can be the position corresponding to the user's selection operation, obtained in real time.

[0088] In this embodiment, after determining the selected content, the layer content needs to be updated. Optionally, the selected content can be drawn on a newly created layer, and the selected content can be removed from the original layer displaying the formula to be processed.

[0089] Specifically, when determining the selected content, the selection position corresponding to the selection operation can be determined first. Then, the selected content can be determined based on the selection position and the formula to be processed. For example, the selected content can be determined based on the positional relationship between the bounding region corresponding to the selection position, the formula region corresponding to the formula to be processed, and the leaf node region corresponding to the leaf node of the formula to be processed. Different selection operations can correspond to different determination methods.

[0090] The outer region can be understood as the smallest outer region containing the selected location. For example, the outer region can be the smallest bounding rectangle enclosing the selected location, or it can be the region bounded by the selected location. The outer region of the selected location corresponding to the selection operation may include the formula region corresponding to the formula to be processed. Therefore, the selected content can be determined by judging whether the outer region of the selected location corresponding to the selection operation includes the formula region corresponding to the formula to be processed: when the outer region of the selected location corresponding to the selection operation includes the formula region corresponding to the formula to be processed, it can be considered that the outer region of the selected location includes the entire content of the formula to be processed, and the selected content is the formula to be processed; when the outer region of the selected location corresponding to the selection operation partially includes the formula region corresponding to the formula to be processed, it can be considered that the outer region of the selected location includes a portion of the content of the formula to be processed, and the selected content needs to be further determined based on the positional relationship between the leaf node regions corresponding to the leaf nodes of the formula to be processed; when the outer region of the selected location corresponding to the selection operation does not include the region corresponding to the formula to be processed, it can be considered that the formula to be processed or a portion of the content of the formula to be processed has not been selected.

[0091] As one possible approach, the steps for determining the selected content can be: when the outer region corresponding to the selected position includes the formula region corresponding to the formula to be processed, the formula to be processed is the selected content.

[0092] It is understandable that when the outer region of the selection position corresponding to the selection operation includes the formula region corresponding to the formula to be processed, the formula to be processed can be considered as the selected content.

[0093] As another possible approach, the step of determining the selected content can also be as follows: before the selection end event is triggered, traverse the leaf node region corresponding to each leaf node of the formula to be processed expressed in a tree structure, and determine whether each leaf node region contains the selected position; if so, determine the leaf node corresponding to the leaf node region containing the selected position as the selected leaf node; otherwise, return to continue to obtain the user's selection operation of the formula to be processed on the formula editing interface.

[0094] After the selection end event is triggered, the outer region of the selection position corresponding to all selection operations before the selection end event is triggered is determined. The leaf node region corresponding to each leaf node of the formula to be processed expressed in a tree structure is traversed to determine whether the outer region contains the leaf node region corresponding to each leaf node. The leaf node corresponding to the contained leaf node region is determined as the selected leaf node. The selected content is determined according to the selected leaf node.

[0095] In this context, a leaf node can be a node with no child nodes, also known as a terminal node, and its degree is 0; a node region can be the smallest region containing nodes, such as... Figure 1b As shown, the area selected by the rectangle is the node region of each node, and the leaf node region is the region where the leaf nodes are selected. The leaf node region can be considered as the position of the corresponding leaf node in the formula to be processed. This position can be a range value, such as... Figure 1b The rectangle containing the content of a leaf node can be considered its leaf node region. Figure 1b In the formula, 2 is a leaf node, and the area enclosed by the rectangle around 2 is the leaf node region corresponding to leaf node 2. The selected leaf node can be considered as the selected leaf node. The number of selected leaf nodes is unlimited. It is necessary to traverse the leaf node region corresponding to each leaf node of the formula to be processed expressed in a tree structure to further determine all the selected leaf nodes and determine the selected content.

[0096] The "select end event" can be understood as ending the selection of the formula to be processed. The triggering method of the "select end event" is not limited. For example, it can be triggered when the mouse or finger is lifted, or it can be automatically triggered when a set first time threshold is reached. The time threshold is set by the system or relevant personnel. This embodiment does not limit this.

[0097] It should be noted that this step can be executed repeatedly. For example, after the formula to be processed is selected for the first time, the first selected content can be determined first, and then the formula to be processed can be selected for the second time to determine the second selected content, until the set second time threshold is triggered. The loop ends, and the first selected content, the second selected content, ... are combined into the selected content. The first and second selections, the first selected content, and the second selected content are only used to distinguish different stages.

[0098] In this step, before the end event is triggered, the selected leaf nodes can be determined to determine the subsequent selections. Specifically, before the end event is triggered, the leaf node regions corresponding to each leaf node of the formula to be processed, expressed in a tree structure, can be traversed to determine whether each leaf node region contains a selection position: the first leaf node region is set as the current leaf node region, and it is determined whether the current leaf node region contains a selection position. If the current leaf node region contains a selection position, the leaf node corresponding to the current leaf node region is determined as the selected leaf node, the next leaf node region is set as the current leaf node region, and it is determined whether the current leaf node region contains a selection position. If the current leaf node region does not contain a selection position, the next leaf node region is set as the current leaf node region, and it is determined whether the current leaf node region contains a selection position. This process continues until all leaf node regions corresponding to all leaf nodes are traversed, and all selected leaf nodes are determined. If none of the leaf node regions corresponding to all leaf nodes contain a selection position, the user's selection operation on the formula to be processed in the formula editing interface is then retrieved.

[0099] After the selected leaf nodes are determined, they can be displayed separately to indicate that the selected leaf nodes have been selected.

[0100] After the end event is triggered, the selected leaf nodes can be further confirmed to ensure that all selected leaf nodes are confirmed, thus guaranteeing the integrity of the selected content.

[0101] Specifically, it can determine the outer region of the selected position corresponding to all selection operations before the end of the selection event is triggered, traverse the leaf node region corresponding to each leaf node of the formula to be processed expressed in a tree structure, determine whether the outer region contains the leaf node region corresponding to each leaf node, and determine the leaf node corresponding to the leaf node region that is contained as the selected leaf node; if the outer region does not contain the leaf node region corresponding to each leaf node, no operation is performed.

[0102] The above steps can be used to obtain all the selected leaf nodes, and then the selected content can be determined based on the selected leaf nodes. Specifically, all the selected leaf nodes can be directly determined as the selected content, or the selected content can be obtained after verifying and organizing all the selected leaf nodes. For example, if all the child nodes of a certain node are selected leaf nodes, then the selected content also includes that node. This embodiment does not limit the determination of the selected content based on the selected leaf nodes.

[0103] As can be seen from the above description, as another way to determine the selected content, this step ensures the integrity of the selected content by doubly determining the selected leaf nodes, thereby improving the accuracy of formula editing.

[0104] In one embodiment, determining the selected content based on the selected leaf node includes:

[0105] If the selected leaf node includes all child nodes of the target node, then the selection status of the target node is set to selected;

[0106] When the separation relationship between the selected leaf node and its corresponding parent node is non-separable, the selection status of the corresponding parent node is set to selected;

[0107] The selected leaf node, the target node that is selected, and the parent node that is selected are defined as the selected content.

[0108] The purpose of this embodiment is to obtain the selected content after further verification and organization of the selected leaf nodes. The specific method of verification and organization can be to set the node selection status according to the relationship or attributes of the selected leaf nodes, and then combine the selected leaf nodes and the nodes with the selected status to determine the selected content.

[0109] In this context, the target node can be understood as a node whose child nodes are contained within the selected leaf node. This embodiment can iterate through all formulas within the formula editing interface to determine if the target formula exists.

[0110] Specifically, determining the selected content based on the selected leaf node can be optimized as follows: when the selected leaf node includes all child nodes of the target node, the selection status of the target node is set to selected; and / or, when the separation relationship between the selected leaf node and its corresponding parent node is non-separable, the selection status of the corresponding parent node is set to selected. Finally, the selected leaf node, the target node with the selected status, and the parent node with the selected status are determined as the selected content.

[0111] For example, when the selected leaf nodes include leaf node a and leaf node i, and a i If the nodes include leaf node a and leaf node i, then the target node a will be... i The selection state is set to selected; when the selected leaf node includes leaf node ∑, the leaf node cannot be detached from its parent node. Then set the selection state of its parent node to selected; finally, set the selected leaf nodes a, i, ∑, and the target node a to be selected. i and the parent node whose selection state is selected. Confirm as selected content, that is, the selected content is a i 、a、i、∑.

[0112] This embodiment does not limit the determination of the stripping relationship; for example, it can be determined by analyzing the formula to be processed. The selection state can be considered as a state representing whether it is selected.

[0113] Example 2

[0114] Figure 2 This is a flowchart illustrating a method for editing formulas according to Embodiment 2 of the present invention, which optimizes upon the aforementioned embodiments. In this embodiment, responding to the movement operation to complete the editing of the selected content is further specified as follows: after detecting a movement end event, if the area corresponding to the target formula does not include the target position corresponding to the movement operation, a formula splitting operation is performed; otherwise, a formula merging operation is performed. After detecting a movement end event, if the formula editing interface only includes the formula to be processed, and the formula area corresponding to the formula to be processed does not include the target position corresponding to the movement operation, a formula splitting operation is performed. After detecting a movement end event, if the target position corresponding to the movement operation is located within a set area, a formula splitting operation is performed.

[0115] For details not covered in this embodiment, please refer to Embodiment 1.

[0116] like Figure 2 As shown in the schematic diagram of a method for editing formulas provided in Embodiment 2 of the present invention, the method includes the following steps:

[0117] S210. Obtain the user's selection operation for the formula to be processed on the formula editing interface.

[0118] S220. Confirm the selected content corresponding to the selection operation.

[0119] S230. Obtain the user's movement operation on the selected content in the formula editing interface.

[0120] S240. After detecting the end of movement event, determine whether the area corresponding to the target formula does not include the target position corresponding to the movement operation. If yes, execute S250; otherwise, execute S260.

[0121] The target formula can be considered as the final formula to be merged, and the region corresponding to the target formula can be considered as the smallest region that encloses the target formula.

[0122] The target position corresponding to the move operation can be understood as the final position of the selected content after the move operation is performed. For example, the target position corresponding to the move operation can be the center position of the selected content area after the move end event is detected, or it can be another position of the selected content area.

[0123] In one embodiment, after detecting the end of the move event, if the formula editing interface only includes the formula to be processed, and the formula area corresponding to the formula to be processed does not include the target position corresponding to the move operation, then the formula splitting operation is performed.

[0124] In one embodiment, after detecting a move end event, if the target position corresponding to the move operation is within a defined area, a formula splitting operation is performed. In this embodiment, a defined area is defined to perform the formula splitting operation. When the target position is within the defined area, it can be assumed that the selected content will be split from the formula to be processed.

[0125] In this embodiment, after detecting the end of movement event, subsequent operations can be determined based on the positional relationship between the area corresponding to the target formula and the target position corresponding to the movement operation. Specifically, it can be determined whether the area corresponding to the target formula does not include the target position corresponding to the movement operation, and subsequent editing operations can be determined based on this determination step.

[0126] For example, when the target position corresponding to the move operation is not included in the area corresponding to the target formula, that is, the target position corresponding to the move operation is not in the area corresponding to the target formula, it means that the target position corresponding to the move operation is located outside the area corresponding to the target formula. It can be considered that the formula to be processed is performing a formula splitting operation, and then step S250 is executed.

[0127] Correspondingly, when the area corresponding to the target formula includes the target position corresponding to the move operation, that is, when the target position corresponding to the move operation is within the area corresponding to the target formula, it indicates that the formula to be processed and the target formula are performing a formula merging operation, and step S260 is executed.

[0128] S250, Perform formula splitting operation, and end the operation.

[0129] This step does not limit the specific means of splitting, such as redrawing the tree structure and then drawing formulas based on the redrawn tree structure.

[0130] In one embodiment, the formula splitting operation includes: redetermining a first tree structure of the formula to be processed after removing the selected content, and determining a second tree structure of the selected content; redrawing the formula to be processed on the original layer of the formula to be processed according to the first tree structure and the size and position of each node in the first tree structure; and drawing the selected content on the original layer of the formula to be processed according to the second tree structure and the size and position of each node in the second tree structure.

[0131] The first tree structure can be considered as the tree structure after the selected content is removed from the formula to be processed, and the second tree structure can be the tree structure of the selected content. The first tree structure and the second tree structure are only used to distinguish different objects.

[0132] It is understandable that when splitting the formula, the tree structure of the formula to be processed needs to be adjusted, the nodes of the selected content need to be removed, and the size and position of each node in the original tree structure need to be recalculated; a new tree structure needs to be constructed from the nodes of the selected content, and the size and position of the nodes in the new tree structure need to be calculated; finally, the formula to be processed and the selected content need to be drawn on the layer according to each tree structure and the size and position of each node in each tree structure. The drawing position is not limited, and may include the location of the formula to be processed, the endpoint of the move operation and / or a preset position. This embodiment does not limit the preset position.

[0133] Specifically, the process of performing formula splitting can be described as follows: First, redetermine the first tree structure of the formula to be processed after removing the selected content, and determine the second tree structure of the selected content; then, based on the first tree structure and the size and position of each node in the first tree structure, redraw the formula to be processed on the original layer of the formula to be processed; finally, based on the second tree structure and the size and position of each node in the second tree structure, draw the selected content on the original layer of the formula to be processed.

[0134] S260, Perform formula merging operation.

[0135] This embodiment does not limit the formula merging operation, as long as it can merge the target formula and the formula to be processed. For example, the merging position of the formula to be processed in the target formula can be determined based on the target position corresponding to the move operation. The merging position is the position of the formula to be processed in the target formula after merging.

[0136] In one embodiment, the formula merging operation includes: merging the selected content and the target formula to obtain a merged formula; and updating the target formula on the original layer to the merged formula.

[0137] When merging formulas, the selected content and the target formula must first be merged to obtain the merged formula. Then, the merged formula is updated on the original layer. Merging methods can be determined based on the distance between the selected content and the four sides of the area containing the target formula, or by the content of the selected content and the target formula.

[0138] For example, when merging the selected content and the target formula, the selection can be judged sequentially on a node-by-node basis to determine the merging position of the selected content. Under conditions that conform to the formula's rules, this embodiment can merge the formula to be processed into any position of the target formula.

[0139] Embodiment 2 of the present invention provides a method for editing formulas. The method includes: acquiring a user's selection operation on a formula editing interface; determining the selected content corresponding to the selection operation; acquiring the user's movement operation on the selected content on the formula editing interface; and, after detecting a movement end event, if the area corresponding to the target formula does not include the target position corresponding to the movement operation, performing a formula splitting operation; otherwise, performing a formula merging operation; wherein the target formula and the formula to be processed are two formulas within the formula editing interface. Using this method, by determining whether the area corresponding to the target formula does not include the target position corresponding to the movement operation, it is possible to determine whether to perform a splitting or merging operation on the formula, thereby completing the editing of the formula.

[0140] Based on the above embodiments, modified embodiments of the above embodiments are proposed. It should be noted that, in order to keep the description brief, only the differences from the above embodiments are described in the modified embodiments.

[0141] In one embodiment, merging the selected content and the target formula to obtain a merged formula includes:

[0142] The root node of the target formula represented by the tree structure is determined as the target node;

[0143] Traverse all child nodes of the target node and determine the target child node that is closest to the target position of the selected content among all child nodes;

[0144] The target child node is determined as the new target node, and the merged formula is determined based on the target location of the selected content and the target node region corresponding to the new target node.

[0145] In this context, the root node can be considered the topmost node in a tree structure when the formula is represented as a tree; the target node can be considered the node whose merging with the formula to be processed is to be determined, and the target node can contain one or more child nodes; the target child node can be the node among all the child nodes of the target node that is closest to the target position of the selected content; the target position of the selected content can be any position of the selected content, such as the center point of the selected content after the move ends, the position where the user acts on the selected content after the user's move operation ends, i.e., the position of the touch point when the user acts on the selected content, or any point in the area corresponding to the selected content. In this embodiment, the target position of the selected content can be displayed as a point on the formula editing interface to facilitate the user's merging operation.

[0146] Understandably, the process involves first determining the root node when the target formula is represented in a tree structure, then traversing all child nodes of the root node to determine the child node closest to the target position of the selected content, and finally determining the merged formula based on the target position of the selected content and the child node region corresponding to the determined child node.

[0147] Specifically, the root node of the target formula represented by the tree structure can be determined as the target node; then all child nodes of the target node are traversed to determine the target child node that is closest to the target position of the selected content; finally, the target child node is determined as the new target node, and the merged formula is determined based on the target position of the selected content and the target node area corresponding to the new target node.

[0148] The method for distance determination is not limited here. For example, it can be determined by a point-to-edge method. The target position of the selected content can be considered as a point, such as the location of the center region of the formula to be processed. The distances from the target position of the selected content to each edge of the region corresponding to all child nodes of the target node are determined sequentially. For a child node, the corresponding region can be four edges forming a rectangle. The distance from the target position of the selected content to that child node can be the distance between the target position of the selected content and the shortest of the four edges.

[0149] When determining the merged formula based on the target location of the selected content and the target node region corresponding to the new target node, the merging method can be determined based on whether the target location of the selected content is within the new target node region; no specific limitation is made here. For example, if the target location of the selected content is not within the new target node region, the new target node and the formula to be processed can be merged directly; otherwise, a new target node can be selected for further judgment, and the selected new target node can be the child node of the original target node that is closest to the target location.

[0150] In one embodiment, determining the merged formula based on the target location of the selected content and the target node region corresponding to the new target node includes:

[0151] When the new target node region includes the target position of the selected content, determine whether the new target node is a leaf node. If not, return to the operation of traversing all child nodes of the new target node. If yes, update the tree structure of the target formula according to the target position of the selected content, the positional relationship of the new target node region, and the first update strategy.

[0152] When the target node region does not include the target location of the selected content, the tree structure of the target formula is updated according to the target location of the selected content, the positional relationship of the new target node region, and the second update strategy.

[0153] The first update strategy may include: determining whether the target position of the selected content is to the left or right of the new target node area. If the target position is to the left of the new target node area, a sibling node is added before the new target node, and the added node is the node of the selected content. If the target position is to the right of the new target node area, a sibling node is added after the new target node, and the added node is the node of the selected content. Here, sibling nodes mainly refer to child nodes that share the same parent node. "Front and back" represents the order of elements within the tree structure. The order of elements in the formula to be processed corresponds to the order of elements in the tree structure, and the same applies to the order of elements above and below.

[0154] The second update strategy may include: determining the positional relationship between the target position of the selected content and the new target node area; if the target position of the selected content is to the left of the new target node area, a sibling node is added before the new target node, and the added node is the node of the selected content; if the target position of the selected content is to the right of the new target node area, a sibling node is added after the new target node, and the added node is the node of the selected content; if the target position of the selected content is above or below the new target node area, a new node is created to replace the target node, and the new target node is used as the child node of the new node. Specifically, if the target position of the selected content is above the new target node area, the node of the selected content is the previous sibling node of the new target node; if the target position of the selected content is below the new target node area, the node of the selected content is the next sibling node of the new target node.

[0155] When determining the merged formula based on the target location of the selected content and the target node region corresponding to the new target node, the process first checks whether the new target node region includes the target location of the selected content. If it does, it further checks whether the new target node is a leaf node. If it is, the tree structure of the target formula is updated based on the target location of the selected content, the positional relationship of the new target node region, and the first update strategy. If the new target node is not a leaf node, the process returns to traversing all child nodes of the new target node, determining the child node closest to the target location of the selected content. This determined child node is then identified as the new target node, and the process restarts to determine whether the new target node region includes the target location of the selected content. If the new target node region does not include the target location of the selected content, the tree structure of the target formula is updated based on the target location of the selected content, the positional relationship of the new target node region, and the second update strategy.

[0156] In this embodiment, when the target location of the selected content is within the new target node region, it is further determined whether the new target node is a leaf node, so that the formula to be processed can be merged at any position of the target formula.

[0157] The present invention will be described by way of example below. Figure 2a This is a flowchart illustrating the process of selecting content in a splitting formula method provided in Embodiment 2 of the present invention, as shown below. Figure 2a As shown, users can select content via touch or mouse. The display device can receive user input and determine whether input has ended by detecting the presence of a selection end event, such as the Up event (touch or mouse release). The input point position can be considered the selection position. When user input is received and no Up event is detected, it can be assumed that the user is currently inputting. That is, before the selection end event is triggered, the regions of all leaf nodes can be traversed. That is, the leaf node regions corresponding to each leaf node of the formula to be processed, expressed in a tree structure, can be traversed to determine whether the node region, i.e., the leaf node region, contains the input point position (i.e., the selection position). If it does, the corresponding leaf node can be considered selected; otherwise, if it does not and all leaf nodes have been traversed, the user input can continue to be acquired.

[0158] After detecting the Up event, the bounded region formed by all input points can be calculated, that is, the bounded region of the selected positions corresponding to all selection operations before the selection end event is triggered. Then, the regions of all leaf nodes are traversed to determine whether the bounded region contains the regions of the corresponding leaf nodes of each leaf node. If it does, the included leaf node is selected and included in the selected leaf node. If it does not, no processing is performed, and the operation of determining the selected content based on the selected leaf node is directly executed, that is, the operation of verifying and organizing all selected nodes is performed: when all child nodes are selected, the corresponding parent node is selected, that is, if the selected leaf node includes all child nodes of the target node, the selection state of the target node is set to selected; when the selected child node cannot be separated from its parent node, the parent node is marked as selected, that is, when the separation relationship between the selected leaf node and its corresponding parent node is not separable, the selection state of the corresponding parent node is set to selected. In order to make the selected node clearly visible to the user, the selected part, that is, the selected content, can be marked with a UI mark to show that the selected content is selected. The method of UI marking is not limited here, such as highlighting, or distinguishing the display by color, thickness, etc.

[0159] Figure 2b This is a flowchart illustrating the process of updating layer content in a splitting formula method provided in Embodiment 2 of the present invention. Before moving the selected content, the layer content also needs to be updated, such as... Figure 2b As shown, the selected content is drawn on a new layer, and the unselected part of the formula is drawn on the old layer. In other words, the part of the formula to be processed, after removing the selected content, is drawn on the old layer.

[0160] Figure 2c This is a flowchart illustrating the process of moving selected content in a splitting formula method provided in Embodiment 2 of the present invention, as shown below. Figure 2cAs shown, users can move the selected content by touch or mouse. The Up event represents the touch or mouse release operation, i.e., the end of movement event. When user input is received but no Up event is detected, it can be assumed that the user is currently moving. The new layer position can then be updated based on the input position data to ensure the selected content moves to the position corresponding to the user's movement. The input position data can be considered the input point position. After detecting the Up event, the original formula tree (the tree structure corresponding to the data to be processed) can be reorganized to remove the split nodes (the selected content), thus obtaining the first tree structure. Then, the size and position of each node in the updated original tree are recalculated. A new tree is reconstructed for all selected nodes (the selected content), and the size and position of the new tree (the second tree structure) are calculated. Finally, the two formulas after splitting are drawn on the old layer based on the first and second tree structures respectively. After drawing, the new layer (the content on the new layer) is cleared, i.e., the selected content is removed from the new layer.

[0161] Figure 2d This is a flowchart illustrating the process of selecting content and updating layer content in a merging formula method provided in Embodiment 2 of the present invention, as shown below. Figure 2d As shown, users can select content by touch or mouse. The Up event can be the touch or mouse release operation, which is the selection end event.

[0162] After detecting the selection end event, the bounded region formed by all input points is calculated. This can be determined by traversing all leaf nodes or by directly comparing the bounded region with the formula region of the formula to be processed. If the bounded region contains the formula's region (i.e., the formula region), the formula is identified as the selected content, thus marking it as selected. Then, a new layer is created, and the selected formula (i.e., the selected content) is drawn on this new layer. Finally, the selected formula is removed from the old layer.

[0163] Understandably, when selecting formulas, this invention can first determine the circumscribed region of the selected location, and then compare the circumscribed region with the formula region to determine whether all formulas are selected; if not, it can traverse all leaf node regions to determine the selected nodes; or it can directly traverse all leaf nodes to determine the selected content.

[0164] It should be noted that the method for editing formulas provided by this invention can be considered as a formula splitting method when the actual editing is formula splitting, and as a formula merging method when the actual editing is formula merging.

[0165] Figure 2eThis is a flowchart illustrating the merging formula in a merging formula method provided in Embodiment 2 of the present invention, as shown below. Figure 2e As shown, in this step, when moving formulas during the merging process, the position of the new layer can be updated based on the input position data. The details of this step are not elaborated here; please refer to the content related to splitting formulas. During the movement of the formula to be processed, this invention can determine in real time whether the center point P of the selected formula area (i.e., the formula area to be processed) enters the target formula's hot zone (i.e., the area corresponding to the target formula). If so, the interface, such as the formula editing interface, can provide feedback to the user indicating whether merging is possible, such as highlighting the target function (i.e., the target formula). If not, it can continue to acquire user input. It should be noted that when determining whether the formula to be processed falls into the area corresponding to the target formula, this invention can determine not only based on the center point of the formula to be processed but also based on any position of the formula to be processed, such as the position where the formula to be processed is manipulated during the movement, or by using the corner points of the area corresponding to the formula to be processed.

[0166] After detecting the Up event (move end event), it can be determined whether there are any points that can be merged. Specifically, it checks whether the current position of the formula to be processed falls within the area corresponding to the target formula when the move end event occurs. If so, the selected formula (the formula to be processed) and the target formula can be merged according to certain rules. After merging, the new layer is cleared, and the merged new formula is redrawn on the old layer.

[0167] Figure 2f This is a flowchart illustrating the merging strategy in a merging formula method provided in Embodiment 2 of the present invention, as shown below. Figure 2f As shown, the specific merging strategy needs to be determined based on whether the center point of the formula region corresponding to the formula to be processed falls within the target node region. In this embodiment, the root node of the target formula can be determined as the target node. Then, the child nodes of the target node are traversed to find the child node closest to the center point of the formula region corresponding to the formula to be processed. Here, the determination of the center point is not limited; that is, the target position includes the center point P, and can also include other positions of the formula to be processed, such as any point on the edge of the formula region corresponding to the formula to be processed. Different target positions can correspond to different judgment methods when further determining the merging strategy. When judging by the center point, it can be determined by whether the center point is within the target node region. When judging by any point on the edge of the formula region, it can be compared with the edge or center point of the target node's formula region. As long as the overlap area between the formula region of the formula to be processed and the target node region reaches a set area threshold, the position of the formula to be processed within the target formula region can be directly determined; otherwise, it can continue to determine whether the target child node is a leaf node.

[0168] For example, if the center point P is within the target node's region, we can determine whether P is to the left or right, or up or down, within that region. If the center point P is not within the target node's region, we can determine whether the target node is a leaf node. If not, we continue traversing the target node's child nodes. Otherwise, we determine whether P is to the left or right of the target node's region.

[0169] For example, with Taking this as an example, the steps for formula decomposition are described.

[0170] Figure 2g This is a schematic diagram illustrating the effect of selecting selected content according to Embodiment 2 of the present invention. Figure 2h This is a schematic diagram illustrating the effect after the selected content is determined, as provided in Embodiment 2 of the present invention. Figure 2g and 2h As shown, first, freely draw the path that needs to be split. After drawing, highlight the selected content (n+1) by using a selection box.

[0171] Figure 2i This is a schematic diagram of the effect of splitting the formula to be processed according to Embodiment 2 of the present invention. Confirm that the part to be split (n+1) is selected, and then drag the selected part to other areas. Finally, confirm that (n+1) is split into the original formula, and the original formula to be processed is readjusted.

[0172] by Taking (n+1) as an example, the steps for merging the formulas are described.

[0173] Figure 2j This is a schematic diagram illustrating the effect of selecting a formula to be processed, provided in Embodiment 2 of the present invention. Figure 2k This is a schematic diagram illustrating the effect of moving a formula to be processed according to Embodiment 2 of the present invention. Figure 2l This is a schematic diagram illustrating the effect of formula merging provided in Embodiment 2 of the present invention, as shown below. Figure 2j , Figure 2k and Figure 2l As shown, first select the formula to be merged (n+1), then drag the selected formula to the target position (after n) of the target formula, and highlight the original formula. The target formula will then indicate that it can be merged. Finally, confirm the merge result.

[0174] Example 3

[0175] Figure 3 This is a schematic diagram of a formula editing device provided in Embodiment 3 of the present invention. The device is applicable to the situation of editing formulas. The device can be implemented by software and / or hardware and is generally integrated into a display device.

[0176] like Figure 3As shown, the device includes:

[0177] The selection operation acquisition module 310 is used to acquire the user's selection operation on the formula to be processed in the formula editing interface.

[0178] Content determination module 320 is used to determine the selected content corresponding to the selection operation;

[0179] The movement operation acquisition module 330 is used to acquire the user's movement operation on the selected content on the formula editing interface;

[0180] The response module 340 is used to respond to the movement operation and complete the editing of the selected content; wherein, the editing of the selected content includes merging into the target formula and / or splitting from the formula to be processed, wherein the target formula and the formula to be processed are two formulas within the formula editing interface.

[0181] Embodiment 3 of the present invention provides a formula editing device. This device acquires a user's selection operation on the formula editing interface via a selection operation acquisition module 310; determines the selected content corresponding to the selection operation via a content determination module 320; acquires the user's movement operation on the selected content on the formula editing interface via a movement operation acquisition module 330; and completes the editing of the selected content in response to the movement operation via a response module 340. The editing of the selected content includes merging it into a target formula and / or splitting it from the formula to be processed, where the target formula and the formula to be processed are two formulas within the formula editing interface. This device can easily edit the selected content by responding to the user's movement operation on the formula editing interface, thereby improving the efficiency of formula editing.

[0182] Furthermore, the content determination module 320 includes:

[0183] A selection position determination unit is used to determine the selection position corresponding to the selection operation;

[0184] The content determination unit is used to determine the selected content based on the selected position and the formula to be processed. The selected content is drawn on a newly created layer, and the selected content is removed from the original layer displaying the formula to be processed.

[0185] Furthermore, the content determination unit is specifically used for:

[0186] When the outer region corresponding to the selected position includes the formula region corresponding to the formula to be processed, the formula to be processed is the selected content.

[0187] Furthermore, the content determination unit includes:

[0188] Before the end event is triggered, the leaf node region corresponding to each leaf node of the formula to be processed, which is expressed in a tree structure, is traversed, and it is determined whether each leaf node region contains the selected position.

[0189] If so, the leaf node corresponding to the leaf node region containing the selected position is determined as the selected leaf node; otherwise, return to continue obtaining the user's selection operation of the formula to be processed on the formula editing interface.

[0190] After the selection end event is triggered, determine the outer region of the selection position corresponding to all selection operations before the selection end event is triggered, traverse the leaf node region corresponding to each leaf node of the formula to be processed expressed in a tree structure, and determine whether the outer region contains the leaf node region corresponding to each leaf node.

[0191] The leaf nodes corresponding to the included leaf node regions are identified as the selected leaf nodes;

[0192] The selected content is determined based on the selected leaf node.

[0193] Furthermore, the content determination unit includes:

[0194] If the selected leaf node includes all child nodes of the target node, then the selection status of the target node is set to selected;

[0195] When the separation relationship between the selected leaf node and its corresponding parent node is non-separable, the selection status of the corresponding parent node is set to selected;

[0196] The selected leaf node, the target node that is selected, and the parent node that is selected are defined as the selected content.

[0197] Furthermore, the response module 340 includes:

[0198] After detecting the end of movement event, if the area corresponding to the target formula does not include the target position corresponding to the movement operation, then the formula splitting operation is performed; otherwise, the formula merging operation is performed.

[0199] After detecting the end of the move event, if the formula editing interface only includes the formula to be processed, and the formula area corresponding to the formula to be processed does not include the target position corresponding to the move operation, then the formula splitting operation is performed.

[0200] After detecting the end of movement event, if the target position corresponding to the movement operation is located within the set area, then the formula splitting operation is executed.

[0201] Furthermore, the response module 340 includes a formula splitting module, which can be used specifically for:

[0202] Redetermine the first tree structure of the formula to be processed after removing the selected content, and determine the second tree structure of the selected content;

[0203] Based on the first tree structure and the size and position of each node within the first tree structure, redraw the formula to be processed on the original layer of the formula to be processed;

[0204] Based on the second tree structure and the size and position of each node within the second tree structure, draw the selected content on the original layer of the formula to be processed.

[0205] Furthermore, the response module 340 includes a formula merging module, specifically including:

[0206] The merging unit is used to merge the selected content and the target formula to obtain the merged formula;

[0207] The update unit is used to update the target formula on the original layer to the merged formula.

[0208] Furthermore, the merging unit includes:

[0209] The root node of the target formula represented by the tree structure is determined as the target node;

[0210] Traverse all child nodes of the target node and determine the target child node that is closest to the target position of the selected content among all child nodes;

[0211] The target child node is determined as the new target node, and the merged formula is determined based on the target location of the selected content and the target node region corresponding to the new target node.

[0212] Furthermore, the merging unit includes:

[0213] When the new target node region includes the target position of the selected content, determine whether the new target node is a leaf node. If not, return to the operation of traversing all child nodes of the new target node. If yes, update the tree structure of the target formula according to the target position of the selected content, the positional relationship of the new target node region, and the first update strategy.

[0214] When the new target node region does not include the target location of the selected content, the tree structure of the target formula is updated according to the target location of the selected content, the positional relationship of the new target node region, and the second update strategy.

[0215] The above-described formula editing device can execute the formula editing method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the method.

[0216] Example 4

[0217] Figure 4 This is a schematic diagram of the structure of a display device provided in Embodiment 4 of the present invention. Figure 4 As shown, the display device provided in Embodiment 4 of the present invention includes: one or more processors 41 and a storage device 42; the processor 41 in the display device may be one or more, Figure 4 Taking a processor 41 as an example; storage device 42 is used to store one or more programs; the one or more programs are executed by the one or more processors 41, so that the one or more processors 41 implement the editing formula method as described in any one embodiment of the present invention.

[0218] The display device may further include an input device 43 and an output device 44.

[0219] The processor 41, storage device 42, input device 43, and output device 44 in the display device can be connected via a bus or other means. Figure 4 Taking the example of a connection between China and Israel via a bus.

[0220] The storage device 42 in the display device serves as a computer-readable storage medium, which can be used to store one or more programs. These programs can be software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the formula editing method provided in Embodiment 1 or 2 of this invention (e.g., appendix). Figure 3 The modules in the formula editing device shown include: a selection operation acquisition module 310, a content determination module 320, a movement operation acquisition module 330, and a response module 340. The processor 41 executes various functional applications and data processing of the display device by running software programs, instructions, and modules stored in the storage device 42, thereby implementing the formula editing method in the above method embodiment.

[0221] Storage device 42 may include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a function; the data storage area may store data created based on the use of the display device, etc. Furthermore, storage device 42 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some instances, storage device 42 may further include memory remotely located relative to processor 41, and this remote memory may be connected to the device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0222] Input device 43 can be used to receive input digital or character information, and to generate key signal inputs related to user settings and function control of the display device. Output device 44 may include display devices such as a display screen.

[0223] Furthermore, when one or more programs included in the aforementioned display device are executed by one or more processors 41, the programs perform the following operations:

[0224] Get the user's selection of the formula to be processed in the formula editing interface;

[0225] Determine the selected content corresponding to the selection operation;

[0226] The user's movement operation on the selected content in the formula editing interface is obtained;

[0227] In response to the movement operation, the selected content is edited.

[0228] The editing of the selected content includes merging into the target formula and / or splitting from the formula to be processed, wherein the target formula and the formula to be processed are two formulas within the formula editing interface.

[0229] Example 5

[0230] Embodiment 5 of the present invention provides a computer-readable storage medium having a computer program stored thereon. When executed by a processor, the program is used to perform a formula editing method, the method comprising:

[0231] Get the user's selection of the formula to be processed in the formula editing interface;

[0232] Determine the selected content corresponding to the selection operation;

[0233] The user's movement operation on the selected content in the formula editing interface is obtained;

[0234] In response to the movement operation, the selected content is edited.

[0235] The editing of the selected content includes merging into the target formula and / or splitting from the formula to be processed, wherein the target formula and the formula to be processed are two formulas within the formula editing interface.

[0236] Optionally, when the program is executed by the processor, it can also be used to execute the formula editing method provided in any embodiment of the present invention.

[0237] The computer storage medium of this invention can be any combination of one or more computer-readable media. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, a portable CD-ROM, an optical storage device, a magnetic storage device, or any suitable combination thereof. A computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0238] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit programs for use by or in connection with an instruction execution system, apparatus, or device.

[0239] Program code contained on a computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, radio frequency (RF), etc., or any suitable combination thereof.

[0240] Computer program code for performing the operations of this invention can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0241] Note that the above description is merely a preferred embodiment of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of the present invention, the scope of which is determined by the scope of the appended claims.

Claims

1. A method for editing formulas, characterized in that, include: Get the user's selection of the formula to be processed in the formula editing interface; Determine the selected content corresponding to the selection operation; The user's movement operation on the selected content in the formula editing interface is obtained; In response to the movement operation, the selected content is edited. The editing of the selected content includes merging into the target formula and / or splitting from the formula to be processed, wherein the target formula and the formula to be processed are two formulas within the formula editing interface; The step of responding to the movement operation and completing the editing of the selected content includes: After detecting the end of the move event, if the target location corresponding to the move operation is not included in the area corresponding to the target formula, then the formula splitting operation is performed; otherwise, the formula merging operation is performed. After detecting the end of the move event, if the formula editing interface only includes the formula to be processed, and the formula area corresponding to the formula to be processed does not include the target position corresponding to the move operation, then the formula splitting operation is performed. After detecting the end of movement event, if the target position corresponding to the movement operation is within the set area, then the formula splitting operation is executed.

2. The method according to claim 1, characterized in that, Determining the selected content corresponding to the selection operation includes: Determine the selection position corresponding to the selection operation; The selected content is determined based on the selected location and the formula to be processed. The selected content is drawn on a newly created layer, and the selected content is removed from the original layer displaying the formula to be processed.

3. The method according to claim 2, characterized in that, The selected content is determined based on the selected location and the formula to be processed, including: When the outer region corresponding to the selected position includes the formula region corresponding to the formula to be processed, the formula to be processed is the selected content.

4. The method according to claim 2, characterized in that, The selected content is determined based on the selected location and the formula to be processed, including: Before the end event is triggered, the leaf node region corresponding to each leaf node of the formula to be processed, which is expressed in a tree structure, is traversed, and it is determined whether each leaf node region contains the selected position. If so, the leaf node corresponding to the leaf node region containing the selected position is determined as the selected leaf node; otherwise, return to continue obtaining the user's selection operation of the formula to be processed on the formula editing interface. After the selection end event is triggered, determine the outer region of the selection position corresponding to all selection operations before the selection end event is triggered, traverse the leaf node region corresponding to each leaf node of the formula to be processed expressed in a tree structure, and determine whether the outer region contains the leaf node region corresponding to each leaf node. The leaf nodes corresponding to the included leaf node regions are identified as the selected leaf nodes; The selected content is determined based on the selected leaf node.

5. The method according to claim 4, characterized in that, The selected content is determined based on the selected leaf node, including: If the selected leaf node includes all child nodes of the target node, then the selection status of the target node is set to selected; When the separation relationship between the selected leaf node and its corresponding parent node is non-separable, the selection status of the corresponding parent node is set to selected; The selected leaf node, the target node that is selected, and the parent node that is selected are defined as the selected content.

6. The method according to claim 1, characterized in that, Formula splitting operations include: Redetermine the first tree structure of the formula to be processed after removing the selected content, and determine the second tree structure of the selected content; Based on the first tree structure and the size and position of each node within the first tree structure, redraw the formula to be processed on the original layer of the formula to be processed; Based on the second tree structure and the size and position of each node within the second tree structure, draw the selected content on the original layer of the formula to be processed.

7. The method according to claim 1, characterized in that, The formula merging operation includes: The selected content and the target formula are combined to obtain the combined formula; Update the target formula on the original layer to the merged formula.

8. The method according to claim 7, characterized in that, The selected content and the target formula are combined to obtain the combined formula, including: The root node of the target formula represented by the tree structure is determined as the target node; Traverse all child nodes of the target node and determine the target child node that is closest to the target location of the selected content. The target child node is determined as the new target node, and the merged formula is determined based on the target location of the selected content and the target node region corresponding to the new target node.

9. The method according to claim 8, characterized in that, The step of determining the merged formula based on the target location of the selected content and the target node region corresponding to the new target node includes: When the target node region includes the target position of the selected content, determine whether the new target node is a leaf node. If not, return to the operation of traversing all child nodes of the new target node. If yes, update the tree structure of the target formula according to the target position of the selected content, the positional relationship of the target node region, and the first update strategy. When the target node region does not include the target location of the selected content, the tree structure of the target formula is updated according to the target location of the selected content, the positional relationship of the target node region, and the second update strategy.

10. An apparatus for editing formulas, characterized in that, The device includes: The selection operation acquisition module is used to acquire the user's selection operation on the formula to be processed in the formula editing interface; The content determination module is used to determine the selected content corresponding to the selection operation; A movement operation acquisition module is used to acquire the user's movement operation on the selected content on the formula editing interface; A response module is used to respond to the movement operation and complete the editing of the selected content; The editing of the selected content includes merging into the target formula and / or splitting from the formula to be processed, wherein the target formula and the formula to be processed are two formulas within the formula editing interface; Specifically, the response module is used for: After detecting the end of the move event, if the target location corresponding to the move operation is not included in the area corresponding to the target formula, then the formula splitting operation is performed; otherwise, the formula merging operation is performed. After detecting the end of the move event, if the formula editing interface only includes the formula to be processed, and the formula area corresponding to the formula to be processed does not include the target position corresponding to the move operation, then the formula splitting operation is performed. After detecting the end of movement event, if the target position corresponding to the movement operation is within the set area, then the formula splitting operation is executed.

11. A display device, characterized in that, include: One or more processors; Storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-9.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-9.

Citation Information

Patent Citations

  • Method and apparatus for modifying formula operator

    CN101436309A

  • Method and device for generating streaming documents

    CN103425634A

  • Mathematical formula index creation method and system for retrieval system

    CN110795526A