CN112800371A - Method and device for processing spreadsheet data in web page - Google Patents

Method and device for processing spreadsheet data in web page Download PDF

Info

Publication number
CN112800371A
CN112800371A CN202110134879.9A CN202110134879A CN112800371A CN 112800371 A CN112800371 A CN 112800371A CN 202110134879 A CN202110134879 A CN 202110134879A CN 112800371 A CN112800371 A CN 112800371A
Authority
CN
China
Prior art keywords
form application
web form
data
web
file
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202110134879.9A
Other languages
Chinese (zh)
Inventor
李为
卢道和
林挺
尹强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
WeBank Co Ltd
Original Assignee
WeBank Co Ltd
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 WeBank Co Ltd filed Critical WeBank Co Ltd
Priority to CN202110134879.9A priority Critical patent/CN112800371A/en
Publication of CN112800371A publication Critical patent/CN112800371A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/177Editing, e.g. inserting or deleting of tables; using ruled lines
    • G06F40/18Editing, e.g. inserting or deleting of tables; using ruled lines of spreadsheets
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The invention discloses a method and a device for processing spreadsheet data in a web page, wherein the method comprises the following steps: the browser sends a web page acquisition request to a server, receives a hypertext markup language file sent by the server, acquires a web form application through an inline frame of an HTML file, and loads the web form application into a web page, wherein the web form application is used for processing spreadsheet data. Because the HTML file is a language for making the web page, the obtained web form application can run on the web page, wherein the web form application is used for processing the spreadsheet data, so that the data can be managed and analyzed in a form of a table on the web page.

Description

