Document management method, system and equipment and storage medium

By recursively parsing the document directory structure, automatically parsing Markdown documents, and combining Git and iGIX technologies, real-time synchronization and fine-grained permission control of the document management system are achieved, solving the problem that traditional systems cannot support multi-organization document co-construction and real-time synchronization, and significantly improving the efficiency and security of document management.

CN120045518APending Publication Date: 2025-05-27INSPUR GENERSOFT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510218973.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-26
Publication Date
2025-05-27

AI Technical Summary

Technical Problem

Traditional document management systems are difficult to support document co-construction scenarios with multiple organizations and multiple warehouses, cannot achieve real-time synchronization, is chaotic in versions, is coarse in permission management, is difficult to achieve fine-grained access control, and lacks an automated analysis mechanism, resulting in low document display efficiency.

Method used

By recursively parsing the local document directory configuration, the main folder, subfolder and multilingual directory structure are automatically identified to generate a complete tree directory system. The Markdown tag is automatically parsed using the Editor.md open source editor, converted it into standard HTML syntax, and rendered into a visual page in real time. Combined with Git branch management, real-time incremental synchronization of documents is achieved, and fine-grained permission control is achieved through the iGIX permission model.

Benefits of technology

It significantly improves the efficiency and accuracy of document structure parsing, ensures the real-time display and format of document content, enhances document security and collaboration flexibility, supports parallel editing and real-time synchronization of multi-warehouse and multi-branch documents, breaking information silos.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120045518A_ABST
    Figure CN120045518A_ABST
Patent Text Reader

Abstract

The invention discloses a document management method. The method comprises the following steps: sending a document acquisition request to a server by using a client; receiving a document file determined and returned by the server based on the document acquisition request; analyzing the document file to obtain a directory structure; obtaining a first type of file according to the directory structure; and analyzing the first type of file and generating an html page to display the file. The invention further discloses a system, computer equipment and a readable storage medium. According to the scheme provided by the invention, the documents pushed to the local from the online warehouse are loaded and analyzed and are presented in the document center in real time, so that the knowledge updating and sharing efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of document management, and particularly to a document management method, system, device, and storage medium. Background Art

[0002] With the development of information technology, document management systems have gradually become the core tools for enterprise knowledge sharing and collaboration. Traditional document management technologies are mainly based on single-organization or local deployment, and their functions are mostly limited to static storage and basic permission management. Existing technologies usually adopt a centralized architecture to achieve document storage and access through file servers or cloud storage, but there are the following significant defects:

[0003] Traditional systems are difficult to support the scenario of document co-construction in multiple organizations and multiple repositories. Documents between different teams or departments cannot be synchronized in real time, resulting in version chaos and lagging knowledge updates. Existing permission management is mostly based on coarse-grained authorization of files or roles, which cannot flexibly adapt to complex directory structures and is difficult to achieve fine-grained access control (such as dividing permissions by directory level, language, or organization). The parsing of structured documents such as Markdown relies on manual conversion tools and lacks an automated real-time parsing mechanism, resulting in low document display efficiency and easy errors. Traditional solutions cannot achieve real-time push of document changes through manual or scheduled batch synchronization, and data inconsistency problems are likely to occur during multi-organization collaboration.

[0004] The above disadvantages seriously restrict the openness, security, and real-time nature of document co-construction. Summary of the Invention

[0005] In view of this, in order to overcome at least one aspect of the above problems, an embodiment of the present invention provides a document management method, including the following steps:

[0006] Sending a document acquisition request to a server using a client;

[0007] Receiving the document file determined and returned by the server based on the document acquisition request;

[0008] Parsing the document file to obtain a directory structure;

[0009] Obtaining first-type files according to the directory structure;

[0010] Parsing the first-type files and generating an html page to display the document.

[0011] In some embodiments, receiving the document file determined and returned by the server based on the document acquisition request further includes:

[0012] Determining a document repository according to the type of the document to be acquired in the document acquisition request;

[0013] Determine the corresponding document file in the document repository according to the version of the document to be obtained.

[0014] In some embodiments, parsing the document file to obtain a directory structure further includes:

[0015] Obtain the nodes under the main folder of the document file;

[0016] Determine whether the list of the nodes is empty;

[0017] In response to not being empty, determine whether the node is a directory;

[0018] In response to the node being a directory, add the node to the directory list and return to the step of obtaining the nodes under the main folder of the document file.

[0019] In some embodiments, it further includes:

[0020] In response to the node not being a directory, determine whether it is a first type of file;

[0021] In response to it being a first type of file, add the node to the file list.

[0022] In some embodiments, obtaining the first type of file according to the directory structure further includes:

[0023] In response to the client receiving a request to access the directory structure, determine whether the requester has access permission;

[0024] In response to the requester having the access permission, obtain the first type of file to be accessed in the corresponding file list according to the directory structure.

[0025] In some embodiments, parsing the first type of file and generating an html page to display the document further includes:

