Data structure editing method, device, electronic device and storage medium

By using the prefix identification selection control in the data structure page to obtain the reference object list and add it to the target location of the text content, the inefficiency of Markdown syntax in rich text content editing is solved, and the target data type text content of the data structure is efficiently edited.

CN114385946BActive Publication Date: 2025-08-29TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202011139968.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-22
Publication Date
2025-08-29
Estimated Expiration
2040-10-22

AI Technical Summary

Technical Problem

The existing Markdown syntax is difficult to meet the needs of rich text content editing for scenes such as pictures, sounds, and videos, resulting in low efficiency in editing data structures.

Method used

Provides a data structure editing method, by displaying a data structure page, including a text editing area and a text format conversion area, using the prefix identification selection control to obtain a list of reference objects, and adding the selected reference objects to the target location of the text content, editing the text content of the target data structure type.

Benefits of technology

Improves the efficiency and flexibility of editing data structures, and can edit text content of the target data structure type based on the visual identification selection control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114385946B_ABST
    Figure CN114385946B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses a method, device, electronic device and storage medium for editing a data structure, including: displaying a data structure page, the data structure page including a text editing area and a text format conversion area, the text format conversion area including an identifier selection control corresponding to a prefix identifier, the text editing area being used to edit a data structure of a business; in response to an operation on the text editing area, obtaining text content to be edited; in response to an operation on a target identifier selection control, displaying a reference object list corresponding to a target prefix identifier, the reference object list including at least one reference object corresponding to the target file extension prefix; in response to an object selection operation on the reference object list, adding the selected reference object to the target position of the text content to edit the text content of the target data structure type. This solution can improve the efficiency of editing data structures.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, device, electronic device, and storage medium for editing a data structure. Background Art

[0002] Currently, most web pages are written in Hypertext Markup Language (HTML), which defines how images, multimedia, and text are displayed on a web page.

[0003] Since different web pages maintain different data structures, the content displayed and edited on the web pages are determined by the business. In addition, some specific syntaxes are only applicable to certain scenarios. For example, Markdown syntax is used to create web documents. Markdown uses plain text format to write documents, and then converts them into HTML documents for publishing. For plain text pages, the editing efficiency using Markdown syntax is very high. However, Markdown syntax is difficult to meet the needs of scenarios containing pictures, sounds, and videos. In this case, the syntax needs to be reselected. Therefore, for rich text content, the current efficiency of editing data structures is relatively low. Summary of the Invention

[0004] Embodiments of the present application provide a data structure editing method, device, electronic device, and storage medium, which can improve the efficiency of editing data structures.

[0005] The present invention provides a method for editing a data structure, including:

[0006] Displaying a data structure page, the data structure page including a text editing area and a text format conversion area, the text format conversion area including an identifier selection control corresponding to the prefix identifier, and the text editing area for editing the data structure of the business;

[0007] In response to an operation on a text editing area, obtaining text content to be edited;

[0008] In response to an operation on a target identifier selection control, a reference object list corresponding to the target prefix identifier is displayed, the reference object list including at least one reference object corresponding to the target file extension prefix, each reference object corresponding to a preset data structure;

[0009] In response to an object selection operation on the reference object list, the selected reference object is added to a target position of the text content to edit the text content of the target data structure type.

[0010] Accordingly, an embodiment of the present application further provides a data structure editing device, comprising:

[0011] A first display module is used to display a data structure page, the data structure page includes a text editing area and a text format conversion area, the text format conversion area includes an identifier selection control corresponding to the prefix identifier, and the text editing area is used to edit the data structure of the business;

[0012] An acquisition module, configured to acquire text content to be edited in response to an operation on the text editing area;

[0013] A second display module is configured to display a reference object list corresponding to the target prefix identifier in response to an operation on the target identifier selection control, wherein the reference object list includes at least one reference object corresponding to the target file extension prefix;

[0014] The editing module is configured to, in response to an object selection operation on the reference object list, add the selected reference object to a target position of the text content to edit the text content of a target data structure type.

[0015] Optionally, in some embodiments of the present application, the second display module includes:

[0016] an acquiring unit, configured to acquire configuration information corresponding to the target prefix identifier according to a pre-stored mapping relationship in response to an operation on the target identifier selection control;

[0017] The display unit is configured to display a reference object list corresponding to the configuration information.

[0018] Optionally, in some embodiments of the present application, the display unit includes:

[0019] An extraction subunit, configured to extract reference objects contained in the configuration information;

[0020] The display subunit is configured to display a list of reference objects corresponding to the configuration information based on the arrangement order and association relationships between the extracted reference objects.

[0021] Optionally, in some embodiments of the present application, the display subunit is specifically used for:

