WO2021073077A1 - 用于自动生成电子表格的方法、装置、设备及存储介质 - Google Patents

用于自动生成电子表格的方法、装置、设备及存储介质 Download PDF

Info

Publication number
WO2021073077A1
WO2021073077A1 PCT/CN2020/089642 CN2020089642W WO2021073077A1 WO 2021073077 A1 WO2021073077 A1 WO 2021073077A1 CN 2020089642 W CN2020089642 W CN 2020089642W WO 2021073077 A1 WO2021073077 A1 WO 2021073077A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
nodes
data
electronic form
component
Prior art date
Application number
PCT/CN2020/089642
Other languages
English (en)
French (fr)
Inventor
丛明舒
瞿中明
曲嘉宝
曾凯
Original Assignee
深圳逻辑汇科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳逻辑汇科技有限公司 filed Critical 深圳逻辑汇科技有限公司
Publication of WO2021073077A1 publication Critical patent/WO2021073077A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems

Definitions

  • the present disclosure relates to methods, devices, equipment and storage media for automatically generating electronic forms.
  • a spreadsheet model is a spreadsheet that can include values, text, and formulas to calculate the value of one or some variables.
  • Spreadsheets used for financial analysis usually include dozens of pages, thousands of rows, and tens of thousands of cells. There are complex mutual calculation relationships between cells, and most of the cells are calculated based on other cells.
  • the existing methods for generating electronic forms are either error-prone and difficult to understand and debug, or they are less flexible. Therefore, there is a need for an improved method, device, device, and storage medium for automatically generating electronic forms.
  • An embodiment of the present disclosure relates to a computer-implemented method for automatically generating an electronic form.
  • the method includes: obtaining a hierarchical structure for the electronic form, wherein the hierarchical structure includes one or more levels, and the one or more levels have multiple levels. Nodes, where each level has at least one node and has a corresponding level type, and each node corresponds to one or more cells in the spreadsheet, where the level structure also includes the affiliation relationship between the multiple nodes; obtaining Metadata of each node of the plurality of nodes; acquiring original data for the electronic form; and generating the electronic form based at least on the hierarchical structure, metadata, and raw data for the electronic form.
  • the apparatus includes: an editor configured to obtain a hierarchical structure for the electronic form, wherein the hierarchical structure includes one or more levels, and the one Or multiple levels have multiple nodes, where each level has at least one node and has a corresponding level type, and each node corresponds to one or more cells in the spreadsheet, where the hierarchy structure also includes one of the multiple nodes
  • the editor is also configured to obtain the metadata of each node in the plurality of nodes
  • the data panel the data panel is configured to obtain the original data for the electronic form
  • the electronic form generation module the electronic form
  • the generation module is configured to generate an electronic form based on at least a hierarchical structure, metadata, and raw data for the electronic form.
  • Another embodiment of the present disclosure relates to a device for automatically generating an electronic form, the device includes: at least one processor; and at least one storage device, the at least one storage device stores instructions, when the instructions are executed by the at least one processor At least one processor is caused to execute the above method.
  • Yet another embodiment of the present disclosure relates to a non-transitory computer-readable storage medium that stores instructions that when executed by a processor causes the foregoing method to be performed.
  • Yet another embodiment of the present disclosure relates to an apparatus for automatically generating an electronic form, which includes components for performing the steps of the above-mentioned method.
  • FIG. 1A is a block diagram of an exemplary apparatus for automatically generating an electronic form according to some embodiments of the present disclosure.
  • FIG. 1B is a flowchart illustrating an exemplary method for automatically generating an electronic form according to some embodiments of the present disclosure.
  • FIG. 2A is a block diagram of an exemplary graphical user editor for obtaining the hierarchical structure of an electronic form according to some embodiments of the present disclosure.
  • FIG. 2B is a flowchart illustrating an exemplary method for obtaining a hierarchical structure of an electronic form according to some embodiments of the present disclosure.
  • FIG. 3A is an exemplary hierarchical structure corresponding to one page of an electronic form according to some embodiments of the present disclosure.
  • FIG. 3B is the structure of a table in an exemplary electronic table according to some embodiments of the present disclosure.
  • Figure 3C is an exemplary component for specifying a table according to some embodiments of the present disclosure.
  • 4A to 4C show exemplary graphical user editors according to some embodiments of the present disclosure.
  • 4D to 4F illustrate graphical user interfaces displayed on an exemplary apparatus for automatically generating electronic forms according to some embodiments of the present disclosure.
  • 5A, 5B, and 5D are schematic diagrams showing exemplary spreadsheet hierarchical structures and dependency relationships between nodes according to some embodiments of the present disclosure.
  • FIG. 5C is a schematic diagram illustrating a method of transforming a calculation relationship between high-level nodes into a calculation relationship between low-level nodes according to some embodiments of the present disclosure.
  • FIG. 5E is a visual representation of the dependency relationship between nodes in an exemplary spreadsheet hierarchy according to some embodiments of the present disclosure.
  • FIG. 6 is a flowchart illustrating an exemplary method for establishing a dependency relationship between nodes according to some embodiments of the present disclosure.
  • FIG. 7 is a schematic diagram illustrating nodes in an exemplary spreadsheet hierarchy structure according to some embodiments of the present disclosure.
  • Figure 8A is a block diagram of an exemplary data panel according to some embodiments of the present disclosure.
  • Figure 8B is a graphical user interface of an exemplary data panel according to some embodiments of the present disclosure.
  • 9A and 9B are flowcharts illustrating exemplary methods for generating electronic forms according to some embodiments of the present disclosure.
  • Figure 10 is a block diagram of an exemplary spreadsheet generation module according to some embodiments of the present disclosure.
  • 11A to 11D show exemplary displayed electronic forms according to some embodiments of the present disclosure.
  • 11E and 11F show exemplary adjustments to the position of the table in the displayed electronic table according to some embodiments of the present disclosure.
  • FIG. 12 is a flowchart illustrating an exemplary method for updating a generated electronic form according to some embodiments of the present disclosure.
  • FIG. 13 is a flowchart illustrating an exemplary method for modifying an electronic form according to some embodiments of the present disclosure.
  • Figure 14 illustrates an exemplary graphical user editor according to some embodiments of the present disclosure.
  • Figure 15 illustrates an exemplary displayed electronic form according to some embodiments of the present disclosure.
  • FIG. 16 is a flowchart illustrating an exemplary method of obtaining a hierarchical structure for an electronic form according to some embodiments of the present disclosure.
  • Figure 17 shows an exemplary formatting component according to some embodiments of the present disclosure.
  • FIG. 18 shows a general hardware environment in which the present disclosure can be applied according to some embodiments of the present disclosure.
  • the existing methods for generating electronic forms are either error-prone and difficult to understand and debug, or they are less flexible.
  • existing general-purpose spreadsheet editing software such as Microsoft Excel, Google Sheets, etc.
  • it is very easy to make mistakes when using general spreadsheet software to generate the spreadsheet model and the generated spreadsheet model is difficult to debug, difficult to reuse, and difficult to understand or change by others except the model builder.
  • the embodiments of the present application may allow users and/or applications, etc. to generate electronic forms by providing the hierarchical structure, metadata, and raw data of the electronic forms, respectively.
  • the method of using the embodiment of the present application to generate the electronic form is more intuitive, convenient, easy to understand and debug, easy to reuse, and has the characteristics of flexibility and automation.
  • FIG. 1A is a block diagram of an exemplary apparatus 100A for automatically generating an electronic form according to some embodiments of the present disclosure.
  • the device 100A may include an editor 110, a data panel 120, and a spreadsheet generating module 130.
  • the device 100A may also include a spreadsheet preview module 140, a hierarchical map builder 150, and a hierarchical map memory 160, and these three components are shown with a dashed frame to indicate that they are optional.
  • FIG. 1A illustrates the above-mentioned six units, this is only a schematic structure of an apparatus for automatically generating an electronic form, and the apparatus 100A for automatically generating an electronic form may also include more than shown. Few or different units, or a combined unit that can include any of the above six units.
  • the editor 110 may be configured to obtain a hierarchical structure for the electronic form.
  • the hierarchical structure for the spreadsheet may include one or more hierarchies with a plurality of nodes, wherein each hierarchical level has at least one node and has a corresponding hierarchical type (e.g., workbook). , Page, section, table, block, row, column, interval, cell, etc.), each node corresponds to one or more cells in the spreadsheet, where the hierarchical structure also includes the affiliation between the multiple nodes (For example, a table node may have several child nodes whose level type is row, that is to say, these child nodes whose level type is row belong to the node whose level type is table). According to one embodiment, if and only if one or more cells corresponding to node A are contained in one or more cells corresponding to node B, node A is a child node of node B, or node A belongs to ⁇ Node B.
  • the editor 110 may include a graphical user interface editor, where the graphical user interface editor includes components for specifying nodes of different levels (for example, components for adding and/or modifying row nodes, for adding And/or modify the components of the table node, etc.), and wherein the graphical user interface editor may also be configured to: receive input for components for specifying nodes of different levels, and generate a hierarchical structure based on the input. For example, in response to receiving an input for a component for adding a row node, the graphical user interface editor may add a corresponding row node in the hierarchical structure, and so on.
  • the graphical user interface editor includes components for specifying nodes of different levels (for example, components for adding and/or modifying row nodes, for adding And/or modify the components of the table node, etc.), and wherein the graphical user interface editor may also be configured to: receive input for components for specifying nodes of different levels, and generate a hierarchical structure based on the input. For example, in response to receiving an input
  • different display formats may be used in the graphical user interface editor to represent different types of grammatical units in components used to specify nodes at different levels, thereby helping For the user’s understanding and debugging.
  • the editor 110 includes a text editor, which may be configured to receive a text code input by a user, and to parse the text code to generate a hierarchical structure.
  • the text code can be written in a domain-specific language for the application scenario, or any existing suitable programming language (such as C, C++, C#, Java, python, etc.) can be used to write, or any future development may be used.
  • Any existing suitable programming language such as C, C++, C#, Java, python, etc.
  • the implementation manner of the editor 110 is not limited to this, and the functions of the editor 110 may also be implemented in any other suitable manner.
  • the level of the spreadsheet used for the spreadsheet may be obtained from the natural language input by the user based on natural language processing.
  • the structure, or the hierarchical structure for the spreadsheet can be obtained based on the tree structure drawn by the user and other information about the node inputted to represent the hierarchical structure.
  • the level type for one or more levels of the spreadsheet includes one or more of the following: workbook, page, section, table, block, row, column, interval, and cell.
  • the components used to specify nodes at different levels include one or more of the following: components used to specify pages, components used to specify headings, components used to specify sections, components used to specify Table components, components for specifying data headers, components for specifying the body of the table, components for specifying rows, components for specifying columns, components for specifying blocks, components for specifying intervals, and The component in the specified cell.
  • the data header corresponds to one or more cells describing the names of each column in the table above the table in the spreadsheet, and the descriptive information at the intersection of the upper left corner of the table (called the stub), and the table body is the table The part except the data header.
  • the editor 110 may also be configured to obtain metadata of each node of a plurality of nodes of the hierarchical structure.
  • obtaining the metadata of each node of the plurality of nodes includes obtaining semantic information describing the specific meaning of the node.
  • the semantic information may include one or more of a name, a title, a tag, and an annotation.
  • the label can be a short term similar to the name describing a node (called an alias label), or it can specify additional characteristics of the node (called an attribute label).
  • Annotation is a descriptive text for a node, generally relatively long, and can be displayed in a specific position of the spreadsheet (such as the end of each page) or displayed in the generated spreadsheet in the form of "notes" in general spreadsheet editing software in.
  • the semantic information of a workbook can be the name of the workbook and/or the text content (title or comment) describing the entire workbook
  • the semantic information of a page can be the name of the page and/or the description of the entire page Text content (title or comment)
  • the semantic information of a section can be the text content (title or comment) describing the section
  • the semantic information of a table can be the name, label, or comment of the table
  • the semantics of a row or column The information can be the name, label, or comment of this row or column.
  • the semantic information of a block can be the name of this block and/or the label or comment applicable to all rows or columns of this block.
  • the semantic information of a cell can be It is the row name/label of this cell and the column name/label of this cell and the comment of this cell.
  • the editor 110 may further include a modifier component, which may be configured to obtain information for specifying one or more first cells corresponding to each of the plurality of nodes. Format information.
  • the information specifying the format of the one or more first cells includes a format type (for example, a first format type, a second format type, etc.), and the format corresponding to the format type is used for setting The format of the one or more first cells (for example, font, font size, background color, font color, bold, underline, indent, etc.).
  • the format corresponding to the format type can be set by the following operations: displaying predefined text, receiving the user's setting of the format of the predefined text, and based on the user's format of the predefined text Set to set the format corresponding to the format type.
  • the editor 110 is a graphical user interface editor
  • the graphical user interface editor may further include a decorator component, which may be used to specify the value of one or more cells corresponding to a node in the hierarchy. Format type.
  • the editor 110 may further include a label component, which may be configured to obtain an alias label or an attribute label for each node, wherein the alias label may specify one or more cells corresponding to the node.
  • the alias for example, number, symbol or text, etc.
  • the attribute tag can specify the additional characteristics of one or more cells corresponding to the node (for example, calculation priority, numerical unit, etc.).
  • Alias tags help users understand, distinguish, and refer to different nodes with the same name, and use attribute tags to control the process of generating spreadsheets more finely. Alias tags and attribute tags are used in the process of generating spreadsheets, but they are generally not displayed in the final generated spreadsheet.
  • the editor 110 may further include a dependency relationship definition component configured to obtain the dependency relationship between the first node of the plurality of nodes and the other one or more nodes. It should be noted that each node in the hierarchy may have a dependency relationship with other nodes. For any two cells A and B in the spreadsheet, define that cell A depends on cell B if and only if cell A is at least calculated by cell B (or by cell B together with other cells) get.
  • nodes eg, row nodes
  • the editor 110 may further include a calculation relationship definition component, and the calculation relationship definition component may be configured to obtain a calculation relationship between the first node and the other one or more nodes.
  • the calculation relationship definition component may be configured to obtain a calculation formula between the first node and one or more other nodes, an operator of the calculation formula, or a combination of operators, and so on.
  • the apparatus 100A may further include a hierarchical graph builder 150 and a hierarchical graph storage 160, wherein the hierarchical graph builder 150 may be configured to be based on each of the multiple nodes in the hierarchical structure obtained by the editor 110
  • the hierarchy type of the hierarchy, the child nodes of the node, and the metadata of the node are used to construct the hierarchy map for the spreadsheet
  • the hierarchy map storage 160 may be configured to store the hierarchy map.
  • the hierarchical graph builder 150 may be configured to obtain one or more first nodes corresponding to the first node based on the dependency relationship between the first node and the other one or more nodes obtained by the dependency relationship definition component.
  • the hierarchical graph builder 150 may be further configured to determine each first cell in the one or more first cells based on the calculated relationship between the first node and the other one or more nodes The calculated relationship between the grid and each of the one or more second cells. The following will further describe the method of establishing the dependency relationship and the calculation relationship between the nodes corresponding to the cells.
  • the hierarchical graph constructed by the hierarchical graph builder 150 may also be based on the nodes on which each node in the hierarchical structure depends. In one embodiment, the hierarchical graph builder 150 constructs the hierarchical graph based on the calculation relationship between each node of the plurality of nodes in the hierarchical structure and other nodes.
  • the data panel 120 may be configured to obtain raw data for the electronic form.
  • the data panel 120 may include a raw data acquisition component, and the raw data acquisition component may include one or more of the following components: a smart data extraction component configured to retrieve data from a data file (for example, an Excel file, a txt file) The original data is automatically identified in the database; the database interface component is configured to import the original data from the database; the retrieval interface component is configured to retrieve the original data from external data sources (for example, search engines, electronic publications, blogs, etc.); and The manual input receiving component is configured to receive the raw data input by the user.
  • a smart data extraction component configured to retrieve data from a data file (for example, an Excel file, a txt file)
  • the original data is automatically identified in the database
  • the database interface component is configured to import the original data from the database
  • the retrieval interface component is configured to retrieve the original data from external data sources (for example, search engines, electronic publications, blogs, etc.)
  • the manual input receiving component is configured
  • the data panel 120 may further include: a data detection component to be filled, configured to detect the node(s) that need to input raw data among the multiple nodes of the hierarchical structure and the requirements for the raw data in the node (For example, three rows, each row requires 5 raw data, etc.); and a data matching component, which is configured to combine the raw data acquired by the raw data acquisition component with the raw data detected by the data detection component to be filled.
  • the nodes match.
  • the data matching can be automatically matched by the system or manually matched or filled by the user through the graphical user interface.
  • the data panel 120 may also include an optional data filling graphical user interface to display the original data form for the electronic form to be filled, and the user can fill the original data form by means of human-computer interaction.
  • the original data table may be generated by the translator in the electronic table generating module 130.
  • the spreadsheet generating module 130 may be configured to generate the spreadsheet based at least on the hierarchical structure and metadata for the spreadsheet acquired by the editor 110 and the original data acquired by the data panel 120.
  • the spreadsheet generating module 130 may include a renderer, and the renderer may be configured to set the one or more first cells in the spreadsheet according to information used to specify the format of the one or more first cells.
  • the format of a cell for example, font, font size, background color, font color, bold, underline, indentation, etc.
  • the renderer may be configured to be based on the level type of the level where each node of the plurality of nodes is obtained by the editor 110, the format information of the node, and one or more units corresponding to the node. One or more of the contents of the cell automatically sets the format of one or more cells corresponding to the node.
  • the electronic form generation module 130 may further include a translator.
  • the translator may be configured to: for each node of the plurality of nodes in the hierarchical structure: determine the position in the electronic table of one or more cells corresponding to the node based on the hierarchical structure; and Fill in one or more cells corresponding to the node based on one or more of the original data, the level type of the node, the metadata of the node, the node that the node depends on, and the calculation relationship of the node Content (for example, numbers, characters, text, etc.).
  • An Excel file or other spreadsheet file can be generated based on the processing result of the translator, or a txt file or a part of a web page or a file in any other suitable format can be generated.
  • the translator may be configured to be based at least on each of the one or more first cells determined by the hierarchical graph builder 150 based on the calculated relationship between the first node and the other one or more nodes A calculation relationship with each second cell in the one or more second cells is used to generate a spreadsheet formula for each first cell in the one or more first cells.
  • the translator may be configured to be based on the hierarchical structure of the spreadsheet obtained by the editor 110, the node that needs to input raw data detected by the to-be-filled data detection component of the data panel 120, and the requirements for the raw data in the node.
  • the translator is only based on The original data can fill all the contents of the spreadsheet.
  • the editor 110 may be further configured to receive an operation of specifying the position of the table in the electronic form
  • the electronic form generation module 130 may be further configured to adjust the position of the table in the electronic form based on the operation.
  • this operation can specify (for example, through a graphical user interface editor or a text editor) that the distance between Table B and Table A is 3 rows, and the spreadsheet generation module 130 can adjust Table B to It is 3 rows away from table A.
  • this operation can specify (for example, through a graphical user interface editor or a text editor) that Table B is located at the bottom right of Table A, and the spreadsheet generation module 130 can adjust Table B to the right of Table A. In the lower position.
  • the device 100A may further include an electronic form preview module 140.
  • the spreadsheet preview module 140 may be configured to: cause the generated spreadsheet (for example, on a display) to be displayed, and to receive modifications to the hierarchy, metadata, raw data, dependency, or calculation relationship , And update the displayed spreadsheet based on changes to the hierarchy, metadata, original data, dependency, or calculation relationship.
  • the modification to the hierarchical structure may include dragging and dropping components for specifying the third node in the hierarchical structure; and wherein updating the displayed spreadsheet includes adjusting and The relative position of one or more cells corresponding to the third node in the electronic table is consistent with the relative position of the dragged component for specifying the third node in the graphical user interface editor.
  • the electronic form preview module 140 may be configured to display the generated electronic form, receive modifications to the displayed electronic form, and convert the modifications to the electronic form into hierarchical structure, metadata, Modification of at least one of the original data, dependency relationship, and calculation relationship, and at least one of the editor and the data panel is used to modify the hierarchical structure, metadata, original data, dependent nodes, etc. based on the modification. Or at least one of the calculation relationships.
  • the apparatus 100A may further include an error detection module, which may be configured to automatically detect errors in one or more of the hierarchical structure, metadata, raw data, dependency relationship, or calculation relationship ; And issuing (for example, visual, auditory, or tactile, etc.) warnings to indicate errors. Through error detection and prompting, it can help reduce possible errors in the electronic form, and facilitate users to debug.
  • the device 100A may further include a smart suggestion module, wherein the smart suggestion module may be configured to: based on one of the obtained hierarchical structure, metadata, raw data, dependency, calculation relationship, and operations that the user has performed.
  • the device 100A can interact with the client 170.
  • the apparatus 100A and the client 170 may be located in the same device, or located in a different device, and may be communicatively coupled through a wired or wireless connection.
  • the client 170 may be, for example, an electronic device such as a notebook computer, a mobile phone, a tablet computer, a wearable device, etc. used by a user, or may be an application program running on a computing device, and the like.
  • the client 170 may provide input to one or more of the editor 110, the data panel 120, the spreadsheet generation module 130, and the spreadsheet preview module 140.
  • FIG. 1B is a flowchart illustrating an exemplary method 100B for automatically generating an electronic form according to some embodiments of the present disclosure.
  • FIG. 1B illustrates the four steps of the method 100B, this is only a schematic flow of the method for automatically generating an electronic form, and the method 100B for automatically generating an electronic form may also include more or more steps than shown. Fewer steps, or a combination of any of the above four steps may be included. In addition, some steps in method 100B may occur simultaneously or in a different order than shown.
  • the method 100B starts from step S110, which can be executed by the editor 110 of FIG. 1A.
  • step S110 a hierarchical structure for the electronic form is obtained, where the hierarchical structure includes one or more levels, the one or more levels have multiple nodes, and each level has at least one node and has a corresponding level type, Each node corresponds to one or more cells in the spreadsheet, and the hierarchical structure also includes the affiliation relationship between the multiple nodes.
  • step S120 proceeds to step S120, and step S120 may be executed by the editor 110 of FIG. 1.
  • step S120 the metadata of each of the multiple nodes in the hierarchical structure is obtained.
  • step S130 which may be executed by the data panel 120 of FIG. 1.
  • step S130 the original data for the electronic form is obtained.
  • step S140 which may be executed by the spreadsheet generating module 130 of FIG. 1.
  • step S140 an electronic form is generated based at least on the hierarchical structure, metadata, and raw data for the electronic form.
  • FIG. 2A is a block diagram of an exemplary graphical user interface editor 200A for obtaining the hierarchical structure of an electronic form according to some embodiments of the present disclosure.
  • the graphical user interface editor 200A may be an example of the editor 110 shown in FIG. 1A.
  • the graphical user interface editor 200A may include a component 210 for specifying nodes of different levels, a dependency relationship definition component 220, a calculation relationship definition component 230, a decorator component 240, and a label component 250.
  • FIG. 2A illustrates the above five units, this is only a schematic structure of the graphical user interface editor 200A, and the graphical user interface editor 200A may also include more or fewer units than shown, or may include A combination unit of any of the above five units.
  • the graphical user interface editor 200A may be configured to receive input to the component 210 for specifying nodes of different levels, and to generate a hierarchical structure for the spreadsheet based on the input.
  • the component 210 for specifying nodes of different levels may be used to add, modify, and/or delete nodes of different levels, and the nodes of different levels may correspond to one or more cells in the spreadsheet.
  • the level type of one or more levels of the spreadsheet may include one or more of the following: workbook, page, section, table, block, row, column, interval, and cell. It should be understood that the above-mentioned hierarchical types are only examples, and any other suitable hierarchical types may also be defined for the hierarchical structure.
  • a page may be composed of sections or tables, and each section may also include a section or table.
  • the components used to specify nodes at different levels include one or more of the following: components used to specify pages, components used to specify headings, components used to specify sections, components used to specify Table components, components for specifying data headers, components for specifying the body of the table, components for specifying rows, components for specifying columns, components for specifying blocks, components for specifying intervals, and The component in the specified cell.
  • the component 210 for specifying nodes of different levels may also include components for adding titles of different levels (for example, the components for specifying sections may be components for adding titles), where titles of different levels can divide the page. For different sections or tables. This will be further described below with reference to FIG. 3A.
  • FIG. 3A is an exemplary hierarchical structure 300A corresponding to one page of an electronic form according to some embodiments of the present disclosure.
  • Title 1 301 and Title 2 304 are first-level titles, and they divide this page into two sections: section 1 and section 2.
  • Section 1 further contains the second-level heading 1.1 302 and the second-level heading 1.2 303, which divide section 1 into section 1.1 and section 1.2 (in this example, because there is no table under the second-level heading 1.2, section 1.2 is empty), section 1.1 and section 1.2 can also be called subsections of section 1.
  • Section 1.1 includes two tables, namely Table 1.1.A 311 and Table 1.1.B 312.
  • section 2 further includes the second-level heading 2.1 305 and the second-level heading 2.2 308, which divide section 2 into section 2.1 and section 2.2.
  • Section 2.1 also includes two three-level headings 2.1.1 306 and heading 2.1.2 307.
  • Table 2.1.2.A 314 under heading 2.1.2 composes section 2.1.2, and section 2.2 includes two tables 2.2.A 315 And Table 2.2.B 316.
  • the hierarchical structure 300A corresponding to one page of the electronic form can be obtained, for example, through a component for specifying a title and a component for specifying a table.
  • a component for specifying a data header a component for specifying a table body, a component for specifying a row, a component for specifying a column, a component for specifying a block, a component for specifying an interval can be passed.
  • the data header corresponds to one or more cells describing the names of each column in the table above the table in the spreadsheet, and the descriptive information at the intersection of the upper left corner of the table (called the stub), and the table body is the table The part except the data header.
  • FIG. 3C is an exemplary component 300C for specifying a table according to some embodiments of the present disclosure.
  • the component 300C is a component that specifies a table arranged vertically, wherein, in the component 350 for specifying the data header, all the columns or column blocks contained in the table are defined, as well as the calculation relationship between the various columns or column blocks.
  • And stub 351 define all rows or row blocks contained in this table and the calculation relationship between each row or row block in the component 370 for specifying the table body.
  • the table node corresponding to the component 300C for specifying the table there are 10 columns 352-356 and 361-365. Among them, the columns 361-365 form a column block 357, and there is a calculation relationship 358 "column 5" between the columns.
  • the interval can be specified by the "[]" operator, for example, "row 3 [column 1: column 5]” represents from “row 3” and “column 1” to The interval composed of cells at the intersection of "Column 5".
  • the component 210 for specifying nodes of different hierarchies may also be configured to obtain metadata of each node of a plurality of nodes of the hierarchical structure.
  • obtaining the metadata of each node of the plurality of nodes includes obtaining semantic information describing the specific meaning of the node.
  • the semantic information may include one or more of a name, a title, a tag, and an annotation.
  • the components 210 for specifying nodes of different levels may include text boxes, option boxes, dialog boxes, etc., thereby allowing the user to input semantic information corresponding to the nodes, so that the graphical user interface editor 200A is user-friendly.
  • the dependency relationship definition component 220 may be configured to obtain the dependency relationship between the first node among the plurality of nodes in the hierarchical structure and the other one or more nodes.
  • the calculation relationship definition component 230 may be configured to obtain the calculation relationship between the first node and the other one or more nodes.
  • the calculation relationship definition component may be configured to obtain the calculation formula between the first node and the other one or more nodes, the operator of the calculation formula, or a combination of operators (for example, "*/*-1", Among them, "*" means a placeholder) and so on.
  • each of the one or more first cells corresponding to the first node can be obtained based on the dependency relationship and the calculation relationship between the first node and the other one or more nodes.
  • the dependency relationship and calculation relationship between the node corresponding to the cell and the node corresponding to each of the one or more second cells corresponding to the other one or more nodes will be further described in conjunction with FIGS. 5A-5D.
  • the decorator component 240 may be configured to obtain information for specifying the format of one or more first cells corresponding to each of the plurality of nodes.
  • specifying the format of the one or more first cells includes specifying a format type (for example, a first format type, a second format type, etc.), and the format corresponding to the format type is used to set the one.
  • the format of multiple first cells for example, font, font size, background color, font color, bold, underline, indent, etc.
  • the decorator component 240 may be configured to obtain information that specifies the format of multiple cells in the same row corresponding to a row node. The information specifies that the format of these cells is the first format type, and then these cells can be converted to the first format type.
  • the format of the grid is set to the format corresponding to the first format type, such as size four, bold.
  • the graphical user interface editor 200A may further include a format setting component, and the format setting component may be used to set a format corresponding to the format type.
  • a predefined text can be displayed, a user's setting of the format of the predefined text can be received, and a specific format corresponding to the format type can be set based on the user's setting of the format of the predefined text.
  • the formatting component may include a text box, an option box, a dialog box, etc. The user can input a number corresponding to the format, input text corresponding to the format, select a level corresponding to the format, and so on.
  • the label component 250 can be configured to obtain an alias label or an attribute label for each node, where the alias label can specify the alias (for example, a number, symbol, or text, etc.) of one or more cells corresponding to the node, and the attribute The label can specify the additional characteristics of one or more cells corresponding to the node.
  • Alias tags and attribute tags can facilitate users to debug the spreadsheet. For example, suppose that the row names of the two rows are both "total", and the actual two rows correspond to the total data of 2016 and the total data of 2017 respectively. In this case, the alias of the first row node can be defined as "2016 Total”, the alias of the second row node is defined as "2017 Total”, which can distinguish these two rows more clearly.
  • aliases For example, you can also define the aliases of the two columns with column names "2016” and “2017” as “hist”, so that the alias "hist” can be used directly when defining the calculation relationship between nodes. Reference these two column nodes together to make the debugging of the spreadsheet more flexible.
  • the cell at the intersection of row 3 and column 5 can be obtained by formulas 358 and 376 at the same time.
  • You can also use the attribute tag to specify that the cell node B that stores the calculation relationship of formula 358 is used to verify the calculation relationship of node A (for example, CHECK TRUE), so that when the specific calculation relationship of node A is used to obtain the specific
  • an alarm can be issued (for example, a dialog box is displayed, a formula is displayed in a special format, a prompt sound, etc.).
  • the client for example, the client 170 in FIG. 1A
  • the client 170 in FIG. 1A can communicate with the graphical user interface editor 200A through any suitable input mechanism (for example, a keyboard, a mouse, a pen tablet, a microphone, a touch-sensitive screen, etc.).
  • any suitable input mechanism for example, a keyboard, a mouse, a pen tablet, a microphone, a touch-sensitive screen, etc.
  • Each component interacts.
  • FIG. 2B is a flowchart illustrating an exemplary method 200B for obtaining a hierarchical structure of an electronic form according to some embodiments of the present disclosure.
  • FIG. 2B illustrates the three steps of the method 200B, this is only a schematic flow for obtaining the hierarchical structure of the electronic form, and the method 200B for obtaining the hierarchical structure of the electronic form may also include more steps than shown. More or fewer steps, or a combination of any of the above three steps may be included.
  • some steps in method 200B may occur simultaneously or in a different order than shown.
  • the method 200B may be executed by the apparatus 100A shown in FIG. 1A.
  • the method 200B starts from step S210.
  • a graphical user interface editor (such as the graphical user interface editor 200A shown in FIG. 2A) is provided, where the graphical user interface editor may include components for specifying nodes at different levels .
  • step S220 the graphical user interface editor may receive input for components for specifying nodes of different levels.
  • step S230 the graphical user interface editor may generate a hierarchical structure based on the input to the components for specifying nodes of different hierarchies. For example, the corresponding row node may be added, modified, and/or deleted in the hierarchical structure based on the input for the component for specifying the row node.
  • FIG. 4A to 4C respectively show exemplary graphical user editors 400A, 400B, and 400C according to some embodiments of the present disclosure.
  • the graphical user interface editors 400A, 400B, and 400C may be examples of the editor 110 shown in FIG. 1A or the graphical user interface editor 200A shown in FIG. 2A. It should be understood that the graphical user interface editors 400A, 400B, and 400C may also include more or less components than those shown, or the graphical user interface editors 400A, 400B, and 400C may be implemented in any other suitable manner.
  • the graphical user interface editor 400A includes components for specifying nodes at different levels, for example, a component 401 for specifying a table, a component 410 for specifying a data header, a component 481 for specifying a title, Component 413 for specifying stubs, components 414-416 for specifying columns or column blocks, components 420-460 and 471-472 for specifying rows or row blocks, and components for specifying cells (not shown) .
  • a new page may be displayed in the graphical user interface editor 400A, and the name or name of the page may be added. Describe other information on the page.
  • a table can be added to the graphical user interface editor 400A, and the component indicating the hierarchy type "table" and the component 402 for specifying the table name can be displayed, the component 402 It may be part of the component 401 for specifying the table. By entering "sales" in the component 402, the name of the table can be specified.
  • the graphical user interface editor 400A may also display a component 410 for specifying the data header of the table.
  • the component 413 for specifying the stub can be displayed.
  • the data header shown in FIG. 4A defines two primary column blocks "2017” and "2018", and each primary column block includes five secondary columns “Q1", “Q2", “Q3", "Q4", "All Year”.
  • the component 416 for specifying the column more first-level columns or first-level column blocks can be added.
  • the component 415 for specifying the column one or more third-level columns belonging to the second-level column "Q4" (at this time the second-level column becomes a second-level column block) can be added.
  • the row definition components 420-460 can define the rows contained in the table.
  • the decorator component 421 can be used to specify the format of one or more cells included in the row. For example, by clicking the upper triangle in the component 421, the level of the format type of the line can be increased, so that the line looks more eye-catching (for example, the font size is larger, the display is emphasized in bold and/or underlined, etc. Darker font color display, etc.); by clicking the triangle located at the bottom of the component 421, the level of the format type of the row can be lowered to make the row look less eye-catching.
  • the modifier component 421 can also be implemented in any other suitable manner. For example, the user can directly input information in a specified format, such as a text defining a format and a number of a format type.
  • the graphical user interface editor 400A may include a format setting component for specifying a format corresponding to a format type. For example, you can pop up a new dialog box or display predefined text (for example, "Cell Format 1") in other areas of the graphical user interface, and receive the user's settings for the format of the predefined text, for example, the displayed
  • the pre-defined text can be adjusted in real time according to the user's settings, so that the user can directly view the display effect of the format.
  • a specific format corresponding to the format type can be set based on the user's setting of the format of the predefined text, and the format of one or more cells having the format type can be designated accordingly according to the specific format. For example, referring to FIG. 17, FIG.
  • FIG. 17 illustrates an exemplary formatting component 1700 according to some embodiments of the present disclosure.
  • different format types of headers, columns, and rows can be set in 1701-1711.
  • the format of the predefined text "Headline Format 1" 1701 means that the format of the heading format 1 is set to a black background, white and bold font
  • the format of the predefined text "Line Format 2" 1708 means that the format of the line format 2 is set as the line name It is italicized, indented by 2 characters, the data in the line is italicized, underlined, two decimal places, plus a thousandth sign
  • the format of the predefined text "Line Format 4" 1710 means that the line name of Line Format 4 is set to underline , The data in the row is displayed as a percent sign with two decimal places.
  • the predefined text 1712 "default table format", etc. means to set the default format of the table (for example, when the editor does not include the modifier component): the table name is black with white background and bold black, stubs are italic, column blocks The name merged cell is centered and displayed in bold bold. The name of the line block is listed above the lines included in the line block and displayed in bold bold. The second-level lines in the line block need to be indented by one character, etc.
  • the component 422 can be used to obtain semantic information describing the specific meaning of the row, such as row name, row label, comment, etc.
  • the graphical user interface editor 400A may also include other components for obtaining metadata of each node in the hierarchical structure.
  • metadata may also include one or more of the following additional information: the creation time of the node, the number of child nodes of the node, and one or more cells corresponding to the node The unit of the data of the node, the time point or time period corresponding to the data of the node, and the path from the root node in the hierarchical structure to the node, etc.
  • the input content in the component 423 is a predefined formula, such as "SOURCE()", which can indicate that the content of the row is filled with the original data obtained by the data panel.
  • the components 453 and 463 may be dependency relationship definition components and/or calculation relationship definition components, where the content in component 453 indicates that the result of the row “total” is equal to the sum of the row "mobile phone", the row “notebook” and the row “tablet”, The content in the component 463 indicates that the result of the row "average” is equal to the average value of the row "mobile phone", the row "notebook", and the row "tablet".
  • the row “total” depends on the row “mobile phone”, the row “notebook” and the row “tablet”, and the row “average” also depends on the row “mobile phone”, the row “notebook” and the row “tablet”.
  • the five rows shown in FIG. 4A are all first-level rows, similar to the components used to specify columns, the components used to specify rows may allow rows of different levels to be added.
  • a dialog box 464 can pop up, allowing the user to add new rows and add new blocks (the block can continue to add rows, and the behavior in the block The line one level lower than the current line) and so on.
  • the graphical user interface editor 400A may further include a label component.
  • the label component may be located in the upper left corner (or upper right corner, lower left corner, The lower right corner, etc.), the label component can also be located in other areas of the graphical user interface.
  • a dialog box 473 by clicking the label component, a dialog box 473 (the dialog box 473 may be a part of the label component) can be popped up, thereby allowing the user to edit one or more labels corresponding to the node.
  • the label component can obtain the alias label and/or attribute label for each node, where the alias label can specify the alias of one or more cells corresponding to the node (for example, numbers, symbols, or text, etc.), and the attribute label can Specify the additional characteristics of one or more cells corresponding to the node.
  • the alias label “mobile phone sales” is set for the row node "mobile phone”
  • the graphical user interface 4000D includes a graphical user interface editor 4010 and a spreadsheet preview module 4020. You can click the button 4030 to jump to the data filling graphical user interface 840 as shown in Figure 8B, and you can click the button 4050 to jump to the figure
  • the display shown in 5E visually represents the interface of 500E.
  • the editor 110 may further include a component importing a template, and the importing template component may be configured to import a template for one or more nodes in the hierarchical structure.
  • the template can be a template for nodes of any hierarchical type, and can be preset by the system or customized by the user.
  • you can import an overall workbook template for example, an overall spreadsheet template about DCF (discounted cash flow) model
  • the user can save pages, tables, blocks, rows, data headers, etc.
  • the spreadsheet preview module 4020 may display a preview 4026 of the generated spreadsheet corresponding to the newly added sheet template.
  • FIGS. 5A, 5B, and 5D are schematic diagrams illustrating exemplary spreadsheet hierarchical structures 500A, 500B, and 500D and dependency relationships between nodes according to some embodiments of the present disclosure.
  • the hierarchical structures 500A, 500B, and 500D are exemplary, and the hierarchical structures shown in FIGS. 5A, 5B, and 5D are only for ease of understanding, and are not intended to limit the storage format of the hierarchical structure.
  • the hierarchical structure in FIG. 5A may be obtained, for example, by the editor 110 of FIG. 1A, the editor 200A of FIG. 2A, or the graphical user interface editors 400A-400C of FIGS. 4A-4C.
  • FIG. 5A different node shapes are used to show nodes of different hierarchical types in the hierarchical structure, solid arrows are used to show the affiliation relationship between the nodes, and dotted arrows are used to show the dependency relationship between the nodes.
  • node A belongs to node B
  • the solid arrow points from B to A
  • node B is the parent node of node A
  • node A is the child node of node B.
  • a node without a parent node is called the root node
  • all nodes on the branch from the root node to a node are called the ancestors of the node.
  • Any node in the child directed graph with a node as the root is called the root node.
  • the node 501 shown in an ellipse is the root node, and its level type is a page, and the node 501 corresponds to a page of the spreadsheet. It should be understood that, in other embodiments, the hierarchical type of the root node may also be a workbook or the like.
  • the level type of the node 503 shown by the rounded rectangle is a table, and it has two child nodes 504 and 505 whose level type is a row, and these two child nodes are shown by an octagon.
  • the level type of the node 502 is also row, but it does not belong to the node 503, but directly belongs to the root node 501.
  • the workbook includes three rows in total, and the table corresponding to node 503 includes two rows corresponding to nodes 504 and 505.
  • Nodes with a hierarchy type of cell are shown by diamonds, in which cell nodes 506 and 507 belong to row node 502, cell nodes 508 and 509 belong to row node 504, and cell nodes 510 and 511 belong to row node 505.
  • FIG. 5A is an example of the hierarchical structure of the electronic form.
  • the actual hierarchical structure may include more or less or different hierarchical types than that of FIG. 5A, and each hierarchical level may include any suitable number of nodes.
  • the dependency definition component (for example, the dependency definition component in FIG. 2A 220)
  • the node 504 depends on the node 502, which can be represented by the dotted arrow 534 between the node 502 and the node 504.
  • the dependency definition component (for example, dependency definition component 220 in FIG.
  • a method for establishing a dependency relationship between nodes according to an exemplary embodiment of the present disclosure will be further described in conjunction with FIG. 5B to FIG. 5D and FIG. 6.
  • FIG. 6 is a flowchart illustrating an exemplary method 600 for establishing a dependency relationship between nodes according to some embodiments of the present disclosure. Although FIG. 6 illustrates four steps of the method 600, this is only a schematic flow of a method for establishing a dependency relationship between nodes. The method 600 may also include other possible steps, or may include the above four steps. A combination of steps in any step.
  • step S610 may be executed by, for example, the editor 110 of FIG. 1A or the dependency relationship definition component 220 of FIG. 2A.
  • step S610 the dependency relationship between the first node among the plurality of nodes in the hierarchical structure and the other one or more nodes is obtained.
  • it may be determined that the first node is dependent on the other one or more nodes by identifying another one or more nodes included in the calculation formula of the first node. For example, for the calculation formula in the component 450 for specifying a row in FIG.
  • the dependency definition component may obtain the following dependency: the row node 504 depends on the row node 502, and the cell node 507 depends on the cell node 511.
  • step S620 may be executed by, for example, the hierarchical graph builder 150 of FIG. 1A.
  • step S620 based on at least the dependency relationship between the first node and the other one or more nodes, for each cell corresponding to the one or more first cells corresponding to the first node Node, determining that the node is dependent on the first group of second nodes corresponding to each of the first group of second cells in the one or more second cells corresponding to the other one or more nodes.
  • the cell node 508 and the cell can be determined
  • the node 506 has a dependency relationship
  • the cell node 509 has a dependency relationship with the cell node 507.
  • the cell node 508 depends on the cell node 506, and the cell node 509 depends on the cell node 507.
  • the dashed arrow 531 between the node 508 and the node 506 and the dashed arrow 539 between the node 509 and the node 507 can be used to indicate these two dependencies.
  • step S610 the dependency edge of node 502 to node 504 has been established in step S610.
  • step S620 the dependency edge from node 502 to node 504 is converted into dependency edge 531 from node 506 to node 508, and dependency edge 539 from node 507 to node 509.
  • step S620 the dependency relationship between the nodes having a higher level type than the cell can be decomposed into the dependency relationship of the node whose level type is the cell among the descendants of the node.
  • the dependency relationship between the node 507 and the node 511 determined in step S610 since the level type of the level of the nodes 507 and 511 is already a cell, this step S620 can actually be omitted.
  • step S630 which may be executed by the hierarchical diagram builder 150 of FIG. 1A, for example.
  • step S630 the one or more first cells corresponding to the first node are obtained based on at least the calculation relationship between the first node and the other one or more nodes.
  • different methods can be used to convert the calculation relationship between the first node and the other one or more nodes into the relationship between each cell corresponding to the first node and the other one or more nodes.
  • the calculated relationship between some or all of the cells in the cell can be used to convert the calculation relationship between the first node and the other one or more nodes into the relationship between each cell corresponding to the first node and the other one or more nodes.
  • FIG. 5C is a schematic diagram illustrating a method of transforming a calculation relationship between high-level nodes into a calculation relationship between low-level nodes according to some embodiments of the present disclosure.
  • the user can enter a calculation formula in the editor
  • the dependency relationship can be further established by the following operations.
  • the method 600 proceeds to step S640, which may be executed by the hierarchical graph builder 150 of FIG. 1A, for example.
  • step S640 for the node corresponding to each of the one or more first cells corresponding to the first node, the following dependency relationship is established: the node and all or part of the ancestor nodes of the node depend on the first node. A group of second nodes and all or part of the ancestor nodes of the first group of second nodes. Referring to FIG.
  • node 508 and all ancestor nodes of node 508 that are not the ancestors of node 506 depend on nodes 506 and all ancestors of node 506 that are not the ancestors of node 508, and nodes 509 and Nodes that are not the ancestor nodes of node 507 among all ancestor nodes of node 509 depend on nodes that are not ancestor nodes of node 509 among all ancestor nodes of node 507 and node 507.
  • 5D shows the dependency relationship constructed according to step S640 for the hierarchical structure shown in FIG. 5A. Note that for clarity of illustration, the dependency relationship between node 509 and its ancestor nodes that are not the ancestor nodes of node 507 and node 507 and its ancestor nodes that are not ancestor nodes of node 509 is omitted in FIG. 5D.
  • dependency 531 indicating that node 508 depends on node 506
  • dependency 532 indicating that node 504 depends on node 506
  • dependency 533 indicating that node 503 depends on node 506
  • dependency 534 indicating node 504 depends on node 502
  • dependency 535 indicates that node 508 depends on node 502
  • dependency 536 indicates that node 503 depends on node 502.
  • dependency relationship node 507 and all ancestor nodes of node 507 that are not the ancestor nodes of node 511 depend on nodes 511 and all ancestor nodes of node 511 that are not ancestor nodes of node 507. That is, the following dependencies can be established: dependency 542, indicating that node 507 depends on node 511; dependency 543, indicating that node 507 depends on node 505; dependency 545, indicating that node 507 depends on node 503; dependency 541, indicating node 502 depends on node 511; dependency relationship 544 indicates that node 502 depends on node 505; dependency relationship 546 indicates that node 502 depends on node 503.
  • FIG. 5E A schematic diagram of the visual representation of the dependency relationship established in this way is shown in FIG. 5E.
  • the dependency relationship between all nodes whose level type is page and all nodes whose level type is page in the hierarchical structure is displayed.
  • the visual representation 500E may include nodes 5001-5007 and arrows representing the dependencies between them.
  • it is not necessary to visualize the dependency relationship between nodes in the hierarchical structure and in this case, there is no need to further establish the dependency relationship through the method of step S640.
  • step S640 is shown with a dashed frame to indicate that this step is optional.
  • FIG. 7 is a schematic diagram illustrating a node 700 in an exemplary spreadsheet hierarchy structure according to some embodiments of the present disclosure.
  • the node 700 may be any node in the hierarchical structure in FIGS. 5A-5B and 5D.
  • the data structure storing the nodes in the hierarchical structure shown in FIGS. 5A-5B and FIG. 5D according to an exemplary embodiment of the present disclosure may be referred to as a hierarchy graph.
  • the tree-like hierarchical structure shown in FIG. 5A, FIG. 5B, and FIG. 5D is only for the convenience of understanding, and is not intended to limit the storage manner of the hierarchical structure.
  • a hierarchical graph builder e.g., the hierarchical graph builder 150 as shown in FIG. 1A
  • the hierarchical graph storage e.g., the hierarchical graph storage 160 as shown in FIG. 1A
  • the hierarchical graph storage may It is configured to store the hierarchical map in any suitable storage device (including but not limited to RAM, ROM, magnetic disk, optical disc, etc.), and allows dynamic query, recall and modification of the hierarchical map.
  • the hierarchy type 702 of the hierarchy of the node, the child nodes 704 of the node, and the metadata 706 of the node may be stored for each node.
  • the hierarchical graph builder may be configured to construct a hierarchy based on the hierarchical type 702 of each node of the plurality of nodes in the hierarchical structure, the child nodes 704 of the node, and the metadata 706 of the node.
  • the metadata 706 may include semantic information describing the specific meaning of the node (for example, one or more of a title, a name, a label, and an annotation associated with the node).
  • the metadata 706 may also include one or more of the following additional information: the creation time of the node, the number of child nodes of the node, the unit of data used for one or more cells corresponding to the node, and the node The time point or time period corresponding to the data, and the path from the root node to the node in the hierarchical structure, etc.
  • the hierarchy type of node 504 may be stored as row, and the child nodes of node 504 are nodes 508 and 509 (for example, a list of numbers of child nodes or a list of pointers to child nodes may be stored, etc. ), and the metadata of the node 504 (for example, the row name, the column name list of each cell of the row, etc.) can be stored.
  • the node 708 on which the node depends may be optionally stored for each node (for example, the number of the dependent node may be stored or a pointer to the dependent node may be stored, etc.).
  • the construction of the hierarchical graph by the hierarchical graph builder is also based on the node 708 on which each node in the hierarchical structure depends. Referring to FIG. 5D, for the node 504, for example, the nodes on which the node 504 depends can be stored including the node 502 and the node 506. It should be noted that it is not necessary to store the nodes that each node depends on. According to an embodiment, the nodes that depend on the node may also be stored additionally or alternatively for each node.
  • the node that the node depends on can be stored, or the node that depends on the node can be stored, or both the node on which the node depends and the node that depends on the node can be stored.
  • the dependency relationship between the node and other nodes may not be stored (for example, the content of the cell corresponding to the node can be directly filled with original data, and the node does not depend on other nodes, but the node It may be dependent on other nodes, such as the row nodes "mobile phone", "notebook” and "tablet computer” in Figure 4A).
  • the calculation relationship 710 between the node and other nodes may optionally be stored for each node (for example, the calculation formula of the node, the operator or the operator included in the calculation formula of the node may be stored The combination of, the constant that may be included in the calculation formula, and the node on which the node depends on each parameter placeholder in the calculation formula, etc.).
  • the construction of the hierarchical graph by the hierarchical graph builder is also based on the calculation relationship 710 between each node in the hierarchical structure and other nodes. Referring to FIG.
  • the dependency relationship used in deriving the complete calculation formula of the node does not include the dependency relationship newly obtained through step S640. That is, for the dependency relationship between the nodes obtained through the editor, the dependency relationship between the ancestor nodes of these nodes is not used when deriving the calculation formula of the nodes.
  • the calculation relationship between the node and other nodes may not be stored (for example, the content of the cell corresponding to the node can be directly filled with original data, rather than calculated by other nodes, such as Figure 4A In the row nodes "mobile phone", "notebook” and "tablet").
  • FIG. 8A is a block diagram of an exemplary data panel 800A according to some embodiments of the present disclosure.
  • the data panel 800A may be a component independent of the editor.
  • the data panel 800A may be an example of the data panel 120 as shown in FIG. 1A.
  • the data panel 800A may include a raw data acquisition component 810, a data to be filled detection component 820, and a data matching component 830.
  • FIG. 8A illustrates the above three units, this is only a schematic structure of the data panel 800A, and the data panel 800A may also include more or less units than shown, or may include a combination of the above three units unit.
  • the raw data acquisition component 810 may be configured to provide an interface with the source of the raw data.
  • the raw data acquisition component 810 may include one or more of the following components: an intelligent data extraction component configured to automatically identify raw data from data files (for example, Excel files, txt files, etc.); database interface Components, configured to import raw data from databases (for example, Bloomberg and other professional financial databases); retrieval interface components, configured to retrieve raw data from external data sources (for example, search engines, electronic publications, blogs, etc.); manual input
  • the receiving component is configured to receive the raw data input by the user.
  • the manual input receiving component may allow the user to directly input data in the spreadsheet preview module (for example, the spreadsheet preview module 140) in the graphical user interface editor.
  • the user can manually modify the data obtained from one or more of the intelligent data extraction component, the database interface component, and the retrieval interface component.
  • a data traceability component can be used to record the source of the original data entered in the data panel.
  • the data source component may record one or more of the name and/or location of the data file, the name of the database, the name of the external data source, and the user name of the input data.
  • the original data input in the data panel 800A can be stored in a data storage device, and the original data stored in the data storage device can be called or exported.
  • the original data acquisition component 810 may be configured to identify the semantic information of each original data item, the original data item is a relatively independent data unit in the data file, and the semantic information of the original data item may be a string list describing the original data item For example, the semantic information of an original data item "123.45” can be a string list "["2019", "income”]".
  • the user can drag and drop or otherwise import the data file into the data panel 800A, and then the intelligent data extraction component can automatically identify the semantic information of each original data item of the original data in the data file.
  • the to-be-filled data detection component 820 can be configured to detect the node that needs to input raw data among the multiple nodes of the hierarchical structure and the requirements for the raw data in the node (for example, whether the node needs to input raw data, and the raw data that needs to be input type).
  • the data matching component 830 can be configured to be based on the raw data acquired by the raw data acquisition component 810 and the node that needs to be inputted with the raw data detected by the to-be-filled data detection component 820, and the requirements for the raw data in the node will require the raw data to be input.
  • the nodes match with the original data obtained.
  • the data matching component 830 may be configured to fill the matched original data into the matched node that requires the input of the original data. In some implementations, if there are multiple original data items that match the same node where the original data needs to be input, the user is allowed to select the original data item to fill in the node where the original data needs to be input. In other implementations, the user is allowed to input data directly (for example, through a keyboard) to fill in the node where the original data needs to be input.
  • the data panel 800A may optionally include a data filling graphical user interface 840.
  • the data table to be filled can be generated through the spreadsheet generation module and displayed on the graphical user interface, so that the data matching and filling results can be displayed in real time, and the user can more intuitively input the original data node Fill it.
  • the data table to be filled can be an Excel file or other electronic table file, or it can be a txt file or a part of a web page or any other suitable file format.
  • FIG. 8B is a graphical user interface 840 of an exemplary data panel according to some embodiments of the present disclosure.
  • the graphical user interface 840 may include a data table 831 to be filled (for example, in the form of a web page) generated by a translator and a renderer.
  • the graphical user interface 840 may also include a view 811 of the original data file (for example, in pdf format) imported by the original data acquisition component, and a view 812 of the analysis result of the original data file by the intelligent data extraction component.
  • the intelligent data extraction component is configured to parse the semantic information of each original data item in the original data identified from the data file to generate parsed data, and after the data file is parsed by the intelligent data extraction component
  • the data item of one of the data and the data filled in the data table to be filled is selected, the other two of the data file, the data parsed by the intelligent data extraction component, and the data filled in the data table to be filled
  • the corresponding data item in can be highlighted.
  • each original data item in the view 812 corresponds to the matching row name and column name.
  • the original data item "265,595" corresponds to semantic information ["Net Sales", "September 29", "2018 "].
  • the cells with dark gray background indicate the cells that do not need to be filled with data detected by the data detection component to be filled (for example, the data of these cells needs to be calculated based on the original data filled in other cells)
  • Only cells with a white or light blue background need to be filled with data.
  • the area 833 is the data automatically matched and filled by the data matching component 830, which is represented in black font on the data filling graphical user interface. For example, the data item "265,595" of the original data is automatically filled into the row "Sales" and the column "2018"
  • the cell at the intersection is displayed in black font.
  • different display formats can be used to distinguish raw data from different sources or corresponding to different predefined formulas.
  • an underlined number and a light blue background represent data manually entered by the user.
  • the graphical user interface 840 in FIG. 8B includes a data traceability function, that is, by clicking any data item in the data table 831 to be filled, one or more matching original data can be highlighted in the views 811 and 812, respectively. Items and parsed data items.
  • click on any of the original data items in the view 811, and the matched analytical data items and filled data items will be highlighted in the view 812 and the data table to be filled 831 respectively; click on any one of the views 812 to parse Data items, the original data items and the filled data items that match them are highlighted in the view 811 and the data table 831 to be filled, respectively.
  • FIG. 9A is a flowchart illustrating an exemplary method 900A for generating an electronic form according to some embodiments of the present disclosure.
  • FIG. 9A illustrates the three steps of the method 900A, this is only a schematic flow of the method for generating an electronic form, and the method 900A for generating an electronic form may also include more or fewer steps than shown. , Or may include a combination of any of the above three steps.
  • some of the steps in method 900A may occur simultaneously or in a different order than that shown.
  • the method 900A starts from step S910, which can be executed by the to-be-filled data detection component 820 of FIG. 8A.
  • step S910 among the multiple nodes in the hierarchical structure, the nodes that need to input original data and the requirements for the original data in the nodes are detected.
  • step S920 the translator generates an electronic form to be filled based on the hierarchical structure of the electronic form, the metadata, the detected nodes that need to input the original data, and the requirements for the original data in the nodes.
  • the method 900A proceeds to step S930, and at step S930, an electronic form to be filled is filled based on the original data to generate an electronic form.
  • FIG. 9B is a flowchart illustrating an exemplary method 900B for generating an electronic form according to some embodiments of the present disclosure.
  • FIG. 9B is a flowchart illustrating an exemplary method 900B for generating an electronic form according to some embodiments of the present disclosure.
  • FIG. 9B illustrates two steps of the method 900B, this is only a schematic flow of the method for generating an electronic form, and the method 900B for generating an electronic form may also include more or fewer steps than shown. , Or may include a combination of any of the above two steps.
  • the steps in method 900B may occur simultaneously or in a different order than that shown.
  • the method 900B may be performed after the data items to be filled are filled in steps S910 to S930 of the method 900A. According to another embodiment, the method 900B may be performed before the steps S910 to S930 of the method 900A, and only the formulas in the spreadsheet are generated. According to one embodiment, the method 900B may be executed by the translator of the spreadsheet generation module.
  • the method 900B starts from step S901, and at step S901, for each node of the plurality of nodes in the hierarchical structure: determine the position of one or more cells corresponding to the node in the electronic table based on the hierarchical structure.
  • the method 900B proceeds to step S902.
  • step S902 it is filled based on one or more of the original data, the level type of the node, the metadata of the node, the node that the node depends on, and the calculation relationship of the node. The content of one or more cells corresponding to this node.
  • corresponding pages can be added to the spreadsheet.
  • the position (for example, row coordinates and column coordinates) of the headings of different levels in each page can be determined for the nodes whose level type is "section" in the hierarchical structure, and the corresponding position in the spreadsheet can be determined.
  • the position of the cell in the upper left corner of each table in the spreadsheet (for example, row coordinates and column coordinates) can be determined for the nodes whose level type is "table" in the hierarchy structure, and the table's position can be determined.
  • the position of the name and the stub of the table in the spreadsheet and write the name of the table and the contents of the stub to the cell at the corresponding position in the spreadsheet.
  • the position of all cells of this table in the spreadsheet and the content (for example, data or formulas) in these cells can be determined, and then sent to the spreadsheet in the Write the corresponding content (for example, data or formula) in the cell at the corresponding position.
  • the cells can also be filled in any other suitable order and manner, as long as the generated electronic form and the obtained hierarchical structure, the metadata of the corresponding node, the original data, and the calculation relationship are guaranteed. Just keep it consistent.
  • FIG. 10 is a block diagram of an exemplary spreadsheet generation module 1000 according to some embodiments of the present disclosure.
  • the electronic form generation module 1000 may be an example of the electronic form generation module 130 shown in FIG. 1.
  • the spreadsheet generating module 1000 may include a translator 1010 and a renderer 1020.
  • FIG. 10 illustrates the above two units, this is only a schematic structure of the spreadsheet generating module 1000.
  • the spreadsheet generating module 1000 may also include more or fewer units than shown, or may include the above two units. A combination of units.
  • the translator 1010 may be configured to be based on the raw data obtained by the data panel or at least based on the association of each first cell and one or more of the one or more first cells obtained by the hierarchical graph builder. The calculation relationship between each second cell in the second cells is used to generate the data or formula in each first cell in one or more first cells. As described above, according to one embodiment, the translator 1010 may be configured to generate an electronic form filled with data based on the data matching result of the data matching component 830.
  • the translator 1010 may be configured to: for each of the multiple nodes in the hierarchical structure, determine the position of one or more cells corresponding to the node in the electronic table based on the hierarchical structure; And based on one or more of the original data, the level type of the node, the metadata of the node, the node that the node depends on, and the calculation relationship of the node to fill one or more cells corresponding to the node Content.
  • step S630 shown in FIG. 6 if the calculation relationship between a cell node and one or more other cell nodes is obtained, the calculation relationship between the cell node and the other one or more cell nodes and The position of the cell corresponding to the cell node in the spreadsheet and the position of the cells corresponding to one or more other cell nodes in the spreadsheet generate a formula for the cell corresponding to the cell node in the spreadsheet.
  • the renderer 1020 may be configured to set the format of the one or more first cells in the spreadsheet according to the information for specifying the format of the one or more first cells. According to an embodiment, the renderer 1020 may be configured to perform data based on the level type of each node of the multiple nodes in the hierarchy structure, the format information of the node, and one or more cells corresponding to the node. One or more of the content automatically sets the format of one or more cells corresponding to the node.
  • the renderer 1020 may place the column name of the column corresponding to the node
  • the format of the cell of is set to the format corresponding to "Column Format 1" (for example, black background, white bold font, four-size font, etc.).
  • the renderer 1020 may change the row name of the row corresponding to the node
  • the format of each cell included in the row is set to the format corresponding to "row format 2" (for example, italic, underline, four-size character, blue font, two significant digits, thousandths place Wait).
  • the format of the cell can also be automatically set based on any suitable predefined rules.
  • the renderer 1020 may perform one or more of the following: automatically set different formats for titles of different levels according to the level of the title, automatically set the format of the data header of the table, and automatically set the format of the data header of the table according to the level of the title.
  • Level automatically sets the format of different columns in the table, automatically sets the format of different rows in the table according to the level of the row, and automatically sets the format of different cells according to the content of the cell.
  • the format of the cell can be set according to the source of the data in the cell. For example, the data manually entered by the user is displayed underlined with a light blue background, and the data extracted from the database is displayed in black italics. Other raw data are displayed in gray, etc.
  • the format of the cell can be set according to the content in the cell.
  • the cell with the content of the formula is set in black font
  • the cross-page formula is set in green font
  • the cell with error is set in big red font, etc. .
  • the spreadsheet preview module (for example, the spreadsheet preview module 140 in FIG. 1A and the 4020 in FIG. 4D) may be configured to cause the generated spreadsheet to be displayed.
  • 11A-11D show exemplary displayed electronic forms 1100A-1100D according to some embodiments of the present disclosure.
  • the electronic forms 1100A-1100D may be generated, for example, based on the input in the graphical user interface editor shown in FIG. 4A and raw data (not shown). It should be understood that the electronic forms 1100A-1100D may also be generated based on input in any other type of editor. The generation process of the electronic forms 1100A-1100D will now be described with reference to FIG. 4A.
  • the to-be-filled data detection component of the data panel can detect the cells corresponding to the row node "mobile phone", row node "notebook”, and row node “tablet computer” in FIG. 4A You need to enter the original data, and then based on the parent node of these row nodes (that is, the table node "sales") includes ten columns, to determine the connection between the row node "mobile phone", the row node "notebook", and the row node "tablet computer” The corresponding cells need to be filled with the original data of one row and ten columns (that is, each row has 10 data, a total of 30 data).
  • the translator may be configured to generate the electronic form 1100A to be filled as shown in FIG. 11A based on the hierarchical structure and metadata obtained by the graphical user interface editor 400A.
  • the electronic form to be filled is an Excel file
  • the electronic form 1100A to be filled may also be any other suitable electronic form file, txt file or part of a webpage or any other suitable file format.
  • the upper left cell of the spreadsheet can be filled with "Sales” 1110.
  • the column block "2017” and the block “2018” each include five secondary columns “Q1", “Q2", “Q3", “Q4", and "full year”, the column names can be changed to 1121——”2017” Fill in the 2-6 cells (B2-F2) of the second row, and fill the column name 1122——”2018” in the 7-11 cells (G2-K2) of the second row.
  • the data table 1100A to be filled can be used for the data filling graphical user interface 840 in the data panel 800A.
  • the translator (for example, the translator 1010 shown in FIG. 10) may be configured to fill the data table to be filled based on the original data obtained through the data panel, the nodes on which each node depends, and the calculation relationship of each node 1100A to generate a spreadsheet 1100B.
  • the spreadsheet 1100B in the row “mobile phone”, row “notebook”, row “tablet”, the contents of the cells with column names “Q1", “Q2”, “Q3”, and “Q4" It is the raw data that matches these cells obtained through the data panel, and the content filled in the row “Total” and row “Average” can be based on the row node “mobile phone”, row node "notebook”, row node “tablet”
  • the calculation formula can be entered in the graphical user interface editor 400A of FIG.
  • the renderer may set the format of one or more cells in the spreadsheet 1100C based on the information obtained in the graphical user interface editor 400A for specifying the format of one or more cells.
  • the row names 1134 and 1135 can be located according to "row format 3". Set the cells A7 and A8 to bold, bold, and indent 2 characters, and set the number format of the cells (B7 ⁇ K7, B8 ⁇ K8) included in these two lines to bold, two decimals, Add the thousandth sign.
  • the cells A4 ⁇ A6 where the row names 1131-1133 are located can be set in bold according to the default row format preset by the system, and the cells included in these three rows (B4 ⁇ K4, B5 ⁇ K5, B6 ⁇ K6) Set to two decimal places, plus a thousandth sign.
  • the format of the cells in the first row in response to the name of the first row of the spreadsheet, can be automatically set to bold, four. For font size, set the format of the cells in the second row to the third row as bold, size four, and italic.
  • FIG. 12 is a flowchart illustrating an exemplary method 1200 for updating a generated electronic form according to some embodiments of the present disclosure.
  • FIG. 12 illustrates three steps of the method 1200, this is only a schematic flow of the method for updating the generated electronic form, and the method 1200 for updating the generated electronic form may also include other possible steps. Or it may include a combination of any of the above three steps.
  • the method 1200 may be executed by a spreadsheet preview module, for example.
  • the method 1200 starts at step S1210, and at step S1210, the generated electronic form is displayed.
  • the generated electronic form may be displayed on a display coupled with the device for generating the electronic form.
  • the method 1200 proceeds to step S1220, and at step S1220, a modification to the hierarchical structure, metadata, original data, dependency relationship, or calculation relationship is received.
  • an editor can be used to modify the hierarchical structure, metadata, dependency, or calculation relationship, such as modifying the membership or dependency of the nodes in the hierarchical structure, adding or deleting nodes, modifying the semantic information of nodes, and modifying The format information of the node, the formula to change the node, etc.
  • the original data stored in the data storage device can be modified.
  • the displayed electronic form is updated based on the modification of the hierarchical structure, metadata, original data, dependency relationship, or calculation relationship.
  • the updated electronic form corresponds to the modified hierarchical structure, metadata, original data, dependency relationship, or calculation relationship.
  • the row name 1134 in the spreadsheet shown in FIG. 11B may be modified to "Total Sales".
  • the row corresponding to the row name "Average” in the spreadsheet 1100B shown in FIG. 11B can be displayed. Add a new row below. Specifically, you can fill in the row name "Year-on-year growth rate" in the first cell of the 9th row.
  • FIG. 13 is a flowchart illustrating an exemplary method 1300 for modifying an electronic form according to some embodiments of the present disclosure. Although FIG. 13 illustrates the three steps of the method 1300, this is only a schematic flow of the method for modifying the electronic form. The method 1300 for modifying the electronic form may also include other possible steps, or may include the above three steps. A combination of any steps in the step. The method 1300 may be executed by a spreadsheet preview module, for example.
  • the method 1300 starts at step S1310, and at step S1310, the generated electronic form is displayed.
  • the generated electronic form may be displayed on a display coupled with the device for generating the electronic form.
  • the method 1300 proceeds to step S1320, and at step S1320, a modification to the generated electronic form is received.
  • the user can add or delete one or more cells in the spreadsheet, change the position of one or more cells, modify one or more of the name, title, label, and comment of one or more cells. Multiple, modify the format information of one or more cells, etc.
  • the user can modify the row name 1134 in the spreadsheet shown in FIG. 11B to "Total Sales".
  • the user can add a new row with the row name "Year-on-year growth rate" below the row corresponding to the row name "Average" in the spreadsheet 1100B shown in FIG. 11B.
  • the method 1300 proceeds to step S1330.
  • the modification of the spreadsheet is converted into a modification of at least one of the hierarchy, metadata, original data, dependency relationship, or calculation relationship, and the editor and data are used.
  • At least one of the panels accordingly modifies at least one of the hierarchical structure, metadata, original data, dependency relationship, or calculation relationship based on the modification.
  • the modified hierarchical structure, metadata, original data, dependency relationship, and calculation relationship correspond to the modified electronic form.
  • the hierarchical graph memory can be used to store the modified hierarchical structure, metadata, dependency relationship, or calculation relationship, and the modified original data can also be stored in the data storage device. For example, in response to modifying the row name 1134 in the spreadsheet shown in FIG.
  • the name “Total” of the corresponding row 450 in the hierarchical structure corresponding to FIG. 4A may be modified to "Total Sales". ".
  • the parent node of the row node "Year-on-year growth rate” can be a node corresponding to the table "Sales”. Set the name of the newly added row in the editor to "Year-on-year growth rate".
  • the modification to the hierarchical structure includes dragging and dropping components for specifying nodes of different levels in the hierarchical structure, and updating the displayed spreadsheet includes adjusting one or more cells corresponding to the node.
  • the relative position in the spreadsheet is consistent with the relative position of the dragged component used to specify the node in the graphical user interface editor.
  • Figure 14 illustrates an exemplary graphical user editor 1400 according to some embodiments of the present disclosure.
  • the component 440 for specifying the row node "tablet” is dragged above the component 430 for specifying the row node "notebook”.
  • FIG. 15 shows an exemplary displayed electronic form 1500 according to some embodiments of the present disclosure.
  • the electronic form 1500 is updated. Specifically, adjust the relative position of the cell in the row with the row name "tablet” in the spreadsheet so that it is above the cell in the row with the row name "notebook", which is in line with the dragged
  • the relative positions of the component 440 for specifying the row node “tablet computer” in the graphical user interface editor 1400 are consistent.
  • the device for generating the electronic form may also include other additional functions to facilitate the operation of the user.
  • the apparatus for generating an electronic form may include an error detection module.
  • the error detection module may be configured to automatically detect errors in one or more of the hierarchical structure, metadata, raw data, dependency, or calculation relationship, and issue a warning to prompt the error. For example, the error detection module can detect that the original data in the first cell is 0, and the formula of the second cell may be equal to the reciprocal of the value of the first cell, so the error detection module can determine the original data or the second cell There may be an error in the formula, which will warn you.
  • the apparatus for generating an electronic form may include a smart suggestion module.
  • the intelligent suggestion module can be configured to predict the hierarchical structure, metadata, and metadata to be acquired based on one or more of the acquired hierarchical structure, metadata, raw data, dependency, calculation relationship, and operations that the user has performed.
  • Users can directly choose from the results of smart suggestions, which can improve the efficiency of the process of generating electronic forms. For example, in response to the user continuously defining two columns with column names "2016” and "2017”, it can be predicted that the column name of the column to be added next is "2018”, and the smart suggestion result is displayed to the user.
  • different display formats may be used to represent different types of grammatical units in the components for specifying nodes of different levels in the graphical user interface editor. For example, different colors or fonts can be used to distinguish defined nodes, newly defined nodes, function names in formulas, node names, etc.
  • FIG. 16 is a flowchart illustrating an exemplary method 1600 for obtaining a hierarchical structure for an electronic form according to some embodiments of the present disclosure.
  • FIG. 16 illustrates two steps of the method 1600, this is only a schematic flow of the method for obtaining the hierarchical structure of the electronic form, and the method 1600 of obtaining the hierarchical structure of the electronic form may also include other possible steps. Or it may include a combination step of any of the above two steps.
  • the method 1600 may be performed by an editor, which may be a text editor.
  • the method 1600 starts at step S1610.
  • a text code input by the user can be received.
  • the text code can be written in a domain-specific language of the application scenario, or written in any suitable programming language (such as C, C++, C#, Java, python, etc.), or in any suitable programming language that may be developed in the future. Programming language to write.
  • users can use keywords BOOK, SHEET, TABLE, HEADER, STUB, ROW, and code indentation to specify different levels, and use the keyword "
  • the text code entered by the user can be as follows.
  • Users can also write text codes based on any predefined grammatical rules.
  • step S1620 the text code is parsed to generate a hierarchical structure.
  • the text code can be parsed based on predefined grammatical rules. For example, a text editor can obtain the same hierarchical structure as that obtained by the graphical user interface editor 400A shown in FIG. 4A by parsing the text code as shown above, which will not be repeated here.
  • the hierarchical structure, calculation relationship and original data in the electronic form can be separated, and the way of generating the electronic form can be more intuitive, convenient, easy to understand and debug, and has both flexibility and automation. specialty.
  • the electronic form can be easily and intuitively modified, making it easy to reuse the existing electronic form model.
  • FIG. 18 shows a general hardware environment in which the present disclosure can be applied according to some embodiments of the present disclosure.
  • the computing device 1800 may be any machine configured to perform processing and/or calculations, and may be, but is not limited to, a workstation, a server, a desktop computer, a laptop computer, a tablet computer, a personal digital assistant, a smart phone, a portable camera, or any of these combination.
  • the foregoing apparatus 100A may be implemented in whole or at least in part by a computing device 1800 or a similar device or system.
  • the computing device 1800 may include elements capable of being connected to or communicating with the bus 1802 via one or more interfaces.
  • the computing device 1800 may include a bus 1802, one or more processors 1804, one or more input devices 1806, and one or more output devices 1808.
  • the one or more processors 1804 may be any type of processor, and may include, but are not limited to, one or more general-purpose processors and/or one or more special-purpose processors (such as special-purpose processing chips).
  • the input device 1806 may be any type of device capable of inputting information to a computing device, and may include, but is not limited to, a mouse, a keyboard, a touch screen, a microphone, and/or a remote control.
  • the output device 1808 may be any type of device capable of presenting information, and may include, but is not limited to, a display, a speaker, a video/audio output terminal, and/or a printer.
  • the computing device 1800 may also include a non-transitory storage device 1810 or be connected to a non-transitory storage device 1810.
  • the non-transitory storage device 1810 may be any storage device that is non-transient and can implement a data storage library, and may include but is not limited to Disk drives, optical storage devices, solid-state storage devices, floppy disks, flexible disks, hard disks, magnetic tapes or any other magnetic media, compact disks or any other optical media, ROM (read only memory), RAM (random access memory), high-speed Cache memory and/or any other memory chip or cassette, and/or any other medium from which the computer can read data, instructions, and/or code.
  • the non-transitory storage device 1810 may be detachable from the interface.
  • the non-transitory storage device 1810 may have data/instructions/code for implementing the above-mentioned methods and steps.
  • the computing device 1800 may also include a communication device 1812.
  • Communication device 1812 may be capable of external devices and / or with any type of device or system network communication, and may include but is not limited to a modem, a network card, an infrared communication device, a wireless communication equipment and / or such as Bluetooth (TM) device, an 802.11 Chip sets for devices, WiFi devices, WiMax devices, cellular communication facilities, etc.
  • TM Bluetooth
  • 802.11 Chip sets for devices WiFi devices, WiMax devices, cellular communication facilities, etc.
  • the bus 1802 may include, but is not limited to, an industry standard architecture (ISA) bus, a microchannel architecture (MCA) bus, an enhanced ISA (EISA) bus, a video electronics standards association (VESA) local bus, and peripheral component interconnect (PCI) bus.
  • ISA industry standard architecture
  • MCA microchannel architecture
  • EISA enhanced ISA
  • VESA video electronics standards association
  • PCI peripheral component interconnect
  • the computing device 1800 may further include a working memory 1814.
  • the working memory 1814 may be any type of working memory that can store instructions and/or data useful for the work of the processor 1804, and may include, but is not limited to, random access memory and/or Read only memory device.
  • the software elements may be located in the working memory 1814, including but not limited to the operating system 1816, one or more application programs 1818, drivers, and/or other data and codes. Instructions for executing the above methods and steps may be included in one or more application programs 1818, and the components of the above apparatus 100A may be implemented by the processor 1804 reading and executing instructions of one or more application programs 1818. More specifically, the editor 110 may be implemented, for example, by the processor 1804 when the application program 1818 having instructions for executing steps S110 and S120 is executed. The data panel 120 may be implemented, for example, by the processor 1804 when the application program 1818 having instructions for executing step S130 is executed.
  • the electronic form generation module 130 may be implemented by, for example, the processor 1804 when the application program 1818 having instructions for executing step S140 is executed.
  • the executable code or source code of the instructions of the software element can be stored in a non-transitory computer-readable storage medium (such as the storage device(s) 1810 described above), and can be compiled and/or installed where possible Read into the working memory 1814.
  • the executable code or source code of the instructions of the software element can also be downloaded from a remote location.
  • the present disclosure also relates to the following embodiments.
  • Embodiment 1 A computer-implemented method for automatically generating an electronic form, the method comprising:
  • the hierarchical structure includes one or more hierarchies, the one or more hierarchies have a plurality of nodes, and each hierarchy has at least one node and has a corresponding hierarchical type, Each node corresponds to one or more cells in the electronic table, wherein the hierarchical structure further includes the affiliation relationship between the multiple nodes;
  • the electronic form is generated based on at least a hierarchical structure for the electronic form, the metadata, and the raw data.
  • Embodiment 2 The method according to embodiment 1, further comprising:
  • the level type of the level of the node, the child nodes of the node, and the metadata of the node are stored.
  • Embodiment 3 The method according to embodiment 1, wherein obtaining a hierarchical structure for the electronic form includes:
  • graphical user interface editor wherein the graphical user interface editor includes components for specifying nodes at different levels;
  • the hierarchical structure is generated based on the input.
  • Embodiment 4 The method according to embodiment 3, wherein the level type of the one or more levels of the electronic form includes one or more of the following: workbook, page, section, table, block , Rows, columns, intervals, and cells, where the components used to specify nodes at different levels include one or more of the following: components used to specify pages, components used to specify headings, components used to specify sections Component, component for specifying table, component for specifying data header, component for specifying table body, component for specifying row, component for specifying column, component for specifying block, component for specifying interval , And the component used to specify the cell.
  • workbook page, section, table, block , Rows, columns, intervals, and cells
  • the components used to specify nodes at different levels include one or more of the following: components used to specify pages, components used to specify headings, components used to specify sections Component, component for specifying table, component for specifying data header, component for specifying table body, component for specifying row, component for specifying column, component for specifying block, component
  • Embodiment 5 The method according to embodiment 1, wherein obtaining the hierarchical structure for the electronic form includes:
  • the text code is parsed to generate the hierarchical structure.
  • Embodiment 6 The method according to embodiment 1, wherein obtaining the metadata of each node in the plurality of nodes includes obtaining semantic information describing the specific meaning of the node.
  • Embodiment 7 The method according to embodiment 6, wherein the semantic information includes one or more of a title, a name, a tag, and an annotation.
  • Embodiment 8 The method according to embodiment 1, wherein:
  • Obtaining the metadata of each node of the plurality of nodes further includes obtaining information for specifying the format of one or more first cells corresponding to the node, and
  • Generating the electronic form further includes setting the format of the one or more first cells in the electronic form according to information for specifying the format of the one or more first cells.
  • Embodiment 9 According to the method described in embodiment 8,
  • the information for specifying the format of one or more first cells corresponding to the node includes a format type
  • the format corresponding to the format type is used to set the format of the one or more first cells.
  • Embodiment 10 The method according to embodiment 3, wherein the graphical user interface editor further includes a modifier component, the modifier component is used to specify one or more units corresponding to a node in the hierarchical structure The format type of the grid.
  • Embodiment 11 The method according to embodiment 9, wherein the format corresponding to the format type is set by the following operations:
  • the format corresponding to the format type is set based on the user's setting of the format of the predefined text.
  • Embodiment 12 The method according to embodiment 1, wherein:
  • Obtaining the metadata of each node in the plurality of nodes further includes obtaining an alias label or an attribute label for the node, wherein the alias label specifies the alias of one or more cells corresponding to the node, the The attribute label specifies the additional characteristics of one or more cells corresponding to the node.
  • Embodiment 13 The method according to embodiment 1, further comprising:
  • Embodiment 14 The method according to embodiment 13, further comprising:
  • Embodiment 15 The method according to embodiment 14, further comprising:
  • each first cell of the one or more first cells corresponding to the first node is The calculation relationship between each second cell in one or more second cells of another one or more nodes.
  • Embodiment 16 The method of embodiment 15, wherein generating the electronic form further includes:
  • Embodiment 17 The method according to embodiment 14, further comprising:
  • the dependency relationship between the nodes corresponding to each second cell in the second cell determines that the node depends on the respective corresponding to the first group of second cells in the one or more second cells The second node of the first group;
  • the node and all or part of the ancestor nodes of the node depend on all or part of the ancestor nodes of the first group of second nodes and the first group of second nodes.
  • Embodiment 18 The method according to embodiment 17, further comprising storing for each node at least one of a node that the node depends on and a node that depends on the node.
  • Embodiment 19 The method according to embodiment 15, further comprising storing, for each node, the calculation relationship between the node and other nodes.
  • Embodiment 20 The method according to embodiment 1, wherein the original data used in the electronic form is obtained by one or more of the following methods:
  • Embodiment 21 The method according to embodiment 1, further comprising:
  • Embodiment 22 The method of embodiment 21, wherein generating the electronic form further includes:
  • Embodiment 23 The method according to embodiment 22, wherein:
  • the original data used for the spreadsheet is automatically identified from the data file, and the method further includes parsing the semantic information of each original data item in the original data identified from the data file to generate parsed data;
  • the data file, the parsed data When the data item of one of the data file, the data parsed by the intelligent data extraction component, and the data filled in the data table to be filled is selected, the data file, the parsed data The corresponding data items in the other two of the data and the data filled in the data table to be filled are highlighted.
  • Embodiment 24 The method of embodiment 15, wherein generating the electronic form includes:
  • Embodiment 25 The method according to embodiment 1, further comprising:
  • generating the electronic form includes adjusting the position of the table in the electronic form based on the operation.
  • Embodiment 26 The method according to embodiment 1, wherein generating the electronic form further includes according to the level type of the level at which each node of the plurality of nodes is located, the format information of the node, and the corresponding node One or more of the contents of one or more cells to automatically set the format of one or more cells corresponding to the node.
  • Embodiment 27 The method according to embodiment 15, further comprising:
  • the metadata, the original data, the dependency relationship, or the calculation relationship is updated.
  • Embodiment 28 The method according to embodiment 15, further comprising:
  • Embodiment 29 According to the method described in embodiment 27,
  • a graphical user interface editor is used to obtain the hierarchical structure for the electronic form, and the graphical user interface editor includes components for specifying nodes of different levels;
  • modification to the hierarchical structure includes dragging and dropping a component for specifying the third node in the hierarchical structure
  • updating the displayed electronic form includes adjusting the relative position of one or more cells corresponding to the third node in the electronic form to match the dragged component for specifying the third node
  • the relative positions in the graphical user interface editor are the same.
  • Embodiment 30 The method according to embodiment 15, further comprising:
  • a warning is issued to indicate the error.
  • Embodiment 31 The method according to embodiment 15, further comprising:
  • the metadata, the original data, the dependency relationship, the calculation relationship, and the operations that the user has performed predict the hierarchy to be acquired One or more of the structure, the metadata, the original data, the dependency relationship, the calculation relationship, and the operation to be performed by the user;
  • Embodiment 32 The method according to embodiment 3, wherein different display formats are used to represent different types of grammatical units in components for specifying nodes of different levels.
  • Embodiment 33 The method according to embodiment 17, further comprising:
  • Embodiment 34 The method according to embodiment 1, wherein obtaining the hierarchical structure for the electronic form further includes:
  • Import a template for one or more nodes in the hierarchy Import a template for one or more nodes in the hierarchy.
  • Embodiment 35 A device for automatically generating an electronic form, the device comprising:
  • An editor configured to obtain a hierarchical structure for the spreadsheet, wherein the hierarchical structure includes one or more levels, the one or more levels have a plurality of nodes, wherein each level has At least one node and has a corresponding hierarchical type, each node corresponds to one or more cells in the spreadsheet, wherein the hierarchical structure further includes the affiliation relationship between the multiple nodes, and the editing
  • the device is also configured to obtain metadata of each node of the plurality of nodes;
  • a data panel configured to obtain raw data for the electronic form
  • An electronic form generation module configured to generate the electronic form based at least on a hierarchical structure for the electronic form, the metadata, and the raw data.
  • Embodiment 36 The device according to embodiment 35, further comprising a hierarchical graph builder and a hierarchical graph memory, wherein the hierarchical graph builder is configured to be based on the hierarchy type of each node in the plurality of nodes , Child nodes of the node and metadata of the node to construct a hierarchical graph for the electronic table, and the hierarchical graph memory is configured to store the hierarchical graph.
  • the hierarchical graph builder is configured to be based on the hierarchy type of each node in the plurality of nodes , Child nodes of the node and metadata of the node to construct a hierarchical graph for the electronic table
  • the hierarchical graph memory is configured to store the hierarchical graph.
  • Embodiment 37 The device of embodiment 35, wherein the editor includes a graphical user interface editor, wherein the graphical user interface editor includes components for specifying nodes of different levels, and wherein the graphic
  • the user interface editor is also configured to:
  • the hierarchical structure is generated based on the input.
  • Embodiment 38 The device of embodiment 37, wherein the level type of the one or more levels of the electronic form includes one or more of the following: workbook, page, section, table, block , Rows, columns, intervals, and cells, where the components used to specify nodes at different levels include one or more of the following: components used to specify pages, components used to specify headings, components used to specify sections Component, component for specifying table, component for specifying data header, component for specifying table body, component for specifying row, component for specifying column, component for specifying block, component for specifying interval , And the component used to specify the cell.
  • workbook page, section, table, block , Rows, columns, intervals, and cells
  • the components used to specify nodes at different levels include one or more of the following: components used to specify pages, components used to specify headings, components used to specify sections Component, component for specifying table, component for specifying data header, component for specifying table body, component for specifying row, component for specifying column, component for specifying block, component
  • Embodiment 39 The device of embodiment 35, wherein the editor comprises a text editor, and the text editor is configured to:
  • the text code is parsed to generate the hierarchical structure.
  • Embodiment 40 The device according to embodiment 35, wherein obtaining the metadata of each node in the plurality of nodes includes obtaining semantic information describing the specific meaning of the node.
  • Embodiment 41 The device according to embodiment 40, wherein the semantic information includes one or more of a title, a name, a tag, and an annotation.
  • Embodiment 42 The device according to embodiment 35, wherein:
  • the editor further includes a decorator component configured to obtain information for specifying the format of one or more first cells corresponding to each of the plurality of nodes, and
  • the electronic form generation module includes a renderer, and the renderer is configured to set the one or more in the electronic form according to the information used to specify the format of the one or more first cells.
  • the format of the first cell includes a renderer, and the renderer is configured to set the one or more in the electronic form according to the information used to specify the format of the one or more first cells. The format of the first cell.
  • Embodiment 43 The device according to embodiment 42,
  • the information for specifying the format of the one or more first cells includes a format type
  • the renderer is configured to use a format corresponding to the format type to set the format of the one or more first cells.
  • Embodiment 44 The device of embodiment 37, wherein the graphical user interface editor further includes a modifier component, the modifier component is used to specify one or more units corresponding to a node in the hierarchical structure The format type of the grid.
  • Embodiment 45 The device according to Embodiment 43, further comprising a format setting component configured to set a format corresponding to the format type through the following operations:
  • the format corresponding to the format type is set based on the user's setting of the format of the predefined text.
  • Embodiment 46 The device according to embodiment 35, wherein:
  • the editor also includes a tag component configured to obtain an alias tag or an attribute tag for each node, wherein the alias tag specifies the alias of one or more cells corresponding to the node, so The attribute tag specifies the additional characteristics of one or more cells corresponding to the node.
  • Embodiment 47 The device of embodiment 35, wherein:
  • the editor further includes a dependency relationship definition component configured to obtain the dependency relationship between the first node of the plurality of nodes and the other one or more nodes.
  • Embodiment 48 The device according to embodiment 47, wherein the hierarchical graph builder is configured to:
  • Embodiment 49 The device according to embodiment 48, further comprising a computing relationship definition component,
  • calculation relationship definition component is configured to obtain the calculation relationship between the first node and the other one or more nodes.
  • the hierarchical graph builder is further configured to determine the one or more first cells corresponding to the first node based on at least the calculation relationship between the first node and the other one or more nodes A calculation relationship between each first cell of and each second cell of the one or more second cells corresponding to the other one or more nodes.
  • Embodiment 50 The device according to embodiment 49, wherein the electronic form generation module further includes a translator, and the translator is configured to:
  • Embodiment 51 The device according to embodiment 48, wherein the hierarchical graph builder is further configured to:
  • the dependency relationship between the nodes corresponding to each second cell in the second cell determines that the node depends on the respective corresponding to the first group of second cells in the one or more second cells The second node of the first group;
  • the node and all or part of the ancestor nodes of the node depend on all or part of the ancestor nodes of the first group of second nodes and the first group of second nodes.
  • Embodiment 52 The device according to embodiment 51, wherein the construction of the hierarchical graph is further based on a node on which each node of the plurality of nodes depends.
  • Embodiment 53 The device according to embodiment 49, wherein the construction of the hierarchical graph is further based on a calculation relationship between each node of the plurality of nodes and other nodes.
  • Embodiment 54 The device according to embodiment 35, wherein the data panel includes a raw data acquisition component, and the raw data acquisition component includes one or more of the following components:
  • the intelligent data extraction component is configured to automatically identify the original data from the data file,
  • the database interface component is configured to import raw data from the database
  • the retrieval interface component is configured to retrieve raw data from external data sources, and
  • the manual input receiving component is configured to receive the raw data input by the user.
  • Embodiment 55 The device according to embodiment 54,
  • the data panel also includes:
  • a data-to-be-filled detection component configured to detect nodes that need to input raw data among the multiple nodes and the requirements for raw data in the nodes;
  • a data matching component configured to match the raw data acquired by the raw data acquisition component with the node that needs to input the raw data detected by the data detection component to be filled.
  • Embodiment 56 the device according to embodiment 55,
  • the electronic form generation module includes:
  • the translator is configured to generate the electronic form to be filled based on the hierarchical structure of the electronic form, the metadata, the detected nodes that require the input of raw data, and the requirements for the raw data in the nodes, and based on The original data is used to fill the electronic form to be filled to generate the electronic form.
  • Embodiment 57 The device of embodiment 56, wherein:
  • the original data acquisition component includes the intelligent data extraction component, and the intelligent data extraction component is configured to parse the semantic information of each original data item in the original data identified from the data file to generate parsed data; as well as
  • the data file is selected by the intelligent data
  • the corresponding data items of the data parsed by the extraction component and the data filled in the data table to be filled are highlighted.
  • Embodiment 58 the device of embodiment 49, wherein the electronic form generation module includes a translator, and the translator is configured to:
  • Embodiment 59 The device according to embodiment 35,
  • the editor is further configured to receive an operation of specifying the position of the table in the electronic table.
  • the electronic form generating module is further configured to adjust the position of the table in the electronic form based on the operation.
  • Embodiment 60 The device according to embodiment 35, wherein the spreadsheet generation module includes a renderer, and the renderer is configured to according to the hierarchy type of the hierarchy at which each node of the plurality of nodes is located, the One or more of the format information of the node and the content of one or more cells corresponding to the node automatically sets the format of one or more cells corresponding to the node.
  • the spreadsheet generation module includes a renderer, and the renderer is configured to according to the hierarchy type of the hierarchy at which each node of the plurality of nodes is located, the One or more of the format information of the node and the content of one or more cells corresponding to the node automatically sets the format of one or more cells corresponding to the node.
  • Embodiment 61 The device according to embodiment 49, further comprising an electronic form preview module, the electronic form preview module being configured to:
  • the metadata, the original data, the dependency relationship, or the calculation relationship is updated.
  • Embodiment 62 The device according to embodiment 49, further comprising an electronic form preview module configured to:
  • Embodiment 63 The device according to embodiment 61, further comprising a graphical user interface editor configured to obtain a hierarchical structure for the electronic form, and the graphical user interface editor Including components used to specify nodes at different levels;
  • modification to the hierarchical structure includes dragging and dropping a component for specifying the third node in the hierarchical structure
  • updating the displayed electronic form includes adjusting the relative position of one or more cells corresponding to the third node in the electronic form to match the dragged component for specifying the third node
  • the relative positions in the graphical user interface editor are the same.
  • Embodiment 64 The device according to embodiment 49, further comprising an error detection module, and the error detection module is configured to:
  • a warning is issued to indicate the error.
  • Embodiment 65 The device according to embodiment 49, further comprising a smart suggestion module, wherein the smart suggestion module is configured to:
  • the metadata, the original data, the dependency relationship, the calculation relationship, and the operations that the user has performed predict the hierarchical structure to be acquired , One or more of the metadata, the original data, the dependency relationship, the calculation relationship, and the operation to be performed by the user;
  • Embodiment 66 The device according to embodiment 37, wherein different display formats are used to represent different types of syntax units in components used to specify nodes of different levels.
  • Embodiment 67 The device according to embodiment 51, further comprising a visualization module, wherein the visualization module is configured to:
  • Embodiment 68 The device according to embodiment 35, wherein the editor further includes a component for importing a template, and the component for importing a template is configured as:
  • Import a template for one or more nodes in the hierarchy Import a template for one or more nodes in the hierarchy.
  • Embodiment 69 A device for automatically generating an electronic form, comprising: components for executing the steps of the method according to any one of the embodiments 1-34.
  • Embodiment 70 A device for automatically generating an electronic form, including:
  • At least one processor At least one processor
  • At least one storage device stores instructions, and when the instructions are executed by the at least one processor, the at least one processor is caused to execute the steps described in any one of the embodiments 1-34 method.
  • Embodiment 71 A non-transitory computer-readable storage medium storing instructions that when executed by a processor causes the method as described in any one of the embodiments 1-34 to be executed.
  • Computer software can be stored in a computer readable storage medium, such as a floppy disk, hard disk, optical disk, or flash memory.
  • the computer software includes a series of instructions that cause a computer (for example, a personal computer, a service station, or a network terminal) to execute the method according to various embodiments of the present disclosure or a part thereof.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

一种用于自动生成电子表格的方法、装置、设备及存储介质,该方法包括:获取用于电子表格的层级结构,其中层级结构包括具有多个节点的一个或多个层级(S110),其中每个层级具有至少一个节点并且具有相应的层级类型,每个节点对应于电子表格中的一个或多个单元格,其中层级结构还包括该多个节点之间的隶属关系;获取多个节点中的每个节点的元数据(S120);获取用于电子表格的原始数据(S130);至少基于用于电子表格的层级结构、元数据和原始数据来生成电子表格(S140)。

Description

用于自动生成电子表格的方法、装置、设备及存储介质
相关申请的交叉引用
本申请要求于2019年10月15日递交的中国专利申请第201910978565.X号的优先权,在此全文引用上述中国专利申请公开的内容以作为本申请的一部分。
技术领域
本公开涉及用于自动生成电子表格的方法、装置、设备及存储介质。
背景技术
在很多行业领域,经常需要编辑复杂的电子表格。比如,在金融分析过程中,金融分析师通常需要构建用于财务分析的电子表格模型,用来计算金融资产的内在价值。电子表格模型是可以包括数值、文本和公式等内容的电子表格,用以计算某个或某些变量的值。用于财务分析的电子表格通常包括数十页、数千行、数万单元格,单元格之间又存在复杂的相互计算关系,其中绝大部分单元格是根据其他单元格计算得到的。现有的用于生成电子表格的方式要么容易出错并且难以理解和调试,要么灵活性较差。因此,需要一种改进的用于自动生成电子表格的方法、装置、设备及存储介质。
发明内容
本公开的一个实施例涉及用于自动生成电子表格的计算机实现的方法,该方法包括:获取用于电子表格的层级结构,其中层级结构包括一个或多个层级,该一个或多个层级具有多个节点,其中每个层级具有至少一个节点并且具有相应的层级类型,每个节点对应于电子表格中的一个或多个单元格,其中层级结构还包括该多个节点之间的隶属关系;获取该多个节点中的每个节点的元数据;获取用于电子表格的原始数据;以及至少基于用于电子表格的层级结构、元数据和原始数据来生成电子表格。
本公开的另一个实施例涉及用于自动生成电子表格的装置,该装置包括:编辑器,编辑器被配置为获取用于电子表格的层级结构,其中层级结构包括一个或多个层级,该一个或多个层级具有多个节点,其中每个层级具有至少一个节点并且具有相应的层级类型,每个节点对应于电子表格中的一个或多个单元格,其中层级结构还包括该多个节点之间的隶属关系,并且编辑器还被配置为获取该多个节点中的每个节点的元数 据;数据面板,数据面板被配置为获取用于电子表格的原始数据;电子表格生成模块,电子表格生成模块被配置为至少基于用于电子表格的层级结构、元数据和原始数据来生成电子表格。
本公开的另一个实施例涉及用于自动生成电子表格的设备,该设备包括:至少一个处理器;以及至少一个存储设备,该至少一个存储设备存储有指令,当指令由至少一个处理器执行时使得至少一个处理器执行上述方法。
本公开的又一个实施例涉及一种非瞬态计算机可读存储介质,该非瞬态计算机可读存储介质存储有指令,当指令由处理器执行时使得执行上述方法。
本公开的再一个实施例涉及一种用于自动生成电子表格的装置,该装置包括用于执行上述方法的步骤的部件。
从参考附图的以下描述中,本公开的其他特征和优点将变得清楚。
附图说明
并入说明书中并构成说明书的一部分的附图示出了本公开的实施例,并且与说明书一起用于解释本公开的原理而没有限制。在各图中,类似的标号用于表示类似的项目。
图1A是根据本公开的一些实施例的示例性的用于自动生成电子表格的装置的框图。
图1B是示出根据本公开的一些实施例的示例性的用于自动生成电子表格的方法的流程图。
图2A是根据本公开的一些实施例的示例性的用于获取电子表格的层级结构的图形用户编辑器的框图。
图2B是示出根据本公开的一些实施例的示例性的用于获取电子表格的层级结构的方法的流程图。
图3A是根据本公开的一些实施例的示例性的与电子表格的一个页对应的层级结构。
图3B是根据本公开的一些实施例的示例性的电子表格中的一个表的结构。
图3C是根据本公开的一些实施例的示例性的用于指定表的组件。
图4A至图4C示出了根据本公开的一些实施例的示例性的图形用户编辑器。
图4D至图4F示出了根据本公开的一些实施例的示例性的用于自动生成电子表格的装置上显示的图形用户界面。
图5A、图5B和图5D是示出根据本公开的一些实施例的示例性的电子表格层级结构及节点之间的依赖关系的示意图。
图5C是示出根据本公开的一些实施例的将高层级节点之间的计算关系转化为低层级节点之间的计算关系的方法的示意图。
图5E是根据本公开的一些实施例的示例性的电子表格层级结构中的节点之间的依赖关系的可视化表示。
图6是示出根据本公开的一些实施例的示例性的用于建立节点之间的依赖关系的方法的流程图。
图7是示出根据本公开的一些实施例的示例性的电子表格层级结构中的节点的示意图。
图8A是根据本公开的一些实施例的示例性的数据面板的框图。
图8B是根据本公开的一些实施例的示例性的数据面板的图形用户界面。
图9A和图9B是示出根据本公开的一些实施例的示例性的用于生成电子表格的方法的流程图。
图10是根据本公开的一些实施例的示例性的电子表格生成模块的框图。
图11A至图11D示出了根据本公开的一些实施例的示例性的所显示的电子表格。
图11E和图11F示出了根据本公开的一些实施例的示例性的对所显示的电子表格中的表的位置的调整。
图12是示出根据本公开的一些实施例的示例性的用于更新所生成的电子表格的方法的流程图。
图13是示出根据本公开的一些实施例的示例性的用于修改电子表格的方法的流程图。
图14示出了根据本公开的一些实施例的示例性的图形用户编辑器。
图15示出了根据本公开的一些实施例的示例性的所显示的电子表格。
图16是示出根据本公开的一些实施例的示例性的获取用于电子表格的层级结构的方法的流程图。
图17示出了根据本公开的一些实施例的示例性的格式设定组件。
图18示出了根据本公开的一些实施例的其中可应用本公开的一般硬件环境。
具体实施方式
在以下详细描述中,阐述了许多具体细节以提供对所描述的示例性实施例的透彻理解。但是,对于本领域技术人员清楚的是,所描述的实施例可以在没有这些具体细节中的一些或全部的情况下进行实践。在所描述的示例性实施例中,为了避免不必要地模糊本公开的概念,没有详细描述众所周知的结构或处理步骤。
下文所示的每个框图内的方框可以通过硬件、软件、固件或其任意组合以实现本公开的原理。本领域技术人员应该理解的是,每个框图中描述的方框可以被组合或分成子框来实现本公开的原理。
本公开中呈现的方法的步骤旨在是说明性的。在一些实施例中,该方法可以用未描述的一个或多个附加步骤来完成和/或在没有所讨论的一个或多个步骤的情况下完成。此外,方法的步骤被示出和描述的顺序并不旨在是限制性的。
如上所述,现有的用于生成电子表格的方式要么容易出错并且难以理解和调试,要么灵活性较差。具体而言,现有的通用电子表格编辑软件(比如Microsoft Excel、Google Sheets等)允许用户以所见即所得的形式编辑电子表格,并且用户可以直接向电子表格内写入各种类型的内容,包括文本、数值、公式等。然而,在使用通用电子表格软件来生成电子表格模型时非常容易出错,并且所生成的电子表格模型难以被调试,难以被复用,难以被除了模型构建者以外的其他人理解或更改。此外,使用通用的电子表格软件来生成电子表格模型一般需要用户手动输入每一个单元格中的内容,且经常需要反复交替输入文本、数字、或公式,这非常费时费力,并且尤其是在生成较为复杂的电子表格模型时,要求用户掌握很多高级的电子表格编辑技巧。
另一些行业软件(比如FactSet和Bloomberg)可以提供一些常用的电子表格模型模板,用户可以通过编辑这些模板来构建电子表格模型。但是此类方法都需要抽象出足够通用的电子表格模型的模板,以使得模板可以被适用于足够多的情形。然而,现实中,这种足够通用的模板很难存在。比如,很难抽象出一个同时适用于房地产行业股票和计算机行业股票的估值模型模板。因此,相比于通用电子表格软件,此类方法的灵活性较差,难以涵盖现实应用中可能出现的对于电子表格模型的多样化需求。例如,对于构建财务模型而言,除了一些非常简单的模型外,能够应用通用的模板的情况也是非常有限的。在大部分时间,金融分析师依然在使用通用电子表格编辑软件来构建财务模型。
本申请的实施例可以允许用户和/或应用程序等通过分别提供电子表格的层级结构、元数据和原始数据来生成电子表格。通过实现电子表格的层级结构和原始数据的分离, 利用本申请的实施例来生成电子表格的方式更加直观、便捷、易于理解和调试,容易复用,并且兼具灵活性和自动化的特点。
下面结合图1A和图1B描述根据本公开的一些实施例的用于自动生成电子表格的装置和方法。
图1A是根据本公开的一些实施例的示例性的用于自动生成电子表格的装置100A的框图。如图1A所示,装置100A可以包括编辑器110、数据面板120、电子表格生成模块130。装置100A还可以包括电子表格预览模块140、层级图构建器150和层级图存储器160,用虚线框示出这三个部件,以表明它们是可选的。此外,虽然图1A例示了上述六个单元,但这仅仅是用于自动生成电子表格的装置的示意性结构,用于自动生成电子表格的装置100A还可以包括比所示出的更多或更少或不同的单元,或者可以包括上述六个单元中任意单元的组合单元。
编辑器110可以被配置成获取用于电子表格的层级结构。根据一个实施例,用于电子表格的层级结构可以包括一个或多个层级,该一个或多个层级具有多个节点,其中每个层级具有至少一个节点并且具有相应的层级类型(例如,工作簿、页、节、表、块、行、列、区间和单元格等),每个节点对应于电子表格中的一个或多个单元格,其中层级结构还包括该多个节点之间的隶属关系(例如,一个表节点可以具有若干层级类型为行的子节点,也就是说这些层级类型为行的子节点隶属于该层级类型为表的节点)。根据一个实施例,当且仅当与节点A对应的一个或多个单元格包含在与节点B对应的一个或多个单元格内时,节点A是节点B的子节点,或者说节点A隶属于节点B。
根据一个实施例,编辑器110可以包括图形用户界面编辑器,其中图形用户界面编辑器包括用于指定不同层级的节点的组件(例如,用于添加和/或修改行节点的组件、用于添加和/或修改表节点的组件等),并且其中图形用户界面编辑器还可以被配置为:接收针对用于指定不同层级的节点的组件的输入,以及基于该输入来生成层级结构。例如,响应于接收到针对用于添加行节点的组件的输入,图形用户界面编辑器可以在层级结构中添加相应的行节点,等等。根据一个实施例,在图形用户界面编辑器中可以用不同的显示格式(例如,颜色、字体、字号等)来表示用于指定不同层级的节点的组件中的不同类型的语法单元,从而有助于用户的理解和调试。根据一个实施例,编辑器110包括文本编辑器,该文本编辑器可以被配置为接收用户输入的文本代码,以及解析文本代码以生成层级结构。该文本代码可以用针对本应用场景的领域特定语 言来编写,或者使用现有的任何合适的编程语言(例如C、C++、C#、Java、python等)来编写,或者用将来可能开发出来的任何合适的编程语言来编写。后文将进一步具体描述根据本公开的实施例的图形用户界面编辑器和文本编辑器。应理解,编辑器110的实现方式不限于此,还可以用任何其他合适的方式来实现编辑器110的功能,例如,可以基于自然语言处理从用户输入的自然语言中获取用于电子表格的层级结构,或者可以基于用户绘制的表示层级结构的树状结构以及输入的关于节点的其他信息来获取用于电子表格的层级结构等。
根据一个实施例,用于电子表格的一个或多个层级的层级类型包括以下各项中的一个或多个:工作簿、页、节、表、块、行、列、区间和单元格。在一个实施例中,用于指定不同层级的节点的组件包括以下各项中的一个或多个:用于指定页的组件、用于指定标题的组件、用于指定节的组件、用于指定表的组件、用于指定数据头的组件、用于指定表体的组件、用于指定行的组件、用于指定列的组件、用于指定块的组件、用于指定区间的组件、和用于指定单元格的组件。其中,数据头对应于电子表格中表的上方的描述表中各个列的名称的一个或多个单元格,以及表左上角交叉位置处的描述性信息(称为存根),表体是表中除了数据头以外的部分。
编辑器110还可以被配置成获取层级结构的多个节点中的每个节点的元数据。根据一个实施例,获取该多个节点中的每个节点的元数据包括获取描述该节点的具体含义的语义信息。根据一个实施例,语义信息可以包括名称、标题、标签和批注中的一个或多个。其中,标签可以是和名称类似的描述一个节点的简短的词语(称为别名(alias)标签),也可以指定节点的附加特性(称为属性标签)。批注是对于一个节点的说明性文字,一般比较长,可以显示于电子表格的特定位置(比如每个页的末尾)或者以通用电子表格编辑软件中的“批注”的形式显示在生成的电子表格中。例如,一个工作簿的语义信息可以是这个工作簿的名称和/或描述整个工作簿的文字内容(标题或批注),一个页的语义信息可以是这个页的名称和/或描述该整个页的文字内容(标题或批注),一个节的语义信息可以是描述这个节的文字内容(标题或批注),一个表的语义信息可以是这个表的名称、标签、或批注,一个行或列的语义信息可以是这个行或列的名称、标签、或批注,一个块的语义信息可以是这个块的名称和/或适用于这个块的所有行或列的标签或批注,一个单元格的语义信息可以是这个单元格的行名称/标签和这个单元格的列名称/标签及这个单元格的批注。
根据一个实施例,编辑器110还可以包括修饰器(modifier)组件,该修饰器组件可以被配置为获取用于指定与多个节点中的每个节点对应的一个或多个第一单元格的格式的信息。根据一个实施例,指定该一个或多个第一单元格的格式的信息包括格式类型(例如,第一格式类型、第二格式类型等),并且其中用与格式类型相对应的格式来设定该一个或多个第一单元格的格式(例如,字体、字号、背景颜色、字体颜色、加粗、下划线、缩进等)。根据一个实施例,可以通过以下操作来设定与格式类型相对应的格式:显示预定义的文本,接收用户对预定义的文本的格式的设定,以及基于用户对预定义的文本的格式的设定来设定与该格式类型相对应的格式。通过这种方式,可以允许用户用直观的方式来设置与格式类型相对应的格式。在编辑器110为图形用户界面编辑器的实施例中,图形用户界面编辑器还可以包括修饰器组件,该修饰器组件可以用于指定与层级结构中的节点对应的一个或多个单元格的格式类型。
根据一个实施例,编辑器110还可以包括标签组件,该标签组件可以被配置为获取用于每个节点的别名标签或属性标签,其中别名标签可以指定与该节点对应的一个或多个单元格的别名(例如,数字、符号或文本等),属性标签可以指定与该节点对应的一个或多个单元格的附加特性(例如,计算优先级、数值单位等)。别名标签有助于用户理解、区分、并引用具有相同名称的不同节点,利用属性标签可以对生成电子表格的过程进行更精细的控制。别名标签和属性标签被用于生成电子表格的过程,但一般不显示在最终生成的电子表格中。
根据一些实施例,在要生成的电子表格包含计算公式的情况下,可能还需要获取层级结构中的节点之间的依赖关系和/或计算关系。根据一个实施例,编辑器110还可以包括依赖关系定义组件,该依赖关系定义组件被配置为获取多个节点中的第一节点与另外的一个或多个节点之间的依赖关系。应注意,层级结构中的每个节点都可能与其他节点存在依赖关系。对于电子表格中的任意两个单元格A和单元格B,定义单元格A依赖于单元格B当且仅当单元格A至少由单元格B(或由单元格B与其他单元格一起)计算得到。对于层级结构中的节点(例如,行节点)C和D,定义节点C依赖于节点D当且仅当节点C包含的至少一个单元格直接或间接地依赖于节点D包含的至少一个单元格。根据一个实施例,编辑器110还可以包括计算关系定义组件,该计算关系定义组件可以被配置为获取第一节点与另外的一个或多个节点之间的计算关系。例如,计算关系定义组件可以被配置为获取第一节点与另外的一个或多个节点之间的计算公式、该计算公式的运算符或运算符的组合等。例如,对于列节点L1、L2和L3, 假设用户输入L1=L2+L3,则依赖关系定义组件可以从中获取这些列节点的依赖关系为:L1依赖于L2和L3,而计算关系定义组件可以从中获取这些节点的计算关系为“+”或者“L1=L2+L3”。
根据一个实施例,装置100A还可以包括层级图构建器150和层级图存储器160,其中层级图构建器150可以被配置为基于由编辑器110获取的层级结构中的多个节点中的每个节点所在层级的层级类型、该节点的子节点以及该节点的元数据来构建用于电子表格的层级图,层级图存储器160可以被配置为存储层级图。根据一个实施例,层级图构建器150可以被配置为基于由依赖关系定义组件获得的第一节点和另外的一个或多个节点之间的依赖关系获得对应于第一节点的一个或多个第一单元格中的每个第一单元格所对应的节点与对应于该另外的一个或多个节点的一个或多个第二单元格中的每个第二单元格所对应的节点之间的依赖关系。根据一个实施例,层级图构建器150还可以被配置为基于第一节点与另外的一个或多个节点之间的计算关系来确定该一个或多个第一单元格中的每个第一单元格与一个或多个第二单元格中的每个第二单元格之间的计算关系。下文将进一步描述建立与单元格对应的节点之间的依赖关系和计算关系的方法。
在一个实施例中,层级图构建器150构建层级图还可以基于层级结构中的每个节点所依赖的节点。在一个实施例中,层级图构建器150构建层级图还可以基于层级结构中的多个节点中的每个节点与其他节点之间的计算关系。
数据面板120可以被配置为获取用于电子表格的原始数据。根据一个实施例,数据面板120可以包括原始数据获取组件,该原始数据获取组件可以包括以下组件中的一个或多个:智能数据提取组件,被配置为从数据文件(例如,Excel文件、txt文件等)中自动识别原始数据;数据库接口组件,被配置为从数据库导入原始数据;检索接口组件,被配置为从外部数据源(例如,搜索引擎、电子出版物、博客等)检索原始数据;以及手动输入接收组件,被配置为接收用户输入的原始数据。根据一个实施例,数据面板120还可以包括:待填充数据检测组件,被配置为检测层级结构的多个节点中需要输入原始数据的(一个或多个)节点以及该节点中对原始数据的要求(例如,三个行,每个行需要5个原始数据等);以及数据匹配组件,被配置将原始数据获取组件获取的原始数据与由待填充数据检测组件所检测到的需要输入原始数据的节点相匹配。其中数据匹配可以是系统自动匹配或者是用户通过图形用户界面手动匹配或填充的。数据面板120还可以包括可选的数据填充图形用户界面,以展示待填充的 用于电子表格的原始数据表格,用户可以通过人机交互的方式填充该原始数据表格。其中,该原始数据表格可以是通过电子表格生成模块130中的转译器生成的。
电子表格生成模块130可以被配置为至少基于由编辑器110获取的用于电子表格的层级结构和元数据以及由数据面板120获取的原始数据来生成电子表格。
根据一个实施例,电子表格生成模块130可以包括渲染器,渲染器可以被配置为根据用于指定一个或多个第一单元格的格式的信息来在电子表格中设定该一个或多个第一单元格的格式(例如,字体、字号、背景颜色、字体颜色、加粗、下划线、缩进等)。根据一个实施例,渲染器可以被配置为根据由编辑器110获取的多个节点中的每个节点所在的层级的层级类型、该节点的格式信息、和与该节点对应的一个或多个单元格的内容中的一者或多者来自动设定与该节点对应的一个或多个单元格的格式。
根据一个实施例,电子表格生成模块130还可以包括转译器。根据一个实施例,转译器可以被配置为:对于层级结构中的多个节点中的每个节点:基于层级结构来确定与该节点对应的一个或多个单元格在电子表格中的位置;以及基于原始数据、该节点的层级类型、该节点的元数据、该节点所依赖的节点、以及该节点的计算关系中的一者或多者来填充与该节点对应的一个或多个单元格的内容(例如,数字、字符、文本等)。可以基于转译器的处理结果生成Excel文件或其他电子表格文件,也可以生成txt文件或网页的一部分或者任何其他合适格式的文件。转译器可以被配置为:至少基于由层级图构建器150基于第一节点与另外的一个或多个节点之间的计算关系确定的一个或多个第一单元格中的每个第一单元格与一个或多个第二单元格中的每个第二单元格之间的计算关系来生成该一个或多个第一单元格中的每个第一单元格的电子表格公式。根据一个实施例,转译器可以被配置为基于编辑器110获得的电子表格的层级结构、数据面板120的待填充数据检测组件检测到的需要输入原始数据的节点以及该节点中对原始数据的要求来生成待填充的原始数据表格,并展示在数据面板120中的数据填充图形用户界面上,以供用户以人机交互的方式填充。例如,在电子表格中不包含需要进行计算的公式且由数据面板120获得的原始数据已经给出与电子表格中需要填入数据的每个单元格相对应的数据的情况下,转译器仅基于原始数据就可以填充该电子表格的所有内容。
根据一个实施例,编辑器110还可以被配置为接收指定电子表格中的表的位置的操作,并且电子表格生成模块130还可以被配置为基于该操作来调整表在电子表格中的位置。例如,参见图11E,该操作可以(例如,通过图形用户界面编辑器或文本编 辑器)指定表B与表A之间的距离为3个行,则电子表格生成模块130可以将表B调整到与表A相距3个行的位置处。再例如,参见图11F,该操作可以(例如,通过图形用户界面编辑器或文本编辑器)指定表B位于表A的右下方,则电子表格生成模块130可以将表B调整到表A的右下方位置处。
根据一些实施例,装置100A还可以包括电子表格预览模块140。根据一个实施例,电子表格预览模块140可以被配置为:使所生成的电子表格(例如,在显示器上)被显示,接收对层级结构、元数据、原始数据、依赖关系、或计算关系的修改,以及基于对层级结构、元数据、原始数据、依赖关系、或计算关系的修改来更新所显示的电子表格。在编辑器110是图形用户界面编辑器的实施例中,对层级结构的修改可以包括对用于指定层级结构中的第三节点的组件的拖拽;以及其中更新所显示的电子表格包括调整与第三节点对应的一个或多个单元格在电子表格中的相对位置以使其与拖拽后的用于指定第三节点的组件在图形用户界面编辑器中的相对位置一致。
根据一个实施例,电子表格预览模块140可以被配置为:使所生成的电子表格被显示,接收对所显示的电子表格的修改,以及将对电子表格的修改转化为对层级结构、元数据、原始数据、依赖关系、和计算关系中的至少一者的修改,并利用编辑器和数据面板中的至少一者基于该修改来相应地修改层级结构、元数据、原始数据、所依赖的节点、或计算关系中的至少一者。
根据一个实施例,装置100A还可以包括错误检测模块,错误检测模块可以被配置为:自动检测层级结构、元数据、原始数据、依赖关系、或计算关系中的一者或多者中存在的错误;以及发出(例如,视觉、听觉或触觉等)警告以提示错误。通过进行错误检测和提示,可以有助于减少电子表格中可能存在的错误,便于用户进行调试。根据一个实施例,装置100A还可以包括智能建议模块,其中智能建议模块可以被配置为:基于已经获取的层级结构、元数据、原始数据、依赖关系、计算关系和用户已经进行的操作中的一者或多者,预测将要获取的层级结构、元数据、原始数据、依赖关系、计算关系和用户将要进行的操作中的一者或多者;以及提供对将要获取的层级结构、元数据、原始数据、依赖关系、计算关系和用户将要进行的操作中的一者或多者的智能建议结果。通过提供智能建议结果,可以方便用户交互,有助于减少用户的工作负担。
根据一个实施例,装置100A可以与客户端170交互。装置100A可以与客户端170位于同一个设备中,或者位于不同的设备中并且通过有线或无线连接可通信地耦 合。客户端170例如可以是由用户使用的诸如笔记本电脑、手机、平板电脑、可穿戴设备等之类的电子设备,或者可以是运行在计算设备上的应用程序等等。客户端170可以向编辑器110、数据面板120、电子表格生成模块130和电子表格预览模块140中的一个或多个提供输入。
图1B是示出根据本公开的一些实施例的示例性的用于自动生成电子表格的方法100B的流程图。虽然图1B例示了方法100B的4个步骤,但这仅仅是用于自动生成电子表格的方法的示意性流程,用于自动生成电子表格的方法100B还可以包括比所示出的步骤更多或更少的步骤,或者可以包括上述四个步骤中任意步骤的组合步骤。此外,方法100B中的一些步骤可以同时发生或者按照与所示出的顺序不同的顺序发生。
方法100B从步骤S110开始,步骤S110可以由图1A的编辑器110执行。在步骤S110处,获取用于电子表格的层级结构,其中层级结构包括一个或多个层级,该一个或多个层级具有多个节点,其中每个层级具有至少一个节点并且具有相应的层级类型,每个节点对应于电子表格中的一个或多个单元格,其中层级结构还包括该多个节点之间的隶属关系。
方法100B前进到步骤S120,步骤S120可以由图1的编辑器110执行。在步骤S120处,获取层级结构中的多个节点中的每个节点的元数据。
方法100B前进到步骤S130,步骤S130可以由图1的数据面板120执行。在步骤S130处,获取用于电子表格的原始数据。
方法100B前进到步骤S140,步骤S140可以由图1的电子表格生成模块130执行。在步骤S140处,至少基于用于电子表格的层级结构、元数据和原始数据来生成电子表格。
下面将结合图2A-图18描述根据本公开的示例性实施例。
图2A是根据本公开的一些实施例的示例性的用于获取电子表格的层级结构的图形用户界面编辑器200A的框图。图形用户界面编辑器200A可以是如图1A所示的编辑器110的一个示例。如图2A所示,图形用户界面编辑器200A可以包括用于指定不同层级的节点的组件210、依赖关系定义组件220、计算关系定义组件230、修饰器组件240和标签组件250。虽然图2A例示了上述五个单元,但这仅仅是图形用户界面编辑器200A的示意性结构,图形用户界面编辑器200A还可以包括比所示出的更多或更少的单元,或者可以包括上述五个单元中任意单元的组合单元。
图形用户界面编辑器200A可以被配置成接收针对用于指定不同层级的节点的组件210的输入,以及基于该输入来生成用于电子表格的层级结构。用于指定不同层级的节点的组件210可以用来添加、修改和/或删除不同层级的节点,该不同层级的节点可以对应于电子表格中的一个或多个单元格。根据一个实施例,电子表格的一个或多个层级的层级类型可以包括以下各项中的一个或多个:工作簿、页、节、表、块、行、列、区间和单元格。应理解,上述层级类型仅仅是示例,还可以为层级结构定义任何其他合适的层级类型。根据本公开的实施例,页可以由节或表构成,每个节还可以包括节或者表。在一个实施例中,用于指定不同层级的节点的组件包括以下各项中的一个或多个:用于指定页的组件、用于指定标题的组件、用于指定节的组件、用于指定表的组件、用于指定数据头的组件、用于指定表体的组件、用于指定行的组件、用于指定列的组件、用于指定块的组件、用于指定区间的组件、和用于指定单元格的组件。
用于指定不同层级的节点的组件210还可以包括用于增加不同级别的标题的组件(例如,用于指定节的组件可以是用于增加标题的组件),其中不同级别的标题可以将页分为不同的节或表。下面将参考图3A来进一步描述。图3A是根据本公开的一些实施例的示例性的与电子表格的一个页对应的层级结构300A。在层级结构300A中,标题1 301和标题2 304是一级标题,它们将这个页分为两个节:节1和节2。节1进一步包含二级标题1.1 302和二级标题1.2 303,它们将节1分为节1.1和节1.2(在这个例子中,由于二级标题1.2下没有表,所以节1.2为空),节1.1和节1.2也可以被称为节1的子节。节1.1包括两个表,分别为表1.1.A 311和表1.1.B 312。类似地,节2进一步包括二级标题2.1 305和二级标题2.2 308,它们将节2分为节2.1和节2.2。节2.1又包括两个三级标题2.1.1 306和标题2.1.2 307,标题2.1.2下的表2.1.2.A 314组成节2.1.2,节2.2中包括两个表2.2.A 315和表2.2.B 316。如此,可以例如通过用于指定标题的组件和用于指定表的组件来获取与电子表格的一个页对应的层级结构300A。
根据一个实施例,可以通过用于指定数据头的组件、用于指定表体的组件、用于指定行的组件、用于指定列的组件、用于指定块的组件、用于指定区间的组件中的一个或多个来获取层级结构300A中的表节点的进一步的结构。其中,数据头对应于电子表格中表的上方的描述表中各个列的名称的一个或多个单元格,以及表左上角交叉位置处的描述性信息(称为存根),表体是表中除了数据头以外的部分。在纵向排列的表中(即表中各行之间的差异性较大、表中的计算关系主要是不同行之间的计算关系, 参见图3B中的电子表格300B),数据头331描述了该表中包含的所有的列(或列块)的名称333和存根334,表体332描述了表中各个行的名称和内容,数据头和表体可以组成一个表。图3C是根据本公开的一些实施例的示例性的用于指定表的组件300C。具体而言,组件300C是一个指定纵向排列的表的组件,其中,在用于指定数据头的组件350中定义这个表包含的所有列或列块,以及各个列或列块之间的计算关系,以及存根351;在用于指定表体的组件370中定义这个表包含的所有行或行块、以及各个行或行块之间的计算关系。在与用于指定表的组件300C对应的表节点中,包括10个列352-356、361-365,其中,列361-365组成一个列块357,各列之间存在计算关系358“列5=列1+列2+列3+列4”;这个表节点包括4个行371-374,其中,行373-374组成行块375,各行之间存在计算关系376“行3=行2.1+行2.2”。下文将结合图4A至图4C进一步描述根据本公开的实施例的用于指定不同层级的节点的组件210。根据一个实施例,在用于指定区间的组件中,可以通过“[]”操作符来指定区间,比如“行3[列1:列5]”代表由“行3”与“列1”至“列5”交叉位置处的单元格组成的区间。
用于指定不同层级的节点的组件210还可以被配置成获取层级结构的多个节点中的每个节点的元数据。根据一个实施例,获取该多个节点中的每个节点的元数据包括获取描述该节点的具体含义的语义信息。根据一个实施例,语义信息可以包括名称、标题、标签和批注中的一个或多个。例如,用于指定不同层级的节点的组件210可以包括文本框、选项框、对话框等,从而允许用户输入与节点对应的语义信息,使得图形用户界面编辑器200A是用户友好的。
依赖关系定义组件220可以被配置为获取层级结构中的多个节点中的第一节点与另外的一个或多个节点之间的依赖关系。计算关系定义组件230可以被配置为获取第一节点与该另外的一个或多个节点之间的计算关系。例如,计算关系定义组件可以被配置为获取第一节点与另外的一个或多个节点之间的计算公式、该计算公式的运算符或运算符的组合(例如,“*/*-1”,其中“*”表示占位符)等。由此,可以直接定义单元格节点以及比单元格更高级别的节点(例如,行节点、列节点、表节点等)之间的依赖关系和计算关系,从而有助于用户理解电子表格中的逻辑关系并且便于用户对所生成的电子表格进行调试和复用等。根据一个实施例,可以基于第一节点与该另外的一个或多个节点之间的依赖关系、计算关系来分别获得对应于第一节点的一个或多个第一单元格中的每个第一单元格所对应的节点与对应于该另外的一个或多个节点 的一个或多个第二单元格中的每个第二单元格所对应的节点之间的依赖关系、计算关系。下文将结合图5A-图5D进一步描述该过程的示例。
修饰器组件240可以被配置为获取用于指定与多个节点中的每个节点对应的一个或多个第一单元格的格式的信息。根据一个实施例,指定该一个或多个第一单元格的格式包括指定格式类型(例如,第一格式类型、第二格式类型等),并且用与格式类型相对应的格式来设定该一个或多个第一单元格的格式(例如,字体、字号、背景颜色、字体颜色、加粗、下划线、缩进等)。例如,修饰器组件240可以被配置为获取指定与一个行节点对应的处于同一行的多个单元格的格式的信息,该信息指定这些单元格的格式为第一格式类型,然后可以将这些单元格的格式设定为和第一格式类型对应的格式,例如四号字、加粗。根据一个实施例,图形用户界面编辑器200A还可以包括格式设定组件,格式设定组件可以用于设定与所述格式类型相对应的格式。根据一个实施例,可以显示预定义的文本,接收用户对预定义的文本的格式的设定,以及基于用户对预定义的文本的格式的设定来设定与格式类型对应的具体格式。应理解,还可以用其他任何合适的方式来获取用于指定与多个节点中的每个节点对应的一个或多个第一单元格的格式的信息。例如,格式设定组件可以包括文本框、选项框、对话框等,用户可以输入与格式对应的编号、输入与格式对应的文本、选择与格式对应的级别等。
标签组件250可以被配置为获取用于每个节点的别名标签或属性标签,其中别名标签可以指定与该节点对应的一个或多个单元格的别名(例如,数字、符号或文本等),属性标签可以指定与该节点对应的一个或多个单元格的附加特性。别名标签和属性标签可以方便用户对电子表格进行调试。例如,假设两个行的行名称都是“总计”,而实际这两个行分别对应2016年的总计数据和2017年的总计数据,此时可以将第一个行节点的别名定义为“2016总计”,将第二个行节点的别名定义为“2017总计”,由此可以更清楚地区分这两个行。例如,还可以将分别具有列名称“2016年”和“2017年”的两个列的别名都定义为“hist”,从而在定义节点之间的计算关系时可以直接利用该别名“hist”来一起引用这两个列节点,从而使得对电子表格的调试更加灵活。属性标签有助于指定节点的一些附加特性。例如,可以基于键值对(key=value)来指定属性标签。假设电子表格中的特定单元格可以由两个不同的计算公式得到,则用户可以定义与该特定单元格对应的节点A与节点B,节点A和节点B可以具有不同的计算关系。例如,在图3C中,行3和列5交叉位置处的单元格可以同时由公 式358和376得到,在这种情况下,可以利用属性标签指定存储有公式376的计算关系的单元格节点A具有最高的优先级(例如,PRIORITY=TOP),从而优先利用公式376的计算关系来获得该特定单元格的公式。还可以利用属性标签指定存储有公式358的计算关系的单元格节点B是用来对节点A的计算关系进行验证的(例如,CHECK=TRUE),从而当利用节点A的计算关系获得的该特定单元格的值与利用节点B的计算关系获得的该特定单元格的值不一致时,可以发出警报(例如,弹出对话框、用特殊格式显示公式、发出提示声音等)。
应理解,客户端(例如,图1A中的客户端170)可以通过任何合适的输入机构(例如,键盘、鼠标、手写板、麦克风、触敏屏幕等)来与图形用户界面编辑器200A中的每个组件进行交互。
图2B是示出根据本公开的一些实施例的示例性的用于获取电子表格的层级结构的方法200B的流程图。虽然图2B例示了方法200B的三个步骤,但这仅仅是用于获取电子表格的层级结构的示意性流程,用于获取电子表格的层级结构的方法200B还可以包括比所示出的步骤更多或更少的步骤,或者可以包括上述三个步骤中任意步骤的组合步骤。此外,方法200B中的一些步骤可以同时发生或者按照与所示出的顺序不同的顺序发生。例如,方法200B可以由图1A所示的装置100A执行。
方法200B从步骤S210开始,在步骤S210处,提供图形用户界面编辑器(例如图2A所示的图形用户界面编辑器200A),其中图形用户界面编辑器可以包括用于指定不同层级的节点的组件。
方法200B前进到步骤S220,在步骤S220处,图形用户界面编辑器可以接收针对用于指定不同层级的节点的组件的输入。
方法200B前进到步骤S230,在步骤S230处,图形用户界面编辑器可以基于针对用于指定不同层级的节点的组件的输入来生成层级结构。例如,可以基于针对用于指定行节点的组件的输入来在层级结构中添加、修改和/或删除相应的行节点。
图4A至图4C分别示出了根据本公开的一些实施例的示例性的图形用户编辑器400A、400B和400C。图形用户界面编辑器400A、400B和400C可以是如图1A所示的编辑器110或图2A所示的图形用户界面编辑器200A的示例。应理解,图形用户界面编辑器400A、400B和400C还可以包括比所示出的更多或更少的组件,或者可以用任何其他合适的方式来实现图形用户界面编辑器400A、400B和400C。
如图4A所示,图形用户界面编辑器400A包括用于指定不同层级的节点的组件,例如,用于指定表的组件401、用于指定数据头的组件410、用于指定标题的组件481、用于指定存根的组件413、用于指定列或列块的组件414-416、用于指定行或行块的组件420-460和471-472以及用于指定单元格的组件(未示出)。响应于针对用于指定页的组件(未示出)的添加操作(例如,点击用于指定页的组件),图形用户界面编辑器400A中可以显示一个新的页,并且可以添加页的名称或描述页的其他信息。响应于针对用于指定表的组件482的添加操作,图形用户界面编辑器400A中可以添加一个表,并且可以显示指示层级类型为“表”的组件和用于指定表名称的组件402,组件402可以是用于指定表的组件401的一部分。通过在组件402中输入“销售额”,可以指定表的名称。响应于针对用于指定表的组件482的添加操作,图形用户界面编辑器400A中还可以显示用于指定表的数据头的组件410。可以显示用于指定存根的组件413。图4A中示出的存根“百万元”可以是表中的数据的单位,然而存根还可以指示与表中的数据相关联的其他信息。图4A中示出的数据头中定义了两个一级列块“2017”和“2018”,每个一级列块各自包括五个二级列“Q1”、“Q2”、“Q3”、“Q4”、“全年”。通过点击用于指定列的组件416,可以添加更多的一级列或一级列块。通过点击用于指定列的组件415,可以添加隶属于二级列“Q4”(此时该二级列变成二级列块)的一个或多个三级列。通过点击用于指定列的组件414,可以添加隶属于一级列“2017”的一个或多个二级列或二级列块。组件417可以是依赖关系定义组件和/或计算关系定义组件。通过组件417可以指定表中的一个或多个列的计算公式,例如,可以指定“全年=Q1+Q2+Q3+Q4”等。
行定义组件420-460可以定义表中包含的行。修饰器组件421可以用来指定该行包括的一个或多个单元格的格式。例如,通过点击组件421中位于上方的三角形可以增加行的格式类型的级别,以使得该行看起来更为醒目(例如,字号更大、以加粗和/或加下划线等方式强调显示、以更深的字体颜色显示等);通过点击组件421中位于下方的三角形可以降低行的格式类型的级别,以使得该行看起来更不醒目。应理解还可以按照任何其他合适的方式来实现修饰器组件421,例如,用户可以直接输入指定格式的信息,诸如定义格式的文本、格式类型的编号。
根据一个实施例,图形用户界面编辑器400A可以包括格式设定组件,格式设定组件用于指定与格式类型相对应的格式。例如,可以弹出新的对话框或者在图形用户界面的其他区域显示预定义的文本(例如,“单元格格式1”),接收用户对预定义的 文本的格式的设定,例如,所显示的预定义的文本可以根据用户的设定实时地调整,以方便用户直接查看该格式的显示效果。然后可以基于用户对预定义的文本的格式的设定来设定与格式类型对应的具体格式,并且可以根据该具体格式来相应地指定具有该格式类型的一个或多个单元格的格式。例如,参考图17,图17示出了根据本公开的一些实施例的示例性的格式设定组件1700。在图17所示的格式设定组件1700中,可以在1701-1711中设定标题、列和行的不同格式类型。例如,预定义的文本“标题格式1”1701的格式代表将标题格式1设置为黑色背景,白色黑体加粗字体;预定义文本“行格式2”1708的格式代表将行格式2设置为行名称为斜体、缩进2个字符、行内数据为斜体,加下划线,两位小数,加千分位符;预定义文本“行格式4”1710的格式代表将行格式4的行名称设置为加下划线、行内数据为百分号显示,两位小数。预定义文本1712“默认表格式”等代表将表(例如,在编辑器不包括修饰器组件的情况下)的默认格式设置为:表名称为黑色背景白色加粗黑体,存根为斜体,列块名称合并单元格居中并用黑体加粗显示,行块名称列于行块所包括的行的上方并用黑体加粗显示,行块内的二级行需要缩进一个字符等。
组件422可以用来获取描述行的具体含义的语义信息,例如行名称、行标签、批注等。图形用户界面编辑器400A还可以包括用于获取层级结构中的每个节点的元数据的其他组件。例如,除了语义信息之外,元数据还可以包括以下附加信息中的一个或多个:该节点的创建时间、该节点的子节点的数量、用于与该节点对应的一个或多个单元格的数据的单位、该节点的数据对应的时间点或时间段、以及从层级结构中的根节点到该节点的路径等。组件423中输入的内容为预定义的公式,例如“SOURCE()”,这可以指示该行的内容由数据面板获得的原始数据填充。组件453、463可以是依赖关系定义组件和/或计算关系定义组件,其中组件453中的内容指示行“总计”的结果等于行“手机”、行“笔记本”和行“平板电脑”的总和,组件463中的内容指示行“平均”的结果等于行“手机”、行“笔记本”和行“平板电脑”的平均值。因此,行“总计”依赖于行“手机”、行“笔记本”和行“平板电脑”,行“平均”也依赖于行“手机”、行“笔记本”和行“平板电脑”。虽然图4A中示出的五个行都是一级行,但是与用于指定列的组件类似地,用于指定行的组件可以允许添加不同级别的行。如图4B所示,通过点击(例如,右击或双击等)组件424,可以弹出对话框464,从而允许用户添加新的行、添加新的块(块内可以继续添加行,块内的行为比当前行低一级的行)等。
根据一个实施例,图形用户界面编辑器400A还可以包括标签组件,例如标签组件可以位于用于指定层级结构中的节点名称的组件(例如,组件422)的左上角(或者右上角、左下角、右下角等),标签组件还可以位于图形用户界面中的其他区域。如图4C所示,通过点击标签组件,可以弹出对话框473(对话框473可以是标签组件的一部分),从而允许用户编辑与该节点对应的一个或多个标签。标签组件可以获取用于每个节点的别名标签和/或属性标签,其中别名标签可以指定与该节点对应的一个或多个单元格的别名(例如,数字、符号或文本等),属性标签可以指定与该节点对应的一个或多个单元格的附加特性。例如,在对话框473中,为行节点“手机”设置了别名标签“手机销量”,并且设置了属性标签“PRIORITY=TOP”,以表明公式“手机=SOURCE()”具有最高的优先级,以指示优先利用从数据面板获得的原始数据来填充行名称为“手机”的行。
图4D至图4F示出了根据本公开的一些实施例的示例性的用于自动生成电子表格的装置上显示的图形用户界面。图形用户界面4000D包括图形用户界面编辑器4010和电子表格预览模块4020,可以通过点击按钮4030跳转至如图8B所示的数据填充图形用户界面840,以及可以通过点击按钮4050跳转至如图5E所示的展示可视化表示500E的界面。
根据一个实施例,编辑器110还可以包括导入模板的组件,该导入模板的组件可以被配置为导入用于层级结构中的一个或多个节点的模板。模板可以是针对任意层级类型的节点的模板,可以是系统预设的或者用户自定义的。如图4D-4F所示,可以通过点击按钮4017导入一个整体工作簿的模板(例如关于DCF(现金流折现)模型的整体的电子表格模板),或者通过点击按钮4012或4013导入一个表的模板(例如“利润表”、“资产负债表”、“现金流量表”模板)。用户可以通过点击按钮4018的下拉菜单(未示出)中的“保存为模板”按钮将编辑器中的页、表、块、行、数据头等保存成自定义模板。所有可用的模板可以显示在如图4E所示的图形用户界面4000E的区域4011中,用户可以选择其中的一个模板并将其添加至编辑器中正在编辑的电子表格模型。比如通过点击按钮4014选择“利润表”模板,可以将其添加至编辑器中,如图4E和图4F的编辑器中的区域4015或4016所示。相应的,在如图4F所示的图形用户界面4000F中,电子表格预览模块4020中可以显示对应于该新添加的表模板的生成的电子表格的预览4026。
下面结合图5A至图5D进一步描述根据本公开的示例性实施例的电子表格层级结构以及如何基于所获取的信息来建立节点之间的依赖关系和计算关系。
图5A、图5B和图5D是示出根据本公开的一些实施例的示例性的电子表格层级结构500A、500B和500D及节点之间的依赖关系的示意图。应理解,层级结构500A、500B和500D是示例性的,并且如图5A、图5B和图5D所示的层级结构仅仅是为了便于理解,而并不意图限制层级结构的存储格式。图5A中的层级结构例如可以是由图1A的编辑器110、图2A的编辑器200A或图4A-图4C的图形用户界面编辑器400A-400C获得的。
在图5A中用不同的节点形状示出了层级结构中的不同层级类型的节点,用实线箭头示出了节点之间的隶属关系,并且用虚线箭头示出了节点之间的依赖关系。假设节点A隶属于节点B,则实线箭头从B指向A,并且称节点B是节点A的父节点,节点A是节点B的子节点。定义没有父节点的节点被称为根节点,从根节点到一个节点所经分支上的所有节点被称为该节点的祖先节点,以一个节点为根的子有向图中的任一节点都称为该节点的子孙节点。用椭圆形示出的节点501是根节点,其层级类型为页,节点501对应于电子表格的一个页。应理解,在其他实施例中,根节点的层级类型还可以是工作簿等。用圆角矩形示出的节点503的层级类型为表,它具有层级类型为行的两个子节点504和505,这两个子节点用八边形示出。节点502的层级类型同样是行,但它不隶属于节点503,而是直接隶属于根节点501。也就是说,工作簿总共包括三个行,其中与节点503对应的表包括与节点504和505对应的两个行。层级类型为单元格的节点用菱形示出,其中单元格节点506和507隶属于行节点502,单元格节点508和509隶属于行节点504,而单元格节点510和511隶属于行节点505。应理解,图5A是电子表格的层级结构的示例,实际的层级结构可以包括比图5A更多或更少或者不同的层级类型,并且每个层级可以包括任意合适数量的节点。
假设与行节点504对应的计算公式中包括行节点502(例如,与节点504对应的行=与节点502对应的行×2),则依赖关系定义组件(例如,图2A中的依赖关系定义组件220)可以获得如下依赖关系:节点504依赖于节点502,这可以由节点502和节点504之间的虚线箭头534表示。假设与单元格节点507对应的计算公式中包括单元格节点511(例如,“与节点507对应的单元格=与节点511对应的单元格的+1”或者“与节点507对应的单元格=与节点511对应的单元格+与节点510对应的单元格”等),则依赖关系定义组件(例如,图2A中的依赖关系定义组件220)可以获得如下 依赖关系:节点507依赖于节点511,这由节点511和节点507之间的虚线箭头542表示(对于“与节点507对应的单元格=与节点511对应的单元格+与节点510对应的单元格”的情形,还可以获得节点507依赖于节点510,这里未示出)。下文将进一步结合图5B至图5D和图6描述根据本公开示例性实施例的用于建立节点之间的依赖关系的方法。
图6是示出根据本公开的一些实施例的示例性的用于建立节点之间的依赖关系的方法600的流程图。虽然图6例示了方法600的四个步骤,但这仅仅是用于建立节点之间的依赖关系的方法的示意性流程,该方法600还可以包括其他可能的步骤,或者可以包括上述四个步骤中任意步骤的组合步骤。
方法600从步骤S610开始,步骤S610例如可以由图1A的编辑器110或图2A的依赖关系定义组件220执行。在步骤S610处,获取层级结构中的多个节点中的第一节点与另外的一个或多个节点之间的依赖关系。根据一个实施例,可以通过识别第一节点的计算公式中包括的另外的一个或多个节点来确定该第一节点依赖于另外的一个或多个节点。例如,对于图4A中的用于指定行的组件450中的计算公式,基于从行节点“总计”的计算公式中识别出行节点“手机”、行节点“笔记本”和行节点“平板电脑”,可以确定行节点“总计”依赖于行节点“手机”、行节点“笔记本”和行节点“平板电脑”。又例如,在图5A的实施例中,依赖关系定义组件可以获取如下依赖关系:行节点504依赖于行节点502,单元格节点507依赖于单元格节点511。
方法600前进到步骤S620,步骤S620例如可以由图1A的层级图构建器150执行。在步骤S620处,至少基于第一节点和该另外的一个或多个节点之间的依赖关系,对于对应于该第一节点的一个或多个第一单元格中的每个单元格所对应的节点,确定该节点依赖于与对应于该另外的一个或多个节点的一个或多个第二单元格中的第一组第二单元格各自对应的第一组第二节点。返回参考图5A,对于与节点504对应的行,例如根据与节点504对应的计算公式为:与节点504对应的行=与节点502对应的行×2,则可以确定单元格节点508与单元格节点506有依赖关系,并且单元格节点509与单元格节点507有依赖关系。具体而言,单元格节点508依赖于单元格节点506,并且单元格节点509依赖于单元格节点507。如图5B所示,可以用节点508和节点506之间的虚线箭头531以及节点509和节点507之间的虚线箭头539表示这两个依赖关系。应理解,取决于具体的计算公式,第一节点与另外的一个或多个节点有依赖关系可以意味着与第一节点对应的每个单元格与另外的一个或多个节点所对应的单元格中的部 分单元格或全部单元格有依赖关系。即,上述第一组第二单元格可以是对应于该另外的一个或多个节点的一个或多个第二单元格中的部分单元格或全部单元格。例如,可以通过计算公式“单元格A=行B.sum()“来指定单元格A等于行B内所有单元格的和,假如行B包括三个单元格,则可以确定与单元格A对应的节点与和行B中的每一个单元格对应的节点有依赖关系。再例如,可以通过计算公式“行A=SUM(行B,行C)”来指定行A的每个单元格等于行B和行C中具有相同列名称的单元格的和,此时行A的每个单元格和行B中具有相同列名称的单元格、以及行C中具有相同列名称的单元格具有依赖关系。
在图5B中,如果节点504中的计算公式为“与节点504对应的行=与节点502对应的行×2”,则步骤S610中已经建立了节点502到节点504的依赖关系边。在步骤S620中,将节点502到节点504的依赖关系边转化为节点506到节点508的依赖关系边531,以及节点507到节点509的依赖关系边539。
取决于具体的计算公式,可以用不同的方法来将第一节点与另外的一个或多个节点之间的依赖关系转化为与第一节点对应的每个单元格与另外的一个或多个节点所对应的单元格中的部分单元格或全部单元格之间的依赖关系。
通过步骤S620,可以将具有比单元格更高的层级类型的节点之间的依赖关系分解为该节点的子孙节点中层级类型为单元格的节点的依赖关系。而对于在步骤S610中确定的节点507与节点511之间的依赖关系,由于节点507和511所在层级的层级类型已经是单元格,所以该步骤S620实际上可以被省略。
方法600前进到步骤S630,步骤S630例如可以由图1A的层级图构建器150执行。在步骤S630处,至少基于第一节点和该另外的一个或多个节点之间的计算关系获得对应于该第一节点的一个或多个第一单元格中的每个第一单元格所对应的节点与对应于该另外的一个或多个节点的一个或多个第二单元格中的每个第二单元格所对应的节点之间的计算关系。返回参考图5A,例如节点504对应的计算公式为“与节点504对应的行=与节点502对应的行×2”,则可以确定“单元格508=单元格506×2”,并且“单元格509=单元格507×2”。应理解,取决于具体的计算公式,第一节点与另外的一个或多个节点有依赖关系可以意味着与第一节点对应的每个单元格与另外的一个或多个节点所对应的单元格中的部分单元格或全部单元格有计算关系。例如,可以通过计算公式“单元格A=行B.sum()“来指定单元格A等于行B内所有单元格的和,假如行B包括三个单元格,则可以确定与“单元格A=sum(行B中的每一个单元格)”。 再例如,可以通过行节点A的计算公式“行A=SUM(行B,行C)”来确定“行A的列坐标为2019的单元格=sum(行B的列坐标为2019的单元格,行C的列坐标为2019的单元格)”。再比如,如果一个行节点A的计算公式为系统预设公式“行A=SOURCE()”,则行节点A的所有单元格子节点的计算关系均为“=SOURCE()”,这代表这些单元格的数据都需要从数据面板输入。取决于具体的计算公式,可以用不同的方法将第一节点与另外的一个或多个节点的计算关系转化为与第一节点对应的每个单元格与另外的一个或多个节点所对应的单元格中的部分单元格或全部单元格之间的计算关系。
图5C是示出根据本公开的一些实施例的将高层级节点之间的计算关系转化为低层级节点之间的计算关系的方法的示意图。
例如,用户可以在编辑器中输入计算公式
“{收入}[预测期]={收入:../利润表}.lag(1)×(1+{平均收入增长率})”
参考下面的“表:总计表”,假设计算公式中的第一节点(或左值节点)的“收入”这一行在电子表格中的总计表中的第10行,以及总计表中的“2019”、“2020”、“2021”所在的列分别为“F”、“G”、“H”。如果“2019”、“2020”、“2021”这三列都带有标签“预测期”,那么在目标电子表格中的总计表中的“收入”这一行(即第10行)与“2019”(即第F列)、“2020”(即第G列)、“2021”(即第H列)交叉处的单元格(即单元格F10、G10和H10)中都需要生成电子表格公式。
表:总计表
Figure PCTCN2020089642-appb-000001
另外,例如,参考下面的“表:利润表”,假设计算公式中的第二节点(依赖节点)的“收入:../利润表”这一行在电子表格中的利润表中的第30行。
表:利润表
Figure PCTCN2020089642-appb-000002
Figure PCTCN2020089642-appb-000003
此外,例如,参考下面的“表:总计表”,假设计算公式中的另一个第二节点(依赖节点)的“平均收入增长率”的值“10%”所对应的单元格在电子表格中的总计表中的第12行第C列。
表:总计表
Figure PCTCN2020089642-appb-000004
因此,可以根据电子表格的层级结构(诸如如上所述的总计表、利润表等)、以及原子运算符“.lag(1)”、“×”、“+”或由上述原子运算符组成的复合运算符“{y}={x1}.lag(1)×(1+{x2})”,对于电子表格中的总计表中的单元格F10、G10和H10,分别生成以下三个电子表格公式:
对于总计表中的单元格F10,生成电子表格公式=E30×(1+C12);对于总计表中的单元格G10,生成电子表格公式=F30×(1+C12);对于总计表中的单元格H10,生成电子表格公式=G30×(1+C12)。
针对一些实现,需要将层级结构中的节点之间的依赖关系可视化出来,此时可以进一步通过如下操作来建立依赖关系。方法600前进到步骤S640,步骤S640例如可以由图1A的层级图构建器150执行。在步骤S640处,对于对应于第一节点的一个或多个第一单元格中的每个单元格所对应的节点,建立如下依赖关系:该节点及该节点的所有或部分祖先节点依赖于第一组第二节点及第一组第二节点的所有或部分祖先节点。参考图5B,例如,对于节点504,在步骤S620处已经确定单元格节点508依赖于单元格节点506以及单元格节点509依赖于单元格节点507。从而可以建立如下依赖关系:节点508以及节点508的所有祖先节点中不是节点506的祖先节点的节点依赖于节点506和节点506的所有祖先节点中不是节点508的祖先节点的节点,并且节点509以及节点509的所有祖先节点中不是节点507的祖先节点的节点依赖于节点507和节点507的所有祖先节点中不是节点509的祖先节点的节点。图5D示出了根据步骤S640对于图5A所示的层级结构所构建的依赖关系。注意,为了图示清楚,在图5D中省略了节点509及其祖先节点中不是节点507的祖先节点的节点与节点507及其祖先 节点中不是节点509的祖先节点的节点之间的依赖关系。即,可以建立如下依赖关系:依赖关系531,指示节点508依赖于节点506;依赖关系532,指示节点504依赖于节点506;依赖关系533,指示节点503依赖于节点506;依赖关系534,指示节点504依赖于节点502;依赖关系535,指示节点508依赖于节点502;依赖关系536,指示节点503依赖于节点502。又例如,对于节点507,在步骤S610处已经确定节点507依赖于节点511。从而可以建立如下依赖关系:节点507以及节点507的所有祖先节点中不是节点511的祖先节点的节点依赖于节点511和节点511的所有祖先节点中不是节点507的祖先节点的节点。即,可以建立如下依赖关系:依赖关系542,指示节点507依赖于节点511;依赖关系543,指示节点507依赖于节点505;依赖关系545,指示节点507依赖于节点503;依赖关系541,指示节点502依赖于节点511;依赖关系544,指示节点502依赖于节点505;依赖关系546,指示节点502依赖于节点503。根据这样建立的依赖关系的可视化表示的示意图如图5E所示。例如,在图5E的可视化表示500E中,显示了层级结构中的所在层级的层级类型为页的所有节点及所在层级的层级类型为页的所有节点之间的依赖关系。可视化表示500E可以包括节点5001-5007以及表示它们之间的依赖关系的箭头。在本公开的另一些实施例中,不需要将层级结构中的节点之间的依赖关系可视化出来,此时则不需要通过步骤S640的方法进一步来建立依赖关系。在图6中,用虚线框示出步骤S640,以表明该步骤是可选的。
图7是示出根据本公开的一些实施例的示例性的电子表格层级结构中的节点700的示意图。应理解,节点700可以是图5A-图5B和图5D中的层级结构中的任意一个节点。根据本公开示例性实施例的存储如图5A-5B和图5D所示的层级结构中的节点的数据结构可以被称为层级图(hierarchy graph)。应理解,图5A、图5B和图5D所示的树状的层级结构仅仅为了方便理解,并不意图限制层级结构的存储方式。可以利用任意合适的数据结构来存储层级图,例如,链表、树、有向图等。根据一个实施例,层级图构建器(例如,如图1A所示的层级图构建器150)可以被配置为构建层级图,层级图存储器(例如,如图1A所示的层级图存储器160)可以被配置为将层级图存储在任何合适的存储设备(包括但不限于RAM、ROM、磁盘、光盘等)中,并且允许对层级图进行动态查询、调用和修改。
根据一个实施例,可以针对每个节点存储该节点所在层级的层级类型702、该节点的子节点704和该节点的元数据706。根据一个实施例,层级图构建器可以被配置为基于层级结构中的多个节点中的每个节点所在层级的层级类型702、该节点的子节 点704以及该节点的元数据706来构建用于电子表格的层级图。元数据706可以包括描述该节点的具体含义的语义信息(例如,与该节点相关联的标题、名称、标签和批注中的一个或多个)。元数据706还可以包括以下附加信息中的一个或多个:该节点的创建时间、该节点的子节点的数量、用于与该节点对应的一个或多个单元格的数据的单位、该节点的数据对应的时间点或时间段、以及从层级结构中的根节点到该节点的路径等。参考图5D,例如对于节点504,可以存储节点504所在层级的层级类型为行,节点504的子节点为节点508和509(例如,可以存储子节点的编号列表或者存储指向子节点的指针列表等),并且可以存储节点504的元数据(例如,行名称、该行每个单元格的列名称列表等)。
根据一个实施例,还可以可选地针对每个节点存储该节点所依赖的节点708(例如,可以存储所依赖的节点的编号或者存储指向所依赖的节点的指针等)。在一个实施例中,层级图构建器对层级图的构建还基于层级结构中的每个节点所依赖的节点708。参考图5D,例如对于节点504,可以存储节点504所依赖的节点包括节点502和节点506。应注意,存储每个节点所依赖的节点不是必须的。根据一个实施例,还可以附加地或替代地针对每个节点存储依赖该节点的节点。也就是说,对于层级图中的每个节点,可以存储该节点所依赖的节点,或者可以存储依赖该节点的节点,或者可以存储该节点所依赖的节点和依赖该节点的节点这两者。此外,针对层级结构中的部分节点可以不存储该节点和其他节点的依赖关系(例如,与该节点对应的单元格的内容可以直接由原始数据填充,该节点不依赖于其他节点,但是该节点可能被其他节点所依赖,比如图4A中的行节点“手机”、“笔记本”和“平板电脑”)。
根据一个实施例,还可以可选地针对每个节点存储该节点与其他节点之间的计算关系710(例如,可以存储该节点的计算公式、该节点的计算公式中包括的运算符或运算符的组合、计算公式中可能包括的常数、以及计算公式中每个参数占位符对应的该节点所依赖的节点等)。根据一个实施例,层级图构建器对层级图的构建还基于层级结构中的每个节点与其他节点之间的计算关系710。参考图5D,例如对于节点504,可以存储节点504与其他节点之间的计算关系为:“与节点504对应的行=与节点502对应的行×2”,或者“×2”。对于节点508,可以存储节点508与其他节点之间的计算关系为:“与节点508对应的单元格=与节点506对应的单元格×2”,或者“×2”。应注意,在一个节点与其他节点的计算关系710中仅存储了该节点的计算公式中包括的运算符或运算符的组合的情况下,可以结合该节点所依赖的节点708而推 导出该节点的完整的计算公式,从而能够在避免信息损失的情况下优化对存储空间的利用。此时,在推导节点的完整的计算公式时所利用的依赖关系不包括通过步骤S640新获得的依赖关系。即,对于通过编辑器所获取的节点之间的依赖关系,在推导节点的计算公式时不利用这些节点的祖先节点之间的依赖关系。此外,针对层级结构中的部分节点可以不存储该节点和其他节点的计算关系(例如,与该节点对应的单元格的内容可以直接由原始数据填充,而不是由其他节点计算得到,比如图4A中的行节点“手机”、“笔记本”和“平板电脑”)。
图8A是根据本公开的一些实施例的示例性的数据面板800A的框图。数据面板800A可以是与编辑器独立的部件。数据面板800A可以是如图1A所示的数据面板120的一个示例。如图8A所示,数据面板800A可以包括原始数据获取组件810、待填充数据检测组件820和数据匹配组件830。虽然图8A例示了上述三个单元,但这仅仅是数据面板800A的示意性结构,数据面板800A还可以包括比所示出的更多或更少的单元,或者可以包括上述三个单元的组合单元。
原始数据获取组件810可以被配置为提供与原始数据的来源的接口。根据一个实施例,原始数据获取组件810可以包括以下组件中的一个或多个:智能数据提取组件,被配置为从数据文件(例如,Excel文件、txt文件等)中自动识别原始数据;数据库接口组件,被配置为从数据库(例如,Bloomberg等专业财经数据库)导入原始数据;检索接口组件,被配置为从外部数据源(例如,搜索引擎、电子出版物、博客等)检索原始数据;手动输入接收组件,被配置为接收用户输入的原始数据。根据一个实施例,手动输入接收组件可以允许用户在图形用户界面编辑器中的电子表格预览模块(例如,电子表格预览模块140)中直接输入数据。根据一个实施例,用户可以针对从智能数据提取组件、数据库接口组件和检索接口组件中的一个或多个得到的数据进行手动修改。根据一个实施例,可以利用数据溯源组件来记录数据面板中输入的原始数据的来源。例如,数据溯源组件可以记录数据文件的名称和/或位置、数据库名称、外部数据源的名称和输入数据的用户名中的一个或多个。根据一个实施例,可以将数据面板800A中输入的原始数据存储在数据存储装置中,并且数据存储装置中存储的原始数据可以被调用或导出。原始数据获取组件810可以被配置为识别每个原始数据项的语义信息,原始数据项是数据文件中相对独立的数据单元,原始数据项的语义信息可以是描述该原始数据项的一个字符串列表,例如,一个原始数据项“123.45”的语义信息可以是一个字符串列表“[“2019”,“收入”]”。根据一个实施例,用户可 以将数据文件拖拽到或以其它方式导入到数据面板800A中,然后智能数据提取组件可以自动识别出数据文件中的原始数据每个原始数据项的语义信息。
待填充数据检测组件820可以被配置成检测层级结构的多个节点中需要输入原始数据的节点以及该节点中对原始数据的要求(例如,该节点是否需要输入原始数据,以及需要输入的原始数据的类型)。根据一个实施例,待填充数据检测组件820可以基于检测到编辑器中的用于指定不同层级的节点的组件中包含特定的预定义的公式(例如,=SOURCE()或=INPUT()),来确定与该节点对应的一个或多个单元格需要输入原始数据,并根据与该节点的元数据和/或层级结构(例如,该节点包括的行节点的数量、列节点的数量、单元格节点的数量等)来确定对原始数据的要求。用户还可以指定原始数据的其他特性,例如精确度等。
数据匹配组件830可以被配置成基于原始数据获取组件810获取的原始数据以及由待填充数据检测组件820所检测到的需要输入原始数据的节点以及该节点中对原始数据的要求将需要输入原始数据的节点与获取的原始数据相匹配。数据匹配组件830可以被配置为将匹配成功的原始数据填充至与之匹配的需要输入原始数据的节点中。在一些实现中,如果有多个原始数据项与同一个需要输入原始数据的节点相匹配,则允许用户选择填充至该需要输入原始数据的节点中的原始数据项。在另一些实现中,允许用户直接(例如,通过键盘)输入数据以填充至需要输入原始数据的节点中。
数据面板800A可以可选地包括数据填充图形用户界面840。在一些实现中,可以通过电子表格生成模块来生成待填充的数据表格,并显示在图形用户界面上,从而可以实时显示数据匹配与填充结果,以及允许用户更加直观地对需要输入原始数据的节点进行填充。其中该待填充的数据表格可以是Excel文件或其他电子表格文件,也可以是txt文件或网页的一部分或者任何其他合适的文件格式。
图8B是根据本公开的一些实施例的示例性的数据面板的图形用户界面840。图形用户界面840可以包括通过转译器和渲染器生成的(例如,网页形式的)待填充的数据表格831。图形用户界面840还可以包括通过原始数据获取组件导入的(例如,pdf格式的)原始数据文件的视图811、以及智能数据提取组件对该原始数据文件的解析结果的视图812。根据一个实施例,智能数据提取组件被配置为解析从数据文件中识别的原始数据中的每个原始数据项的语义信息以生成解析后的数据,并且在数据文件、由智能数据提取组件解析后的数据和待填充的数据表格中填充的数据中的一者的数据项被选中时,数据文件、由智能数据提取组件解析后的数据和待填充的数据表格中填 充的数据中的另外两者中的相应的数据项可以被高亮显示。如图8B所示,在视图812中每个原始数据项都对应与之匹配的行名称和列名称,例如原始数据项“265,595”对应语义信息[“Net Sales”,“September 29”,“2018”]。待填充的数据表格831中背景为深灰色的单元格表示待填充数据检测组件检测出的不需要填充数据的单元格(例如,这些单元格的数据需要根据其他单元格填充的原始数据计算得到),仅背景为白色或浅蓝色的单元格需要填充数据。区域833中是数据匹配组件830自动匹配并填充的数据,在数据填充图形用户界面上用黑色字体表示,例如,原始数据的数据项“265,595”被自动填充至行“Sales”和列“2018”交叉位置处的单元格,并用黑色字体显示。根据一个实施例,可以用不同的显示格式区分不同来源或者对应于不同预定义公式的原始数据,例如,在单元格835中用加下划线的数字以及浅蓝色的背景表示用户手动输入的数据,在与三个单元格对应的区域834中用黑色斜体数字表示对应于预定义公式“=INPUT()”而非“=SOURCE()”的单元格的数据。图8B中的图形用户界面840包括数据溯源功能,即点击待填充的数据表格831中的任何一个数据项,则可以在视图811和812中分别高亮显示与之匹配的一个或多个原始数据项和解析数据项。类似的,点击视图811中的任何一个原始数据项,则在视图812和待填充的数据表格831中分别高亮显示与之匹配的解析数据项和填充数据项;点击视图812中的任何一个解析数据项,则在视图811和待填充的数据表格831中分别高亮显示与之匹配的原始数据项和填充数据项。
图9A是示出根据本公开的一些实施例的示例性的用于生成电子表格的方法900A的流程图。虽然图9A例示了方法900A的三个步骤,但这仅仅是用于生成电子表格的方法的示意性流程,用于生成电子表格的方法900A还可以包括比所示出的步骤更多或更少的步骤,或者可以包括上述三个步骤中任意步骤的组合步骤。此外,方法900A中的一些步骤可以同时发生或者按照与所示出的顺序不同的顺序发生。
方法900A从步骤S910开始,步骤S910可以由图8A的待填充数据检测组件820执行。在步骤S910处,检测层级结构中的多个节点中需要输入原始数据的节点以及节点中对原始数据的要求。
方法900A前进到步骤S920,步骤S920可以由转译器执行。在步骤S920处,转译器基于电子表格的层级结构、元数据、所检测到的需要输入原始数据的节点以及节点中对原始数据的要求来生成待填充的电子表格。
方法900A前进到步骤S930,在步骤S930处,基于原始数据来填充待填充的电子表格以生成电子表格。
图9B是示出根据本公开的一些实施例的示例性的用于生成电子表格的方法900B的流程图。图9B是示出根据本公开的一些实施例的示例性的用于生成电子表格的方法900B的流程图。虽然图9B例示了方法900B的两个步骤,但这仅仅是用于生成电子表格的方法的示意性流程,用于生成电子表格的方法900B还可以包括比所示出的步骤更多或更少的步骤,或者可以包括上述两个步骤中任意步骤的组合步骤。此外,方法900B中的步骤可以同时发生或者按照与所示出的顺序不同的顺序发生。根据一个实施例,方法900B可以在方法900A的步骤S910~S930对待填充的数据项进行填充后进行。根据另一个实施例,方法900B可以在方法900A的步骤S910~S930之前进行,仅生成电子表格中的公式。根据一个实施例,方法900B可以由电子表格生成模块的转译器执行。
方法900B从步骤S901开始,在步骤S901处,对于层级结构中的多个节点中的每个节点:基于层级结构来确定与该节点对应的一个或多个单元格在电子表格中的位置。
方法900B前进到步骤S902,在步骤S902处,基于原始数据、该节点的层级类型、该节点的元数据、该节点所依赖的节点、以及该节点的计算关系中的一者或多者来填充与该节点对应的一个或多个单元格的内容。
根据一个实施例,可以针对层级结构中的层级类型为“页”的所有节点,在电子表格中添加相应的页。根据一个实施例,可以针对层级结构中的层级类型为“节”的节点,确定每个页中不同层级的标题所在的位置(例如,行坐标和列坐标),并且可以向电子表格中相应位置的单元格中写入标题的内容。根据一个实施例,可以针对层级结构中的层级类型为“表”的节点,确定每个表的最左上角的单元格在电子表格中的位置(例如,行坐标和列坐标),确定表的名称和表的存根在电子表格中的位置,并且向电子表格中相应位置的单元格中写入表名称和存根的内容。根据一个实施例,可以针对每一个“表”节点,根据它的子节点中的“行”节点、“列”节点、“块”节点来确定这个表中的所有行名称和列名称在电子表格中的位置,并向电子表格中的相应位置的单元格中写入行名称和列名称。根据一个实施例,可以针对每一个“表”节点,确定这个表的所有的单元格在电子表格中的位置,以及这些单元格中的内容(例如,数据或公式),并向电子表格中的相应位置的单元格中写入相应的内容(例如,数据或公式)。应理解,这些描述仅仅是示例,还可以按任何其他合适的顺序和 方式来填充单元格,只要保证所生成的电子表格与所获取的层级结构、相应节点的元数据、原始数据、及计算关系保持一致即可。
图10是根据本公开的一些实施例的示例性的电子表格生成模块1000的框图。电子表格生成模块1000可以是如图1所示的电子表格生成模块130的一个示例。如图10所示,电子表格生成模块1000可以包括转译器1010和渲染器1020。虽然图10例示了上述两个单元,但这仅仅是电子表格生成模块1000的示意性结构,电子表格生成模块1000还可以包括比所示出的更多或更少的单元,或者可以包括上述两个单元的组合单元。
根据一个实施例,转译器1010可以被配置为基于由数据面板获得的原始数据或至少基于由层级图构建器获取的一个或多个第一单元格中的每个第一单元格与一个或多个第二单元格中的每个第二单元格之间的计算关系来生成一个或多个第一单元格中的每个第一单元格中的数据或公式。如上所述,根据一个实施例,转译器1010可以被配置为基于数据匹配组件830的数据匹配结果生成填充有数据的电子表格。根据一个实施例,转译器1010可以被配置为:对于层级结构中的多个节点中的每个节点,基于层级结构来确定与该节点对应的一个或多个单元格在电子表格中的位置;以及基于原始数据、该节点的层级类型、该节点的元数据、该节点所依赖的节点、以及该节点的计算关系中的一者或多者来填充与该节点对应的一个或多个单元格的内容。
在经过图6所示的步骤S630后,如果与一个单元格对应的节点的计算关系为系统预设公式“=SOURCE()”或“=INPUT()”,则表明这个单元格的内容为经由数据面板获得的与该单元格匹配的原始数据项。在经过图6所示的步骤S630后,如果得到一个单元格节点与其他一个或多个单元格节点的计算关系,则可以根据该单元格节点与其他一个或多个单元格节点的计算关系以及与该单元格节点对应的单元格在电子表格中的位置以及其他一个多个单元格节点对应的单元格在电子表格中的位置生成与该单元格节点对应的单元格在电子表格中的公式。例如,可以将单元格节点A与行节点B的计算关系“单元格A=行B.sum()“转化为单元格A与隶属于行B的每个单元格的计算关系:“单元格A=sum(行B中的每一个单元格)。假如行B包括三个单元格,经由图9B中的步骤S901确定的这三个单元格在电子表格中的位置分别为“E10,F10,G10”,经由步骤S901确定的单元格节点A在电子表格中的位置为“D5”,则可以确定生成的电子表格的单元格D5的内容为公式“=SUM(E10:G10)”。
渲染器1020可以被配置为根据用于指定一个或多个第一单元格的格式的信息来在电子表格中设定该一个或多个第一单元格的格式。根据一个实施例,渲染器1020可以被配置为根据层级结构中的多个节点中的每个节点所在层级的层级类型、该节点的格式的信息、和该节点对应的一个或多个单元格的内容中的一者或多者来自动设定与该节点对应的一个或多个单元格的格式。例如,根据一个节点的层级类型为列,该节点的元数据中包括利用修饰器组件对该节点设定的“列格式1”,则渲染器1020可以将与该节点对应的列的列名称所在的单元格的格式设定为与“列格式1”对应的格式(例如,黑色背景、白色加粗字体、四号字等)。再例如,根据一个节点的层级类型为行,该节点的元数据中包括利用修饰器组件对该节点设定的“行格式2”,则渲染器1020可以将与该节点对应的行的行名称及该行所包括的每一个单元格的格式设定为与“行格式2”相对应的格式(例如,斜体、下划线、四号字、蓝色字体、数字两位有效数字、千分位符等)。再例如,应理解,根据一些实施例,(例如,在编辑器不包括修饰器组件的情况下)也可以基于任何合适的预定义的规则来自动设定单元格的格式。根据一个实施例,渲染器1020可以执行以下各项中的一个或多个:根据标题的层级来为不同层级的标题自动设定不同的格式,自动设定表的数据头的格式,根据列的级别自动设定表中不同列的格式、根据行的级别自动设定表中不同行的格式、根据单元格中的内容来自动设定不同单元格的格式。根据一个实施例,可以根据单元格中的数据的来源来设定单元格的格式,例如,用户手动输入的数据加下划线显示并加浅蓝色背景,从数据库中提取的数据用黑色斜体显示,其他原始数据用灰色显示等。根据一个实施例,可以根据单元格中的内容来设定单元格的格式,比如内容为公式的单元格设置为黑色字体,跨页公式设置为绿色字体,出现错误的单元格用大红色字体等。
如上所述,根据一个实施例,电子表格预览模块(例如,图1A的电子表格预览模块140以及图4D中的4020)可以被配置为使所生成的电子表格被显示。
图11A至图11D示出了根据本公开的一些实施例的示例性的所显示的电子表格1100A-1100D。电子表格1100A-1100D可以是例如根据图4A所示的图形用户界面编辑器中的输入以及原始数据(未示出)来生成的。应理解,电子表格1100A-1100D还可以是基于任何其他类型的编辑器中的输入来生成的。现在参考图4A来描述电子表格1100A-1100D的生成过程。
数据面板的待填充数据检测组件(例如,图8A的待填充数据检测组件820)可以检测到图4A中的行节点“手机”、行节点“笔记本”、行节点“平板电脑”对应的单 元格需要输入原始数据,然后可以基于这些行节点的父亲节点(即,表节点“销售额”)包括十个列,来确定在与行节点“手机”、行节点“笔记本”、行节点“平板电脑”对应的单元格中分别需要填充一个行十个列的原始数据(即,每行10个数据,一共30个数据)。而在与行节点“总计”和行节点“平均”对应的单元格中分别不需要填充数据,而是需要填充十个公式,但是这些公式需要引用与行节点“手机”、行节点“笔记本”、行节点“平板电脑”对应的单元格中的原始数据。
转译器(例如,图10所示的转译器1010)可以被配置为基于由图形用户界面编辑器400A获取的层级结构和元数据来生成如图11A所示的待填充的电子表格1100A。虽然在图11A中示出该待填充的电子表格是Excel文件,但是待填充的电子表格1100A还可以是任何其他合适的电子表格文件、txt文件或网页的一部分或者任何其他合适的文件格式。根据一个实施例,可以基于表“销售额”是所在页的第一个表,以及基于表的名称为“销售额”,而在电子表格的最左上角的单元格中填入“销售额”1110。由于该表的数据头包含二级列,所以需要两个行来填充列名称,从而可以将存根“百万元”1120填充到电子表格的第二行至第三行的第一个单元格(A2-A3)合并后的单元格中。基于确定列块“2017”和块“2018”各自包括五个二级列“Q1”、“Q2”、“Q3”、“Q4”、“全年”,可以将列名称1121——“2017”填充到第二行的第2-6个单元格(B2-F2)中,将列名称1122——“2018”填充到第二行的第7-11个单元格(G2-K2)中。在第三行的第2-6个单元格(B3-F3)中可以依次填充列名称1141-1145——“Q1”、“Q2”、“Q3”、“Q4”、“全年”,在第三行的第7-11个单元格(G3-K3)中可以依次填充列名称1151-1155——“Q1”、“Q2”、“Q3”、“Q4”、“全年”。类似地,可以在第4-8行的第一个单元格中依次填充行名称1131-1135——“手机”、“笔记本”、“平板电脑”、“总计”和“平均”。由此,可以生成待填充的数据表格1100A。根据一个实施例,在图4A的图形用户界面编辑器400A中可以输入计算公式:“全年=Q1+Q2+Q3+Q4”。因此,可以用深色底色来填充行“总计”、行“平均”中的单元格以及行“手机”、“笔记本”、“平板电脑”中列名称为“全年”的单元格,以表示这些单元格中不需要填充原始数据,而是需要填充公式。该待填充数据表格1100A可以被用于数据面板800A中的数据填充图形用户界面840。
转译器(例如,图10所示的转译器1010)可以被配置为基于通过数据面板获得的原始数据、以及基于各个节点所依赖的节点、以及各个节点的计算关系来填充该待 填充的数据表格1100A以生成电子表格1100B。根据一个实施例,电子表格1100B中的行“手机”、行“笔记本”、行“平板电脑”中列名称为“Q1”、“Q2”、“Q3”、“Q4”的单元格填充的内容是通过数据面板获得的与这些单元格匹配的原始数据,而行“总计”和行“平均”中填充的内容可以是基于行节点“手机”、行节点“笔记本”、行节点“平板电脑”的每个单元格的计算关系生成的电子表格公式,例如单元格“B7”中的内容是“=SUM(B4:B6)”,单元格B8的内容是“=AVERAGE(B4:B6)。根据一个实施例,可以在图4A的图形用户界面编辑器400A中输入计算公式:“全年=Q1+Q2+Q3+Q4”。在这种情况下,可以仅输入针对位于列名称1141-1144、1151-1154所在列、且位于行名称1131-1133所在行的单元格的原始数据。列名称1145和1155所在列、行名称1134-1135所在行的单元格的内容为公式,比如单元格“F4”中的内容为“=SUM(B4:E4)”。转译器可以被配置为基于填充了电子表格公式的单元格中的公式和原始数据来进一步填充这些单元格的内容(例如,数值结果),从而得到如图11C所示的电子表格1100C。
根据一个实施例,渲染器可以基于在图形用户界面编辑器400A中获得的用于指定一个或多个单元格的格式的信息来设定电子表格1100C中的一个或多个单元格的格式。根据一个实施例,响应于在修饰器组件421中获得的用于行“总计”和行“平均”的格式级别为“行格式3”,可以根据“行格式3”将行名称1134和1135所在的单元格A7和A8设置为黑体、加粗、缩进2个字符,以及将这两行所包括的单元格(B7~K7,B8~K8)的数字格式设置为加粗、两位小数、加千分位符。另外,也可以根据系统预设的默认行格式将行名称1131-1133所在的单元格A4~A6设置为黑体,以及将这三行所包括的单元格(B4~K4,B5~K5,B6~K6)设置为两位小数、加千分位符。根据一个实施例,还可以响应于电子表格中的第一行为表的名称,第二行至第三行为表的数据头,而自动将第一行的单元格的格式设定为加粗、四号字,将第二行至第三行的单元格的格式设定为加粗、四号字、斜体。
图12是示出根据本公开的一些实施例的示例性的用于更新所生成的电子表格的方法1200的流程图。虽然图12例示了方法1200的三个步骤,但这仅仅是用于更新所生成的电子表格的方法的示意性流程,用于更新所生成的电子表格的方法1200还可以包括其他可能的步骤,或者可以包括上述三个步骤中任意步骤的组合步骤。方法1200例如可以由电子表格预览模块执行。
方法1200从步骤S1210开始,在步骤S1210处,显示所生成的电子表格。例如,可以在与用于生成电子表格的装置耦合的显示器上显示所生成的电子表格。
方法1200前进到步骤S1220,在步骤S1220处,接收对层级结构、元数据、原始数据、依赖关系、或计算关系的修改。根据一个实施例,可以利用编辑器来修改层级结构、元数据、依赖关系、或计算关系,例如修改层级结构中的节点的隶属关系或者依赖关系、添加或删除节点、修改节点的语义信息、修改节点的格式信息、改变节点的公式等。根据一个实施例,可以修改存储在数据存储装置中的原始数据。
方法1200前进到步骤S1230,在步骤S1230处,基于对层级结构、元数据、原始数据、依赖关系、或计算关系的修改,更新所显示的电子表格。根据一个实施例,更新后的电子表格与修改后的层级结构、元数据、原始数据、依赖关系、或计算关系对应。例如,响应于将图4A中的行名称“总计”修改为“销售额总计”,可以将图11B所示的电子表格中的行名称1134修改为“销售额总计”。又例如,响应于利用用于指定行节点的组件471在图4A中添加新的行节点“同比增长率”,可以在图11B所示的电子表格1100B中的与行名称“平均”对应的行下方添加新的行。具体而言,可以在第9行第一个单元格中填充行名称“同比增长率”。
图13是示出根据本公开的一些实施例的示例性的用于修改电子表格的方法1300的流程图。虽然图13例示了方法1300的三个步骤,但这仅仅是用于修改电子表格的方法的示意性流程,用于修改电子表格的方法1300还可以包括其他可能的步骤,或者可以包括上述三个步骤中任意步骤的组合步骤。方法1300例如可以由电子表格预览模块执行。
方法1300从步骤S1310开始,在步骤S1310处,显示所生成的电子表格。例如,可以在与用于生成电子表格的装置耦合的显示器上显示所生成的电子表格。
方法1300前进到步骤S1320,在步骤S1320处,接收对所生成的电子表格的修改。根据一个实施例,用户可以在电子表格中添加或删除一个或多个单元格,改变一个或多个单元格的位置,修改一个或多个单元格的名称、标题、标签和批注中的一个或多个,修改一个或多个单元格的格式信息等。例如,用户可以将图11B所示的电子表格中的行名称1134修改为“销售额总计”。又例如,用户可以在图11B所示的电子表格1100B中的与行名称“平均”对应的行下方添加具有行名称“同比增长率”的新的行。
方法1300前进到步骤S1330,在步骤S1330处,将对电子表格的修改转化为对层级结构、元数据、原始数据、依赖关系、或计算关系中的至少一者的修改,并利用编 辑器和数据面板中的至少一者基于该修改来相应地修改层级结构、元数据、原始数据、依赖关系、或计算关系中的至少一者。根据一个实施例,修改后的层级结构、元数据、原始数据、依赖关系和计算关系与修改后的电子表格对应。根据一个实施例,可以利用层级图存储器来存储修改后的层级结构、元数据、依赖关系、或计算关系,还可以将修改后的原始数据存储在数据存储装置中。例如,响应于将图11B所示的电子表格中的行名称1134修改为“销售额总计”,可以将与图4A对应的层级结构中的相应行450的名称“总计”修改为“销售额总计”。又例如,响应于在图11B所示的电子表格1100B中的与行名称“平均”对应的行下方添加具有行名称“同比增长率”的新的行,可以在与图4A对应的层级结构中添加新的行节点“同比增长率”,该行节点“同比增长率”的父亲节点可以是与表“销售额”对应的节点,例如,可以利用用于指定行的组件471自动添加行节点并将编辑器中新增加的行的名称设为“同比增长率”。
根据一个实施例,对层级结构的修改包括对用于指定层级结构中的不同层级的节点的组件的拖拽,以及更新所显示的电子表格包括调整与该节点对应的一个或多个单元格在电子表格中的相对位置以使其与拖拽后的用于指定该节点的组件在图形用户界面编辑器中的相对位置一致。
图14示出了根据本公开的一些实施例的示例性的图形用户编辑器1400。与图4A中的图形用户界面编辑器400A相比,用于指定行节点“平板电脑”的组件440被拖拽到用于指定行节点“笔记本”的组件430的上方。
图15示出了根据本公开的一些实施例的示例性的所显示的电子表格1500。与图11D所示的电子表格1100D相比,电子表格1500被更新。具体而言,调整具有行名称“平板电脑”的行中的单元格在电子表格中的相对位置以使其位于具有行名称“笔记本”的行中的单元格的上方,从而与拖拽后的用于指定行节点“平板电脑”的组件440在图形用户界面编辑器1400中的相对位置一致。
用于生成电子表格的装置还可以包括其他附加功能,以便于用户的操作。根据一个实施例,用于生成电子表格的装置可以包括错误检测模块。错误检测模块可以被配置为:自动检测层级结构、元数据、原始数据、依赖关系、或计算关系中的一者或多者中存在的错误,以及发出警告以提示错误。例如,错误检测模块可以检测到第一单元格中的原始数据为0,而第二单元格的公式可能等于第一单元格的值的倒数,从而错误检测模块可以确定原始数据或第二单元格的公式可能存在错误,从而发出警告。例如,错误检测模块可以检测到行“总计”的公式为“总计=AVEARGE(手机,笔记本, 平板电脑)”,从而检测到该行的语义信息“总计”和该行的运算符“AVERAGE”不符合,从而发出警告。根据一个实施例,用于生成电子表格的装置可以包括智能建议模块。智能建议模块可以被配置为:基于已经获取的层级结构、元数据、原始数据、依赖关系、计算关系和用户已经进行的操作中的一者或多者,预测将要获取的层级结构、元数据、原始数据、依赖关系、计算关系和用户将要进行的操作中的一者或多者;以及提供对将要获取的层级结构、元数据、原始数据、依赖关系、计算关系和用户将要进行的操作中的一者或多者的智能建议结果。用户可以从智能建议结果中直接进行选择,从而可以提高生成电子表格的过程的效率。例如,响应于用户连续定义了具有列名称“2016”、“2017”的两个列,可以预测接下来要添加的列的列名称为“2018”,并且向用户显示智能建议结果。根据一个实施例,可以用不同的显示格式来表示图形用户界面编辑器中的用于指定不同层级的节点的组件中的不同类型的语法单元。例如,可以用不同的颜色或字体等来区分已定义的节点、新定义的节点、公式中的函数名称、节点名称等。
图16是示出根据本公开的一些实施例的示例性的获取用于电子表格的层级结构的方法1600的流程图。虽然图16例示了方法1600的两个步骤,但这仅仅是获取用于电子表格的层级结构的方法的示意性流程,获取用于电子表格的层级结构的方法1600还可以包括其他可能的步骤,或者可以包括上述两个步骤中任意步骤的组合步骤。例如,方法1600可以由编辑器执行,该编辑器可以是文本编辑器。
方法1600从步骤S1610开始,在步骤S1610处,可以接收用户输入的文本代码。该文本代码可以针对本应用场景的领域特定语言来编写,或者使用现有的任何合适的编程语言(例如C、C++、C#、Java、python等)来编写,或者用将来可能开发出来的任何合适的编程语言来编写。根据一个实施例,在一种针对本应用场景的领域特定语言中,用户可以使用关键字BOOK、SHEET、TABLE、HEADER、STUB、ROW以及代码缩进等来指定不同的层级,使用关键字“|”来分隔数据头中的不同列或列块,使用关键字“[ ]”来指定区间,使用关键字“[[ ]]”来定义标签,使用+++、++、+、-、--、---作为修饰器以定义节点的格式等。例如,用户输入的文本代码可以如下所示。
Figure PCTCN2020089642-appb-000005
Figure PCTCN2020089642-appb-000006
用户还可以基于任何预定义的语法规则来编写文本代码。
方法1600前进到步骤S1620,在步骤S1620处,解析文本代码以生成层级结构。根据一个实施例,可以基于预定义的语法规则来解析文本代码。例如,文本编辑器通过解析如上所示的文本代码可以获得与图4A所示的图形用户界面编辑器400A获得的相同的层级结构,在此不再赘述。
如上所述,根据本公开的实施例可以实现电子表格中的层级结构、计算关系和原始数据的分离,生成电子表格的方式可以更加直观、便捷、易于理解和调试,并且兼具灵活性和自动化的特点。此外,根据本公开的实施例可以便于直观便捷地修改电子表格,使得容易复用现有的电子表格模型。
硬件实现
图18示出了根据本公开的一些实施例的其中可应用本公开的一般硬件环境。
参考图18,现在将描述作为可应用于本公开的各方面的硬件设备的示例的计算设备1800。计算设备1800可以是被配置成执行处理和/或计算的任何机器,可以是但不限于工作站、服务器、台式计算机、膝上型计算机、平板计算机、个人数字助理、智能电话、便携式相机或其任意组合。上述装置100A可以整体或至少部分地由计算设备1800或类似的设备或系统来实现。
计算设备1800可以包括能够经由一个或多个接口与总线1802连接或者与总线1802通信的元件。例如,计算设备1800可以包括总线1802、一个或多个处理器1804、一个或多个输入设备1806以及一个或多个输出设备1808。一个或多个处理器1804可 以是任何类型的处理器,并且可以包括但不限于一个或多个通用处理器和/或一个或多个专用处理器(诸如专用处理芯片)。输入设备1806可以是能够向计算设备输入信息的任何类型的设备,并且可以包括但不限于鼠标、键盘、触摸屏、麦克风和/或遥控器。输出设备1808可以是能够呈现信息的任何类型的设备,并且可以包括但不限于显示器、扬声器、视频/音频输出终端和/或打印机。计算设备1800还可以包括非瞬态存储设备1810或与非瞬态存储设备1810连接,非瞬态存储设备1810可以是非瞬态的并且可以实现数据存储库的任何存储设备,并且可以包括但不限于盘驱动器、光学存储设备、固态存储装置、软盘、柔性盘、硬盘、磁带或任何其它磁性介质、紧凑型盘或任何其它光学介质、ROM(只读存储器)、RAM(随机存取存储器)、高速缓存存储器和/或任何其它存储器芯片或盒带、和/或计算机可以从其读取数据、指令和/或代码的任何其它介质。非瞬态存储设备1810可以是可从接口拆卸的。非暂态存储设备1810可以具有用于实现上述方法和步骤的数据/指令/代码。计算设备1800还可以包括通信设备1812。通信设备1812可以是能够与外部装置和/或与网络通信的任何类型的设备或系统,并且可以包括但不限于调制解调器、网络卡、红外通信设备、无线通信装备和/或诸如蓝牙 TM设备、802.11设备、WiFi设备、WiMax设备、蜂窝通信设施等的芯片组。
总线1802可以包括但不限于工业标准体系架构(ISA)总线、微通道体系架构(MCA)总线、增强型ISA(EISA)总线、视频电子标准协会(VESA)本地总线和外围组件互连(PCI)总线。
计算设备1800还可以包括工作存储器1814,工作存储器1814可以是可以存储对处理器1804的工作有用的指令和/或数据的任何类型的工作存储器,并且可以包括但不限于随机存取存储器和/或只读存储器设备。
软件要素可以位于工作存储器1814中,包括但不限于操作系统1816、一个或多个应用程序1818、驱动程序和/或其它数据和代码。用于执行上述方法和步骤的指令可以被包括在一个或多个应用程序1818中,并且上述装置100A的部件可以通过处理器1804读取并执行一个或多个应用程序1818的指令来实现。更具体地,编辑器110可以例如由处理器1804在执行具有执行步骤S110和S120的指令的应用程序1818时实现。数据面板120可以例如由处理器1804在执行具有执行步骤S130的指令的应用程序1818时实现。电子表格生成模块130可以例如由处理器1804在执行具有执行步骤S140的指令的应用程序1818时实现。软件要素的指令的可执行代码或源代码可以存储在非瞬态计算机可读存储介质(诸如上述(一个或多个)存储设备1810)中,并 且可以在可能编译和/或安装的情况下被读入到工作存储器1814中。软件要素的指令的可执行代码或源代码也可以从远程位置下载。
本公开还涉及以下实施例。
实施例1、一种用于自动生成电子表格的计算机实现的方法,所述方法包括:
获取用于所述电子表格的层级结构,其中所述层级结构包括一个或多个层级,所述一个或多个层级具有多个节点,其中每个层级具有至少一个节点并且具有相应的层级类型,每个节点对应于所述电子表格中的一个或多个单元格,其中所述层级结构还包括所述多个节点之间的隶属关系;
获取所述多个节点中的每个节点的元数据;
获取用于所述电子表格的原始数据;以及
至少基于用于所述电子表格的层级结构、所述元数据和所述原始数据来生成所述电子表格。
实施例2、根据实施例1所述的方法,还包括:
针对每个节点存储该节点所在层级的层级类型、该节点的子节点以及该节点的元数据。
实施例3、根据实施例1所述的方法,其中,获取用于所述电子表格的层级结构包括:
提供图形用户界面编辑器,其中所述图形用户界面编辑器包括用于指定不同层级的节点的组件;
接收针对用于指定不同层级的节点的组件的输入;以及
基于所述输入来生成所述层级结构。
实施例4、根据实施例3所述的方法,其中所述电子表格的所述一个或多个层级的层级类型包括以下各项中的一个或多个:工作簿、页、节、表、块、行、列、区间和单元格,其中用于指定不同层级的节点的组件包括以下各项中的一个或多个:用于指定页的组件、用于指定标题的组件、用于指定节的组件、用于指定表的组件、用于指定数据头的组件、用于指定表体的组件、用于指定行的组件、用于指定列的组件、用于指定块的组件、用于指定区间的组件、和用于指定单元格的组件。
实施例5、根据实施例1所述的方法,其中,获取用于所述电子表格的层级结构包括:
接收用户输入的文本代码;以及
解析所述文本代码以生成所述层级结构。
实施例6、根据实施例1所述的方法,其中获取所述多个节点中的每个节点的元数据包括获取描述该节点的具体含义的语义信息。
实施例7、根据实施例6所述的方法,其中,所述语义信息包括标题、名称、标签和批注中的一个或多个。
实施例8、根据实施例1所述的方法,其中:
获取所述多个节点中的每个节点的元数据还包括获取用于指定与该节点对应的一个或多个第一单元格的格式的信息,并且
生成所述电子表格还包括根据用于指定所述一个或多个第一单元格的格式的信息来在所述电子表格中设定所述一个或多个第一单元格的格式。
实施例9、根据实施例8所述的方法,
其中所述用于指定与该节点对应的一个或多个第一单元格的格式的信息包括格式类型,并且
其中用与所述格式类型相对应的格式来设定所述一个或多个第一单元格的格式。
实施例10、根据实施例3所述的方法,其中所述图形用户界面编辑器还包括修饰器组件,所述修饰器组件用于指定与所述层级结构中的节点对应的一个或多个单元格的格式类型。
实施例11、根据实施例9所述的方法,其中通过以下操作来设定与所述格式类型相对应的格式:
显示预定义的文本;
接收用户对预定义的文本的格式的设定;以及
基于用户对预定义的文本的格式的设定来设定与所述格式类型相对应的格式。
实施例12、根据实施例1所述的方法,其中:
获取所述多个节点中的每个节点的元数据还包括获取用于该节点的别名标签或属性标签,其中所述别名标签指定与该节点对应的一个或多个单元格的别名,所述属性标签指定与该节点对应的一个或多个单元格的附加特性。
实施例13、根据实施例1所述的方法,还包括:
获取所述多个节点中的第一节点与另外的一个或多个节点之间的依赖关系。
实施例14、根据实施例13所述的方法,还包括:
至少基于所述第一节点和所述另外的一个或多个节点之间的依赖关系获得对应于所述第一节点的一个或多个第一单元格中的每个第一单元格所对应的节点与对应于所述另外的一个或多个节点的一个或多个第二单元格中的每个第二单元格所对应的节点之间的依赖关系。
实施例15、根据实施例14所述的方法,还包括:
获取所述第一节点与另外的一个或多个节点之间的计算关系;
至少基于所述第一节点与另外的一个或多个节点之间的计算关系来确定对应于所述第一节点的一个或多个第一单元格中的每个第一单元格与对应于所述另外的一个或多个节点的一个或多个第二单元格中的每个第二单元格之间的计算关系。
实施例16、根据实施例15所述的方法,其中生成所述电子表格还包括:
至少基于所述一个或多个第一单元格中的每个第一单元格与所述一个或多个第二单元格中的每个第二单元格之间的计算关系来生成所述一个或多个第一单元格中的每个第一单元格的电子表格公式。
实施例17、根据实施例14所述的方法,还包括:
对于对应于所述第一节点的所述一个或多个第一单元格中的每个单元格所对应的节点,基于该节点与对应于所述另外的一个或多个节点的一个或多个第二单元格中的每个第二单元格所对应的节点之间的依赖关系而确定该节点依赖于与所述一个或多个第二单元格中的第一组第二单元格各自对应的第一组第二节点;以及
建立如下依赖关系:该节点及该节点的所有或部分祖先节点依赖于所述第一组第二节点及所述第一组第二节点的所有或部分祖先节点。
实施例18、根据实施例17所述的方法,还包括针对每个节点存储该节点所依赖的节点和依赖该节点的节点中的至少一个。
实施例19、根据实施例15所述的方法,还包括针对每个节点存储该节点与其他节点之间的计算关系。
实施例20、根据实施例1所述的方法,其中用于电子表格的原始数据是通过以下方式中的一种或多种获取的:
从数据文件中自动识别,
从数据库导入,
从外部数据源检索,以及
由用户输入。
实施例21、根据实施例1所述的方法,还包括:
检测所述多个节点中需要输入原始数据的节点以及所述节点中对原始数据的要求,以及
将所获取的原始数据与所检测到的需要输入原始数据的节点相匹配。
实施例22、根据实施例21所述的方法,其中生成所述电子表格还包括:
基于所述电子表格的层级结构、所述元数据、所检测到的需要输入原始数据的节点以及所述节点中对原始数据的要求来生成待填充的电子表格;以及
基于所述原始数据来填充所述待填充的电子表格以生成所述电子表格。
实施例23、根据实施例22所述的方法,其中:
用于电子表格的原始数据是从数据文件中自动识别的,并且所述方法还包括解析从数据文件中识别的原始数据中的每个原始数据项的语义信息以生成解析后的数据;以及
在所述数据文件、由所述智能数据提取组件解析后的数据和所述待填充的数据表格中填充的数据中的一者的数据项被选中时,所述数据文件、所述解析后的数据和所述待填充的数据表格中填充的数据中的另外两者中的相应的数据项被高亮显示。
实施例24、根据实施例15所述的方法,其中生成所述电子表格包括:
对于所述多个节点中的每个节点:
基于所述层级结构来确定与该节点对应的一个或多个单元格在所述电子表格中的位置;以及
基于所述原始数据、该节点的层级类型、该节点的元数据、该节点所依赖的节点、以及该节点的计算关系中的一者或多者来填充与该节点对应的一个或多个单元格的内容。
实施例25、根据实施例1所述的方法,还包括:
接收指定所述电子表格中的表的位置的操作;
其中生成所述电子表格包括基于所述操作来调整所述表在所述电子表格中的位置。
实施例26、根据实施例1所述的方法,其中生成所述电子表格还包括根据所述多个节点中的每个节点所在的层级的层级类型、该节点的格式信息、和与该节点对应的一个或多个单元格的内容中的一者或多者来自动设定与该节点对应的一个或多个单元格的格式。
实施例27、根据实施例15所述的方法,还包括:
显示所生成的电子表格;
接收对所述层级结构、所述元数据、所述原始数据、所述依赖关系、或所述计算关系的修改;以及
基于对所述层级结构、所述元数据、所述原始数据、所述依赖关系、或所述计算关系的修改,更新所显示的电子表格。
实施例28、根据实施例15所述的方法,还包括:
显示所生成的电子表格;
接收对所显示的电子表格的修改;以及
将对电子表格的修改转化为对所述层级结构、所述元数据、所述原始数据、所述依赖关系、或所述计算关系中的至少一者的修改,并基于该修改来相应地修改所述层级结构、所述元数据、所述原始数据、所述依赖关系、或所述计算关系中的至少一者。
实施例29、根据实施例27所述的方法,
其中通过图形用户界面编辑器来获取用于所述电子表格的层级结构,并且所述图形用户界面编辑器包括用于指定不同层级的节点的组件;
其中对所述层级结构的修改包括对用于指定所述层级结构中的第三节点的组件的拖拽;以及
其中更新所显示的电子表格包括调整与所述第三节点对应的一个或多个单元格在所述电子表格中的相对位置以使其与拖拽后的用于指定所述第三节点的组件在所述图形用户界面编辑器中的相对位置一致。
实施例30、根据实施例15所述的方法,还包括:
自动检测所述层级结构、所述元数据、所述原始数据、所述依赖关系和所述计算关系中的一者或多者中存在的错误;以及
发出警告以提示所述错误。
实施例31、根据实施例15所述的方法,还包括:
基于已经获取的所述层级结构、所述元数据、所述原始数据、所述依赖关系、所述计算关系、以及用户已经进行的操作中的一者或多者,预测将要获取的所述层级结构、所述元数据、所述原始数据、所述依赖关系、所述计算关系、以及用户将要进行的操作中的一者或多者;以及
提供对将要获取的所述层级结构、所述元数据、所述原始数据、、所述依赖关系、所述计算关系、以及用户将要进行的操作中的一者或多者的智能建议结果。
实施例32、根据实施例3所述的方法,其中用不同的显示格式来表示用于指定不同层级的节点的组件中的不同类型的语法单元。
实施例33、根据实施例17所述的方法,还包括:
对所述层级结构中的所述多个节点中的至少部分节点以及所述部分节点与所述多个节点中的其他节点之间的依赖关系进行可视化。
实施例34、根据实施例1所述的方法,其中获取用于所述电子表格的层级结构还包括:
导入用于所述层级结构中的一个或多个节点的模板。
实施例35、一种用于自动生成电子表格的装置,所述装置包括:
编辑器,所述编辑器被配置为获取用于所述电子表格的层级结构,其中所述层级结构包括一个或多个层级,所述一个或多个层级具有多个节点,其中每个层级具有至少一个节点并且具有相应的层级类型,每个节点对应于所述电子表格中的一个或多个单元格,其中所述层级结构还包括所述多个节点之间的隶属关系,并且所述编辑器还被配置为获取所述多个节点中的每个节点的元数据;
数据面板,所述数据面板被配置为获取用于所述电子表格的原始数据;
电子表格生成模块,所述电子表格生成模块被配置为至少基于用于所述电子表格的层级结构、所述元数据和所述原始数据来生成所述电子表格。
实施例36、根据实施例35所述的装置,还包括层级图构建器和层级图存储器,其中所述层级图构建器被配置为基于所述多个节点中的每个节点所在层级的层级类型、该节点的子节点以及该节点的元数据来构建用于所述电子表格的层级图,并且所述层级图存储器被配置为存储所述层级图。
实施例37、根据实施例35所述的装置,其中,所述编辑器包括图形用户界面编辑器,其中所述图形用户界面编辑器包括用于指定不同层级的节点的组件,并且其中所述图形用户界面编辑器还被配置为:
接收针对用于指定不同层级的节点的组件的输入;以及
基于所述输入来生成所述层级结构。
实施例38、根据实施例37所述的装置,其中所述电子表格的所述一个或多个层级的层级类型包括以下各项中的一个或多个:工作簿、页、节、表、块、行、列、区间和单元格,其中用于指定不同层级的节点的组件包括以下各项中的一个或多个:用于指定页的组件、用于指定标题的组件、用于指定节的组件、用于指定表的组件、用 于指定数据头的组件、用于指定表体的组件、用于指定行的组件、用于指定列的组件、用于指定块的组件、用于指定区间的组件、和用于指定单元格的组件。
实施例39、根据实施例35所述的装置,其中,所述编辑器包括文本编辑器,所述文本编辑器被配置为:
接收用户输入的文本代码;以及
解析所述文本代码以生成所述层级结构。
实施例40、根据实施例35所述的装置,其中获取所述多个节点中的每个节点的元数据包括获取描述该节点的具体含义的语义信息。
实施例41、根据实施例40所述的装置,其中,所述语义信息包括标题、名称、标签和批注中的一个或多个。
实施例42、根据实施例35所述的装置,其中:
所述编辑器还包括修饰器组件,所述修饰器组件被配置为获取用于指定与所述多个节点中的每个节点对应的一个或多个第一单元格的格式的信息,并且
其中所述电子表格生成模块包括渲染器,所述渲染器被配置为根据用于指定所述一个或多个第一单元格的格式的信息来在所述电子表格中设定所述一个或多个第一单元格的格式。
实施例43、根据实施例42所述的装置,
其中用于指定所述一个或多个第一单元格的格式的信息包括格式类型,并且
其中所述渲染器被配置为用与所述格式类型相对应的格式来设定所述一个或多个第一单元格的格式。
实施例44、根据实施例37所述的装置,其中所述图形用户界面编辑器还包括修饰器组件,所述修饰器组件用于指定与所述层级结构中的节点对应的一个或多个单元格的格式类型。
实施例45、根据实施例43所述的装置,还包括格式设定组件,所述格式设定组件被配置为通过以下操作来设定与所述格式类型相对应的格式:
显示预定义的文本;
接收用户对预定义的文本的格式的设定;以及
基于用户对预定义的文本的格式的设定来设定所述格式类型相对应的格式。
实施例46、根据实施例35所述的装置,其中:
所述编辑器还包括标签组件,所述标签组件被配置为获取用于每个节点的别名标签或属性标签,其中所述别名标签指定与该节点对应的一个或多个单元格的别名,所述属性标签指定与该节点对应的一个或多个单元格的附加特性。
实施例47、根据实施例35所述的装置,其中:
所述编辑器还包括依赖关系定义组件,所述依赖关系定义组件被配置为获取所述多个节点中的第一节点与另外的一个或多个节点之间的依赖关系。
实施例48、根据实施例47所述的装置,其中所述层级图构建器被配置为:
至少基于所述第一节点和所述另外的一个或多个节点之间的依赖关系获得对应于所述第一节点的一个或多个第一单元格中的每个第一单元格所对应的节点与对应于所述另外的一个或多个节点的一个或多个第二单元格中的每个第二单元格所对应的节点之间的依赖关系。
实施例49、根据实施例48所述的装置,还包括计算关系定义组件,
其中所述计算关系定义组件被配置为获取所述第一节点与另外的一个或多个节点之间的计算关系;并且
其中所述层级图构建器还被配置为至少基于所述第一节点与另外的一个或多个节点之间的计算关系来确定对应于所述第一节点的一个或多个第一单元格中的每个第一单元格与对应于所述另外的一个或多个节点的一个或多个第二单元格中的每个第二单元格之间的计算关系。
实施例50、根据实施例49所述的装置,其中所述电子表格生成模块还包括转译器,所述转译器被配置为:
至少基于所述一个或多个第一单元格中的每个第一单元格与所述一个或多个第二单元格中的每个第二单元格之间的计算关系来生成所述一个或多个第一单元格中的每个第一单元格的电子表格公式。
实施例51、根据实施例48所述的装置,其中所述层级图构建器还被配置为:
对于对应于所述第一节点的所述一个或多个第一单元格中的每个单元格所对应的节点,基于该节点与对应于所述另外的一个或多个节点的一个或多个第二单元格中的每个第二单元格所对应的节点之间的依赖关系而确定该节点依赖于与所述一个或多个第二单元格中的第一组第二单元格各自对应的第一组第二节点;以及
建立如下依赖关系:该节点及该节点的所有或部分祖先节点依赖于所述第一组第二节点及所述第一组第二节点的所有或部分祖先节点。
实施例52、根据实施例51所述的装置,其中构建所述层级图还基于所述多个节点中的每个节点所依赖的节点。
实施例53、根据实施例49所述的装置,其中构建所述层级图还基于所述多个节点中的每个节点与其他节点之间的计算关系。
实施例54、根据实施例35所述的装置,其中所述数据面板包括原始数据获取组件,所述原始数据获取组件包括以下组件中的一个或多个:
智能数据提取组件,被配置为从数据文件中自动识别原始数据,
数据库接口组件,被配置为从数据库导入原始数据,
检索接口组件,被配置为从外部数据源检索原始数据,以及
手动输入接收组件,被配置为接收用户输入的原始数据。
实施例55、根据实施例54所述的装置,
其中所述数据面板还包括:
待填充数据检测组件,所述待填充数据检测组件被配置为检测所述多个节点中需要输入原始数据的节点以及所述节点中对原始数据的要求;以及
数据匹配组件,所述数据匹配组件被配置为将原始数据获取组件获取的原始数据与由待填充数据检测组件所检测到的需要输入原始数据的节点相匹配。
实施例56、根据实施例55所述的装置,
其中电子表格生成模块包括:
转译器,被配置为基于所述电子表格的层级结构、所述元数据、所检测到的需要输入原始数据的节点以及所述节点中对原始数据的要求来生成待填充的电子表格,并且基于所述原始数据来填充所述待填充的电子表格以生成所述电子表格。
实施例57、根据实施例56所述的装置,其中:
所述原始数据获取组件包括所述智能数据提取组件,并且所述智能数据提取组件被配置为解析从数据文件中识别的原始数据中的每个原始数据项的语义信息以生成解析后的数据;以及
在所述数据文件、由所述智能数据提取组件解析后的数据和所述待填充的数据表格中填充的数据中的一者的数据项被选中时,所述数据文件、由所述智能数据提取组件解析后的数据和所述待填充的数据表格中填充的数据中的另外两者中的相应的数据项被高亮显示。
实施例58、根据实施例49所述的装置,其中所述电子表格生成模块包括转译器,所述转译器被配置为:
对于所述多个节点中的每个节点:
基于所述层级结构来确定与该节点对应的一个或多个单元格在所述电子表格中的位置;以及
基于所述原始数据、该节点的层级类型、该节点的元数据、该节点所依赖的节点、以及该节点的计算关系中的一者或多者来填充与该节点对应的一个或多个单元格的内容。
实施例59、根据实施例35所述的装置,
其中所述编辑器还被配置为接收指定所述电子表格中的表的位置的操作;并且
其中所述电子表格生成模块还被配置为基于所述操作来调整所述表在所述电子表格中的位置。
实施例60、根据实施例35所述的装置,其中所述电子表格生成模块包括渲染器,所述渲染器被配置为根据所述多个节点中的每个节点所在的层级的层级类型、该节点的格式信息、和与该节点对应的一个或多个单元格的内容中的一者或多者来自动设定与该节点对应的一个或多个单元格的格式。
实施例61、根据实施例49所述的装置,还包括电子表格预览模块,所述电子表格预览模块被配置为:
使所生成的电子表格被显示;
接收对所述层级结构、所述元数据、所述原始数据、所述依赖关系或所述计算关系的修改;以及
基于对所述层级结构、所述元数据、所述原始数据、所述依赖关系或所述计算关系的修改,更新所显示的电子表格。
实施例62、根据实施例49所述的装置,还包括电子表格预览模块,所述电子表格预览模块被配置为:
使所生成的电子表格被显示;
接收对所显示的电子表格的修改;以及
将对电子表格的修改转化为对所述层级结构、所述元数据、所述原始数据、所述依赖关系和所述计算关系中的至少一者的修改,并利用所述编辑器和所述数据面板中 的至少一者基于所述修改来相应地修改所述层级结构、所述元数据、所述原始数据、所述依赖关系和所述计算关系中的至少一者。
实施例63、根据实施例61所述的装置,还包括图形用户界面编辑器,所述图形用户界面编辑器被配置为获取用于所述电子表格的层级结构,并且所述图形用户界面编辑器包括用于指定不同层级的节点的组件;
其中对所述层级结构的修改包括对用于指定所述层级结构中的第三节点的组件的拖拽;以及
其中更新所显示的电子表格包括调整与所述第三节点对应的一个或多个单元格在所述电子表格中的相对位置以使其与拖拽后的用于指定所述第三节点的组件在所述图形用户界面编辑器中的相对位置一致。
实施例64、根据实施例49所述的装置,还包括错误检测模块,所述错误检测模块被配置为:
自动检测所述层级结构、所述元数据、所述原始数据、所述依赖关系和所述计算关系中的一者或多者中存在的错误;以及
发出警告以提示所述错误。
实施例65、根据实施例49所述的装置,还包括智能建议模块,其中所述智能建议模块被配置为:
基于已经获取的所述层级结构、所述元数据、所述原始数据、所述依赖关系、所述计算关系和用户已经进行的操作中的一者或多者,预测将要获取的所述层级结构、所述元数据、所述原始数据、所述依赖关系、所述计算关系和用户将要进行的操作中的一者或多者;以及
提供对将要获取的所述层级结构、所述元数据、所述原始数据、所述依赖关系、所述计算关系和用户将要进行的操作中的一者或多者的智能建议结果。
实施例66、根据实施例37所述的装置,其中用不同的显示格式来表示用于指定不同层级的节点的组件中的不同类型的语法单元。
实施例67、根据实施例51所述的装置,还包括可视化模块,其中所述可视化模块被配置为:
对所述层级结构中的所述多个节点中的至少部分节点以及所述部分节点与所述多个节点中的其他节点之间的依赖关系进行可视化。
实施例68、根据实施例35所述的装置,其中所述编辑器还包括导入模板的组件,所述导入模板的组件被配置为:
导入用于所述层级结构中的一个或多个节点的模板。
实施例69、一种用于自动生成电子表格的装置,包括:用于执行如实施例1-34中的任一项所述的方法的步骤的部件。
实施例70、一种用于自动生成电子表格的设备,包括:
至少一个处理器;以及
至少一个存储设备,所述至少一个存储设备存储有指令,当所述指令由所述至少一个处理器执行时使得所述至少一个处理器执行如实施例1-34中的任一项所述的方法。
实施例71、一种非瞬态计算机可读存储介质,存储有指令,当所述指令由处理器执行时使得执行如实施例1-34中的任一项所述的方法。
从上述实施例中,本领域技术人员可以清楚地知晓,可以通过软件及必要的硬件来实现本公开,或者可以通过硬件、固件等来实现本公开。基于这种理解,可以部分地以软件形式来实现本公开的实施例。计算机软件可以存储在计算机的可读存储介质中,比如软盘、硬盘、光盘或闪存中。计算机软件包括使得计算机(例如个人计算机、服务站或网络终端)运行根据本公开的各个实施例的方法或其一部分的一系列指令。
已经这样描述了本公开,清楚的是,本公开可以以许多种方式变化。这些变化不被视为背离了本公开的精神和范围,而是对于本领域技术人员而言显而易见的所有这种修改意欲被包括在以下权利要求的范围中。

Claims (71)

  1. 一种用于自动生成电子表格的计算机实现的方法,所述方法包括:
    获取用于所述电子表格的层级结构,其中所述层级结构包括一个或多个层级,所述一个或多个层级具有多个节点,其中每个层级具有至少一个节点并且具有相应的层级类型,每个节点对应于所述电子表格中的一个或多个单元格,其中所述层级结构还包括所述多个节点之间的隶属关系;
    获取所述多个节点中的每个节点的元数据;
    获取用于所述电子表格的原始数据;以及
    至少基于用于所述电子表格的层级结构、所述元数据和所述原始数据来生成所述电子表格。
  2. 根据权利要求1所述的方法,还包括:
    针对每个节点存储该节点所在层级的层级类型、该节点的子节点以及该节点的元数据。
  3. 根据权利要求1所述的方法,其中,获取用于所述电子表格的层级结构包括:
    提供图形用户界面编辑器,其中所述图形用户界面编辑器包括用于指定不同层级的节点的组件;
    接收针对用于指定不同层级的节点的组件的输入;以及
    基于所述输入来生成所述层级结构。
  4. 根据权利要求3所述的方法,其中所述电子表格的所述一个或多个层级的层级类型包括以下各项中的一个或多个:工作簿、页、节、表、块、行、列、区间和单元格,其中用于指定不同层级的节点的组件包括以下各项中的一个或多个:用于指定页的组件、用于指定标题的组件、用于指定节的组件、用于指定表的组件、用于指定数据头的组件、用于指定表体的组件、用于指定行的组件、用于指定列的组件、用于指定块的组件、用于指定区间的组件、和用于指定单元格的组件。
  5. 根据权利要求1所述的方法,其中,获取用于所述电子表格的层级结构包括:
    接收用户输入的文本代码;以及
    解析所述文本代码以生成所述层级结构。
  6. 根据权利要求1所述的方法,其中获取所述多个节点中的每个节点的元数据包括获取描述该节点的具体含义的语义信息。
  7. 根据权利要求6所述的方法,其中,所述语义信息包括标题、名称、标签和批注中的一个或多个。
  8. 根据权利要求1所述的方法,其中:
    获取所述多个节点中的每个节点的元数据还包括获取用于指定与该节点对应的一个或多个第一单元格的格式的信息,并且
    生成所述电子表格还包括根据用于指定所述一个或多个第一单元格的格式的信息来在所述电子表格中设定所述一个或多个第一单元格的格式。
  9. 根据权利要求8所述的方法,
    其中所述用于指定与该节点对应的一个或多个第一单元格的格式的信息包括格式类型,并且
    其中用与所述格式类型相对应的格式来设定所述一个或多个第一单元格的格式。
  10. 根据权利要求3所述的方法,其中所述图形用户界面编辑器还包括修饰器组件,所述修饰器组件用于指定与所述层级结构中的节点对应的一个或多个单元格的格式类型。
  11. 根据权利要求9所述的方法,其中通过以下操作来设定与所述格式类型相对应的格式:
    显示预定义的文本;
    接收用户对预定义的文本的格式的设定;以及
    基于用户对预定义的文本的格式的设定来设定与所述格式类型相对应的格式。
  12. 根据权利要求1所述的方法,其中:
    获取所述多个节点中的每个节点的元数据还包括获取用于该节点的别名标签或属性标签,其中所述别名标签指定与该节点对应的一个或多个单元格的别名,所述属性标签指定与该节点对应的一个或多个单元格的附加特性。
  13. 根据权利要求1所述的方法,还包括:
    获取所述多个节点中的第一节点与另外的一个或多个节点之间的依赖关系。
  14. 根据权利要求13所述的方法,还包括:
    至少基于所述第一节点和所述另外的一个或多个节点之间的依赖关系获得对应于所述第一节点的一个或多个第一单元格中的每个第一单元格所对应的节点与对应于所述另外的一个或多个节点的一个或多个第二单元格中的每个第二单元格所对应的节点之间的依赖关系。
  15. 根据权利要求14所述的方法,还包括:
    获取所述第一节点与另外的一个或多个节点之间的计算关系;
    至少基于所述第一节点与另外的一个或多个节点之间的计算关系来确定对应于所述第一节点的一个或多个第一单元格中的每个第一单元格与对应于所述另外的一个或多个节点的一个或多个第二单元格中的每个第二单元格之间的计算关系。
  16. 根据权利要求15所述的方法,其中生成所述电子表格还包括:
    至少基于所述一个或多个第一单元格中的每个第一单元格与所述一个或多个第二单元格中的每个第二单元格之间的计算关系来生成所述一个或多个第一单元格中的每个第一单元格的电子表格公式。
  17. 根据权利要求14所述的方法,还包括:
    对于对应于所述第一节点的所述一个或多个第一单元格中的每个单元格所对应的节点,基于该节点与对应于所述另外的一个或多个节点的一个或多个第二单元格中的每个第二单元格所对应的节点之间的依赖关系而确定该节点依赖于与所述一个或多个第二单元格中的第一组第二单元格各自对应的第一组第二节点;以及
    建立如下依赖关系:该节点及该节点的所有或部分祖先节点依赖于所述第一组第二节点及所述第一组第二节点的所有或部分祖先节点。
  18. 根据权利要求17所述的方法,还包括针对每个节点存储该节点所依赖的节点和依赖该节点的节点中的至少一个。
  19. 根据权利要求15所述的方法,还包括针对每个节点存储该节点与其他节点之间的计算关系。
  20. 根据权利要求1所述的方法,其中用于电子表格的原始数据是通过以下方式中的一种或多种获取的:
    从数据文件中自动识别,
    从数据库导入,
    从外部数据源检索,以及
    由用户输入。
  21. 根据权利要求1所述的方法,还包括:
    检测所述多个节点中需要输入原始数据的节点以及所述节点中对原始数据的要求,以及
    将所获取的原始数据与所检测到的需要输入原始数据的节点相匹配。
  22. 根据权利要求21所述的方法,其中生成所述电子表格还包括:
    基于所述电子表格的层级结构、所述元数据、所检测到的需要输入原始数据的节点以及所述节点中对原始数据的要求来生成待填充的电子表格;以及
    基于所述原始数据来填充所述待填充的电子表格以生成所述电子表格。
  23. 根据权利要求22所述的方法,其中:
    用于电子表格的原始数据是从数据文件中自动识别的,并且所述方法还包括解析从数据文件中识别的原始数据中的每个原始数据项的语义信息以生成解析后的数据;
    以及
    在所述数据文件、由所述智能数据提取组件解析后的数据和所述待填充的数据表格中填充的数据中的一者的数据项被选中时,所述数据文件、所述解析后的数据和所述待填充的数据表格中填充的数据中的另外两者中的相应的数据项被高亮显示。
  24. 根据权利要求15所述的方法,其中生成所述电子表格包括:
    对于所述多个节点中的每个节点:
    基于所述层级结构来确定与该节点对应的一个或多个单元格在所述电子表格
    中的位置;以及
    基于所述原始数据、该节点的层级类型、该节点的元数据、该节点所依赖的
    节点、以及该节点的计算关系中的一者或多者来填充与该节点对应的一个或多个
    单元格的内容。
  25. 根据权利要求1所述的方法,还包括:
    接收指定所述电子表格中的表的位置的操作;
    其中生成所述电子表格包括基于所述操作来调整所述表在所述电子表格中的位置。
  26. 根据权利要求1所述的方法,其中生成所述电子表格还包括根据所述多个节点中的每个节点所在的层级的层级类型、该节点的格式信息、和与该节点对应的一个或多个单元格的内容中的一者或多者来自动设定与该节点对应的一个或多个单元格的格式。
  27. 根据权利要求15所述的方法,还包括:
    显示所生成的电子表格;
    接收对所述层级结构、所述元数据、所述原始数据、所述依赖关系、或所述计算关系的修改;以及
    基于对所述层级结构、所述元数据、所述原始数据、所述依赖关系、或所述计算关系的修改,更新所显示的电子表格。
  28. 根据权利要求15所述的方法,还包括:
    显示所生成的电子表格;
    接收对所显示的电子表格的修改;以及
    将对电子表格的修改转化为对所述层级结构、所述元数据、所述原始数据、所述依赖关系、或所述计算关系中的至少一者的修改,并基于该修改来相应地修改所述层级结构、所述元数据、所述原始数据、所述依赖关系、或所述计算关系中的至少一者。
  29. 根据权利要求27所述的方法,
    其中通过图形用户界面编辑器来获取用于所述电子表格的层级结构,并且所述图形用户界面编辑器包括用于指定不同层级的节点的组件;
    其中对所述层级结构的修改包括对用于指定所述层级结构中的第三节点的组件的拖拽;以及
    其中更新所显示的电子表格包括调整与所述第三节点对应的一个或多个单元格在所述电子表格中的相对位置以使其与拖拽后的用于指定所述第三节点的组件在所述图形用户界面编辑器中的相对位置一致。
  30. 根据权利要求15所述的方法,还包括:
    自动检测所述层级结构、所述元数据、所述原始数据、所述依赖关系和所述计算关系中的一者或多者中存在的错误;以及
    发出警告以提示所述错误。
  31. 根据权利要求15所述的方法,还包括:
    基于已经获取的所述层级结构、所述元数据、所述原始数据、所述依赖关系、所述计算关系、以及用户已经进行的操作中的一者或多者,预测将要获取的所述层级结构、所述元数据、所述原始数据、所述依赖关系、所述计算关系、以及用户将要进行的操作中的一者或多者;以及
    提供对将要获取的所述层级结构、所述元数据、所述原始数据、、所述依赖关系、所述计算关系、以及用户将要进行的操作中的一者或多者的智能建议结果。
  32. 根据权利要求3所述的方法,其中用不同的显示格式来表示用于指定不同层级的节点的组件中的不同类型的语法单元。
  33. 根据权利要求17所述的方法,还包括:
    对所述层级结构中的所述多个节点中的至少部分节点以及所述部分节点与所述多个节点中的其他节点之间的依赖关系进行可视化。
  34. 根据权利要求1所述的方法,其中获取用于所述电子表格的层级结构还包括:
    导入用于所述层级结构中的一个或多个节点的模板。
  35. 一种用于自动生成电子表格的装置,所述装置包括:
    编辑器,所述编辑器被配置为获取用于所述电子表格的层级结构,其中所述层级结构包括一个或多个层级,所述一个或多个层级具有多个节点,其中每个层级具有至少一个节点并且具有相应的层级类型,每个节点对应于所述电子表格中的一个或多个单元格,其中所述层级结构还包括所述多个节点之间的隶属关系,并且所述编辑器还被配置为获取所述多个节点中的每个节点的元数据;
    数据面板,所述数据面板被配置为获取用于所述电子表格的原始数据;
    电子表格生成模块,所述电子表格生成模块被配置为至少基于用于所述电子表格的层级结构、所述元数据和所述原始数据来生成所述电子表格。
  36. 根据权利要求35所述的装置,还包括层级图构建器和层级图存储器,其中所述层级图构建器被配置为基于所述多个节点中的每个节点所在层级的层级类型、该节点的子节点以及该节点的元数据来构建用于所述电子表格的层级图,并且所述层级图存储器被配置为存储所述层级图。
  37. 根据权利要求35所述的装置,其中,所述编辑器包括图形用户界面编辑器,其中所述图形用户界面编辑器包括用于指定不同层级的节点的组件,并且其中所述图形用户界面编辑器还被配置为:
    接收针对用于指定不同层级的节点的组件的输入;以及
    基于所述输入来生成所述层级结构。
  38. 根据权利要求37所述的装置,其中所述电子表格的所述一个或多个层级的层级类型包括以下各项中的一个或多个:工作簿、页、节、表、块、行、列、区间和单 元格,其中用于指定不同层级的节点的组件包括以下各项中的一个或多个:用于指定页的组件、用于指定标题的组件、用于指定节的组件、用于指定表的组件、用于指定数据头的组件、用于指定表体的组件、用于指定行的组件、用于指定列的组件、用于指定块的组件、用于指定区间的组件、和用于指定单元格的组件。
  39. 根据权利要求35所述的装置,其中,所述编辑器包括文本编辑器,所述文本编辑器被配置为:
    接收用户输入的文本代码;以及
    解析所述文本代码以生成所述层级结构。
  40. 根据权利要求35所述的装置,其中获取所述多个节点中的每个节点的元数据包括获取描述该节点的具体含义的语义信息。
  41. 根据权利要求40所述的装置,其中,所述语义信息包括标题、名称、标签和批注中的一个或多个。
  42. 根据权利要求35所述的装置,其中:
    所述编辑器还包括修饰器组件,所述修饰器组件被配置为获取用于指定与所述多个节点中的每个节点对应的一个或多个第一单元格的格式的信息,并且
    其中所述电子表格生成模块包括渲染器,所述渲染器被配置为根据用于指定所述一个或多个第一单元格的格式的信息来在所述电子表格中设定所述一个或多个第一单元格的格式。
  43. 根据权利要求42所述的装置,
    其中用于指定所述一个或多个第一单元格的格式的信息包括格式类型,并且
    其中所述渲染器被配置为用与所述格式类型相对应的格式来设定所述一个或多个第一单元格的格式。
  44. 根据权利要求37所述的装置,其中所述图形用户界面编辑器还包括修饰器组件,所述修饰器组件用于指定与所述层级结构中的节点对应的一个或多个单元格的格式类型。
  45. 根据权利要求43所述的装置,还包括格式设定组件,所述格式设定组件被配置为通过以下操作来设定与所述格式类型相对应的格式:
    显示预定义的文本;
    接收用户对预定义的文本的格式的设定;以及
    基于用户对预定义的文本的格式的设定来设定所述格式类型相对应的格式。
  46. 根据权利要求35所述的装置,其中:
    所述编辑器还包括标签组件,所述标签组件被配置为获取用于每个节点的别名标签或属性标签,其中所述别名标签指定与该节点对应的一个或多个单元格的别名,所述属性标签指定与该节点对应的一个或多个单元格的附加特性。
  47. 根据权利要求35所述的装置,其中:
    所述编辑器还包括依赖关系定义组件,所述依赖关系定义组件被配置为获取所述多个节点中的第一节点与另外的一个或多个节点之间的依赖关系。
  48. 根据权利要求47所述的装置,其中所述层级图构建器被配置为:
    至少基于所述第一节点和所述另外的一个或多个节点之间的依赖关系获得对应于所述第一节点的一个或多个第一单元格中的每个第一单元格所对应的节点与对应于所述另外的一个或多个节点的一个或多个第二单元格中的每个第二单元格所对应的节点之间的依赖关系。
  49. 根据权利要求48所述的装置,还包括计算关系定义组件,
    其中所述计算关系定义组件被配置为获取所述第一节点与另外的一个或多个节点之间的计算关系;并且
    其中所述层级图构建器还被配置为至少基于所述第一节点与另外的一个或多个节点之间的计算关系来确定对应于所述第一节点的一个或多个第一单元格中的每个第一 单元格与对应于所述另外的一个或多个节点的一个或多个第二单元格中的每个第二单元格之间的计算关系。
  50. 根据权利要求49所述的装置,其中所述电子表格生成模块还包括转译器,所述转译器被配置为:
    至少基于所述一个或多个第一单元格中的每个第一单元格与所述一个或多个第二单元格中的每个第二单元格之间的计算关系来生成所述一个或多个第一单元格中的每个第一单元格的电子表格公式。
  51. 根据权利要求48所述的装置,其中所述层级图构建器还被配置为:
    对于对应于所述第一节点的所述一个或多个第一单元格中的每个单元格所对应的节点,基于该节点与对应于所述另外的一个或多个节点的一个或多个第二单元格中的每个第二单元格所对应的节点之间的依赖关系而确定该节点依赖于与所述一个或多个第二单元格中的第一组第二单元格各自对应的第一组第二节点;以及
    建立如下依赖关系:该节点及该节点的所有或部分祖先节点依赖于所述第一组第二节点及所述第一组第二节点的所有或部分祖先节点。
  52. 根据权利要求51所述的装置,其中构建所述层级图还基于所述多个节点中的每个节点所依赖的节点。
  53. 根据权利要求49所述的装置,其中构建所述层级图还基于所述多个节点中的每个节点与其他节点之间的计算关系。
  54. 根据权利要求35所述的装置,其中所述数据面板包括原始数据获取组件,所述原始数据获取组件包括以下组件中的一个或多个:
    智能数据提取组件,被配置为从数据文件中自动识别原始数据,
    数据库接口组件,被配置为从数据库导入原始数据,
    检索接口组件,被配置为从外部数据源检索原始数据,以及
    手动输入接收组件,被配置为接收用户输入的原始数据。
  55. 根据权利要求54所述的装置,
    其中所述数据面板还包括:
    待填充数据检测组件,所述待填充数据检测组件被配置为检测所述多个节点
    中需要输入原始数据的节点以及所述节点中对原始数据的要求;以及
    数据匹配组件,所述数据匹配组件被配置为将原始数据获取组件获取的原始
    数据与由待填充数据检测组件所检测到的需要输入原始数据的节点相匹配。
  56. 根据权利要求55所述的装置,
    其中电子表格生成模块包括:
    转译器,被配置为基于所述电子表格的层级结构、所述元数据、所检测到的
    需要输入原始数据的节点以及所述节点中对原始数据的要求来生成待填充的电子
    表格,并且基于所述原始数据来填充所述待填充的电子表格以生成所述电子表格。
  57. 根据权利要求56所述的装置,其中:
    所述原始数据获取组件包括所述智能数据提取组件,并且所述智能数据提取组件被配置为解析从数据文件中识别的原始数据中的每个原始数据项的语义信息以生成解析后的数据;以及
    在所述数据文件、由所述智能数据提取组件解析后的数据和所述待填充的数据表格中填充的数据中的一者的数据项被选中时,所述数据文件、由所述智能数据提取组件解析后的数据和所述待填充的数据表格中填充的数据中的另外两者中的相应的数据项被高亮显示。
  58. 根据权利要求49所述的装置,其中所述电子表格生成模块包括转译器,所述转译器被配置为:
    对于所述多个节点中的每个节点:
    基于所述层级结构来确定与该节点对应的一个或多个单元格在所述电子表格
    中的位置;以及
    基于所述原始数据、该节点的层级类型、该节点的元数据、该节点所依赖的
    节点、以及该节点的计算关系中的一者或多者来填充与该节点对应的一个或多个
    单元格的内容。
  59. 根据权利要求35所述的装置,
    其中所述编辑器还被配置为接收指定所述电子表格中的表的位置的操作;并且
    其中所述电子表格生成模块还被配置为基于所述操作来调整所述表在所述电子表格中的位置。
  60. 根据权利要求35所述的装置,其中所述电子表格生成模块包括渲染器,所述渲染器被配置为根据所述多个节点中的每个节点所在的层级的层级类型、该节点的格式信息、和与该节点对应的一个或多个单元格的内容中的一者或多者来自动设定与该节点对应的一个或多个单元格的格式。
  61. 根据权利要求49所述的装置,还包括电子表格预览模块,所述电子表格预览模块被配置为:
    使所生成的电子表格被显示;
    接收对所述层级结构、所述元数据、所述原始数据、所述依赖关系或所述计算关系的修改;以及
    基于对所述层级结构、所述元数据、所述原始数据、所述依赖关系或所述计算关系的修改,更新所显示的电子表格。
  62. 根据权利要求49所述的装置,还包括电子表格预览模块,所述电子表格预览模块被配置为:
    使所生成的电子表格被显示;
    接收对所显示的电子表格的修改;以及
    将对电子表格的修改转化为对所述层级结构、所述元数据、所述原始数据、所述依赖关系和所述计算关系中的至少一者的修改,并利用所述编辑器和所述数据面板中的至少一者基于所述修改来相应地修改所述层级结构、所述元数据、所述原始数据、所述依赖关系和所述计算关系中的至少一者。
  63. 根据权利要求61所述的装置,还包括图形用户界面编辑器,所述图形用户界面编辑器被配置为获取用于所述电子表格的层级结构,并且所述图形用户界面编辑器包括用于指定不同层级的节点的组件;
    其中对所述层级结构的修改包括对用于指定所述层级结构中的第三节点的组件的拖拽;以及
    其中更新所显示的电子表格包括调整与所述第三节点对应的一个或多个单元格在所述电子表格中的相对位置以使其与拖拽后的用于指定所述第三节点的组件在所述图形用户界面编辑器中的相对位置一致。
  64. 根据权利要求49所述的装置,还包括错误检测模块,所述错误检测模块被配置为:
    自动检测所述层级结构、所述元数据、所述原始数据、所述依赖关系和所述计算关系中的一者或多者中存在的错误;以及
    发出警告以提示所述错误。
  65. 根据权利要求49所述的装置,还包括智能建议模块,其中所述智能建议模块被配置为:
    基于已经获取的所述层级结构、所述元数据、所述原始数据、所述依赖关系、所述计算关系和用户已经进行的操作中的一者或多者,预测将要获取的所述层级结构、所述元数据、所述原始数据、所述依赖关系、所述计算关系和用户将要进行的操作中的一者或多者;以及
    提供对将要获取的所述层级结构、所述元数据、所述原始数据、所述依赖关系、所述计算关系和用户将要进行的操作中的一者或多者的智能建议结果。
  66. 根据权利要求37所述的装置,其中用不同的显示格式来表示用于指定不同层级的节点的组件中的不同类型的语法单元。
  67. 根据权利要求51所述的装置,还包括可视化模块,其中所述可视化模块被配置为:
    对所述层级结构中的所述多个节点中的至少部分节点以及所述部分节点与所述多个节点中的其他节点之间的依赖关系进行可视化。
  68. 根据权利要求35所述的装置,其中所述编辑器还包括导入模板的组件,所述导入模板的组件被配置为:
    导入用于所述层级结构中的一个或多个节点的模板。
  69. 一种用于自动生成电子表格的装置,包括:用于执行如权利要求1-34中的任一项所述的方法的步骤的部件。
  70. 一种用于自动生成电子表格的设备,包括:
    至少一个处理器;以及
    至少一个存储设备,所述至少一个存储设备存储有指令,当所述指令由所述至少一个处理器执行时使得所述至少一个处理器执行如权利要求1-34中的任一项所述的方法。
  71. 一种非瞬态计算机可读存储介质,存储有指令,当所述指令由处理器执行时使得执行如权利要求1-34中的任一项所述的方法。
PCT/CN2020/089642 2019-10-15 2020-05-11 用于自动生成电子表格的方法、装置、设备及存储介质 WO2021073077A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910978565.XA CN110738037B (zh) 2019-10-15 2019-10-15 用于自动生成电子表格的方法、装置、设备及存储介质
CN201910978565.X 2019-10-15

Publications (1)

Publication Number Publication Date
WO2021073077A1 true WO2021073077A1 (zh) 2021-04-22

Family

ID=69269010

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/089642 WO2021073077A1 (zh) 2019-10-15 2020-05-11 用于自动生成电子表格的方法、装置、设备及存储介质

Country Status (2)

Country Link
CN (1) CN110738037B (zh)
WO (1) WO2021073077A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114547314A (zh) * 2022-04-25 2022-05-27 北京安华金和科技有限公司 一种基于主从表的数据分类分级方法和系统
CN116029264A (zh) * 2023-02-01 2023-04-28 上海谐振半导体科技有限公司 一种ate测试数据转换方法及系统

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110738037B (zh) * 2019-10-15 2021-02-05 深圳逻辑汇科技有限公司 用于自动生成电子表格的方法、装置、设备及存储介质
CN111813789B (zh) * 2020-06-03 2024-04-19 新奥数能科技有限公司 数据配置方法、装置、计算机可读存储介质及电子设备
CN113268964B (zh) * 2020-07-23 2022-01-18 腾讯科技(深圳)有限公司 一种表格编辑方法、装置、设备及存储介质
CN111709220B (zh) * 2020-08-18 2020-11-13 广东电网有限责任公司东莞供电局 一种配网供电倒闸操作系统及方法
CN112528613A (zh) * 2020-12-21 2021-03-19 金蝶软件(中国)有限公司 一种数据表生成方法及其相关设备
CN112765947A (zh) * 2021-01-22 2021-05-07 平安资产管理有限责任公司 表格渲染显示方法、装置、计算机设备和存储介质
CN113657274B (zh) * 2021-08-17 2022-09-20 北京百度网讯科技有限公司 表格生成方法、装置、电子设备及存储介质
CN114371894B (zh) * 2021-12-08 2023-11-17 贵州开放大学(贵州职业技术学院) 一种管理元数据的方法

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1755668A (zh) * 2004-09-30 2006-04-05 微软公司 对数据表格起作用的电子表格函数的设计
CN101258486A (zh) * 2005-09-09 2008-09-03 微软公司 用于创建电子表格数据汇总表的用户界面
US20140082470A1 (en) * 2012-09-19 2014-03-20 4Clicks Solutions, LLC Spreadtree hierarchy system for spreadsheets and related methods
CN107111639A (zh) * 2014-12-18 2017-08-29 起元技术有限责任公司 构建报表
CN109766381A (zh) * 2018-12-29 2019-05-17 福建华闽通达信息技术有限公司 一种工程评定数据自动引用的方法
CN110738037A (zh) * 2019-10-15 2020-01-31 深圳逻辑汇科技有限公司 用于自动生成电子表格的方法、装置、设备及存储介质

Family Cites Families (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7415481B2 (en) * 2004-09-30 2008-08-19 Microsoft Corporation Method and implementation for referencing of dynamic data within spreadsheet formulas
US7984371B2 (en) * 2005-02-18 2011-07-19 Andrew Joseph Zdenek Method and system for the graphical modeling of data and calculations of a spreadsheet
US8095866B2 (en) * 2005-09-09 2012-01-10 Microsoft Corporation Filtering user interface for a data summary table
US7480675B2 (en) * 2005-09-09 2009-01-20 Microsoft Corporation Automated placement of fields in a data summary table
US8577704B2 (en) * 2007-12-10 2013-11-05 Modelsheet Software, Llc Automatically generating formulas based on parameters of a model
US20090265624A1 (en) * 2008-04-18 2009-10-22 Reiji Fukuda Electronic forms preparing and managing system, electronic forms preparing and managing program, and program storing memory media
US8326892B2 (en) * 2008-05-30 2012-12-04 Schneider Electric USA, Inc. Methods and systems for automatic conversion of a utility monitoring system layout into a storage format
IT1393542B1 (it) * 2009-03-30 2012-04-27 Milano Politecnico Foto-rivelatore e metodo per rivelare una radiazione ottica
CN101706716B (zh) * 2009-09-08 2013-04-03 南京师范大学 基于vo的表单定制配置与解析运行方法
CN101794280B (zh) * 2010-03-11 2011-07-27 北京中科辅龙计算机技术股份有限公司 一种基于表格模板集的表格自动生成方法及系统
CN103257959A (zh) * 2012-02-15 2013-08-21 深圳市金蝶友商电子商务服务有限公司 生成电子表格报表的方法和装置
CN103559292A (zh) * 2013-11-07 2014-02-05 大连东方之星信息技术有限公司 一种自定义动态创建并显示多级表格的方法
CN103605747B (zh) * 2013-11-20 2017-10-27 北京国双科技有限公司 文件表单的处理方法和装置
WO2015113301A1 (en) * 2014-01-30 2015-08-06 Microsoft Technology Licensing, Llc Automatic insights for spreadsheets
US9785637B2 (en) * 2014-03-18 2017-10-10 Google Inc. System and method for computing, applying, and displaying document deltas
CN105573610B (zh) * 2014-10-14 2019-01-18 珠海金山办公软件有限公司 一种电子表格操作方法及装置
CN106776509A (zh) * 2016-11-16 2017-05-31 武汉飞博科技有限公司 一种电子表单生成方法及装置
CN108595397A (zh) * 2018-04-09 2018-09-28 重庆塞尔特科技有限公司 一种自动生成报告的方法
CN109800401A (zh) * 2018-12-25 2019-05-24 北京数知科技股份有限公司 信息报表自动生成方法及装置
CN110032373B (zh) * 2019-04-12 2022-05-06 国网山东省电力公司淄博供电公司 面向对象的表格功能通用实现方法
CN110287473A (zh) * 2019-06-28 2019-09-27 北京字节跳动网络技术有限公司 电子表格编辑方法及装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1755668A (zh) * 2004-09-30 2006-04-05 微软公司 对数据表格起作用的电子表格函数的设计
CN101258486A (zh) * 2005-09-09 2008-09-03 微软公司 用于创建电子表格数据汇总表的用户界面
US20140082470A1 (en) * 2012-09-19 2014-03-20 4Clicks Solutions, LLC Spreadtree hierarchy system for spreadsheets and related methods
CN107111639A (zh) * 2014-12-18 2017-08-29 起元技术有限责任公司 构建报表
CN109766381A (zh) * 2018-12-29 2019-05-17 福建华闽通达信息技术有限公司 一种工程评定数据自动引用的方法
CN110738037A (zh) * 2019-10-15 2020-01-31 深圳逻辑汇科技有限公司 用于自动生成电子表格的方法、装置、设备及存储介质

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114547314A (zh) * 2022-04-25 2022-05-27 北京安华金和科技有限公司 一种基于主从表的数据分类分级方法和系统
CN114547314B (zh) * 2022-04-25 2022-07-05 北京安华金和科技有限公司 一种基于主从表的数据分类分级方法和系统
CN116029264A (zh) * 2023-02-01 2023-04-28 上海谐振半导体科技有限公司 一种ate测试数据转换方法及系统

Also Published As

Publication number Publication date
CN110738037A (zh) 2020-01-31
CN110738037B (zh) 2021-02-05

Similar Documents

Publication Publication Date Title
WO2021073077A1 (zh) 用于自动生成电子表格的方法、装置、设备及存储介质
JP6185127B2 (ja) 電子文書の検索方法及び電子文書検索のグラフィカル表示方法
US7673235B2 (en) Method and apparatus for utilizing an object model to manage document parts for use in an electronic document
WO2021073195A1 (zh) 生成电子表格公式的计算机实现的方法、设备和存储介质
US20070061703A1 (en) Method and apparatus for annotating a document
CN110728124B (zh) 用于可视化电子表格的方法、装置、设备及存储介质
US20130290837A1 (en) Method and Apparatus for Correcting Document Formatting Based on Source Document
JPWO2005098663A1 (ja) 情報管理装置
CN115309298B (zh) 基于富文本编辑器的文本结构化方法及装置、介质及设备
CN116468010A (zh) 报表生成方法、装置、终端及存储介质
US20220229973A1 (en) Interactive tool for modifying an automatically generated electronic form
US11977722B2 (en) Interactive patent visualization systems and methods
US10241899B2 (en) Test input information search device and method
JPWO2006001392A1 (ja) 文書処理方法および装置
CN114207598A (zh) 电子表单表转换
JP4736089B2 (ja) 情報処理装置ならびにファイルデータマージ方法およびファイル名称付与方法
CN115935915A (zh) 文档处理方法、计算机设备、存储介质
US20200301930A1 (en) Support system, storage medium, and method for presenting relationships of items
JPWO2006137564A1 (ja) 文書処理装置
JPWO2005098698A1 (ja) 文書処理装置
CN110457659B (zh) 条款文档生成方法及终端设备
US20240111944A1 (en) System and Method for Annotation-Based Document Management
KR102499832B1 (ko) 쿼리 바인딩 기능을 구비한 온라인 보고서 작성 시스템
CN118035303A (zh) 一种数据查询方法、装置及存储介质
CN117874379A (zh) 基于SpreadJS技术的多报表的数据校验方法及装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20876864

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 180822)

122 Ep: pct application non-entry in european phase

Ref document number: 20876864

Country of ref document: EP

Kind code of ref document: A1