[0026] Parse the syntax tags of the first type of file and convert them into corresponding html syntax tags;

[0027] Generate an html page based on the html syntax tags.

[0028] In some embodiments, it further includes:

[0029] Use the git repository to receive the latest document edited by the user;

[0030] Based on the push rule, push the latest document to the corresponding document file under the git repository.

[0031] Based on the same inventive concept, according to another aspect of the present invention, an embodiment of the present invention further provides a document management system, including:

[0032] A sending module, configured to send a document acquisition request to a server using a client;

[0033] A receiving module, configured to receive the document file determined and returned by the server based on the document acquisition request;

[0034] A first parsing module, configured to parse the document file to obtain a directory structure;

[0035] An acquisition module, configured to acquire first-type files according to the directory structure;

[0036] A second parsing module, configured to parse the first-type files and generate an html page to display the document.

[0037] Based on the same inventive concept, according to another aspect of the present invention, an embodiment of the present invention further provides a computer device, including:

[0038] At least one processor; and

[0039] A memory, the memory stores a computer program that can run on the processor, and when the processor executes the program, it executes the steps of any of the above-mentioned document management methods.

[0040] Based on the same inventive concept, according to another aspect of the present invention, an embodiment of the present invention further provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it executes the steps of any of the above-mentioned document management methods.

[0041] The present invention has the following beneficial technical effects: By recursively parsing the local document directory configuration, the present invention can automatically identify the main folder, sub-folders, and multi-language directory structures (such as Chinese and English versions), and generate a complete tree-like directory system. This method solves the problem that traditional systems cannot dynamically process complex directory levels, and significantly improves the efficiency and accuracy of document structure parsing.

[0042] The present invention uses the open-source Editor.md editor to automatically parse Markdown tags, convert them into standard HTML syntax, and render them into a visual page in real time. This process avoids the cumbersome operation of manual conversion, ensures the instant display and format uniformity of document content, and greatly improves the user experience.

[0043] The present invention takes the document directory as a permission control node, associates it with functional operations, and supports fine-grained permission allocation according to directory levels, organizations, or user roles. For example, restricting a certain organization to only access documents in specific branches. This mechanism breaks through the limitations of the traditional coarse-grained permission model and enhances document security and collaboration flexibility.

[0044] The present invention realizes real-time incremental synchronization of documents through scheduled tasks (such as a 2-minute synchronization cycle) to ensure the consistency of document versions in the scenario of multi-organization co-construction. Combined with Git branch management, it effectively avoids version conflicts and improves collaboration efficiency and data reliability.

[0045] Through the synergistic effects of recursive parsing, dynamic rendering, fine-grained permission control, and real-time synchronization, the present invention constructs an open, secure, and efficient document co-construction ecosystem. Specifically, it supports parallel editing and real-time synchronization of documents in multiple repositories and multiple branches, breaking information silos; the whole process from directory parsing to HTML generation is automated, reducing manual intervention and improving the efficiency of knowledge update; precise access control is achieved based on the permission model of iGIX to ensure the security of sensitive documents; real-time preview, multi-language support, and intuitive interface design reduce the user's learning cost and enhance the willingness to collaborate. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention, and those of ordinary skill in the art can also obtain other embodiments based on these drawings without creative efforts.

[0047] Figure 1 It is a schematic flowchart of the document management method provided by the embodiment of the present invention;

[0048] Figure 2 It is a schematic diagram of the interaction between the server and the GIT repository provided by the embodiment of the present invention;

[0049] Figure 3 It is a flowchart of the directory synchronization provided by the embodiment of the present invention;

[0050] Figure 4 It is a schematic diagram of the structure of the document management system provided by the embodiment of the present invention;

[0051] Figure 5 It is a schematic diagram of the structure of the computer device provided by the embodiment of the present invention;

[0052] Figure 6 It is a schematic diagram of the structure of the computer-readable storage medium provided by the embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0053] To make the objectives, technical solutions and advantages of the present invention more clear and understandable, the following further elaborates on the embodiments of the present invention in detail with reference to specific embodiments and the accompanying drawings.

[0054] It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are for distinguishing two entities or parameters with the same name but different identities. It can be seen that "first" and "second" are only for the convenience of expression and should not be construed as a limitation on the embodiments of the present invention. This will not be elaborated one by one in subsequent embodiments.

[0055] According to one aspect of the present invention, an embodiment of the present invention provides a document management method, as Figure 1 shown, which may include the steps:

[0056] S1, sending a document acquisition request to the server using the client.

[0057] Specifically, the user operates through the client (such as an application or a web interface), selects or specifies the document type or other relevant information to be acquired.

[0058] The client constructs a document acquisition request according to the user's selection or input. This request usually includes the basic information of the document to be acquired, such as the document type, version, etc., in order to accurately locate the target document file on the server. In some cases, this request may also contain the user's authentication information to ensure that only authorized users can access specific resources.

