CN118095242B - Method, device, equipment and medium for making document in real time based on BS frame - Google Patents

Method, device, equipment and medium for making document in real time based on BS frame Download PDF

Info

Publication number
CN118095242B
CN118095242B CN202410494159.7A CN202410494159A CN118095242B CN 118095242 B CN118095242 B CN 118095242B CN 202410494159 A CN202410494159 A CN 202410494159A CN 118095242 B CN118095242 B CN 118095242B
Authority
CN
China
Prior art keywords
data
document
docx
entity
target
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.)
Active
Application number
CN202410494159.7A
Other languages
Chinese (zh)
Other versions
CN118095242A (en
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.)
Aerospace Hongtu Information Technology Co Ltd
Original Assignee
Aerospace Hongtu Information Technology Co Ltd
Filing date
Publication date
Application filed by Aerospace Hongtu Information Technology Co Ltd filed Critical Aerospace Hongtu Information Technology Co Ltd
Priority to CN202410494159.7A priority Critical patent/CN118095242B/en
Publication of CN118095242A publication Critical patent/CN118095242A/en
Application granted granted Critical
Publication of CN118095242B publication Critical patent/CN118095242B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention provides a document real-time making method, device, equipment and medium based on a BS frame, which comprises the following steps: and determining data to be edited from the data provided in the data selection area through a rich text editor, responding to a Docx J processing library, converting elements contained in the initial document data into target Docx J entities according to the mapping relation between the elements and the custom entities and the mapping relation between the custom entities and Docx J entities, and generating target document data based on the target Docx J entities. The invention can flexibly meet the requirements of more complex formats or content adjustment, and can be tightly combined with business, thereby reducing the dependence on third-party plug-ins.

Description

Method, device, equipment and medium for making document in real time based on BS frame
Technical Field
The invention relates to the technical field of weather forecast, in particular to a document real-time making method, device, equipment and medium based on a BS frame.
Background
In the process of expanding the weather service, the BS system can realize efficient inquiry and utilization of service products such as pictures, tables and the like, and ensures the smoothness of the service flow. But the document is often produced as the final purpose of a system service, as the final presentation form of integrated service information. In document production, some systems generate documents in a timed manner that can only meet the document requirements of fixed content. Real-time online document production is indispensable. There are currently two ways to achieve this. Firstly, the document format, typesetting and style are fixed, and only text is replaced in the system. And secondly, the method is realized by adopting a plug-in of a third party.
The common realization mode of the current business has the defects. The method of using a fixed document format and replacing only text therein, while simple and easy to operate, does not provide a dynamic real-time editing experience because it does not support the interactive production of what you see is what you get. This approach may be applicable to documents where the structure is unchanged, only the text content needs to be updated, but is not flexible enough to cope with more complex format or content adaptation requirements. While third party plug-ins, while providing online real-time editing and what you see is what you get, meet the more diverse editing needs, the non-open-source nature does limit the ability of developers to adjust and customize functionality as needed. This constraint is particularly important in cases where the business requirements change frequently, and in most cases cannot be as closely related to the business as the self-developed function. In addition, since most third party plug-ins require pay-for-use, this not only increases the cost burden of the enterprise, but may also lead to increased reliance on the provider, which may pose a risk to the business if the provider changes price policies or terminates services.
Disclosure of Invention
In view of the above, the present invention aims to provide a method, apparatus, device and medium for real-time document production based on BS framework, which can flexibly cope with more complex format or content adjustment requirements, and can be tightly combined with services, thereby reducing the dependency on third party plug-ins.
In a first aspect, an embodiment of the present invention provides a BS frame based document real-time production method, which is applied to a document real-time production system, where a rich text editor is configured at a front end of the document real-time production system, and a document editing area and a data selecting area are configured in the rich text editor, and a Docx J processing library is configured at a rear end of the document real-time production system, and the method includes:
determining data to be edited from the data provided in the data selection area through the rich text editor, and responding to editing operation of the data to be edited displayed in the document editing area to generate initial document data; wherein the data provided by the data selection area comprises one or more of a material template, material data, live data and forecast thematic product data;
And converting the elements contained in the initial document data into target Docx4J entities according to the mapping relation between the elements and the custom entities and the mapping relation between the custom entities and Docx J entities through Docx4J processing library, and generating target document data based on the target Docx4J entities.
In one embodiment, the step of determining data to be edited from the data provided in the data selection area by the rich text editor, and generating initial document data in response to an editing operation for the data to be edited displayed in the document editing area, includes:
responding to a query operation for the data provided in the data selection area to determine data to be edited;
displaying an editing control and data to be edited through the document editing area;
Responding to the operation aiming at the editing control to edit the data to be edited displayed in the document editing area to obtain initial document data; wherein, the initial document data is stored in an Html format.
In one embodiment, the step of determining the data to be edited in response to a query operation for the data provided in the data selection area includes:
And taking the current time information and/or the weather live data as query conditions, and screening the data to be edited from the data provided in the data selection area.
In one embodiment, the step of converting the element included in the initial document data into the target Docx J entity according to the mapping relationship between the element and the custom entity and the mapping relationship between the custom entity and the Docx J entity includes:
according to the mapping relation between the elements and the custom entities, converting the elements contained in the initial document data and the attribute information corresponding to the elements into target custom entities;
And converting the target custom entity into a target Docx J entity according to the mapping relation between the custom entity and the Docx J entity.
In one embodiment, before the step of converting the element included in the initial document data and the attribute information corresponding to the element into the target custom entity according to the mapping relationship between the element and the custom entity, the method further includes:
And establishing HtmlToDocment an entity as an Html parser, and disassembling the initial document data through the Html parser to obtain the elements contained in the initial document data and the attribute information corresponding to the elements.
In one embodiment, the target Docx J entity includes a P-paragraph object that describes one or more of a paragraph, attribute information of a paragraph, text content contained by a paragraph, and attribute information of text content.
In one embodiment, the object Docx J entity includes a Pict graphical object that is used to describe one or more of attribute information, text description information, hyperlink information, scale, transparency of a graphical element.
In a second aspect, an embodiment of the present invention further provides a BS frame-based document real-time production apparatus, which is applied to a document real-time production system, where a rich text editor is used at a front end of the document real-time production system, the rich text editor is configured with a document editing area and a data selecting area, and a Docx J processing library is used at a rear end of the document real-time production system, and the apparatus includes:
A rich text editing module for determining data to be edited from the data provided in the data selection area through the rich text editor, and responding to editing operation for the data to be edited displayed in the document editing area to generate initial document data; wherein the data provided by the data selection area comprises one or more of a material template, material data, live data and forecast thematic product data;
the document generation module is used for converting the elements contained in the initial document data into target Docx J entities through Docx J processing library according to the mapping relation between the elements and the custom entities and the mapping relation between the custom entities and Docx J entities, and generating target document data based on the target Docx J entities.
In a third aspect, an embodiment of the present invention further provides an electronic device comprising a processor and a memory storing computer-executable instructions executable by the processor to implement the method of any one of the first aspects.
In a fourth aspect, embodiments of the present invention also provide a computer-readable storage medium storing computer-executable instructions which, when invoked and executed by a processor, cause the processor to implement the method of any one of the first aspects.
The embodiment of the invention provides a document real-time making method, device, equipment and medium based on a BS frame, which are applied to a document real-time making system, wherein the front end of the document real-time making system adopts a rich text editor, the rich text editor is configured with a document editing area and a data selecting area, the rear end adopts a Docx J processing library, firstly, data to be edited is determined from data provided in the data selecting area through the rich text editor, and editing operation aiming at the data to be edited displayed in the document editing area is responded to generate initial document data, and the data provided in the data selecting area comprises one or more of a material template, material data, live data and forecast special product data; then through Docx J processing library, according to the mapping relation between the element and the custom entity and the mapping relation between the custom entity and Docx J entity, converting the element contained in the initial document data into target Docx4J entity, and generating target document data based on target Docx4J entity. The front end of the method adopts a rich text editor, the rear end adopts Docx J processing libraries, the technology which belongs to different languages of the front section and the rear section is connected in series, the function of real-time online document making which is obtained immediately after being seen is realized, and the embodiment of the invention has stronger adaptability and operability when facing complex and changeable business requirements, thereby flexibly coping with the more complex format or content adjustment requirements, and in addition, the method can be tightly combined with the business, thereby reducing the dependence on third-party plug-ins.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
In order to make the above objects, features and advantages of the present invention more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are needed in the description of the embodiments or the prior art will be briefly described, and it is obvious that the drawings in the description below are some embodiments of the present invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of a document real-time making method based on a BS framework provided by an embodiment of the invention;
FIG. 2 is an interface diagram of a TinyMCE rich text editor according to an embodiment of the present invention;
fig. 3 is a schematic diagram of query and insertion of service data according to an embodiment of the present invention;
Fig. 4 is an interface schematic diagram of a service data retrieval panel according to an embodiment of the present invention;
FIG. 5 is an overall flowchart of a document real-time production method based on a BS framework provided by an embodiment of the invention;
FIG. 6 is a schematic structural diagram of a document real-time making device based on a BS framework according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described in conjunction with the embodiments, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
At present, a method for adopting a fixed document format and only replacing text in the fixed document format is not flexible enough to meet more complex format or content adjustment requirements, and a method for adopting a third-party plug-in cannot be closely related to business.
For the understanding of this embodiment, the method for making a document in real time based on a BS framework disclosed in the embodiment of the present invention is first described in detail, and the method is applied to a document real-time making system, where a rich text editor is adopted at the front end of the document real-time making system, and Docx4J processing libraries are adopted at the rear end, see a schematic flow chart of a document real-time making method based on a BS framework shown in fig. 1, and the method mainly includes the following steps S102 to S104:
step S102, determining data to be edited from the data provided in the data selection area by the rich text editor, and responding to the editing operation of the data to be edited displayed in the document editing area to generate initial document data.
The rich text editor can specifically adopt TinyMCE rich text editor, and the rich text editor is integrated into a browser to create a customized text editing environment. The rich text editor is configured with a document editing area and a data selection area, the document editing area is configured with an editing toolbar which comprises editing controls corresponding to functions of editing text, view conversion, form insertion, text format and the like, and data provided by the data selection area comprises one or more of material templates, material data, live data and forecast thematic product data.
In one embodiment, the TinyMCE rich text editor may provide default data as the data to be edited, or may use the data selected by the user in the data selection area as the data to be edited, and respond to the user's operation on each editing control provided in the editing toolbar to generate the required initial document data, where the initial document data is in an Html (Hyper Text Markup Language ) format, and the initial document data in the Html format is transferred to the backend.
Step S104, through Docx to 4J processing library, according to the mapping relation between the element and the custom entity and the mapping relation between the custom entity and Docx to 4J entity, converting the element contained in the initial document data into target Docx J entity, and generating target document data based on target Docx J entity.
In one embodiment, the initial document data in the Html format may be parsed, so that according to a mapping relationship between an element and a custom entity, the element included in the initial document data is converted into a target custom entity, further according to a mapping relationship between the custom entity and Docx J entity, the target custom entity is converted into a target Docx J entity, and finally, the required target document data is generated based on the target Docx J entity.
According to the method for making the document based on the BS framework in real time, the rich text editor is adopted at the front end, the Docx J processing library is adopted at the rear end, and the technology belonging to different languages at the front end and the rear end is connected in series to realize the function of making the real-time online document obtained by the sight.
For easy understanding, the embodiment of the invention provides a specific implementation manner of a document real-time making method based on a BS framework, see the following steps 1 to 5:
step 1, front-end visualization and customization transformation based on TinyMCE rich text editor.
A TinyMCE rich text editor is integrated in the browser. Referring to FIG. 2, an interface diagram of a TinyMCE rich text editor is shown, with a document editing area on the left and a data selection area on the right. Designating a document editing area of an editor, adding a document editing toolbar in the area, wherein the toolbar comprises editing controls corresponding to functions such as editing text, view conversion, insertion form, text format and the like, displaying a common material template file and an information text on the right side, and clicking the common material template file and the information text to load the common material template file and the information text into a designated position of a document. The user inserts and modifies the text content and style of the form, the picture, the paragraph by clicking the icon button in the page toolbar, and based on specific requirements, the TinyMCE rich text editor is developed secondarily, so that the centering function of the form, the picture and the like is added.
Integrating TinyMCE the rich text editor into the browser creates a customized text editing environment. A specific text editing area is defined in the editor, provided with a toolbar containing a plurality of tools. These tools support functions such as editing text, view conversion, inserting tables, and formatting text. With continued reference to fig. 2, the ui interface is designed to allow for ease of use, and a panel (i.e., data selection area) is specifically provided on the right side for ease of use by the user, wherein commonly used material templates, material data, live data, forecast thematic product data are presented, allowing the user to quickly load these content into a specified location of the document in a single click.
The user operation interface is quite visual, forms, pictures and paragraphs can be easily inserted and modified by clicking icon buttons on the page toolbar, and meanwhile, the style of the selected content can be freely adjusted. Different users may have different needs, and therefore, the TinyMCE rich text editor was developed secondarily, adding additional functions, such as improved form and picture centering tools, which provided the user with richer editing options and higher degrees of operational freedom. The integration scheme not only improves the efficiency and user experience of document processing, but also can flexibly adapt to the continuously-changing business requirements due to expansibility.
And 2, making the real-time online page document.
In one example, see steps 2.1 to 2.3 below:
and 2.1, responding to a query operation for the data provided in the data selection area to determine the data to be edited.
In one embodiment, the user may interact with the data selection area to select desired data therefrom as the data to be edited.
Illustratively, the preset template on the right side of the interface is loaded by a click operation. These templates are configured by the backend and stored in HTML format to ensure that the front-end can render and present it properly through the rich text editor. Each template is built around the basic building blocks of HTML, typical elements include < table > tags for creating tables, < p > tags for paragraphs, < span > tags for in-line elements and < img > tags for embedding pictures.
In addition, the current time information and/or the weather live data are used as query conditions, and the data to be edited are screened from the data provided in the data selection area. Querying live content typically includes: precipitation, minimum air temperature, strong wind and weather phenomenon information from today, yesterday, last 24 hours and1 to 6 days before. Typically, a topical product map corresponding to time is provided and text analysis is performed within the time range (e.g., 24 hours in the past, a past 24 hour product based on the current time determination is provided. E.g., 20 minutes in the current 15 hours, i.e., the generated pictures and text correspond to 15 hours yesterday-15 hours today)
Illustratively, the system makes a default selection of products based on current operating user, current time, and or weather live data, e.g., selecting "materials templates" as "two-office" by default for users who frequently select "two-office"; the type of weather disaster early warning is selected as cold tide by default when the current time is about 1 month; the average air temperature in the current weather live reaches 40 ℃, and the type of weather disaster early warning is selected as high temperature by default.
And 2.2, displaying the editing control and the data to be edited through the document editing area.
Step 2.3, responding to the operation aiming at the editing control to edit the data to be edited displayed in the document editing area to obtain initial document data; wherein, the initial document data is stored in an Html format.
The embodiment of the invention provides the contents such as thematic map, intelligent language text description, statistical chart and the like produced in a highly integrated system. Through configuration management between TinyMCE rich text editor and system product inquiry, the system service is highly integrated, the use of users is convenient, and the independence of auxiliary text editing is ensured. Referring to a query and insertion schematic diagram of service data shown in fig. 3 and an interface schematic diagram of a service data retrieval panel shown in fig. 4, the embodiment of the invention allows a user to select products based on real-time and forecast, and by using this function, the user can quickly retrieve relevant information of any product in the system. A one-click operation is provided for the search result, and the user can directly insert the text, the picture and the table into the document. To further enhance the user experience, the front end automatically provides default style and size settings for the inserted pictures, text, and forms. Such a design is intended to simplify the editing process while allowing the user to customize these elements to personal preferences. The default style provided by the system is dynamically adjusted according to the use history, the product type and the like of the user, and the user can not only be limited to the default style provided by the system, but also adjust the attributes such as font size, color, table layout, picture size and the like according to the specific requirements or personal preference of different weather service documents.
In one example, our system achieves fast document editing while preserving personalized degrees of freedom by providing standardized templates in combination with what you see is what you get editing experience in a rich text editor, meeting the needs of various complex document editing.
In one example, by selecting based on the live forecast on the right side, the retrieval of any product in the system is realized, and the one-key insertion function of characters, pictures and forms is provided.
In one example, the front end gives a default style and size for pictures, text, tables. Supporting user-defined adjustments.
And step 3, mapping the initial document data in the Html format into a custom entity. In one embodiment, htmlToDocment entities can be established as an Html parser, and the initial document data is disassembled through the Html parser to obtain the elements contained in the initial document data and the attribute information corresponding to the elements; and converting the elements contained in the initial document data and attribute information corresponding to the elements into target custom entities according to the mapping relation between the elements and the custom entities.
The front-end TinyMEC rich text editor will assemble the style and elements seen by the front-end into html and transfer the html to the back-end. For different elements, a set of regularized corresponding relations are realized at the front end and the rear end. By parsing html, content is mapped sequentially into entities.
Specifically, a HtmlToDocment entity is established as an html parser. The content in the html is disassembled, and the following is the content contained by the corresponding entity after the document content is disassembled:
(1) MainDocumentPart: the body content of the document comprises words, pictures, tables and the like.
(2) StyleDefinitionsPart: style definitions of documents, such as paragraph style, title style, etc.
(3) FontTablePart: font information used in the document.
(4) NumberingDefinitionsPart: for defining bullets and numbering formats.
(5) CommentsPart: annotation information in a document.
(6) METADATAPART: metadata of the document, such as author, title, description, etc.
Meanwhile, an entity is established for html common elements, the disassembled parts are mapped to the element entities, and main elements comprise the following contents:
And 4, customizing the mapping relation between the entity and Docx J entity to realize consistency of front end and back end. In one embodiment, the target custom entity may be converted to the target Docx4J entity according to a mapping between the custom entity and the Docx4J entity.
In a specific implementation, after completing the html data conversion entity, the mapping relationship between the custom entity and the Docx J entity is further processed, and the mapping relationship is as follows:
in one example, the object Docx J entity includes a P paragraph object that describes one or more of a paragraph, paragraph attribute information, text content contained in the paragraph, and attribute information for the text content.
The P paragraph object contains attribute information such as centering (ALIGNTYPE), retracting (isTextIndent), line height (LINEHEIGHT) and the like of the paragraphs, the attribute information is parsed from an original html data style (style), and the paragraphs of a word document are obtained through further transformation, and the displayed contents are as follows:
< w: p > represents a paragraph containing one or more < w: r > elements for representing different text runs. In the < w: r > element, the text content may be represented using the < w: t > element. Thus, the < P > tag in HTML can be considered as a paragraph object (P) created in docx4j, and the style and content of the paragraph can be set using the corresponding methods and attributes.
In one example, the object Docx J entity includes a Pict graphical object that is used to describe one or more of attribute information, text description information, hyperlink information, scaling, transparency for a graphical element.
The Pict graphic object is one graphic object in a Word document and can contain drawing elements, embedded images, charts, formulas and the like. In Word documents, the Pict graphic objects are typically automatically created by OLE (Object LINKING AND Embedding), and different types of Pict graphic objects may use different storage formats, such as EMF, WMF, BMP, PNG, etc.
In Docx4J, the graphical elements in the Word document may be represented using the Pict graphical object. The Pict object is one of the classes of JAXB, which may correspond to the < w: pict > element in WordprocessingML markup language. Using the Pict graphic object, the graphic element can be embedded in a Word document or linked to an external file or URL.
The Pict object provides various attributes and methods, which can be used for controlling the size, position, rotation angle, border, filling and other styles of the graphic elements, and can also be used for setting text description, hyperlink, scaling, transparency and the like of the elements. Meanwhile, complex graphic elements such as charts, formulas and the like can be generated and operated by using the Pict graphic objects, so that richer graphic effects are realized, and the displayed contents are as follows:
In this example VML (Vector Markup Language) is used to create a vector graphics object and embed it in the paragraph as a horizontal line. The < v: rect > element represents a rectangle, width and height attributes are set, and a solid border color. This rectangle is contained as a graphical object (< w: picture >) in a run (< w: r >) and then presented as the content of a paragraph (< w: p >).
Note that the elements < w: p >, < w: r >, < w: peptide >, < v: rect >, and < w: t > in XML all belong to WordprocessingML markup languages for describing the structure and content of Word documents. When creating a Word document using Docx J4J, the specification of WordprocessingML needs to be followed to represent document elements and properties, and the corresponding operations are implemented using the API provided by Docx J4.
Step 5, export of target document data:
After the steps are finished, export operation can be carried out on the processed document, products are generated to a local cache directory according to API call specifications provided by Docx J, then the products are written into a client browser in a data stream mode to download the product document, the downloading is waited to be finished, and the document is opened and displayed through a local office program.
In summary, the overall flow of the BS frame-based document real-time production method provided by the embodiment of the present invention is shown in fig. 5, and fig. 5 is an overall flow chart of the BS frame-based document real-time production method, which mainly includes submitting interactive produced Html data, reading the Html data in the background to convert the Html data into a custom entity, converting the custom entity and Docx J entity, processing and producing elements, and exporting Word products. Based on the above, the BS framework-based document real-time production provided by the embodiment of the present invention has at least the following characteristics:
(1) The application technology is open-source, and has stronger adaptability and operability when facing complex and changeable business demands; (2) can be tightly integrated with business system products.
On the basis of the foregoing embodiment, the embodiment of the present invention provides a BS frame-based document real-time production apparatus, which is applied to a document real-time production system, wherein a rich text editor is configured at the front end of the document real-time production system, and is configured with a document editing area and a data selecting area, and a Docx J processing library is configured at the rear end, and the apparatus mainly includes the following parts, referring to a schematic structural diagram of the BS frame-based document real-time production apparatus shown in fig. 6:
A rich text editing module 602 for determining data to be edited from the data provided in the data selection area through a rich text editor, and responding to an editing operation for the data to be edited displayed in the document editing area to generate initial document data; wherein the data provided by the data selection area comprises one or more of a material template, material data, live data, forecast thematic product data;
The document generation module 604 is configured to convert, through the Docx J processing library, an element included in the initial document data into a target Docx J entity according to a mapping relationship between the element and the custom entity and a mapping relationship between the custom entity and the Docx J entity, and generate target document data based on the target Docx J entity.
The document real-time making device based on the BS framework provided by the embodiment of the invention adopts the rich text editor at the front end and the Docx J processing library at the rear end, and realizes the real-time online document making function by connecting technologies belonging to different languages at the front and rear sections in series.
In one embodiment, the rich text editing module 602 is further configured to:
Taking current time information and/or weather live data as query conditions, and screening data to be edited from the data provided in the data selection area;
Displaying an editing control and data to be edited through a document editing area;
Responding to the operation aiming at the editing control to edit the data to be edited displayed in the document editing area to obtain initial document data; wherein, the initial document data is stored in an Html format.
In one embodiment, the rich text editing module 602 is further configured to:
and taking the current time information and/or the weather live data as query conditions, and screening the data to be edited from the data provided in the data selection area.
In one embodiment, the document generation module 604 is further configured to:
Converting the elements contained in the initial document data and attribute information corresponding to the elements into target custom entities according to the mapping relation between the elements and the custom entities;
And converting the target custom entity into a target Docx J entity according to the mapping relation between the custom entity and the Docx J entity.
In one embodiment, the document generation module 604 is further configured to:
and establishing HtmlToDocment an entity as an Html analyzer, and disassembling the initial document data through the Html analyzer to obtain the elements contained in the initial document data and the attribute information corresponding to the elements.
In one embodiment, the object Docx J entity includes a P paragraph object that describes one or more of a paragraph, attribute information for the paragraph, text content contained by the paragraph, and attribute information for the text content.
In one embodiment, the object Docx J entity includes a Pict graphical object that is used to describe one or more of attribute information, text description information, hyperlink information, scale, transparency of a graphical element.
The device provided by the embodiment of the present invention has the same implementation principle and technical effects as those of the foregoing method embodiment, and for the sake of brevity, reference may be made to the corresponding content in the foregoing method embodiment where the device embodiment is not mentioned.
The embodiment of the invention provides electronic equipment, which comprises a processor and a storage device; the storage means has stored thereon a computer program which, when executed by the processor, performs the method of any of the embodiments described above.
Fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, where the electronic device 100 includes: a processor 70, a memory 71, a bus 72 and a communication interface 73, said processor 70, communication interface 73 and memory 71 being connected by bus 72; the processor 70 is arranged to execute executable modules, such as computer programs, stored in the memory 71.
The memory 71 may include a high-speed random access memory (RAM, random Access Memory), and may further include a non-volatile memory (non-volatilememory), such as at least one magnetic disk memory. The communication connection between the system network element and the at least one other network element is achieved via at least one communication interface 73 (which may be wired or wireless), which may use the internet, a wide area network, a local network, a metropolitan area network, etc.
Bus 72 may be an ISA bus, a PCI bus, an EISA bus, or the like. The buses may be classified as address buses, data buses, control buses, etc. For ease of illustration, only one bi-directional arrow is shown in FIG. 7, but not only one bus or type of bus.
The memory 71 is configured to store a program, and the processor 70 executes the program after receiving an execution instruction, where the method executed by the apparatus for flow defining disclosed in any of the foregoing embodiments of the present invention may be applied to the processor 70 or implemented by the processor 70.
The processor 70 may be an integrated circuit chip with signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuitry in hardware or instructions in software in the processor 70. The processor 70 may be a general-purpose processor, including a Central Processing Unit (CPU), a network processor (NetworkProcessor NP), etc.; but may also be a digital signal processor (DIGITAL SIGNAL Processing, DSP), application SPECIFIC INTEGRATED Circuit (ASIC), off-the-shelf Programmable gate array (Field-Programmable GATE ARRAY, FPGA) or other Programmable logic device, discrete gate or transistor logic device, discrete hardware components. The disclosed methods, steps, and logic blocks in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be embodied directly in the execution of a hardware decoding processor, or in the execution of a combination of hardware and software modules in a decoding processor. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in a memory 71 and the processor 70 reads the information in the memory 71 and in combination with its hardware performs the steps of the method described above.
The computer program product of the readable storage medium provided by the embodiment of the present invention includes a computer readable storage medium storing a program code, where the program code includes instructions for executing the method described in the foregoing method embodiment, and the specific implementation may refer to the foregoing method embodiment and will not be described herein.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Finally, it should be noted that: the above examples are only specific embodiments of the present invention, and are not intended to limit the scope of the present invention, but it should be understood by those skilled in the art that the present invention is not limited thereto, and that the present invention is described in detail with reference to the foregoing examples: any person skilled in the art may modify or easily conceive of the technical solution described in the foregoing embodiments, or perform equivalent substitution of some of the technical features, while remaining within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention, and are intended to be included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (7)

1. The method is characterized by being applied to a document real-time making system, wherein the front end of the document real-time making system adopts a rich text editor, the rich text editor is configured with a document editing area and a data selecting area, and the rear end adopts Docx J processing libraries, and the method comprises the following steps:
determining data to be edited from the data provided in the data selection area through the rich text editor, and responding to editing operation of the data to be edited displayed in the document editing area to generate initial document data; wherein the data provided by the data selection area comprises one or more of a material template, material data, live data and forecast thematic product data;
Converting the elements contained in the initial document data into target Docx4J entities according to the mapping relation between the elements and the custom entities and the mapping relation between the custom entities and Docx J entities through Docx4J processing library, and generating target document data based on the target Docx4J entities; the target Docx J entity includes a P paragraph object, where the P paragraph object is used to describe one or more of a paragraph, attribute information of the paragraph, text content contained in the paragraph, and attribute information of the text content; the object Docx J entity includes a Pict graphic object for describing one or more of attribute information, text description information, hyperlink information, a scale, and transparency of a graphic element;
the step of converting the element contained in the initial document data into the target Docx J entity according to the mapping relation between the element and the custom entity and the mapping relation between the custom entity and Docx J entity comprises the following steps: according to the mapping relation between the elements and the custom entities, converting the elements contained in the initial document data and the attribute information corresponding to the elements into target custom entities; and converting the target custom entity into a target Docx J entity according to the mapping relation between the custom entity and the Docx J entity.
2. The BS frame-based document real-time production method according to claim 1, wherein the step of determining data to be edited from the data provided in the data selection area by the rich text editor, and generating initial document data in response to an editing operation for the data to be edited displayed in the document editing area, comprises:
responding to a query operation for the data provided in the data selection area to determine data to be edited;
displaying an editing control and data to be edited through the document editing area;
Responding to the operation aiming at the editing control to edit the data to be edited displayed in the document editing area to obtain initial document data; wherein, the initial document data is stored in an Html format.
3. The BS frame-based document real-time production method according to claim 2, wherein the step of determining the data to be edited in response to a query operation for the data provided in the data selection area comprises:
And taking the current time information and/or the weather live data as query conditions, and screening the data to be edited from the data provided in the data selection area.
4. The BS frame-based document real-time production method according to claim 1, wherein before the step of converting the element contained in the initial document data and the attribute information corresponding to the element into the target custom entity according to the mapping relationship between the element and the custom entity, the method further comprises:
And establishing HtmlToDocment an entity as an Html parser, and disassembling the initial document data through the Html parser to obtain the elements contained in the initial document data and the attribute information corresponding to the elements.
5. The utility model provides a device is made in real time to document based on BS frame, its characterized in that is applied to the real-time system of making of document, the front end of the real-time system of making of document adopts rich text editor, rich text editor is furnished with document editing area and data selection area, and the rear end adopts Docx4J processing storehouse, and the device includes:
A rich text editing module for determining data to be edited from the data provided in the data selection area through the rich text editor, and responding to editing operation for the data to be edited displayed in the document editing area to generate initial document data; wherein the data provided by the data selection area comprises one or more of a material template, material data, live data and forecast thematic product data;
The document generation module is used for converting the elements contained in the initial document data into target Docx J entities through Docx J processing library according to the mapping relation between the elements and the custom entities and the mapping relation between the custom entities and Docx J entities, and generating target document data based on the target Docx J entities; the target Docx J entity includes a P paragraph object, where the P paragraph object is used to describe one or more of a paragraph, attribute information of the paragraph, text content contained in the paragraph, and attribute information of the text content; the object Docx J entity includes a Pict graphic object for describing one or more of attribute information, text description information, hyperlink information, a scale, and transparency of a graphic element;
The document generation module is further configured to: according to the mapping relation between the elements and the custom entities, converting the elements contained in the initial document data and the attribute information corresponding to the elements into target custom entities; and converting the target custom entity into a target Docx J entity according to the mapping relation between the custom entity and the Docx J entity.
6. An electronic device comprising a processor and a memory, the memory storing computer-executable instructions executable by the processor, the processor executing the computer-executable instructions to implement the method of any one of claims 1 to 4.
7. A computer readable storage medium storing computer executable instructions which, when invoked and executed by a processor, cause the processor to implement the method of any one of claims 1 to 4.
CN202410494159.7A 2024-04-24 Method, device, equipment and medium for making document in real time based on BS frame Active CN118095242B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410494159.7A CN118095242B (en) 2024-04-24 Method, device, equipment and medium for making document in real time based on BS frame

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410494159.7A CN118095242B (en) 2024-04-24 Method, device, equipment and medium for making document in real time based on BS frame

Publications (2)

Publication Number Publication Date
CN118095242A CN118095242A (en) 2024-05-28
CN118095242B true CN118095242B (en) 2024-06-28

Family

ID=

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114118038A (en) * 2021-11-30 2022-03-01 深圳壹账通智能科技有限公司 Table document online editing method, device, equipment and medium
CN114239529A (en) * 2021-12-16 2022-03-25 深圳前海环融联易信息科技服务有限公司 Document generation method, device, equipment and medium based on template engine

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114118038A (en) * 2021-11-30 2022-03-01 深圳壹账通智能科技有限公司 Table document online editing method, device, equipment and medium
CN114239529A (en) * 2021-12-16 2022-03-25 深圳前海环融联易信息科技服务有限公司 Document generation method, device, equipment and medium based on template engine

Similar Documents

Publication Publication Date Title
CN109801347B (en) Method, device, equipment and medium for generating editable image template
CN110442822B (en) Method, device, equipment and storage medium for displaying small program content
US7721195B2 (en) RTF template and XSL/FO conversion: a new way to create computer reports
US11341324B2 (en) Automatic template generation with inbuilt template logic interface
US10210142B1 (en) Inserting linked text fragments in a document
US11822615B2 (en) Contextual editing in a page rendering system
US20040041818A1 (en) Design system for website text graphics
JP2009522626A (en) How to create and open a typesetting file on a computer
US10417184B1 (en) Widely accessible composite computer file operative in a plurality of forms by renaming the filename extension
US20120072831A1 (en) Method for creating a multi-lingual web page
CN112631580B (en) Data processing method and device and computing equipment
US20080288861A1 (en) Generating a word-processing document from database content
CN112699641B (en) Method for quickly converting batch copy of WORD content to DM based on S1000D standard
US20110023014A1 (en) Method and apparatus for modifying an executable application using in-memory object representation
CN113391808A (en) Page configuration method and device and electronic equipment
CN114820881A (en) Picture generation method, intelligent terminal and computer readable storage medium thereof
CN118095242B (en) Method, device, equipment and medium for making document in real time based on BS frame
CN118095242A (en) Method, device, equipment and medium for making document in real time based on BS frame
US11526578B2 (en) System and method for producing transferable, modular web pages
CN115309476A (en) Browser-based ofd file display and editing method
US20070206022A1 (en) Method and apparatus for associating text with animated graphics
CN112558957B (en) Method and device for generating webpage form, electronic equipment and readable storage medium
CN113377453A (en) Picture processing method and device and electronic equipment
CN113515929A (en) Typesetting method, device, equipment, storage medium and program product of academic thesis
Andersson et al. Scalable Vector Graphics (SVG) Tiny 1.2 Specification

Legal Events

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