[0022] Identify the object reference relationship for each referenced object;

[0023] Determining a parent reference object and a child reference object in the extracted reference object according to the identified object reference relationship;

[0024] Based on the extracted arrangement order and object reference relationship between the reference objects, a reference object list corresponding to the configuration information is displayed, wherein the reference object list includes a first-level menu corresponding to each parent reference object and a submenu under each first-level menu.

[0025] Optionally, in some embodiments of the present application, a construction unit is further included, wherein the construction unit is specifically used to:

[0026] Collect configuration information corresponding to multiple reference objects;

[0027] Construct a mapping relationship between each configuration information and prefix identifier.

[0028] Optionally, in some embodiments of the present application, the editing module includes:

[0029] a determining unit, configured to determine, in response to an object selection operation on the reference object list, a selected reference object as a target reference object;

[0030] A parsing unit, configured to parse the target reference object;

[0031] The editing unit is used to edit the text content based on the parsing result to obtain text content of the target data structure type.

[0032] Optionally, in some embodiments of the present application, the editing unit is specifically configured to:

[0033] Edit the text content based on the parsing result to obtain edited text content;

[0034] A preset suffix identifier is obtained, and the preset suffix identifier is added to the end of the edited text content to obtain text content of the target data structure type.

[0035] Optionally, in some embodiments of the present application, the acquisition module is specifically configured to:

[0036] Obtain the text content corresponding to the initial data structure, and display the text content corresponding to the initial data structure in the text editing area;

[0037] In response to an operation on the content displayed in the text editing area, text content to be edited is acquired.

[0038] Optionally, in some embodiments of the present application, the data structure page further includes a preview display control and a preview module, wherein the preview module is specifically configured to:

[0039] In response to an operation on the preview display control, text content of the target data structure type is previewed.

[0040] In an embodiment of the present application, after displaying a data structure page, the data structure page includes a text editing area and a text format conversion area, the text format conversion area includes an identifier selection control corresponding to a prefix identifier, the text editing area is used to edit the data structure of the business, and in response to an operation on the text editing area, the text content to be edited is obtained, and in response to an operation on a target identifier selection control, a reference object list corresponding to a target prefix identifier is displayed, the reference object list includes at least one reference object corresponding to the target file extension prefix, and in response to an object selection operation on the reference object list, the selected reference object is added to the target position of the text content to edit the text content of the target data structure type. Therefore, the efficiency of editing the data structure can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0042] Figure 1a Schematic diagram of a scenario of a method for editing a data structure provided in an embodiment of the present application

[0043] Figure 1b A flowchart of a method for editing a data structure provided in an embodiment of the present application;

[0044] Figure 2a This is another flowchart of the method for editing a data structure provided in an embodiment of the present application;

[0045] Figure 2b is a structural diagram of a data structure analysis system provided in an embodiment of the present application;

[0046] Figure 2c is a schematic diagram of a data structure page in the data structure editing method provided in an embodiment of the present application;

[0047] Figure 2d This is another schematic diagram of a data structure page in the data structure editing method provided in an embodiment of the present application;

[0048] Figure 2e This is another schematic diagram of a data structure page in the data structure editing method provided in an embodiment of the present application;

[0049] Figure 3a It is a structural diagram of a data structure editing device provided in an embodiment of the present application;

[0050] Figure 3bis another structural diagram of the data structure editing device provided in an embodiment of the present application;

[0051] Figure 4 It is a schematic diagram of the structure of the terminal provided in an embodiment of the present application. DETAILED DESCRIPTION

[0052] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without making creative efforts are within the scope of protection of this application.

[0053] Embodiments of the present application provide a method and device for editing a data structure.

[0054] Among them, the editing device of the data structure can be specifically integrated into a server or a terminal. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The terminal can be a smart phone, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, etc., but is not limited to this. The terminal and the server can be directly or indirectly connected through wired or wireless communication, and this application does not limit this.

[0055] Take the data structure editing device integrated into the terminal as an example, see Figure 1aWhen it is necessary to edit the data structure, after receiving the data structure editing request, the data structure editing request can be triggered by the user, and the data structure page is displayed. The data structure page includes a text editing area and a text format conversion area. The text format conversion area includes an identifier selection control corresponding to the prefix identifier. The text editing area is used to edit the data structure of the business, wherein the number of identifier selection controls is at least one. The following is a specific explanation using multiple examples. The terminal responds to the user's operation on the text editing area and obtains the text content to be edited. For example, the user enters the text content to be edited in the text editing area. Then, when the terminal detects the selection operation on multiple identifier selection controls, it determines the selected identifier selection control as the target identifier selection control and displays a reference object list corresponding to the target prefix identifier. The reference object list includes at least one reference object corresponding to the target file extension prefix, and each reference object corresponds to a preset data structure. In response to the object selection operation on the reference object list, the terminal adds the selected reference object to the target position of the text content to edit the text content of the target data structure type.

