Document processing method, device, equipment and medium

By using document query requests and filtering unit document information during document editing, the cumbersome problems of traditional document citation process are solved, the rapid and accurate positioning of document content and the difficulty of finding it is achieved, and the editing efficiency is improved.

CN117151051BActive Publication Date: 2025-01-14MACROWING SOFTWARE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311204224.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-18
Publication Date
2025-01-14
Estimated Expiration
2043-09-18

AI Technical Summary

Technical Problem

In the traditional document editing process, the citation process of document content is cumbersome, making it difficult to achieve rapid and accurate positioning, which makes it difficult to find document content.

Method used

By obtaining the document query request for the document to be edited, the candidate unit document information is queried in the pre-stored unit document information according to the included keywords, the target unit document content is filtered, and the content is referenced to the document to be edited.

Benefits of technology

It simplifies the citation process of document content, realizes the rapid and accurate positioning of document content, reduces the difficulty of finding document content, and improves editing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117151051B_ABST
    Figure CN117151051B_ABST
Patent Text Reader

Abstract

The present invention discloses a document processing method, device, equipment and medium. The method comprises: obtaining a document query request for a document to be edited; querying and obtaining at least one candidate unit document information in the unit document information corresponding to the pre-stored unit document according to the keywords contained in the document query request; determining the corresponding candidate unit document content according to the candidate unit document information; screening the target unit document content in each of the candidate unit document contents, and citing the target unit document content to the document to be edited. The technical solution of the embodiment of the present invention simplifies the reference process of the document content, realizes the rapid and accurate positioning of the document content, and reduces the difficulty of finding the document content.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a document processing method, device, equipment and medium. Background Art

[0002] Document references are used very frequently when editing and writing documents.

[0003] In the traditional document editing process, if you want to reference the content in a certain document, you need to manually open the document, find the corresponding content, and then copy it to the document being edited.

[0004] However, this method of citing document content has the problem that the document content citing process is cumbersome, it is difficult to quickly and accurately locate the document content, and the referenced document content is difficult to find. Summary of the invention

[0005] The present invention provides a document processing method, device, equipment and medium, which simplifies the reference process of document content, realizes rapid and accurate positioning of document content, and reduces the difficulty of searching document content.

[0006] According to one aspect of the present invention, there is provided a document processing method, the method comprising:

[0007] Get a document query request for the document to be edited;

[0008] According to the keywords included in the document query request, query and obtain at least one candidate unit document information from the pre-stored unit document corresponding to the unit document;

[0009] Determining corresponding candidate unit document content according to the candidate unit document information;

[0010] In each of the candidate unit document contents, a target unit document content is screened, and the target unit document content is referenced to the document to be edited.

[0011] According to another aspect of the present invention, there is provided a document processing device, the device comprising:

[0012] A document query request acquisition module, used to acquire a document query request for a document to be edited;

[0013] A candidate unit document information determination module, configured to query and obtain at least one candidate unit document information from the unit document information corresponding to the pre-stored unit documents according to the keywords contained in the document query request;

[0014] A candidate unit document content determination module, used to determine the corresponding candidate unit document content according to the candidate unit document information;

[0015] The target unit document content reference module is used to filter the target unit document content from the candidate unit document content and reference the target unit document content to the document to be edited.

[0016] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0017] at least one processor; and

[0018] a memory communicatively connected to the at least one processor; wherein,

[0019] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the document processing method described in any embodiment of the present invention.

[0020] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the document processing method described in any embodiment of the present invention when executed.

[0021] The technical solution of the embodiment of the present invention obtains a document query request of a document to be edited, queries at least one candidate unit document information in the unit document information corresponding to the pre-stored unit document according to the keywords contained in the document query request, determines the corresponding candidate unit document content according to the candidate unit document information, screens the target unit document content in each of the candidate unit document contents, and references the target unit document content to the document to be edited, thereby solving the problems of the existing document content reference method, which has the problems of cumbersome document content reference process, difficulty in realizing fast and accurate positioning of document content, and high difficulty in searching the referenced document content, simplifies the document content reference process, realizes fast and accurate positioning of document content, and reduces the difficulty in searching document content.

[0022] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0024] Figure 1 is a flowchart of a document processing method provided according to Embodiment 1 of the present invention;

[0025] Figure 2 is a flowchart of a document processing method provided according to Embodiment 2 of the present invention;

[0026] Figure 3 is a flowchart of a document processing method provided according to Embodiment 2 of the present invention;

[0027] Figure 4 is a structural schematic diagram of a document processing device provided according to Embodiment 3 of the present invention;

[0028] Figure 5 It is a schematic diagram of the structure of an electronic device for implementing the document processing method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0029] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0030] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0031] Embodiment 1