Method and device for processing spreadsheet data in web page
Technical Field
The invention relates to the field of financial technology (Fintech), in particular to a method and a device for processing spreadsheet data in a web page.
Background
With the development of computer technology, more and more technologies (such as block chains, cloud computing or big data) are applied in the financial field, the traditional financial industry is gradually changing to the financial technology, and big data technology is no exception, but higher requirements are also put forward on big data technology due to the security and real-time requirements of the financial and payment industries.
At present, data is generally managed in a form of electronic forms, such as excel software, for better management of data, however, electronic forms similar to excel software can only be applied to a local server and cannot be applied to a web front end. The front end of the web is any operation interface, such as a browser, for directly making a communication with a user.
Therefore, a method for managing data of a web front end is needed, which is implemented to process data in a form of a table at the web front end.
Disclosure of Invention
The embodiment of the invention provides a method and a device for processing spreadsheet data in a web page, which are used for realizing the management and analysis of the data in a form of a table on the web page.
In a first aspect, an embodiment of the present invention provides a method for processing spreadsheet data in a web page, including:
the browser sends a web page acquisition request to a server; the browser receives a hypertext Markup Language (HTML) file sent by the server side;
the browser acquires a web form application through an inline frame of the HTML file and loads the web form application into a web page; the web form application is for processing spreadsheet data.
In the technical scheme, the HTML file is a language for making the web page, so that the obtained web form application can run on the web page, wherein the web form application is used for processing the spreadsheet data, and the data can be managed and analyzed on the web page in a form of a form.
Optionally, after the loading the web form application into the web page, the method further includes:
the browser receives an import request triggered by a user through the web form application;
the browser reads a file corresponding to the import request;
the browser presents the file in a spreadsheet of the web form application through the web form application.
In the technical scheme, a user can trigger an import request in a web form application, the import request is a file to be imported selected by the user, then a browser reads the file corresponding to the import request and displays the file in the web form application, and the file corresponding to the import request is displayed on the web page through the web form application, so that data is displayed on the web page in a form of a form.
Optionally, the browser displays the file in a spreadsheet of the web form application through the web form application, including:
the web form application associating metadata of content types with metadata of style types in the file;
aiming at the content type metadata and the style type metadata which have an association relationship, the web form application determines the display position of the content type metadata in the electronic form, and renders and displays the content type metadata in the electronic form according to the display position according to the style type metadata.
In the technical scheme, the web table application is not limited to displaying the table data and can also display the text data by performing the association processing on the metadata, the types of the data to be rendered are increased, and the metadata are respectively indexed according to the content type metadata and the style type metadata which are divided into the content type metadata and the style type metadata, so that the accuracy and the richness of the rendered data are increased without being limited to the content of only the rendered metadata.
Optionally, the receiving, by the browser, an import request triggered by the user through the web form application includes:
the web form application receives a user-triggered file selection request;
the web form application, upon determining that a file in the file selection request includes a plurality of worksheets, presenting an index of the plurality of worksheets;
the web form application receiving a user-triggered worksheet selection request;
the browser reads the file corresponding to the import request, and the method comprises the following steps:
and the browser reads the worksheet corresponding to the worksheet selection request through the web form application.
In the technical scheme, when the web form application determines that the file in the file selection request comprises a plurality of worksheets, only the indexes of the worksheets are displayed, and the data in the worksheets are not directly displayed, so that the data analysis resources of the browser are reduced, and the efficiency of displaying the data on the web page is improved.
Optionally, the browser displays the file in a spreadsheet of the web form application through the web form application, including:
and when the web form application determines that the address corresponding to the import request comprises a preset address, reading a file according to a preset reading rule, and displaying the file in an electronic form of the web form application.
According to the technical scheme, the authority of the user can be controlled through the preset reading rule, so that an illegal user is prevented from stealing the protection data of other systems, the data of other systems can be directly rendered into the spreadsheet according to the reading rule, the user does not need to select the data by himself, the process of selecting by the user is reduced, and the data loading time is shortened.
Optionally, after the browser displays the file in the spreadsheet of the web form application through the web form application, the browser further includes:
the web form application receives a data screening request triggered by a user;
and the web form application processes and displays the data in the electronic form according to the data screening request.
In the technical scheme, the web form application processes the data through the data screening request triggered by the user and then displays the processed data, so that the humanized management of the data in the form of the form on the web page is promoted.
Optionally, the data filtering request is determined by selecting a filtering option in the web form application; each screening option is stored in the form of an independent variable.
In the above technical solution, each filtering option in the web form application is stored in an independent variable form, that is, data corresponding to each filtering option is stored in an independent variable form, so that differences between data corresponding to each filtering option can be determined, so as to determine a portion of the spreadsheet where data changes.
Optionally, the displaying, by the web form application, the processed data in the electronic form according to the data filtering request includes:
the web form application determines a part of the electronic form, in which data change occurs, according to the data screening request;
and the web table application re-renders and displays the part with the changed data.
In the technical scheme, each screening option in the web form application is stored in an independent variable form, which is equivalent to that corresponding data has certain difference among the screening options, and is stored in an independent variable form, so that when a user selects a plurality of screening options and the screening options are increased or reduced, only the part with data change is re-rendered and displayed in the spreadsheet, the calculation amount of the web form application is reduced, the calculation resources of the web form application are saved, and the time for the web form application to load data is shortened.
Optionally, after the loading the web form application into the web page, the method further includes:
the web form application generates an operation record of a user in the web form application;
and the web table application re-renders the electronic table in the web table application through the operation record according to the undo operation of the user.
Optionally, after the loading the web form application into the web page, the method further includes:
the web form application acquires an operation template loading request triggered by a user; the operation template loading request comprises an operation template recorded with at least one operation;
the web form application re-renders the spreadsheet in the web form application according to the operation template.
In the technical scheme, the user can re-render the spreadsheet in the web form application according to the operation template and/or operation so as to improve the management capability of data on the web page.
Optionally, the file is a local file where the browser is located or a remote file of the server.
In a second aspect, an embodiment of the present invention provides an apparatus for processing spreadsheet data within a web page, including:
the communication module is used for sending a web page acquisition request to the server; receiving a hypertext markup language (HTML) file sent by the server;
the processing module is used for acquiring a web form application through an inline frame of the HTML file and loading the web form application into a web page; the web form application is for processing spreadsheet data.
Optionally, the processing module is further configured to:
controlling the communication module to receive an import request triggered by a user through the web form application;
reading a file corresponding to the import request;
the file is presented by the web form application in a spreadsheet of the web form application.
Optionally, the processing module is specifically configured to:
associating metadata of a content type with metadata of a style type in the file;
and aiming at the content type metadata and the style type metadata which have the association relationship, determining the display position of the content type metadata in the electronic form, and rendering and displaying the content type metadata in the electronic form according to the display position according to the style type metadata.
Optionally, the processing module is specifically configured to:
controlling the communication module to receive a file selection request triggered by a user;
when the file in the file selection request is determined to comprise a plurality of worksheets, presenting indexes of the worksheets;
controlling the communication module to receive a worksheet selection request triggered by a user;
and reading the worksheet corresponding to the worksheet selection request.
Optionally, the processing module is further configured to:
and when the address corresponding to the import request is determined to comprise a preset address, reading a file according to a preset reading rule, and displaying the file in an electronic form of the web form application.
Optionally, the processing module is further configured to:
after the file is displayed in an electronic form of the web form application through the web form application, controlling the communication module to receive a data screening request triggered by a user;
and processing and displaying the data in the electronic form according to the data screening request.
Optionally, the data filtering request is determined by selecting a filtering option in the web form application; each screening option is stored in the form of an independent variable.
Optionally, the processing module is specifically configured to:
determining a part of the spreadsheet where data change occurs according to the data screening request;
and re-rendering and displaying the part with the changed data.
Optionally, the processing module is further configured to:
after the web form application is loaded into a web page, generating an operation record of a user in the web form application;
and according to the undo operation of the user, re-rendering the electronic form in the web form application through the operation record.
Optionally, the processing module is further configured to:
after the web form application is loaded into a web page, controlling the communication module to acquire an operation template loading request triggered by a user; the operation template loading request comprises an operation template recorded with at least one operation;
and re-rendering the electronic form in the web form application according to the operation template.
Optionally, the file is a local file where the browser is located or a remote file of the server.
In a third aspect, an embodiment of the present invention further provides a computing device, including:
a memory for storing program instructions;
and the processor is used for calling the program instructions stored in the memory and executing the method for processing the spreadsheet data in the web page according to the obtained program.
In a fourth aspect, the present invention further provides a computer-readable storage medium storing computer-executable instructions for causing a computer to perform the above method for processing spreadsheet data within a web page.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a system architecture diagram according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a method for processing spreadsheet data within a web page according to an embodiment of the present invention;
FIG. 3 is a diagram of a web form application provided by an embodiment of the present invention;
FIG. 4 is a diagram illustrating an import request on a web form application according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an apparatus for processing spreadsheet data within a web page according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In a terminal (such as a computer, a mobile phone, a tablet and the like), a plurality of local applications are included and are used for various functions, such as Word application, Visio application, Excel application and the like. The Excel application is an application of a spreadsheet, and a plurality of worksheets can be established in the Excel application so as to manage and analyze data.
However, the Excel application can only be used locally at the terminal, there is no means for managing and analyzing data in the web front end, and data of local, database and other systems cannot be imported or exported on the web page, and in the process of processing data on the web page, operation history of each step cannot be recorded, the operation history of a certain step cannot be skipped to, the step of the operation history cannot be changed, and a history template cannot be generated according to the operation history.
In view of the above, there is a need for a method of managing and analyzing data on a web page to enable importing or exporting data of local, database and other systems on the web page and recording operation history at each step in the process of processing the data on the web page.
Fig. 1 illustrates an exemplary system architecture to which embodiments of the present invention are applicable, which includes a server 100, where the server 100 may include a processor 110, a communication interface 120, and a memory 130.
The communication interface 120 is configured to obtain an import request, a file selection request, a worksheet selection request, or a data filtering request selected by a user, so as to import or export data of a local system, a database, or other systems.
The processor 110 is a control center of the server 100, connects various parts of the entire server 100 using various interfaces and routes, performs various functions of the server 100 and processes data by operating or executing software programs and/or modules stored in the memory 130 and calling data stored in the memory 130. Alternatively, processor 110 may include one or more processing units.
The memory 130 may be used to store software programs and modules, and the processor 110 executes various functional applications and data processing by operating the software programs and modules stored in the memory 130. The memory 130 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to a business process, and the like. Further, the memory 130 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
It should be noted that the structure shown in fig. 1 is only an example, and the embodiment of the present invention is not limited thereto.
Based on the above description, fig. 2 is a schematic flow chart illustrating a method for processing spreadsheet data in a web page according to an embodiment of the present invention, where the flow chart is executable by an apparatus for processing spreadsheet data in a web page.
As shown in fig. 2, the process specifically includes:
step 210, the browser sends a web page acquisition request to a server; and the browser receives a hypertext markup language (HTML) file sent by the server.
The HTML includes various tags, such as a horizontal line tag < hr > is defined, an information tag < head > is defined with respect to a document, an italic tag < i > is defined, an image tag < img > is defined, and the like.
In the embodiment of the invention, the HTML file comprises a defined inline frame tag < iframe >.
Step 220, the browser obtains a web form application through the inline frame of the HTML file and loads the web form application into a web page.
In the embodiment of the invention, the HTML file comprises a definition inline frame tag < iframe >, the definition inline frame tag < iframe > comprises an address parameter src, and the web form application is loaded into the web page according to the web form application address. For example, after setting the address parameter src to the address http of the web form application, the web form application is loaded into the web page. Wherein the web form application is for processing spreadsheet data. By the method, the web form application can be loaded into any browser for use.
Fig. 3 is a schematic diagram illustrating an example of a web form application, and as shown in fig. 3, after a user loads the web form application onto a web page, the user correspondingly renders the data on the web form application according to the selected file data, and then the user processes and analyzes the data on the web form application.
Further, after the web form application is loaded into the web page, an import request triggered by a user through the web form application is received, a file corresponding to the import request is read, and the file is displayed in an electronic form of the web form application through the web form application.
FIG. 4 is a schematic diagram illustrating an import request on a web form application, such as an import request from a local, an import request from a database, an import request from a workspace, and the like, as shown in FIG. 4. And reading the corresponding file according to the address path, the file name and the like of the import request. For example, after a user selects a file locally through an address path, the user calls a data reading API (Application Programming Interface) of a browser through a Java Script language, reads the file, and displays the file in a spreadsheet of a spreadsheet Application through the spreadsheet Application.
Since metadata is simply a stack of data, a more complex data structure is required when all data is in an array object, but needs to be displayed in a spreadsheet of a web form application. Therefore, the web form application needs to split the content type and the style type of the metadata to obtain the content type metadata and the style type metadata, then store the content type metadata and the style type metadata as objects, index the name of the content type metadata and the content type metadata through key values, correspond the content type metadata and the style type metadata through methods such as traversal, indexing and the like, and then render and display the metadata in the electronic form.
Further, the web form application associates the metadata of the content type with the metadata of the style type in the file, determines the display position of the metadata of the content type in the electronic form aiming at the metadata of the content type and the metadata of the style type with an association relationship, and renders and displays the metadata of the content type in the electronic form according to the display position according to the metadata of the style type.
In the embodiment of the present invention, the display position of the content-type metadata in the spreadsheet is determined according to the name of the metadata, such as the column name in the group object. The metadata of the style type may be a style of a color, font size, etc. of the metadata of the content type.
Specifically, the metadata of the content type may determine a display position in the spreadsheet according to a column name of the metadata, first determine a first column name of the metadata of the content type, such as a numerical index, then map the first column name of the metadata of the content type to a second column name according to a preset mapping rule, finally determine a display position of the metadata of the content type in the spreadsheet according to the second column name, and render the metadata of the content type in the spreadsheet.
For the style metadata, first style values, such as color values, font sizes and the like, of the style metadata are determined, the first style values are matched according to a preset data structure, a second style value is determined, and then the second style value and the content metadata are indexed, wherein the second style value of the preset data structure can be obtained by classifying and sequencing the color values.
In order to better explain the above technical solution, how to determine the display position of the content-type metadata in the spreadsheet and how to determine the style-type metadata will be explained in the following specific examples.
Example 1
When the metadata is determined to be an array, the array column name is extracted, because in the array, there are only 1, 2, 3, etc. digital indexes (i.e. column names), but when displayed on the web table application, the column name can be converted into indexes of a1, G6, D8, etc., specifically, for example: in the first step, the numeric index p is divided by 26 to obtain a remainder q. If q is 0, q is 26. Secondly, mapping q to a character c, wherein the mapping rule is {1-26} - > { a-Z }, and then splicing c to the left of the 26-system value result, that is, the index value corresponding to p is c + result. And in the third step, p1 is equal to (p-q)/26, if p1 is greater than 0, the execution is continued by returning to the first step, and otherwise, the fourth step is carried out. Fourthly, returning the 26-system value result. If p is 27, q is 1, q is mapped to a character c, the character c is a, the 26-ary value result of p is 1, and the index value corresponding to p is a 1.
Example 2
The color style of the metadata includes infinite colors such as "theme color", "theme color extension color", "standard color", "more color", etc., the color style in the file is various and not standardized, so the web form application requires additional processing of the color style of the metadata. Firstly, the web application confirms the type of the color pattern, and then performs processing according to the type of the color pattern, if the type of the color pattern is a value of hsl (Hue preservation lighting, a representation of a point in an RGB color model in a cylindrical coordinate system), the type of the color pattern is judged according to a corresponding color value (tint value), and if the color value is greater than 0, the processing is performed according to the following function: ({ h: res [0], s: res [1], l: Math.abs (tint × 100) }). toHexString (), and then attaching the processed result to a corresponding data structure, and connecting the processed result with the metadata of the content type in a traversing, indexing and other modes. If the color value is less than or equal to 0, processing according to the following function: ({ h: res [0], s: res [1], l: Math.abs ((1+ tint) × 100) }) toHexString ().
If the color value is the value of the theme color and the extended color thereof, the color value is queried in a preset color table library according to a color value index (including the theme color index and the extended color index thereof), because the color value in the color table library is more in number and almost unlimited, the color value is classified in a limited way, and the color value is sorted by a sorting algorithm (such as a sorting algorithm of Java Script) to obtain a specific color value. The color table library may be a data structure preset by establishing a map (a collection structure for storing data in a key-value pair manner).
In the embodiment of the invention, the display position of the content type metadata in the electronic form is determined by the preset mapping rule, so that different types of files can be mapped into the electronic form, such as PDF (portable document format) files, word files and the like, and the type of the file to be rendered is increased without being limited to table files, such as Excel files. The style corresponding to the metadata of the content type is determined through the preset data structure, because the styles of different files are possibly different in certain degree, for example, the number of color values is large and almost unlimited, the first style value is matched through the preset data structure, the styles of different files are unified, and the second style value in the preset data structure is obtained after classification and sequencing, so that when the first style value is matched, the calculation amount can be reduced, the calculation resources are saved, the matching time is shortened, and the rendering efficiency is improved.
In the embodiment of the present invention, when the file corresponding to the import request is a form file, such as an Excel file, indexes of the worksheets are displayed, and data of the file is not directly displayed, specifically, the web form application receives a file selection request triggered by a user, when it is determined that the file in the file selection request includes a plurality of worksheets, indexes of the plurality of worksheets are displayed, and after the user-triggered worksheet selection request is received, the browser reads the worksheet corresponding to the worksheet selection request through the web form application.
The file corresponding to the file selection request is a table file, such as an Excel file, then a worksheet identifier (such as a worksheet name) in the file is used as an index for displaying, after the worksheet selection request triggered by a user is received, the corresponding worksheet is read only, and the data of the whole file is read, so that the data calculation resources of the browser are reduced, and the efficiency of displaying the data on a web page is improved.
In order to better explain the above technical solutions, the following will be illustrated in specific examples.
Example 3
In the excel application, when the worksheets are opened, all the worksheets, such as worksheet 1, worksheet 2 and worksheet 3, are forced to be opened, and one or more worksheets cannot be selected independently for punching. In the embodiment of the invention, when the file is of an excel type, the web form application reads the information of all worksheets in the file, displays the names of the worksheets on the web form application in a list form, and selects one or more worksheets to be imported by a user, so that the calculation amount of reading data is reduced, the calculation resources are saved, and the working efficiency is improved.
In embodiments of the present invention, drop-down boxes (e.g., file selection requests, etc.), radio boxes, multiple selection boxes (e.g., selection of multiple worksheets, etc.), switches, input boxes, etc., provided in a web spreadsheet application, may be implemented according to UTF-8 encoding to dynamically load one or more box components in the web application.
In the embodiment of the present invention, when the file corresponding to the import request is a file of another system, a preset reading rule may be triggered according to an identifier such as a name or an address of the system, so as to read the file of the other system. Specifically, when the web form application determines that the address corresponding to the import request includes the preset address, the file is read according to the preset reading rule, and the file is displayed in the electronic form of the web form application.
For example, a read rule is preset in a URL (uniform resource locator) parameter, where the read rule is, for example, a read-only form file, a read-only Excel file, or a file with a designated work form name under an Excel file, and the like, and a data reading API (Application Programming Interface) of a browser is called through a Java Script language to obtain resource addresses of other systems, and when the resource addresses of other systems are preset addresses, the Excel file is read in the other systems according to the preset read rule, and the file is displayed in an electronic form applied to a web form.
In the implementation of the present invention, when the web form application receives an import request triggered by a user, the import request is different, and the index content displayed for the user is also different, for example, when the import request is locally imported, the web form application reads a local file of a computer, pops up a file selection box for the user to select the file, records a judgment flag of the import request after the user triggers the file selection request, and pops up a selection box for further processing. And displaying the content which is correspondingly processed by the local import because the import request is determined to be the local import according to the judgment mark.
When the import request is imported from a database, a data reading API interface is called, a request is sent to a remote server, a list of the database is requested, the list of the database name is displayed on a bullet frame, then a selection request triggered by a user is received, the database selected by the user is determined, and then a base table below the database is requested to the server through the id of the database. After receiving a header request (such as a field name as a header) triggered by a user, processing first row data of data in a library table in the database, adding an identifier of the header to the first row data, and then setting the background color of the row data as the exclusive background color of the header if a certain row of data is read to have the identifier of the header when the data is rendered, and adding a screenable function to the row of data.
And when the import request is imported from the workspace, popping up an input box for a user to input the link of the workspace.
When the import request is imported from other systems, the system pops up an input box for a user to input the addresses of the other systems, and also provides a selection box (including the names or the addresses of the other systems) for the user to directly click a certain system for selection.
After the browser displays the file in the spreadsheet of the web form application through the web form application, the browser may further process the data according to the screening request triggered by the user, specifically, the web form application receives the data screening request triggered by the user, and then displays the data in the spreadsheet after processing according to the data screening request. Wherein the data screening request is determined by selecting a screening option in the web form application; each screening option is stored in the form of an independent variable.
In the embodiment of the present invention, each filtering option is stored in the form of an independent variable, for example, the filtering options include the following options:
a. ignore the top row number: the row number a1 input by the user in the input box can be received, the data in the spreadsheet is ignored for the previous row a1 according to the row number a1, and then the data in the next row of the ignored row a1 is displayed. Note that the row a1 does not include a row that is empty.
b. The number of gauge head lines: in the electronic form, the header and the content have some differences, for example, the header line has a unique color style, the header line also has a unique filtering function, and the like, and the receiving user inputs a line b1 in the input box and then takes the first b1 line of data as the header.
c. Number of discarded data lines: the receiving user inputs a row number c1 in the input box, and then discards the data of the first c1 row after the head row in the spreadsheet, i.e. the row c1+1 is shown after the head row.
d. Maximum number of rows of load data: the receiving user enters a row number d1 in the input box, and then only the first d1 row of data in the spreadsheet, which is not the head row, is displayed.
e. Merge all data into one worksheet: if there are multiple worksheets in the spreadsheet, the data in the multiple worksheets is merged into one worksheet.
In the embodiment of the present invention, the screening options include, but are not limited to, the above screening options, and it is ensured that each screening option can be used in combination. In order to better explain the above technical solutions, the following will be illustrated in specific examples.
Example 4
The browser displays the file in an electronic form of the web form application through the web form application, wherein the electronic form comprises 5 rows of data, the first row is empty, and the second row to the fifth row are data.
If the data screening request is to ignore the top row number: when a1 is equal to 1, the data displayed after being processed according to the data screening request is: the first row is empty, the second row to the fourth row are data of the third row to the fifth row before the data screening request, and data after the fourth row are empty. When a1 is equal to 4, the data displayed after being processed according to the data screening request is an empty table.
If the data screening request is the head line number: when b1 is equal to 1, the data displayed after being processed according to the data screening request is: the first row is empty, the second row is the header, and the third row to the fifth row are data.
If the data screening request comprises the header line number and the discarded data line number: when b1 is equal to 1 and c1 is equal to 1, the data displayed after being processed according to the data screening request are as follows: the first row is empty, the second row is a header, the third row to the fourth row are data of the fourth row to the fifth row before the data screening request, and data after the fourth row are empty.
If the data screening request is the maximum number of the loaded data lines: when d1 is equal to 3, the data displayed after being processed according to the data screening request is: the first row is empty, the second row to the fourth row are data, and the data after the fourth row are empty.
In the embodiment of the invention, each screening option is stored in an independent variable form, that is, data which is equivalent to the data processed by each screening option is also stored in an independent form, for example, the processed data corresponding to each data screening request in example 4, and the value of data change between the data screening requests is determined in such a way, so that only the part with the data change is re-rendered and displayed in the spreadsheet, the calculation amount of the web form application is reduced, the calculation resource of the web form application is saved, and the time for the web form application to load the data is shortened.
Further, the web form application determines a part of the electronic form with the data change according to the data screening request, and the web form application re-renders and displays the part with the data change.
In the embodiment of the invention, the corresponding data has certain difference among the screening options, but also has some coupled data, so that the changed part and the unchanged part of the data in the spreadsheet can be determined, the computing resource of the web form application is saved, and the time for loading the data by the web form application is shortened. For example, on the electronic form after the user selects the filtering option, if the user cancels or adds the filtering option at this time, the part of the electronic form where the data change occurs may be determined by the difference of the data corresponding to the filtering option, and the part where the data change occurs is re-rendered and displayed.
In the embodiment of the invention, after the web form application is loaded into the web page, the operation of the user is recorded, so that different functions are realized according to the operation. Specifically, the web form application generates an operation record of the user in the web form application, and the electronic form in the web form application is re-rendered through the operation record according to the undo operation of the user.
In the embodiment of the present invention, the operation is each operation when the user uses the spreadsheet, and includes, but is not limited to, the following four operation types.
Style type: the types of operations that affect only the page style of the worksheet.
Data type: the operation type of the data content of the worksheet is changed.
General type: the Schema (table data structure) of the worksheet is the same, and the resulting data changes are of the same type of operation across all worksheets. For example, values with column names number are all + 100.
Non-generic types: the Schema (table data structure) of the worksheet is the same, changing the operation type of the data content of the worksheet. For example, the value of a cell is directly changed.
In the embodiment of the invention, in order to reduce the computing capacity of the web form application, when the data in the spreadsheet is greater than a first threshold value, each operation of a user is computed and recorded by a browser, and if the data in the spreadsheet is greater than a second threshold value, each operation of the user is computed and recorded by a server corresponding to the browser. The first threshold and the second threshold are preset according to the experience of the user, for example, the first threshold is 10000, and the second threshold is 50000.
For the user's undo operation, including undoing one or more operations, for example, the current spreadsheet includes 10 operations, the current spreadsheet may be undone to the fifth operation, or three operations may be undone forward. For the undo operation, the user may also perform a recovery operation, for example, when a certain operation f1 is undone in the operation record, after the recovery, the operation f1 undone before is added in the operation record.
The embodiment of the invention also comprises a clearing operation and a dragging operation, wherein the clearing operation is used for deleting or clearing the operation in the operation record. The drag operation is used to change the order of operations in the operation record.
In order to better illustrate the above technical solution, the operations in the operation record will be illustrated in the following specific examples.
Example 5
And receiving a certain operation in the operation record selected by the user, and then re-rendering the electronic form in the web form application through the operation of operation record aggregation. For example, the operation record includes five operations 1, 2, 3, 4 and 5. If the operation selected by the user is 3, the operations in the operation record are 1, 2 and 3, and then the spreadsheet in the web form application is re-rendered.
And receiving a certain operation in the operation record deleted by the user, and then re-rendering the electronic form in the web form application through the operation of operation record summarization. For example, the operation record includes five operations 1, 2, 3, 4 and 5. If the user delete operation is 3, the operations in the operation record are 1, 2, 4, and 5, and then the spreadsheet in the web form application is re-rendered.
And receiving the operation record dragged by the user, and then re-rendering the electronic form in the web form application through operation of operation record summarization. Such as the order of 1, 2, 3, 4, and 5 of the operation records. And the dragged operation records are 1, 2, 4, 5 and 3, and then the electronic table in the web table application is re-rendered according to the dragged operation records.
In the embodiment of the invention, after the web form application is loaded into the web page, if the web form application acquires an operation template loading request triggered by a user, the electronic form in the web form application is re-rendered according to the operation template. The operation template loading request comprises an operation template recorded with at least one operation.
In the embodiment of the present invention, the operation template is generated in advance according to an operation selected by a user, and includes one or more operations, for example, the template 1 includes operations 1, 2, and 3, and the template 2 includes operations 6, 7, and 8. It should be noted that the re-rendering of the spreadsheet in the web form application according to the operation template includes the following implementation methods.
When the electronic form is newly added or edited, the operation template is selected and then re-rendered according to the full coverage of the operation template. For example, the operation records of the current spreadsheet are 6, 7, 8, and the operation template is template 1, including operations 1, 2, 3. After the template is operated, the operation record of the template 1 is covered to the current electronic form, namely, the current electronic form is re-rendered according to the operation records 1, 2 and 3.
When the electronic form is newly added or edited, the operation template is selected and then additionally re-rendered according to the operation template. For example, the records of the operations of the current spreadsheet are 6, 7, 8, and the operation template is template 3, including operations 4, 5, 6. After the template is operated, the operation record of the template 1 is added to the current spreadsheet, namely, the current spreadsheet is re-rendered according to the operation records 6, 7, 8, 4, 5 and 6.
It should be noted that, in the above-described implementable embodiment, the import operation is included in the operation record of the current spreadsheet, for example, when the operation record of the current spreadsheet is 6, 7, or 8, if the template 1 is added or overwritten, the operation 9 of the current spreadsheet is the import operation, and when the operation is the import operation, the data verification is performed on the spreadsheet, so the import operation may be replaced with the data verification operation. Wherein the data verification operation includes the following two types.
And (5) performing row and column check operation. The row and column check operation saves the total number of rows, total number of columns, and table type schema (table data structure) in the spreadsheet.
Schema (table data structure) check operation. Schema checking operations save the Schema of the column used by the operation list.
The data checking operation is used for preventing the error of selecting the operation template caused by the existence of the non-universal type operation in the operation record.
In the embodiment of the invention, the file can be a local file where a browser is located or a remote file of a server.
Based on the same technical concept, fig. 5 exemplarily shows a schematic structural diagram of an apparatus for processing spreadsheet data in a web page according to an embodiment of the present invention, and the apparatus can execute a flow of a method for processing spreadsheet data in a web page.
As shown in fig. 5, the apparatus specifically includes:
a communication module 510, configured to send a web page acquisition request to a server; receiving a hypertext markup language (HTML) file sent by the server;
a processing module 520, configured to obtain a web form application through an inline frame of the HTML file and load the web form application into a web page; the web form application is for processing spreadsheet data.
Optionally, the processing module 520 is further configured to:
controlling the communication module 510 to receive an import request triggered by a user through the web form application;
reading a file corresponding to the import request;
the file is presented by the web form application in a spreadsheet of the web form application.
Optionally, the processing module 520 is specifically configured to:
associating metadata of a content type with metadata of a style type in the file;
and aiming at the content type metadata and the style type metadata which have the association relationship, determining the display position of the content type metadata in the electronic form, and rendering and displaying the content type metadata in the electronic form according to the display position according to the style type metadata.
Optionally, the processing module 520 is specifically configured to:
controlling the communication module 510 to receive a user-triggered file selection request;
when the file in the file selection request is determined to comprise a plurality of worksheets, presenting indexes of the worksheets;
control the communication module 510 to receive a user-triggered worksheet selection request;
and reading the worksheet corresponding to the worksheet selection request.
Optionally, the processing module 520 is further configured to:
and when the address corresponding to the import request is determined to comprise a preset address, reading a file according to a preset reading rule, and displaying the file in an electronic form of the web form application.
Optionally, the processing module 520 is further configured to:
after the file is presented in the spreadsheet of the web form application by the web form application, controlling the communication module 510 to receive a user-triggered data filtering request;
and processing and displaying the data in the electronic form according to the data screening request.
Optionally, the data filtering request is determined by selecting a filtering option in the web form application; each screening option is stored in the form of an independent variable.
Optionally, the processing module 520 is specifically configured to:
determining a part of the spreadsheet where data change occurs according to the data screening request;
and re-rendering and displaying the part with the changed data.
Optionally, the processing module 520 is further configured to:
after the web form application is loaded into a web page, generating an operation record of a user in the web form application;
and according to the undo operation of the user, re-rendering the electronic form in the web form application through the operation record.
Optionally, the processing module 520 is further configured to:
after the web form application is loaded into a web page, controlling the communication module 510 to obtain an operation template loading request triggered by a user; the operation template loading request comprises an operation template recorded with at least one operation;
and re-rendering the electronic form in the web form application according to the operation template.
Optionally, the file is a local file where the browser is located or a remote file of the server.
Based on the same technical concept, an embodiment of the present invention further provides a computing device, including:
a memory for storing program instructions;
and the processor is used for calling the program instructions stored in the memory and executing the method for processing the spreadsheet data in the web page according to the obtained program.
Based on the same technical concept, embodiments of the present invention also provide a computer-readable storage medium storing computer-executable instructions for causing a computer to perform the above-mentioned method of processing spreadsheet data within a web page.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (14)

