Document conversion method and device based on agent interaction and storage medium
By splitting documents according to pages and assigning agents to each page for detection and processing, the problem of lack of refined control and error management in the existing document conversion methods is solved, and the security and efficiency of document conversion are achieved.
Patent Information
- Application Number
- CN202411755144.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2025-03-21
AI Technical Summary
The existing document conversion methods lack refined control and error management mechanisms, which makes it difficult to deal with problems encountered during document conversion process in a timely manner, and it is easy to ignore the possible complexity or security risks of individual pages in the document.
The document conversion method based on agent interaction is adopted to split the target document according to the page, and the agent is assigned to each page. The agent detects the embedded resources of the page, removes risk elements, generates error correction solutions and applies them, ensuring that the page is converted into a secure format.
Through page-by-page detection and processing, the risks of individual pages can be discovered and eliminated in a timely manner to ensure the security of documents; through information sharing among agents and the unity of error correction solutions, the efficiency and consistency of document conversion are improved.
Smart Images

Figure CN119669165A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a document conversion method, device and storage medium based on intelligent agent interaction. Background Art
[0002] Document conversion is usually to solve the needs of information sharing and processing in multiple platforms, multiple devices, multiple languages, and multiple formats, especially in terms of data consistency, availability, and long-term accessibility, etc. For example, modern enterprises and organizations often use different systems and platforms. Especially when it is necessary to share information with external partners, suppliers, and customers, differences in document formats become an obstacle, and internal documents are converted into a common cross-platform format to ensure that all platforms and devices can view and use these contents normally; for another example, with the popularization of AI and machine learning, many projects require massive documents as training data or analysis objects, but these data usually exist in various formats, and documents such as scanned contracts, customer feedback, and research reports are converted into a format that can be processed by machine learning algorithms to provide a clean and consistent data source for the model.
[0003] Most existing document conversion methods use batch processing mode, that is, converting the entire document into another format at one time. Although this method is efficient, it is easy to ignore the complexity or security risks that may exist in individual pages of the document. At the same time, existing document conversion methods lack refined control and error management mechanisms, resulting in problems encountered during the document conversion process being difficult to be handled in a timely manner. Summary of the invention
[0004] The present application provides a document conversion method, device and storage medium based on agent interaction, which can ensure the security, efficiency and consistency of document conversion.
[0005] On the one hand, the present application provides a document conversion method based on agent interaction, the method comprising:
[0006] Split the target document into pages and assign an agent to each split page;
[0007] The agent that receives page assignment detects the embedded resources of the assigned page;
[0008] If the agent that receives the page allocation detects that the page allocated to it contains risk elements, the agent removes the risk elements and converts the page containing the risk elements into a page in a safe format;
[0009] If the agent that receives the page allocation detects that the page allocated to it has an error, the error is notified to other agents, and each agent that knows the error generates an error correction solution for the error page through a shared knowledge base;
[0010] Correcting the page with errors by using the error correction scheme, and converting the corrected page into a page in a safe format;
[0011] The securely formatted pages are reassembled into a complete document output.
[0012] On the other hand, the present application provides a document conversion device based on agent interaction, the device comprising:
[0013] The splitting module is used to split the target document into pages and assign an agent to each split page;
[0014] A detection module is used for the agent that receives page allocation to detect embedded resources of the page allocated to it;
[0015] A risk elimination module, for removing the risk element and converting the page with the risk element into a safe format page if the agent receiving the page allocation detects that the page allocated to it has risk elements;
[0016] A correction module, for notifying other agents of the error if the agent receiving the page allocation detects that the page allocated to it has an error, and for each agent that has learned of the error to generate an error correction solution for the error page through a shared knowledge base;
[0017] A conversion module, used to correct the error of the page with error by using the error correction scheme, and convert the corrected page into a page in a safe format;
[0018] A reassembly module is used to reassemble the pages in the secure format into a complete document output.
[0019] In a third aspect, the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the technical solution of the document conversion method based on agent interaction as described above when executing the computer program.
[0020] In a fourth aspect, the present application provides a storage medium storing a computer program, which, when executed by a processor, implements the steps of the technical solution of the document conversion method based on agent interaction as described above.
[0021] From the technical solution provided by the present application, it can be seen that, on the one hand, compared with the prior art which is to convert the entire document in batches, the technical solution of the present application is to split the target document into pages and then detect the split pages page by page, so that the risks of individual pages can be discovered and eliminated in time, thereby ensuring the safety of the entire document; on the other hand, when the agent that accepts the page allocation detects that there is an error in the page it is allocated, it notifies the error to other agents and generates an error correction solution for the error page through a shared knowledge base. In other words, through timely information sharing between agents, the agents in the system can quickly synchronize error information, avoiding repeated detection and analysis of multiple agents when facing the same problem, thereby improving the overall work efficiency. All agents use the same error correction solution, which can ensure the consistency of repair and avoid problems caused by different repair methods. In summary, compared with the prior art, the technical solution of the present application can ensure the safety and efficiency of document conversion. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0023] Figure 1 is a flow chart of a document conversion method based on agent interaction provided in an embodiment of the present application;
[0024] Figure 2 is a structural diagram of a document conversion device based on agent interaction provided in an embodiment of the present application;
[0025] Figure 3 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0026] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0027] In this specification, adjectives such as first and second may be used only to distinguish one element or action from another element or action, without necessarily requiring or implying any actual such relationship or order. Where circumstances permit, reference to an element or component or step (etc.) should not be interpreted as being limited to only one of the elements, components, or steps, but may be one or more of the elements, components, or steps, etc.
[0028] In this specification, for the convenience of description, the sizes of various parts shown in the drawings are not drawn according to the actual proportional relationship.
[0029] Document conversion is usually to solve the needs of information sharing and processing in multiple platforms, multiple devices, multiple languages, and multiple formats, especially in terms of data consistency, availability, and long-term accessibility. For example, modern enterprises and organizations often use different systems and platforms. Especially when they need to share information with external partners, suppliers, and customers, differences in document formats become an obstacle. Converting internal documents to a common cross-platform format ensures that all platforms and devices can view and use these contents normally. For another example, with the popularity of AI and machine learning, many projects require massive documents as training data or analysis objects, but these data usually exist in various formats. Scanned contracts, customer feedback, research reports and other documents are converted into a format that can be processed by machine learning algorithms to provide a clean and consistent data source for the model. Most existing document conversion methods use batch processing mode, that is, converting the entire document into another format at one time. Although this method is efficient, it is easy to ignore the complexity or security risks that may exist in individual pages in the document. At the same time, the existing document conversion methods lack refined control and error management mechanisms, which makes it difficult to deal with problems encountered in the document conversion process in a timely manner.
[0030] In view of the above problems in the prior art, this application proposes a document conversion method based on agent interaction, the flow chart of which is shown in the attached figure. Figure 1 As shown, it mainly includes steps S101 to S106, which are described in detail as follows:
[0031] Step S101: Split the target document into pages, and assign an agent to each split page.
[0032] In the embodiment of the present application, the so-called target document refers to the original document to be converted into another format, and the agent refers to an independent computing entity that can process information and make decisions through interaction with the system, and is responsible for the safe conversion and management of the document page by page. Unlike the prior art that converts the entire document into another format at one time when doing document conversion, the technical solution of the present application is page-by-page conversion, that is, the target document is split according to pages and then converted. As an embodiment of the present application, the target document is split according to pages, and an agent is assigned to each split page. The target document is split page by page, and the pages split from the target document are assigned to the agent in a manner that one page is assigned to one agent. Since each page is assigned to an agent, each agent focuses on the processing of a single page, and can analyze and convert the page content more carefully. Each agent works independently or processes in parallel, which can reduce the waiting time for each other, thereby improving the efficiency of document conversion.
[0033] Considering that some target documents have relatively high page complexity or the levels of the pages are different, as another embodiment of the present application, the target document is split according to pages, and an agent is assigned to each split page. The method may be: split the target document page by page, and group the pages split from the target document; and assign the grouped pages to one or more agents. After the target document pages are grouped, the grouped pages are assigned to one or more agents. For example, all pages in a single group may be assigned to an agent for independent processing, that is, the group and the agent correspond one to one. For another example, the pages in a single group with higher complexity may be assigned to multiple agents for collaborative processing, and all pages in a single group with lower complexity may be assigned to an agent for independent processing, thereby simplifying the allocation implementation and improving the processing efficiency. In the above embodiment, the page complexity can be roughly analyzed from dimensions such as the number of elements and element types in the page. Specifically, the more elements a page has, the higher the page complexity is generally. In terms of the complexity of element types, some element types may be more complex than other types. For example, videos and scripts are generally more complex than plain texts. Therefore, pages with a large number of videos and / or scripts are generally more complex than pages containing only plain texts. The page complexity of a single group can be determined by the weighted average of the complexity of each page in the single group, wherein the weight of each page complexity is proportional to its complexity, and the sum of the weights of all page complexities should be equal to 1.
[0034] Grouping the pages split from the target document can be achieved through the following steps S1011 to S1012, which are described in detail as follows:
[0035] Step S1011 , preprocessing the entire target document, and analyzing the page complexity of the target document according to the number of elements in the page of the target document and the complexity of the element types.
[0036] Here, preprocessing the entire target document includes format parsing, content extraction, data cleaning and structuring of the entire target document, etc. By preprocessing the entire target document, the complexity of subsequent processing can be reduced, thereby improving processing efficiency, and the structure and content of the document can be better understood, thereby improving the accuracy of processing. In an embodiment of the present application, the page complexity of the target document can be roughly analyzed from the dimensions of the number of elements and element types in the page, wherein the elements in the page refer to the various components of the page content, and the element types include text, images, audio, video, scripts, styles, interactivity, etc. in the page. Generally speaking, the more elements a page has, the higher the complexity of the page is usually, because more content needs to be processed. In terms of the complexity of element types, some element types may be more complex than other types. For example, videos and scripts are usually more complex than plain text. Therefore, pages with more videos and / or scripts are usually more complex than pages containing only plain text. The complexity of a page containing scripts can be analyzed from the number of scripts embedded in the page and the complexity of the scripts themselves, for example, analyzing the script language type (such as JavaScript, Python, etc.), the size and execution time of the script, and the logic complexity in the script, such as loops, conditional statements, and function calls, etc. The complexity of the page style can be analyzed from dimensions such as the number and complexity of style rules applied to the page, including the length and complexity of the style sheet, the use of CSS preprocessors (such as Sass, Less), and the nesting and inheritance relationship of style rules, etc. The interactive elements in the page include forms, buttons, drag-and-drop functions, etc. Interactive elements usually require additional script and style support. Therefore, the analysis of the complexity of a page containing interactive elements can usually refer to the analysis methods of the complexity of a page containing scripts and the complexity of the page style.
[0037] In a specific implementation, all elements, the number of elements, and the element type complexity of each element contained in a single page can be determined first, and then the complexity values corresponding to the number of elements and the element type complexity values of each element can be weighted and summed in a preset manner to finally obtain a total complexity value, and the total complexity value can be used as the complexity data of the page. Among them, the complexity values corresponding to different numbers of elements can be set in advance according to actual conditions, the complexity values of different element types can also be set in advance according to actual conditions, and can also be calculated based on a preset method. Of course, other settings based on actual needs are also within the protection scope of the present invention.
[0038] Step S1012, according to the analysis result of the page complexity, the number of pages included in each group is defined, and the pages split from the target document are statically grouped, or the pages split from the target document are dynamically grouped.
[0039] If the structure of the target document is relatively uniform, that is, the pages in the document are similar in content organization, format, element type and complexity (which means that there are no significant differences between the pages, and they follow the same design template and content layout), due to its consistency, simplified management, efficiency improvement, resource utilization, predictability and easy maintenance, for such target documents, the number of pages contained in each group can be defined according to the analysis results of page complexity, and the pages of the target document can be statically grouped. Specifically, the number of pages contained in each group can be defined according to the scale of the target document and the processing power of the agent, so as to avoid excessive load on a single agent due to too large a group, or waste of resources due to too small a group. Specifically, an empty group list can be initialized first; then, each page in the target document is traversed and the page is assigned to the corresponding group according to the grouping strategy; if the number of pages in the target document is an integer multiple of the number of groups, each group contains the same number of pages; if it is not an integer multiple, the number of pages in the last group is adjusted according to the actual situation. It should be noted that in the above-mentioned embodiment, the static grouping of the pages of the target document should be understood in a broad sense, that is, a certain buffer space can be reserved in the grouping strategy to cope with possible processing delays or abnormal situations. For example, the number of buffer pages reserved for each group can be determined based on the overall scale of the target document, the processing capacity of the agent, and the expected processing delay. The buffer size should be sufficient to cope with common processing delays, but should not be too large to avoid wasting resources. In addition, the buffer size can be dynamically adjusted according to the actual processing situation. If the processing speed of the agent in a certain group is faster than expected, some buffer pages can be allocated to the agents in other groups with slower processing. Conversely, if the agents in a certain group encounter processing delays, buffer pages can be used to maintain the continuous work of the agent to avoid idle waiting.
[0040] Specifically, according to the analysis result of page complexity, the pages of the target document can be dynamically grouped by the following steps a to e:
[0041] Step a: Initialize an empty group list;
[0042] Step b: Traverse each page of the target document and assign it to the appropriate group according to its complexity;
[0043] Step c: If a page of the target document has high complexity, it can be grouped separately;
[0044] Step d: If a page of the target document has low complexity, it can be added to the current group until the group complexity threshold or group size limit is reached;
[0045] Step e: Once the threshold or limit is reached, a new grouping is started.
[0046] The processing from step b to step e is repeated until the pages of the target document are evenly divided into corresponding groups.
[0047] Step S102: The agent to which the page is assigned detects the embedded resources of the page to which it is assigned.
[0048] The embedded resources of a page can be all static or dynamic resources in the page, including dynamic content (e.g., images, videos, audios), embedded objects and scripts, etc. These embedded resources may pose risks to the page. Therefore, the agent assigned to the page detects the embedded resources of the page to which it is assigned. The above-mentioned dynamic grouping of pages split from the target document based on the analysis results of page complexity can avoid resource waste, reduce communication and synchronization overhead between agents, support parallel processing, and speed up document conversion. In addition, this processing method is also highly fault-tolerant. Even if an agent in a group fails, agents in other groups can continue to work, thereby improving the efficiency and reliability of document conversion.
[0049] Step S103: If the agent that accepts the page allocation detects that the page allocated to it contains risk elements, the risk elements are removed and the page containing the risk elements is converted into a page in a safe format.
[0050] Specifically, if the agent that accepts page assignment detects that the page it is assigned contains risky elements, then the risky elements are removed and the page with risky elements is converted into a safe format. The page can be: the agent uses various recognition algorithms (such as text analysis, image recognition, pattern matching, etc.) to identify embedded resources such as dynamic content, scripts and embedded objects in the target document; the agent compares the identified embedded resources with the security policy (that is, a set of rules defined by security experts, which clearly specify which types of embedded resources are safe and which may be risky). If the embedded resource is in the allowed list specified by the security policy, the embedded resource is marked as safe; if the embedded resource is in the prohibited list specified by the security policy, the embedded resource is marked as dangerous and prepared for removal; if the embedded resource requires further inspection, a more in-depth risk assessment is performed, such as: static code analysis of scripts to detect potential malicious behavior, and external links. URL reputation analysis, checking whether it points to known malicious websites and performing behavioral analysis on macros to determine whether they attempt to perform unsafe operations, etc.; based on the results of the risk assessment, the agent will perform the following operations: for embedded resources marked as dangerous, the agent will remove them from the target document, and for embedded resources that require further inspection, the agent will perform corresponding cleaning or conversion operations, such as: disabling scripts or converting them into static content, replacing or deleting suspicious external links, and clearing or modifying macros that may cause problems, etc.; for the remaining embedded resources in the target document, the agent converts them into a safe format, such as: converting embedded scripts into pictures or text descriptions, re-encoding images in the target document to eliminate potential hidden codes, and cleaning text content to remove possible formatting errors or invisible characters, etc.; through the above operations, pages with risky elements are converted into pages in a safe format.
[0051] Step S104: If the agent that receives the page allocation detects that the page allocated to it has an error, it notifies the error to other agents, and each agent that knows the error generates an error correction solution for the error page through a shared knowledge base.
[0052] In the embodiments of the present application, although each agent is an independent individual responsible for independently processing one or more pages, some errors may be cross-page or global problems. Specifically, some documents, especially complex dynamic documents, may contain cross-page references, scripts or embedded objects. If an agent finds an error in the page it is responsible for (for example, an unparseable script or a damaged embedded object), the error may not only affect the page, but also other pages. For example, the security policy of the document may be global, not just applicable to a certain page. For example, certain embedded content types (such as specific scripts or plug-ins) may be marked as potential risks during the conversion process. If an agent detects such a risk, it needs to broadcast this information to other agents to ensure that all agents adopt the same security policy when processing similar content. Otherwise, the security processing standards of different pages may be inconsistent, resulting in the failure of the security of the entire document, etc. The above facts or scenarios all require coordination and notification between agents, for example, notifying other agents of errors in the assigned pages and generating error correction solutions for error pages through a shared knowledge base. As an embodiment of the present application, if the agent that receives the page allocation detects that the page allocated to it has an error, then the error correction solution of notifying the error to other agents and generating the error page through the shared knowledge base can be implemented through steps S1041 to S1043, as described in detail as follows:
[0053] Step S1041: The first-initiating intelligent agent broadcasts a message to other intelligent agents that a page error exists, requesting other intelligent agents to participate in error correction, wherein the first-initiating intelligent agent is the intelligent agent that accepts page allocation and detects that the page it allocates has an error for the first time.
[0054] Step S1042: Other agents evaluate the preliminary error correction solution proposed by the first agent based on the information in the shared knowledge base, and express support or opposition through voting.
[0055] Step S1043: If the proposed error correction solution is supported by the majority of intelligent agents, the error correction solution supported by the majority of intelligent agents is accepted as the final error correction solution. Otherwise, the initial intelligent agent or other intelligent agents re-propose a new proposal.
[0056] In the above embodiment, any intelligent agent that detects an error in its allocated page for the first time can negotiate an error correction solution with other intelligent agents by broadcasting the error it finds to other intelligent agents in the system.
[0057] As another embodiment of the present application, if the agent that receives the page allocation detects that the page allocated to it has an error, then notifying the error to other agents and generating an error correction solution for the error page through the shared knowledge base can also be implemented through steps S'1041 to S'1044, as described in detail as follows:
[0058] Step S'1041: The scheduling node receives a message from a first-starting intelligent agent indicating that a page has an error, wherein the first-starting intelligent agent is an intelligent agent that accepts page allocation and detects for the first time that an error exists in the page allocated to it.
[0059] In the embodiment of the present application, the scheduling node is also called the central node, which is a computing entity that has the function of scheduling, managing, and controlling the agents in the system. Unlike the previous embodiment in which the first-launching agent broadcasts the message that there is an error in the page, in this embodiment, the first-launching agent sends the message that there is an error in the page to the scheduling node.
[0060] Step S'1042: The scheduling node determines the page in the target document that is related to the page error according to the message that the page error exists.
[0061] Specifically, the scheduling node queries the dependency table or the global document structure index table it maintains; and determines the page in the target document that is related to the page error based on the dependency in the dependency table or the global document structure index in the global document structure index table.
[0062] Step S'1043: The scheduling node center node sends a message indicating that a page has an error to the agent responsible for processing pages related to the page having an error.
[0063] Step S'1044: Based on the information in the shared knowledge base, the first issuing agent and the agent processing the page related to the page error generate an error correction solution for the error page through negotiation.
[0064] Here, the first issuing intelligent agent and the intelligent agent that processes the page related to the page error generate an error correction solution for the error page through negotiation. Its technical solution is the same as steps S1042 to S1043 of the aforementioned embodiment. Please refer to the relevant description of the aforementioned embodiment and will not be repeated here.
[0065] Compared with the aforementioned embodiment which notifies the page of error messages by broadcasting, the present embodiment notifies the page of error messages by scheduling nodes. On the one hand, by controlling the transmission range of the message, only truly relevant agents receive the notification, thus avoiding irrelevant agents from receiving and processing irrelevant information, saving system resources and network bandwidth. On the other hand, each agent only needs to deal with errors and information related to itself, without having to perform additional checks or judgments due to receiving irrelevant broadcast messages, thereby improving the efficiency of each agent.
[0066] Step S105: adopting an error correction scheme to correct the page with errors, and converting the corrected page into a page in a safe format.
[0067] Here, converting the page after error correction into a page in a safe format is the same as the solution of converting the page with risk elements into a page in a safe format in the aforementioned embodiment. Please refer to the relevant description of the aforementioned embodiment, and no further details will be given here.
[0068] Step S106: Reassemble the pages in the secure format into a complete document output.
[0069] Specifically, all pages of the target document can be verified for security and correctness by the scheduling node or any designated agent in the system, including in the page parsing stage, the agent will scan the code and resources in the page, and judge the security of all pages of the target document by checking whether there are potential security vulnerabilities (such as XSS, SQL injection, etc.), and through the preset content template or page structure, the page content and layout are verified to be correct in the expected format and logic. Then, the scheduling node or the designated agent will save all verified page contents in a standardized data format (such as HTML, XML, etc.), and remove any dynamic scripts and embedded non-essential objects. After the combination is completed, the scheduling node or the designated agent will perform another integrity check to ensure that the document content is not omitted and all pages are combined correctly in order, and the recombined page content will be output in the target format.
[0070] From the above attached Figure 1 It can be seen from the example document conversion method based on agent interaction that, on the one hand, compared with the prior art which is to convert the entire document in batches, the technical solution of the present application is to split the target document into pages and then detect the split pages page by page, so that the risks of individual pages can be discovered and eliminated in time, thereby ensuring the safety of the entire document; on the other hand, when the agent that accepts the page allocation detects that there is an error in the page it is assigned, it notifies the error to other agents and generates an error correction solution for the error page through a shared knowledge base. In other words, through timely information sharing between agents, the agents in the system can quickly synchronize error information, avoiding repeated detection and analysis of multiple agents when facing the same problem, thereby improving the overall work efficiency. All agents use the same error correction solution, which can ensure the consistency of repair and avoid problems caused by different repair methods. In summary, compared with the prior art, the technical solution of the present application can ensure the safety and efficiency of document conversion.
[0071] Please see attached Figure 2 , is a document conversion device based on agent interaction provided in an embodiment of the present application, the device may include a splitting module 201, a detection module 202, a risk elimination module 203, a correction module 204, a conversion module 205 and a reorganization module 206, which are described in detail as follows:
[0072] A splitting module 201 is used to split the target document into pages and assign an agent to each split page;
[0073] Detection module 202, used for the agent to which the page is assigned to detect the embedded resources of the page assigned to it;
[0074] The risk elimination module 203 is used to remove the risk elements and convert the page with risk elements into a safe format page if the agent receiving the page allocation detects that the page allocated to it has risk elements;
[0075] Correction module 204, for notifying other agents of the error if the agent receiving the page allocation detects that the page allocated to it has an error, and each agent that has learned of the error generates an error correction solution for the error page through a shared knowledge base;
[0076] The conversion module 205 is used to correct the error of the page with error by using the error correction scheme, and convert the corrected page into a page in a safe format;
[0077] The reassembly module 206 is used to reassemble the pages in the security format into a complete document output.
[0078] From the above attached Figure 2 It can be seen from the example of the document conversion device based on agent interaction that, on the one hand, compared with the prior art that batch converts the entire document, the technical solution of the present application is to split the target document into pages and then detect the split pages page by page, so that the risks of individual pages can be discovered and eliminated in time, thereby ensuring the safety of the entire document; on the other hand, when the agent that accepts the page allocation detects that there is an error in the page it is assigned, it notifies the error to other agents and generates an error correction solution for the error page through a shared knowledge base. In other words, through timely information sharing between agents, the agents in the system can quickly synchronize error information to avoid repeated detection and analysis of multiple agents when facing the same problem, thereby improving the overall work efficiency. All agents use the same error correction solution to ensure the consistency of repair and avoid problems caused by different repair methods. In summary, compared with the prior art, the technical solution of the present application can ensure the safety and efficiency of document conversion.
[0079] Figure 3 Schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Figure 3 As shown, the electronic device 3 of this embodiment mainly includes: a processor 30, a memory 31, and a computer program 32 stored in the memory 31 and executable on the processor 30, such as a program of a document conversion method based on agent interaction. When the processor 30 executes the computer program 32, the steps in the embodiment of the document conversion method based on agent interaction are implemented, such as Figure 1Alternatively, when the processor 30 executes the computer program 32, the functions of each module / unit in the above-mentioned device embodiments are implemented, for example Figure 2 The functions of the splitting module 201, the detection module 202, the risk elimination module 203, the correction module 204, the conversion module 205 and the reorganization module 206 are shown.
[0080] Exemplarily, the computer program 32 of the document conversion method based on agent interaction mainly includes: splitting the target document according to pages, assigning an agent to each split page; the agent that accepts the page assignment detects the embedded resources of the page assigned to it; if the agent that accepts the page assignment detects that the page assigned to it has risk elements, then remove the risk elements and convert the page with risk elements into a safe format page; if the agent that accepts the page assignment detects that the page assigned to it has errors, then notify the errors to other agents, and each agent that knows the errors generates an error correction scheme for the error page through a shared knowledge base; the error correction scheme is used to correct the page with errors, and the corrected page is converted into a safe format page; the safe format page is reassembled into a complete document output. The computer program 32 can be divided into one or more modules / units, one or more modules / units are stored in the memory 31, and are executed by the processor 30 to complete the present application. One or more modules / units can be a series of computer program instruction segments that can complete specific functions, and the instruction segments are used to describe the execution process of the computer program 32 in the electronic device 3. For example, the computer program 32 can be divided into the functions of a splitting module 201, a detection module 202, a risk elimination module 203, a correction module 204 and a reorganization module 205 (modules in the virtual device), and the specific functions of each module are as follows: a splitting module 201 is used to split the target document according to pages and assign an intelligent agent to each split page; a detection module 202 is used for the intelligent agent that receives page allocation to detect the embedded resources of the page to which it is allocated; a risk elimination module 203 is used to remove the risk elements and convert the page with risk elements into a page in a safe format if the intelligent agent that receives page allocation detects that the page to which it is allocated has risk elements; a correction module 204 is used to notify other intelligent agents of the error if the intelligent agent that receives page allocation detects that the page to which it is allocated has errors, and each intelligent agent that has learned the errors generates an error correction scheme for the error page through a shared knowledge base; a conversion module 205 is used to correct the pages with errors using an error correction scheme and convert the corrected pages into pages in a safe format; a reorganization module 206 is used to recombine the pages in a safe format into a complete document output.
[0081] The electronic device 3 may include but is not limited to a processor 30 and a memory 31. Those skilled in the art will appreciate that Figure 3It is only an example of the electronic device 3 and does not constitute a limitation of the electronic device 3. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device may also include input and output devices, network access devices, buses, etc.
[0082] The processor 30 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0083] The memory 31 may be an internal storage unit of the electronic device 3, such as a hard disk or memory of the electronic device 3. The memory 31 may also be an external storage device of the electronic device 3, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 3. Further, the memory 31 may also include both an internal storage unit of the electronic device 3 and an external storage device. The memory 31 is used to store computer programs and other programs and data required by the electronic device. The memory 31 may also be used to temporarily store data that has been output or is to be output.
[0084] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned device can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0085] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0086] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0087] In the embodiments provided in the present application, it should be understood that the disclosed devices / equipment and methods can be implemented in other ways. For example, the device / equipment embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0088] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0089] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0090] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program of the document conversion method based on agent interaction can be stored in a storage medium. When the computer program is executed by the processor, it can implement the steps of each of the above-mentioned method embodiments, that is, split the target document according to pages, and assign an agent to each split page; the agent that accepts the page assignment detects the embedded resources of the page assigned to it; if the agent that accepts the page assignment detects that the page assigned to it has risk elements, it removes the risk elements and converts the page with risk elements into a page in a safe format; if the agent that accepts the page assignment detects that the page assigned to it has errors, it notifies the errors to other agents, and each agent that knows the errors generates an error correction scheme for the error page through a shared knowledge base; the error correction scheme is used to correct the page with errors, and the corrected page is converted into a page in a safe format; the pages in the safe format are recombined into a complete document output. Among them, the computer program includes computer program code, which can be in source code form, object code form, executable file or some intermediate form, etc. Storage media may include: any entity or device capable of carrying computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the storage medium does not include electric carrier signal and telecommunication signal.
[0091] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application is described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some of the technical features therein by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application. The specific implementation methods described above further describe the purpose, technical solutions and beneficial effects of the present application in detail. It should be understood that the above description is only the specific implementation method of the present application, and is not used to limit the protection scope of the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present invention.
Claims
1. A document conversion method based on agent interaction, characterized in that: The method comprises: Split the target document into pages and assign an agent to each split page; The agent that receives page assignment detects the embedded resources of the assigned page; If the agent that receives the page allocation detects that the page allocated to it contains risk elements, the agent removes the risk elements and converts the page containing the risk elements into a page in a safe format; If the agent that receives the page allocation detects that the page allocated to it has an error, the error is notified to other agents, and each agent that knows the error generates an error correction solution for the error page through a shared knowledge base; Correcting the page with errors by using the error correction scheme, and converting the corrected page into a page in a safe format; The securely formatted pages are reassembled into a complete document output.
2. The document conversion method based on agent interaction as claimed in claim 1, characterized in that: The step of splitting the target document into pages and assigning an agent to each of the split pages includes: The target document is split page by page, and the pages split from the target document are assigned to the intelligent agents in a manner that one page is assigned to one intelligent agent.
3. The document conversion method based on agent interaction as claimed in claim 1, characterized in that: The step of splitting the target document into pages and assigning an agent to each of the split pages includes: Splitting the target document page by page, and grouping the pages split from the target document; The grouped pages are assigned to one or more of the agents.
4. The document conversion method based on agent interaction as claimed in claim 3, characterized in that: Grouping the pages split from the target document includes: Preprocessing the entire target document, and analyzing the page complexity of the target document according to the number of elements in the page of the target document and the complexity of the element types; According to the analysis result of the page complexity, the pages split from the target document are dynamically grouped, or the number of pages contained in each group is defined, and the pages split from the target document are statically grouped.
5. The document conversion method based on agent interaction as claimed in claim 1, characterized in that: If the agent that receives the page allocation detects that the page allocated to it has an error, the agent notifies the error to other agents and generates an error correction scheme for the error page through a shared knowledge base, including: The first intelligent agent broadcasts a broadcast message that a page has an error to other intelligent agents to request the other intelligent agents to participate in error correction. The first intelligent agent is an intelligent agent that accepts page allocation and detects that the page allocated to it has an error for the first time. The other agents evaluate the preliminary error correction scheme proposed by the first agent based on the information in the shared knowledge base, and express support or opposition through voting; If the proposed error correction solution is supported by the majority of intelligent agents, then the error correction solution supported by the majority of intelligent agents is accepted as the final error correction solution. Otherwise, the initial intelligent agent or other intelligent agents will re-propose a new proposal.
6. The document conversion method based on agent interaction as claimed in claim 1, characterized in that: If the agent that receives the page allocation detects that the page allocated to it has an error, the agent notifies the error to other agents and generates an error correction scheme for the error page through a shared knowledge base, including: The scheduling node receives a message from a first-starting intelligent agent that a page has an error, wherein the first-starting intelligent agent is an intelligent agent that receives page allocation and detects for the first time that an error exists in the page allocated to it; The scheduling node determines other pages in the target document that are related to the error in the page according to the message that the page has an error; The scheduling node center node sends the message that the page has an error to the agent responsible for processing other pages related to the error existing on the page; According to the information in the shared knowledge base, the first-issue intelligent agent and the intelligent agents of other pages related to the error existing in the page generate an error correction solution for the error page through negotiation.
7. The document conversion method based on agent interaction as claimed in claim 6, characterized in that: The scheduling node determines, according to the message that the page has an error, other pages in the target document that are related to the error in the page, including: The scheduling node queries the dependency table or the global document structure index table maintained by it; According to the dependency relationship in the dependency relationship table or the global document structure index in the global document structure index table, other pages in the target document that are related to the error existing in the page are determined.
8. A document conversion device based on agent interaction, characterized in that: The device comprises: The splitting module is used to split the target document into pages and assign an agent to each split page; A detection module is used for the agent that receives page allocation to detect embedded resources of the page allocated to it; A risk elimination module, for removing the risk element and converting the page with the risk element into a safe format page if the agent receiving the page allocation detects that the page allocated to it has risk elements; A correction module, for notifying other agents of the error if the agent receiving the page allocation detects that the page allocated to it has an error, and for each agent that has learned of the error to generate an error correction solution for the error page through a shared knowledge base; A conversion module, used to correct the error of the page with error by using the error correction scheme, and convert the corrected page into a page in a safe format; A reassembly module is used to reassemble the pages in the secure format into a complete document output.
9. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A 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 implemented.