[0032] Figure 1 A flowchart of a document processing method provided in Embodiment 1 of the present invention. The embodiment of the present invention is applicable to the case of processing documents, and the method can be executed by a document processing device, which can be implemented in the form of hardware and / or software, and can be configured in an electronic device that carries a document processing function.

[0033] See also Figure 1 The document processing method shown includes:

[0034] S110: Obtain a document query request for a document to be edited.

[0035] The document to be edited may be a document that needs to quote content from other documents. Exemplarily, the document to be edited may include a text document, a table document, a presentation, or a Hypertext Markup Language (HTML) document. The document query request may be a request to query the document content to be referenced. Optionally, the document query request may be triggered in the client by the editor of the document to be edited. Exemplarily, the client may be a real-time search engine (Elastic Search, ES).

[0036] Specifically, a document query request of the document to be edited triggered by the editor of the document to be edited in the client may be obtained.

[0037] S120. According to the keywords included in the document query request, query and obtain at least one candidate unit document information from the unit document information corresponding to the pre-stored unit documents.

[0038] The keywords included in the document query request may be search keywords for the document content to be referenced. Optionally, the keywords included in the document query request may be determined based on the content entered by the editor of the document to be edited in the client and the search method of the client. Exemplarily, the client may be a real-time search engine (Elastic Search, ES); the search method of the real-time search engine may include word segmentation search, phrase matching, and fuzzy search; the keywords included in the document query request may include at least one of the content entered by the editor of the document to be edited in the client and the word segmentation result of the content entered by the editor of the document to be edited in the client.

[0039] The unit document may be the result of splitting the document required to be referenced. The unit document information may be information about the splitting process of the document required to be referenced. Exemplarily, the unit document information may include the unit document size and the unit document position. Based on the unit document information, the position of the unit document in the referenced document may be determined. The candidate unit document information may be unit document information obtained by searching based on keywords contained in the document query request. The number of candidate unit document information is at least one.

[0040] Specifically, the content inputted by the editor of the document to be edited in the client corresponding to the document query request can be segmented according to the search method of the client to obtain the keywords contained in the document query request. According to the keywords contained in the document query request, the unit document information corresponding to the pre-stored unit document can be searched using the search method of the client to obtain at least one candidate unit document information.

[0041] S130. Determine corresponding candidate unit document content according to the candidate unit document information.

[0042] The candidate unit document content may be the unit document content determined based on the candidate unit document information. The candidate unit document may include the candidate unit document size and the candidate unit document position.

[0043] Specifically, the starting position of the candidate unit document in the candidate document can be determined based on the candidate unit document position included in the candidate unit document information. The byte length occupied by the candidate unit document can be determined based on the candidate unit document size included in the candidate unit document information, and then the end position of the candidate unit document in the candidate document can be determined. The candidate unit document content of the candidate unit document can be determined based on the starting position and end position of the candidate unit document.

[0044] S140: Filter target unit document content from each of the candidate unit document contents, and reference the target unit document content to the document to be edited.

[0045] The target unit document content may be the actual referenced unit document content. The candidate unit document content may include the target unit document content. Optionally, the target unit document content may be screened by the editor of the document to be edited.

[0046] Specifically, the target unit document content selected by the editor of the document to be edited from the candidate unit document content may be obtained, and the target unit document content may be referenced to the document to be edited.

[0047] The technical solution of the embodiment of the present invention obtains a document query request of a document to be edited, and queries at least one candidate unit document information in the unit document information corresponding to the pre-stored unit documents according to the keywords contained in the document query request, determines the corresponding candidate unit document content according to the candidate unit document information, screens the target unit document content in each of the candidate unit document contents, and references the target unit document content to the document to be edited. By using the unit document information corresponding to the pre-stored unit documents, the document content reference process is simplified, the automatic reference of the document content is realized, the time cost spent on manual search for document content is reduced, the document content can be quickly and accurately located, and the difficulty of searching for document content is reduced.

[0048] In an optional embodiment of the present invention, determining the corresponding candidate unit document content based on the candidate unit document information includes: querying the corresponding candidate document content based on the storage location of the candidate document in the candidate unit document information; querying the corresponding candidate unit document content in the candidate document content based on the candidate unit document location and the candidate unit document size in the candidate unit document information; wherein the candidate unit document location is used to characterize the location of the candidate unit document in the candidate document.

