Method for generating graphic frame and related device

CN122593658APending Publication Date: 2026-08-18SHENZHEN ZHIHEXING TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610691382.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-19
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

这种图文分离的模式,导致用户输入的图文信息无法作为一个整体进行存储和流转

Benefits of technology

本申请实施例提供了一种图文框生成方法及相关设备,显示图文编辑界面,所述图文编辑界面包括元素,所述元素包括文本框元素和图片框元素,每一所述元素对应唯一索引,所述文本框元素和所述图片框元素作为有序元素存储于图文框控件对象的数据结构中;响应于所述图文编辑界面中光标在所述元素之间的切换操作,确定目标元素;并根据所述目标元素的类型,更新所述图文框控件对象中所述目标元素的值以重新渲染所述图文编辑界面。如此,通过将文本框元素和图片框元素作为有序元素存储于图文框控件对象的数据结构中,确保输出数据结构清晰、标准,能够融入各种业务流程中,有利于提高工作效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122593658A_ABST
    Figure CN122593658A_ABST
Patent Text Reader

Abstract

The application discloses a kind of graphic-text frame generation method and related equipment, comprising: display graphic-text editing interface, graphic-text editing interface includes element, element includes text box element and picture frame element, each element corresponds unique index, text box element and picture frame element are stored in the data structure of graphic-text frame control object as ordered element;In response to the switching operation of cursor in graphic-text editing interface between element, determine target element;And according to the type of target element, update the value of target element in graphic-text frame control object to re-render graphic-text editing interface.It can be seen that, by the above method, it can ensure that output data structure is clear, standard, can be integrated into various business processes, and be conducive to improving work efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method for generating text and image frames and related equipment. Background Technology

[0002] Traditional form technologies (such as the input and textarea tags in HTML) can only handle plain text data. For rich media content such as images, they must be processed through a separate file upload field. This separation of text and images means that user-inputted text and image information cannot be stored and transferred as a whole. Although general-purpose rich text editors (such as Microsoft Word or various web-based editors) can handle mixed text and images, they typically generate HTML or specific binary formats containing a large amount of redundant style information. This results in a chaotic data structure that cannot be directly mapped to an interactive, structured document model with strict business constraints. The generated data is also difficult to parse and utilize effectively by subsequent business systems due to format mismatch, severely restricting the efficiency of document automation and business process integration. Summary of the Invention

[0003] This application provides a method and related equipment for generating graphic boxes. By storing text box elements and image box elements as ordered elements in the data structure of the graphic box control object, the output data structure is ensured to be clear and standardized, which can be integrated into various business processes and improves work efficiency.

[0004] Firstly, this application provides a method for generating image frames, including: The graphic editing interface is displayed. The graphic editing interface includes elements, including text box elements and image box elements. Each element corresponds to a unique index. The text box elements and the image box elements are stored as ordered elements in the data structure of the graphic box control object. In response to the cursor switching operation between elements in the text and image editing interface, a target element is determined; and according to the type of the target element, the value of the target element in the text and image box control object is updated to re-render the text and image editing interface.

[0005] In one possible implementation, in response to the switching operation of the cursor between the elements in the graphic editing interface, the cursor focus is switched, and the cursor position for inserting the target element is determined; If the target element is a text box, the cursor position, the target element, and the index of the target element are stored in the selected element focus of the current document. The element focus is used for the paste function of the text box element. If the target element is a picture box, then the image index of the image corresponding to the cursor position and the cell address corresponding to the image are determined. The image index, the cell address, the target element, and the index of the target element are stored in the selected element focus of the current document. The element focus is used for the paste function application of the picture box element.

[0006] In one possible implementation, responding to the cursor switching operation between the elements in the text and image editing interface includes: The cursor focus is switched, and based on the current cursor position corresponding to the cursor focus, the type of the adjacent elements of the element at the current cursor position, and the preset switching rules, the cursor focus is automatically switched to the specified input position of the adjacent element, and the focus style is dynamically updated during the switching process to complete the cursor switching operation between elements.

[0007] In one possible implementation, the data structure of the text box control object further includes: text box properties, the text box properties including at least one of the following: preset prompt, preset text box character count threshold, preset text box image count threshold, and preset style object; the preset style object includes at least one of the following: text color, alignment, and whether to automatically wrap text. The element also includes input box text values ​​and a collection of image subjects; wherein, the image box element includes a collection of image subjects composed of multiple image subjects, and the image box element is rendered in the image and text editing interface as a component including at least one of the image subjects, a left image input box, a right image input box, an image deletion marker, and an image serial number name editing box.

[0008] In one possible implementation, updating the value of the target element in the image / text box control object to re-render the image / text editing interface based on the type of the target element includes: If the target element is a text box, the starting position for text editing is determined based on the index of the target element and the cursor position. Based on the starting position of the text editing, iterate through all elements in the text box element; If the total number of characters in all elements is less than or equal to the preset character count threshold for the image and text box, then update the value of the text box element in the current image and text box control object to re-render the image and text editing interface; If the total number of characters in all elements exceeds the preset character count threshold for the image and text box, the extra strings are deleted, the text that meets the preset character count threshold is retained, and the value of the current image and text box control object is updated to re-render the image and text editing interface.

[0009] In one possible implementation, updating the value of the target element in the image / text box control object to re-render the image / text editing interface based on the type of the target element includes: If the target element is an image frame, then based on the index of the target element and the cursor position, determine the editing position of the left or right image input box in the image editing interface, and update the value of the image frame element in the current image frame control object to re-render the image editing interface.

[0010] In one possible implementation, the method further includes: Determine the cell address of the target element, and based on the cell address, query the document internal reference mapping table to obtain the cell address that needs to be synchronously modified for internal references, and update the cell data corresponding to the cell address that needs to be synchronously modified for internal references; and, Based on the document ID, query the document external reference mapping table to obtain the external document ID that references the target element and the external reference cell address in the external document ID, and update the cell data corresponding to the external reference cell address.

[0011] Secondly, a graphic frame generation apparatus according to this application includes: The display module is used to display the graphic editing interface. The graphic editing interface includes elements, including text box elements and picture box elements. Each element corresponds to a unique index. The text box elements and the picture box elements are stored as ordered elements in the data structure of the graphic box control object. The rendering module is used to respond to the cursor switching operation between elements in the image and text editing interface, determine the target element, and update the value of the target element in the image and text box control object according to the type of the target element to re-render the image and text editing interface.

[0012] Thirdly, an electronic device according to this application includes a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and the programs include instructions for performing steps in any method of the first aspect of the embodiments of this application.

[0013] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program for electronic data interchange, wherein the computer program causes a computer to perform some or all of the steps described in any method of the first aspect of this application.

[0014] Fifthly, embodiments of this application provide a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps described in any method of the first aspect of this application. The computer program product may be a software installation package.

[0015] By implementing this application, the following beneficial effects can be achieved: This application provides a method and related device for generating graphic text boxes, displaying a graphic text editing interface. The graphic text editing interface includes elements, including text box elements and image box elements. Each element corresponds to a unique index. The text box elements and image box elements are stored as ordered elements in the data structure of a graphic text box control object. In response to the cursor switching operation between the elements in the graphic text editing interface, a target element is determined. Based on the type of the target element, the value of the target element in the graphic text box control object is updated to re-render the graphic text editing interface. Thus, by storing text box elements and image box elements as ordered elements in the data structure of the graphic text box control object, the output data structure is ensured to be clear and standardized, allowing it to be integrated into various business processes and improving work efficiency. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 This is a schematic diagram of the architecture of a text frame generation system provided in an embodiment of this application; Figure 2 This is a flowchart illustrating a method for generating a text frame according to an embodiment of this application; Figure 3A This is a schematic diagram illustrating a graphic editing interface provided in an embodiment of this application; Figure 3B This is a schematic diagram illustrating another graphic editing interface provided in the embodiments of this application; Figure 4A This is a block diagram of the functional modules of a text frame generation device proposed in the embodiments of this application; Figure 4B This is a block diagram of the functional modules of another graphic frame generation device proposed in the embodiments of this application; Figure 5This is a schematic diagram of the structure of an electronic device proposed in an embodiment of this application. Detailed Implementation