[0059] After constructing the document acquisition request, the client sends this request to the server through the network. Here, the "server" refers to the location where these document resources are stored and managed, which may be a cloud server or an enterprise internal data center.

[0060] For example, the user wants to acquire a technical document about the latest product features.

[0061] This document is stored on a remote server and is managed through a document management system.

[0062] The user has logged in to the document management system and has the permission to access the required document.

[0063] User operation: The user opens the client application of the document management system (which can be a desktop application or a web application). Enters the keyword "latest product features" in the search bar and selects the document type as "technical document".

[0064] Client construction request: The client constructs a document acquisition request containing the following information according to the user's input:

[0065] Document Type: "Technical Document"

[0066] Keywords: "Latest Product Features"

[0067] Version: Defaults to the latest version

[0068] User Authentication Information: Includes information such as session tokens, used to confirm the user's identity and permissions.

[0069] Sending a Request: The client sends the above - constructed document acquisition request to the server via the network. This request may use the HTTP / HTTPS protocol, encapsulated in the POST request body or as part of a GET request.

[0070] Request Example (Simplified):

[0071]

[0072]

[0073] Furthermore, in addition to the basic document type and version information, more advanced query parameters such as language version, document tags, etc. can be added to the request to more accurately locate the required document. For complex query requirements, the client can dynamically generate the request content according to the user's operations. For example, when the user selects multiple filtering conditions, the client can intelligently combine these conditions to form a composite query request. To improve the user experience, the client should perform validity checks on the input data before sending the request and be prepared to handle error responses from the server (such as 404 Not Found, 403 Forbidden, etc.), providing friendly prompt messages. For frequently requested documents, the client can implement a local caching strategy. If the requested document has not been updated, it is directly loaded from the local cache, reducing the number of network requests and improving the response speed.

[0074] S2. Receive the document file determined and returned by the server based on the document acquisition request.

[0075] Specifically, when the server receives a document acquisition request sent by the client, it will first determine the specific repository where the document is stored based on the information contained in the request (such as the document type). Each document repository may be dedicated to storing specific types of documents or versions. Once the correct document repository is determined, the server will further accurately locate the corresponding document file in that repository according to the document version information in the request. In some embodiments, the server will also perform a permission check to ensure that the requesting party has the appropriate permissions to access the required document. If the requesting party does not have sufficient permissions, the corresponding document file will not be returned. The server prepares the data to be returned to the client. This usually includes the actual document file content and any necessary metadata (such as file name, size, etc.). In some cases, for the convenience of transmission, the document may be compressed or converted into a more suitable format for transmission. Finally, the server returns the prepared document file and related information to the client via the network. This process usually involves the data transmission mechanism of the HTTP / HTTPS protocol, where the document file is sent back to the client as part of the response body.

[0076] The client listens for the response from the server and is ready to receive the returned document file. This may involve a decoding process, especially if the document was compressed or encrypted during transmission. Once the document file arrives at the client, it will be further processed. Although the details of this part are beyond the scope of the current step, it is important to understand that the client has successfully received the document file, laying the foundation for subsequent steps (such as parsing the document file to obtain the directory structure, etc.).

[0077] For example, suppose there is an online document management system where users access and manage documents through their client applications. A user has sent a document acquisition request and hopes to obtain the PDF document named "Technical Manual_v2.0".

[0078] After the server receives the document acquisition request sent by the client, it first determines the correct document repository according to the document type specified in the request (for example, "Technical Manual"). Each document repository may store different types or versions of documents.

[0079] After confirming the correct document repository, the server looks for the corresponding document file in that repository according to the version information in the request (for example, "v2.0"). If there are multiple versions, the server will select the one that matches the request.

[0080] After determining the correct document file, the server prepares the corresponding response data. This usually includes the actual document file content and its metadata (such as file name, size, etc.). Assuming the document is transmitted via the HTTPS protocol, the server may construct an HTTP response in the following form:

[0081] HTTP / 1.1 200 OK

[0082] Content-Type: application / pdf

[0083] Content-Disposition: attachment; filename="Technical Manual_v2.0.pdf"

[0084] Content-Length: 3420

[0085] %PDF-1.5 ...

[0087] In this example of an HTTP response:

[0088] Content-Type specifies that the content type of the return is PDF format.

[0089] Content-Disposition provides the suggested file name and indicates that this is an attachment, meaning the browser may prompt the user to download it rather than open it directly in the browser.

[0090] Content-Length indicates the size of the entity body part, which is 3420 bytes here.

[0091] The entity body contains the actual PDF document data.

[0092] The client listens for the response from the server and starts receiving the returned data stream. For large files, this may be a process of segmented transfer.

[0093] The client understands what type of document the received data is and how to process it based on the information in the HTTP response headers (such as Content-Type and Content-Disposition). For example, if it is a PDF document and attachment is set, the client can prompt the user to save the document to the local disk.