[0049] The candidate document may be the whole document in which the candidate unit document is located. The candidate document may be the document before the candidate unit document is split. When storing the document, what is actually stored is the candidate document and at least one corresponding candidate unit document information. The candidate unit document information may include the storage location of the candidate document, the candidate unit document location and the candidate unit document size. Among them, the storage location of the candidate document may be the storage location of the candidate document in the storage space. The storage location of the candidate document may be used to determine the candidate document content in the storage space. The candidate document content may be the content recorded in the candidate document. The candidate unit document location may be the storage location of the candidate unit document in the candidate document. Optionally, the candidate unit document location may be the nth unit document of the candidate unit document in the candidate document. Based on the candidate unit document location, the starting position of the candidate unit document in the candidate document may be determined. The candidate unit document size may be the size of the storage space occupied by the candidate unit document, that is, the byte length occupied by the candidate unit document content. Based on the candidate unit document size, the end position of the candidate unit document in the candidate document may be determined.

[0050] Specifically, the candidate document content corresponding to the storage location of the candidate document can be queried in the storage space according to the storage location of the candidate document in the candidate unit document. The starting position of the candidate unit document in the storage space can be determined according to the candidate unit document position in the candidate unit document information. The ending position of the candidate unit document in the storage space can be determined according to the size of the candidate unit document. According to the starting position and ending position of the candidate unit document in the storage space, the corresponding candidate unit document content is queried.

[0051] This scheme achieves the positioning of the candidate document content by introducing the storage location of the candidate document in the candidate unit document information, that is, it achieves the coarse positioning of the candidate unit document content. By introducing the candidate unit document position and the candidate unit document size, it achieves the precise positioning of the candidate unit document content. Through the two-stage positioning of the candidate unit document content, the accuracy of document content positioning is further improved, thereby further reducing the difficulty of querying the document content.

[0052] In an optional embodiment of the present invention, the target unit document content includes unformatted target unit document content and formatted target unit document content.

[0053] The unformatted target unit document content may be a target unit document content in plain text, and the formatted target unit document content may be a target unit document content with a format.

[0054] Specifically, when the target unit document content is unformatted target unit document content, the target unit document content may be directly referenced to the document to be edited.

[0055] Exemplarily, the document to be edited may be a hypertext markup language document; and the target unit document content to be referenced may be unformatted target unit document content.

[0056] Specifically, when the target unit document content is formatted target unit document content, the target unit document may be downloaded first to obtain the formatted target document content, and then the formatted target unit document content may be referenced to the document to be edited.

[0057] Exemplarily, the document to be edited may be a text document, a table document or a presentation; the target unit document content to be referenced may be a formatted target unit document content.

[0058] This solution can be applied to different application scenarios by concretizing the target unit document content into formatted target unit document content and unformatted target unit document content, thereby further improving the applicability and extensibility of document content reference.

[0059] In an optional embodiment of the present invention, the unit document information corresponding to each unit document is queried according to the keywords included in the document query request to obtain at least one candidate unit document information, including: according to the keywords included in the document query request, the unit document information corresponding to each unit document is queried to obtain a query result; according to the word frequency of the keywords in the unit document information, in the query result, at least one unit document information with a higher word frequency is selected to obtain at least one candidate unit document information.

[0060] The query result may be all query results for the unit document information based on the keywords contained in the document query request. The number of query results may be at least one. One query result corresponds to one unit document information. The query result may include the unit document information and the word frequency of the keywords in the unit document information. The word frequency of the keywords in the unit document information may be used to characterize the degree of association between the unit document information and the keywords. The higher the word frequency of the keywords in the unit document information, the higher the degree of association between the unit document information and the keywords, that is, the higher the degree of association between the unit document information and the document query request, and the higher the probability that the unit document information is screened as the target unit document information. The number of candidate unit document information may be at least one.

[0061] Specifically, the unit document information corresponding to the unit document can be queried according to the keywords included in the document query request using the client search method to obtain the query result. The word frequencies of the keywords in each unit document information can be compared, and at least one unit document information with a higher word frequency can be selected and determined as the candidate unit document information.

[0062] This scheme introduces the word frequency of keywords in unit document information, filters the query results of each unit document information based on the keywords, selects at least one unit document information with a higher word frequency, and determines it as the candidate unit document information, thereby further improving the correlation between the candidate unit document information and the keywords contained in the document query request, further improving the accuracy of the queried candidate unit document information, and then improving the accuracy of the determined target unit document content, thereby improving the accuracy of the referenced document content.

[0063] Embodiment 2