[0056] The data structure editing method provided in this application pre-establishes a mapping relationship between the reference object and the data structure. When the text content needs to be edited, the text content of the target data structure type is edited according to the visual identification selection control. Therefore, the efficiency of editing the data structure can be improved and the flexibility is high.

[0057] It should be noted that the order of description of the following embodiments does not limit the priority order of the embodiments.

[0058] A method for editing a data structure comprises: displaying a data structure page, obtaining text content to be edited in response to an operation on a text editing area, displaying a list of reference objects corresponding to a target prefix identifier in response to an operation on a target identifier selection control, and adding the selected reference object to a target position of the text content in response to an object selection operation on the reference object list to edit the text content of the target data structure type.

[0059] See also Figure 1b , Figure 1b This is a flow chart of a method for editing a data structure provided in an embodiment of the present application. The specific flow of the method for editing a data structure may be as follows:

[0060] 101. Display the data structure page.

[0061] For example, specifically, the data structure page of the client can be displayed. The client can be a syntax parser, such as a Markdown syntax parser or an Angular syntax parser. The data structure page can include a text editing area and a text format conversion area. The text format conversion area includes an identifier selection control corresponding to the prefix identifier. The text editing area is used to edit the data structure of the business. The text editing area can be located in the top area, bottom area, middle area or any position of the data structure page. Similarly, the text format conversion area can also be located in the top area, bottom area, middle area or any position of the data structure page, and the specific setting is based on actual conditions.

[0062] It should be noted that each identifier selection control corresponds to a prefix identifier, and the style of the identifier selection control is the symbol corresponding to the prefix identifier, such as "@", "#" and "~". It is set according to actual conditions. Users can determine the prefix identifier corresponding to the selected identifier selection control based on the style of the identifier selection control.

[0063] 102. In response to an operation on the text editing area, obtain text content to be edited.

[0064] The text content to be edited may be stored locally, for example, a piece of text stored locally; or may be obtained through a network, for example, a piece of code obtained through a network. Optionally, in some embodiments, the step of "obtaining the text content to be edited in response to an operation on the text editing area" may specifically include:

[0065] (11) obtaining text content corresponding to the initial data structure and displaying the text content corresponding to the initial data structure in the text editing area;

[0066] (12) In response to an operation on the content displayed in the text editing area, the text content to be edited is obtained.

[0067] For example, a user copies a piece of text content (i.e., the text content corresponding to the initial data structure) from a web page through the Internet and pastes the copied text content into the text editing area. Then, the user adds the text elements that need to be added, such as characters or punctuation, to the copied text content to display the text content to be edited in the text editing area.

[0068] 103. In response to an operation on a target identifier selection control, a reference object list corresponding to the target prefix identifier is displayed.

[0069] Among them, the reference object list includes at least one reference object corresponding to the extension prefix of the target file, the expression form of the reference object is the same as the expression form of the text content to be edited, and each prefix identifier corresponds to a preset data structure. It can be understood that when an operation on the target identifier selection control is detected, the reference object list corresponding to the target data structure (that is, the preset data structure corresponding to the target identifier selection control) is displayed, and the reference object list covers all objects that can be referenced under this data structure.

[0070] The preset data structure can be an array, object, string, number or Boolean value, and is set specifically according to the business type. Furthermore, in some embodiments, after obtaining the text content to be edited, the corresponding identification selection control can be displayed according to the text content to be edited. For example, if the text content to be edited only supports two data structures, numbers and Boolean values, then the identification selection controls corresponding to the two data structures of numbers and Boolean values ​​are displayed; or, only the identification selection controls corresponding to the two data structures of numbers and Boolean values ​​are displayed in a highlighted color, and their corresponding control states are adjusted to an optional state. The optional state indicates that the identification selection control can be used for the text content to be marked.

[0071] For example, if the function corresponding to the prefix identifier of the target identifier selection control is to adjust the font style, then a reference object list corresponding to the font style adjustment is displayed, wherein the reference object list includes reference object A, and the reference object A is " <span style="font-size:16px"> text ”, the reference object A indicates that the font size is adjusted to 12. Further, in response to the operation of the target identifier selection control, a reference object list of the configuration information corresponding to the target prefix identifier is displayed. That is, optionally, in some embodiments, the step of “in response to the operation of the target identifier selection control, displaying the reference object list corresponding to the target prefix identifier” may specifically include:

[0072] (21) in response to an operation on a target identifier selection control, obtaining configuration information corresponding to the target prefix identifier according to a pre-stored mapping relationship;