[0018] It should be understood that the terms "first," "second," etc., used in the embodiments of this application are used to distinguish different objects, rather than to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, software, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may also include steps or units not listed, or may also include other steps or units inherent to these processes, methods, products, or devices.

[0019] The term "implementation" as used in the embodiments of this application means that a specific feature, structure, or characteristic described in connection with an implementation may be included in at least one implementation of this application. The appearance of this phrase in various places in the specification does not necessarily refer to the same implementation, nor is it a separate or alternative implementation mutually exclusive with other implementations. It will be explicitly and implicitly understood by those skilled in the art that the implementations described herein can be combined with other implementations.

[0020] In the embodiments of this application, "and / or" describes the relationship between associated objects, indicating that three relationships can exist. For example, for "A and / or B", the following three relationships exist: "A", "B", and "A and B".

[0021] In this embodiment of the application, the symbol " / " can indicate that the preceding and following related objects are in an "or" relationship.

[0022] In the embodiments of this application, "at least one item" or similar expressions refer to any combination of these items, including any combination of a single item or a plurality of items, which means one or more, and "multiple" means two or more.

[0023] In this application, "higher than" can be used interchangeably with "greater than," "lower than" can be used interchangeably with "less than," "not lower than" can be used interchangeably with "higher than or equal to" or "greater than or equal to," and "not higher than" can be used interchangeably with "lower than or equal to" or "less than or equal to." In this application, for the same solution, "equal to" can be used with "less than" or "greater than," but not simultaneously with both. When "equal to" is used with "less than," it applies to the technical solution adopted by "less than." When "equal to" is used with "greater than," it applies to the technical solution adopted by "greater than."

[0024] In the embodiments of this application, the terms "of", "corresponding / relevant", "corresponding", "indicated", and "associated" can be used interchangeably.

[0025] In the embodiments of this application, the terms "association", "corresponding", "is", "of", "belonging to", "as", and "considered as" may sometimes be used interchangeably.

[0026] In the embodiments of this application, "connection" refers to various connection methods such as direct connection or indirect connection to realize communication between devices, and no limitation is made in this regard.

[0027] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0028] The following is combined with, for example Figure 1 The following is an illustration of the architecture of a text box generation system in an embodiment of this application. The text box generation system includes a server 200a and multiple electronic devices (including electronic device 100a, electronic device 100b and electronic device 100c).

[0029] The server 200a can establish communication connections with multiple electronic devices (electronic devices 100a, 100b, and 100c); each of the multiple electronic devices (100a, 100b, and 100c) can correspond to multiple users, and each electronic device (electronic device 100a, 100b, or 100c) can correspond to one user.

[0030] Server 200a is used to perform computational tasks for generating interactive document templates, including generating image and text box controls corresponding to the image and text editing interface uploaded by electronic devices 100a, 100b, or 100c; generating document internal reference mapping tables and / or document external reference mapping tables corresponding to the document template; internal references within the document template and external references across documents; and synchronous modification of image and text box controls when the source image and text box controls are modified. It is the core of maintaining the consistency of document template content and logical control, and is the carrier for realizing the conversion of image and text data into interactive templates.

[0031] The electronic devices (electronic devices 100a, 100b, or 100c) involved in the embodiments of this application may include various handheld devices (mobile phones, tablets, etc.) with wireless communication functions, desktop computers, in-vehicle devices, wearable devices (smartwatches, smart bracelets, wireless headphones, augmented reality / virtual reality devices, smart glasses), computing devices or other processing devices connected to a wireless modem, as well as various forms of user equipment (UE), mobile station (MS), terminal device, etc. For ease of description, the devices mentioned above are collectively referred to as electronic devices.

[0032] Among them, electronic device 100a, electronic device 100b, or electronic device 100c can display a graphic editing interface. The graphic editing interface includes elements, including text box elements and picture box elements. Each element corresponds to a unique index. The text box elements and picture box elements are stored as ordered elements in the data structure of the graphic box control object. In response to the switching operation of the cursor between elements in the graphic editing interface, the target element is determined. And according to the type of the target element, the value of the target element in the graphic box control object is updated to re-render the graphic editing interface.

[0033] Among them, electronic devices 100a, 100b, or 100c are user-facing electronic devices used to initiate upload requests for image and document controls to server 200a, retrieve and load structured document templates, and conduct interactive control and multi-document collaborative processing operations based on document templates. They serve as the entry point for user-system interaction. Server 200a communicates with electronic devices 100a, 100b, or 100c to conduct stable data interaction, enabling the uplink transmission of user operation commands and the downlink feedback of image and document control data and processing results, ensuring smooth operation of the end-to-end process.

[0034] As can be seen, the architecture of the above-described image and text box generation system enables the generation and synchronous uploading of image and text box controls. When the source image and text box control in the document template is modified, its corresponding internal references or cross-document external references are synchronously modified. This ensures the efficiency and accuracy of synchronous modification of internal or external references of image and text box controls in response to user requests to modify or generate image and text box control objects in the document template via centralized server computing power, guaranteeing consistency of document template content. Furthermore, the interactive visual image and text editing interface on electronic devices enhances user convenience. Supporting electronic devices, the system stores text box elements and image box elements as ordered elements in the data structure of the image and text box control object, enabling mixed text and image editing. The structured storage of content ensures clear and standardized output data, allowing integration into various business processes. It effectively adapts to the generation and collaborative update needs of image and text box control objects in document templates in project R&D, manufacturing, and other business scenarios. Using user-input mixed text and image data throughout the project document improves work efficiency.

[0035] The following will combine Figure 2 This application describes a method for generating a text frame according to its embodiments. Figure 2 This is a flowchart illustrating a method for generating a text box according to an embodiment of this application. This method can be applied to... Figure 1 The electronic device shown (including electronic device 100a, electronic device 100b, or electronic device 100c) specifically includes the following steps: S201: Display the graphic editing interface, which includes elements, including text box elements and picture box elements. Each element corresponds to a unique index, and the text box elements and the picture box elements are stored as ordered elements in the data structure of the graphic box control object.

[0036] The electronic device may include multiple document templates. The document templates are pre-set based on the business collaboration requirements of project research and development and manufacturing. Then, according to the business requirements or rule configuration in the document template, some text needs to be inserted for display. Therefore, in this application, a graphic editing interface can be set in the document template for users to edit images and / or text in the interface.

[0037] The image and text editing interface is rendered by a mix of text boxes and image boxes, and this interface is stored using image and text box control objects. Each text box or image box can be considered an element, and each element has a unique index. These elements can be arranged in an ordered manner within the data structure of the image and text box control object. A design that separates content and style can be adopted to generate a standardized JSON data structure.

[0038] The graphic editing interface can receive selection operations from the user of the electronic device for elements. The attributes of the selection operation include the start position of the selection, the end position of the selection, and the value of the selected element, etc., which are not limited here.

[0039] Among them, electronic devices can achieve database persistence through graphic box control objects. When the graphic box control object changes, the graphic box control object can be synchronously modified in the server's database to achieve database persistence.

[0040] Within a single document template, multiple text and image editing interfaces can be included. Each text and image editing interface can correspond to a text and image box control, which includes the aforementioned text and image box control object. For example... Figure 3A The diagram illustrates a text and image editing interface. If the document template corresponds to the business requirement of developing a smart door lock, it can include the expected deliverables, usage scenarios, and main functional modules after project completion. The template can include text and image editing interface 1 and interface 2, corresponding to the expected deliverables, usage scenarios, and main functional modules, respectively. Different interfaces are used to display different project or presentation requirements within the document template. Text box elements and image box elements can be mixed and arranged in either interface 1 or interface 2, as shown in the specific arrangement. Figure 3B The text editing interface 1 or text editing interface 2 is shown, but no specific choice is made here.

[0041] In one possible implementation, the data structure of the text box control object further includes: text box properties, the text box properties including at least one of the following: preset prompt, preset text box character count threshold, preset text box image count threshold, and preset style object; the preset style object includes at least one of the following: text color, alignment, and whether to automatically wrap text. The element also includes input box text values ​​and a collection of image subjects; wherein, the image box element includes a collection of image subjects composed of multiple image subjects, and the image box element is rendered in the image and text editing interface as a component including at least one of the image subjects, a left image input box, a right image input box, an image deletion marker, and an image serial number name editing box.