[0064] Figure 2A flowchart of a document processing method provided for the second embodiment of the present invention. Based on the above embodiment, the embodiment of the present invention further adds "obtaining candidate documents, splitting the content of the candidate documents, obtaining at least one candidate unit document and corresponding candidate unit document information, storing the candidate documents and the candidate unit document information corresponding to each candidate unit document, and adding the storage location of the candidate document to each candidate unit document information" before obtaining the document query request for the document to be edited. The content splitting of the candidate documents is achieved, and reference information is provided for reference search of the document content. By storing the candidate documents instead of directly storing each candidate unit document, the number of documents stored in the storage space is reduced, and the storage cost and maintenance cost of the documents in the storage space are reduced. It should be noted that for the parts not described in detail in the embodiment of the present invention, please refer to the description of other embodiments.

[0065] See also Figure 2 The document processing method shown includes:

[0066] S210: Obtain candidate documents.

[0067] Exemplarily, the candidate documents may include text documents, spreadsheet documents, presentation documents, or hypertext markup language documents, etc.

[0068] Specifically, the candidate document sent by the storage party of the candidate document may be obtained.

[0069] S220: Split the candidate document into its contents to obtain at least one candidate unit document and corresponding candidate unit document information.

[0070] The candidate unit documents of the same candidate document may correspond to different candidate unit document contents in the candidate document content. The candidate unit document information may be used to record the positional relationship between the candidate unit document and the candidate document to determine the position of the candidate unit document in the candidate document.

[0071] Specifically, the candidate document may be content-segmented to obtain at least one candidate unit document and corresponding candidate unit document information.

[0072] S230: Store the candidate document and the candidate unit document information corresponding to each of the candidate unit documents, and add the storage location of the candidate document to each of the candidate unit document information.

[0073] Compared with storing each candidate unit document after splitting, storing the candidate document and the candidate unit document information corresponding to each candidate unit document not only retains the positional relationship of each candidate unit document in the candidate document, that is, retains the contextual information of each candidate unit document in the candidate document, but also reduces the number of documents stored in the storage space and reduces the document management cost in the storage space. By adding the storage location of the candidate document to each candidate unit document information, the storage location of the candidate document to which it belongs can be determined based on the candidate unit document information, and then the storage location of the candidate unit document can be determined.

[0074] Specifically, the candidate document and the candidate unit document information corresponding to each candidate unit document may be stored in association, and the storage location of the candidate document may be added to each candidate unit document information.

[0075] S240: Obtain a document query request for the document to be edited.

[0076] S250: According to the keywords included in the document query request, query and obtain at least one candidate unit document information from the unit document information corresponding to the pre-stored unit documents.

[0077] S260: Determine corresponding candidate unit document content according to the candidate unit document information.

[0078] S270: Filter target unit document content from each of the candidate unit document contents, and reference the target unit document content to the document to be edited.

[0079] The technical solution of the embodiment of the present invention obtains candidate documents before the document query request for obtaining the document to be edited, splits the content of the candidate documents, obtains at least one candidate unit document and corresponding candidate unit document information, stores the candidate documents and the candidate unit document information corresponding to each candidate unit document, and adds the storage location of the candidate document to each candidate unit document information, thereby realizing content splitting of the candidate documents, providing reference information for reference search of document content, avoiding ignoring the context information of the document, resulting in missing important content or inability to understand the query results, and at the same time, by storing the candidate documents instead of directly storing each candidate unit document, the number of documents stored in the storage space is reduced, and the storage cost and maintenance cost of the documents in the storage space are reduced.

[0080] In an optional embodiment of the present invention, the content splitting of the candidate document to obtain at least one candidate unit document and corresponding candidate unit document information includes: splitting the candidate document according to structural information of the candidate document to obtain at least one candidate unit document and corresponding candidate unit document information; wherein the structural information includes directory information, list information, paragraph information or paging information.

[0081] Structural information can be used to characterize the structure of the candidate document. Through the structural information of the candidate document, the context information of the candidate document can be determined. Directory information can be used to characterize the directory structure of the candidate document. Exemplarily, the directory information may include the title of the candidate document and the corresponding text information. List information can be used to characterize the list structure of the candidate document. It can be understood that when the candidate document does not generate a corresponding directory, the structure of the candidate document can be characterized by the list information. Exemplarily, the list information may include information corresponding to at least one subheading. Paragraph information can be used to characterize the paragraph structure of the candidate document. Exemplarily, the paragraph information may be the nth paragraph of the candidate document. Pagination information can be used to characterize the pagination structure of the candidate document. Exemplarily, the pagination information may be the nth page of the candidate document.

[0082] Specifically, a document splitting control may be used to split the candidate document content according to the structure information of the candidate document to obtain at least one candidate unit document and corresponding candidate unit document information. Exemplarily, the document splitting control may be Aspose (document management control).

[0083] Exemplarily, the candidate document may be a presentation; the presentation may be split into contents according to the paging information of the presentation to obtain at least one candidate unit document contained in the presentation and corresponding candidate unit document information.

