CN112182201A - Rich text report generation method and device, computer equipment and storage medium - Google Patents

Rich text report generation method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN112182201A
CN112182201A CN202011247770.8A CN202011247770A CN112182201A CN 112182201 A CN112182201 A CN 112182201A CN 202011247770 A CN202011247770 A CN 202011247770A CN 112182201 A CN112182201 A CN 112182201A
Authority
CN
China
Prior art keywords
page
rich text
data
text report
preset
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
CN202011247770.8A
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.)
Ping An Puhui Enterprise Management Co Ltd
Original Assignee
Ping An Puhui Enterprise Management 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 Ping An Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN202011247770.8A priority Critical patent/CN112182201A/en
Publication of CN112182201A publication Critical patent/CN112182201A/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/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/338Presentation of query results
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution

Abstract

The application relates to the technical field of data processing, and discloses a method for generating a rich text report, which comprises the following steps: generating cache data of rich text styles according to the service data; detecting a setting instruction corresponding to each page in cache data, wherein the setting instruction is used for setting page format information and page skin information corresponding to the page; acquiring picture data corresponding to each page according to the page skin information; creating a preset document according to the page format information and the picture data corresponding to each page; and writing the content information corresponding to each page in the cache data into the preset document to generate a rich text report. The application can also be applied to the technical field of block chains. The application also discloses a rich text report generation device, computer equipment and a computer readable storage medium. The method and the device for generating the rich text report realize diversified generation of the rich text report and meet the requirements of users on diversified rich text reports.

Description