[0094] Furthermore, to ensure the security of data during transmission, the HTTPS protocol is usually used. HTTPS protects the communication between the client and the server through the SSL / TLS encryption layer to prevent data from being eavesdropped or tampered with. For larger document files, HTTP's Chunked Transfer Encoding can be used to allow files to be sent in a series of smaller data blocks instead of sending the entire file at once. This method helps to improve response speed and reduce memory usage. Content-Type: Used to specify the MIME type of the returned content, such as application / pdf, text / html, etc., to help the client correctly identify and process the received document files. Content-Disposition: This header field can be used to instruct the browser how to handle the returned content. For example, setting it to attachment; filename="example.pdf" allows the browser to prompt the user to download the file and suggest the file name "example.pdf".

[0095] The server should return an appropriate HTTP status code to indicate the result of the request. The common success status code is 200OK, while 404Not Found, 403Forbidden, etc. indicate error conditions such as resource not found or access denied.

[0096] In addition to the status code, specific error description information can also be included in the response body so that the client can understand the problem more accurately and may take appropriate measures based on different errors.

[0097] When returning a document, a version identifier can be included in the response header or document metadata, so that the client can clearly know the specific version of the received document. This is especially important for systems that support the coexistence of multiple versions.

[0098] If the document is large and frequently updated, consider transmitting only the changes compared to the previous version (i.e., incremental updates), thereby saving bandwidth and speeding up downloads.

[0099] By setting HTTP header fields such as Cache-Control and Expires, you can instruct the client whether and how to cache received document files, which helps reduce the number of repeated requests and improve user experience.

[0100] ETag is an entity tag mechanism that provides a means to verify whether a cached resource is still valid. When the client makes the same request again, it can carry the previously obtained ETag value through the If-None-Match header, and the server can use this to determine whether it needs to resend the resource.

[0101] S3. Parse the document file to obtain the directory structure.

[0102] Specifically, first, the main folder of the document file (usually the outermost folder) needs to be identified. Then, start traversing all the nodes (including sub-folders and files) under this main folder. Before starting the parsing, the system checks whether the node list at the current level is empty. If it is empty, it means there is no more content to parse at the current level, and this branch ends. For each node, the system first determines whether it is a file or a directory. If it is a directory, add it to the directory list and continue to drill down into this directory, repeating the above process (i.e., obtaining all the nodes under this directory again and checking whether these nodes are empty, etc.). If it is not a directory, further determine whether the node belongs to the first type of file (e.g., Markdown file or other files in a specific format). If so, add this node to the file list. Based on the information collected in the above steps, gradually build the directory structure of the entire document file. This usually means creating a tree structure where each node represents a file or a directory and contains links to its child nodes (if any). In some cases, it may also be necessary to adjust the way of building the directory structure according to the language attributes of the folder or file. For example, the directory structure can be organized according to the language used in the folder or the language version of the file itself.

[0103] For example, suppose there is a compressed package (e.g., ZIP file) containing multiple sub-folders and files, and this compressed package represents a document library that contains different types of documents (such as Markdown files, pictures, etc.). It is necessary to parse the directory structure from this compressed package.

[0104] Assume the main folder after decompression is named documentation. First, it is necessary to list all the direct sub-items under the documentation folder. The direct sub-items may include: getting-started.md (Markdown file), images (sub-folder), installation-guide.md (Markdown file). In this example, there are three direct sub-items under the documentation folder, so the node list is not empty and the processing continues. For each node, check whether it is a directory or a file: getting-started.md is a file, and further determine that it is the first type of file (in this scenario, it is a Markdown file), and add it to the file list. images is a sub-folder, add it to the directory list, and further deeply parse this folder. After entering the images folder, it is found that it contains two files, logo.png and screenshot.png, and these are not the first type of files (i.e., non-Markdown files), so only record them as the contents under the images folder. installation-guide.md is also a Markdown file, and add it to the file list. Based on the information collected in the above steps, gradually build the directory structure of the entire document file. In this example, the final directory structure is as follows:

[0105] documentation /

[0106] ├──getting-started.md

[0107] ├──images /

[0108] │├──logo.png

[0109] │└──screenshot.png

[0110] └──installation-guide.md

[0111] If the system also needs to adjust the directory structure according to languages or other attributes, additional logic can be added when building the directory. For example, if some folders or files carry specific language tags (such as zh-CN representing the Simplified Chinese version), the directory structure can be organized according to these tags. However, in this example, such complexity is not involved.

[0112] Furthermore, when parsing the document file, a depth-first search or breadth-first search algorithm can be used to traverse the entire directory structure. This helps to systematically process each folder and its subfolders. For each node (i.e., file or folder), its type needs to be determined first. Whether a node is a file or a folder can be determined by checking the file extension or metadata.

[0113] Once it is confirmed that a node is a directory, it is added to the current directory list, and the above process is repeated recursively for all sub-nodes under this directory. This recursive method can effectively construct a complete directory tree structure.