[0084] Exemplarily, the candidate document may be a text document; the text document may be content-segmented according to the directory information of the text document to obtain at least one candidate unit document contained in the text document and corresponding candidate unit document information.

[0085] This solution introduces the structural information of candidate documents, splits the candidate documents, and considers the context structure of the candidate documents, which facilitates the rapid and accurate positioning of document content when the document is referenced, further improving the accuracy of document content search and reference.

[0086] In an optional embodiment of the present invention, after splitting the candidate document according to the structural information of the candidate document to obtain at least one candidate unit document and corresponding candidate unit document information, it also includes: detecting the size of the candidate unit document; when the size of the candidate unit document is less than or equal to the preset unit document size, merging the candidate unit document into adjacent candidate unit documents.

[0087] The preset unit document size may be a preset lower limit of the storage space occupied by the unit document. The preset unit document size may be used to detect the validity of the content of the unit document. It may be understood that if the candidate unit document size is less than or equal to the preset unit document size, the content in the candidate unit document is too little, and accordingly, the valid content in the candidate unit document is too little, or the candidate unit document contains invalid content. At this time, it is difficult to directly reference the content of the candidate unit document, and the candidate unit document needs to have more valid content. Therefore, it is necessary to merge the candidate unit document and the adjacent candidate unit documents to enrich the valid content of the candidate unit document. The adjacent candidate unit documents may include the candidate unit document before the candidate unit document or the candidate unit document after the candidate unit document. Optionally, the positional relationship between the candidate unit documents contained in the candidate document may be determined based on the structural information of the candidate document.

[0088] Specifically, the unit document size may be detected and compared with a preset unit document size. When the unit document size is smaller than or equal to the preset unit document size, the unit document is merged into an adjacent unit document.

[0089] Exemplarily, the candidate documents may include a first candidate unit document, a second candidate unit document and a third candidate unit document. When the size of the second candidate unit document is less than or equal to the preset unit document size, the second candidate unit document may be merged into the first candidate unit document or the third candidate unit document.

[0090] This solution introduces a preset unit document size to detect the size of candidate unit documents, thereby realizing effective content detection of candidate unit documents and further ensuring the accuracy of document content application.

[0091] Figure 3 The present invention provides a flowchart of a document processing method according to a second embodiment of the present invention. Figure 3 This is a preferred embodiment of document processing for multi-terminal interaction. Figure 3 The document processing method comprises:

[0092] S301, the client uploads a file to the server.

[0093] Among them, the file is the candidate document.

[0094] S302: The server creates a parsing task and sends it to the parsing server.

[0095] S303, the parsing server obtains the parsing task, downloads the file, performs content parsing on the file, and obtains the unit file and the corresponding chapter information; the parsing server merges the unit files and saves them to the storage, and the storage returns the storage result to the parsing server; the parsing server writes the chapter information to the storage, and the storage returns the saving result to the parsing server; the parsing server feeds back the parsing result and parsing record to the server.

[0096] The unit file is the candidate unit document; the chapter information is the candidate unit document information. Among them, the chapter information may include data such as the unit file content, the storage information of the merged file, the offset of the unit file in the merged file, and the byte length of the unit file. The unit file content is the candidate unit document content; the storage location of the merged file is the storage location of the candidate document; the offset of the unit file in the merged file is the candidate unit document location, that is, the storage location of the candidate unit document in the candidate document; the byte length of the unit file is the size of the candidate unit document. The storage result may include the storage location of the candidate document. The saving result may include the candidate unit document information. The parsing result includes a successful parsing or a parsing failure. The parsing record is used to record the reason for the parsing failure. Exemplarily, the storage may be ES storage.

[0097] Specifically, during the parsing process, different parsing rules exist for files of different formats. The parsing server can split the file according to the file format and the corresponding parsing rules to obtain several unit files. The parsing server can merge the unit files and save them in the storage. At the same time, the parsing server can write the chapter information into the storage. When the parsing fails, the parsing service saves the parsing record and records the reason for the parsing failure. Regardless of whether the parsing is successful or not, the parsing server will feedback the parsing results and the corresponding parsing records to the server.

[0098] Exemplarily, a presentation can be parsed into candidate unit documents corresponding to a single-page slide based on Aspose; a text document can be parsed into candidate unit documents corresponding to a single paragraph according to rules. The candidate unit document information (including paging information and paragraph information) can be stored in the storage. Among them, the paging information and paragraph information are used to provide retrieval. The files where the unit files are located are merged and stored, and the data of the starting position (i.e., the candidate unit document position) and length (i.e., the candidate unit document size) of each unit file when merged are also saved in the candidate unit document information, which is used to accurately locate the unit file and realize the process of obtaining the file stream on demand.