Rich text report generation method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a rich text report generation method, a rich text report generation apparatus, a computer device, and a computer-readable storage medium.
Background
In different business systems, rich text reports of various different formats are produced more and more, and although the rich text reports can be generated by one key at present, the background and the format of the page of the rich text reports generated in the way are usually fixed and are relatively single, so that the requirement of a user on generating diversified rich text reports is difficult to meet.
The above is only for the purpose of assisting understanding of the technical solutions of the present application, and does not represent an admission that the above is prior art.
Disclosure of Invention
The application mainly aims to provide a rich text report generation method, a rich text report generation device, a computer device and a computer readable storage medium, and aims to solve the problem that diversified rich text reports are difficult to generate.
In order to achieve the above object, the present application provides a method for generating a rich text report, including the following steps:
acquiring service data of a service system, and generating cache data with rich text styles according to the service data;
detecting a setting instruction corresponding to each page in the cache data, wherein the setting instruction is used for setting page format information and page skin information corresponding to the page;
acquiring picture data corresponding to each page according to the page skin information;
creating a preset document according to the page format information and the picture data corresponding to each page;
and writing the content information corresponding to each page in the cache data into the preset document to generate a rich text report.
Further, the step of detecting a setting instruction corresponding to each page in the cache data includes:
providing a plurality of preset page templates, wherein the preset page templates comprise page format information and page skin information;
when detecting that a setting instruction is generated on the basis of each page in the cache data, determining a preset page template for the setting instruction;
associating a preset page template aimed at by the setting instruction with a page corresponding to the setting instruction in the cache data;
and taking the page format information and the page skin information of the preset page template associated with each page as the page format information and the page skin information corresponding to each page.
Further, before the step of providing a plurality of preset page templates, the method further includes:
and generating the preset page template according to the page format option factor, the page quantity factor, the page sequence factor and the page skin option factor, wherein the page format information is determined according to the page format option factor, and the page skin information is determined according to the page skin option factor.
Further, before the step of obtaining the picture data corresponding to each page according to the page skin information, the method further includes:
acquiring a plurality of picture data;
coding picture data based on a base64 algorithm to obtain coded data corresponding to the picture data and page skin information corresponding to the coded data;
storing the encoded data in a database;
the step of obtaining the picture data corresponding to each page according to the page skin information comprises the following steps:
acquiring coded data corresponding to each page from the database according to the page skin information corresponding to each page;
and decoding the coded data corresponding to each page to obtain the picture data corresponding to each page.
Further, the decoding the encoded data corresponding to each page to obtain the picture data corresponding to each page includes:
and decoding the coded data corresponding to each page by using a public key and a private key of an AES (advanced encryption Standard) encryption algorithm to obtain the picture data corresponding to each page, wherein the coded data is obtained by coding the picture data in advance according to the AES encryption algorithm and the base64 algorithm.
Further, the step of creating a preset document according to the page format information and the picture data corresponding to each page includes:
according to the page format information corresponding to each page, an ftl template corresponding to each page is obtained;
and creating a preset document according to the ftl template corresponding to each page and the picture data.
Further, after the step of creating a preset document according to the page format information and the picture data corresponding to each page, the method further includes:
generating a preview of a rich text report according to the layout information corresponding to each page of the cache data and the preset document;
and when a confirmation instruction of the rich text report preview is received, the step of writing the content information corresponding to each page in the cache data into the preset document to generate the rich text report is executed.
In order to achieve the above object, the present application further provides a rich text report generation device, where the rich text report generation device includes:
the acquisition module is used for acquiring service data of a service system and generating cache data rich in text styles according to the service data;
the detection module is used for detecting a setting instruction corresponding to each page in the cache data, wherein the setting instruction is used for setting page format information and page skin information corresponding to the page;
the processing module is used for acquiring the picture data corresponding to each page according to the page skin information;
the creating module is used for creating a preset document according to the page format information and the picture data corresponding to each page;
and the report module is used for writing the content information corresponding to each page in the cache data into the preset document so as to generate a rich text report.
To achieve the above object, the present application also provides a computer device, comprising:
the computer equipment comprises a memory, a processor and a rich text report generation program which is stored on the memory and can run on the processor, wherein the rich text report generation program realizes the steps of the rich text report generation method when being executed by the processor.
In order to achieve the above object, the present application further provides a computer readable storage medium, on which a rich text report generation program is stored, and when being executed by a processor, the rich text report generation program implements the steps of the rich text report generation method.
According to the rich text report generation method, the rich text report generation device, the computer equipment and the computer readable storage medium, each page data in the generated rich text report can support a multi-page format and a multi-page skin, so that the rich text report is generated in a diversified manner, and the requirements of a user on diversified rich text reports are met.
Drawings
FIG. 1 is a schematic diagram illustrating steps of a rich text report generation method according to an embodiment of the present application;
FIG. 2 is a schematic block diagram of a rich text report generation apparatus according to an embodiment of the present application;
fig. 3 is a block diagram illustrating a structure of a computer device according to an embodiment of the present application.
The implementation, functional features and advantages of the objectives of the present application will be further explained with reference to the accompanying drawings.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
Referring to fig. 1, in an embodiment, the method for generating a rich text report includes:
and step S10, acquiring service data of the service system, and generating cache data of rich text styles according to the service data.
Step S20, detecting a setting instruction corresponding to each page in the cache data, where the setting instruction is used to set page format information and page skin information corresponding to the page.
And step S30, acquiring the picture data corresponding to each page according to the page skin information.
Step S40, creating a preset document according to the page format information and the picture data corresponding to each page.
And step S50, writing the content information corresponding to each page in the cache data into the preset document to generate a rich text report.
In this embodiment, the terminal in this embodiment may be a computer device, such as a multi-format visual reporting system; the terminal can also be a rich text report generation device. The following description will take the example of the embodiment terminal as a multi-format visual report system.
As set forth in step S10: the terminal is provided with an online rich text editor, and a user can place the service data of the service system into the rich text editor and adjust the service data style online. After the user confirms that the service data and the style thereof are correct, the service data can be stored in the rich text editor, and the terminal can acquire the service data stored by the user.
It should be noted that a Rich Text Editor (RTE for short) is a Text Editor that can be embedded in a browser and is what is known as a what-you-see-is-what-you-get.
Optionally, the terminal may also support the function of interfacing the service system, provide a rich and complete API (Application Programming Interface) for acquiring the service data of the service system, and implement interfacing at least one service system to dynamically acquire the service data of the service system in real time. I.e. the service data acquired by the terminal, may be acquired from one or more service systems.
Optionally, each service system is configured with a block chain node, the service data of each service system may be stored in the corresponding block chain node first, and the block chain node stores the received service data in a block chain account book manner and updates the received service data globally. The Ledger (Ledger) is a general term for a block chain (also referred to as Ledger data) and a state database synchronized with the block chain.
The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism and an encryption algorithm. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product services layer, and an application services layer.
The block chain underlying platform can comprise processing modules such as user management, basic service, intelligent contract and operation monitoring. The user management module is responsible for identity information management of all blockchain participants, and comprises public and private key generation maintenance (account management), key management, user real identity and blockchain address corresponding relation maintenance (authority management) and the like, and under the authorization condition, the user management module supervises and audits the transaction condition of certain real identities and provides rule configuration (wind control audit) of risk control; the basic service module is deployed on all block chain node equipment and used for verifying the validity of the service request, recording the service request to storage after consensus on the valid request is completed, for a new service request, the basic service firstly performs interface adaptation analysis and authentication processing (interface adaptation), then encrypts service information (consensus management) through a consensus algorithm, transmits the service information to a shared account (network communication) completely and consistently after encryption, and performs recording and storage; the intelligent contract module is responsible for registering and issuing contracts, triggering the contracts and executing the contracts, developers can define contract logics through a certain programming language, issue the contract logics to a block chain (contract registration), call keys or other event triggering and executing according to the logics of contract clauses, complete the contract logics and simultaneously provide the function of upgrading and canceling the contracts; the operation monitoring module is mainly responsible for deployment, configuration modification, contract setting, cloud adaptation in the product release process and visual output of real-time states in product operation, such as: alarm, monitoring network conditions, monitoring node equipment health status, and the like.
When the terminal needs to acquire the service data of the service system, the terminal only needs to be connected to any blockchain node of the blockchain network, and then all the required service data can be acquired. The block chain Network (Blockchain Network) incorporates a new block into a set of a series of nodes of a block chain in a consensus manner.
Therefore, the service data is not easy to lose and tamper, and the safety of service data storage is improved.
Optionally, after the terminal obtains the service data, the terminal maintains the corresponding pattern of each subdata in the service data unchanged by means of a flash translation layer ftl (flash translation layer), so as to generate cache data of a rich text pattern.
As set forth in step S20: the multi-format visual reporting system can support various page formats, including ppt format, pps format, pptx format, doc format, docx format, excel format and the like.
Optionally, the multi-format visual reporting system provides a plurality of page skin pictures, such as background pictures of page skins.
The terminal can output and display the generated cache data so that a user can view the data of each page in the cache data page by page. Meanwhile, the user can set the page format and the page skin corresponding to each page in the cache data by sending a setting instruction. For example, when the user issues a setting instruction based on the currently displayed page, the issued setting instruction corresponds to the current page (i.e., the setting instruction is generated based on the current page).
Further, when the user uses the page format and the page skin corresponding to each page in the cache data set by the setting instruction, the terminal may detect the corresponding setting instruction, determine the page format information corresponding to the page format and the page skin information corresponding to the page skin, and receive the determined page format information and the determined page skin information. Namely, the setting instruction is used for setting page format information and page skin information corresponding to the page in the cache data.
Optionally, when the user sets the page skin of the page in the cached data, the page skin may be set by selecting a page skin picture provided by the multi-format visual report system; the user can also set the page skin by using the self-selected picture (which can be uploaded by the user), and meanwhile, the multi-format visual report system stores the self-selected picture of the user as a new page skin picture, so that the user is supported to customize the page skin by himself.
Certainly, when the user is allowed to set the page skin of the page in the cache data, the page skin or the page format is not set for any page, and at this time, the terminal receives the page format information or the page skin information corresponding to the page as a default value (or a default value) by default. For example, if the page skin information is a null value, the corresponding page skin picture is a background-free picture; and if the page skin information is the default value, the corresponding page skin picture is a preset picture.
Optionally, the multi-format visual report system supports the user to set different page formats for different pages, for example, in the same cache data, a first page is set to be in doc format, and a second page is set to be in pptx format; the multi-format visual report system supports a user to set different page skins for different pages, for example, in the same cache data, a first page is set as a green background picture, and a second page is set as a background-free picture.
As set forth in step S30: the terminal stores each page skin picture in a database in advance in the form of picture data, and each picture data is associated with corresponding page skin information.
Of course, if the page skin picture set by the user is the self-selected picture, the terminal will also store the self-selected picture in the form of picture data in the database. The database can be an in-memory database or a database server.
Optionally, after the terminal obtains the page skin information corresponding to each page of the cached data, the terminal obtains the picture data corresponding to the page skin information from the database.
As set forth in step S40: after the terminal obtains the page format and the picture data corresponding to each page of the cache data, an empty document corresponding to the page format can be generated for each page, and then the picture data corresponding to each page is transmitted to the empty document corresponding to each page, so that a preset document corresponding to each page is obtained. Thus, the generated preset document includes the page format and the page skin (at this time, the preset document does not have the specific content information written therein).
As set forth in step S50: the terminal obtains layout information corresponding to each page in the cache data, wherein the layout information at least comprises pictures, characters, tables or video files represented by the related data and the positions of the related data in the pages.
And writing the content information of each page into a preset document of the corresponding page in the same layout mode according to the layout information corresponding to each page in the cache data, so as to generate a rich text report, wherein the rich text report supports different page formats corresponding to each page.
Optionally, when the terminal outputs the rich text report, the rich text report is output in rtf format by default, and meanwhile, the format of the rich text report is also changed into ppt format, pps format, pptx format, doc format, docx format, excel format, and the like. For example, a user wants to generate a report in ppt format, the first page of the report content corresponding to the rtf-format file is a text description, the second page is a continuous animation, and finally the whole report can be written into an empty slide document (ppt format) to generate a report in the slide format.
In an embodiment, in the generated rich text report, each page data can support a multi-page format and a multi-page skin, so that the diversified generation of the rich text report is realized, and the requirement of a user on the diversified rich text report is met.
In an embodiment, based on the foregoing embodiment, the step of detecting a setting instruction corresponding to each page in the cache data includes:
and step S60, providing a plurality of preset page templates, wherein the preset page templates are associated with page format information and page skin information.
Step S61, when it is detected that a setting instruction is generated based on each page in the cache data, determining a preset page template to which the setting instruction is directed.
Step S62, associating the preset page template for the setting instruction with the page corresponding to the setting instruction in the cache data.
Step S63, taking the page format information and the page skin information of the preset page template associated with each page as the page format information and the page skin information corresponding to each page.
In this embodiment, the terminal generates a plurality of preset page templates in advance, each preset page template is designed with at least one preset page, and a page format and a page skin are preset in the preset page, so that a user can view a page format effect and a page skin effect. Some exemplary data may also be displayed in the default page.
Of course, the page format information corresponding to the page format set in the preset page is associated with the preset page, and the page skin information corresponding to the page skin set in the preset page is associated with the preset page, that is, the preset page template includes the page format information and the page skin information.
The terminal may count all the page formats and all the page skins, determine a cartesian product between the total page format and the total page skin, obtain a combination of any page format and any page skin, and generate a preset page template corresponding to each combination according to the page format and the page skin in each combination.
Optionally, after the terminal converts the service data into the cache data, the data of each page in the cache data may be displayed, and at this time, the user may select a corresponding preset page template for each page in the cache data based on the preset page template provided by the terminal.
Optionally, after the user selects the corresponding preset page template for the current page, the terminal determines that there is a setting instruction generated based on the page in the cache data, and at this time, the terminal may determine the preset page template to which the setting instruction is directed (or the preset page template selected by the setting instruction). And then the terminal associates the preset page template corresponding to the setting instruction with the page (namely the current page) corresponding to the setting instruction in the cache data.
In this way, after the user selects the corresponding preset page template for each page through the setting instruction, the terminal can use the page format information and the page skin information of the preset page template associated with each page as the received page format information and the received page skin information corresponding to each page.
It should be understood that, if a page without a corresponding preset page template is present in the cache data, the page format information and the page skin information of the page are defaulted to be default values or null values.
Therefore, the user can configure the page format and the page skin for the page in the cache data conveniently.
In an embodiment, on the basis of the above embodiment, before the step of providing a plurality of preset page templates, the method further includes:
step S64, generating the preset page template according to a page format option factor, a page quantity factor, a page sequence factor and a page skin option factor, wherein the page format information is determined according to the page format option factor, and the page skin information is determined according to the page skin option factor.
In this embodiment, the preset page template generated in advance by the terminal may include a plurality of preset pages, and each preset page is provided with a corresponding page format and a corresponding page skin.
Optionally, when customizing the preset page template, the developer may customize the page format option factor, the page number factor, the page sequence factor, and the page skin option factor associated with various preset page templates in the multi-format visual reporting system. The page format option factors are characterized in that various page formats selected in a preset page template are associated with page format information corresponding to various page formats; the page quantity factor is characterized by the quantity of preset pages of a page format in a preset page template; the page sequence factor is characterized in that the page sequence factor is the arrangement sequence of each preset page in the preset page template; the page skin option factor is characterized by the page skin selected by each preset page in the preset page template, and the page skin option factor is associated with page skin information corresponding to the page skin selected by each preset page.
For example, the page format option factor includes a ppt format option factor, a pps format option factor, a pptx format option factor, a doc format option factor, a docx format option factor, or an excel format option factor; the page format number factor comprises a preset page number factor in a ppt format, a preset page number factor in a pps format, a preset page number factor in a pptx format, a preset page number factor in a doc format, a preset page number factor in a docx format or a preset page number factor in an excel format; the page format order factor can be regarded as a factor for adjusting the order of the ppt page format, the pps page format, the pptx page format, the doc page format, the docx page format, and the excel page format.
Optionally, the terminal generates a preset page template according to the page format option factor, the page number factor, the page sequence factor and the page skin option factor input by the developer.
For example, setting the page skin option factors of the excel format as no background images and the number of the page skin option factors as 2, setting the ppt format and the docx format as green background images and the number of the page skin option factors of the green background images as 1, sequentially setting the page skin option factors, the ppt format and the docx format, to obtain the preset page template, the page format of the first preset page is the excel format and has no background images, the page format of the second preset page is the excel format and has no background images, the page format of the third preset page is the ppt format and has green background images, and the page format of the fourth preset page is the docx format and has green background images.
Optionally, after the user selects the preset page template for the cache data and sends the setting instruction, the terminal may define the page corresponding to the setting instruction as all pages in the cache data, and associate each preset page in the preset page template for the setting instruction with each page in the cache data one by one.
Optionally, when the actual page number of the cache data is greater than the preset page number corresponding to the preset page template, defining page format information and page skin information corresponding to a part of pages exceeding the preset page number in the cache data as default values or null values; and when the actual page number of the cache data is smaller than the preset page number corresponding to the preset page template, sequentially acquiring the preset pages with the number equal to the actual page number of the cache data according to the arrangement sequence of the preset pages in the preset page template, and associating the acquired preset pages with the pages in the cache data one by one.
In this way, after the user selects the corresponding preset page template, the terminal can use the page format information and the page skin information of the preset page in the preset page template associated with each page as the received page format information and the received page skin information corresponding to each page.
Therefore, the user can configure the page format and the page skin for the page in the cache data conveniently.
In an embodiment, based on the above embodiment, before the step of obtaining the picture data corresponding to each page according to the page skin information, the method further includes:
step S70, acquiring a plurality of picture data;
s71, coding the picture data based on a base64 algorithm to obtain coded data corresponding to the picture data and page skin information corresponding to the coded data;
step S73, storing the coded data into a database;
the step of obtaining the picture data corresponding to each page according to the page skin information comprises the following steps:
step S31, acquiring coded data corresponding to each page from the database according to the page skin information corresponding to each page;
and step S32, decoding the encoded data corresponding to each page to obtain the picture data corresponding to each page. In this embodiment, the terminal stores a plurality of page skin pictures in the database in advance in the form of picture data, and each picture data is associated with corresponding page skin information.
In the process that the page skin picture is stored in the database in the form of picture data, the terminal may encode the picture data based on the base64 algorithm to obtain encoded data, and compress the encoded data. And then, taking the coded base64 character string as page skin information corresponding to the picture data, and storing coded data corresponding to the picture data into a database. When the terminal needs to acquire the picture data stored in the database, the coded data corresponding to each page is acquired from the database according to the page skin information corresponding to each page in the cache data, and then the coded data is decompressed and decoded, so that the picture data corresponding to the page skin information of each page can be acquired. In this way, by compressing the picture data based on the base64 algorithm, it is possible to save the space for storing the picture data and to improve the efficiency of transmitting the picture data (the capacity of encoded data obtained by compressing the data is smaller than that of the picture data, and therefore the transmission efficiency is high).
For example, the user opens the multi-format visual reporting system to select the skin background image or the user-defined skin background image of the memory presented by the corresponding picture data, and finally converts the picture data corresponding to the skin background image or the user-defined skin background image of the memory into the base64 character string to return to the current webpage of the user, so that the current webpage can store the picture data in the database according to the information of the base64 character string.
Optionally, in the process of encoding the picture data based on the base64 algorithm, an AES encryption algorithm may be further added, an unlocking key is randomly generated in a manner of encoding and decoding by using the AES encryption algorithm and the base64 algorithm, and then the encoded data is transmitted and received through a secure channel of the multi-format visual report system, where the key may also be a public key and a private key.
Optionally, the terminal encodes the picture data by using an AES encryption algorithm and a base64 algorithm to obtain encoded data corresponding to each picture data, and then stores the encoded data in the database through the secure channel.
Optionally, an SSH channel is established between the multi-format visual reporting system and the database, the encoded data is transmitted through an SSH secure tunnel, a session key is randomly generated and transmitted through the SSH secure channel, and cluster management and control data transmission can be safely and reliably achieved.
When the terminal needs to acquire the picture data stored in the database, acquiring the coded data corresponding to each page from the database according to the page skin information corresponding to each page in the cache data, and then decoding the coded data corresponding to each page by using the public key and the private key of the AES encryption algorithm, so as to obtain the picture data corresponding to the page skin information of each page.
Therefore, the speed of picture data transmission and the safety of data transmission are improved.
In an embodiment, based on the above embodiment, the step of creating a preset document according to the page format information and the picture data corresponding to each page includes:
s41, acquiring ftl templates corresponding to the pages according to the page format information corresponding to the pages;
and step S42, creating a preset document according to the ftl template and the picture data corresponding to each page.
In this embodiment, the multi-format visual reporting system includes a plurality of ftl templates, each ftl template of the plurality of ftl (which may be referred to as a flash translation layer) templates is used to record mapping from logical addresses to flash physical addresses, and all ftl templates are located in the database. It should be understood that each ftl template may have a different logical block size. For example, when a user wants to generate a report in ppt page format, the first page of the report content corresponding to the overall layout of the format file is a text description (e.g., 32KB), the second page is a continuous animation, the ftl template finally writes the entire report content into an empty slide document (e.g., 256KB), and finally generates a report in slide format, so that the amount of archive data can be accurately calculated.
Optionally, after obtaining the page format and the picture data corresponding to each page of the cached data, the terminal may obtain an ftl template corresponding to the page format according to the page format corresponding to each page, generate an empty document corresponding to each page, and then transmit the picture data corresponding to each page into the empty document corresponding to each page (the empty document is created on the basis of the ftl template), so as to obtain a preset document corresponding to each page.
In this way, the preset document of the page in the cache data is created based on the ftl template, and the created preset document is provided with the page skin.
In an embodiment, on the basis of the above embodiment, after the step of creating a preset document according to the page format information and the picture data corresponding to each page, the method further includes:
and step S80, generating a preview of the rich text report according to the layout information corresponding to each page of the cache data and the preset document.
Step S81, when receiving the confirmation instruction of the rich text report preview, executing the step of writing the content information corresponding to each page in the cached data into the preset document to generate a rich text report.
In this embodiment, the terminal obtains layout information corresponding to each page in the cache data, where the layout information at least includes a picture, a text, a table, or a video file represented by the related data, and a position of the related data in the page.
And then the terminal creates an effect graph obtained by fitting each page of data to the corresponding preset document based on the layout information according to the layout information and the preset document corresponding to each page in the cache data, and integrates the effect graphs corresponding to all the pages into a preview graph of the rich text report.
And outputting the preview image of the rich text report so that the user can intuitively feel the display effect of the finally formed rich text report. If the user is not satisfied with the display effect, the process may return to step S20 to readjust the page format and/or page skin of the page in the cached data; if the user is satisfied with the display effect, a confirmation instruction of the preview of the rich text report may be sent, and after the terminal receives the confirmation instruction, the step of writing the content information corresponding to each page in the cached data into the preset document to generate the rich text report (i.e., step S50) may be executed, according to the layout information corresponding to each page in the cached data, each page of data is written into the preset document of the corresponding page in the same layout manner, so as to generate the rich text report, and the rich text report is printed and output.
Therefore, the user can conveniently check the display effect of the finally formed rich text report.
Optionally, the terminal may determine a usage group corresponding to the user according to the user information, and determine the usage right corresponding to the user according to the usage group. The using permission comprises a first permission and a second permission, the first permission allows sending of a confirmation instruction of the rich text report preview (that is, the rich text report corresponding to the rich text report preview can be finally generated and output), and the second permission does not allow sending of the confirmation instruction of the rich text report preview (that is, only the rich text report preview can be generated, but not the rich text report can be generated and output).
When the terminal receives a confirmation instruction of the rich text report preview image, user information corresponding to the confirmation instruction is obtained first, and the use permission corresponding to the user information is obtained. Then detecting whether the use authority belongs to the first authority; if yes, executing the step of writing the content information corresponding to each page in the cache data into the preset document to generate a rich text report (i.e., step S50); if not, the terminal does not respond.
For example, the first right may be owned by a paying user, the second right may be owned by an unpaid user, and the user may obtain the first right by upgrading to a paying user. And developing a function of generating the rich text report preview image for the user with the second authority, obtaining the first authority by paying upgrade when the user is satisfied with the display effect of the rich text report preview image, generating the rich text report corresponding to the rich text report preview image, and then printing and outputting the rich text report.
In this way, the data processing resource shortage of the system caused by the abuse of the function of generating the rich text report can be avoided.
Referring to fig. 2, an embodiment of the present application further provides a device 10 for generating a rich text report, including:
the acquisition module 11 is configured to acquire service data of a service system and generate cache data in a rich text style according to the service data;
a detection module 12, configured to detect a setting instruction corresponding to each page in the cache data, where the setting instruction is used to set page format information and page skin information corresponding to the page;
the processing module 13 is configured to obtain picture data corresponding to each page according to the page skin information;
a creating module 14, configured to create a preset document according to the page format information and the picture data corresponding to each page;
and the report module 15 is configured to write content information corresponding to each page in the cache data into the preset document, so as to generate a rich text report.
Referring to fig. 3, a computer device, which may be a server and whose internal structure may be as shown in fig. 3, is also provided in the embodiment of the present application. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the computer designed processor is used to provide computational and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for a rich text report generation program. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a rich text report generation method.
Those skilled in the art will appreciate that the architecture shown in fig. 3 is only a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects may be applied.
In addition, the present application also provides a computer-readable storage medium, which includes a rich text report generation program, and when the rich text report generation program is executed by a processor, the steps of the rich text report generation method according to the above embodiments are implemented. It is to be understood that the computer-readable storage medium in the present embodiment may be a volatile-readable storage medium or a non-volatile-readable storage medium.
In summary, according to the rich text report generation method, the rich text report generation device, the computer device and the storage medium provided in the embodiment of the present application, each page data in the generated rich text report can support multiple page formats and multiple page skins, so that diversified generation of the rich text report is realized, and the user's requirements for diversified rich text reports are met.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium provided herein and used in the examples may include non-volatile and/or volatile memory. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), double-rate SDRAM (SSRSDRAM), Enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, apparatus, article, or method that includes the element.
The above description is only for the preferred embodiment of the present application and not intended to limit the scope of the present application, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the specification and the drawings of the present application, or which are directly or indirectly applied to other related technical fields, are intended to be included within the scope of the present application.