[0073] (22) Display the reference object list corresponding to the configuration information.

[0074] The configuration information may include a reference object set corresponding to the prefix identifier and an arrangement order between reference objects in the reference object set. When actually displayed, the reference object list corresponding to the target prefix identifier is displayed according to the reference object set and the arrangement order and association relationship between the reference objects in the reference object set. That is, optionally, in some embodiments, the step of "displaying a reference object list corresponding to the configuration information" may specifically include:

[0075] (31) extracting the reference object contained in the configuration information;

[0076] (32) Based on the arrangement order and association relationship between the extracted reference objects, a list of reference objects corresponding to the configuration information is displayed.

[0077] For example, the configuration information includes sequentially arranged reference objects a, reference objects b, and reference objects c. Based on the arrangement order and association relationship between the reference objects, the sequentially arranged reference objects a, reference objects b, and reference objects c are displayed on the data structure page. Furthermore, the reference objects in the displayed reference object list are descriptive information of the referenced data, such as displaying the functions performed by the reference objects, so that the user can know; if the reference objects in the displayed reference object list are descriptive information of the referenced data, when an information acquisition operation triggered by the descriptive information is detected, such as moving the mouse to the reference object, the specific content of the referenced data is displayed in the form of a thumbnail. The specific settings can be made according to actual conditions and will not be repeated here.

[0078] Furthermore, the association relationship between reference objects may specifically be a reference relationship between reference objects. For example, reference object a is a parent reference object of reference object b. Then, when displaying, a corresponding reference object list may be displayed, such as displaying the reference object list in the form of a two-level menu. That is, the optional step of "displaying a reference object list corresponding to the configuration information based on the extracted arrangement order and association relationship between the reference objects" may specifically include:

[0079] (41) identifying the object reference relationship of each referenced object;

[0080] (42) determining a parent reference object and a child reference object in the extracted reference objects according to the identified object reference relationship;

[0081] (43) Based on the arrangement order and object reference relationship between the extracted reference objects, a list of reference objects corresponding to the configuration information is displayed.

[0082] Among them, the reference object list includes the first-level menu corresponding to each parent reference object, and the submenu under each first-level menu. In this application, the parent reference object refers to the reference object that does not reference other reference objects, that is, as the first-level menu of a multi-level menu, it can be understood that the child reference object refers to the reference object that references other reference objects, for example, reference object q references reference object w, reference object w references reference object e, reference object e references reference object r, and reference object r does not reference other reference objects, that is, reference object q, reference object w and reference object e are all child reference objects, and reference object r is the parent reference object.

[0083] In addition, the mapping relationship between the configuration information and the prefix identifier can be constructed in advance by the operation and maintenance personnel. Specifically, the configuration information corresponding to multiple reference objects can be collected, and then the mapping relationship between each configuration information and the prefix identifier can be constructed.

[0084] 104. In response to an object selection operation on the reference object list, add the selected reference object to a target location of the text content to edit the text content of the target data structure type.

[0085] For example, specifically, the reference object list includes multiple reference objects. When an object selection operation on the reference object list is detected, the selected reference object is determined as the target reference object. Then, the target application object is parsed to obtain text content of the target data structure type. That is, optionally, in some embodiments, the step of "in response to the object selection operation on the reference object list, adding the selected reference object to the target position of the text content to edit the text content of the target data structure type" may specifically include:

[0086] (41) in response to an object selection operation on the reference object list, determining the selected reference object as a target reference object;

[0087] (42) Parsing the target reference object;

[0088] (43) Edit the text content based on the parsing result to obtain the text content of the target data structure type.

[0089] For example, specifically, a Markdown syntax parser can be used to parse the target reference object to obtain the target reference data corresponding to the target reference object, and then the target reference data can be added to the target position of the text content to complete the editing of the text content, that is, to obtain the text content of the target data structure type.

[0090] It should be noted that, in the present application, a visual identification selection control is used to assist the user in selecting different types of data structures, and the scope of the reference is clarified by the suffix identifier. When the target reference data is added to the target position of the text content, the suffix is ​​automatically filled in to complete the editing of the text content. That is, optionally, in some embodiments, the step of "editing the text content based on the parsing results to obtain text content of the target data structure type" may specifically include:

[0091] (51) editing the text content based on the parsing result to obtain edited text content;

[0092] (52) Obtain a preset suffix identifier, and add the preset suffix identifier to the end of the edited text content to obtain the text content of the target data structure type.

[0093] Among them, the suffix identifier can be pre-set, and its corresponding style can be set according to actual conditions. For example, the style corresponding to the suffix identifier is "*". For example, specifically, the text content to be edited is "www.qq.com", the target reference object is to define a hyperlink, the data of the target reference object is, the hyperlink is used to link from one page to another, and the result after editing "www.qq.com" is "www.qq.com".