[0042] The aforementioned preset prompts, preset text box character count thresholds, preset text box image quantity thresholds, and / or preset style objects can be pre-set by the system or device, and are not limited here. Preset prompts are used to inform users of the properties already set in the text box control, such as the text box character count threshold, text box image quantity threshold, etc. The preset text box character count threshold, preset text box image quantity threshold, and / or preset style can be adaptively set according to the business needs of the document template.

[0043] For example, when the text box control object has no value, a preset property tooltip can be displayed with gray text; otherwise, the entered text value can be displayed with the font of the set specific color.

[0044] For example, such as Figure 3B The image shown is a schematic diagram of another text and image editing interface, compared to... Figure 3A Consistently, if the document template corresponds to the business requirement of developing a smart door lock, the document template can include the expected deliverable modules after project completion, the scenarios in which the deliverables will be used, and their main functional modules. The expected deliverable modules after project completion correspond to the text and image editing interface 1, and the scenarios in which the deliverables will be used and their main functional modules correspond to the text and image editing interface 2. The text and image editing interface 1 or the text and image editing interface 2 contains a mixed arrangement of different numbers of text box elements and / or image box elements. In the text and image editing interface 1, the preset threshold for the number of characters in the text and image boxes is 50, the threshold for the number of images in the text and image boxes is 1, the text color is green, and the alignment is center alignment. Figure 3B The diagram shown may include text boxes containing text, such as "Smart door locks include: front panel + back panel + electronic mainboard + motor lock body + lock cylinder + power supply accessories" in the explanation of smart door lock business requirements, as well as image boxes containing inserted images, with text also inserted within these image boxes, such as " Figure 1 The "deliverables of the smart lock" are used to explain the images in the image box element; in the text and image editing interface 2, preset prompts, preset text box character count thresholds, preset text box image quantity thresholds, and / or preset style objects can be set as follows: the text box character count threshold is 100 characters, the text box image quantity threshold is 10, the text color is yellow, the alignment is justified, and the image box element is rendered in the text and image editing interface as including the image body, the left image input box, and the right image input box; such as Figure 3B As shown, users can continue to input specific text and images related to the "scenarios where the results are used and their main functional modules" using the keyboard and mouse, based on preset prompts, preset text box character thresholds, preset text box image quantity thresholds, and / or preset style objects in the text and image editing interface 2.

[0045] For example, it should be noted that the graphic frame editing interface provided in the above embodiments of this application can be modified in style according to the actual application requirements of the document template when dealing with different document templates or business needs, including but not limited to the style in this embodiment.

[0046] S202: In response to the cursor switching operation between the elements in the graphic editing interface, determine the target element; and update the value of the target element in the graphic box control object according to the type of the target element to re-render the graphic editing interface.

[0047] The target element can be a text box element or an image box element.

[0048] Among them, the electronic device can detect that the user switches elements by clicking on specific elements with the left mouse button, and obtain the element index corresponding to the target element, the cursor position of the inserted text box element or picture box element, etc.

[0049] For example, an electronic device can respond to the user's control by using the up, down, left and / or right keys on the keyboard to switch the cursor between elements. In this case, the switching operation only modifies the element attributes of the corresponding user interaction interface in the graphic editing interface, and does not persist them to the database.

[0050] Specifically, when the mouse loses focus and it is determined that the current text box control object has been modified, that is, the value of the target element in the text box control object has changed, the text box control object data needs to be persisted to the database to achieve data synchronization in the document.

[0051] For example, when the target element is a text box element, the electronic device can determine whether the text is selected based on whether the start position and the end position selected by the element attribute are the same, determine whether the cursor is at the beginning of the current target element based on whether the start position selected by the element attribute is 0, and determine whether the cursor is at the end of the current target element based on whether the end position selected by the element attribute is the length of the current text box input document.

[0052] For example, when the target element is an image frame element, the electronic device can determine whether the cursor is displayed in the left or right input box of the image based on the position of the image clicked. In this case, the current image subject's bounding box can be set to display yellow, and other image focus styles can be cleared.

[0053] As can be seen, the graphic box generation method described in this application displays a graphic editing interface, which includes elements, including text box elements and image box elements. Each element corresponds to a unique index. The text box elements and image box elements are stored as ordered elements in the data structure of the graphic box control object. In response to the cursor switching operation between the elements in the graphic editing interface, a target element is determined. Based on the type of the target element, the value of the target element in the graphic box control object is updated to re-render the graphic editing interface. Thus, by storing text box elements and image box elements as ordered elements in the data structure of the graphic box control object, the output data structure is ensured to be clear and standardized, enabling integration into various business processes and improving work efficiency.

[0054] In one possible implementation, the method further includes the following steps: in response to the switching operation of the cursor between elements in the text and image editing interface, switching the cursor focus and determining the cursor position where the target element is inserted; if the target element is a text box, storing the cursor position, the target element, and the index of the target element in the selected element focus corresponding to the current document, the element focus being used for the paste function application of the text box element; if the target element is an image box, determining the image index of the image corresponding to the cursor position and the cell address corresponding to the image, storing the image index, the cell address, the target element, and the index of the target element in the selected element focus corresponding to the current document, the element focus being used for the paste function application of the image box element.

[0055] The focus of the above elements is the global variable in the document template.

[0056] Users can edit text box elements or image box elements in the text and image editing interface by right-clicking the mouse. In this embodiment, the editing functions corresponding to text box elements include at least one of the following: paste function, insert image, etc., without limitation; the editing functions corresponding to image box elements include at least one of the following: paste function, adjust image size function, insert image function, etc., without limitation.

[0057] For example, when the target element is a text box, if the element focus is applied to the paste function of the text box element, the method for the electronic device to execute the paste function application with the target element being a text box element to update the value of the target element in the graphic text box control object and re-render the graphic text editing interface includes the following steps: First, the electronic device captures the focus of the selected element in the current document corresponding to the mouse click and retrieves data from the clipboard. If the data is empty, no operation is performed. If the pasted data type is text, plain text is added to the focus of the selected element. The electronic device detects that the user should trigger keyboard input to perform a preset text box character count threshold check. If the plain text character count is less than or equal to the preset text box character count threshold, the value of the current text box control object is updated responsively, and the text editing interface is re-rendered. If the plain text character count exceeds the preset text box character count threshold, the extra strings are deleted, and the text that meets the preset text box character count threshold is retained. The value of the current text box control object is updated responsively, and the text editing interface is re-rendered.

[0058] Furthermore, if the pasted data type is an image, the image size, format, and the preset image limit for the text box are first validated. The `documentTwInsertChildElement` interface (used for inserting images into text boxes) is then called, passing in the document ID, cell address, index of the target element in the element's focus, cursor position in the element's focus, and file type to create an image element object. Next, the `uploadMinio` interface (used for file uploads) is called, passing in the image data and file category type parameters. Based on the uploaded image name, time, and file category type, an image upload server address is generated. The image is then uploaded to the server, and simultaneously, the document ID and image upload server address are stored in the document resource table, while the ID generated from the document resource table is stored in the image element object. The uploaded image's default width is set to large. If the current document is vertical, the width is calculated as (768 - cell width - 20); if it's horizontal, the width is calculated as (1236 - cell column width - 20). If the original width of the uploaded image is not equal to the default width, the image is scaled up, and then the image height is calculated simultaneously. The calculated height and width are stored in the image element object. Finally, the electronic device pastes the image into the selected text. This can involve the following steps: adding it after the selected target element; or, cutting the selected target element into two segments based on the current cursor position, overwriting the selected target element's text with the first segment, creating a text element box, setting its value to the cut-off second segment, and adding it after the created image element; or, if pasting at the beginning or end of the selected text, adding it before the selected element; or, if pasting at the end of the selected text, adding it after the selected target element. This updates the value of the target element (text box element) in the image / text box control object to re-render the image / text editing interface, and then persists it to the database to refresh the image / text box control in the database.

