Word document content merging method, system and terminal

By properly handling the directory structure and content of Word documents, the problems of repeated merging and directory confusion during the merging process are solved, and efficient and accurate document merging is achieved.

CN120745567APending Publication Date: 2025-10-03SHANDONG INSPUR AOLIN BIG DATA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510885085.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-30
Publication Date
2025-10-03

AI Technical Summary

Technical Problem

When merging Word documents, the existing technology easily leads to repeated merging of the same content and disordered directory structure, which affects the integration quality of the report.

Method used

By obtaining the directory structure of the document to be merged, removing duplicates and forming a directory structure, determining the duplication of directories and content, only adding unique content to the target document, and recording missing content, reasonable sorting of directories and uniqueness of content are achieved.

Benefits of technology

It effectively avoids repeated merging of document content, ensures the rationality of the directory structure, and improves the integration efficiency and quality of reports.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120745567A_ABST
    Figure CN120745567A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data processing, in particular to a Word document content merging method and system and a terminal. Newly creating a content list and a target document; sequentially reading each directory in the directory structure; adding the read directory to the end of the target document; all the Word documents to be merged are traversed; judging whether a current directory exists in the traversed document, if yes, judging whether content exists in the current directory, if yes, reading all content in the directory, adding the content to a content list, judging whether content identical to the added content exists in the content list, and if not, adding the content to the content list; and if not, copying the added content to a corresponding directory in the target document. The method and the device are used for avoiding simple additional listing of document contents, merging the contents under the same catalog and putting the merged contents under the corresponding catalog, and meanwhile, avoiding repeated addition of the same contents and avoiding repeated chapter contents of the finally merged document.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and in particular to a method, system and terminal for merging Word document contents. Background Art

[0002] In today's digital information age, businesses, research institutions, and other organizations often need to generate various Word reports to support decision-making and communication during daily operations and strategic decision-making. Furthermore, due to management requirements, documents ultimately need to be merged into a complete report.

[0003] However, report submission often requires multiple individuals in various departments to complete the report separately, and these report files (Word files) need to be consolidated. Currently, mainstream document merging tools on the market simply append document contents, without merging content in the same directory into corresponding directories. Furthermore, duplicate content is merged multiple times, which can easily lead to duplicate sections in the final merged document if the integrator is not careful. Summary of the Invention

[0004] In view of the above shortcomings, the present invention provides a method, system and terminal for merging Word document contents to solve at least one aspect of the above shortcomings.

[0005] In a first aspect, the present invention provides a method for merging Word document contents, the method comprising: Q1. Get the directory structure of all Word documents to be merged, remove duplicates, and merge to form a directory structure S; Q2. Create a new empty content list; create a new empty Word document as the target document; Q3. Starting from the first directory, read each directory in the directory structure S sequentially; Q4. For each directory read, perform the following operations: Add the read directory to the end of the target document; Traverse each document in all Word documents to be merged; Determine whether the current directory exists in the traversed document: If so, determine whether there is content in the current directory: if there is content in the current directory, read all the content in the directory in the traversed document, add it to the content list, and determine whether the content list already contains the same content as the added content. If the same content exists, do not copy and paste the added content into the corresponding directory in the target document. If the same content does not exist, copy and paste the added content into the corresponding directory in the target document. If there is no content in the current directory, record that the traversed Word document lacks the content in the current directory. If not, record that the traversed document does not exist in the current directory; Q5. The document content is merged. After step Q4 is executed, the target document obtained is the merged document of all Word documents to be merged.

[0006] In an optional embodiment, in step Q1, the directory structures of all Word documents to be merged are obtained, duplicates are removed, and they are merged to form a directory structure S, including: Q11. Store all Word documents to be merged in the specified directory; Q12. Sort all Word documents to be merged stored in the specified directory according to specified document attributes to obtain a sorted file list F; Q13. Based on the file list F, form a directory structure S.

[0007] In an optional embodiment, step Q13 includes: Traverse each Word document in the file list F, where when traversing to the first Word document in the file list F, read all the directories of the first Word document to generate a directory structure S; when traversing to the next Word document in the file list F, read each directory of the second Word document, and for each directory read, determine whether it exists in the directory structure S. If it exists, do not do anything; if it does not exist, add this directory to the end of the directory structure S; repeat this recursion until all Word documents in the file list F are traversed, and the final directory structure S is the directory structure S to be formed.