1. A method of processing spreadsheet data within a web page, comprising:
the browser sends a web page acquisition request to a server; the browser receives a hypertext markup language (HTML) file sent by the server;
the browser acquires a web form application through an inline frame of the HTML file and loads the web form application into a web page; the web form application is for processing spreadsheet data.
2. The method of claim 1, wherein after loading the web form application into a web page, further comprising:
the browser receives an import request triggered by a user through the web form application;
the browser reads a file corresponding to the import request;
the browser presents the file in a spreadsheet of the web form application through the web form application.
3. The method of claim 2, wherein the browser exposing the file to a spreadsheet of the web form application through the web form application comprises:
the web form application associating metadata of content types with metadata of style types in the file;
aiming at the content type metadata and the style type metadata which have an association relationship, the web form application determines the display position of the content type metadata in the electronic form, and renders and displays the content type metadata in the electronic form according to the display position according to the style type metadata.
4. The method of claim 2, wherein the browser receives an import request triggered by a user through the web form application, comprising:
the web form application receives a user-triggered file selection request;
the web form application, upon determining that a file in the file selection request includes a plurality of worksheets, presenting an index of the plurality of worksheets;
the web form application receiving a user-triggered worksheet selection request;
the browser reads the file corresponding to the import request, and the method comprises the following steps:
and the browser reads the worksheet corresponding to the worksheet selection request through the web form application.
5. The method of claim 2, wherein the browser exposing the file to a spreadsheet of the web form application through the web form application comprises:
and when the web form application determines that the address corresponding to the import request comprises a preset address, reading a file according to a preset reading rule, and displaying the file in an electronic form of the web form application.
6. The method of claim 2, wherein after the browser presents the file in a spreadsheet of the web form application through the web form application, further comprising:
the web form application receives a data screening request triggered by a user;
and the web form application processes and displays the data in the electronic form according to the data screening request.
7. The method of claim 6, wherein the data filtering request is determined by selecting a filtering option in the web form application; each screening option is stored in the form of an independent variable.
8. The method of claim 6, wherein the web form application being exposed after processing the data in the spreadsheet according to the data filtering request comprises:
the web form application determines a part of the electronic form, in which data change occurs, according to the data screening request;
and the web table application re-renders and displays the part with the changed data.
9. The method of any of claims 1 to 8, after loading the web form application into a web page, further comprising:
the web form application generates an operation record of a user in the web form application;
and the web table application re-renders the electronic table in the web table application through the operation record according to the undo operation of the user.
10. The method of any of claims 1 to 8, after loading the web form application into a web page, further comprising:
the web form application acquires an operation template loading request triggered by a user; the operation template loading request comprises an operation template recorded with at least one operation;
the web form application re-renders the spreadsheet in the web form application according to the operation template.
11. The method of claim 2, wherein the file is a local file of the browser or a remote file of the server.
12. An apparatus for processing spreadsheet data within a web page, comprising:
the communication module is used for sending a web page acquisition request to the server; receiving a hypertext markup language (HTML) file sent by the server;
the processing module is used for acquiring a web form application through an inline frame of the HTML file and loading the web form application into a web page; the web form application is for processing spreadsheet data.
13. A computing device, comprising:
a memory for storing program instructions;
a processor for calling program instructions stored in said memory to execute the method of any one of claims 1 to 11 in accordance with the obtained program.
14. A computer-readable storage medium having stored thereon computer-executable instructions for causing a computer to perform the method of any one of claims 1 to 11.
CN202110134879.9A 2021-01-29 2021-01-29 Method and device for processing spreadsheet data in web page Pending CN112800371A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110134879.9A CN112800371A (en) 2021-01-29 2021-01-29 Method and device for processing spreadsheet data in web page

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110134879.9A CN112800371A (en) 2021-01-29 2021-01-29 Method and device for processing spreadsheet data in web page

