Cross-platform Office component embedding method and system
By configuring Wine tools and building a communication architecture on a cross-platform client, the high resource utilization and compatibility problems of Windows Office applications in a cross-platform environment are solved, and efficient cross-platform Office application integration and performance optimization are achieved.
Patent Information
- Application Number
- CN202510537847.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-27
- Publication Date
- 2025-08-01
AI Technical Summary
When running Windows Office applications in a cross-platform environment, the existing technology has problems such as excessive resource usage and stuckness, especially on non-Windows systems such as Linux and macOS, where compatibility and performance are insufficient.
By configuring Wine tools on cross-platform clients, combining .NET and Office Interop technologies, a cross-platform communication architecture is built, the configuration parameters of the Wine virtual environment are dynamically adjusted, and multi-protocol intelligent switching is implemented using protocol feature recognition algorithms, cross-platform memory address mappers and pipeline daemons are developed to solve memory leaks and window focus loss problems.
It realizes seamless integration of Office applications under the Linux platform, reducing communication latency, saving bandwidth, reducing memory leaks, improving response speed and system resource utilization efficiency.
Smart Images

Figure CN120407016A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of cross-platform software compatibility, and particularly to a method and system for embedding components in cross-platform Office. Background Art
[0002] When embedding the Office module in various different types of clients, QT clients are usually adopted, and the c# Office embedded components are called to implement. For example, by using the C# and.NET Core technology stacks and leveraging open-source Office document processing libraries (such as Microsoft Office, WPS office), the functions of opening, parsing Office files (including embedded files), file opening, modification, and saving are realized on the Windows platform. However, since the c# language is based on the mainstream development language of Microsoft, it is troublesome to be compatible with various domestic systems and it is also difficult to achieve version iteration.
[0003] Wine is an open-source software based on compatibility layer technology. Its core function is to enable Unix-like operating systems such as Linux and macOS to directly run Windows application programs. Different from virtual machines or hardware emulators, Wine builds a compatibility layer by re-implementing the Windows API, converts Windows system calls into Unix system calls, and simulates the Windows operating environment (such as DLL components). Its name "Wine" is a recursive abbreviation (Wine Is Not an Emulator), emphasizing its non-emulator technical essence, supporting the direct running of unmodified Windows executable files (.exe) without relying on a virtualized environment.
[0004] The core advantages of Wine lie in high performance and wide compatibility. Wine provides a set of libraries that mimic the behavior of Windows, enabling Windows application programs to run on Linux or macOS. It avoids the resource consumption of virtual machines, and the running efficiency is close to that of native applications, supporting various programs from office software to large games. Despite its powerful functions, Wine still has technical limitations. Its compatibility depends on the continuous adaptation of the Windows API, and some driver-level applications or programs that rely on new Windows features may have difficulty running, and complex software often requires additional configuration. Currently, in the Wine tool startup scheme, during the startup and use of Wine, problems such as excessive memory and CPU resource occupation may suddenly occur, resulting in program crashes. Summary of the Invention
[0005] Embodiments of the present disclosure provide a method and system for embedding components in cross-platform Office to solve the problems existing in the related technologies. The technical solutions are as follows:
[0006] In a first aspect, embodiments of the present disclosure provide a method for embedding components in cross-platform Office, including:
[0007] Obtain an Office embedded component, where the Office embedded component is used to embed and operate an Office application;
[0008] Configure the Wine tool in the cross-platform client to run the Office embedded component;
[0009] Build a cross-platform client communication architecture to enable the display and operation of Office applications on the cross-platform client.
[0010] Optionally, the Office embedded component is developed using.NET and Office Interop technologies.
[0011] Optionally, operating the Office application includes:
[0012] Opening, editing, or saving a document, where the document includes Word, Excel, or PPT documents.
[0013] Optionally, configuring the Wine tool includes:
[0014] Install the Wine tool on the Ubuntu system of the cross-platform client and configure it to run.NET programs so that the Office embedded component runs in a Linux environment.
[0015] Optionally, building a cross-platform client communication architecture includes:
[0016] When starting the Wine tool, dynamically adjust the Wine virtual environment configuration parameters to adapt to the system resources in the cross-platform client by monitoring the system resources in the cross-platform client;
[0017] Build a hierarchical communication architecture to achieve multi-protocol intelligent switching through a protocol feature recognition algorithm, where the multi-layer communication architecture is used to implement communication of multiple protocols.
[0018] Optionally, dynamically adjusting the Wine virtual environment configuration parameters to adapt to the system resources in the cross-platform client includes:
[0019] Calculate a resource utilization utility function based on the system resources, dynamically calculate a resource weight factor using the entropy weight method, and obtain the total amount of real-time available resources in the system resources of the cross-platform client according to the resource utilization utility function and the resource weight factor;
[0020] Calculate a dynamic constraint boundary based on the total amount of real-time available resources and build a dynamic programming matrix;
[0021] Based on the dynamic constraint boundary and the dynamic programming matrix, the optimal resource allocation strategy is iteratively calculated by means of value function approximation method.
[0022] Optionally, multi-protocol intelligent switching is implemented through a protocol feature recognition algorithm, including:
[0023] Obtain event data;
[0024] Determine the data volume of the event data;
[0025] If the determination result is small data, it is transmitted through a shared memory channel; if the determination result is streaming data, a Socket long connection is made to achieve streaming data transmission; if the determination result is a control instruction, a named pipe is used to achieve control instruction transmission.
[0026] Optionally, the shared memory channel transmission includes: implementing a cross-platform memory address mapper using a double-buffer mechanism to achieve shared memory channel transmission; and / or,
[0027] The streaming data transmission includes: implementing protocol stack optimization using a dynamic bandwidth adaptation algorithm to achieve streaming data transmission; and / or,
[0028] The named pipe to achieve control instruction transmission includes: optimizing the instruction priority queue using protobuf to achieve control instruction transmission.
[0029] Optionally, a Wine tool is configured in the cross-platform client to run the Office embedded component, including:
[0030] Start and control the Office embedded component in the Wine environment through QProcess;
[0031] Embed the Office interface using the graphical user interface elements of the cross-platform client, wherein the third-party window handle is obtained and embedded into the graphical user interface of the cross-platform client.
[0032] According to another aspect of the embodiments of the present disclosure, a system for a cross-platform Office embedded component is further provided, including:
[0033] The Office embedded component is used to embed and operate the Office application;
[0034] The cross-platform client configures a Wine tool to run the Office embedded component, constructs a cross-platform client communication architecture to achieve the display and operation of the Office application on the cross-platform client.
[0035] The advantages or beneficial effects in the above technical solutions at least include:
[0036] (1) Provides an effective method for running Windows applications on the Linux platform;
[0037] (2) Achieves seamless integration between cross-platform clients and Office applications in the Wine environment, reducing the investment in repetitive development work;
[0038] (3) Reduces cross-platform communication latency through a protocol feature recognition algorithm (measured to reduce the instruction response time by 37%);
[0039] (4) Develops a cross-platform memory address mapper to address the difference in memory space between the Wine environment and the Linux native memory. Innovatively adopts a double-buffering mechanism to avoid read-write conflicts; achieves sub-millisecond response (measured latency of 0.3 ms);
[0040] (5) Implements a dynamic bandwidth adaptive algorithm (adjusts the window size based on RTT measurement), integrates Zstandard real-time compression, and saves 45% of the bandwidth occupancy;
[0041] (6) Develops a pipe daemon to maintain the availability of long connections; Implements an instruction priority queue (emergency instruction interposition mechanism), and uses protobuf for instruction serialization to improve parsing efficiency
[0042] (7) Adopts a reverse release order + forced GC mechanism to solve the problem of COM object leakage in the Wine environment (tests show that the memory leakage rate is reduced by 92%);
[0043] (8) Develops a dynamic window level adjustment algorithm to solve the problem of focus loss of Wine windows in the QT framework.
[0044] The above summary is only for the purpose of the specification and is not intended to be limiting in any way. In addition to the illustrative aspects, embodiments, and features described above, further aspects, embodiments, and features of the present disclosure will be readily apparent by reference to the drawings and the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In the drawings, unless otherwise specified, the same reference numerals throughout the several views refer to the same or similar parts or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings only depict some embodiments in accordance with the present disclosure and should not be regarded as limiting the scope of the present disclosure.
[0046] Figure 1 It is a flowchart of the method for cross-platform Office embedded components in the embodiments of the present disclosure;
[0047] Figure 2 It is a flowchart of the steps for obtaining Office embedded components in the embodiments of the present disclosure;
[0048] Figure 3 Flowchart of steps for installing the Wine tool on the Ubuntu system in the embodiments of the present disclosure;
[0049] Figure 4 Flowchart of steps for implementing multi - protocol intelligent switching through a protocol feature recognition algorithm in another embodiment of the present disclosure;
[0050] Figure 5 Block diagram of system 100 of cross - platform Office embedded components in the embodiments of the present disclosure. Detailed implementation manners
[0051] In the following text, only some exemplary embodiments are simply described. As those skilled in the art can recognize, the described embodiments can be modified in various different ways without departing from the spirit or scope of the present disclosure. Therefore, the drawings and the description are considered to be exemplary in nature rather than restrictive.
[0052] The term "and / or" in this document is merely a description of the association relationship between associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the term "at least one" in this document represents any one of multiple types or any combination of at least two of multiple types. For example, including at least one of A, B, and C can represent including any one or more elements selected from the set composed of A, B, and C.
[0053] The term cross - platform client in this document not only includes the ubutun system, but also includes other independent or third - party general systems. General - purpose embedded operating systems such as VxWorks and μClinux are also applicable to the embodiments of the present application.
[0054] In addition, for better illustration of the present disclosure, numerous specific details are given in the following detailed implementation manners. Those skilled in the art should understand that the present disclosure can also be implemented without some specific details. In some instances, methods, means, elements, and circuits well - known to those skilled in the art are not described in detail to highlight the gist of the present disclosure.
[0055] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some but not all of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of the present invention.
[0056] To solve the problem of troublesome adaptation of various cross - platform clients (non - Windows systems) mentioned in the background technology. For example, for a QT client, it also needs to adapt to the requirements of multiple domestic clients at the same time. Currently, it is intended to call the C# Office embedded component through the QT client. Among them, the Office embedded component includes, but is not limited to, ActiveX controls, WebView2 controls, or WebOffice embedded web components, etc.
[0057] Embodiments of the present disclosure provide a method for cross - platform Office embedded components, which is applied to cross - platform clients to achieve access to Office, as Figure 1 shown, including the following steps:
[0058] S10. Obtain an Office embedded component, where the Office embedded component is used to embed and operate Office applications;
[0059] Among them, the Office embedded component is developed using.NET and Office Interop technologies. For example, a C# program is developed, and COM Interop is used for Office automation. The Office embedded component can open, edit, and save Office documents, and can be controlled through command - line parameters or standard input / output;
[0060] As a preferred implementation, as Figure 2 shown, including the following steps:
[0061] S101. Use a C# program to call the Microsoft Office Interop API to achieve Office embedding. First, Office and Primary Interop Assemblies (PIAs) need to be installed. The detailed steps are as follows:
[0062] Ensure that Microsoft Office software is installed on the computer;
[0063] Install the Primary Interop Assemblies (PIAs) of Microsoft Office. It can be automatically downloaded and installed through the NuGet package manager, or manually downloaded and installed from the official Microsoft website;
[0064] S103. Reference the required PIAs in the C# project. In Visual Studio, through the "Add Reference" function, select the "COM" tab and add the PIA of the corresponding Office component (such as Microsoft Word xx.x Object Library).
[0065] S105. Write C# code to create an instance of the Office application and call its methods and properties. The specific steps include:
[0066] Use the using statement to introduce the required Interop namespace (such as Microsoft.Office.Interop.Word).
[0067] Create an instance of the Office application (such as Application wordApp = new Application();).
[0068] Create a new Office document (such as Document doc = wordApp.Documents.Add();).
[0069] Call the methods and properties of the document object for editing (such as doc.Content.Text = "Hello,World!";).
[0070] Save and close the document (such as doc.SaveAs2("path_to_your_document.docx"); and doc.Close();).
[0071] Exit the Office application (such as wordApp.Quit();).
[0072] S107. Error handling and resource management. Implement an appropriate error handling mechanism in the code to handle errors and exceptions that may occur when interacting with the Office application; ensure proper management of the COM object's life cycle to avoid memory leaks and other issues. When the COM object is no longer needed, use the Marshal.ReleaseComObject method to release its resources.
[0073] S20. Configure the Wine tool on the cross-platform client to run the embedded Office component; for a system like the ubutun system running on the cross-platform client and installing the Wine tool, relevant dependency packages need to be obtained and queried. Since most product solutions for starting the Wine tool have not been actually implemented, during the start-up and use of Wine, problems such as excessive resource consumption of memory, CPU, etc. may occur, resulting in the program freezing.
[0074] Therefore, this embodiment proposes the collaborative innovation of a cross-platform communication architecture. In one embodiment, the Wine tool is configured, including:
[0075] Install the Wine tool on the Ubuntu system of the cross-platform client and configure it to run.NET programs, so that the Office embedded components can run in the Linux environment.
[0076] Taking the installation of the Wine tool on the Ubuntu system as an example, as Figure 3 shown, the installation steps are as follows:
[0077] S201. Update the system to ensure that the Ubuntu system on the client is the latest. Open the terminal and run the following commands to update the package list and upgrade the installed packages:
[0078] bash
[0079] sudo apt update
[0080] sudo apt upgrade
[0081] S203. Add the Wine official repository. By default, the Wine version in the Ubuntu software repository may not be the latest. To obtain the latest stable version, it is necessary to add the Wine official repository. Execute the following commands in the terminal to add the GPG key of the Wine repository:
[0082] bash
[0083] wget - nc https: / / dl.winehq.org / wine - builds / winehq.key
[0084] sudo apt - key add winehq.key
[0085] Next, execute one of the following commands according to the Ubuntu version to add the Wine repository:
[0086] For Ubuntu 20.04:
[0087] bash
[0088] sudo add - apt - repository 'deb https: / / dl.winehq.org / wine - builds / ubuntu / focal main'
[0089] For other Ubuntu versions, you need to replace "focal" with your version name (e.g., "bionic" for Ubuntu 18.04).
[0090] S205. Install Wine; After adding the repository, you can install Wine. Run the following command in the terminal to install the latest stable version of Wine:
[0091] bash
[0092] sudo apt install--install-recommends winehq-stable
[0093] This installation process may take some time because Wine is a relatively large software package and will install many dependencies.
[0094] S207. Verify the installation; After the installation is complete, you can verify whether Wine is correctly installed by running the following command:
[0095] bash
[0096] wine--version
[0097] If you see the version information of Wine, it means the installation was successful.
[0098] S209. Run Windows programs; You can run a Windows program by double-clicking its.exe file or by using the wine command in the terminal, e.g.:
[0099] bash
[0100] wine your_program.exe
[0101] S2011. Configure Wine to run.NET programs and ensure that Wine has the required libraries (such as Mono or the.NET framework).
[0102] Based on the above steps, this C# office embedded component can run under the Wine tool.
[0103] S30. Build a cross-platform client communication architecture to achieve the display and operation of Office applications on cross-platform clients.
[0104] As an optional implementation method, building a cross-platform client communication architecture includes:
[0105] When starting the Wine tool, by monitoring the system resources in the cross-platform client, dynamically adjust the virtual environment configuration parameters of the Wine tool to adapt to the system resources of the cross-platform client;
[0106] For example, when QProcess starts the Wine environment, by monitoring the host system resources (CPU / memory / GPU) in real time, dynamically adjust the virtual environment configuration parameters of Wine:
[0107]
[0108] Build a hierarchical communication architecture, and implement multi-protocol intelligent switching through a protocol feature recognition algorithm, where the multi-layer communication architecture is used to implement the communication of multiple protocols.
[0109] As an optional implementation, dynamically adjusting the virtual environment configuration parameters of the Wine tool to adapt to the system resources of the cross-platform client includes the following steps:
[0110] Step 1: Calculate the resource utilization utility function based on the system resources, dynamically calculate the resource weight factor using the entropy weight method, and obtain the total amount of real-time available resources in the system resources of the cross-platform client according to the resource utilization utility function and the resource weight factor;
[0111] Among them, the resource utilization utility function can be obtained by the following method:
[0112] Adopt a dynamic resource allocation model based on constrained optimization, specifically the following two-layer programming model:
[0113]
[0114] Among them, ∑ i∈R x i ≤C total ;
[0115]
[0116] R = {CPU core count, memory allocation, GPU video memory} resource set;
[0117] x i The amount of type i resources allocated to the Wine environment;
[0118] Is the resource utilization benefit function;
[0119] λ i Is the resource weight factor;
[0120] C total Is the total amount of real-time available resources of the host system;
[0121] The parameter definitions can be as follows:
[0122] Resource utilization benefit function: (α i is the resource sensitivity coefficient, and through experiments, it is measured that α cpu = 0.35, α Mem = 0.02, α GPU = 0.15)
[0123] Resource weight factor: λ i can be dynamically calculated by the entropy weight method (reflecting resource scarcity)
[0124] Total amount of real-time available resources: C total = [Number of available CPU cores, amount of free memory, remaining video memory].
[0125] Step 2: Calculate the dynamic constraint boundary based on the total amount of real-time available resources, and construct a dynamic programming matrix;
[0126] Resource monitoring layer: Real-time collection of the host system through Linux cgroups: number of available CPU cores (n_avail_cores), amount of free memory (mem_avail), and remaining GPU video memory (gpu_mem_free).
[0127] Execute the following calculations every 30 seconds:
[0128] Calculate the dynamic constraint boundary:
[0129] x_max^cpu = min(n_avail_cores × 0.8, 4) / / Maximum occupancy of 80% of available cores, upper limit of 4 cores
[0130] x_min^cpu = 1 / / At least reserve 1 core
[0131] Construct the dynamic programming matrix:
[0132] State transition equation:
[0133] V_t(x) = max[U(x) + γ · E(V_{t+1}(x'))]
[0134] where γ is the discount factor and x' is the resource amount in the next state.
[0135] Use approximate dynamic programming (ADP) to solve:
[0136] Iteratively calculate the optimal resource allocation strategy through the value function approximation method;
[0137] Parameter adjustment layer:
[0138] Map the solution result to Wine environment variables:
[0139] WINEDEBUG = "fixme-all"
[0140] WINE_CPU_TOPOLOGY = "0 - xcpu" WINEMEMORYLIMIT = "{x_mem}MB"
[0141] DXVK_CONFIG = "dxgi.maxDeviceMemory = ${x_gpu}"
[0142] Step 3: Based on the dynamic constraint boundary and the dynamic programming matrix, iteratively calculate the optimal resource allocation strategy through the value function approximation method.
[0143] This embodiment can adapt the virtual environment of the Wine tool to the system resources of the cross - platform client, breaking through the performance bottleneck caused by traditional static configuration.
[0144] The code to dynamically calculate the resource weight factor using the entropy weight method is as follows:
[0145] def entropy_weight(data_matrix):
[0146] #data_matrix: historical resource data matrix
[0147] norm_matrix = data_matrix / data_matrix.sum(axis = 0)
[0148] k = 1 / np.log(data_matrix.shape[0])
[0149] e = -k * (norm_matrix * np.log(norm_matrix)).sum(axis = 0)
[0150] return(1 - e) / (1 - e).sum()
[0151] As an alternative implementation, multi - protocol intelligent switching is achieved through the protocol feature recognition algorithm, as Figure 4 shown, including the following steps:
[0152] S301: Obtain event data;
[0153] S303: Determine the data volume of the event data;
[0154] S305: If the determination result is small data, transmit it through the shared memory channel;
[0155] S307, if the result of the determination is stream data, a long socket connection is performed to implement stream data transmission;
[0156] S309: If the determination result is a control instruction, a named pipe is used to implement transmission of the control instruction.
[0157] For example, this can be achieved through the following code:
[0158] Dynamic judgment algorithm implementation:
[0159]
[0160]
[0161] The aforementioned protocol feature recognition algorithm reduces cross-platform communication latency (measured reduction of 37% in command response time); integrates multi-dimensional data feature analysis (size / type / business semantics); and implements intelligent decision-making combining fuzzy matching with Bayesian probability models. A built-in self-learning mechanism dynamically optimizes thresholds based on historical transmission performance.
[0162] Among them, shared memory channel transmission includes: using a double buffer mechanism to implement a cross-platform memory address mapper to achieve shared memory channel transmission; for example, QT client shared memory management can be implemented through the following code:
[0163]
[0164] This embodiment develops a cross-platform memory address mapper to resolve the difference in memory space between the Wine environment and the Linux native environment; innovatively adopts a double buffering mechanism to avoid read and write conflicts; and can achieve sub-millisecond response (measured delay 0.3ms).
[0165] The streaming data transmission includes: using a dynamic bandwidth adaptive algorithm to optimize the protocol stack to achieve streaming data transmission; for example, the protocol stack optimization design code is as follows:
[0166] sequenceDiagramQt Client->>Wine Server:SYN (with QoS parameters)
[0167] Wine Server-->>Qt Client:SYN-ACK (negotiated compression algorithm)
[0168] Qt Client->>Wine Server: packet data (each frame with CRC check) Wine Server-->>QtClient: real-time ACK feedback
[0169] This embodiment customizes a binary protocol header (including timestamp / sequence number / check bit); adopts an o dynamic bandwidth adaptation algorithm (for example, an algorithm that can adjust the window size based on RTT measurement); integrates Zstandard real-time compression, which can save 45% of bandwidth occupancy.
[0170] Among them, named pipes are used to implement control instruction transmission, including: using protobuf to optimize the instruction priority queue to achieve control instruction transmission. For example, the Wine environment pipe path mapping is as follows: ln - s / tmp / .wine - 1000 / pipes / control_pipe / run / user / 1000 / office_ctrl
[0171] This embodiment develops a pipe daemon to maintain the availability of long connections and implement an instruction priority queue. For example, an emergency instruction insertion mechanism can be implemented; protobuf is used for instruction serialization to improve parsing efficiency.
[0172] In addition, this embodiment also proposes lifecycle management for COM objects. Using a counting intelligent recycling system, a COM object tracker is implemented on the C# side. For example, the implementation is as follows:
[0173]
[0174]
[0175] This embodiment adopts a reverse release order + forced GC mechanism to solve the problem of COM object leakage in the Wine environment (for example, tests show that the memory leakage rate is reduced by 92%).
[0176] As an optional implementation method, configure the Wine tool in the cross-platform client to run the Office embedded component, including:
[0177] Start and control the Office embedded component in the Wine tool environment through QProcess;
[0178] Use the graphical user interface elements of the cross-platform client to embed the Office interface. Among them, the handle of the third-party window is obtained and embedded into the graphical user interface of the cross-platform client. In this embodiment, window handle hijacking dynamic mapping technology can be adopted, and through reverse engineering of the XWindow protocol, seamless integration of the QT window and the Wine window can be achieved. For example, the key code for window embedding on the Linux side is as follows:
[0179] Window wineWin = XGetWindowByPid(proc.pid());
[0180] XReparentWindow(display, wineWin, QTWindowId, x, y);
[0181] XSync(display, False);
[0182] In this embodiment, a dynamic window level adjustment algorithm is developed to solve the problem of focus loss of Wine windows under the Qt framework.
[0183] According to another aspect of the embodiments of the present disclosure, as Figure 5 shown, a cross-platform Office embedded component system 100 is further provided, including:
[0184] An Office embedded component 1 for embedding and operating Office applications;
[0185] A cross-platform client 2 configures the Wine tool to run the Office embedded component, constructs a cross-platform client communication architecture to achieve the display and operation of Office applications on the cross-platform client. Among them, inter-process communication (IPC) methods can be used, such as standard input / output pipes, sockets, shared files, etc. Use QProcess to start and control C# programs in the Wine environment; in the QT client, start C# Office applications in the Wine environment through the QProcess class and communicate through standard input / output pipes; implement socket communication with C# applications through the QTcpSocket class; use multiple communication methods such as standard input / output pipes and sockets to ensure two-way data transmission.
[0186] For the above system, those skilled in the art can understand that it is a configuration implemented based on the above method of cross-platform Office embedded components. That is to say, without conflict, any embodiment of the above method can be applied, and no exhaustive examples will be given herein.
[0187] The advantages or beneficial effects in the above embodiments at least include:
[0188] (1) Provide an effective method for running Windows applications on the Linux platform;
[0189] (2) Achieve seamless integration between the cross-platform client and Office applications in the Wine tool environment, reducing the input of repetitive development work;
[0190] (3) Through the protocol feature recognition algorithm, reduce cross-platform communication latency (the measured instruction response time is reduced by 37%);
[0191] (4) Develop a cross-platform memory address mapper to address the differences between the Wine tool environment and the native memory space of Linux. Innovatively adopt a double-buffering mechanism to avoid read-write conflicts; achieve sub-millisecond response (measured latency of 0.3 ms);
[0192] (5) Implement a dynamic bandwidth adaptive algorithm (adjust the window size based on RTT measurement), integrate Zstandard real-time compression, and save 45% of bandwidth occupancy;
[0193] (6) Develop a pipe daemon to maintain the availability of long connections; o Implement an instruction priority queue (urgent instruction insertion mechanism), and use protobuf for instruction serialization to improve parsing efficiency
[0194] (7) Adopt a reverse release order + forced GC mechanism to solve the problem of COM object leakage in the Wine tool environment (tests show that the memory leakage rate is reduced by 92%);
[0195] (8) Develop an algorithm for dynamically adjusting the window hierarchy to solve the problem of focus loss of the Wine tool window in the QT framework.
[0196] (9) Those skilled in the art can understand that in the above method and system for cross-platform Office embedded components in the specific implementation manner, the writing order of each step does not mean a strict execution order and does not constitute any limitation to the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.
[0197] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to multiple embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of an instruction, and the module, program segment, or part of an instruction contains one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions marked in the block may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and the combinations of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.
[0198] In the description of this specification, the description with reference to terms such as "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present disclosure. Moreover, the specific features, structures, materials, or characteristics described may be combined in a suitable manner in any one or more embodiments or examples. In addition, without contradiction, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.
Claims
1. Method for embedding components in cross-platform Office, characterized in that, including: Obtain an Office embedded component, where the Office embedded component is used to embed and operate an Office application; Configure the Wine tool in the cross-platform client to run the Office embedded component; Build a cross-platform client communication architecture to enable the display and operation of Office applications in the cross-platform client.
2. The method of the cross-platform Office embedded component according to claim 1, characterized in that, The Office embedded component is developed using.NET and Office Interop technologies.
3. The method of the cross-platform Office embedded component according to claim 1 or 2, characterized in that Operating the Office application includes: Opening, editing, or saving a document, where the document includes a Word, Excel, or PPT document.
4. The method for cross-platform Office embedded components according to claim 1 or 2, characterized in that, Configuring the Wine tool includes: Install the Wine tool on the Ubuntu system of the cross-platform client and configure it to run.NET programs, enabling the Office embedded component to run in a Linux environment.
5. The method for cross-platform Office embedded components according to claim 1 or 2, characterized in that, Building a cross-platform client communication architecture includes: When starting the Wine tool, dynamically adjust the Wine virtual environment configuration parameters to adapt to the system resources in the cross-platform client by monitoring the system resources in the cross-platform client; Build a hierarchical communication architecture to achieve multi-protocol intelligent switching through a protocol feature recognition algorithm, where the multi-layer communication architecture is used to implement the communication of multiple protocols.
6. The method of the cross-platform Office embedded component according to claim 5, wherein, Dynamically adjusting the Wine virtual environment configuration parameters to adapt to the system resources in the cross-platform client includes: Calculate a resource utilization utility function based on the system resources, dynamically calculate a resource weight factor using the entropy weight method, and obtain the total amount of real-time available resources in the system resources of the cross-platform client according to the resource utilization utility function and the resource weight factor; Calculate a dynamic constraint boundary based on the total amount of real-time available resources and build a dynamic programming matrix; Based on the dynamic constraint boundary and the dynamic programming matrix, iteratively calculate the optimal resource allocation strategy through a value function approximation method.
7. The method for cross-platform Office embedded components as claimed in claim 5, wherein Achieving multi-protocol intelligent switching through a protocol feature recognition algorithm includes: Obtain event data; Determine the data volume of the event data; If the determination result is small data, transmit it through a shared memory channel; if the determination result is streaming data, establish a Socket long connection to achieve streaming data transmission; if the determination result is a control instruction, use a named pipe to achieve control instruction transmission.
8. The method of the cross-platform Office embedded component according to claim 1 or 2, characterized in that, Shared memory channel transmission includes: implementing a cross-platform memory address mapper using a double-buffer mechanism to achieve shared memory channel transmission; and / or, Streaming data transmission includes: implementing protocol stack optimization using a dynamic bandwidth adaptation algorithm to achieve streaming data transmission; and / or, Using a named pipe to achieve control instruction transmission includes: optimizing the instruction priority queue using protobuf to achieve control instruction transmission.
9. The method of the cross-platform Office embedded component according to claim 1 or 2, characterized in that, Configuring the Wine tool in the cross-platform client to run the Office embedded component includes: Start and control the Office embedded component in the Wine environment through QProcess; Embed the Office interface using the graphical user interface elements of the cross-platform client, where the third-party window handle is obtained and embedded into the graphical user interface of the cross-platform client.
10. The system of cross-platform Office embedded components is characterized in that, including: An Office embedded component for embedding and operating Office applications; A cross-platform client that configures the Wine tool to run the Office embedded component and builds a cross-platform client communication architecture to enable the display and operation of Office applications on the cross-platform client.