[0008] In an optional embodiment, step Q13 includes: Traverse the first directory of the first Word document in the file list F and generate the directory structure S; Traverse the first directory of each Word document in the file list F. For each first directory found, determine whether it exists in the directory structure S. If it exists, do nothing. If it does not exist, append this directory to the end of the directory structure S. Traverse the second directory of each Word document in the file list F. For each second directory traversed, determine whether it exists in the directory structure S. If it exists, do nothing. If it does not exist, append this directory to the end of the directory structure S. The process is deduced in this way until all directories of each Word document in the file list F are traversed, and the directory structure S finally obtained is the directory structure S to be formed.

[0009] In an optional embodiment, in step Q13, forming a directory structure S based on the file list F includes: forming the directory structure S based on the file list F in response to a user trigger.

[0010] In an optional embodiment, in step Q4, determining whether content identical to the added content already exists in the content list includes: Using a text similarity matching algorithm, calculate the similarity between the content to be added and each previously added content in the content list; Determine whether all calculated similarities are less than the pre-set similarity threshold: If so, it is determined that the same content exists; If not, it is determined that the same content does not exist.

[0011] In an optional embodiment, an empty list L is created in advance; In step Q4: each time it is determined that the current directory does not exist in the traversed document, the traversed document is recorded in list L as missing content under the corresponding directory; each time it is determined that there is no content under the current directory, the corresponding Word document is recorded in list L as missing content under the corresponding directory.

[0012] In an optional embodiment, the method further comprises: Append each record in the list L to the corresponding directory in the target document.

[0013] In a second aspect, the present invention provides a system for merging Word document contents, the system comprising: The first module is used to obtain the directory structure of all Word documents to be merged, remove duplicates, and merge to form a directory structure S; The second module is used to create a new empty content list and a new empty Word document as the target document; The third module is used to read each directory in the directory structure S sequentially starting from the first directory; The fourth module is used to perform the following operations on each directory read: Add the read directory to the end of the target document; Traverse each document in all Word documents to be merged; Determine whether the current directory exists in the traversed document: If so, determine whether there is content in the current directory: if there is content in the current directory, read all the content in the directory in the traversed document, add it to the content list, and determine whether the content list already contains the same content as the added content. If the same content exists, do not copy and paste the added content into the corresponding directory in the target document. If the same content does not exist, copy and paste the added content into the corresponding directory in the target document. If there is no content in the current directory, record that the traversed Word document lacks the content in the current directory. If not, record that the traversed document does not exist in the current directory; The fifth module is used to obtain the target document finally obtained by the fourth module, which is the document obtained by merging the contents of each Word document to be merged.

[0014] In a third aspect, the present invention provides a terminal, comprising: processor, memory, wherein The memory is used to store computer programs, The processor is used to call and run the computer program from the memory, so that the terminal executes the methods described in the above aspects.

[0015] In a fourth aspect, a computer storage medium is provided, wherein the computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the method for merging Word document contents as described in the above aspects.

[0016] It can be seen from the above technical solutions that the present invention has the following advantages: The present invention removes duplicates from the directory structures of all Word documents to be merged, merges them to form a directory structure S, and for each directory in the read directory structure S, adds the read directory to the end of the target document, traverses each document in all Word documents to be merged, and determines whether the current directory exists in the traversed document. If so, determines whether there is content in the current directory. If there is content in the current directory, reads all the content in the directory in the traversed document, adds it to a content list, and determines whether the content list already contains the same content as the added content. If the same content exists, the added content is not copied and pasted into the corresponding directory in the target document. If the same content does not exist, the added content is copied and pasted into the corresponding directory in the target document. If there is no content in the current directory, it is recorded that the traversed Word document lacks the content in the current directory. If not, it is recorded that the traversed document does not have the current directory. This avoids the simple appending and listing of document content, helps merge content in the same directory into the corresponding directory, and also avoids multiple appending of the same content, helping to avoid duplicate chapter content in the final merged document. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solution of the present invention, the following is a brief introduction to the drawings required for the description. 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 paying any creative work.