[0099] S304. The user sends a document query request for searching and displaying unit files to the server through the client; wherein the document query request includes keywords; the server queries and obtains unit file data from the storage according to the keywords, and the storage feeds back the unit file data to the server; wherein the unit file data includes entity information, displacement value and length; the server obtains the file stream of a specified interval from the entity information according to the unit file data, and the storage returns the file stream corresponding to the unit file to the server; the server returns the file stream interface display to the client.

[0100] The unit file is the unit document. The document query request is used to query the unit document and display it in the file stream interface. The file stream interface is used to display the query results of the unit document. The unit file data is the unit document information. The entity information is the storage location of the candidate document. The displacement value is the unit document location. The length is the unit document size. The file stream is the candidate unit document.

[0101] Specifically, the relevant unit file information (i.e., candidate unit document information) can be searched from the storage (e.g., ES storage) based on the keywords. The file stream (i.e., candidate unit document content) of the specified interval (i.e., the storage location interval determined by the candidate unit document position and the candidate unit document size) can be obtained from the stored merged file (i.e., candidate document) and returned to the server. The server obtains at least one candidate unit document content and returns it to the client for display.

[0102] S305, the client references the unit file to the server; the server queries the unit file data from the storage and feeds back the unit file data to the server; the unit file data includes entity information, displacement value and length; the server obtains the file stream of the specified interval from the entity information according to the unit file data, and the storage returns the file stream corresponding to the unit file to the server; the client obtains the file stream corresponding to the unit file to complete the file stream saving file reference.

[0103] The unit file is the unit document. The unit file data is the unit document information. The entity information is the storage location of the candidate document. The offset value is the unit document location. The length is the unit document size. The file stream is the target unit document content.

[0104] Specifically, the client refers to the unit file to the server, which can be understood as the client selecting the target unit content from the candidate unit document content. Exemplarily, the target unit document content can be screened from the candidate unit document content based on the identifier of each candidate unit document content, such as the ID (identity identifier) ​​of the candidate unit document content. Correspondingly, after the client receives the target unit document content selected by the user, the client sends the identifier of the target unit document content to the server. Based on the identifier, the server obtains the file stream (i.e., the target unit document content) of the specified interval (i.e., the storage location interval determined by the target unit document position and the target unit document size) from the target document where the target unit document is located, and returns it to the client. The client receives the target unit document content, saves it as the target unit document content or the target unit document, references it in the document to be edited, and deletes the locally stored target unit document content or the target unit document.

[0105] For example, users can retrieve paragraphs based on keywords. When quoting a document, based on the starting position and length of the quoted unit file in the merged file, the file stream of the quoted unit file can be obtained from the merged file to generate paragraph content or paragraph file, providing convenient quoting.

[0106] This solution performs content parsing on the candidate document, splits the candidate document into several candidate unit documents, then merges the candidate unit documents to generate a candidate document, and indexes the storage location of the candidate document, the location of the candidate unit document, the size of the candidate unit document and other information for merged storage; when writing a document, the required target unit document information can be quickly located according to keywords, the corresponding target document and target unit location can be located, the target unit document content can be obtained from the target document, and a document content reference can be generated. Through content parsing, merged indexing and on-demand acquisition, the problems of difficult document content search, difficult content splitting management and difficult content accurate positioning are solved; after pre-parsing the candidate document, when editing and writing the document, the unit document content can be efficiently, quickly and accurately retrieved through global search, realizing quick reference to the unit document content, saving manual and complicated search time, and improving the editing efficiency of the document; at the same time, when parsing the candidate document, the candidate document and the corresponding candidate unit document information are stored, realizing merged storage of the candidate document, and the target unit file content can be obtained on demand from the merged candidate document, reducing the number of documents in storage and reducing the storage management cost.

[0107] Embodiment 3

[0108] Figure 4This is a schematic diagram of the structure of a document processing device provided in Embodiment 3 of the present invention. The embodiment of the present invention is applicable to the case of processing documents, the device can execute a document processing method, the device can be implemented in the form of hardware and / or software, and the device can be configured in an electronic device that carries a document processing function.

[0109] See also Figure 4 The document processing device shown includes: a document query request acquisition module 410, a candidate unit document information determination module 420, a candidate unit document content determination module 430 and a target unit document content reference module 440. The document query request acquisition module 410 is used to obtain a document query request of a document to be edited; the candidate unit document information determination module 420 is used to query and obtain at least one candidate unit document information from the unit document information corresponding to the pre-stored unit document according to the keywords contained in the document query request; the candidate unit document content determination module 430 is used to determine the corresponding candidate unit document content according to the candidate unit document information; and the target unit document content reference module 440 is used to filter the target unit document content from each of the candidate unit document contents and reference the target unit document content to the document to be edited.

[0110] The technical solution of the embodiment of the present invention obtains a document query request of a document to be edited, and queries at least one candidate unit document information in the unit document information corresponding to the pre-stored unit documents according to the keywords contained in the document query request, determines the corresponding candidate unit document content according to the candidate unit document information, screens the target unit document content in each of the candidate unit document contents, and references the target unit document content to the document to be edited. By using the unit document information corresponding to the pre-stored unit documents, the document content reference process is simplified, the automatic reference of the document content is realized, the time cost spent on manual search for document content is reduced, the document content can be quickly and accurately located, and the difficulty of searching for document content is reduced.

[0111] In an optional embodiment of the present invention, the candidate unit document content determination module 430 includes: a candidate document content query unit, used to query the corresponding candidate document content according to the storage position of the candidate document in the candidate unit document information; a candidate unit document content query unit, used to query the corresponding candidate unit document content in the candidate document content according to the candidate unit document position and the candidate unit document size in the candidate unit document information; wherein the candidate unit document position is used to characterize the position of the candidate unit document in the candidate document.

[0112] In an optional embodiment of the present invention, the target unit document content includes unformatted target unit document content and formatted target unit document content.

[0113] In an optional embodiment of the present invention, the candidate unit document information determination module 420 includes: a query result determination unit, which is used to query the unit document information corresponding to each unit document according to the keywords contained in the document query request to obtain a query result; a candidate unit document information determination unit, which is used to select at least one unit document information with a higher word frequency in the query result according to the word frequency of the keywords in the unit document information to obtain at least one candidate unit document information.

[0114] In an optional embodiment of the present invention, the device further includes: a candidate document acquisition module, used to obtain candidate documents before the document query request for obtaining the document to be edited; a candidate document splitting module, used to split the content of the candidate document to obtain at least one candidate unit document and corresponding candidate unit document information; a candidate document storage module, used to store the candidate document and the candidate unit document information corresponding to each candidate unit document, and add the storage location of the candidate document to each candidate unit document information.

[0115] In an optional embodiment of the present invention, the candidate document splitting module includes: a candidate document splitting unit, used to split the candidate document according to the structural information of the candidate document to obtain at least one candidate unit document and corresponding candidate unit document information; wherein the structural information includes directory information, list information, paragraph information or paging information.

[0116] In an optional embodiment of the present invention, the candidate document splitting module further includes: a unit document size detection unit, which is used to detect the size of the candidate unit document after splitting the candidate document according to the structural information of the candidate document to obtain at least one candidate unit document and corresponding candidate unit document information; and a unit document merging unit, which is used to merge the candidate unit document into an adjacent candidate unit document when the size of the candidate unit document is less than or equal to a preset unit document size.

[0117] The document processing device provided in the embodiment of the present invention can execute the document processing method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0118] In the technical solution of the embodiment of the present invention, the document query request for the document to be edited and the acquisition, storage and application of candidate documents etc. are all in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0119] Embodiment 4

[0120] Figure 5 A schematic diagram of the structure of an electronic device 500 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0121] like Figure 5 As shown, the electronic device 500 includes at least one processor 501, and a memory connected to the at least one processor 501 in communication, such as a read-only memory (ROM) 502, a random access memory (RAM) 503, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 501 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 502 or the computer program loaded from the storage unit 508 to the random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 can also be stored. The processor 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0122] Multiple components in the electronic device 500 are connected to the I / O interface 505, including: an input unit 506, such as a keyboard, a mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a disk, an optical disk, etc.; and a communication unit 509, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 509 allows the electronic device 500 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0123] The processor 501 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 501 performs the various methods and processes described above, such as a document processing method.

[0124] In some embodiments, the document processing method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 500 via the ROM 502 and / or the communication unit 509. When the computer program is loaded into the RAM 503 and executed by the processor 501, one or more steps of the document processing method described above may be performed. Alternatively, in other embodiments, the processor 501 may be configured to execute the document processing method in any other appropriate manner (e.g., by means of firmware).

[0125] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0126] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0127] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0128] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0129] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0130] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS (Virtual Private Server) services.