[0114] If the document management system supports a multi-language environment, then when constructing the directory list, the language attributes of the folders or files also need to be considered. For example, the directory structure can be organized according to specific language tags (such as zh-CN for Simplified Chinese).

[0115] In addition to identifying directories, special attention also needs to be paid to the nodes that belong to the first type of files. These are usually file formats that require special processing, such as Markdown files. They are identified by checking the file extension (such as.md) or other identifiers, and the eligible files are added to the file list. In practical applications, some unwanted file types (such as temporary files, system files, etc.) may need to be filtered out. This can be achieved by defining an exclusion list to ensure that only relevant files are added to the final file list.

[0116] To avoid performance issues caused by loading too much data at once, a lazy loading strategy can be adopted. That is, loading and parsing are only performed when a certain directory or file is actually needed. To improve efficiency, the directory structure can be cached after the first parsing. The next time the same directory is accessed, the information can be directly read from the cache without re-parsing the entire document file.

[0117] Various exceptions may occur during the parsing process, such as being unable to read certain files or folders. A good error handling mechanism can help the system handle these problems gracefully and avoid program crashes. To solve potential problems and improve the system, any errors or warnings that occur during the parsing process should be logged in detail. This not only helps with debugging but also provides valuable feedback information.

[0118] S4. Obtain the first type of files according to the directory structure.

[0119] Specifically, when the client receives a request to access the directory structure, the system first checks whether the requester has the corresponding access rights. This is an important step to ensure document security and privacy protection. If the requester has access rights, the system proceeds to the next step; otherwise, access is denied and an error message is returned. Permission control can be achieved through the iGIX permission control mechanism, where the document directory serves as a permission control node and is associated with functional operations to achieve precise management of directory access permissions. After confirming that the requester has access rights, the system locates and retrieves the first type of files based on the previously parsed directory structure. The "first type of files" here refers to a category of files that meet specific conditions (such as Markdown files). The system traverses each node in the directory structure (including folders and files) to find all files belonging to the first type. For each file found, the system checks its extension or internal identifier to determine whether it belongs to the first type of files. For example, when processing Markdown files, the system may look for all files with the extension.md. Once eligible files are identified, they are added to a dedicated list for subsequent processing or display. Finally, the system collates all eligible first type of files and prepares them for further use. This may involve generating metadata for each file (such as file path, size, etc.) to facilitate user browsing or searching.

[0120] For example, assume that the following directory structure has been parsed from a document repository, and now it is necessary to find all first type of files with the extension.md (i.e., Markdown files) from it:

[0121]

[0122] Suppose the client has sent a request to access this directory structure. Before starting to search for the first type of files, the system first checks whether the requester has the permission to access these files. If the requester has the appropriate permission, the system proceeds to the next step; otherwise, an error message is returned.

[0123] The system starts from the root directory documentation / and traverses its subdirectories and files layer by layer.

[0124] For each node (whether it is a file or a directory), the system checks whether it is a first type of file (in this example, it refers to a Markdown file, i.e., a file with the extension.md). Under the documentation / directory, there are two files that directly belong to the first type of files: getting-started.md and installation-guide.md. These two files will be added to the first type of file list.

[0125] Enter the images / directory and find that there are no first-type files that meet the conditions (only image files) inside, so skip this directory. Then enter the guides / directory, where there are three files and one subdirectory: user-guide.md and admin-guide.md are two Markdown files, which will be added to the list of first-type files. Enter the images / subdirectory again and find that there are also no first-type files that meet the requirements (only image files) inside, so skip it again.

[0126] After the above steps, all the first-type files sorted out by the system are as follows:

[0127] documentation / getting-started.md

[0128] documentation / installation-guide.md

[0129] documentation / guides / user-guide.md

[0130] documentation / guides / admin-guide.md

[0131] Furthermore, in order to more accurately identify the file type, the actual content of the file (i.e., the file header information) can be further checked. For example, although Markdown files have the extension.md, their authenticity can also be confirmed by checking whether there are typical Markdown syntax markers at the beginning of the file.

[0132] Role-Based Access Control (RBAC): When obtaining first-type files, permission management is a key factor. Through the RBAC model, it is possible to define which files or directories users can access based on their roles. This can ensure that only authorized users can access specific first-type files.

[0133] Fine-grained permission settings: In addition to basic role-level permissions, more detailed permission setting options can also be provided. For example, allow administrators to set read and write permissions for each file or directory separately, so as to implement a more flexible security policy.

[0134] S5. Parse the first-type files and generate html pages to display the documents.