[0094] In order to facilitate users to observe the results of their editing, optionally, in some embodiments, the data structure page also includes a preview display control. After obtaining the text content of the target data structure type, the user can also trigger a preview display request for the preview display control to preview the text content of the target data structure type, that is, in response to the operation on the preview display control, the text content of the target data structure type is previewed.

[0095] After displaying the data structure page, the embodiment of the present application obtains the text content to be edited in response to an operation on the text editing area, displays a list of reference objects corresponding to the target prefix identifier in response to an operation on a target identifier selection control, and adds the selected reference object to the target position of the text content in response to an object selection operation on the reference object list to edit the text content of the target data structure type. The data structure editing method provided by the present application pre-establishes a mapping relationship between the reference object and the data structure. When the text content needs to be edited, the text content of the target data structure type is edited according to the visual identifier selection control. Therefore, the efficiency of editing the data structure can be improved and the flexibility is high.

[0096] The method described in the embodiment will be further described in detail below with examples.

[0097] In this embodiment, the editing device of the data structure is specifically integrated into the terminal as an example for description.

[0098] See also Figure 2a , a data structure editing method, the specific process can be as follows:

[0099] 201. The terminal displays a data structure page.

[0100] For example, a data structure page can be displayed in a client, which can be a syntax parser. The data structure page can include a text editing area and a text format conversion area. The text format conversion area includes an identifier selection control corresponding to the prefix identifier, and the text editing area is used to edit the data structure of the business.

[0101] 202. The terminal obtains text content to be edited in response to an operation on the text editing area.

[0102] For example, specifically, the user copies a piece of text content (i.e., the text content corresponding to the initial data structure) from a web page through the network, and pastes the copied text content into the text editing area. The terminal responds to the user's operation on the content displayed in the text editing area and obtains the text content to be edited. For example, if the user enters a piece of text in the text content corresponding to the initial data structure, the terminal responds to the user's input operation and displays the text content to be marked.

[0103] 203. In response to the operation of selecting a control for the target identifier, the terminal displays a reference object list corresponding to the target prefix identifier.

[0104] Among them, the reference object list includes at least one reference object corresponding to the target file extension prefix, and the preset data structure can be an array, an object, a string, a number or a Boolean value, which is set specifically according to the business type. For example, specifically, the terminal first displays multiple identification selection controls. When the terminal detects the user's control selection operation on the identification selection control, the terminal determines the selected identification selection control as the target identification selection control. Then, in response to the user's click operation on the target identification selection control, the terminal displays a reference object list corresponding to the configuration information corresponding to the target prefix identification.

[0105] 204. In response to the object selection operation on the reference object list, the terminal adds the selected reference object to the target location of the text content to edit the text content of the target data structure type.

[0106] For example, specifically, the terminal determines the selected reference object as the target reference object, and then parses the target application object to obtain the text content of the target data structure type. The terminal can specifically use a Markdown syntax parser to parse the target reference object to obtain the target reference data corresponding to the target reference object, and then add the target reference data to the target position of the text content to complete the editing of the text content.

[0107] To further understand the editing scheme of the data structure of this application, please refer to Figure 2b , taking the scenario of data structure analysis as an example for specific description, the data structure analysis system includes a terminal 10, a parser 20, a database 30 and a data structure analysis engine 40. For details, please refer to Figure 2cThe terminal 10 displays a data structure page. The data structure page may include a text editing area 10A, a text format conversion area 10B, an editing status area 10C, and a view switching area 10D. The text editing area 10A is used to edit the data structure of the business. The text format conversion area 10B includes an identifier selection control corresponding to the prefix identifier. The style of the identifier selection control is the symbol corresponding to the prefix identifier, such as "@", "#", and "~". It is set according to the actual situation. When the user triggers an editing event, the terminal 10 detects an operation on the target identifier selection control and displays a list of reference objects corresponding to the target prefix identifier. Please refer to Figure 2d When the terminal 10 detects the operation of selecting the control "#" for the target identifier, the reference object list corresponding to the target prefix identifier "#" is displayed on the data structure page, wherein the reference object list includes a first-level object menu and a submenu corresponding to each reference object in the first-level object menu. When the terminal 10 detects the text content input by the user, it generates ordinary text and structured text, and displays the ordinary text on the data structure page. For example, if the input text content is "Is AAA equal to", the ordinary text generated is "Is AAA equal to XXX. Example 1". At the same time, the structured text is saved in the database 30. When it is necessary to perform data structure analysis on the structured text, the data structure analysis engine 40 pulls the structured text from the database 30 and analyzes it. Finally, the data structure analysis engine 40 stores the analysis results in the database 30. In addition, please refer to Figure 2e When the terminal 10 detects a click operation triggered on the preview display control, the preview displays the text content of the target data structure "Is AAA equal to XXX. Example 1".