[0059] For another example, when the target element is a picture box, if the element focus is applied to the paste function of the picture box element, the method for the electronic device to execute the paste function application with the target element as a picture box element to update the value of the target element in the text box control object and re-render the text editing interface includes the following steps: If the paste function is used to paste images, the electronic device first obtains data such as the element index, image index, and cell address stored in the focus of the selected element in the current document, and then retrieves the image data from the clipboard. Next, it validates the image size, format, and the number of images allowed in the image frame. It then calls the `documentImageUpload` interface (used for inserting images into image frames), passing in the document ID, cell address, the element index stored in the focus of the selected element, the image index, and the file. An image element object is created, and the file ID, width, and height are set after uploading the file to the document resource table. The image upload server address is stored in the document resource table, and the ID generated from the document resource table is stored in the image element object. The default width of the uploaded image is large. If the current document is vertical, the width is calculated as (768 - cell width - 20); if it is horizontal, the width is calculated as (1236 - width per column - 20). If the original width of the uploaded image is not equal to the default width, the image is resized, and then the image height is calculated simultaneously. The calculated height and width are then stored in the image element object. Finally, the image body is added to the corresponding target element (image box element) image body collection according to the element index to re-render the image and text editing interface, and then persisted to the database to refresh the image and text box control in the database.

[0060] If the paste function is used to paste text, the electronic device first retrieves the element index, image index, and cell address data stored in the focus of the selected element corresponding to the current document click, and then retrieves the text data from the clipboard. A text box element is created, and the user-inputted text value is stored in it. If the electronic device detects that the current cursor position is in the left image input box and not the first image, or the cursor is in the right image input box and not the last image, the specific steps may include the following: If the input position (current cursor position) is between two images, the image set is split into two sets based on the unique image index. An image box element is created, and the image set of the split portion is stored. The current image box element replaces the image set of the previous portion. The created text box element is added after the current element (which can be the target element, the target element corresponding to the element index stored in the focus of the selected element in the current document click), and the created image box element is added after the created text box element, and then persisted to the database. If the current cursor position is detected in the left image input box, the created text box element is added before the current element; if the cursor is detected in the right image input box, the created text box element is added after the current element, and then persisted to the database.

[0061] As can be seen, in this embodiment, the electronic device can detect the cursor switching operation between elements in the text and image editing interface and determine the target element corresponding to the switching operation. Based on the type of the target element, the element focus storage process differentiates and stores different key information such as element index, image index, and cell address into the document global variable of the element focus. This information is used for other editing functions such as pasting different types of elements. It supports the mutual conversion between images and text boxes, as well as the intelligent merging and splitting of adjacent elements, thereby realizing the mixed arrangement and editing of text and images in the text and image editing interface, and the adaptive rendering of text and images. This enables the electronic device to accurately identify and locate the current editing context in subsequent operations, avoiding data inconsistency problems caused by state loss or confusion, and ensuring the reliability and data integrity of the editing operation.

[0062] In one possible implementation, in response to the cursor switching operation between elements in the graphic editing interface, the following steps may be included: switching the cursor focus, and automatically switching the cursor focus to a specified input position of the adjacent element according to the current cursor position corresponding to the cursor focus, the type of the adjacent elements of the element at the current cursor position, and a preset switching rule, and dynamically updating the focus style during the switching process to complete the cursor switching operation between elements.

[0063] The electronic device can detect when a user switches the cursor focus using the up, down, left, and / or right keys on the keyboard, and determine the cursor position corresponding to the cursor focus, the type of the element at the cursor position, and the type of the adjacent elements of the element at the cursor position.

[0064] For example, the elements in the text and image editing interface are arranged in a mixed manner. When the element at the cursor position is a text box, its adjacent elements include text boxes or image boxes; when the element at the cursor position is an image box, its adjacent elements include text boxes or image boxes. Therefore, different switching rules are involved in the switching process, as shown in the following example: For example, if the current element at the current cursor position is a text box, the switching rules may include: when the electronic device detects that the user has pressed the up key and the cursor is at the first line of the current text box element, if the previous element is a text box element, the focus is switched to the previous text box element, and the cursor is set at the corresponding character position of the previous text box element according to the current cursor's character position in the line; if the number of characters in the previous text box element is less than the current cursor position, the cursor is set at the end of the previous text box element; if the previous element is an image box element, the focus is switched to the right input box of the image of the previous image box element, and the image body bounding box of the image box element is highlighted in a preset color.

[0065] For another example, if the current element at the current cursor position is a text box, the switching rules may include: when the electronic device detects that the user has pressed the down key and the cursor is at the last line of the current text box element: if the next element is a text box element, the focus is switched to the next text box element, and the cursor is set at the corresponding character position of the next text box element according to the current cursor's character position in the line; if the number of characters in the next text box element is less than the current cursor position, the cursor is set at the end of the next text box element; if the next element is an image box element, the focus is switched to the left input box of the image of the next image box element, and the image body bounding box of the image box element is highlighted in a preset color.

[0066] For another example, if the current element at the current cursor position is a text box, the switching rules may include: when the electronic device detects that the user has pressed the left button and the cursor is at the beginning of the current text box element: if the previous element is a text box element, the focus is switched to the end of the previous text box element; if the previous element is an image box element, the focus is switched to the right input box of the image of the previous image box element, and the image body bounding box of the image box element is highlighted in a preset color.

[0067] For another example, if the current element at the current cursor position is a text box, the switching rules may include: when the electronic device detects that the user has pressed the right mouse button and the cursor is at the end of the current text box element: if the next element is a text box element, the focus is switched to the first position of the next text box element; if the next element is an image box element, the focus is switched to the left input box of the image of the next image box element, and the image body bounding box of the image box element is highlighted in a preset color.

[0068] For example, if the current element at the current cursor position is a picture frame, the switching rules may include: when the electronic device detects that the user has pressed the up or left key and the cursor is at the beginning of the left input box of the first picture of the current picture frame element: if the previous element is a text box element, the focus is switched to the previous focusable text box element; if the previous element is a picture frame element, the focus is switched to the right input box of the last picture of the previous picture frame element, and the image body bounding box of that picture frame element is highlighted in a preset color.

[0069] As another example, if the current element at the current cursor position is a picture frame, the switching rule may further include: when the electronic device detects that the user has pressed the down key or the right key and the cursor is at the end of the right input box of the last picture of the current picture frame element: if the next element is a text box element, the focus is switched to the next focusable text box element; if the next element is a picture frame element, the focus is switched to the left input box of the first picture of the next picture frame element, and the image body boundary of the picture frame element is highlighted in a preset color.

[0070] In the example above, the preset color can be set to yellow to visually identify the currently focused image frame element in the image editing interface.

[0071] It should be noted that the above cursor switching operation only updates the front-end interactive state and does not trigger database persistence operations. Data persistence is only performed when the user makes the current element lose focus, which helps to avoid unnecessary network requests and data synchronization overhead.

[0072] As can be seen, in this embodiment, when switching between elements, the user can dynamically switch the cursor focus using the up, down, left, and / or right keys on the keyboard to complete the cursor switching operation between elements. Through preset intelligent switching rules, the user can seamlessly switch between text box elements and image box elements using the arrow keys, without the need for frequent mouse clicks. This keyboard-driven navigation method significantly improves the user's editing efficiency and operational smoothness; furthermore, the electronic device can intelligently determine and accurately set the target cursor position based on multiple contextual information such as the current cursor position, element type, and adjacent element types. For example, when switching between text boxes, it can maintain the character-level positional correspondence; when switching between image boxes, it can accurately identify the left / right input box, achieving context-aware and precise cursor positioning. This refined control greatly reduces the user's operational costs and cognitive burden.

[0073] In one possible implementation, updating the value of the target element in the text box control object to re-render the text editing interface based on the type of the target element may include the following steps: if the type of the target element is a text box, determine the starting position of text editing based on the index of the target element and the cursor position; traverse all elements in the text box based on the starting position of text editing; if the number of characters in the text of all elements is less than or equal to the preset text box character count threshold, update the value of the text box element in the current text box control object to re-render the text editing interface; if the number of characters in the text of all elements exceeds the preset text box character count threshold, delete the redundant strings, retain the text that meets the preset text box character count threshold, and update the value of the current text box control object to re-render the text editing interface.

[0074] The preset text box character limit is used to monitor and limit the total amount of text entered by the user in real time, so as to prevent system abnormalities such as memory overflow, interface lag, and data storage failure caused by excessively long text entered by the user.

[0075] It should be noted that other specific descriptions of the aforementioned preset text box character count threshold have been described in the foregoing embodiments and will not be repeated here.