[0018] Figure 1 is a schematic flow chart of a method according to an embodiment of the present invention.

[0019] Figure 2 FIG. 4 is a schematic block diagram of a system according to an embodiment of the present invention.

[0020] Figure 3 A schematic diagram of the structure of a terminal provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0021] The following describes in detail the method, system, and terminal steps for merging the contents of Word documents. Specific details, such as specific system structures and techniques, are provided for purposes of illustration, not limitation, to facilitate a thorough understanding of the embodiments of the present invention. However, it will be apparent to those skilled in the art that the present invention may be practiced in other embodiments without these specific details.

[0022] It should be understood that when used in the present specification, the term "comprising" indicates the presence of the described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or their collections. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.

[0023] The phrases "one embodiment" or "some embodiments" described in the present invention mean that the particular features, structures, or characteristics described in the embodiment are included in one or more embodiments of the present invention. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in other embodiments," etc. that appear in different places in the present invention do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized.

[0024] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. 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 making creative efforts are within the scope of protection of the present invention.

[0025] Figure 1 A flowchart of a method for merging Word document contents provided by an embodiment of the present invention. Figure 1 The execution subject may be a system for merging Word document contents. The method for merging Word document contents provided in the embodiment of the present invention is executed by a computer device, and accordingly, the system for merging Word document contents runs in the computer device.

[0026] Please refer to Figure 1 The method for merging Word document contents includes the following steps Q1 to Q5.

[0027] Step Q1: Obtain the directory structure of all Word documents to be merged, remove duplicates, and merge to form a directory structure S; Step Q2: Create a new empty content list; create a new empty Word document as the target document; Step Q3: Starting from the first directory, read each directory in the directory structure S sequentially; Step Q4: For each directory read, perform the following operations: Add the read directory to the end of the target document; Traverse each document in all Word documents to be merged; Determine whether the current directory exists in the traversed document: If so, determine whether there is content in the current directory: if there is content in the current directory, read all the content in the directory in the traversed document, add it to the content list, and determine whether the content list already contains the same content as the added content. If the same content exists, do not copy and paste the added content into the corresponding directory in the target document. If the same content does not exist, copy and paste the added content into the corresponding directory in the target document. If there is no content in the current directory, record that the traversed Word document lacks the content in the current directory. If not, record that the traversed document does not exist in the current directory; Step Q5: The document content is merged and the target document obtained after step Q4 is executed is the merged document of all Word documents to be merged.

[0028] If the method of this embodiment is used to merge the contents of multiple reports, the target document obtained after step Q4 is executed is a report that integrates the directories and contents of the multiple reports.

[0029] In some embodiments, obtaining the directory structures of all Word documents to be merged, removing duplicates, and merging to form a directory structure S includes: Step Q11: Store all Word documents to be merged in the specified directory; Step Q12: sort all Word documents to be merged stored in the specified directory according to the specified document attributes to obtain a sorted file list F; Step Q13: Based on the file list F, a directory structure S is formed.

[0030] The above-mentioned Word documents to be merged are Word documents to be merged.

[0031] The above traverses each document in all Word documents to be merged, that is, traverses each document in the file list F.

[0032] Exemplarily, the specified document attributes may be attributes such as the name, modification date, author, or last saver of the document.

[0033] Steps Q11 to Q12 complete the sorting of all Word documents to be merged. Specifically, during the sorting, all Word documents to be merged are placed in a pre-specified directory and then sorted according to a specified attribute of the document (such as name, modification date, etc.) to obtain a sorted file list F.

[0034] According to the file list F, the order of the directories and their contents can be obtained.

[0035] Sorting all Word documents to be merged can help users adjust the relevant properties of the documents to be merged based on the document properties on which the sorting is based, so that some documents are sorted together after the merger. For example, if a company currently has documents to be merged involving three departments, namely Department 1, Department 2, and Department 3, the document naming method can be adjusted to integrate the documents of the same department together after the merger. For example, the document name of Department 1 can start with "Department 1", the document name of Department 2 can start with "Department 2", and the document name of Department 3 can start with "Department 3". The document property used for sorting is specified as the name, and the file list F formed after sorting will include the documents of Department 1 integrated together, the documents of Department 2 integrated together, and the documents of Department 3 integrated together.