[0131] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0132] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A document processing method, characterized in that: The method comprises: Get a document query request for the document to be edited; According to the keywords included in the document query request, query and obtain at least one candidate unit document information from the pre-stored unit document corresponding to the unit document; Determining corresponding candidate unit document content according to the candidate unit document information; Filtering target unit document content from each of the candidate unit document contents, and referencing the target unit document content to the document to be edited; Wherein, determining the corresponding candidate unit document content according to the candidate unit document information includes: According to the storage location of the candidate document in the candidate unit document information, query the corresponding candidate document content; According to the candidate unit document position and the candidate unit document size in the candidate unit document information, in the candidate document content, the corresponding candidate unit document content is searched; wherein the candidate unit document position is used to represent the position of the candidate unit document in the candidate document; Wherein, searching for corresponding candidate unit document content in the candidate document content according to the candidate unit document position and the candidate unit document size in the candidate unit document information includes: Determining a starting position of the candidate unit document in the storage space according to the candidate unit document position in the candidate unit document information; Determining the end position of the candidate unit document in the storage space according to the candidate unit document size in the candidate unit document information; According to the starting position and the ending position of the candidate unit document in the storage space, query the corresponding candidate unit document content; The querying of the unit document information corresponding to each unit document according to the keywords included in the document query request to obtain at least one candidate unit document information includes: According to the keywords included in the document query request, query the unit document information corresponding to each unit document to obtain the query result; According to the word frequency of the keyword in the unit document information, in the query results, at least one unit document information with a higher word frequency is selected to obtain at least one candidate unit document information; Before obtaining the document query request for the document to be edited, the method further includes: Get candidate documents; Splitting the candidate document content to obtain at least one candidate unit document and corresponding candidate unit document information; The candidate document and the candidate unit document information corresponding to each candidate unit document are stored, and the storage location of the candidate document is added to each candidate unit document information.

2. The method according to claim 1, characterized in that: The target unit document content includes unformatted target unit document content and formatted target unit document content.

3. The method according to claim 1, characterized in that The step of performing content splitting on the candidate document to obtain at least one candidate unit document and corresponding candidate unit document information includes: According to the structural information of the candidate document, the candidate document is split to obtain at least one candidate unit document and corresponding candidate unit document information; wherein the structural information includes directory information, list information, paragraph information or paging information.

4. The method according to claim 3, characterized in that After splitting the candidate document according to the structural information of the candidate document to obtain at least one candidate unit document and corresponding candidate unit document information, the method further includes: Detecting the size of the candidate unit document; When the size of the candidate unit document is less than or equal to the preset unit document size, the candidate unit document is merged into adjacent candidate unit documents.

5. A document processing device, characterized in that: The device comprises: A document query request acquisition module, used to acquire a document query request for a document to be edited; A candidate unit document information determination module, configured to query and obtain at least one candidate unit document information from the unit document information corresponding to the pre-stored unit documents according to the keywords contained in the document query request; A candidate unit document content determination module, used to determine the corresponding candidate unit document content according to the candidate unit document information; A target unit document content reference module, used to filter the target unit document content from the candidate unit document content and reference the target unit document content to the document to be edited; The candidate unit document content determination module includes: A candidate document content query unit, used to query the corresponding candidate document content according to the storage location of the candidate document in the candidate unit document information; A candidate unit document content query unit, used to query the corresponding candidate unit document content in the candidate document content according to the candidate unit document position and the candidate unit document size in the candidate unit document information; wherein the candidate unit document position is used to represent the position of the candidate unit document in the candidate document; Wherein, searching for corresponding candidate unit document content in the candidate document content according to the candidate unit document position and the candidate unit document size in the candidate unit document information includes: Determining a starting position of the candidate unit document in the storage space according to the candidate unit document position in the candidate unit document information; Determining the end position of the candidate unit document in the storage space according to the candidate unit document size in the candidate unit document information; According to the starting position and the ending position of the candidate unit document in the storage space, query the corresponding candidate unit document content; The candidate unit document information determination module includes: A query result determination unit, configured to query the unit document information corresponding to each unit document according to the keywords included in the document query request to obtain a query result; a candidate unit document information determining unit, configured to select at least one unit document information with a higher word frequency in the query result according to the word frequency of the keyword in the unit document information, to obtain at least one candidate unit document information; The device further comprises: A candidate document acquisition module, used to acquire candidate documents before the document query request for acquiring the document to be edited; A candidate document splitting module is used to split the content of the candidate document to obtain at least one candidate unit document and corresponding candidate unit document information; The candidate document storage module is used to store the candidate document and the candidate unit document information corresponding to each candidate unit document, and add the storage location of the candidate document to each candidate unit document information.

6. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the document processing method according to any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the document processing method according to any one of claims 1 to 4 when executed.

Citation Information

Patent Citations

  • Document template calling method and device, electronic equipment and storage medium

    CN111414743A

  • Document query method and device, electronic equipment and storage medium

    CN112347324A