Claims (10)

1. A method for generating a rich text report is characterized by comprising the following steps:
acquiring service data of a service system, and generating cache data with rich text styles according to the service data;
detecting a setting instruction corresponding to each page in the cache data, wherein the setting instruction is used for setting page format information and page skin information corresponding to the page;
acquiring picture data corresponding to each page according to the page skin information;
creating a preset document according to the page format information and the picture data corresponding to each page;
and writing the content information corresponding to each page in the cache data into the preset document to generate a rich text report.
2. The method for generating a rich text report as claimed in claim 1, wherein said step of detecting a setting instruction corresponding to each page in said cached data comprises:
providing a plurality of preset page templates, wherein the preset page templates comprise page format information and page skin information;
when detecting that a setting instruction is generated on the basis of each page in the cache data, determining a preset page template for the setting instruction;
associating a preset page template aimed at by the setting instruction with a page corresponding to the setting instruction in the cache data;
and taking the page format information and the page skin information of the preset page template associated with each page as the page format information and the page skin information corresponding to each page.
3. The method for generating a rich text report as recited in claim 2 wherein said step of providing a plurality of predefined page templates is preceded by the steps of:
and generating the preset page template according to the page format option factor, the page quantity factor, the page sequence factor and the page skin option factor, wherein the page format information is determined according to the page format option factor, and the page skin information is determined according to the page skin option factor.
4. The method for generating a rich text report according to claim 1, wherein before the step of obtaining the picture data corresponding to each page according to the page skin information, the method further comprises:
acquiring a plurality of picture data;
coding picture data based on a base64 algorithm to obtain coded data corresponding to the picture data and page skin information corresponding to the coded data;
storing the encoded data in a database;
the step of obtaining the picture data corresponding to each page according to the page skin information comprises the following steps:
acquiring coded data corresponding to each page from the database according to the page skin information corresponding to each page;
and decoding the coded data corresponding to each page to obtain the picture data corresponding to each page.
5. The method for generating a rich text report as recited in claim 4, wherein the step of decoding the encoded data corresponding to each of the pages to obtain the picture data corresponding to each of the pages comprises:
and decoding the coded data corresponding to each page by using a public key and a private key of an AES (advanced encryption Standard) encryption algorithm to obtain the picture data corresponding to each page, wherein the coded data is obtained by coding the picture data in advance according to the AES encryption algorithm and the base64 algorithm.
6. The method for generating a rich text report as claimed in claim 1, wherein said step of creating a preset document according to said page format information and said picture data corresponding to each of said pages comprises:
according to the page format information corresponding to each page, an ftl template corresponding to each page is obtained;
and creating a preset document according to the ftl template corresponding to each page and the picture data.
7. The method for generating a rich text report according to any one of claims 1-6, wherein after the step of creating a preset document according to the page format information and the picture data corresponding to each page, the method further comprises:
generating a preview of a rich text report according to the layout information corresponding to each page of the cache data and the preset document;
and when a confirmation instruction of the rich text report preview is received, the step of writing the content information corresponding to each page in the cache data into the preset document to generate the rich text report is executed.
8. An apparatus for generating a rich text report, comprising:
the acquisition module is used for acquiring service data of a service system and generating cache data rich in text styles according to the service data;
the detection module is used for detecting a setting instruction corresponding to each page in the cache data, wherein the setting instruction is used for setting page format information and page skin information corresponding to the page;
the processing module is used for acquiring the picture data corresponding to each page according to the page skin information;
the creating module is used for creating a preset document according to the page format information and the picture data corresponding to each page;
and the report module is used for writing the content information corresponding to each page in the cache data into the preset document so as to generate a rich text report.
9. A computer device comprising a memory, a processor and a rich-text report generator stored on the memory and executable on the processor, the rich-text report generator when executed by the processor implementing the steps of the rich-text report generation method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a rich-text report generation program, which when executed by a processor, implements the steps of the rich-text report generation method according to any one of claims 1 to 7.
CN202011247770.8A 2020-11-10 2020-11-10 Rich text report generation method and device, computer equipment and storage medium Pending CN112182201A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011247770.8A CN112182201A (en) 2020-11-10 2020-11-10 Rich text report generation method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011247770.8A CN112182201A (en) 2020-11-10 2020-11-10 Rich text report generation method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112182201A true CN112182201A (en) 2021-01-05