Publications (1)

Publication Number Publication Date
CN112800371A true CN112800371A (en) 2021-05-14

Family

ID=75813316

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110134879.9A Pending CN112800371A (en) 2021-01-29 2021-01-29 Method and device for processing spreadsheet data in web page

Country Status (1)

Country Link
CN (1) CN112800371A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113190759A (en) * 2021-05-21 2021-07-30 上海微盟企业发展有限公司 Webpage generation method, device and equipment and computer readable storage medium
CN113486269A (en) * 2021-05-25 2021-10-08 厦门海迈科技股份有限公司 WEB-based electronic form data processing method, computing device, and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113190759A (en) * 2021-05-21 2021-07-30 上海微盟企业发展有限公司 Webpage generation method, device and equipment and computer readable storage medium
CN113486269A (en) * 2021-05-25 2021-10-08 厦门海迈科技股份有限公司 WEB-based electronic form data processing method, computing device, and storage medium
CN113486269B (en) * 2021-05-25 2024-01-30 厦门海迈科技股份有限公司 WEB-based electronic form data processing method, computing device and storage medium

Similar Documents

Publication Publication Date Title
CN111367976B (en) Method and device for exporting EXCEL file data based on JAVA reflection mechanism
CN109408764B (en) Page area dividing method, device, computing equipment and medium
CN111125598A (en) Intelligent data query method, device, equipment and storage medium
CN110705237B (en) Automatic document generation method, data processing device and storage medium
CN107748752B (en) Data processing method and device
CN106354483B (en) Data processing method and device and electronic equipment
CN106557307B (en) Service data processing method and system
CN112800371A (en) Method and device for processing spreadsheet data in web page
CN113157947A (en) Knowledge graph construction method, tool, device and server
CN110990403A (en) Business data storage method, system, computer equipment and storage medium
CN110716718A (en) Page generation method, device, equipment and storage medium
JP2022041865A (en) Online working system for template-based excel documents
CN113688288A (en) Data association analysis method and device, computer equipment and storage medium
CN114201615B (en) Scientific research data change review method and server based on data snapshot
CN115357590A (en) Recording method and device for data change, electronic device and storage medium
CN112597023A (en) Case management method and device based on guide picture, computer equipment and storage medium
CN113485746B (en) Method and device for generating application program interface document
US20240037325A1 (en) Ability to add non-direct ancestor columns in child spreadsheets
CN115757174A (en) Database difference detection method and device
CN115409014A (en) Document template generation method and device, computer equipment and storage medium
CA3063175A1 (en) Data storage method and apparatus
CN113051333A (en) Data processing method and device, electronic equipment and storage medium
CN111651531A (en) Data import method, device, equipment and computer storage medium
CN115994194B (en) Method, system, equipment and medium for checking data quality of government affair big data
CN113935301B (en) Report generation method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination