WO2019214182A1 - 文档格式转换方法和装置 - Google Patents

文档格式转换方法和装置 Download PDF

Info

Publication number
WO2019214182A1
WO2019214182A1 PCT/CN2018/113420 CN2018113420W WO2019214182A1 WO 2019214182 A1 WO2019214182 A1 WO 2019214182A1 CN 2018113420 W CN2018113420 W CN 2018113420W WO 2019214182 A1 WO2019214182 A1 WO 2019214182A1
Authority
WO
WIPO (PCT)
Prior art keywords
document
attribute
format
determining
conversion method
Prior art date
Application number
PCT/CN2018/113420
Other languages
English (en)
French (fr)
Inventor
彭骋
Original Assignee
天津字节跳动科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 天津字节跳动科技有限公司 filed Critical 天津字节跳动科技有限公司
Publication of WO2019214182A1 publication Critical patent/WO2019214182A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/93Document management systems

Definitions

  • the present disclosure relates to the field of Internet technologies, and in particular, to a document format conversion and apparatus.
  • the format of computer documents commonly used by users mainly includes text (Text, referred to as TXT), document (Document, referred to as doc), Portable Document Format (PDF), etc., and users can use "Save As” and "Export”. "Equivalent way to achieve the conversion of documents between different formats.
  • the current way in which documents are converted between various formats is usually to convert the "file type" corresponding to the document, such as converting the doc format document to a PDF document, so that the user can open the document with PDF software. , or convert the mind map to a picture in doc format, so that users can open mind maps and so on with doc software.
  • the conversion method of the above document format can only convert the type of the entire document, and cannot convert the content of the document between different formats.
  • the present disclosure proposes a document format conversion and apparatus for realizing the conversion of document content in different formats by converting attributes of elements in different documents according to attributes of different elements in the document, thereby saving the conversion of document content between different formats, thereby saving The time when the user edits, modifies, and reads the document improves the user experience, and solves the technical problem that the type of the document can only be converted in the prior art, and the conversion of the document content between different formats cannot be realized.
  • An embodiment of the present disclosure provides a document format conversion method, including:
  • the first document is one of a text document or a mind map
  • the second document is another.
  • a further embodiment of the present disclosure provides a document format conversion apparatus, including:
  • An obtaining module configured to obtain a first document whose document format is the first format
  • An identification module configured to identify the first document, and determine a first attribute of each element in the first document
  • a determining module configured to determine a second attribute corresponding to the first attribute of each element according to a preset element attribute conversion rule
  • a conversion module configured to convert the first document into a second document whose document format is a second format according to a second attribute corresponding to each element
  • the first document is one of a text document or a mind map
  • the second document is another one.
  • a further aspect of the embodiments of the present disclosure provides an electronic device, including: a memory, a processor, and a computer program stored on the memory and executable on the processor, when the processor executes the program,
  • a computer program stored on the memory and executable on the processor, when the processor executes the program
  • a further aspect of the embodiments of the present disclosure provides a non-transitory computer readable storage medium having stored thereon a computer program, wherein the program is executed by a processor to implement the foregoing embodiments as disclosed in the present disclosure.
  • Document format conversion method
  • the first document is obtained by acquiring the first document in the first format, and then the first document is identified, the first attribute of each element in the first document is determined, and then the rule is converted according to the preset element attribute. And determining a second attribute corresponding to the first attribute of each element. Finally, converting the first document into a second document whose document format is the second format according to the second attribute corresponding to each element.
  • FIG. 1 is a schematic flowchart of a document format conversion method according to Embodiment 1 of the present disclosure
  • FIG. 2 is a schematic diagram 1 of a mind map according to an embodiment of the present disclosure
  • FIG. 3 is a schematic flowchart diagram of a document format conversion method according to Embodiment 2 of the present disclosure
  • FIG. 4 is a schematic diagram 2 of a mind map according to an embodiment of the present disclosure.
  • FIG. 5 is a schematic flowchart of a document format conversion method according to Embodiment 3 of the present disclosure.
  • FIG. 6 is a schematic flowchart diagram of a document format conversion method according to Embodiment 4 of the present disclosure.
  • FIG. 7 is a schematic diagram 3 of a mind map according to an embodiment of the present disclosure.
  • FIG. 8 is a schematic diagram showing a display mode of a mind map according to an embodiment of the present disclosure.
  • FIG. 9 is a schematic structural diagram of a document format conversion apparatus according to Embodiment 5 of the present disclosure.
  • FIG. 10 is a schematic structural diagram of a document format conversion apparatus according to Embodiment 6 of the present disclosure.
  • FIG. 11 is a schematic diagram showing a hardware configuration of an electronic device according to an embodiment of the present disclosure.
  • FIG. 12 is a schematic diagram illustrating a computer readable storage medium in accordance with an embodiment of the present disclosure.
  • FIG. 1 is a schematic flowchart diagram of a document format conversion method according to Embodiment 1 of the present disclosure.
  • the document format conversion method includes the following steps:
  • Step 101 Acquire a first document whose document format is the first format.
  • the document format conversion method provided by the embodiment of the present disclosure may be implemented by the document format conversion apparatus provided by the embodiment of the present disclosure, and the apparatus may be configured in any electronic device, so that the electronic device can implement the conversion function of the document format.
  • the first document may be a text document, and the format of the text document may be a TXT format, a doc format, a PDF format, a Rich Text Field (RTF), or the like.
  • the first document can also be a mind map.
  • the following embodiments of the present disclosure take the first document as a text document as an example for description.
  • the first document in the first format may be selected by the user, for example, the user may download the first document in the first format online, or the user may select one document as the first document from the locally stored data. No restrictions.
  • Step 102 Identify the first document, and determine a first attribute of each element in the first document.
  • the first document when the first document is a text document, the first document may include a document title element, a first-level title element, a second-level title element, a third-level title element, an ordered list element, and an unordered list element.
  • the attributes of the elements in the first document can be document title, first level title, second level title, three level title, ordered list, unordered list, task list, table , paragraphs, etc.
  • the document format conversion device may determine, according to a format of each element in the first document and a fixed pattern set corresponding to the first document, a first attribute of each element.
  • the fixed style set includes the correspondence between each element attribute and the format.
  • the first attribute of each element refers to the title level, list type, or table type corresponding to the element.
  • the attributes of an element in a text document include: a document title, a first-level title, a second-level title, a three-level title, an unordered list, an ordered list, a task list, a table, a paragraph, and the like.
  • the format of the "document title" in the fixed style set is "first line indentation: 0 characters, line spacing: single line spacing, allowing punctuation overflow boundaries", then the document format conversion device
  • first line indent: 0 characters, line spacing: single line spacing, allowing punctuation overflow boundaries the format of an element.
  • the document format The conversion device may further determine the first attribute of each element according to location information, font size information, and/or spacing information of each element.
  • the position information of each element includes the position of each element in the document, for example, the Xth row and the Yth column;
  • the font size information may include a font type, a font size, a font shape, etc.;
  • the spacing information refers to a direct spacing of each element, such as Line spacing, word spacing, and more.
  • the first attribute of each element may be determined based on the foregoing rule, combined with location information, font size information, and/or spacing information of each element in the text document.
  • the document format conversion device identifies the first document, determining that the location information corresponding to the element "document format conversion method" in the first document is: the first line, centered; the corresponding font size information is: Song, No. 2, Bold, you can determine the first attribute corresponding to the element is "document title.”
  • the document format conversion device identifies the first document, determining a position change rule between the partial consecutive elements in the first document, and the font size information is consistent, then determining that the first attribute of the partial continuous element is a “table element” Wait.
  • Step 103 Determine a second attribute corresponding to the first attribute of each element according to a preset element attribute conversion rule.
  • the preset element attribute conversion rule may be a file format conversion device, which is automatically generated according to attributes and meanings of elements in the document in various formats, or may be determined according to a user's designation. Not limited.
  • the document format conversion device may first preset a conversion rule between element attributes, and then, after acquiring the first document in the first format to be converted, according to the first element in the first document.
  • the second document can be a mind map.
  • the preset element attribute conversion rule may be as shown in Table 1.
  • its position in the mind map can only be the root node, and there is no sibling node, nor a superior node, and the subordinate node is inserted.
  • the default element of the node is the first-level title
  • for the first-level title element its position in the mind map is the first layer, and it cannot be inserted into the root node.
  • the default element inserted into the lower-level node is the second-level title, and the same is inserted.
  • the default element of the level node is the first level title. Similarly, you can get the position of other elements in the mind map.
  • Step 104 Convert the first document into a second document whose document format is the second format according to the second attribute corresponding to each element.
  • the position of each element in the second document may be The presentation form converts the first document into a second document whose document format is the second format.
  • the node in the mind map can only be the root node, and it must exist.
  • the node of the first-level title (H1) element in the mind map is the leaf node of the root node
  • the node of the level heading (H2) element in the mind map is the leaf node of H1
  • the node of the three-level heading (H3) in the mind map is the leaf node of H2
  • the node of the table element and the paragraph element in the mind map It can only be a leaf node; for an unordered list element, an ordered list element, and a task list element, it can be mapped to the corresponding node in the mind map according to the hierarchical relationship of the list itself; the missing node is not displayed, and a blank position can be left. , and the nodes appearing and the sibling nodes are aligned.
  • H1 and H2 in the mind map are blank, and may exist in a horizontal line manner.
  • the position of the three-level heading (H3) element in the mind map is aligned with the nearest H3.
  • the text contained in the element can be in the mind map.
  • the corresponding node is completely rendered; for ordered list elements, unordered list elements, task list elements, and table elements, the title of the list element or table element can be rendered in the corresponding node in the mind map;
  • Paragraph elements in general, paragraph elements contain longer text, so you can parse the paragraph elements, determine the summary of the paragraph elements, the abstract as a paragraph element in the mind map, or, because The importance of a word increases proportionally with the number of times it appears in the document. Therefore, the paragraph element can be parsed to determine the words included in the paragraph element whose frequency of occurrence is greater than the threshold, and the words including the occurrence frequency greater than the threshold are included as The presentation of paragraph elements in the mind map.
  • FIG. 2 is a schematic diagram 1 of a mind map according to an embodiment of the present disclosure.
  • the first document is a text document
  • the second document is a mind map.
  • the display interface can be divided into two.
  • the text document is located in the right area 21, and the mind map is located in the left area 22, and the document title is : ⁇ personality classification MBTI>, the first level title is: ⁇ INJT type> and ⁇ other>, the second level title is ⁇ assisted> and ⁇ accessory function: extraversion thinking>.
  • ⁇ personality classification MBTI> is the root node
  • ⁇ INJT type> and ⁇ other> are the leaf nodes of ⁇ personality classification MBTI>, ⁇ auxiliary> and ⁇ auxiliary function: extraversion thinking>
  • Leaf node of ⁇ other> is the root node
  • ⁇ INJT type> is the leaf nodes of ⁇ personality classification MBTI>
  • ⁇ auxiliary> is the leaf nodes of ⁇ auxiliary>
  • ⁇ auxiliary function extraversion thinking>
  • the foregoing embodiment of the present disclosure is an example in which a text document is converted into a mind map as an example.
  • the mind map can also be converted into a text document according to the attribute conversion rule.
  • the document content can be converted between different formats according to the attributes of the document content, so that the user can pass the mind map when editing the document.
  • the mind map can be converted into a text document and then edited.
  • the position of the node in the mind map can be directly adjusted, and the corresponding title position adjustment in the text document can be realized.
  • the document format conversion method of the embodiment of the present disclosure by acquiring the first document whose document format is the first format, identifying the first document, determining the first attribute of each element in the first document, and converting the rule according to the preset element attribute And determining a second attribute corresponding to the first attribute of each element, and converting the first document into the second document whose document format is the second format according to the second attribute corresponding to each element.
  • FIG. 3 is a schematic flowchart diagram of a document format conversion method according to Embodiment 2 of the present disclosure.
  • the document format conversion method may further include the following steps:
  • Step 201 When determining that the current focus is located in the first element in the second document, acquiring text content corresponding to the first element.
  • the current focus can be located in the first element of the second document by clicking a mouse, or when the user uses an electronic device (eg, a smart phone, Pad, etc.), when the document format conversion, you can click the touch screen to place the current focus on the first element in the second document.
  • the text content corresponding to the first element may be acquired.
  • Step 202 Display the text content in a preset form.
  • the text content can be displayed in the form of a floating window.
  • the text content can be displayed in the form of a scroll bar.
  • the text content can be displayed in the form of a partition display.
  • FIG. 4 is a schematic diagram 2 of a mind map according to an embodiment of the present disclosure.
  • the display interface can be divided into two, the mind map is displayed on the left side, and the text content corresponding to ⁇ INTJ type> is displayed on the right side.
  • the document format conversion method of the embodiment of the present disclosure when determining that the current focus is located in the first element in the second document, acquiring the text content corresponding to the first element; displaying the text content in a preset form, thereby, the user may Through the second document, the structure of the first document can be quickly understood, and each element in the second document can be refined and read one by one, thereby helping the user to clear the knowledge points and improve the absorption rate of the knowledge points by the user. .
  • the user may also set a permission for the second document, for example, a node in the mind map, and the second element in the embodiment of the present disclosure.
  • the second element can be displayed in the second document only by the authenticated user. Specifically, the above process will be described in detail below with reference to FIG. 5.
  • FIG. 5 is a schematic flowchart diagram of a document format conversion method according to Embodiment 3 of the present disclosure.
  • the document format conversion method may further include the following steps:
  • Step 301 Receive a permission setting command, where the permission setting command includes the identifier and the permission information of the second element.
  • the permission setting command is triggered by the user, and the permission setting command is used to set the permission for the second element, and the permission setting command includes the identifier and the permission information of the second element.
  • the identifier of the second element is used to uniquely identify the second element.
  • the identifier of the second element may be the location of the second element in the second document, or any other information that uniquely identifies the second element. This is not a limitation.
  • the privilege information may include a user identifier and/or password information, and the user identifier may be a user avatar, a salutation, etc., and the password information may be a digital password and/or a biometric password, which is not limited thereto.
  • Step 302 Set, according to the rights information, the rights of the second element corresponding to the identifier of the second element in the second document.
  • the authority of the second element corresponding to the identifier of the second element in the second document may be set according to the permission information in the permission setting command.
  • Step 303 Receive a second document open request, where the open request includes verification information.
  • the user may send a second document open request, for example, the user may enter the verification page by triggering the second document, and then the user may input the verification information through the verification page, and the user After the verification information is entered, a second document open request can be generated.
  • Step 304 Determine, according to the authority information, whether the verification information is legal. If yes, go to step 305. Otherwise, go to step 306.
  • Step 305 Display an element corresponding to the identifier of the second element in the second document.
  • the verification information is legal according to the authority information, at this time, it indicates that the user has the right to open the second document, and therefore, the element corresponding to the identifier of the second element may be displayed in the second document.
  • step 306 no processing is performed.
  • the user may send a second document open request.
  • the second document may also be directly opened.
  • the permissions are not set for other elements in the second document except the second element, so other elements than the second element can be displayed in the second document.
  • the user wants to display the second element in the second document, the user can enter the verification page by triggering the second element, and then the user can input the verification information through the verification page, and then can determine whether the verification information is legal according to the permission information, and if legal , the element corresponding to the identifier of the second element may be displayed in the second document.
  • the document format conversion method of the embodiment of the present disclosure by receiving the permission setting command, the permission setting command includes the identifier and the permission information of the second element; and the second element corresponding to the identifier of the second element in the second document according to the permission information
  • the permission is set to receive the second document open request, and the open request includes the verification information.
  • the verification information is legal according to the permission information
  • the element corresponding to the identifier of the second element is displayed in the second document.
  • the user can set the rights of the elements in the second document, and only the authenticated user can display the elements in the second document, thereby improving the security of the second document.
  • the user may directly use the second document to update the first document.
  • the title in the first document may be modified, and the document structure of the first document may be modified.
  • FIG. 6 is a schematic flowchart diagram of a document format conversion method according to Embodiment 4 of the present disclosure.
  • the document format conversion method may further include the following steps:
  • Step 401 Acquire an update request, where the update request includes a third element identifier and information to be updated.
  • the identifier of the third element is used to uniquely identify the third element, for example, the identifier of the third element may be the location of the third element in the second document, or any other unique identifier of the third element. Information, no restrictions on this.
  • the information to be updated may include content to be updated, such as a title name, etc., or may also include a location to be updated, such as adjusting a chapter or the like.
  • Step 402 Determine a target element in the first document that corresponds to the third element identifier.
  • the target element corresponding to the third element identifier in the first document may be determined.
  • Step 403 Update the target element in the first document according to the information to be updated.
  • the target element in the first document may be updated according to the information to be updated in the update request.
  • FIG. 7 is a schematic diagram 3 of a mind map according to an embodiment of the present disclosure.
  • the user can right-click on an element in the mind map.
  • the element selected by the user is a secondary title ⁇ Accessibility: Extraversion Thinking>, and the user can right click on the element by clicking H1. Adjust the secondary title to a first-level title.
  • the document format conversion method of the embodiment of the present disclosure by acquiring an update request, the update request includes a third element identifier and information to be updated; determining a target element corresponding to the third element identifier in the first document; The updated information is described, and the target element in the first document is updated. Therefore, the user can directly use the second document to update the first document, and the operation is convenient.
  • the display content and the display order of the first document may be automatically generated according to the structure of the second document, or the display content and the display order of the first document may be set by the user in the second document, thereby improving The flexibility and applicability of the method.
  • the first document is a text document and the second document is a mind map
  • the text document can be displayed through the mind map.
  • FIG. 8 is a schematic diagram showing a display mode of a mind map according to an embodiment of the present disclosure.
  • the user can set the first node to be displayed as ⁇ Auxiliary>, the second node to display is ⁇ IBTJ Type>, and the third node to display is ⁇ Other>.
  • the present disclosure also proposes a document format conversion device.
  • FIG. 9 is a schematic structural diagram of a document format conversion apparatus according to Embodiment 5 of the present disclosure.
  • the document format conversion apparatus 100 includes an acquisition module 101, an identification module 102, a determination module 103, and a conversion module 104. among them,
  • the obtaining module 101 is configured to obtain a first document whose document format is the first format.
  • the identification module 102 is configured to identify the first document and determine a first attribute of each element in the first document.
  • the first document is a text document
  • the identification module 102 is configured to determine a first attribute of each element according to a format of each element in the first document and a fixed pattern set corresponding to the first document;
  • the first attribute of each element is determined according to location information, font size information, and/or spacing information of each element in the first document.
  • the determining module 103 is configured to determine a second attribute corresponding to the first attribute of each element according to a preset element attribute conversion rule.
  • the determining module 103 is specifically configured to determine a position and a presentation form of each element in the second document according to a preset element attribute conversion rule and a first attribute of each element.
  • the first document includes a paragraph element
  • the determining module 103 is specifically configured to parse the paragraph element, determine a summary of the paragraph element, or a word included in the paragraph element whose appearance frequency is greater than a threshold; A summary of the paragraph elements, or words that appear more frequently than the threshold, to determine the presentation of the paragraph elements in the mind map.
  • the conversion module 104 is configured to convert the first document into a second document whose document format is the second format according to the second attribute corresponding to each element.
  • the first document is one of a text document or a mind map
  • the second document is another.
  • the document format conversion apparatus 100 may further include:
  • the display module 105 is configured to: after converting the first document into the second document, when determining that the current focus is located in the first element in the second document, acquiring text content corresponding to the first element, and displaying the content in a preset form Text content.
  • the display module 105 is specifically configured to display the text content in the form of a floating window; or display the text content in the form of a partition display.
  • the first document is a text document
  • the second document is a mind map document
  • the first receiving module 106 is configured to receive a permission setting command after converting the first document into the second document, where the permission setting command includes the identifier of the second element and the authority information.
  • the setting module 107 is configured to set, according to the rights information, the rights of the second element corresponding to the identifier of the second element in the second document.
  • the second receiving module 108 is configured to receive a second document open request, where the open request includes verification information.
  • the determining module 109 is configured to determine, according to the authority information, whether the verification information is legal.
  • the processing module 110 is configured to: if yes, display an element corresponding to the identifier of the second element in the second document.
  • the update module 111 is configured to: after converting the first document into the second document, obtain an update request, where the update request includes the third element identifier and the information to be updated, and determine a target element corresponding to the third element identifier in the first document. And updating the target element in the first document according to the information to be updated.
  • the document format conversion apparatus of the embodiment of the present disclosure by acquiring the first document whose document format is the first format, identifying the first document, determining the first attribute of each element in the first document, and converting the rule according to the preset element attribute And determining a second attribute corresponding to the first attribute of each element, and converting the first document into the second document whose document format is the second format according to the second attribute corresponding to each element.
  • the present disclosure also proposes an electronic device.
  • FIG. 11 is a schematic diagram illustrating a hardware structure of an electronic device according to an embodiment of the present disclosure.
  • the electronic device may be implemented in various forms, and the electronic device in the embodiments of the present disclosure may include, but is not limited to, such as a mobile phone, a smart phone, a notebook computer, a digital broadcast receiver, a PDA (Personal Digital Assistant), a PAD (Tablet PC).
  • Mobile electronic devices such as PMPs (portable multimedia players), navigation devices, in-vehicle electronic devices, in-vehicle display terminals, in-vehicle electronic rearview mirrors, and the like, and fixed electronic devices such as digital TVs, desktop computers, and the like.
  • the electronic device 1100 may include a wireless communication unit 1110, an A/V (audio/video) input unit 1120, a user input unit 1130, a sensing unit 1140, an output unit 1150, a memory 1160, an interface unit 1170, and control.
  • Figure 11 illustrates an electronic device having various components, but it should be understood that not all illustrated components are required to be implemented. More or fewer components can be implemented instead.
  • the wireless communication unit 1110 allows radio communication between the electronic device 1100 and a wireless communication system or network.
  • the A/V input unit 1120 is for receiving an audio or video signal.
  • the user input unit 1130 can generate key input data according to a command input by the user to control various operations of the electronic device.
  • the sensing unit 1140 detects the current state of the electronic device 1100, the position of the electronic device 1100, the presence or absence of a user's touch input to the electronic device 1100, the orientation of the electronic device 1100, the acceleration or deceleration movement and direction of the electronic device 1100, and the like, and A command or signal is generated for controlling the operation of the electronic device 1100.
  • the interface unit 1170 serves as an interface through which at least one external device can be connected to the electronic device 1100.
  • Output unit 1150 is configured to provide an output signal in a visual, audio, and/or tactile manner.
  • the memory 1160 may store a software program or the like that performs processing and control operations performed by the controller 1180, or may temporarily store data that has been output or is to be output.
  • Memory 1160 can include at least one type of storage medium.
  • the electronic device 1100 can cooperate with a network storage device that performs a storage function of the memory 1160 through a network connection.
  • Controller 1180 typically controls the overall operation of the electronic device. Additionally, the controller 1180 can include a multimedia module for reproducing or playing back multimedia data.
  • the controller 1180 can perform a pattern recognition process to recognize a handwriting input or a picture drawing input performed on the touch screen as a character or an image.
  • the power supply unit 1190 receives external power or internal power under the control of the controller 1180 and provides appropriate power required to operate the various components and components.
  • Various embodiments of the document format conversion method proposed by embodiments of the present disclosure may be implemented in a computer readable medium using, for example, computer software, hardware, or any combination thereof.
  • various embodiments of the document format conversion method proposed by the embodiments of the present disclosure may use an application specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device. (PLD), field programmable gate array (FPGA), processor, controller, microcontroller, microprocessor, at least one of the electronic units designed to perform the functions described herein, in some cases
  • ASIC application specific integrated circuit
  • DSP digital signal processor
  • DSPD digital signal processing device
  • PLD programmable logic device.
  • FPGA field programmable gate array
  • processor controller, microcontroller, microprocessor, at least one of the electronic units designed to perform the functions described herein, in some cases
  • Various embodiments of the document format conversion method proposed by the embodiments of the present disclosure may be implemented in the controller 1180.
  • various embodiments of the document format conversion method proposed by embodiments of the present disclosure may be implemented with separate software modules that allow execution of at least one function or operation.
  • the software code can be implemented by a software application (or program) written in any suitable programming language, which can be stored in memory 1160 and executed by controller 1180.
  • the present disclosure also proposes a computer readable storage medium.
  • FIG. 12 is a schematic diagram illustrating a computer readable storage medium in accordance with an embodiment of the present disclosure.
  • a computer readable storage medium 200 having computer readable instructions 201 stored thereon is stored in accordance with an embodiment of the present disclosure.
  • the computer readable instructions 201 are executed by a processor, all or part of the steps of the document format conversion method of the aforementioned embodiments of the present disclosure are performed.
  • first and second are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated.
  • features defining “first” or “second” may include at least one of the features, either explicitly or implicitly.
  • the meaning of "a plurality” is at least two, such as two, three, etc., unless specifically defined otherwise.
  • Any process or method description in the flowcharts or otherwise described herein may be understood to represent a module, segment or portion of code comprising one or more executable instructions for implementing the steps of a custom logic function or process.
  • the scope of the preferred embodiments of the present disclosure includes additional implementations, in which the functions may be performed in a substantially simultaneous manner or in an inverse order depending on the functions involved, in the order shown or discussed. It will be understood by those skilled in the art to which the embodiments of the present disclosure pertain.
  • a "computer-readable medium” can be any apparatus that can contain, store, communicate, propagate, or transport a program for use in an instruction execution system, apparatus, or device, or in conjunction with the instruction execution system, apparatus, or device.
  • computer readable media include the following: electrical connections (electronic devices) having one or more wires, portable computer disk cartridges (magnetic devices), random access memory (RAM), Read only memory (ROM), erasable editable read only memory (EPROM or flash memory), fiber optic devices, and portable compact disk read only memory (CDROM).
  • the computer readable medium may even be a paper or other suitable medium on which the program can be printed, as it may be optically scanned, for example by paper or other medium, followed by editing, interpretation or, if appropriate, other suitable The method is processed to obtain the program electronically and then stored in computer memory.
  • portions of the present disclosure can be implemented in hardware, software, firmware, or a combination thereof.
  • multiple steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system.
  • a suitable instruction execution system For example, if implemented in hardware and in another embodiment, it can be implemented by any one or combination of the following techniques well known in the art: discrete with logic gates for implementing logic functions on data signals Logic circuits, application specific integrated circuits with suitable combinational logic gates, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), and the like.
  • each functional unit in various embodiments of the present disclosure may be integrated into one processing module, or each unit may exist physically separately, or two or more units may be integrated into one module.
  • the above integrated modules can be implemented in the form of hardware or in the form of software functional modules.
  • the integrated modules, if implemented in the form of software functional modules and sold or used as stand-alone products, may also be stored in a computer readable storage medium.
  • the above mentioned storage medium may be a read only memory, a magnetic disk or an optical disk or the like. While the embodiments of the present disclosure have been shown and described above, it is understood that the foregoing embodiments are illustrative and are not to be construed as limiting the scope of the disclosure The embodiments are subject to variations, modifications, substitutions and variations.

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • General Business, Economics & Management (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Document Processing Apparatus (AREA)

Abstract

一种文档格式转换方法和装置,其中,方法包括:获取文档格式为第一格式的第一文档(101);对第一文档进行识别,确定第一文档中各元素的第一属性(102);根据预设的元素属性转换规则,确定与各元素的第一属性对应的第二属性(103);根据各元素对应的第二属性,将第一文档转换为文档格式为第二格式的第二文档(104);其中,第一文档为文本文档或思维导图中的一种,第二文档为另外一种。该方法通过根据文档中各元素在不同格式文档中的属性,将文档中元素的属性进行转换,从而实现了文档内容在不同格式间的转换,节约了用户编辑、修改、阅读文档的时间,改善了用户体验。

Description

文档格式转换方法和装置
相关申请的交叉引用
本公开要求天津字节跳动科技有限公司于2018年05月09日提交的、申请名称为“文档格式转换方法和装置”的、中国专利申请号“201810437386.0”的优先权,该申请的全部内容通过引用结合在本申请中。
技术领域
本公开涉及互联网技术领域,尤其涉及一种文档格式转换和装置。
背景技术
随着计算机技术的普及,越来越多的用户使用计算机文档记录工作和生活事物。用户常用的计算机文档的格式主要有文本(Text,简称TXT)、文档(Document,简称doc)、可移植文档格式(Portable Document Format,简称PDF)等,且用户可以通过“另存为”、“导出”等方式,实现文档在不同各格式间的转换。
目前,随着工作效率的需求,思维导图,因其具有人类思维的强大功能而逐渐被应用到了各个领域。思维导图运用图文并重的技巧,把各级主题的关系用相互隶属与相关的层级图表现出来,把主题关键词与图像、颜色等建立记忆链接。相关技术中,用户也可以用相关软件,直接将思维导图“另存为”其它格式的文件。
申请人发现,目前文档在各种格式之间转换的方式,通常只是将文档对应的“文件类型”进行了转换,比如将doc格式文档转换为PDF格式文档,从而使用户可以用PDF软件打开文档,或者将思维导图转换为doc格式的图片,从而使用户可以用doc软件打开思维导图等等。但是上述文档格式的转换方法,仅能转换文档整体的类型,而无法实现文档内容在不同格式间的转换。
发明内容
本公开提出一种文档格式转换和装置,以实现通过根据文档中各元素在不同格式文档中的属性,将文档中元素的属性进行转换,从而实现了文档内容在不同格式间的转换,节约了用户编辑、修改、阅读文档的时间,改善了用户体验,用于解决现有技术中仅能转换文档整体的类型,而无法实现文档内容在不同格式间的转换的技术问题。
本公开实施例一方面实施例提出了一种文档格式转换方法,包括:
获取文档格式为第一格式的第一文档;
对所述第一文档进行识别,确定所述第一文档中各元素的第一属性;
根据预设的元素属性转换规则,确定与所述各元素的第一属性对应的第二属性;
根据所述各元素对应的第二属性,将所述第一文档转换为文档格式为第二格式的第二文档;
其中,所述第一文档为文本文档或思维导图中的一种,第二文档为另外一种。
本公开实施例又一方面实施例提出了一种文档格式转换装置,包括:
获取模块,用于获取文档格式为第一格式的第一文档;
识别模块,用于对所述第一文档进行识别,确定所述第一文档中各元素的第一属性;
确定模块,用于根据预设的元素属性转换规则,确定与所述各元素的第一属性对应的第二属性;
转换模块,用于根据所述各元素对应的第二属性,将所述第一文档转换为文档格式为第二格式的第二文档;
其中,所述第一文档为文本文档或思维导图中的一种,所述第二文档为另外一种。
本公开实施例又一方面实施例提出了一种电子设备,包括:存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时,实现如本公开前述实施例所述的文档格式转换方法。
本公开实施例又一方面实施例提出了一种非暂态计算机可读存储介质,其上存储有计算机程序,其特征在于,该程序被处理器执行时实现如本公开前述实施例所述的文档格式转换方法。
本公开实施例所提供的技术方案可以包含以下的有益效果:
本公开实施例中,通过获取文档格式为第一格式的第一文档,而后,对第一文档进行识别,确定第一文档中各元素的第一属性,接着,根据预设的元素属性转换规则,确定与各元素的第一属性对应的第二属性,最后,根据各元素对应的第二属性,将第一文档转换为文档格式为第二格式的第二文档。由此,通过根据文档中各元素在不同格式文档中的属性,将文档中元素的属性进行转换,从而实现了文档内容在不同格式间的转换,节约了用户编辑、修改、阅读文档的时间,改善了用户体验。
本公开附加的方面和优点将在下面的描述中部分给出,部分将从下面的描述中变得明显,或通过本公开的实践了解到。
附图说明
为了更清楚地说明本公开实施例中的技术方案,下面将对一个或多个实施例通过与之 对应的附图中的图片进行示例性说明,这些示例性说明并不构成对实施例的限定,其中:
图1为本公开实施例一所提供的文档格式转换方法的流程示意图;
图2为本公开实施例中思维导图示意图一;
图3为本公开实施例二所提供的文档格式转换方法的流程示意图;
图4为本公开实施例中思维导图示意图二;
图5为本公开实施例三所提供的文档格式转换方法的流程示意图;
图6为本公开实施例四所提供的文档格式转换方法的流程示意图;
图7为本公开实施例中思维导图示意图三;
图8为本公开实施例中思维导图的展示模式示意图;
图9为本公开实施例五所提供的文档格式转换装置的结构示意图;
图10为本公开实施例六所提供的文档格式转换装置的结构示意图;
图11是图示根据本公开实施例的电子设备的硬件结构示意图;
图12是图示根据本公开的实施例的计算机可读存储介质的示意图。
具体实施方式
下面详细描述本公开的实施例,所述实施例的示例在附图中示出,其中自始至终相同或类似的标号表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施例是示例性的,旨在用于解释本公开,而不能理解为对本公开的限制。
下面参考附图描述本公开实施例的文档格式转换方法和装置。
图1为本公开实施例一所提供的文档格式转换方法的流程示意图。
如图1所示,该文档格式转换方法包括以下步骤:
步骤101,获取文档格式为第一格式的第一文档。
本公开实施例提供的文档格式转换方法,可以由本公开实施例提供的文档格式转换装置实现,该装置可以被配置在任何电子设备中,以使该电子设备可以实现文档格式的转换功能。
本公开实施例中,第一文档可以为文本文档,文本文档的格式可以为TXT格式、doc格式、PDF格式、富文本格式(Rich Text Field,简称RTF)等。或者,第一文档,也可以为思维导图。为方便说明,本公开以下各实施例以第一文档为文本文档为例进行说明。
具体地,可以通过用户选取第一格式的第一文档,例如,用户可以在线下载第一格式的第一文档,或者,用户可以从本地存储的数据中,选择一个文档作为第一文档,对此不作限制。
步骤102,对第一文档进行识别,确定第一文档中各元素的第一属性。
本公开实施例中,当第一文档为文本文档时,该第一文档中可以包括文档标题元素、一级标题元素、二级标题元素、三级标题元素、有序列表元素、无序列表元素、任务列表元素、表格元素、段落元素等,因此,第一文档中元素的属性可以为文档标题、一级标题、二级标题、三级标题、有序列表、无序列表、任务列表、表格、段落等。
在一种可能实现形式中,文档格式转换装置,针对文本文档,可以根据该第一文档中各元素的格式及该第一文档对应的固定样式集,确定各元素的第一属性。
其中,固定样式集中包括各元素属性与格式的对应关系。各元素的第一属性,指该元素对应的标题级别、列表类型或者表格类型等等。通常,文本文档中元素的属性包括:文档标题、一级标题、二级标题、三级标题、无序列表、有序列表、任务列表、表格、段落等。
举例来说,对于doc格式的文档,其固定的样式集中“文档标题”的格式为“首行缩进:0字符,行距:单倍行距,允许标点溢出边界”,那么文档格式转换装置,在对第一文档进行识别时,若确定某一元素的格式为“首行缩进:0字符,行距:单倍行距,允许标点溢出边界”,则可确定该元素为文档标题。
在另一种可能的实现形式中,若第一格式的第一文档无固定样式集,或者该第一格式的第一文档在编辑时,未采用固定样式集中的格式编辑各元素,那么文档格式转换装置,还可以根据各元素的位置信息、字号信息和/或间距信息,确定所述各元素的第一属性。
其中,各元素的位置信息,包括各元素在文档中的位置,比如,第X行第Y列;字号信息可以包括字体类型、字号大小、字形等;间距信息,指各元素直接的间距,比如行间距、字间距等等。
通常,由于文本文档中,各级标题、段落等元素的位置及字号等格式均有固定的规律,比如文档标题,通常位于文档的首行、且文档标题的字号比一级标题的字号大;一级标题的字号比二级标题字号大;标题字号比段落字号大等。因此,本公开实施例中,可以基于上述规律,结合文本文档中各元素的位置信息、字号信息和/或间距信息,确定所述各元素的第一属性。
例如,若文档格式转换装置对第一文档识别后,确定第一文档中,元素“文档格式转换方法”对应的位置信息为:第一行、居中;对应的字号信息为:宋体、二号、加粗,则可确定该元素对应的第一属性为“文档标题”。
或者,文档格式转换装置对第一文档识别后,确定第一文档中,部分连续元素间的位置变化规律,且字号信息一致,那么则可以确定该部分连续元素的第一属性为“表格元素”等。
步骤103,根据预设的元素属性转换规则,确定与各元素的第一属性对应的第二属性。
其中,预设的元素属性转换规则,可以是文档格式转换装置,根据各种格式的文档中 元素的属性及含义,自动生成的,或者也可以是根据用户的指定确定的,本实施例对此不做限定。
本公开实施例中,文档格式转换装置中可以首先预置元素属性间的转换规则,之后,在获取到待转换的第一格式的第一文档后,即可根据第一文档中各元素的第一属性,确定各元素在第二格式的第二文档中的位置及呈现形式。其中,第二文档可以为思维导图。
可选地,预设的元素属性转换规则可以如表1所示,对于文档标题元素,其在思维导图中的位置只能是根节点,并且没有同级节点,也没有上级节点,插入下级节点的默认元素为一级标题,而对于一级标题元素,其在思维导图中的位置为第一层,且其不能插入至根节点,插入下级节点的默认元素为二级标题,插入同级节点的默认元素为一级标题,同理,可以得到其他元素在思维导图中的位置。
步骤104,根据各元素对应的第二属性,将第一文档转换为文档格式为第二格式的第二文档。
本公开实施例中,当根据预设的元素属性转换规则及各元素的第一属性,确定各元素在第二文档中的位置及呈现形式后,可以根据各元素在第二文档中的位置及呈现形式,将第一文档转换为文档格式为第二格式的第二文档。
需要说明的是,对于文档标题元素,其在思维导图中的节点只能是根节点,且必然存在,一级标题(H1)元素在思维导图中的节点是根节点的叶子节点,二级标题(H2)元素在思维导图中的节点是H1的叶子节点,三级标题(H3)在思维导图中的节点是H2的叶子节点;表格元素、段落元素在思维导图中的节点只能是叶子节点;对于无序列表元素、有序列表元素、任务列表元素,可以按照列表本身的层级关系映射到思维导图中相应的节点;缺失的节点不显示,可以留出空白的位置,而出现的节点和同级节点对齐显示。
Figure PCTCN2018113420-appb-000001
表1 元素属性转换规则
举例而言,当第一文档中没有一级标题(H1)元素和二级标题(H2)元素时,H1和H2在思维导图中对应的位置是空白的,可以以横线的方式存在,而三级标题(H3)元素在思维导图中的位置与最近的一个H3对齐显示。
由于文档标题元素、一级标题元素、二级标题元素、三级标题元素所包含的文字个数较少,因此在思维导图中呈现时,可以将元素所包含的文字在思维导图中的相应节点进行完整地呈现;对于有序列表元素、无序列表元素、任务列表元素和表格元素来说,可以将列表元素或者表格元素的标题,在思维导图中的相应节点进行呈现;而对于段落元素来说,一般而言,段落元素所包含的文字较长,因此,可以对段落元素进行解析,确定段落元素的摘要,将摘要作为段落元素在思维导图中的呈现形式,或者,由于字词的重要性随着它在文档中出现的次数成正比增加,因此,可以对段落元素进行解析,确定段落元素中包括的出现频率大于阈值的词语,将包括的出现频率大于阈值的词语作为段落元素在思维导图中的呈现形式。
作为一种示例,参见图2,图2为本公开实施例中思维导图示意图一。如图2所示, 第一文档为文本文档,第二文档为思维导图,可以将显示界面一分为二,文本文档位于右侧区域21,思维导图位于左侧区域22,文档标题为:<人格分类MBTI>,一级标题为:<INJT类型>和<其他>,二级标题为<辅助>和<辅助功能:外倾思考>。将文本文档转换为思维导图后,<人格分类MBTI>为根节点,<INJT类型>和<其他>为<人格分类MBTI>的叶子节点,<辅助>和<辅助功能:外倾思考>为<其他>的叶子节点。
需要说明的是,本公开上述实施例是以文本文档转换为思维导图为例进行的说明,在实际使用时,也可以根据属性转换规则,将思维导图转换为文本文档。
由图2可以看出,通过采用本公开提供的文档格式转换方法,可以根据文档内容的属性,将文档内容在不同格式之间进行转换,从而使得用户在编辑文档时,可以通过思维导图,快速构建文档的思路及脉络,从而节省了用户的时间,之后可以将思维导图转换为文本文档,再进行具体编辑。并且在修改文档,比如调整标题顺序时,则可以直接调整思维导图中节点的位置,即可实现文本文档中对应的标题位置的调整。
本公开实施例的文档格式转换方法,通过获取文档格式为第一格式的第一文档,对第一文档进行识别,确定第一文档中各元素的第一属性,根据预设的元素属性转换规则,确定与各元素的第一属性对应的第二属性,根据各元素对应的第二属性,将第一文档转换为文档格式为第二格式的第二文档。由此,通过根据文档中各元素在不同格式文档中的属性,将文档中元素的属性进行转换,从而实现了文档内容在不同格式间的转换,节约了用户编辑、修改、阅读文档的时间,改善了用户体验。
作为一种可能的实现方式,由于思维导图中各节点可呈现的内容有限,因此将文本文档转换为思维导图时,文本文档中的段落,通常无法全部显示在思维导图中,此时为了便于用户在思维导图模式下快速获取文本文档的内容,当用户点击思维导图中与段落对应的元素时,可以将该元素对应的文本内容与思维导图一起进行显示。下面结合图3,对上述过程进行详细说明。
图3为本公开实施例二所提供的文档格式转换方法的流程示意图。
如图3所示,在图1所示实施例的基础啊,在步骤104之后,该文档格式转换方法还可以包括以下步骤:
步骤201,在确定当前焦点位于第二文档中的第一元素时,获取与第一元素对应的文本内容。
例如,在用户使用个人电脑(Personal Computer,简称PC)进行文档格式转换时,可以通过点击鼠标,将当前焦点位于第二文档中的第一元素,或者,当用户使用电子设备(例如智能手机、pad等),进行文档格式转换时,可以通过点击可触摸屏幕,将当前焦点位于第二文档中的第一元素。在确定当前焦点位于第二文档中的第一元素时,可以获取与第一元素对应的文本内容。
步骤202,以预设的形式显示文本内容。
作为一种可能的实现方式,可以以浮窗的形式显示文本内容。
作为另一种可能的实现方式,可以以滚动条的形式显示文本内容。
作为又一种可能的实现方式,可以以分区显示的形式,显示文本内容。
作为一种示例,参见图4,图4为本公开实施例中思维导图示意图二。当用户将当前焦点位于思维导图中的<INTJ类型>时,可以将显示界面一分为二,左侧显示思维导图,右侧显示<INTJ类型>对应的文本内容。
本公开实施例的文档格式转换方法,通过在确定当前焦点位于第二文档中的第一元素时,获取与第一元素对应的文本内容;以预设的形式显示文本内容,由此,用户可以通过第二文档,快速了解第一文档的结构,同时还可以对第二文档中的每个元素进行细化,逐个部分进行阅读,从而帮助用户理清知识点,提升用户对知识点的吸收率。
作为一种可能的实现方式,将第一文档转换为第二文档之后,用户还可以对第二文档,例如思维导图中的某个节点,本公开实施例中记为第二元素进行权限设置,只有通过验证的用户,才可以在第二文档中显示第二元素。具体地,下面结合图5,对上述过程进行详细说明。
图5为本公开实施例三所提供的文档格式转换方法的流程示意图。
如图5所示,在图1和图3所示实施例的基础上,该文档格式转换方法还可以包括以下步骤:
步骤301,接收权限设置命令,权限设置命令中包括第二元素的标识及权限信息。
本公开示例中,权限设置命令为用户触发的,权限设置命令用于对第二元素进行权限设置,权限设置命令中包括第二元素的标识及权限信息。
其中,第二元素的标识用于唯一标识该第二元素,例如第二元素的标识可以为第二元素在第二文档中的位置,或者为其他任一唯一标识该第二元素的信息,对此不作限制。权限信息可以包括用户标识和/或密码信息,用户标识可以为用户头像、称呼等,密码信息可以为数字密码和/或生物特征密码,对此不作限制。
步骤302,根据权限信息,对第二文档中与第二元素的标识对应的第二元素的权限进行设置。
具体地,当用户触发权限设置命令时,可以根据权限设置命令中的权限信息,对第二文档中与第二元素的标识对应的第二元素的权限进行设置。
步骤303,接收第二文档打开请求,打开请求中包括验证信息。
可选地,当用户想要打开第二文档时,用户可以发送第二文档打开请求,例如,用户可以通过触发第二文档,进入验证页面,而后用户可以通过验证页面,输入验证信息,在用户输入完验证信息后,可以生成第二文档打开请求。
步骤304,根据权限信息,判断验证信息是否合法,若是,执行步骤305,否则,执行步骤306。
步骤305,在第二文档中显示第二元素的标识对应的元素。
在根据权限信息,判断验证信息合法时,此时,表明该用户具有打开第二文档的权限,因此,可以在第二文档中显示第二元素的标识对应的元素。
步骤306,不做任何处理。
在根据权限信息,判断验证信息不合法时,此时,表明该用户未具有打开第二文档的权限,因此,可以不做任何处理。
需要说明的是,当用户想要打开第二文档时,用户可以发送第二文档打开请求,当接收到打开请求后,本公开实施例中,还可以直接打开第二文档,此时,由于用户并未对第二文档中除第二元素之外的其他元素进行权限设置,因此,可以在第二文档中显示除第二元素之外的其他元素。如果用户想要在第二文档中显示第二元素时,用户可以通过触发第二元素,进入验证页面,而后用户可以通过验证页面输入验证信息,接着可以根据权限信息判断验证信息是否合法,若合法,则可以在第二文档中显示第二元素的标识对应的元素。
本公开实施例的文档格式转换方法,通过接收权限设置命令,权限设置命令中包括第二元素的标识及权限信息;根据权限信息,对第二文档中与第二元素的标识对应的第二元素的权限进行设置,接收第二文档打开请求,打开请求中包括验证信息,当根据权限信息,判断验证信息合法时,在第二文档中显示第二元素的标识对应的元素。本实施例中,用户可以对第二文档中的元素进行权限设置,只有通过验证的用户,才可以在第二文档中显示元素,由此,可以提升第二文档的安全性。
现有技术中,当用户想要对文档中的某个地方进行修改时,用户需要打开文档,进入相应地页面进行修改,操作步骤繁琐。
而本公开实施例中,用户可以直接利用第二文档,对第一文档进行更新,例如,可以对第一文档中的标题进行修改,对第一文档的文档结构进行修改等,操作便捷。下面结合图6,对上述过程进程详细说明。
图6为本公开实施例四所提供的文档格式转换方法的流程示意图。
如图6所示,在图1和图3所示实施例的基础上,该文档格式转换方法还可以包括以下步骤:
步骤401,获取更新请求,更新请求中包括第三元素标识及待更新的信息。
本公开实施例中,第三元素的标识用于唯一标识该第三元素,例如第三元素的标识可以为第三元素在第二文档中的位置,或者为其他任一唯一标识该第三元素的信息,对此不作限制。
待更新的信息可以包括待更新的内容,例如标题名称等,或者也可以包括待更新的位 置,比如调整章节等。
步骤402,确定第一文档中与第三元素标识对应的目标元素。
可选地,当确定第三元素标识后,可以确定第一文档中与第三元素标识对应的目标元素。
步骤403,根据待更新的信息,对第一文档中目标元素进行更新。
可选地,在确定目标元素后,可以根据更新请求中的待更新的信息,对第一文档中目标元素进行更新。
作为一种示例,参见图7,图7为本公开实施例中思维导图示意图三。如图7所示,用户可以通过右击思维导图中的某一元素,例如,用户选择的元素为二级标题<辅助功能:外倾思考>,用户可以右击该元素,通过点击H1,将该二级标题调整为一级标题。
本公开实施例的文档格式转换方法,通过获取更新请求,所述更新请求中包括第三元素标识及待更新的信息;确定第一文档中与所述第三元素标识对应的目标元素;根据所述待更新的信息,对第一文档中所述目标元素进行更新。由此,用户可以直接利用第二文档,对第一文档进行更新,操作便捷。
作为一种可能的实现方式,可以根据第二文档的结构自动生成第一文档的展示内容和展示顺序,或者,可以由用户在第二文档中设置第一文档的展示内容和展示顺序,从而提升该方法的灵活性及适用性。由此,当第一文档为文本文档,第二文档为思维导图时,可以实现通过思维导图对文本文档进行展示。
作为一种示例,参见图8,图8为本公开实施例中思维导图的展示模式示意图。如图8所示,用户可以设置第一个进行展示的节点为<辅助>,第二个进行展示的节点为<IBTJ类型>,第三个进行展示的节点为<其他>。
为了实现上述实施例,本公开还提出一种文档格式转换装置。
图9为本公开实施例五所提供的文档格式转换装置的结构示意图。
如图9所示,该文档格式转换装置100包括:获取模块101、识别模块102、确定模块103,以及转换模块104。其中,
获取模块101,用于获取文档格式为第一格式的第一文档。
识别模块102,用于对第一文档进行识别,确定第一文档中各元素的第一属性。
作为一种可能的实现方式,第一文档为文本文档,识别模块102,具体用于根据第一文档中的各元素的格式及第一文档对应的固定样式集,确定各元素的第一属性;或者,根据第一文档中各元素的位置信息、字号信息和/或间距信息,确定各元素的第一属性。
确定模块103,用于根据预设的元素属性转换规则,确定与各元素的第一属性对应的第二属性。
作为一种可能的实现方式,确定模块103,具体用于根据预设的元素属性转换规则及 各元素的第一属性,确定各元素在第二文档中的位置及呈现形式。
作为另一种可能的实现方式,第一文档中包括段落元素,确定模块103,具体用于对段落元素进行解析,确定段落元素的摘要,或者段落元素中包括的出现频率大于阈值的词语;根据段落元素的摘要,或者包括的出现频率大于阈值的词语,确定段落元素在思维导图中的呈现形式。
转换模块104,用于根据各元素对应的第二属性,将第一文档转换为文档格式为第二格式的第二文档。
其中,第一文档为文本文档或思维导图中的一种,第二文档为另外一种。
进一步地,在本公开实施例的一种可能的实现方式中,参见图10,在图9所示实施例的基础上,该文档格式转换装置100还可以包括:
显示模块105,用于在将第一文档转换为第二文档之后,在确定当前焦点位于第二文档中的第一元素时,获取与第一元素对应的文本内容,并以预设的形式显示文本内容。
作为一种可能的实现方式,显示模块105,具体用于以浮窗的形式显示文本内容;或者,以分区显示的形式,显示文本内容。
作为一种可能的实现方式,第一文档为文本文档,第二文档为思维导图文档。
第一接收模块106,用于在将第一文档转换为第二文档之后,接收权限设置命令,权限设置命令中包括第二元素的标识及权限信息。
设置模块107,用于根据权限信息,对第二文档中与第二元素的标识对应的第二元素的权限进行设置。
第二接收模块108,用于接收第二文档打开请求,打开请求中包括验证信息。
判断模块109,用于根据权限信息,判断验证信息是否合法。
处理模块110,用于若是,则在第二文档中显示第二元素的标识对应的元素。
更新模块111,用于在将第一文档转换为第二文档之后,获取更新请求,更新请求中包括第三元素标识及待更新的信息,确定第一文档中与第三元素标识对应的目标元素,以及根据待更新的信息,对第一文档中目标元素进行更新。
需要说明的是,前述对文档格式转换方法实施例的解释说明也适用于该实施例的文档格式转换装置100,此处不再赘述。
本公开实施例的文档格式转换装置,通过获取文档格式为第一格式的第一文档,对第一文档进行识别,确定第一文档中各元素的第一属性,根据预设的元素属性转换规则,确定与各元素的第一属性对应的第二属性,根据各元素对应的第二属性,将第一文档转换为文档格式为第二格式的第二文档。由此,通过根据文档中各元素在不同格式文档中的属性,将文档中元素的属性进行转换,从而实现了文档内容在不同格式间的转换,节约了用户编辑、修改、阅读文档的时间,改善了用户体验。
为了实现上述实施例,本公开还提出一种电子设备。
图11是图示根据本公开实施例的电子设备的硬件结构示意图。
电子设备可以以各种形式来实施,本公开实施例中的电子设备可以包括但不限于诸如移动电话、智能电话、笔记本电脑、数字广播接收器、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多媒体播放器)、导航装置、车载电子设备、车载显示终端、车载电子后视镜等等的移动电子设备以及诸如数字TV、台式计算机等等的固定电子设备。
如图11所示,电子设备1100可以包括无线通信单元1110、A/V(音频/视频)输入单元1120、用户输入单元1130、感测单元1140、输出单元1150、存储器1160、接口单元1170、控制器1180和电源单元1190等等。图11示出了具有各种组件的电子设备,但是应理解的是,并不要求实施所有示出的组件。可以替代地实施更多或更少的组件。
其中,无线通信单元1110允许电子设备1100与无线通信系统或网络之间的无线电通信。A/V输入单元1120用于接收音频或视频信号。用户输入单元1130可以根据用户输入的命令生成键输入数据以控制电子设备的各种操作。感测单元1140检测电子设备1100的当前状态、电子设备1100的位置、用户对于电子设备1100的触摸输入的有无、电子设备1100的取向、电子设备1100的加速或减速移动和方向等等,并且生成用于控制电子设备1100的操作的命令或信号。接口单元1170用作至少一个外部装置与电子设备1100连接可以通过的接口。输出单元1150被构造为以视觉、音频和/或触觉方式提供输出信号。存储器1160可以存储由控制器1180执行的处理和控制操作的软件程序等等,或者可以暂时地存储己经输出或将要输出的数据。存储器1160可以包括至少一种类型的存储介质。而且,电子设备1100可以与通过网络连接执行存储器1160的存储功能的网络存储装置协作。控制器1180通常控制电子设备的总体操作。另外,控制器1180可以包括用于再现或回放多媒体数据的多媒体模块。控制器1180可以执行模式识别处理,以将在触摸屏上执行的手写输入或者图片绘制输入识别为字符或图像。电源单元1190在控制器1180的控制下接收外部电力或内部电力并且提供操作各元件和组件所需的适当的电力。
本公开实施例提出的文档格式转换方法的各种实施方式可以以使用例如计算机软件、硬件或其任何组合的计算机可读介质来实施。对于硬件实施,本公开实施例提出的文档格式转换方法的各种实施方式可以通过使用特定用途集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理装置(DSPD)、可编程逻辑装置(PLD)、现场可编程门阵列(FPGA)、处理器、控制器、微控制器、微处理器、被设计为执行这里描述的功能的电子单元中的至少一种来实施,在一些情况下,本公开实施例提出的文档格式转换方法的各种实施方式可以在控制器1180中实施。对于软件实施,本公开实施例提出的文档格式转换方法的各种实施方式可以与允许执行至少一种功能或操作的单独的软件模块来实施。软件代码可以由以任何适当的编程语言编写的软件应用程序(或程序)来实施,软件代码可以存储在存储器 1160中并且由控制器1180执行。
为了实现上述实施例,本公开还提出一种计算机可读存储介质。
图12是图示根据本公开的实施例的计算机可读存储介质的示意图。
如图12所示,根据本公开实施例的计算机可读存储介质200,其上存储有计算机可读指令201。当该计算机可读指令201由处理器运行时,执行前述的本公开各实施例的文档格式转换方法的全部或部分步骤。
在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本公开的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不必须针对的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。
此外,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。在本公开的描述中,“多个”的含义是至少两个,例如两个,三个等,除非另有明确具体的限定。
流程图中或在此以其他方式描述的任何过程或方法描述可以被理解为,表示包括一个或更多个用于实现定制逻辑功能或过程的步骤的可执行指令的代码的模块、片段或部分,并且本公开的优选实施方式的范围包括另外的实现,其中可以不按所示出或讨论的顺序,包括根据所涉及的功能按基本同时的方式或按相反的顺序,来执行功能,这应被本公开的实施例所属技术领域的技术人员所理解。
在流程图中表示或在此以其他方式描述的逻辑和/或步骤,例如,可以被认为是用于实现逻辑功能的可执行指令的定序列表,可以具体实现在任何计算机可读介质中,以供指令执行系统、装置或设备(如基于计算机的系统、包括处理器的系统或其他可以从指令执行系统、装置或设备取指令并执行指令的系统)使用,或结合这些指令执行系统、装置或设备而使用。就本说明书而言,"计算机可读介质"可以是任何可以包含、存储、通信、传播或传输程序以供指令执行系统、装置或设备或结合这些指令执行系统、装置或设备而使用的装置。计算机可读介质的更具体的示例(非穷尽性列表)包括以下:具有一个或多个布线的电连接部(电子装置),便携式计算机盘盒(磁装置),随机存取存储器(RAM),只读存储器(ROM),可擦除可编辑只读存储器(EPROM或闪速存储器),光纤装置,以及便携式光盘只读存储器(CDROM)。另外,计算机可读介质甚至可以是可在其上打印所述程序的纸或其他合适的介质,因为可以例如通过对纸或其他介质进行光学扫描,接着进行编辑、解 译或必要时以其他合适方式进行处理来以电子方式获得所述程序,然后将其存储在计算机存储器中。
应当理解,本公开的各部分可以用硬件、软件、固件或它们的组合来实现。在上述实施方式中,多个步骤或方法可以用存储在存储器中且由合适的指令执行系统执行的软件或固件来实现。如,如果用硬件来实现和在另一实施方式中一样,可用本领域公知的下列技术中的任一项或他们的组合来实现:具有用于对数据信号实现逻辑功能的逻辑门电路的离散逻辑电路,具有合适的组合逻辑门电路的专用集成电路,可编程门阵列(PGA),现场可编程门阵列(FPGA)等。
本技术领域的普通技术人员可以理解实现上述实施例方法携带的全部或部分步骤是可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,该程序在执行时,包括方法实施例的步骤之一或其组合。
此外,在本公开各个实施例中的各功能单元可以集成在一个处理模块中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。所述集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。
上述提到的存储介质可以是只读存储器,磁盘或光盘等。尽管上面已经示出和描述了本公开的实施例,可以理解的是,上述实施例是示例性的,不能理解为对本公开的限制,本领域的普通技术人员在本公开的范围内可以对上述实施例进行变化、修改、替换和变型。

Claims (12)

  1. 一种文档格式转换方法,其特征在于,包括:
    获取文档格式为第一格式的第一文档;
    对所述第一文档进行识别,确定所述第一文档中各元素的第一属性;
    根据预设的元素属性转换规则,确定与所述各元素的第一属性对应的第二属性;
    根据所述各元素对应的第二属性,将所述第一文档转换为文档格式为第二格式的第二文档;
    其中,所述第一文档为文本文档或思维导图中的一种,所述第二文档为另外一种。
  2. 如权利要求1所述的文档格式转换方法,其特征在于,所述根据预设的元素属性转换规则,确定与所述各元素的第一属性对应的第二属性,包括:
    根据预设的元素属性转换规则及各元素的第一属性,确定各元素在所述第二文档中的位置及呈现形式。
  3. 如权利要求2所述的文档格式转换方法,其特征在于,所述第一文档中包括段落元素;
    所述确定各元素在所述第二文档中的位置及呈现形式,包括:
    对所述段落元素进行解析,确定所述段落元素的摘要,或者所述段落元素中包括的出现频率大于阈值的词语;
    根据所述段落元素的摘要,或者包括的出现频率大于阈值的词语,确定所述段落元素在思维导图中的呈现形式。
  4. 如权利要求1-3任一所述的文档格式转换方法,其特征在于,所述第一文档为文本文档;
    所述确定所述第一文档中各元素的第一属性,包括:
    根据所述第一文档中的各元素的格式及所述第一文档对应的固定样式集,确定所述各元素的第一属性;
    或者,根据所述第一文档中各元素的位置信息、字号信息和/或间距信息,确定所述各元素的第一属性。
  5. 如权利要求1-4任一所述的文档格式转换方法,其特征在于,所述将所述第一文档转换为第二文档之后,还包括:
    在确定当前焦点位于所述第二文档中的第一元素时,获取与所述第一元素对应的文本内容;
    以预设的形式显示所述文本内容。
  6. 如权利要求5所述的文档格式转换方法,其特征在于,所述以预设的形式显示所述文本内容,包括:
    以浮窗的形式显示所述文本内容;
    或者,
    以分区显示的形式,显示所述文本内容。
  7. 如权利要求1-6任一所述的文档格式转换方法,其特征在于,所述第一文档为文本文档,所述第二文档为思维导图文档;
    所述将所述第一文档转换为第二文档之后,还包括:
    接收权限设置命令,所述权限设置命令中包括第二元素的标识及权限信息;
    根据所述权限信息,对所述第二文档中与所述第二元素的标识对应的第二元素的权限进行设置。
  8. 如权利要求7所述的文档格式转换方法,其特征在于,所述对所述第二文档中与所述第二元素的标识对应的第二元素的权限进行设置之后,还包括:
    接收第二文档打开请求,所述打开请求中包括验证信息;
    根据所述权限信息,判断所述验证信息是否合法;
    若是,则在所述第二文档中显示所述第二元素的标识对应的元素。
  9. 如权利要求1-8任一所述的文档格式转换方法,其特征在于,所述第一文档为文本文档,所述第二文档为思维导图文档;
    所述将所述第一文档转换为第二文档之后,还包括:
    获取更新请求,所述更新请求中包括第三元素标识及待更新的信息;
    确定所述第一文档中与所述第三元素标识对应的目标元素;
    根据所述待更新的信息,对所述第一文档中所述目标元素进行更新。
  10. 一种文档格式转换装置,其特征在于,包括:
    获取模块,用于获取文档格式为第一格式的第一文档;
    识别模块,用于对所述第一文档进行识别,确定所述第一文档中各元素的第一属性;
    确定模块,用于根据预设的元素属性转换规则,确定与所述各元素的第一属性对应的第二属性;
    转换模块,用于根据所述各元素对应的第二属性,将所述第一文档转换为文档格式为第二格式的第二文档;
    其中,所述第一文档为文本文档或思维导图中的一种,所述第二文档为另外一种。
  11. 一种电子设备,其特征在于,包括:存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时,实现如权利要求1-9中任一所述的文档格式转换方法。
  12. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机可读指令,所述计算机可读指令用于使计算机执行权利要求1-9中任一所述的文档格式转换方法。
PCT/CN2018/113420 2018-05-09 2018-11-01 文档格式转换方法和装置 WO2019214182A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810437386.0 2018-05-09
CN201810437386.0A CN108647305B (zh) 2018-05-09 2018-05-09 文档格式转换方法和装置

Publications (1)

Publication Number Publication Date
WO2019214182A1 true WO2019214182A1 (zh) 2019-11-14

Family

ID=63754002

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/113420 WO2019214182A1 (zh) 2018-05-09 2018-11-01 文档格式转换方法和装置

Country Status (2)

Country Link
CN (1) CN108647305B (zh)
WO (1) WO2019214182A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112861481A (zh) * 2021-01-29 2021-05-28 北京尚医智信健康管理有限公司 分页处理的方法、装置、电子设备及计算机可读存储介质

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108647305B (zh) * 2018-05-09 2021-07-20 天津字节跳动科技有限公司 文档格式转换方法和装置
CN111104786A (zh) * 2018-10-26 2020-05-05 北京金山办公软件股份有限公司 一种文档追踪的方法、装置、计算机存储介质及终端
CN109582934B (zh) * 2018-12-04 2023-02-10 万兴科技股份有限公司 版式文档的转换方法及装置
CN109933766B (zh) * 2019-03-13 2023-07-28 腾讯科技(深圳)有限公司 文件生成方法、装置及存储介质
CN111832261A (zh) * 2019-03-29 2020-10-27 珠海金山办公软件有限公司 一种文档样式选择方法、装置及电子设备
CN109993152B (zh) * 2019-04-15 2021-03-09 武汉轻工大学 坐标曲线积分的模式转换方法、设备、存储介质及装置
CN112001150A (zh) * 2019-05-27 2020-11-27 珠海金山办公软件有限公司 一种文档格式转换的方法、装置、计算机存储介质及终端
CN110991144A (zh) * 2019-12-03 2020-04-10 盛科网络(苏州)有限公司 固定格式文档的维护方法及维护系统
CN111865437B (zh) * 2020-06-24 2022-07-19 紫光展讯通信(惠州)有限公司 一种数字化转换方法及装置
CN112232032B (zh) * 2020-09-04 2023-08-18 科航(苏州)信息科技有限公司 docx文档的内容样式自动转换方法
CN113177390A (zh) * 2021-05-07 2021-07-27 深圳市欧瑞博科技股份有限公司 文档的智能处理方法、装置、计算机可读介质及电子设备
CN113704214A (zh) * 2021-08-27 2021-11-26 北京市律典通科技有限公司 电子卷宗文件类型转换方法、装置及计算机设备

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8103703B1 (en) * 2006-06-29 2012-01-24 Mindjet Llc System and method for providing content-specific topics in a mind mapping system
CN105893254A (zh) * 2016-03-29 2016-08-24 乐视控股(北京)有限公司 测试用例导入方法及装置
CN108647305A (zh) * 2018-05-09 2018-10-12 天津字节跳动科技有限公司 文档格式转换方法和装置

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101417842B1 (ko) * 2012-07-11 2014-07-09 정영교 문서작성과 실시간으로 연동되는 마인드맵 생성방법, 장치 및 컴퓨터로 판독 가능한 기록매체
US8949670B1 (en) * 2012-09-26 2015-02-03 Emc Corporation Method and system for translating mind maps to test management utility test cases
CN104850591B (zh) * 2015-04-24 2019-03-19 百度在线网络技术(北京)有限公司 一种数据的转换存储方法及装置
CN107885713B (zh) * 2017-11-28 2021-12-14 广州视源电子科技股份有限公司 文件格式转换方法、装置、设备和存储介质

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8103703B1 (en) * 2006-06-29 2012-01-24 Mindjet Llc System and method for providing content-specific topics in a mind mapping system
CN105893254A (zh) * 2016-03-29 2016-08-24 乐视控股(北京)有限公司 测试用例导入方法及装置
CN108647305A (zh) * 2018-05-09 2018-10-12 天津字节跳动科技有限公司 文档格式转换方法和装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"MindManager instructions", MU HONGXING-BLOG PARK, vol. 1, no. 4, 31 May 2015 (2015-05-31), pages 6 - 13, XP055650879, Retrieved from the Internet <URL:http://www.cnblogs.com/muhongxing/archive/2009/12/29/1635104.html> *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112861481A (zh) * 2021-01-29 2021-05-28 北京尚医智信健康管理有限公司 分页处理的方法、装置、电子设备及计算机可读存储介质
CN112861481B (zh) * 2021-01-29 2024-01-30 北京尚医智信健康管理有限公司 分页处理的方法、装置、电子设备及计算机可读存储介质

Also Published As

Publication number Publication date
CN108647305A (zh) 2018-10-12
CN108647305B (zh) 2021-07-20

Similar Documents

Publication Publication Date Title
WO2019214182A1 (zh) 文档格式转换方法和装置
US10484315B2 (en) Method, system and apparatus for adding network comment information
EP2691873B1 (en) Techniques to create structured document templates using enhanced content controls
EP2776946B1 (en) Document collaboration
JP5139984B2 (ja) ユーザ・インターフェース向けマークアップ・ベースの拡張性
US9098836B2 (en) Rich email attachment presentation
US8074167B2 (en) Cross domain presence of web user interface and logic
US20110264705A1 (en) Method and system for interactive generation of presentations
CN109445657B (zh) 文档编辑方法和装置
US9594736B2 (en) Display and selection of bidirectional text
WO2019205552A1 (zh) 在线文档的评论方法和装置
SG188304A1 (en) Concurrent editing of online drawings
US11675483B2 (en) Client device, control method, and storage medium for smoothly exchanging the display of images on a device
US9128591B1 (en) Providing an identifier for presenting content at a selected position
US20150058708A1 (en) Systems and methods of character dialog generation
US9286309B2 (en) Representation of last viewed or last modified portion of a document
WO2013110286A1 (en) Paragraph property detection and style reconstruction engine
WO2020187117A1 (zh) 附图页面的展示方法和装置、文本页面的展示方法和装置
CN115039064A (zh) 动态排版
WO2018176652A1 (zh) 一种数据显示方法、装置及电子设备
KR102013620B1 (ko) 웹 기반 문서의 템플릿을 변경하는 웹 기반 문서 편집 서버 및 이의 동작 방법
JP4542033B2 (ja) 文書コンテンツの複数のレンディションを提供するためのシステムおよび方法
US20160320948A1 (en) Document and object manipulation
KR102432916B1 (ko) 글자체를 제공하는 방법 및 디바이스
US10608900B2 (en) Generating a deferrable data flow

Legal Events

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

Ref document number: 18917853

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18917853

Country of ref document: EP

Kind code of ref document: A1