[0036] Optionally, the directory structure S is implemented using a list to facilitate the addition and deletion of data in the directory structure S.

[0037] In one embodiment, step Q13 includes: Traverse each Word document in the file list F, where when traversing to the first Word document in the file list F, read all the directories of the first Word document to generate a directory structure S; when traversing to the next Word document in the file list F, read each directory of the second Word document, and for each directory read, determine whether it exists in the directory structure S. If it exists, do not do anything; if it does not exist, add this directory to the end of the directory structure S; repeat this recursion until all Word documents in the file list F are traversed, and the final directory structure S is the directory structure S to be formed.

[0038] In another embodiment, step Q13 includes: Traverse the first directory of the first Word document in the file list F and generate the directory structure S; Traverse the first directory of each Word document in the file list F. For each first directory found, determine whether it exists in the directory structure S. If it exists, do nothing. If it does not exist, append this directory to the end of the directory structure S. Traverse the second directory of each Word document in the file list F. For each second directory traversed, determine whether it exists in the directory structure S. If it exists, do nothing. If it does not exist, append this directory to the end of the directory structure S. The process is deduced in this way until all directories of each Word document in the file list F are traversed, and the directory structure S finally obtained is the directory structure S to be formed.

[0039] Optionally, in step Q13, a directory structure S is formed based on the file list F, including: In response to a user trigger, based on the file list F, a directory structure S is formed.

[0040] During use, the user sends a trigger instruction, and Q13 in this embodiment forms a directory structure S based on the file list F in response to the user's trigger.

[0041] In some other embodiments, determining whether content identical to the added content already exists in the content list in step Q4 includes: Using a text similarity matching algorithm, calculate the similarity between the content to be added and each previously added content in the content list; Determine whether all calculated similarities are less than the pre-set similarity threshold: If so, it is determined that the same content exists; If not, it is determined that the same content does not exist.

[0042] During specific implementation, those skilled in the art may set the specific value of the aforementioned preset similarity threshold based on experience or actual conditions.

[0043] Optionally, the text similarity matching algorithm adopts the Sentence-BERT model.

[0044] Sentence-BERT (SBERT) is an improved sentence embedding model based on BERT. It optimizes the efficiency of sentence similarity calculations through a twin network structure. Its core advantage lies in providing pre-trained models that users can load and use directly. For example, after loading the model using the sentence-transformers library, sentence vectors can be quickly generated and similarity calculated.

[0045] from sentence_transformers import SentenceTransformer # Load the pre-trained SBERT model model = SentenceTransformer('all-MiniLM-L6-v2') # Generate sentence embeddings sentences = ["This is an example sentence.", "Each sentence is converted to a vector."] embeddings = model.encode(sentences) print(embeddings) Optionally, in the method of this embodiment, an empty list L is created in advance.

[0046] In the method of this embodiment, each time it is determined in step Q4 that the current directory does not exist in the traversed document, it is recorded in list L that the traversed document lacks the content under the corresponding directory.

[0047] In the method of this embodiment, each time step Q4 determines that there is no content in the current directory, it records in list L that the corresponding Word document is missing content in the corresponding directory.

[0048] Preferably, the method of this embodiment further includes: Step Q6: Append each record in the list L to the corresponding directory in the target document.

[0049] For example, if there is a record in list L that is "XX document does not fill in the content under directory AA", then this record can be appended to directory AA in the target document.

[0050] For another example, if there is a record in list L that is "XX document has no BB directory", then this record can be appended to the BB directory in the target document.

[0051] When the method of this embodiment is used to integrate multiple report documents, after each record in the list L is appended to the corresponding directory in the target document in step Q6, it is saved to generate a complete synthetic report.

[0052] In step Q4, each time it is determined that the same content exists, the document attribute information of the content added to the content list is obtained and added to the front of the corresponding content in the content list.

[0053] like Figure 2 As shown, this embodiment provides a system for merging Word document contents, the system including: The first module 201 is used to obtain the directory structure of all Word documents to be merged, remove duplicates, and merge to form a directory structure S; The second module 202 is used to create an empty content list and a new empty Word document as a target document; The third module 203 is used to sequentially read each directory in the directory structure S starting from the first directory; The fourth module 204 is configured to perform the following operations on each directory read: Add the read directory to the end of the target document; Traverse each document in all Word documents to be merged; Determine whether the current directory exists in the traversed document: If so, determine whether there is content in the current directory: if there is content in the current directory, read all the content in the directory in the traversed document, add it to the content list, and determine whether the content list already contains the same content as the added content. If the same content exists, (illustratively, this step may also include: obtaining the document attribute information added to the content list, and adding it to the front of the corresponding content in the content list or to another position) do not copy and paste the added content into the corresponding directory in the target document. If the same content does not exist, copy and paste the added content into the corresponding directory in the target document. If there is no content in the current directory, record that the traversed Word document lacks the content in the current directory (the record format may be "XX document does not have the content in directory AA"). If not, record that the traversed document does not exist in the current directory (the record format can be "XX document does not have AA directory"); The fifth module 205 is used to obtain the target document finally obtained by the fourth module, which is the document obtained by merging the contents of each Word document to be merged.

[0054] The embodiment of the system for merging Word document contents of this embodiment belongs to the same inventive concept as the method for merging Word document contents of the above-mentioned embodiments. For details not fully described in the embodiment of the system for merging Word document contents, please refer to the embodiment of the method for merging Word document contents in the previous text.

[0055] Figure 3 This is a structural diagram of a terminal 300 provided in an embodiment of the present invention. The terminal 300 can be used to execute the method provided in an embodiment of the present invention.

[0056] The terminal 300 may include a processor 310, a memory 320, and a communication unit 330. These components communicate via one or more buses. Those skilled in the art will appreciate that the server structure shown in the figure does not limit the present invention. The server structure may be a bus structure or a star structure, and may include more or fewer components than shown, or may combine certain components or arrange the components differently.

[0057] Memory 320 can be used to store execution instructions of processor 310. Memory 320 can be implemented by any type of volatile or non-volatile storage device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk. When the execution instructions in memory 320 are executed by processor 310, terminal 300 can perform some or all of the steps in the above-described method embodiments.

[0058] The processor 310 is the control center of the storage terminal. It uses various interfaces and lines to connect various parts of the entire electronic terminal. It runs or executes software programs and / or modules stored in the memory 320, and calls data stored in the memory to perform various functions of the electronic terminal and / or process data. The processor can be composed of an integrated circuit (IC), for example, it can be composed of a single packaged IC, or it can be composed of multiple packaged ICs with the same or different functions. For example, the processor 310 can only include a central processing unit (CPU). In an embodiment of the present invention, the CPU can be a single computing core or multiple computing cores.

[0059] The communication unit 330 is configured to establish a communication channel so that the storage terminal can communicate with other terminals, receive user data sent by other terminals, or send user data to other terminals.

[0060] The present invention also provides a computer storage medium that can store a program that, when executed, can include some or all of the steps of each embodiment of the present invention. The storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0061] In this specification, the same or similar parts between the various embodiments can be referred to each other. In particular, for the terminal embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description in the method embodiment.

[0062] The present invention can quickly and dynamically integrate multiple reports according to the configured sorting method, which shortens the report preparation time and improves work efficiency.

[0063] The present invention can quickly and dynamically integrate multiple reports into one report according to the configured sorting method, greatly shortening the report preparation time and improving work efficiency.

[0064] The present invention can support multiple configuration sorting methods (you can configure the sorting by name, modification date, author, etc., just specify it) to meet the personalized needs of different users. Just sort the files according to your needs.

[0065] The present invention avoids the use of traditional report generation methods, thereby helping to solve the problems of "dependence on manual operation, low efficiency and prone to errors" brought about by traditional report generation methods.

[0066] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention is not limited to the embodiments shown herein but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for merging Word document contents, characterized in that: Methods include: Q1. Get the directory structure of all Word documents to be merged, remove duplicates, and merge to form a directory structure S; Q2. Create a new empty content list; create a new empty Word document as the target document; Q3. Starting from the first directory, read each directory in the directory structure S sequentially; Q4. For each directory read, perform the following operations: Add the read directory to the end of the target document; Traverse each document in all Word documents to be merged; Determine whether the current directory exists in the traversed document: If so, determine whether there is content in the current directory: If there is content in the current directory, read all the content in the directory in the traversed document, add it to the content list, and determine whether the content list already contains the same content as the added content. If the same content exists, do not copy and paste the added content to the corresponding directory in the target document. If the same content does not exist, copy and paste the added content to the corresponding directory in the target document. If there is no content in the current directory, record that the traversed Word document lacks the content in the current directory; If not, record that the traversed document does not exist in the current directory; Q5. The document content is merged. After step Q4 is executed, the target document obtained is the merged document of all Word documents to be merged.