[0076] As can be seen, in this embodiment, after detecting a change in the number of characters, the electronic device can immediately update the value of the text box control object and re-render the text editing interface, providing users with instant and intuitive visual feedback. Users can clearly see the current text status and the remaining number of characters that can be entered, enhancing the controllability and transparency of the operation.

[0077] In one possible implementation, in addition to the text box element pasting function in the above implementation, the text box element editing function in the image and text editing interface also includes functions such as copying, cutting, pasting, deleting, and inserting images, etc., which are not limited here.

[0078] For example, if the electronic device recognizes the target element as a text box, the "insert image" function is used to select the uploaded image. Its implementation logic is the same as the "paste image" logic described above, and will not be repeated here. The "copy" function copies the selected text or image to the clipboard. The "cut" function cuts the text or image from the text box to the clipboard. Generally, the copy operation is performed first, followed by the deletion operation of the text or image in the text box.

[0079] For example, if the electronic device recognizes that the target element is a text box, the editing functions corresponding to the text box element also include a carriage return function, which is used to add a newline character at the cursor position of the current element.

[0080] For example, if the electronic device recognizes that the target element is a text box, and the above editing function includes a deletion function, the deletion function specifically includes forward deletion and backward deletion. The application of the deletion function includes the following steps: In its implementation, when the deletion function is forward deletion, if the target element is a text box and has a text value, the electronic device can delete the text before the current cursor position, and the cursor position will be adjusted after deletion. If the target element is a text box and has no text value, and both the elements above and below it exist and are both image boxes, the image set of the lower image element is added to the image set of the upper image element, and the electronic device can delete the current target element and the element below it. If the target element is a text box and has no text value, and it is not the first element, but the previous element is a text box, the electronic device can find the previous focusable text box element, set the cursor to the end of the previous text box element, and delete the current target element. If the previous element is an image box, the electronic device can find the right input box of the image of the previous focusable image box element, the image's main bounding box is displayed in yellow, and the electronic device can delete the current target element.

[0081] On the other hand, when the deletion function is set to delete backwards, if the current target element is a text box and has a text value, the electronic device can delete the text after the current cursor position and adjust the cursor position after deletion. If the current target element is a text box and has no text value, and if both the elements above and below it exist and both are image boxes, the image set of the lower image element is added to the image set of the upper image element, and the current target element and the element below it are deleted. If the current target element is a text box and has no text value, and if it is not the last element, and the next element is a text box, the electronic device can find the next focusable text box element, set the cursor to the beginning of the next text box element, and delete the current target element. If the next element is an image box, the electronic device can find the left input box of the next focusable image box element, display the image's main bounding box in yellow, and delete the current target element.

[0082] As can be seen, in this embodiment, the electronic device provides a comprehensive and intelligent editing system for text box elements within the text and image editing interface. This system integrates various basic editing functions such as copy, cut, paste, delete, insert images, and enter, forming a complete editing toolset. Users can complete all common text and image editing operations without switching to other editors, greatly improving editing efficiency and workflow continuity. Furthermore, after performing a deletion operation, the system can intelligently locate the next focusable editing position based on the type of adjacent elements (text box or image box) and set the cursor to an appropriate position (end / beginning of the text box or left / right input box of the image box). This intelligent focus management avoids the tedious operation of manually repositioning the cursor. Additionally, the electronic device provides a unified interface for copying, cutting, and pasting operations for both text and image content. In particular, the image insertion function maintains consistency with the image pasting logic; this design consistency reduces the user's learning cost, allowing users to seamlessly switch between editing different content types. Finally, in mixed text and image editing scenarios, users often need to switch frequently between text and images. Through intelligent element recognition and focus management, users can complete complex cross-element editing tasks with simple keyboard operations (such as the delete key, enter key, etc.), which significantly improves editing efficiency in complex documents.

[0083] In one possible implementation, updating the value of the target element in the image and text box control object to re-render the image and text editing interface according to the type of the target element may include the following steps: if the type of the target element is an image box type, then determine the editing position of the left image input box or the right image input box in the image and text editing interface according to the index of the target element and the cursor position, and update the value in the image box element in the current image and text box control object to re-render the image and text editing interface.

[0084] The aforementioned correspondence between cursor position and element index is used by electronic devices to accurately identify and locate the specific editing position of the left or right input box of the image, and to intelligently identify whether the user intends to edit the input box on the left or right side of the image, without requiring the user to perform any additional selection operations.

[0085] As can be seen, in this embodiment, when a user performs an editing operation on the image box element, the system can immediately update the corresponding image box element value in the text box control object and trigger a re-render of the interface. Furthermore, by deeply integrating the editing logic of the image box element with the text box control object, the system can provide instant visual feedback and a smooth interactive experience when the user performs editing operations.

[0086] In one possible implementation, in addition to the paste function of the image frame element in the above implementation, the editing function of the image frame element in the image and text editing interface also includes functions such as copying, cutting, pasting, deleting, inserting images, and adjusting image size, which are not limited here.

[0087] It should be noted that the image box element control is a blank text box by default; the image box only appears after an image is inserted or pasted.

[0088] For example, if the electronic device recognizes that the target element is a picture frame, and the editing function of the picture frame element is the delete function, the delete function specifically includes forward deletion and backward deletion.

[0089] In its implementation, when the deletion function is set to delete forward, the electronic device detects that the current cursor position is in the left input box of the image and the target element is the first image. This can include the following steps: If the target element is not the first element, and the previous element is a text box, find the previous focusable text box element, set the cursor to the end of the previous text box element, and delete the last character of the previous element. If the previous element is an image box, find the right input box of the previous focusable image box element, and display the image's main bounding box in red, indicating it is deletable. Otherwise, find the right input box of the previous image, and display the image's main bounding box in red, indicating it is deletable.

[0090] On the other hand, when the deletion function is set to delete backwards, if the electronic device detects that the current cursor position is in the right input box of the image and the target element is the last image, it may include the following steps: If the target element is not the last element, and the next element is a text box, the electronic device finds the next focusable text box element, sets the cursor to the beginning of the next text box element, and deletes the first character of the next element. If the next element is an image box, the electronic device may find the left input box of the next focusable image box element, and the image's main bounding box will display a red "deleteable" indicator; otherwise, it will find the left input box of the next image, and the image's main bounding box will display a red "deleteable" indicator.

[0091] For example, if the electronic device recognizes that the target element is a picture frame, the editing function of the picture frame element also includes an Enter key input function. The electronic device detects that the user has entered plain text using the Enter key on the keyboard. Specifically, the electronic device creates a text box element and stores the entered text value. If the electronic device detects that the current cursor position is in the left input box of the image and the target element is not the first image, or detects that the current cursor position is in the right input box of the image and the target element is not the last image, the following steps may be included: If the input position is between two images, the image set is split into two sets according to the unique image index, a picture frame element is created, and the image set of the split portion is stored. The current picture frame element replaces the image set of the split portion. The created text box element is added after the current target element, and the created picture frame element is added after the created text box element, and then persisted to the database. Otherwise, if the cursor is in the left input box of the image, the created text box element is added before the current target element; if the cursor is detected in the right input box of the image, the created text box element is added after the current target element, and then persisted to the database.

[0092] For example, if the electronic device recognizes that the target element is a picture box, the editing function of the picture box element also includes the function of inserting an image, which is used to select the uploaded image. Its specific implementation method is the same as the implementation logic of the paste image function, and will not be described in detail here.

[0093] For example, if the electronic device recognizes the target element as an image box, the image box element's editing function also includes a deletion function. Specifically, when the image box element contains only one image, the electronic device creates a null text box element, replaces the image box element with the current target element index, and then persists it to the database. When the image box contains multiple images, if it's the first image, delete the first image in the current text box; if it's the last image, delete the last image in the current text box; otherwise, create a null text box element, split the image box into two image sets (excluding deleted images) based on the current image index, replace the current image box's image set with the split first set, add the created text box element after the current target element index, set the image set of the created text box element to the split second set, add it after the text box element, and then persist it to the database.

[0094] For example, if the electronic device recognizes the target element as a picture frame, the editing functions of the picture frame element also include a copy function to copy the selected image to the clipboard. The editing functions of the picture frame element also include a cut function to cut the image to the clipboard; generally, the copy operation is performed first, followed by the deletion operation of the image within the picture frame.

