External formula editing component calling method and device for artificial intelligence proposition, equipment and storage medium
By creating an OLE container on the application platform and utilizing the COM component registry and IDispatch interface, external formula editing components are dynamically loaded and converted to MathML format. This solves the problem of complex cross-platform operation, enables seamless migration and efficient calling of formulas, and improves user experience and data accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-03
- Publication Date
- 2026-03-13
AI Technical Summary
Existing technologies often involve complex cross-platform operation of external formula editing components, resulting in a poor user experience, difficulty in seamlessly migrating formula data, and a high risk of errors.
By creating an OLE container on the application platform, external formula editing components are dynamically loaded, and component identifiers are obtained using the COM component registry. Cross-platform calls are achieved through the IDispatch interface. Combined with a rule engine and recognition algorithm, formulas are converted into a standardized MathML format, supporting seamless cross-platform integration and data synchronization.
It enables seamless calling of external formula editing components across different platforms, simplifies user operations, improves the efficiency and accuracy of formula data migration, avoids formula errors caused by cross-platform switching, and enhances work efficiency.
Smart Images

Figure CN121658110A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of educational informatization technology, and in particular to a method, apparatus, device, and storage medium for calling an external formula editing component for artificial intelligence propositions. Background Technology
[0002] Mathematical formulas serve as core information carriers in various professional fields such as scientific research, education, engineering design, and technological development. Their standardized electronic processing and efficient reuse have become crucial for improving work efficiency and promoting knowledge dissemination. In practical scenarios such as academic paper writing, scientific data calculation, engineering scheme design, and teaching material production, the accuracy, reusability, and cross-platform adaptability of mathematical formulas directly affect the quality of work results and the efficiency of dissemination.
[0003] With the development of digital technology, various formula editing tools and professional work platforms (such as document processing systems, scientific research data management platforms, online education platforms, etc.) have emerged, providing users with diversified electronic formula solutions. Summary of the Invention
[0004] The purpose of this invention is to provide a method, apparatus, device, and storage medium for calling an external formula editing component for artificial intelligence propositions, aiming to solve the problem of complex operation of external formula editing components across platforms in the prior art.
[0005] To address the aforementioned technical problems, the first aspect of this application provides a method for invoking an external formula editing component for artificial intelligence propositions. The method includes: in response to a request from an application platform, creating an OLE container on the application platform and creating a component identifier for the external formula editing component; the external formula editing component includes a desktop formula editor component or a formula component built into third-party office software; in response to a formula editing requirement from the application platform, obtaining the component identifier through a COM component registry; dynamically loading the external formula editing component into the OLE container based on the component identifier; and implementing the application platform's function call to the external formula editing component through the IDispatch interface of the external formula editing component.
[0006] In one embodiment, the external formula editing component is a desktop formula editor. The step of implementing the application platform's function call to the external formula editing component through the IDispatch interface of the external formula editing component includes: activating the editing window of the external formula editing component through the IDispatch interface; and synchronizing the formula edited through the editing window to the application platform through the IDispatch interface.
[0007] In one embodiment, synchronizing the formula edited through the editing window to the application platform via the IDispatch interface includes: capturing the raw data of the formula through the IStream interface of the OLE container; converting the raw data into a standardized formula; and synchronizing the standardized formula to the application platform.
[0008] In one embodiment, the standardized format is MathML format, and the step of converting the raw data into a formula in the standardized format includes: parsing the drawing instructions, text, and location information in the raw data, and converting the drawing instructions, text, and location information into a formula in MathML format through a rule engine and a recognition algorithm.
[0009] In one embodiment, the step of converting the drawing instructions, text, and location information into a MathML format formula using a rule engine and a recognition algorithm includes: identifying mathematical structure features of the formula from the drawing instructions, text, and location information using the recognition algorithm and the rule engine; mapping the identified mathematical structure features to MathML tags using the rule engine; and assembling the mapped MathML tags into MathML format streaming data according to MathML syntax to obtain the MathML format formula.
[0010] In one embodiment, the external formula editing component is a built-in formula component of third-party office software. The step of implementing the application platform's function call to the external formula editing component through the IDispatch interface of the external formula editing component includes: capturing the document corresponding to the formula generated by the third-party office software through the IDispatch interface; parsing the document to generate corresponding resource files, XML metadata files, media files, and embedded object files; and synchronizing the metafiles in the media files and the binary stream files in the embedded object files to the application platform; wherein the metafiles in the media files and the binary stream files in the embedded object files are generated by the built-in formula component of the third-party office software.
[0011] In one embodiment, after dynamically loading the external formula editing component into the OLE container based on the component identifier, the method further includes: loading a preset configuration file through the IDispatch interface of the external formula editing component; the preset configuration file includes toolbar layout configuration and shortcut key configuration; configuring the external formula editing component using the preset configuration file so that the editing page of the external formula editing component in the application platform is consistent with the editing page of the external formula editing component when running independently.
[0012] To address the aforementioned technical problems, a second aspect of this application provides an external formula editing component invocation device for artificial intelligence propositions. The device includes: an initialization module configured to create an OLE container on the application platform and create a component identifier for the external formula editing component in response to a request from the application platform; a component identifier acquisition module configured to acquire the component identifier through a COM component registry in response to a formula editing request from the application platform; a loading module configured to dynamically load the external formula editing component into the OLE container based on the component identifier; and an invocation module configured to implement the application platform's function invocation of the external formula editing component through the IDispatch interface of the external formula editing component.
[0013] To address the aforementioned technical problems, a third aspect of this application provides an external formula editing component invocation device for artificial intelligence propositions, the external formula editing component invocation device comprising a processor and a memory coupled to each other; the memory stores a computer program, and the processor is used to execute the computer program to implement the steps of the method provided in the first aspect above.
[0014] To address the aforementioned technical problems, a fourth aspect of this application provides a computer-readable storage medium storing program data, which, when executed by a processor, implements the steps of the method provided in the first aspect above.
[0015] The embodiments of this invention offer the following advantages: Unlike existing technologies, this application, in response to a request from an application platform, creates an OLE container on the application platform and establishes a component identifier for an external formula editing component. The external formula editing component includes a desktop formula editor component or a formula component built into third-party office software. In response to the application platform's formula editing requirements, the component identifier is obtained through the COM component registry. Based on the component identifier, the external formula editing component is dynamically loaded into the OLE container. The application platform's function call to the external formula editing component is implemented through the IDispatch interface of the external formula editing component. This enables cross-platform calls within the system for the external formula editing component. Users can call the external formula editing component directly from the application platform without switching back and forth between the application platform and the external formula editing component, making the operation convenient and efficient, and avoiding formula errors caused by cross-platform use. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] in:
[0018] Figure 1 This is a flowchart illustrating an embodiment of the method for calling an external formula editing component for artificial intelligence propositions in this application;
[0019] Figure 2 This is a flowchart illustrating an embodiment of step S14 of this application;
[0020] Figure 3 This is a flowchart illustrating an embodiment of step S22 of this application;
[0021] Figure 4 This is a flowchart illustrating an embodiment of step S222 of this application;
[0022] Figure 5 This is a flowchart illustrating an embodiment of step S52 of this application;
[0023] Figure 6 This is a flowchart illustrating another embodiment of step S14 of this application;
[0024] Figure 7 This is a schematic diagram of an embodiment of the external formula editing component calling device for artificial intelligence propositions according to this application.
[0025] Figure 8 This is a schematic block diagram of an embodiment of the external formula editing component calling device for artificial intelligence propositions in this application;
[0026] Figure 9 This is a schematic block diagram of an embodiment of a computer-readable storage medium of this application. Detailed Implementation
[0027] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0028] The terms "first" and "second" in this application are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such processes, methods, products, or apparatus.
[0029] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0030] Existing technical solutions still have many issues that need optimization in practical applications, resulting in user experience and work efficiency falling short of expectations. Firstly, the technical architecture and data storage formats of different formula editing tools differ significantly. Most external formula editors use closed, proprietary data formats, making it difficult to directly migrate historical formula libraries accumulated by users over time to new platforms. Users must manually copy and paste for secondary editing and format adaptation, which not only increases repetitive work but also easily leads to formula parameter deviations and format errors due to human error, severely impacting work efficiency and data accuracy. Secondly, the integration of formula editing functions with the target platform is insufficient. Users often need to repeatedly switch between third-party formula editing software and the core platform to complete the creation, editing, insertion, and modification of formulas. This operational mode fragments the complete workflow and disrupts user continuity. Especially for mathematical formulas containing complex nested structures, special symbols, or a large number of parameters, frequent cross-platform switching and repetitive editing significantly increase modification costs and reduce overall work efficiency.
[0031] The aforementioned problems significantly limit the electronic application of mathematical formulas in terms of cross-platform reuse and workflow integration, making it difficult to meet the demands of modern professional fields for efficient, accurate, and convenient formula processing. Therefore, a technical solution is urgently needed that enables seamless cross-platform migration of formulas and simplifies operational processes to address the shortcomings of existing technologies. This application provides a method for calling an external formula editing component for artificial intelligence propositions, enabling application platforms to call external formula editing components and resolving the problems of operational complexity and error-proneness caused by the inability to call external formula editing components across platforms.
[0032] Please see Figure 1 , Figure 1 This is a schematic flowchart illustrating an embodiment of the method for calling an external formula editing component for artificial intelligence propositions, as described in this application. It should be noted that if substantially the same result is obtained, this embodiment does not necessarily reflect that outcome. Figure 1 The illustrated process sequence is limited. This embodiment of the method for calling an external formula editing component for artificial intelligence propositions includes the following steps:
[0033] S11: In response to a request from the application platform, create an OLE container on the application platform and create a component identifier for the external formula editing component;
[0034] Users can initiate a creation request on the application platform to create an OLE container.
[0035] Specifically, this step initializes the OLE container object through a Windows COM interface (such as CoCreateInstance).
[0036] External formula editing components can include desktop formula editor components or formula components built into third-party office software. Desktop formula editor components include editor components such as MathType, while third-party office software includes software such as Word. The built-in formula component of third-party office software is the formula editing component of Word.
[0037] Additionally, a component identifier for an external formula editing component can be registered, and this component identifier can be recognized by COM components. For example, a component identifier could be a CLSID.
[0038] The application platform can be a question bank system, an education platform, or other application platforms that require formula editing or are used for artificial intelligence question setting.
[0039] S12: In response to the application platform's formula editing requirements, obtain the component identifier through the COM component registry.
[0040] Users can submit formula editing requests through the application platform. Based on the formula editing requests, the application platform matches the component identifier CLSID of the desktop formula editor component or the built-in formula component of third-party office software through the COM component registry.
[0041] S13: Based on the external formula editing component identifier, dynamically load the external formula editing component into the OLE container.
[0042] To ensure security, sandbox isolation technology, such as Windows Sandbox or virtualization-based containers, can be used to restrict the running process of external formula editing components to a sandbox environment. OLE containers interact with components in the sandbox through cross-process communication interfaces. In this way, potentially unsafe component operations can be isolated, ensuring the correct loading of components while protecting the security of the host system.
[0043] Within the established sandbox environment, target objects are dynamically loaded into the OLE container. Two modes are supported: one is to directly call the desktop equation editor component; the other is to launch third-party office software (such as Word) through the OLE automation interface and load its built-in equation component. This ensures that all operations of the component are restricted within the sandbox boundaries, preventing unauthorized access or modification to the host system.
[0044] This step dynamically loads the external formula editing component into the OLE container and obtains the IDispatch interface pointer of the external formula editing component.
[0045] S14: Implement the application platform's function call to the external formula editing component through the IDispatch interface of the external formula editing component.
[0046] The application platform calls external formula editing components through the IDispatch interface. Users can also open desktop formula editor components or built-in formula components in third-party office software on the application platform, realizing seamless integration and calling of external formula editing components with the application platform, and formula data can be migrated across platforms.
[0047] This embodiment utilizes OLE encapsulation technology to enable cross-platform calling of desktop equation editor components or built-in equation components in third-party office software, facilitating cross-platform migration of equation data. For users, they can continue using the operating habits of desktop equation editor components or built-in equation components in third-party office software without having to switch back and forth between application platforms and external equation editing components. This shortens the user operation path by more than 50% and avoids distortion and errors in equation structure and style caused by copying and pasting, making user operation more convenient and efficient.
[0048] In one embodiment, after step S13, the following steps may be included: loading a preset configuration file through the IDispatch interface of the external formula editing component; configuring the external formula editing component using the preset configuration file so that the editing page of the external formula editing component in the application platform is consistent with the editing page of the external formula editing component when running independently.
[0049] The preset configuration file includes toolbar layout and shortcut key configuration. Specifically, after the external formula editing component is initialized, the preset configuration file is automatically loaded and used to configure the external formula editing component on the application platform's call page. This ensures that the editing page of the external formula editing component called by the application platform is consistent with the editing page of the desktop formula editor component or the formula component built into third-party office software, such as having the same toolbar layout and shortcut key configuration. For example, for the external formula editing component MathType, the settings of the desktop version of MathType can be called through a COM component, loading registry entries or configuration files (such as *.dat files) containing the toolbar layout and custom shortcut keys, ensuring that the component page configuration called by the application platform is completely consistent with the page configuration of the standalone desktop version of MathType. Users do not need to adapt to a different operating page than the desktop version of MathType, thus achieving a migration of user operating habits.
[0050] Please see Figure 2 , Figure 2 This is a schematic flowchart illustrating an embodiment of step S14 of this application. It should be noted that if substantially the same result is achieved, this embodiment does not necessarily follow that approach. Figure 2 The illustrated process order is limited. The method for calling the desktop formula editor in this embodiment includes the following steps:
[0051] S21: Activate the editing window of the external formula editing component through the IDispatch interface of the external formula editing component.
[0052] The application platform activates the external formula editing component's editing window by calling the `Invoke` method of `IDispatch` through the `IDispatch` interface. The formula editing window of the external formula editing component then pops up on the application platform's interface, embedded within it. Users can edit formulas in this interface using the same methods as desktop formula editors or third-party office software, such as inputting calculus symbols and matrices, maintaining their previous editing habits without needing to adapt to a new formula editing interface.
[0053] S22: Synchronize the formulas edited through the editing window to the application platform via the IDispatch interface.
[0054] Formulas edited by users in the editing window can be directly synchronized to the application platform without the need for copying, pasting, or formatting adjustments.
[0055] Please see Figure 3 , Figure 3 This is a schematic flowchart illustrating an embodiment of step S22 of this application. It should be noted that if substantially the same result is achieved, this embodiment does not necessarily follow the same approach. Figure 3 The illustrated process sequence is limited. Step S22 of this application includes the following steps:
[0056] S221: Capture the raw data of the formula through the IStream interface of the OLE container.
[0057] IStream is a streaming data manipulation interface defined by OLE, which can be used to read and write continuous binary data.
[0058] The raw data may include structured formula data and graphical formula data. Structured formula data is, for example, MathType binary format data, which is directly output by an external formula editing component that supports structured output; graphical formula data is, for example, an EMF (Enhanced MetaFile) format binary stream, which is output by an external formula editing component that only supports graphical output.
[0059] This step can prioritize capturing structured formula data as the raw data; if the component does not support it, it will capture graphical formula data as the raw data.
[0060] S222: Formulas that transform raw data into a standardized format.
[0061] In one embodiment, the standardized format is, for example, the MathML format.
[0062] Please see Figure 4 , Figure 4 This is a schematic flowchart of an embodiment of step S222 of this application. It should be noted that if substantially the same result is achieved, this embodiment does not necessarily follow the same pattern. Figure 4 The sequence of processes shown is limited. Step S222 of this application includes the following steps S51 to S52:
[0063] S51: Parse the drawing instructions, text, and location information in the raw data.
[0064] This involves parsing the drawing instructions, text, and position information from the raw data. Specifically, this can be done by using a dedicated parsing library (such as Apache Batik's EMF parsing module) or by calling the relevant APIs of .NET's System.Drawing.Imaging to parse the raw data and obtain the drawing instructions, text, and position information.
[0065] The drawing commands include, for example, fraction bars, square roots, integral symbols, parentheses, coordinates of the square root arc, and shape parameters. Text information includes, for example, characters in the formula (including variables, numbers 0-9, addition and subtraction operators, etc.), font (such as MathType fonts), font size, and position coordinates (the origin of the character's drawing point). Position information includes, for example, the relative position of elements (such as superscripts above and to the right of characters, subscripts below and to the right of characters, and the top and bottom parts of fractions), and alignment (such as centering the fraction bar).
[0066] S52: Converts drawing instructions, text, and location information into formulas in MathML format using a rule engine and recognition algorithm.
[0067] The system uses a rule engine and recognition algorithms to convert drawing instructions, text, and location information into formulas in MathML format. See also... Figure 5 Step S52 may specifically include the following steps S521 to S523:
[0068] S521: Identifies the mathematical structure features of formulas from drawing instructions, text, and location information through recognition algorithms and rule engines.
[0069] Mathematical structural features include, but are not limited to: semantic classification of variables, numbers, and operators; combinational associations of characters, such as function names with closely arranged consecutive characters, and the binding relationship between characters and adjacent subscripts and superscripts; positional and morphological structural features, such as fractional structural features and square root structural features.
[0070] In one embodiment, identifying the mathematical structure features of a formula through a rule engine may include: first, extracting the binary stream of the original data, such as OMML or MathType binary format; then, comparing the extracted binary stream with a tag base library (e.g., OMML syntax library or MathType format library); analyzing the encoding rules of the data stream to determine the formula components corresponding to each encoding (e.g., <encoding rule 1> corresponds to a fraction, <encoding rule 21> corresponds to a subscript); and decomposing the logical structure of the formula (e.g., decomposing the numerator, denominator, base character, superscript, subscript, radicand, root exponent, etc.) to identify the mathematical structure features of the formula.
[0071] In one embodiment, identifying the mathematical structure features of a formula through an identification algorithm may include: identifying the mathematical structure features of the formula through visual features, such as matching the visual features of typical mathematical symbols through symbol recognition, such as identifying "square root arc + vertical stroke" as a square root, "horizontal straight line separating upper and lower character blocks" as a fraction, and "small character in the upper right corner of a character" as a superscript; and associating isolated characters and graphic elements according to mathematical rules through semantic association (such as associating "x" with the "2" in the upper right corner as "x"). 2By associating the “y” and “2” above and below the fraction line with “y / 2”, the mathematical structure features of the formula can be identified.
[0072] This step combines the two methods mentioned above, extracts the binary stream of the original data to identify the mathematical structure features of the formula, and then uses visual feature recognition to verify and correct it, ensuring the accuracy of the mathematical structure feature recognition of the formula.
[0073] S522: The identified mathematical structure features are mapped to MathML labels through the rule engine.
[0074] In step S521, the mathematical structure features identified have one-to-one corresponding MathML tags. The identified mathematical structure features are mapped to MathML tags through predefined mapping rules, thus transforming the abstract mathematical structure into a tag code that conforms to the MathML specification.
[0075] S523: Assemble the mapped MathML tags into MathML format stream data according to MathML syntax to obtain the MathML format formula.
[0076] This step nests MathML tags according to the hierarchical structure of the formula to obtain the MathML format formula corresponding to the original data.
[0077] This embodiment uses an algorithm and rule engine to convert drawing instructions, text, and location information into formulas in MathML format. Its advantages are: MathML is a W3C standard, allowing for direct rendering by modern browsers, and it facilitates subsequent data exchange, retrieval, and re-editing. In online application platforms (such as question bank systems), formulas can be embedded in HTML pages in MathML format and visualized as aesthetically pleasing mathematical formulas using front-end mathematical rendering libraries (such as MathJax or KaTeX), thus ensuring consistent display across different devices and platforms.
[0078] S223: Synchronize standardized formulas to the application platform.
[0079] This step synchronizes standardized formulas to the application platform via either an internal function interface or an HTTP RESTful API. For internal function interfaces, the application platform's formula data storage interface is called directly, such as `SetFormulaData(MathMLString)`. For HTTP RESTful APIs, the MathML formatted data is encapsulated as a JSON string and sent via a POST request to the specified interface address on the application platform, and the synchronization result returned by the interface is received.
[0080] APIs (Application Programming Interfaces) or data interfaces are written into the application platform.
[0081] Please see Figure 6 , Figure 6 This is a flowchart illustrating another embodiment of step S14 of this application. It should be noted that if substantially the same result is achieved, this embodiment does not necessarily follow that approach. Figure 6 The illustrated process sequence is limited. This embodiment describes the method for calling the built-in formula component of third-party office software, which includes the following steps:
[0082] S31: Capture the document corresponding to the formula generated by third-party office software via the IDispatch interface.
[0083] Capture documents corresponding to formulas generated by third-party office software, such as .docx and .doc documents generated by Word.
[0084] S32: Parse the document to generate corresponding resource files, XML metadata files, media files, and embedded object files.
[0085] For the obtained .docx documents, their encapsulation features based on the OpenXML standard can be utilized to unpack the documents as ZIP archives, automatically classify and parse them according to resource type, and generate corresponding resource files, XML metadata files, media files, and embedded object files.
[0086] S33: Synchronize the metafiles in the media file and the binary stream files in the embedded object file to the application platform.
[0087] The metafiles in the media files and the binary stream files in the embedded object files are generated by the built-in formula component of third-party office software.
[0088] This includes metafiles in media files, such as WMF (Windows Metafile Format) or EMF format files. It also includes binary stream files embedded in object files, such as .bin format files.
[0089] This step directly transmits the metafiles from the media file and the binary stream files from the embedded object file to the application platform. The application platform parses the received metafiles and binary stream files to generate the SVG image displayed on the application platform page. This achieves a high-fidelity, one-to-one reproduction of the original formula.
[0090] This application, through the above embodiments, enables the functional invocation of external formula editing components on application platforms, supporting cross-version desktop formula editor components and third-party office software. Users can invoke the external formula editing components they are accustomed to using on the application platform and directly edit formulas on the application platform without having to switch back and forth between the external formula editing components and the application platform, or copy and paste. This avoids the complexity of operations and the problems of formula structure recognition errors that may occur when copying and pasting, improves work efficiency and accuracy, avoids rework and correction of formula errors, achieves lossless transfer of formulas, and allows users to continue to focus without being interrupted by additional operations.
[0091] Please see Figure 7 , Figure 7 This is a schematic diagram of an embodiment of the external formula editing component invocation device for artificial intelligence problem-solving, as described in this application. The external formula editing component invocation device 100 for artificial intelligence problem-solving includes: an initialization module 110, a component identifier acquisition module 120, a loading module 130, and an invocation module 140. The initialization module 110 is configured to create an OLE container on the application platform and create a component identifier for the external formula editing component in response to a request from the application platform. The component identifier acquisition module 120 is configured to acquire the component identifier through the COM component registry in response to the formula editing requirements of the application platform. The loading module 130 is configured to dynamically load the external formula editing component into the OLE container based on the component identifier. The invocation module 140 is configured to enable the application platform to invoke functions of the external formula editing component through the IDispatch interface of the external formula editing component.
[0092] The calling module 140 is also configured to: activate the editing window of the external formula editing component through the IDispatch interface of the external formula editing component; and synchronize the formula edited through the editing window to the application platform through the IDispatch interface.
[0093] The calling module 140 is also configured to: capture the binary stream of the formula through the IStream interface of the OLE container to obtain the original data of the formula; convert the original data into a formula in a standardized format; and synchronize the formula in the standardized format to the application platform.
[0094] The calling module 140 is also configured to: parse the drawing instructions, text and position information in the raw data, and convert the drawing instructions, text and position information into formulas in MathML format through a rule engine and recognition algorithm.
[0095] The calling module 140 is further configured to: identify the mathematical structure features of the formula from drawing instructions, text and location information through the recognition algorithm and the rule engine; map the identified mathematical structure features to MathML tags through the rule engine; assemble the mapped MathML tags into MathML format streaming data according to MathML syntax to obtain the formula in MathML format.
[0096] The calling module 140 is also configured to: capture the document corresponding to the formula generated by the third-party office software through the IDispatch interface; parse the document to generate the corresponding resource file, XML metadata file, media file and embedded object file; synchronize the metafile in the media file and the binary stream file in the embedded object file to the application platform; wherein the metafile in the media file and the binary stream file in the embedded object file are generated by the formula component built into the third-party office software.
[0097] The external formula editing component invocation device 100 for artificial intelligence propositions may also include a configuration module, which is used to load a configuration file through the IDispatch interface of the external formula editing component and configure the external formula editing component using the configuration file.
[0098] For the functions executed by each module of the external formula editing component calling device 100 for artificial intelligence propositions, please refer to the method for calling the external formula editing component for artificial intelligence propositions; these will not be repeated here.
[0099] Please see Figure 8 , Figure 8 This is a schematic block diagram of an embodiment of the external formula editing component invocation device for artificial intelligence propositions according to this application. The external formula editing component invocation device 900 for artificial intelligence propositions includes a processor 910 and a memory 920 coupled to each other. The memory 920 stores a computer program, and the processor 910 executes the computer program to implement the external formula editing component invocation method for artificial intelligence propositions described in the above embodiments.
[0100] For a description of each step of the processing execution, please refer to the description of each step in the above embodiment of the method for calling the external formula editing component for artificial intelligence propositions in this application, and it will not be repeated here.
[0101] The memory 920 can be used to store program data and modules. The processor 910 executes various functional applications and data processing by running the program data and modules stored in the memory 920. The memory 920 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as configuration functions, loading functions, formula format conversion functions, etc.), etc.; the data storage area may store data created by calling the device 900 according to the external formula editing component for artificial intelligence propositions. In addition, the memory 920 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 920 may also include a memory controller to provide the processor 910 with access to the memory 920.
[0102] In the various embodiments of this application, the disclosed methods, apparatus, and devices can be implemented in other ways. For example, the embodiments of the external formula editing component calling device for artificial intelligence propositions described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0103] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0104] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0105] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium.
[0106] See Figure 9 , Figure 9 This is a schematic block diagram of a computer-readable storage medium according to an embodiment of the present application. The computer-readable storage medium 700 stores program data 710. When the program data 710 is executed, it implements the steps of the external formula editing component invocation method for artificial intelligence propositions as described above.
[0107] For a description of each step of the processing execution, please refer to the description of each step in the above embodiment of the method for calling the external formula editing component for artificial intelligence propositions in this application, and it will not be repeated here.
[0108] The computer-readable storage medium 700 can be any medium capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0109] The above description discloses only preferred embodiments of the present invention and should not be construed as limiting the scope of the present invention. Therefore, equivalent variations made in accordance with the claims of the present invention are still within the scope of the present invention.
Claims
1. A method for calling an external formula editing component for artificial intelligence propositions, characterized in that, The method includes: In response to a request from an application platform, an OLE container is created on the application platform, and a component identifier for an external formula editing component is created; the external formula editing component includes a desktop formula editor component or a formula component built into third-party office software. In response to the formula editing requirements of the application platform, the component identifier is obtained through the COM component registry; Based on the component identifier, the external formula editing component is dynamically loaded into the OLE container; The application platform invokes the functions of the external formula editing component through the IDispatch interface of the external formula editing component.
2. The method according to claim 1, characterized in that, The external formula editing component is a desktop formula editor. The process of implementing the application platform's function calls to the external formula editing component through the IDispatch interface includes: The editing window of the external formula editing component is activated through the IDispatch interface of the external formula editing component; The formulas edited through the editing window will be synchronized to the application platform via the IDispatch interface.
3. The method according to claim 2, characterized in that, The step of synchronizing the formula edited through the editing window to the application platform via the IDispatch interface includes: The raw data of the formula is captured through the IStream interface of the OLE container; The raw data is converted into a formula in a standardized format; The standardized formula is synchronized to the application platform.
4. The method according to claim 3, characterized in that, The standardized format is MathML format, and the formula for converting the original data into the standardized format includes: Parse the drawing instructions, text, and location information in the raw data; The drawing instructions, text, and location information are converted into formulas in MathML format using a rule engine and recognition algorithm.
5. The method according to claim 4, characterized in that, The process of converting the drawing instructions, text, and location information into MathML format formulas using a rule engine and recognition algorithm includes: The mathematical structure features of formulas are identified from drawing instructions, text, and location information using the recognition algorithm and the rule engine. The rule engine maps the identified mathematical structure features to MathML labels. The mapped MathML tags are assembled into MathML format stream data according to MathML syntax to obtain the MathML format formula.
6. The method according to claim 1, characterized in that, The external formula editing component is a built-in formula component of third-party office software. The process of implementing the application platform's function call to the external formula editing component through the IDispatch interface includes: The document corresponding to the formula generated by the third-party office software is captured through the IDispatch interface; The document is parsed to generate corresponding resource files, XML metadata files, media files, and embedded object files; The metafiles in the media file and the binary stream files in the embedded object file are synchronized to the application platform; wherein the metafiles in the media file and the binary stream files in the embedded object file are generated by the built-in formula component of the third-party office software.
7. The method according to claim 1, characterized in that, After dynamically loading the external formula editing component into the OLE container based on the component identifier, the method further includes: The preset configuration file is loaded through the IDispatch interface of the external formula editing component; the preset configuration file includes toolbar layout configuration and shortcut key configuration. The external formula editing component is configured using the preset configuration file so that the editing page of the external formula editing component in the application platform is consistent with the editing page when the external formula editing component runs independently.
8. A device for calling an external formula editing component for artificial intelligence propositions, characterized in that, include: The initialization module is configured to respond to a request from the application platform, create an OLE container on the application platform, and create a component identifier for the external formula editing component. The component identifier acquisition module is configured to acquire the component identifier through the COM component registry in response to the formula editing requirements of the application platform; The loading module is configured to dynamically load the external formula editing component into the OLE container based on the component identifier; The calling module is configured to implement the application platform's function call to the external formula editing component through the IDispatch interface of the external formula editing component.
9. A device for calling an external formula editing component for artificial intelligence propositions, characterized in that, The device includes a processor and a memory coupled to each other; the memory stores a computer program, and the processor executes the computer program to implement the steps of the method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores program data that, when executed by a processor, implements the steps of the method as described in any one of claims 1-7.