[0135] Specifically, first, the system needs to identify the syntax tags in the first type of file. For example, for Markdown files, it is necessary to identify its specific syntax markers, such as headings (#), lists (- or *), links ([text](url)), code blocks (````), etc. This step usually involves using a dedicated Markdown parsing library, such as marked.min.js, to parse Markdown text.

[0136] After identifying the Markdown syntax tags, the next step is to convert them into corresponding HTML tags. For example, # in Markdown will be converted to <h1>The label, - or * will be converted to And Labels, etc. This process is automatically completed by the parsing library, ensuring that Markdown text can be accurately converted into HTML format.

[0137] After the conversion is completed, the system will generate a complete HTML page based on the converted HTML content. This includes, but is not limited to, adding necessary HTML header information, CSS styles, and JavaScript scripts to ensure that the page not only has the correct content but also looks good and functions properly. Open-source tools such as Editor.md may be used to assist in the conversion from Markdown to HTML and provide a preview function.

[0138] In the HTML page, introduce the required CSS and JavaScript files, such as editormd.js and marked.min.js. Use JavaScript to call the initialization function of editormd.js to bind the Markdown editor to the specified container. Utilize the marked.min.js library to process the Markdown text, convert it into an HTML structure, and render it onto the page in real-time for users to view.

[0139] For example, suppose there is a Markdown file named example.md with the following content:

[0140] # Title 1

[0141] This is a simple example of a Markdown document.

[0142] ## Subtitle

[0143] - List item 1

[0144] - List item 2

[0145] [This is a link](http: / / example.com)

[0146] The goal is to convert this Markdown file into an HTML page and display it in a browser.

[0147] Step 1: Introduce the necessary libraries

[0148] First, in the HTML page, introduce the required JavaScript libraries, such as marked.min.js for Markdown parsing and editormd.js for the conversion and rendering from Markdown to HTML.

[0149]

[0150]

[0151]

[0152]

[0153] Step 2: Read the content of the Markdown file

[0154] In this example, we asynchronously loaded the content of the example.md file through the $.get() method of jQuery. In actual applications, this step can be adjusted according to the actual situation, such as directly obtaining the Markdown content from the server side or through AJAX requests, etc.

[0155] Step 3: Convert Markdown to HTML

[0156] Using marked.js: You can directly call the marked() function to convert the Markdown text into an HTML string.

[0157] Using Editor.md: Through the editormd.markdownToHTML() function, not only can the conversion from Markdown to HTML be completed, but also rich function supports can be provided, such as table of contents generation, emoji support, etc.

[0158] Step 4: Embed the HTML content into the page

[0159] Finally, the HTML content generated by either marked.js or Editor.md will be embedded into a specific container on the page (in this example, it is ), so that when the user opens the HTML page, they can see the converted content.

[0160] When the above HTML page is loaded into the browser, it will automatically read the content of the example.md file, convert it to HTML, and display the content as shown below:

[0161] <h1>Title 1< / h1>

[0162] This is a simple example of a Markdown document.

[0163] <h2>Subtitle< / h2>

[0164]

[0165] List item 1

[0166] List item 2

[0167]

[0168] <a href="http: example.com">This is a link

[0169] This process strictly focuses on how to convert Markdown files into HTML pages and display them in a browser, without involving other steps such as document acquisition or parsing of directory structures. In this way, it can clearly show how to achieve the conversion from Markdown to HTML and its presentation on the web page.

[0170] The solution proposed by the present invention improves the efficiency of knowledge update and sharing by loading and parsing the documents pushed from the online repository to the local and presenting them in the document center in real time.

[0171] In some embodiments, receiving the document file determined and returned by the server based on the document acquisition request further includes:

[0172] Determine the document repository according to the type of the document to be acquired in the document acquisition request;

[0173] Determine the corresponding document file in the document repository according to the version of the document to be acquired.

[0174] Specifically, as Figure 2 shown, there are multiple document repositories (doclibrary) under the server (DocService), each document repository is used to store different types of files, and each document repository includes multiple versions of files. In this way, the document repository is determined according to the type of the document to be acquired, and then the corresponding document file is determined through the version of the document to be acquired.

[0175] In some embodiments, parsing the document file to obtain the directory structure further includes:

[0176] Obtain the nodes under the main folder of the document file;

[0177] Judge whether the list of the nodes is empty;

[0178] In response to not being empty, judge whether the node is a directory;

[0179] In response to the node being a directory, add the node to the directory list and return to the step of obtaining the nodes under the main folder of the document file.

[0180] In some embodiments, it further includes:

[0181] In response to the node not being a directory, judge whether it is a first type of file;

[0182] In response to it being a first type of file, add the node to the file list.

[0183] Specifically, as Figure 3 As shown, load the repository document file, recursively parse the local document file configuration, and obtain the directory structure;

[0184] In some embodiments, the file directory can also be obtained according to the directories under the current main folder, the main folder, the language used for the folder, and the language used for the file.

[0185] In some embodiments, obtaining the first type of file according to the directory structure further includes:

[0186] In response to the client receiving a request to access the directory structure, determine whether the requester has access permission;

[0187] In response to the requester having the access permission, obtain the first type of file to be accessed from the corresponding file list according to the directory structure.

[0188] Specifically, for document file permission control, it can be based on the iGIX permission control mechanism. The document file is used as a permission control node and associated with functional operations to achieve directory access permission control.

[0189] In some embodiments, parsing the first type of file and generating an html page for document display further includes:

[0190] Parse the syntax tags of the first type of file and convert them into corresponding html syntax tags;

[0191] Generate an html page based on the html syntax tags.

[0192] Specifically, after completing the loading of the document file, identify and parse the markdown tags. Use the open-source online Markdown editor Editor.md to parse the tags of the md syntax and convert them into corresponding html tags, and finally generate an html page.

[0193] First, introduce the CSS and JavaScript files required by Editor.md in the HTML page, including editormd.js and marked.min.js.

[0194] Secondly, specify a div container in the HTML and call the initialization function of editormd.js through JavaScript to bind the Markdown editor to this container.

[0195] Then, use the Markdown parsing library in marked.min.js to convert Markdown text into HTML. marked.min.js can recognize Markdown syntax and generate the corresponding HTML structure. When the user enters Markdown text in the Editor.md editor, this text will be parsed and rendered into HTML in real time and then displayed in the preview area.

[0196] In some embodiments, it further includes:

[0197] Receiving the latest document edited by the user using a git repository;

[0198] Pushing the latest document to the corresponding document file under the git repository based on the push rule.

[0199] Specifically, as Figure 2 shown, it supports scheduled synchronization of repository documents, synchronizing the documents under the git repository branch to the local directory of the online document program, and realizing real-time update display and co-construction by multiple organizations of the documents.

[0200] The solution proposed by the present invention improves the efficiency of knowledge update and sharing by loading and parsing the documents pushed from the online repository to the local and presenting them in the document center in real time. At the same time, in the process of document co-construction, permission management and security technology are crucial. Through strict permission settings and identity authentication mechanisms, it can be ensured that only authorized users can access and modify the documents, guaranteeing the security and integrity of the documents.

[0201] Based on the same inventive concept, according to another aspect of the present invention, an embodiment of the present invention further provides a document management system 400, as Figure 4 shown, including:

[0202] A sending module 401, configured to send a document acquisition request to the server using the client;

[0203] A receiving module 402, configured to receive the document file determined and returned by the server based on the document acquisition request;

[0204] A first parsing module 403, configured to parse the document file to obtain a directory structure;

[0205] An acquisition module 404, configured to acquire the first type of file according to the directory structure;

[0206] A second parsing module 405, configured to parse the first type of file and generate an html page to display the document.

[0207] In some embodiments, receiving the document file determined and returned by the server based on the document acquisition request further includes:

[0208] Determine the document repository according to the type of the document to be acquired in the document acquisition request;

[0209] Determine the corresponding document file in the document repository according to the version of the document to be acquired.

[0210] In some embodiments, parsing the document file to obtain a directory structure further includes:

[0211] Obtain the nodes under the main folder of the document file;

[0212] Determine whether the list of the nodes is empty;

[0213] In response to not being empty, determine whether the node is a directory;

[0214] In response to the node being a directory, add the node to the directory list and return to the step of obtaining the nodes under the main folder of the document file.

[0215] In some embodiments, it further includes:

[0216] In response to the node not being a directory, determine whether it is a first type of file;

[0217] In response to it being a first type of file, add the node to the file list.

[0218] In some embodiments, obtaining the first type of file according to the directory structure further includes:

[0219] In response to the client receiving a request to access the directory structure, determine whether the requester has access permission;

[0220] In response to the requester having the access permission, obtain the first type of file to be accessed in the corresponding file list according to the directory structure.

[0221] In some embodiments, parsing the first type of file and generating an html page to display the document further includes:

[0222] Parse the syntax tags of the first type of file and convert them into corresponding html syntax tags;

[0223] Generate an html page based on the html syntax tags.

[0224] In some embodiments, it further includes:

[0225] Use a git repository to receive the latest document edited by the user;

[0226] Push the latest document to the corresponding document file of the git repository based on the push rule.

[0227] The solution proposed by the present invention improves the efficiency of knowledge update and sharing by loading and parsing the documents pushed from the online repository to the local and presenting them in the document center in real time. At the same time, in the process of co-building documents, permission management and security technology are crucial. Through strict permission settings and identity authentication mechanisms, it can be ensured that only authorized users can access and modify the documents, guaranteeing the security and integrity of the documents.

[0228] Based on the same inventive concept, according to another aspect of the present invention, as Figure 5 shown, an embodiment of the present invention further provides a computer device 501, including:

[0229] At least one processor 520; and

[0230] A memory 510, the memory 510 stores a computer program 511 that can run on the processor, and when the processor 520 executes the program, it executes the steps of any one of the above document management methods.

[0231] Based on the same inventive concept, according to another aspect of the present invention, as Figure 6 shown, an embodiment of the present invention further provides a computer-readable storage medium 601, the computer-readable storage medium 601 stores a computer program 610, and when the computer program 610 is executed by a processor, it executes the steps of any one of the above document management methods.

[0232] Finally, it should be noted that those of ordinary skill in the art can understand that all or part of the processes of implementing the above method embodiments can be completed by instructing relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above method embodiments.

[0233] In addition, it should be understood that the computer-readable storage medium herein (for example, a memory) can be a volatile memory or a non-volatile memory, or can include both a volatile memory and a non-volatile memory.

[0234] Those skilled in the art will also understand that the various exemplary logical blocks, modules, circuits, and algorithmic steps described in connection with the disclosure herein can be implemented as electronic hardware, computer software, or a combination of both. To clearly illustrate this interchangeability of hardware and software, functions have been generally described in terms of the functions of various illustrative components, blocks, modules, circuits, and steps. Whether such functions are implemented as software or hardware depends on the particular application and the design constraints imposed on the overall system. The functions that can be implemented in various ways by those skilled in the art for each specific application, but such implementation decisions should not be construed as causing a departure from the scope of the disclosure of the embodiments of the present invention.

[0235] The above are exemplary embodiments disclosed by the present invention. However, it should be noted that various changes and modifications can be made without departing from the scope of the disclosure of the embodiments of the present invention as defined by the claims. The functions, steps, and / or actions of the method claims according to the disclosed embodiments herein need not be performed in any particular order. In addition, although the elements disclosed in the embodiments of the present invention can be described or claimed in individual form, they can also be understood as plural unless explicitly limited to the singular.

[0236] It should be understood that, as used herein, unless the context clearly supports exceptions, the singular form "a" is also intended to include the plural form. It should also be understood that the "and / or" used herein refers to any and all possible combinations of one or more of the associated listed items.

[0237] The serial numbers of the disclosed embodiments of the present invention above are only for description and do not represent the superiority or inferiority of the embodiments.

[0238] Those of ordinary skill in the art can understand that all or part of the steps of implementing the above embodiments can be completed by hardware or can be completed by a program instructing relevant hardware. The program can be stored in a computer-readable storage medium, and the above-mentioned storage medium can be a read-only memory, a disk, an optical disc, or the like.

[0239] Those of ordinary skill in the art should understand that: the discussion of any of the above embodiments is only exemplary and is not intended to imply that the scope of the disclosure of the embodiments of the present invention (including the claims) is limited to these examples; under the concept of the embodiments of the present invention, the technical features between the above embodiments or different embodiments can also be combined, and there are many other variations in different aspects of the embodiments of the present invention as above, which are not provided in detail for the sake of brevity. Therefore, any omission, modification, equivalent replacement, improvement, etc. made within the spirit and principle of the embodiments of the present invention shall be included within the protection scope of the embodiments of the present invention. < / h1>

Claims

1. A document management method, characterized in that: The following steps are involved: Use the client to send a document acquisition request to the server; Receiving a document file determined and returned by the server based on the document acquisition request; Parsing the document file to obtain a directory structure; Acquire a first type of file according to the directory structure; Parse the first type of file and generate an HTML page to display the document.

2. The method according to claim 1, characterized in that Receiving a document file determined and returned by the server based on the document acquisition request further includes: Determining a document repository according to the type of the document to be obtained in the document obtaining request; A corresponding document file is determined in the document repository according to the version of the document to be obtained.

3. The method according to claim 2, characterized in that Parsing the document file to obtain the directory structure further includes: Get the node under the main folder of the document file; Determine whether the list of nodes is empty; In response to not being empty, determining whether the node is a directory; In response to the node being a directory, the node is added to a directory list and the process returns to the step of acquiring the node under the main folder of the document file.

4. The method according to claim 3, characterized in that Also includes: In response to the node not being a directory, determining whether it is a first type of file; In response to the node being a first type file, adding the node to a file list.

5. The method according to claim 4, characterized in that Acquiring a first type of file according to the directory structure further includes: In response to the client receiving a request to access the directory structure, determining whether the requesting party has access rights; In response to the requesting party having the access authority, a first type of file to be accessed is obtained in a corresponding file list according to the directory structure.

6. The method according to claim 1, characterized in that Parsing the first type of file and generating an HTML page to display the document further includes: Parse the syntax tags of the first type of file and convert them into corresponding HTML syntax tags; Generate HTML pages based on HTML syntax tags.

7. The method according to claim 2, characterized in that Also includes: Use the git repository to receive the latest documents edited by users; The latest document is pushed to the document file corresponding to the git repository based on the push rule.

8. A document management system, characterized in that: include: A sending module, configured to send a document acquisition request to a server using a client; A receiving module, configured to receive a document file determined and returned by the server based on the document acquisition request; A first parsing module, configured to parse the document file to obtain a directory structure; An acquisition module, configured to acquire a first type of file according to the directory structure; The second parsing module is configured to parse the first type of file and generate an HTML page to display the document.

9. A computer device comprising: at least one processor; as well as A memory storing a computer program executable on the processor, wherein the processor executes the steps of the method according to any one of claims 1 to 7 when executing the program.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are performed.