[0095] For another example, if the electronic device recognizes the target element as an image frame, the editing functions for the image frame element also include the ability to adjust the image size. Specifically, the electronic device first obtains the element index, image index, and cell address data stored in the focus area of ​​the currently selected element in the document. It then calls the `documentImageSizeModify` interface (used for modifying the image size of the image frame), passing in the document ID, cell address, currently selected element index, image index, and the desired size (large, medium, small). In the specific implementation, if the size is set to "Large", its width = number of columns occupied by the cell × width of each column - 20; if the size is set to "Medium", its width = (number of columns occupied by the cell × width of each column × 0.5) - 20; if the size is set to "Small", its width = (number of columns occupied by the cell × width of each column × (1.0 / 3)) - 20. Finally, the electronic device can compare the calculated width with the original width. If they are not equal, the scaling ratio is calculated. Then, the scaled height is calculated by calculating the ratio. Then, different heights and widths are obtained according to different sizes. The height and width of the image object are set and then persisted to the database.

[0096] As can be seen, in this embodiment, the electronic device provides a comprehensive and intelligent editing function system for image box elements in the image and text editing interface. It integrates multiple core editing functions such as copying, cutting, pasting, deleting, inserting images, and adjusting image size, forming a complete image editing toolset. It not only supports the mutual conversion between images and text boxes, but also supports the intelligent merging and splitting of adjacent elements. This enables the mixed arrangement and editing of text and images in the image and text editing interface, as well as the adaptive rendering of text and images. This ensures that the output data structure is clear and standardized, can be integrated into various business processes, and is conducive to improving work efficiency.

[0097] In its image deletion strategy, the electronic device employs differentiated deletion logic for different scenarios involving single and multiple images. When an image box contains only one image, it is automatically replaced with an empty text box; when multiple images exist, the device intelligently segments the image set and reorganizes the document structure to ensure that the deletion operation does not compromise the integrity of the overall content.

[0098] Furthermore, in implementing the Enter key input function, electronic devices can intelligently insert text box elements between images and split the image set into two sets based on the image's unique index, automatically adjusting the document structure. This intelligent structure management capability ensures the logic and readability of mixed text and image content, avoiding content chaos.

[0099] Furthermore, the electronic device enables cross-element type editing, recognizing the current target element type (text box / image box) and executing corresponding editing logic accordingly. Users experience a consistent and smooth user experience when switching between editing text and images, without needing to concern themselves with the underlying implementation details. Additionally, the device offers image layout adjustment capabilities, supporting three preset sizes (large, medium, and small) for image resizing. Each size has a precise calculation formula that automatically calculates the optimal size based on the number of columns and the width of each column. This flexible layout adjustment capability meets the image display needs of different scenarios.

[0100] In addition, the electronic device adopts a modular design for various editing functions. When it is necessary to add new editing functions or adjust existing functions, it is only necessary to make modifications in the corresponding module without affecting the normal operation of other functions, which greatly improves the maintainability of the system.

[0101] In one possible implementation, the method further includes the following steps: determining the cell address of the target element, and querying the document internal reference mapping table based on the cell address to obtain the cell address of the internal reference that needs to be modified synchronously, and updating the cell data corresponding to the cell address of the internal reference that needs to be modified synchronously; and / or, querying the document external reference mapping table based on the document ID to obtain the external document ID that references the target element and the external reference cell address in the external document ID, and updating the cell data corresponding to the external reference cell address.

[0102] The electronic device can set up an internal reference mapping table for each document template to store other cell addresses related to the content corresponding to the cell address in the document. When the content of the cell address in the current document changes, the electronic device synchronously updates the data stored in other cell addresses related to that cell address to ensure the consistency of the document content.

[0103] The electronic device also features a document external reference mapping table for cross-document reference synchronization. This table stores external document IDs associated with the document ID, as well as cell addresses in external documents that reference the cell address content of the document ID. The electronic device can synchronize the data of cells in related external documents through the document external reference mapping table to achieve cross-document interaction consistency.

[0104] As can be seen, in this embodiment, the electronic device can automatically identify the cell addresses of all referenced target elements (including those within and outside the document) by querying the internal and external reference mapping tables, and automatically update the data in these cells. This fully automatic synchronization mechanism eliminates the tedious manual updating process, significantly improving work efficiency. Whether it is a reference relationship within a document or a reference relationship across documents, the system can accurately identify and synchronize updates through the mapping table mechanism, ensuring the consistency between all referenced data and source data. Furthermore, through the automated mapping table query and batch update mechanism, it can efficiently handle large-scale reference relationships, significantly improving the efficiency of data management.

[0105] The above primarily describes the implementation scheme of this application from a methodological perspective. It is understood that, to achieve the aforementioned functions, the device includes corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should readily recognize that, in conjunction with the modules and algorithm steps of the various examples described in the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0106] The embodiments of this application can divide the corresponding graphic frame generation device into functional modules according to the above method examples. For example, each function can be divided into its own functional modules, or two or more functions can be integrated into one processing module. The integrated modules can be implemented in hardware or as software program modules. It should be noted that the module division in the embodiments of this application is illustrative and only represents a logical functional division, while other division methods may be used in actual implementation.

[0107] When using integrated modules, Figure 4A This is a block diagram of the functional modules of a text frame generation device proposed in an embodiment of this application. The text frame generation device 400 includes a display module 401 and a rendering module 402.

[0108] In this embodiment, the display module 401 and the rendering module 402 can be module units used to receive and process signals, information, etc., or to determine monitoring mechanisms, and there are no specific limitations on them.

[0109] In this embodiment, the graphic frame generation apparatus 400 may further include a storage module for storing computer program code or instructions executed by the graphic frame generation apparatus 400. The storage module may be a memory.

[0110] In this embodiment, the graphic frame generation device 400 may be a chip or a chip module.

[0111] In this embodiment, the display module 401 and the rendering module 402 can be communication modules of the graphic frame generation device 400. The communication module can be a communication interface, transceiver, transceiver circuit, etc.

[0112] In this embodiment, the display module 401 and the rendering module 402 can be processing modules of the graphic frame generation device 400.

[0113] It should be noted that the processing module can be a processor or controller, such as a baseband processor, baseband chip, central processing unit (CPU), general-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), or other programmable logic device, transistor logic device, hardware component, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processing module can also be a combination that implements computational functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0114] In this embodiment, the image frame generation device 400 is used to perform any of the steps performed by network devices / chips / chip modules, etc., as described in the above method embodiments.

[0115] In specific implementation, the display module 401 and the rendering module 402 are used to perform any of the steps in the above method implementation, and when performing actions such as sending, other modules can be selectively called to complete the corresponding operations. A detailed explanation follows.

[0116] Display module 401 is used to display a graphic editing interface. The graphic editing interface includes elements, including text box elements and picture box elements. Each element corresponds to a unique index. The text box elements and the picture box elements are stored as ordered elements in the data structure of the graphic box control object. The rendering module 402 is used to respond to the switching operation of the cursor between the elements in the graphic editing interface, determine the target element, and update the value of the target element in the graphic box control object according to the type of the target element to re-render the graphic editing interface.

[0117] In one possible implementation, with Figure 4A Consistently, Figure 4B This is a functional module block diagram of another text frame generation device proposed in this application. The text frame generation device 400 also includes a determination module 403, which is used to: switch the cursor focus and determine the cursor position where the target element is inserted in response to the switching operation of the cursor between the elements in the text editing interface. If the target element is a text box, the cursor position, the target element, and the index of the target element are stored in the selected element focus of the current document. The element focus is used for the paste function of the text box element. If the target element is a picture box, then the image index of the image corresponding to the cursor position and the cell address corresponding to the image are determined. The image index, the cell address, the target element, and the index of the target element are stored in the selected element focus of the current document. The element focus is used for the paste function application of the picture box element.

[0118] In one possible implementation, in response to the cursor switching operation between elements in the graphic editing interface, the rendering module 402 is specifically used for: The cursor focus is switched, and based on the current cursor position corresponding to the cursor focus, the type of the adjacent elements of the element at the current cursor position, and the preset switching rules, the cursor focus is automatically switched to the specified input position of the adjacent element, and the focus style is dynamically updated during the switching process to complete the cursor switching operation between elements.