Family

ID=73918087

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011247770.8A Pending CN112182201A (en) 2020-11-10 2020-11-10 Rich text report generation method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112182201A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113268968A (en) * 2021-04-28 2021-08-17 企查查科技有限公司 Report file generation method and device, computer equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20150120153A (en) * 2014-04-17 2015-10-27 삼성전자주식회사 Method for saving and expressing webpage
CN106096064A (en) * 2016-07-19 2016-11-09 百度在线网络技术(北京)有限公司 For the method and apparatus generating the page
US20170116639A1 (en) * 2007-11-14 2017-04-27 Google Inc. Formatting web pages with advertisements
CN109901834A (en) * 2019-01-25 2019-06-18 平安科技(深圳)有限公司 Document file page generation method, device, computer equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170116639A1 (en) * 2007-11-14 2017-04-27 Google Inc. Formatting web pages with advertisements
KR20150120153A (en) * 2014-04-17 2015-10-27 삼성전자주식회사 Method for saving and expressing webpage
CN106096064A (en) * 2016-07-19 2016-11-09 百度在线网络技术(北京)有限公司 For the method and apparatus generating the page
CN109901834A (en) * 2019-01-25 2019-06-18 平安科技(深圳)有限公司 Document file page generation method, device, computer equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113268968A (en) * 2021-04-28 2021-08-17 企查查科技有限公司 Report file generation method and device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN108881290B (en) Block chain based digital certificate use method, system and storage medium
CN108701145B (en) System and method for digital identity management and admissions control in distributed network node
CN110535971B (en) Interface configuration processing method, device, equipment and storage medium based on block chain
CN108573737B (en) Storage method, device, equipment and storage medium of electronic medical record
CN109784922B (en) Electronic contract signing method, electronic contract signing device, computer equipment and storage medium
WO2016173993A1 (en) Method for generating an electronic signature
CN111177735B (en) Identity authentication method, device, system and equipment and storage medium
JP2015528947A (en) Method and system for secure communication of personal information
CN102025710A (en) Multi-application intelligent card and intelligent card multi-application management system and method
KR20080105721A (en) Text security method
CN110597541B (en) Interface updating processing method, device, equipment and storage medium based on block chain
CN113326081A (en) Static resource processing method and device, computer equipment and storage medium
CN111625809A (en) Data authorization method and device, electronic equipment and storage medium
CN112668041A (en) Document file generation method and device, computer equipment and storage medium
CN109688210A (en) Track method, apparatus, server and the storage medium of user information
CN110598375A (en) Data processing method, device and storage medium
CN111339141A (en) Data transmission method, block link node equipment and medium
CN112182201A (en) Rich text report generation method and device, computer equipment and storage medium
CN104978537A (en) Document access authority configuration method and device
CN113468862A (en) Method and device for creating layout file by block chain, electronic equipment and storage medium
CN111415285A (en) Specific personnel information management method and terminal based on hierarchical administrative regions
CN112650659B (en) Buried point setting method and device, computer equipment and storage medium
CN113342835B (en) Method, device, equipment and medium for modifying text to be checked based on blockchain
EP3289509B1 (en) Method for generating an electronic signature
KR20050044948A (en) System and method for preparing a living will using network

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
AD01 Patent right deemed abandoned

Effective date of abandoning: 20240507