[0108] It should be noted that structured text, also known as structured text programming language (English: Structured text) or ST language, is a programming language designed for programmable logic controllers (PLCs) and is one of the languages ​​supported by the relevant IEC 61131-3 standard [1]. Structured text programming language is a high-level language that supports block structure. It is based on Pascal and has a syntax similar to Pascal. All IEC 61131-3 languages ​​support IEC61131 Common Elements. Its variables and function calls are defined by IEC61131 Common Elements, so different languages ​​in IEC 61131-3 can be used in the same program. Structured text programming language is similar to PASCAL and C language, so it can use the same programming technology as microcomputers and personal computers to perform complex calculations that are difficult to perform with ladder diagrams and complete program creation. Commonly used programs and circuits can be easily reused through the creation of FB (function blocks).

[0109] As can be seen from the above, after the terminal of the embodiment of the present application displays the data structure page, the terminal responds to the operation on the text editing area to obtain the text content to be edited, responds to the operation on the target identifier selection control, displays the reference object list corresponding to the target prefix identifier, and responds to the object selection operation on the reference object list to add the selected reference object to the target position of the text content to edit the text content of the target data structure type. The terminal provided by the present application pre-establishes the mapping relationship between the reference object and the data structure. When the text content needs to be edited, the text content of the target data structure type is edited according to the visual identifier selection control. Therefore, the efficiency of editing the data structure can be improved and the flexibility is high.

[0110] To facilitate better implementation of the data structure editing method of the embodiment of the present application, the embodiment of the present application also provides an editing device based on the above data structure (hereinafter referred to as the editing device). The meanings of the terms are the same as those in the above data structure editing method, and the specific implementation details can be referred to the description in the method embodiment.

[0111] See also Figure 3a , Figure 3a A schematic diagram of the structure of a data structure editing device provided in an embodiment of the present application, wherein the editing device may include a first display module 301, an acquisition module 302, a second display module 303, and an editing module 304, specifically as follows:

[0112] The first display module 301 is used to display a data structure page.

[0113] For example, specifically, the first display module 301 can display the data structure page of the client, and the client can be a syntax parser, such as a Markdown syntax parser or an Angular syntax parser. The data structure page can include a text editing area and a text format conversion area. The text format conversion area includes an identifier selection control corresponding to the prefix identifier. The text editing area is used to edit the data structure of the business. The text editing area can be located in the top area, bottom area, middle area or any position of the data structure page. Similarly, the text format conversion area can also be located in the top area, bottom area, middle area or any position of the data structure page, and the specific setting is based on actual conditions.

[0114] The acquisition module 302 is configured to acquire text content to be edited in response to an operation on the text editing area.

[0115] Among them, the text content to be edited can be saved locally, for example, a piece of text content saved locally; it can also be obtained through the network, for example, a piece of code obtained through the network. Optionally, in some embodiments, the acquisition module 302 can be specifically used to: obtain the text content corresponding to the initial data structure, display the text content corresponding to the initial data structure in the text editing area, and obtain the text content to be edited in response to operations on the content displayed in the text editing area.

[0116] The second display module 303 is configured to display a reference object list corresponding to the target prefix identifier in response to an operation on the target identifier selection control.

[0117] Among them, the reference object list includes at least one reference object corresponding to the target file extension prefix. When the second display module 303 detects an operation on the target identifier selection control, it displays the reference object list corresponding to the target data structure (that is, the preset data structure corresponding to the target identifier selection control). The reference object list covers all objects that can be referenced under the data structure.

[0118] Optionally, in some embodiments, the second display module 303 may specifically include:

[0119] an acquiring unit, configured to acquire configuration information corresponding to the target prefix identifier according to a pre-stored mapping relationship in response to an operation on the target identifier selection control;

[0120] The display unit is used to display a list of reference objects corresponding to the configuration information.

[0121] Optionally, in some embodiments, the display unit may specifically include:

[0122] An extraction subunit, used to extract reference objects contained in the configuration information;

[0123] The display subunit is used to display a list of reference objects corresponding to the configuration information based on the arrangement order and association relationship between the extracted reference objects.

[0124] Optionally, in some embodiments, the editing device may further include a construction unit, which may be used to collect configuration information corresponding to a plurality of reference objects and construct a mapping relationship between each piece of configuration information and a prefix identifier.

[0125] The editing module 304 is configured to, in response to an object selection operation on the reference object list, add the selected reference object to a target location of the text content to edit the text content of the target data structure type.