[0119] In one possible implementation, the data structure of the text box control object further includes: text box properties, the text box properties including at least one of the following: preset prompt, preset text box character count threshold, preset text box image count threshold, and preset style object; the preset style object includes at least one of the following: text color, alignment, and whether to automatically wrap text. The element also includes input box text values ​​and a collection of image subjects; wherein, the image box element includes a collection of image subjects composed of multiple image subjects, and the image box element is rendered in the image and text editing interface as a component including at least one of the image subjects, a left image input box, a right image input box, an image deletion marker, and an image serial number name editing box.

[0120] In one possible implementation, regarding the step of updating the value of the target element in the graphic box control object according to the type of the target element to re-render the graphic editing interface, the rendering module 402 is specifically used for: If the target element is a text box, the starting position for text editing is determined based on the index of the target element and the cursor position. Based on the starting position of the text editing, iterate through all elements in the text box element; If the total number of characters in all elements is less than or equal to the preset character count threshold for the image and text box, then update the value of the text box element in the current image and text box control object to re-render the image and text editing interface; If the total number of characters in all elements exceeds the preset character count threshold for the image and text box, the extra strings are deleted, the text that meets the preset character count threshold is retained, and the value of the current image and text box control object is updated to re-render the image and text editing interface.

[0121] In one possible implementation, regarding the step of updating the value of the target element in the graphic box control object according to the type of the target element to re-render the graphic editing interface, the rendering module 402 is specifically used for: If the target element is an image frame, then based on the index of the target element and the cursor position, determine the editing position of the left or right image input box in the image editing interface, and update the value of the image frame element in the current image frame control object to re-render the image editing interface.

[0122] In one possible implementation, the determining module 403 is further configured to: Determine the cell address of the target element, and based on the cell address, query the document internal reference mapping table to obtain the cell address that needs to be synchronously modified for internal references, and update the cell data corresponding to the cell address that needs to be synchronously modified for internal references; and / or, Based on the document ID, query the document external reference mapping table to obtain the external document ID that references the target element and the external reference cell address in the external document ID, and update the cell data corresponding to the external reference cell address.

[0123] It should be noted that, Figure 4A and Figure 4B The specific implementation of each operation in the implementation method can be found in the description of the method implementation method shown above, and will not be repeated here.

[0124] As can be seen, the graphic and text box generation device described in this application embodiment can display a graphic and text editing interface. The graphic and text editing interface includes elements, including text box elements and image box elements. Each element corresponds to a unique index. The text box elements and the image box elements are stored as ordered elements in the data structure of the graphic and text box control object. In response to the cursor switching operation between the elements in the graphic and text editing interface, a target element is determined. And according to the type of the target element, the value of the target element in the graphic and text box control object is updated to re-render the graphic and text editing interface. In this way, by storing the text box elements and image box elements as ordered elements in the data structure of the graphic and text box control object, the output data structure is ensured to be clear and standardized, which can be integrated into various business processes and is conducive to improving work efficiency.

[0125] See Figure 5 , Figure 5 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. The electronic device 500 may include a processor 510, a memory 520, and a communication bus for connecting the processor 510 and the memory 520. The electronic device 500 may be... Figure 1 Electronic device 100a, electronic device 100b, or electronic device 100c.

[0126] Optionally, the memory 520 may include, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or compact disc read-only memory (CD-ROM). The memory 520 is used to store program code executed by the electronic device 500 and data transmitted therefrom.

[0127] In this embodiment, the electronic device 500 also includes a communication interface for receiving and sending data.

[0128] In this embodiment, the electronic device 500 can be the above-mentioned graphic frame generation device or graphic frame generation apparatus.

[0129] In this embodiment, the processor 510 may be one or more CPUs. If the processor 510 is a CPU, the CPU may be a single-core CPU or a multi-core CPU.

[0130] In this embodiment, the processor 510 can be a baseband chip, a chip, a CPU, a general-purpose processor, a DSP, an ASIC, an FPGA, or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof.

[0131] In specific implementation, the processor 510 in the electronic device 500 executes the computer program or instructions 521 stored in the memory 520 to perform the following operations: The graphic editing interface is displayed. The graphic editing interface includes elements, including text box elements and image box elements. Each element corresponds to a unique index. The text box elements and the image box elements are stored as ordered elements in the data structure of the graphic box control object. In response to the cursor switching operation between elements in the text and image editing interface, a target element is determined; and according to the type of the target element, the value of the target element in the text and image box control object is updated to re-render the text and image editing interface.

[0132] In one possible implementation, in response to a cursor switching operation between elements in the graphic editing interface, switching cursor focus, and determining the cursor position for inserting the target element, the processor 510 in the electronic device 500 executes a computer program or instruction 521 stored in the memory 520 to perform the following operations: If the target element is a text box, the cursor position, the target element, and the index of the target element are stored in the selected element focus of the current document. The element focus is used for the paste function of the text box element. If the target element is a picture box, then the image index of the image corresponding to the cursor position and the cell address corresponding to the image are determined. The image index, the cell address, the target element, and the index of the target element are stored in the selected element focus of the current document. The element focus is used for the paste function application of the picture box element.

[0133] In one possible implementation, in response to the cursor switching operation between the elements in the graphic editing interface, the processor 510 in the electronic device 500 executes a computer program or instruction 521 stored in the memory 520 to perform the following operations: The cursor focus is switched, and based on the current cursor position corresponding to the cursor focus, the type of the adjacent elements of the element at the current cursor position, and the preset switching rules, the cursor focus is automatically switched to the specified input position of the adjacent element, and the focus style is dynamically updated during the switching process to complete the cursor switching operation between elements.

[0134] In one possible implementation, the data structure of the text box control object further includes: text box properties, the text box properties including at least one of the following: preset prompt, preset text box character count threshold, preset text box image count threshold, and preset style object; the preset style object includes at least one of the following: text color, alignment, and whether to automatically wrap text. The element also includes input box text values ​​and a collection of image subjects; wherein, the image box element includes a collection of image subjects composed of multiple image subjects, and the image box element is rendered in the image and text editing interface as a component including at least one of the image subjects, a left image input box, a right image input box, an image deletion marker, and an image serial number name editing box.

[0135] In one possible implementation, regarding the step of updating the value of the target element in the graphic box control object according to the type of the target element to re-render the graphic editing interface, the processor 510 in the electronic device 500 is used to execute the computer program or instructions 521 stored in the memory 520 to perform the following operations: If the target element is a text box, the starting position for text editing is determined based on the index of the target element and the cursor position. Based on the starting position of the text editing, iterate through all elements in the text box element; If the total number of characters in all elements is less than or equal to the preset character count threshold for the image and text box, then update the value of the text box element in the current image and text box control object to re-render the image and text editing interface; If the total number of characters in all elements exceeds the preset character count threshold for the image and text box, the extra strings are deleted, the text that meets the preset character count threshold is retained, and the value of the current image and text box control object is updated to re-render the image and text editing interface.

[0136] In one possible implementation, regarding the step of updating the value of the target element in the graphic box control object according to the type of the target element to re-render the graphic editing interface, the processor 510 in the electronic device 500 is used to execute the computer program or instructions 521 stored in the memory 520 to perform the following operations: If the target element is an image frame, then based on the index of the target element and the cursor position, determine the editing position of the left or right image input box in the image editing interface, and update the value of the image frame element in the current image frame control object to re-render the image editing interface.

[0137] In one possible implementation, the processor 510 in the electronic device 500 is used to execute the computer program or instructions 521 stored in the memory 520 to perform the following operations: Determine the cell address of the target element, and based on the cell address, query the document internal reference mapping table to obtain the cell address that needs to be synchronously modified for internal references, and update the cell data corresponding to the cell address that needs to be synchronously modified for internal references; and / or, Based on the document ID, query the document external reference mapping table to obtain the external document ID that references the target element and the external reference cell address in the external document ID, and update the cell data corresponding to the external reference cell address.

[0138] It should be noted that, Figure 5 The specific implementation of each operation in the above-described method implementation can be found in the description of the method implementation, and will not be repeated here.

[0139] As can be seen, the electronic device described in this application embodiment can display a graphic editing interface. The graphic editing interface includes elements, including text box elements and image box elements. Each element corresponds to a unique index. The text box elements and image box elements are stored as ordered elements in the data structure of the graphic box control object. In response to the cursor switching operation between the elements in the graphic editing interface, a target element is determined. Based on the type of the target element, the value of the target element in the graphic box control object is updated to re-render the graphic editing interface. Thus, by storing text box elements and image box elements as ordered elements in the data structure of the graphic box control object, the output data structure is ensured to be clear and standardized, enabling integration into various business processes and improving work efficiency.

