The terms "first," "second," and "third," etc. in the description and claims of the present invention and the above-described drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "comprises" and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the invention. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
It should be understood that the technical solution of the embodiment of the present invention may be specifically applied to a terminal, and the terminal may be, for example, a Mobile phone (e.g., an Android Mobile phone, an iOS Mobile phone, etc.), a tablet computer, a desktop computer, a Mobile Internet Device (MID), a Personal Digital Assistant (PDA), and other terminal devices. The terminal may also be referred to as User Equipment (UE).
Fig. 1 is a schematic flow chart of a document generating method according to an embodiment of the present invention. Specifically, the steps included in the method may be performed by the terminal described above. The document generating method shown in fig. 1 may include:
s101, obtaining a target document template from a preset document template library.
Wherein, the document template library can be preset in the terminal.
Specifically, the executing, by the terminal, the obtaining of the target document template from the preset document template library may specifically include: and receiving a selection operation on a document type selection interface, wherein the selection operation indicates that a target document type obtains a target document template corresponding to the target document type from a preset document template library.
The document type selection interface provides a plurality of document types which can be selected and used by a user. In a particular embodiment, the document type may include, but is not limited to, a table, a meter, a chart, or a text document. Further specifically, the table types may include, but are not limited to, cross-tables and freeform tables, and the chart types may include, but are not limited to, bar charts, line charts, pie charts, bar charts, area charts, scatter charts, stock price charts, surface charts, circle charts, bubble charts, and radar charts.
For example, when a user wants to analyze data change conditions within a period of time or compare the data change conditions with each other through a bar graph, a chart can be selected on a document type selection interface output by a terminal, and at the moment, the terminal can receive a first selection operation of the user on the document type selection interface, wherein the first selection operation indicates the chart; further, after receiving the first selection operation, the terminal may further output a chart type selection interface, and when a user selects a bar chart on the chart type selection interface, the terminal may receive a second selection operation of the user on the chart type selection interface, where the second selection operation indicates the bar chart (i.e., a target document type).
S102, obtaining a first filtering condition, and filtering the data source according to the first filtering condition to obtain a target data set.
In a specific embodiment, the data source may specifically be a data source acquired by the terminal from a big data platform.
Specifically, the acquiring, by the terminal, the data source from the big data platform may specifically include: receiving a selection operation from a data source selection interface, wherein the selection operation indicates the identification of a target data table; and acquiring the target data table from the big data platform according to the identification, and determining a data source according to the target data table.
Wherein, a large amount of data can be stored in the big data platform. In particular, the big data platform may store data in the form of a table. Thus, the data source acquired by the terminal from the big data platform can be a data table. That is, the data source may be a data table prepared on the big data platform. In a specific embodiment, the data table may be a report layer data table, for example. Of course, the big data platform may also store data in other forms, which is not limited in this embodiment of the present invention.
Further, the terminal can filter the data source through the filter control to obtain a target data set. Specifically, a user may set a first filtering condition through a filtering control, and a terminal may receive a setting operation of the user to obtain the first filtering condition, and perform filtering processing on the data source according to the first filtering condition to obtain a target data set.
Wherein the filter controls may include, but are not limited to, a list filter control, a tree filter control, a range filter control, and a date filter control.
S103, adding the target data set into the target document template to generate a target output document.
In a specific implementation, because the display modes of data in different target document templates may be different, when the target document templates are different (that is, the types of the target documents are different), the terminal may add the target data set to the target document templates in different modes to generate the target output document. For example, when the type of the target document is a form, the terminal may directly input the dimension information that needs to be displayed by each data in the target data set and the metric value thereof under the dimension information into the target form template, so as to generate a target output form.
Further, the terminal may directly display the generated target output document on a document output interface of the document generation tool, and the user may view the target output document on the document output interface. Optionally, the terminal may further store the generated target output document in a terminal memory, and the user may download (or export) the target output document from the terminal memory.
In the embodiment of the invention, the terminal realizes the input of the data source by acquiring the data source to be analyzed from the big data platform without manually inputting the data source to be analyzed by a user, thereby simplifying the user operation; the target document template is obtained from the preset document template library, the data source is filtered according to the obtained filtering condition to obtain the target data set, the target data set is added into the target document template, the target output document is automatically generated, and the efficiency and the intelligence of data analysis document generation are improved.
Fig. 2 is a schematic flow chart of another document generating method according to an embodiment of the present invention. Specifically, the steps included in the method may be performed by the terminal described above. The document generating method as shown in fig. 2 may include:
s201, obtaining a target document template from a preset document template library.
It should be noted that the functions implemented by the terminal of the embodiment of the present invention may be integrated in the document generation tool. That is, the terminal may implement the document generating method as shown in fig. 2 through the document generating tool. Thus, the document template library may be preset in the document generation tool.
Specifically, the executing, by the terminal, the obtaining of the target document template from the preset document template library may specifically include: and receiving a selection operation on a document type selection interface, wherein the selection operation indicates that a target document type obtains a target document template corresponding to the target document type from a preset document template library.
The document type selection interface provides a plurality of document types which can be selected and used by a user. In a particular embodiment, the document type may include, but is not limited to, a table, a meter, a chart, or a text document. Further specifically, the table types may include, but are not limited to, cross-tables and freeform tables, and the chart types may include, but are not limited to, bar charts, line charts, pie charts, bar charts, area charts, scatter charts, stock price charts, surface charts, circle charts, bubble charts, and radar charts.
For example, when a user wants to analyze data change conditions over a period of time or analyze comparison conditions among various items through a bar graph, a diagram can be selected on a document type selection interface of the document generation tool output by a terminal, as shown in fig. 3, at this time, the terminal can receive a first selection operation of the user on the document type selection interface, and the first selection operation indicates the diagram; further, after receiving the first selection operation, the terminal may further output a chart type selection interface of the document generation tool as shown in fig. 4, and when a user selects a bar chart at the chart type selection interface, the terminal may receive a second selection operation of the user at the chart type selection interface, where the second selection operation indicates a bar chart (i.e., a target document type).
S202, determining a target index, and updating the target document template according to the target index.
The target index refers to a data index, usually a constant (e.g., total number, average number) or a percentage, for evaluating or analyzing the data. In particular implementations, different data may have different data indicators, and different data indicators may be used to evaluate or analyze data from different perspectives.
Taking website data as an example, the data indexes can be website conversion rate, rate of visitors, and the like. The website conversion rate is a quotient of a visitor who performs a corresponding action (such as a click action and a download action) and the total visit volume, and can be used for evaluating the attraction degree of website contents to the website visitor and the propaganda effect of the website; the reviewer ratio is the quotient of the number of reviewers and the number of independent visitors, and can be used for evaluating the attraction degree of the website contents to the visitors and the practicability of the website.
Optionally, the terminal executing the target index determination may specifically include: receiving a selection operation from an index selection interface of the document generation tool; and taking the index of the selection operation instruction as a target index.
The index selection interface provides a plurality of index types which can be selected and used by a user. In a particular embodiment, the indicator types may include demographic indicators, website indicators, business indicators, and the like. Further specifically, the demographic indicators may include population numbers, standing population, existing population, household population, gender ratio, and the like, the website indicators may include number of independent visitors, number of repeat visitors (i.e., reviewers), number of page views per visitor, visitor participation index, number of active visitors, and the like, and the business indicators may include order conversion rate, single output, return on investment rate, order acquisition rate, average order amount, sales per visitor, and the like.
Further, the terminal updates the target document template according to the determined target index. In the updated target document template, the display information of the data is increased by the target index. Wherein the display information refers to data information presented to a user. In general, the data information may include dimensional information of the data and its metric values under the dimensional information. The dimension information refers to descriptive attributes or characteristics of the data, and may be variable names of data rows or data columns. Thus, the metric value under the dimension information may be a variable value corresponding to the variable name. For example, the latitude information of the geographic location may include a latitude, a longitude, or a city name, and the metric values of the latitude and the longitude are an abscissa value and an ordinate value of the geographic location in the spherical coordinate system, respectively, and the metric value of the city name may be, for example, beijing, shanghai, chongqing, and so on.
S203, obtaining a first filtering condition, and filtering the data source according to the first filtering condition to obtain a target data set.
In a specific embodiment, the data source may specifically be a data source acquired by the terminal from a big data platform.
Specifically, the acquiring, by the terminal, the data source from the big data platform may specifically include: receiving a selection operation from a data source selection interface of the document generation tool, wherein the selection operation indicates an identification of a target data table; and acquiring the target data table from the big data platform according to the identification, and determining a data source according to the target data table.
Wherein, a large amount of data can be stored in the big data platform. In particular, the big data platform may store data in the form of a table. Thus, the data source acquired by the terminal from the big data platform can be a data table. That is, the data source may be a data table prepared on the big data platform. In a specific embodiment, the data table may be a report layer data table, for example. Of course, the big data platform may also store data in other forms, which is not limited in this embodiment of the present invention.
It should be noted that the terminal may configure the identifier of each data table stored in the big data platform in the document generation tool. Thus, the terminal may receive an identification selection operation from the data source selection interface of the document generation tool as shown in FIG. 5.
Optionally, the acquiring, by the terminal, the target data table from the big data platform according to the identifier may specifically include: the terminal may send a data table acquisition request to the big data platform, where the data table acquisition request is used to instruct the big data platform to find out a target data table corresponding to the identifier, and send the target data table to the terminal; and the terminal receives the target data table sent by the big data platform.
It should be noted that the data source is data to be analyzed (e.g., data of a certain statistical month, data of a certain distribution area, data of 30 days past due, etc.). In a specific embodiment, when the target data table acquired by the terminal from the big data platform is data to be analyzed, the determining, by the terminal, a data source according to the target data table may specifically include: and taking the target data table as a data source.
In another specific embodiment, when the target data table acquired by the terminal from the big data platform includes not only the data to be analyzed but also other data, the determining, by the terminal, the data source according to the target data table may specifically include: and acquiring a second filtering condition, and filtering the target data table according to the second filtering condition to obtain a data source. In this case, the second filtering condition is used to filter out data that does not satisfy the second filtering condition, or to screen out data that satisfies the second filtering condition, so as to select data that needs to be analyzed from the target data table.
For example, when the target data table acquired by the terminal from the big data platform is the sales data statistical table from 2011 to 2017, and the user only wants to analyze or view the sales data table in 2016, the user may use 2016 as the second filtering condition. For another example, when the target data table acquired by the terminal from the big data platform is a sales data statistical table of three areas, i.e., a northwest area, a southwest area, and a northeast area, and the user only wants to analyze or view the sales data table of the southwest area, the user may use the distribution area of the southwest area as the second filtering condition.
Specifically, the step of the terminal executing the first filtering condition, and performing filtering processing on the data source according to the first filtering condition to obtain the target data set may specifically include: receiving a selection operation from a control selection interface of the document generation tool as shown in FIG. 6, the selection operation indicating a target filter control; receiving a selection operation from a dimension selection interface of the document generation tool shown in FIG. 7, wherein the selection operation indicates dimension information to be filtered; associating the target filtering control with the dimension information to be filtered, and acquiring a control value of the target filtering control under the dimension information to be filtered; and taking the metric value corresponding to the dimension information to be filtered in the control value range as a first filtering condition, and filtering a data source according to the first filtering condition to obtain a target data set, wherein data in the target data set is data which meets the first filtering condition in the data source.
The control selection interface provides a plurality of filtering controls which can be selected and used by a user. The filter controls may include, but are not limited to, a list filter control, a tree filter control, a range filter control, and a date filter control. The dimension selection interface provides a plurality of kinds of dimension information for the user to select, and the dimension information comprises all attributes or characteristics of the data in the data source.
Therefore, a user can select a target filtering control from the control selection interface according to actual needs, and the dimension information (namely the dimension information to be filtered) to be filtered is pulled into the target filtering control from the dimension selection interface, so that the association between the target filtering control and the dimension information to be filtered is realized.
Further, after the control selection interface receives a selection operation (the selection operation indicates a target filter control), the terminal may output a control value selection interface or a control value input interface corresponding to the target filter control. Further, the terminal may further receive a selection operation from the control value selection interface or an input operation from the control value input interface to obtain the control value of the target filter control.
For example, in the first filter condition setting interface of the document creation tool shown in fig. 8, the user selects a range filter control, pulls the contract validation date into the range filter control, and selects a date between 2015 year 7/month 21 and 2016 year 7/month 22 as the control value corresponding to the range filter space. That is, the terminal may use the contract effective date between 2015 year 7/month 21 and 2016 year 7/month 22 as the first filtering condition, and filter the data source according to the first filtering condition to obtain the target data set, that is, select the data satisfying the first filtering condition (i.e., the data having the contract effective date between 2015 year 7/month 21 and 2016 year 7/month 22) to form the target data set.
And S204, calculating to obtain a numerical value of the target index according to the target data set.
Specifically, the step of the terminal executing the value of the target index calculated according to the target data set may specifically include: obtaining a calculation formula corresponding to the target index; determining target dimension information required to be used in the calculation formula; substituting the target dimension information in the target data set into the calculation formula, and calculating to obtain the numerical value of the target index.
S205, adding the target data set and the value of the target index into the target document template to generate a target output document.
In a specific implementation, because the display modes of data in different target document templates may be different, when the target document templates are different (that is, the types of the target documents are different), the terminal may add the target data set and the numerical value of the target index to the target document templates in different modes to generate a target output document. For example, when the type of the target document is a table, the terminal may directly input the dimension information, the metric value under the dimension information, and the numerical value of the target index, which need to be displayed by each data in the target data set, into the target table template, and generate a target output table.
Further, the terminal may directly display the generated target output document on a document output interface of the document generation tool, and the user may view the target output document on the document output interface. Optionally, the terminal may further store the generated target output document in a terminal memory, and the user may download (or export) the target output document from the terminal memory.
In the embodiment of the invention, the terminal realizes the input of the data source by acquiring the data source to be analyzed from the big data platform without manually inputting the data source to be analyzed by a user, thereby simplifying the user operation; the target document template is obtained from the preset document template library, the data source is filtered according to the obtained filtering condition to obtain the target data set, the target data set is added into the target document template, the target output document is automatically generated, and the efficiency and the intelligence of data analysis document generation are improved.
The embodiment of the invention also provides a terminal, which comprises a module for executing the method shown in the figure 1 of the application. Specifically, please refer to fig. 9, which is a schematic structural diagram of a terminal according to an embodiment of the present invention. The terminal as shown in fig. 9 may include: an acquisition module 301, a filtering module 302, and a generation module 303. Wherein,
the obtaining module 301 is configured to obtain a target document template from a preset document template library.
The filtering module 302 is configured to obtain a first filtering condition, and filter a data source according to the first filtering condition to obtain a target data set.
The generating module 303 is configured to add the target data set to the target document template, and generate a target output document.
It should be noted that, for the specific work flow of the terminal provided in the embodiment of the present invention, please refer to the method flow portion provided in the embodiment of the present invention, which is not described herein again.
In the embodiment of the invention, the terminal obtains the target document template from the preset document template library, filters the data source according to the obtained filtering condition to obtain the target data set, and adds the target data set into the target document template to automatically generate the target output document, thereby improving the efficiency and the intelligence of generating the data analysis document.
The embodiment of the present invention further provides another terminal, where the terminal includes a module for executing the method shown in fig. 2 of the present application. Specifically, please refer to fig. 10, which is a schematic structural diagram of a terminal according to an embodiment of the present invention. The terminal as shown in fig. 10 may include: an acquisition module 401, a receiving module 402, an updating module 403, a filtering module 404, a calculation module 405, and a generation module 406. Wherein,
the obtaining module 401 is configured to obtain a target document template from a preset document template library.
Optionally, the obtaining module 401 is specifically configured to receive a selection operation on a document type selection interface when the obtaining module executes the obtaining of the target document template from the preset document template library, where the selection operation indicates a target document type; and acquiring a target document template corresponding to the target document type from a preset document template library.
Wherein the target document type may include, but is not limited to, a table, a meter, a chart, or a text document.
The receiving module 402 is configured to receive a selection operation from an index selection interface, where the selection operation indicates a target index.
The updating module 403 is configured to update the target document template according to the target index, where the target index is added to the dimension information of the data in the updated target document template.
The receiving module 402 is further configured to receive a selection operation from the data source selection interface, where the selection operation indicates an identifier of the target data table.
The obtaining module 401 is further configured to obtain the target data table from the big data platform according to the identifier, and determine a data source according to the target data table.
Optionally, when the obtaining module 401 executes the determining of the data source according to the target data table, it may be specifically configured to determine the data source according to the target data table.
Optionally, when the obtaining module 401 executes the determining of the data source according to the target data table, it may be specifically configured to obtain a second filtering condition, and perform filtering processing on the target data table according to the second filtering condition to obtain the data source.
The filtering module 404 is configured to obtain a first filtering condition, and filter the data source according to the first filtering condition to obtain a target data set.
Optionally, the filtering module 404 is specifically configured to receive a selection operation from a control selection interface when the obtaining of the first filtering condition is performed and the data source is filtered according to the first filtering condition to obtain a target data set, where the selection operation indicates a target filtering control; receiving a selection operation from a dimension selection interface, wherein the selection operation indicates dimension information to be filtered; associating the target filtering control with the dimension information to be filtered, and acquiring a control value of the target filtering control under the dimension information to be filtered; and taking the metric value corresponding to the dimension information to be filtered in the control value range as a first filtering condition, and filtering the data source according to the first filtering condition to obtain a target data set, wherein data in the target data set is data which meets the first filtering condition in the data source.
The calculating module 405 is configured to calculate a numerical value of the target index according to the target data set.
The generating module 406 is configured to add the target data set and the value of the target indicator to the target document template, and generate a target output document.
In the embodiment of the invention, the terminal realizes the input of the data source by acquiring the data source to be analyzed from the big data platform without manually inputting the data source to be analyzed by a user, thereby simplifying the user operation; the target document template is obtained from the preset document template library, the data source is filtered according to the obtained filtering condition to obtain the target data set, the target data set is added into the target document template, the target output document is automatically generated, and the efficiency and the intelligence of data analysis document generation are improved.
Referring to fig. 11, a schematic block diagram of another terminal provided in the embodiment of the present invention is shown. The terminal in this embodiment as shown in fig. 11 may include: one or more processors 501, one or more input devices 502, one or more output devices 503, and memory 504. The processor 501, input device 502, output device 503 and memory 504 are connected by the bus 505. The memory 504 is used to store a computer program comprising program instructions.
Specifically, the processor 501 is configured to call the program instruction to perform:
acquiring a target document template from a preset document template library;
acquiring a first filtering condition, and filtering a data source according to the first filtering condition to obtain a target data set;
and adding the target data set into the target document template to generate a target output document.
Optionally, the processor 501 is configured to call the program instruction to further perform:
receiving a selection operation from an index selection interface, the selection operation indicating a target index;
and updating the target document template according to the target index, wherein the target index is added into the dimension information of the data in the updated target document template.
Optionally, the processor 501 is configured to call the program instruction to further perform:
and calculating to obtain the numerical value of the target index according to the target data set.
Optionally, the processor 501 is configured to invoke the program instruction to add the target data set to the target document template, and specifically perform, when generating a target output document:
and adding the target data set and the value of the target index into the target document template to generate a target output document.
Optionally, the processor 501 is configured to call the program instruction to execute the obtaining of the first filtering condition, and specifically perform, according to the first filtering condition, filtering a data source to obtain a target data set:
receiving a selection operation from a control selection interface, wherein the selection operation indicates a target filtering control;
receiving a selection operation from a dimension selection interface, wherein the selection operation indicates dimension information to be filtered;
associating the target filtering control with the dimension information to be filtered, and acquiring a control value of the target filtering control under the dimension information to be filtered;
and taking the metric value corresponding to the dimension information to be filtered in the control value range as a first filtering condition, and filtering a data source according to the first filtering condition to obtain a target data set, wherein data in the target data set is data which meets the first filtering condition in the data source.
Optionally, the processor 501 is configured to call the program instruction to further perform:
receiving a selection operation from a data source selection interface, wherein the selection operation indicates the identification of a target data table;
and acquiring the target data table from a big data platform according to the identification, and determining a data source according to the target data table.
Optionally, the processor 501 is configured to call the program instruction to execute the following steps when determining a data source according to the target data table:
and taking the target data table as a data source.
Optionally, the processor 501 is configured to call the program instruction to execute the following steps when determining a data source according to the target data table:
and acquiring a second filtering condition, and filtering the target data table according to the second filtering condition to obtain a data source.
Optionally, the target document type is a table, a meter, a chart, or a text document; the processor 501 is configured to invoke the program instruction to execute the following steps when the target document template is obtained from the preset document template library:
receiving a selection operation on a document type selection interface, wherein the selection operation indicates a target document type;
and acquiring a target document template corresponding to the target document type from a preset document template library.
It should be understood that, in the embodiment of the present invention, the Processor 501 may be a Central Processing Unit (CPU), and the Processor may also be other general processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The input device 502 may include a touch pad, a fingerprint sensor (for collecting fingerprint information of a user and direction information of the fingerprint), a microphone, etc., and the output device 503 may include a Display (liquid crystal Display, LCD, etc.), a speaker, etc.
The Memory 504 may include a Read-Only Memory (ROM) and a Random Access Memory (RAM), and provides computer programs and data to the processor 501. The portion of memory 504 may also include non-volatile random access memory. The memory 504 may also store device type information, for example.
In a specific implementation, the processor 501, the input device 502, and the output device 503 described in this embodiment of the present invention may execute an implementation manner of the document generating method shown in fig. 1 or fig. 2, and are not described herein again.
In the embodiment of the present invention, the processor 501 invokes the program instruction stored in the memory 504, and the data source to be analyzed is obtained from the big data platform to realize the input of the data source, so that the user does not need to manually enter the data source to be analyzed, thereby simplifying the user operation; the target document template is obtained from the preset document template library, the data source is filtered according to the obtained filtering condition to obtain the target data set, the target data set is added into the target document template, the target output document is automatically generated, and the efficiency and the intelligence of data analysis document generation are improved.
In an embodiment of the present invention, a computer-readable storage medium is further provided, where the computer-readable storage medium stores a computer program, the computer program includes program instructions, and the processor is configured to call the program instructions to execute the document generation method shown in fig. 1 or fig. 2 of the present application.
The computer readable storage medium may be an internal storage unit of the terminal according to any of the foregoing embodiments, for example, a hard disk or a memory of the terminal. The computer readable storage medium may also be an external storage device of the terminal, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the terminal. Further, the computer-readable storage medium may also include both an internal storage unit and an external storage device of the terminal. The computer-readable storage medium is used for storing the computer program and other programs and data required by the terminal. The computer readable storage medium may also be used to temporarily store data that has been output or is to be output.
While the invention has been described with reference to specific embodiments, the invention is not limited thereto, and various equivalent modifications and substitutions can be easily made by those skilled in the art within the technical scope of the invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.