[0126] For example, the reference object list includes multiple reference objects. When the editing module 304 detects an object selection operation on the reference object list, it determines the selected reference object as the target reference object, and then parses the target application object to obtain text content of the target data structure type. That is, optionally, in some embodiments, the editing module 304 may specifically include:

[0127] a determining unit, configured to determine, in response to an object selection operation on the reference object list, a selected reference object as a target reference object;

[0128] A parsing unit, configured to parse the target reference object;

[0129] The editing unit is used to edit the text content based on the parsing result to obtain text content of the target data structure type.

[0130] Optionally, in some embodiments, the editing unit can be specifically used to: edit the text content based on the parsing results to obtain the edited text content, obtain a preset suffix identifier, and add the preset suffix identifier to the end of the edited text content to obtain text content of the target data structure type.

[0131] Optionally, in some embodiments, the data structure page further includes a preview display control, and the editing device may further include a preview module 305, such as Figure 3b As shown, the preview module 305 can be specifically used to preview the text content of the target data structure type in response to an operation on the preview display control.

[0132] In the embodiment of the present application, after the first display module 301 displays the data structure page, the acquisition module 302 obtains the text content to be edited in response to the operation on the text editing area, the second display module 302 displays the reference object list corresponding to the target prefix identifier in response to the operation on the target identifier selection control, and the editing module 304 adds the selected reference object to the target position of the text content in response to the object selection operation on the reference object list to edit the text content of the target data structure type. The data structure editing device provided by the present application pre-establishes the mapping relationship between the reference object and the data structure. When the text content needs to be edited, the text content of the target data structure type is edited according to the visual identifier selection control. Therefore, the efficiency of editing the data structure can be improved and the flexibility is high.

[0133] In addition, the present application also provides an electronic device, such as Figure 4 As shown, it shows a schematic diagram of the structure of the electronic device involved in this application, specifically:

[0134] The electronic device may include one or more processing core processors 401, one or more computer-readable storage media memories 402, a power supply 403, an input unit 404 and other components. Those skilled in the art will understand that Figure 4 The electronic device structure shown in the figure does not constitute a limitation of the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange components differently.

[0135] Processor 401 is the control center of the electronic device. It connects the various parts of the entire electronic device using various interfaces and lines. By running or executing software programs and / or modules stored in memory 402 and calling data stored in memory 402, it performs various functions of the electronic device and processes data, thereby providing overall control of the electronic device. Optionally, processor 401 may include one or more processing cores; preferably, processor 401 may integrate an application processor and a modem processor, wherein the application processor primarily processes the operating system, user interface, and application programs, and the modem processor primarily handles wireless communications. It is understood that the modem processor may not be integrated into processor 401.

[0136] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and data processing by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 402 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.

[0137] The electronic device also includes a power supply 403 for supplying power to various components. Preferably, the power supply 403 can be logically connected to the processor 401 via a power management system, thereby enabling the power management system to manage charging, discharging, and power consumption. The power supply 403 can also include one or more DC or AC power supplies, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and other arbitrary components.

[0138] The electronic device may further include an input unit 404, which may be configured to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.

[0139] Although not shown, the electronic device may further include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 401 in the electronic device will load the executable files corresponding to the processes of one or more application programs into the memory 402 according to the following instructions, and the processor 401 will run the application programs stored in the memory 402 to implement various functions as follows:

[0140] Display the data structure page, respond to the operation on the text editing area, obtain the text content to be edited, respond to the operation on the target identifier selection control, display the reference object list corresponding to the target prefix identifier, respond to the object selection operation on the reference object list, add the selected reference object to the target position of the text content to edit the text content of the target data structure type.

[0141] The specific implementation of the above operations can be found in the previous embodiments and will not be repeated here.

[0142] After displaying the data structure page, the embodiment of the present application obtains the text content to be edited in response to an operation on the text editing area, displays a list of reference objects corresponding to the target prefix identifier in response to an operation on a target identifier selection control, and adds the selected reference object to the target position of the text content in response to an object selection operation on the reference object list to edit the text content of the target data structure type. The data structure editing method provided by the present application pre-establishes a mapping relationship between the reference object and the data structure. When the text content needs to be edited, the text content of the target data structure type is edited according to the visual identifier selection control. Therefore, the efficiency of editing the data structure can be improved and the flexibility is high.

[0143] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be accomplished by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0144] To this end, the present application provides a storage medium storing a plurality of instructions that can be loaded by a processor to execute the steps of any of the data structure editing methods provided in the present application. For example, the instructions can execute the following steps:

[0145] Display the data structure page, respond to the operation on the text editing area, obtain the text content to be edited, respond to the operation on the target identifier selection control, display the reference object list corresponding to the target prefix identifier, respond to the object selection operation on the reference object list, add the selected reference object to the target position of the text content to edit the text content of the target data structure type.

[0146] The specific implementation of the above operations can be found in the previous embodiments and will not be repeated here.

[0147] The storage medium may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0148] Since the instructions stored in the storage medium can execute the steps in any data structure editing method provided in this application, the beneficial effects that can be achieved by any data structure editing method provided in this application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0149] According to one aspect of the present application, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in the various optional implementations described above.

[0150] The above is a detailed introduction to the data structure editing method, device, electronic device and storage medium provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, based on the ideas of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A method for editing a data structure, characterized in that: include: Displaying a data structure page of a syntax parser for a web page, the data structure page including a text editing area and a text format conversion area, the text format conversion area including an identifier selection control corresponding to a prefix identifier, the text editing area being used to edit a data structure of a business, each prefix identifier corresponding to a preset data structure; In response to an operation on the text editing area, obtaining text content to be edited; In response to an operation on a target identifier selection control, displaying a reference object list corresponding to a target data structure, wherein the target data structure is a preset data structure corresponding to the target identifier selection control, and the reference object list includes at least one reference object corresponding to an extension prefix of a target file; In response to an object selection operation on the reference object list, the selected reference object is determined as a target reference object, the target reference object is parsed using the syntax parser, and the text content is edited based on the parsing result to obtain text content of the target data structure type.

2. The method according to claim 1, characterized in that In response to the operation of selecting a control for a target identifier, a list of reference objects corresponding to the target prefix identifier is displayed, including: In response to an operation on a target identifier selection control, obtaining configuration information corresponding to the target prefix identifier according to a pre-stored mapping relationship; Displays a list of reference objects corresponding to the configuration information.

3. The method according to claim 2, characterized in that The displaying of the reference object list corresponding to the configuration information includes: Extracting the reference object contained in the configuration information; Based on the extracted arrangement order and association relationship between the reference objects, a reference object list corresponding to the configuration information is displayed.

4. The method according to claim 3, characterized in that The displaying of a list of reference objects corresponding to the configuration information based on the arrangement order and association relationship between the extracted reference objects includes: Identify the object reference relationship for each referenced object; Determining a parent reference object and a child reference object in the extracted reference object according to the identified object reference relationship; Based on the extracted arrangement order and object reference relationship between the reference objects, a reference object list corresponding to the configuration information is displayed, wherein the reference object list includes a first-level menu corresponding to each parent reference object and a submenu under each first-level menu.

5. The method according to claim 2, characterized in that Also includes: Collect configuration information corresponding to multiple reference objects; Construct a mapping relationship between each configuration information and prefix identifier.

6. The method according to any one of claims 1 to 5, characterized in that The editing of the text content based on the parsing result to obtain text content of the target data structure type includes: Edit the text content based on the parsing result to obtain edited text content; A preset suffix identifier is obtained, and the preset suffix identifier is added to the end of the edited text content to obtain text content of the target data structure type.

7. The method according to any one of claims 1 to 5, characterized in that The step of obtaining text content to be edited in response to an operation on the text editing area includes: Obtain the text content corresponding to the initial data structure, and display the text content corresponding to the initial data structure in the text editing area; In response to an operation on the content displayed in the text editing area, text content to be edited is acquired.

8. The method according to any one of claims 1 to 5, characterized in that The data structure page further includes a preview display control, which, in response to an object selection operation on the reference object list, adds the selected reference object to a target location of the text content to edit the text content of the target data structure type, and further includes: In response to an operation on the preview display control, text content of the target data structure type is previewed.

9. A data structure editing device, characterized in that: include: A first display module is configured to display a data structure page of a syntax parser for a web page, the data structure page including a text editing area and a text format conversion area, the text format conversion area including an identifier selection control corresponding to a prefix identifier, the text editing area being used to edit a data structure of a service, each prefix identifier corresponding to a preset data structure; An acquisition module, configured to acquire text content to be edited in response to an operation on the text editing area; a second display module, configured to display a reference object list corresponding to a target data structure in response to an operation on a target identifier selection control, wherein the target data structure is a preset data structure corresponding to the target identifier selection control, and the reference object list includes at least one reference object corresponding to an extension prefix of a target file; The editing module is used to respond to the object selection operation for the reference object list, determine the selected reference object as the target reference object, use the syntax parser to parse the target reference object, and edit the text content based on the parsing result to obtain the text content of the target data structure type.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the data structure editing method according to any one of claims 1 to 8 are implemented.

11. A computer-readable storage medium, characterized in that A computer program is stored thereon, wherein when the computer program is executed by a processor, the steps of the data structure editing method according to any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Automated documentation system and method

    US20080109739A1