2. The method according to claim 1, characterized in that In step Q1, the directory structure of all Word documents to be merged is obtained, duplicates are removed, and the directory structure S is formed by merging the documents, including: Q11. Store all Word documents to be merged in the specified directory; Q12. Sort all Word documents to be merged stored in the specified directory according to specified document attributes to obtain a sorted file list F; Q13. Based on the file list F, form a directory structure S.

3. The method according to claim 2, characterized in that Q13 includes: Traverse each Word document in the file list F, where when traversing to the first Word document in the file list F, read all the directories of the first Word document to generate a directory structure S; when traversing to the next Word document in the file list F, read each directory of the second Word document, and for each directory read, determine whether it exists in the directory structure S. If it exists, do not do anything; if it does not exist, add this directory to the end of the directory structure S; repeat this recursion until all Word documents in the file list F are traversed, and the final directory structure S is the directory structure S to be formed.

4. The method according to claim 2, characterized in that Q13 includes: Traverse the first directory of the first Word document in the file list F and generate the directory structure S; Traverse the first directory of each Word document in the file list F. For each first directory found, determine whether it exists in the directory structure S. If it exists, do nothing. If it does not exist, append this directory to the end of the directory structure S. Traverse the second directory of each Word document in the file list F. For each second directory traversed, determine whether it exists in the directory structure S. If it exists, do nothing. If it does not exist, append this directory to the end of the directory structure S. The process is deduced in this way until all directories of each Word document in the file list F are traversed, and the directory structure S finally obtained is the directory structure S to be formed.

5. The method according to claim 2, characterized in that In Q13, based on the file list F, a directory structure S is formed, including: In response to a user trigger, based on the file list F, a directory structure S is formed.

6. The method according to claim 1, wherein In step Q4, the determination of whether the content list already contains the same content as the content to be added includes: Using a text similarity matching algorithm, calculate the similarity between the content to be added and each previously added content in the content list; Determine whether all calculated similarities are less than the pre-set similarity threshold: If so, it is determined that the same content exists; If not, it is determined that the same content does not exist.

7. The method according to claim 1, characterized in that Create an empty list L in advance; In step Q4: each time it is determined that the current directory does not exist in the traversed document, the traversed document is recorded in list L as missing content under the corresponding directory; each time it is determined that there is no content under the current directory, the corresponding Word document is recorded in list L as missing content under the corresponding directory.

8. The method according to claim 7, characterized in that The method also includes: Append each record in the list L to the corresponding directory in the target document.

9. A system for merging Word document contents, characterized in that: The system includes: The first module is used to obtain the directory structure of all Word documents to be merged, remove duplicates, and merge to form a directory structure S; The second module is used to create a new empty content list and a new empty Word document as the target document; The third module is used to read each directory in the directory structure S sequentially starting from the first directory; The fourth module is used to perform the following operations on each directory read: Add the read directory to the end of the target document; Traverse each document in all Word documents to be merged; Determine whether the current directory exists in the traversed document: If so, determine whether there is content in the current directory: if there is content in the current directory, read all the content in the directory in the traversed document, add it to the content list, and determine whether the content list already contains the same content as the added content. If the same content exists, do not copy and paste the added content into the corresponding directory in the target document; if the same content does not exist, copy and paste the added content into the corresponding directory in the target document; If there is no content in the current directory, record that the traversed Word document lacks the content in the current directory; If not, record that the traversed document does not exist in the current directory; The fifth module is used to obtain the target document finally obtained by the fourth module, which is the document obtained by merging the contents of each Word document to be merged.

10. A terminal, characterized in that: include: processor; A memory for storing execution instructions of the processor; The processor is configured to execute the method according to any one of claims 1 to 8.