[0140] In this embodiment, the above-described method implementation can be applied to a terminal device. That is, the executing entity of the above-described method implementation can be a terminal device, a chip, a chip module, or a module, etc., without specific limitations.

[0141] This application also provides a chip including a processor and a communication interface, wherein the processor is used to execute computer programs or instructions to implement the steps described in the above method embodiments.

[0142] This application also provides a chip module, including a transceiver component and a chip. The chip includes a processor, a memory, and a computer program or instructions stored in the memory, wherein the processor executes the computer program or instructions to implement the steps described in the above method embodiments.

[0143] This application also provides a module device, including a communication module, a power module, a storage module, and a chip. The power module is used to provide power to the module device, the storage module is used to store data and instructions, the communication module is used for internal communication within the module device, or for communication between the module device and external devices, and the chip is used to execute computer programs or instructions to implement the steps described in the above method embodiments.

[0144] This application also provides a computer-readable storage medium storing a computer program or instructions that, when executed, implement the steps described in the above-described method embodiments.

[0145] This application also provides a computer program product, including a computer program or instructions that, when executed, implement the steps described in the above method embodiments.

[0146] It should be noted that, for the sake of simplicity, the various embodiments described above are all presented as a series of actions. Those skilled in the art should understand that this application is not limited by the described order of actions, as some steps in the embodiments of this application can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions, steps, modules, or units involved are not necessarily essential to the embodiments of this application.

[0147] In the above embodiments, the descriptions of each embodiment in this application have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0148] The steps of the methods or algorithms described in this application can be implemented in hardware or by a processor executing software instructions. The software instructions can consist of corresponding software modules, which can be stored in RAM, flash memory, ROM, EPROM, electrically erasable programmable read-only memory (EEPROM), registers, hard disk, portable hard disk, read-only optical disk (CD-ROM), or any other form of storage medium known in the art. An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and storage medium can reside in an ASIC. Furthermore, the ASIC can reside in a terminal device or management device. Alternatively, the processor and storage medium can exist as discrete components in the terminal device or management device.

[0149] Those skilled in the art will recognize that, in one or more of the examples above, the functions described in the embodiments of this application can be implemented, in whole or in part, by software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. This computer program product includes one or more computer instructions. When these computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., digital video discs (DVDs)), or semiconductor media (e.g., solid-state disks (SSDs)).

[0150] The modules / units included in the various devices and products described in the above embodiments can be software modules / units, hardware modules / units, or a combination of both. For example, for devices and products applied to or integrated into a chip, all modules / units can be implemented using hardware methods such as circuits, or at least some modules / units can be implemented using software programs that run on a processor integrated within the chip, while the remaining (if any) modules / units can be implemented using hardware methods such as circuits. For devices and products applied to or integrated into a chip module, all modules / units can be implemented using hardware methods such as circuits. Different modules / units can be located in the same component (e.g., chip, circuit module, etc.) or different components of the chip module, or at least some modules / units can be implemented using hardware methods such as circuits. The implementation is achieved through a software program that runs on the processor integrated within the chip module. The remaining modules / units (if any) can be implemented using hardware methods such as circuits. For various devices and products applied to or integrated into terminal equipment, each of their modules / units can be implemented using hardware methods such as circuits. Different modules / units can be located in the same component (e.g., chip, circuit module, etc.) or different components within the terminal equipment. Alternatively, at least some modules / units can be implemented through a software program that runs on the processor integrated within the terminal equipment, while the remaining modules / units (if any) can be implemented using hardware methods such as circuits.

[0151] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the embodiments of this application. It should be understood that the above description is only a specific embodiment of the embodiments of this application and is not intended to limit the protection scope of the embodiments of this application. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solution of the embodiments of this application should be included within the protection scope of the embodiments of this application.

Claims

1. A method for generating a text box, characterized in that, include: The graphic editing interface is displayed. The graphic editing interface includes elements, including text box elements and image box elements. Each element corresponds to a unique index. The text box elements and the image box elements are stored as ordered elements in the data structure of the graphic box control object. In response to the cursor switching operation between the elements in the graphic editing interface, the target element is determined; And based on the type of the target element, update the value of the target element in the graphic box control object to re-render the graphic editing interface.

2. The method according to claim 1, characterized in that, The method further includes: In response to the cursor switching operation between the elements in the graphic editing interface, the cursor focus is switched, and the cursor position for inserting the target element is determined; If the target element is a text box, the cursor position, the target element, and the index of the target element are stored in the selected element focus of the current document. The element focus is used for the paste function of the text box element. If the target element is a picture box, then the image index of the image corresponding to the cursor position and the cell address corresponding to the image are determined. The image index, the cell address, the target element, and the index of the target element are stored in the selected element focus of the current document. The element focus is used for the paste function application of the picture box element.

3. The method according to claim 1 or 2, characterized in that, In response to the cursor switching operation between the elements in the text and image editing interface, the following are included: The cursor focus is switched, and based on the current cursor position corresponding to the cursor focus, the type of the element at the current cursor position, the type of the adjacent elements of the element at the current cursor position, and the preset switching rules, the cursor focus is automatically switched to the specified input position of the adjacent element, and the focus style is dynamically updated during the switching process to complete the cursor switching operation between elements.

4. The method according to claim 1 or 2, characterized in that, The data structure of the graphic box control object further includes: graphic box properties, which include at least one of the following: preset prompt, preset graphic box character count threshold, preset graphic box image count threshold, and preset style object; the preset style object includes at least one of the following: text color, alignment, and whether to automatically wrap text. The element also includes input box text values ​​and a collection of image subjects; wherein, the image box element includes a collection of image subjects composed of multiple image subjects, and the image box element is rendered in the image and text editing interface as a component including at least one of the image subjects, a left image input box, a right image input box, an image deletion marker, and an image serial number name editing box.

5. The method according to claim 4, characterized in that, The step of updating the value of the target element in the graphic box control object according to the type of the target element to re-render the graphic editing interface includes: If the target element is of the text box type, then the starting position of text editing is determined based on the index of the target element and the cursor position; Based on the starting position of the text editing, iterate through all elements in the text box element; If the total number of characters in all elements is less than or equal to the preset character count threshold for the image and text box, then update the value of the text box element in the current image and text box control object to re-render the image and text editing interface; If the total number of characters in all elements exceeds the preset character count threshold for the image and text box, the extra strings are deleted, the text that meets the preset character count threshold is retained, and the value of the current image and text box control object is updated to re-render the image and text editing interface.

6. The method according to claim 4, characterized in that, The step of updating the value of the target element in the graphic box control object according to the type of the target element to re-render the graphic editing interface includes: If the target element is of the image frame type, then based on the index of the target element and the cursor position, the editing position of the left or right image input box in the image editing interface is determined, and the value in the image frame element of the current image frame control object is updated to re-render the image editing interface.

7. The method according to claim 1, characterized in that, The method further includes: Determine the cell address of the target element, and based on the cell address, query the document internal reference mapping table to obtain the cell address that needs to be synchronously modified for internal references, and update the cell data corresponding to the cell address that needs to be synchronously modified for internal references; and / or, Based on the document ID, query the document external reference mapping table to obtain the external document ID that references the target element and the external reference cell address in the external document ID, and update the cell data corresponding to the external reference cell address.

8. A graphic frame generation device, characterized in that, The device includes: The display module is used to display the graphic editing interface. The graphic editing interface includes elements, including text box elements and picture box elements. Each element corresponds to a unique index. The text box elements and the picture box elements are stored as ordered elements in the data structure of the graphic box control object. The rendering module is used to respond to the cursor switching operation between elements in the image and text editing interface, determine the target element, and update the value of the target element in the image and text box control object according to the type of the target element to re-render the image and text editing interface.

9. An electronic device, characterized in that, The method includes a processor, a memory, a communication interface, and one or more programs, said one or more programs being stored in the memory and configured to be executed by the processor, said programs including instructions for performing the steps of the method as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, A computer program for storing electronic data interchange, wherein the computer program causes a computer to perform the method as described in any one of claims 1-7.