Method for invoking ppapi browser plug-in across cpu architecture
By using the cross-CPU architecture PPAPI browser plugin invocation method, and leveraging the business server proxy service program and WebAssembly module, the PPAPI plugin can run on non-x86 architectures. This solves the problem that domestic CPU computers cannot use Windows platform browser applications, and reduces the difficulty of ecosystem adaptation and software compatibility.
Patent Information
- Application Number
- CN202411484338.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-23
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2044-10-23
AI Technical Summary
Existing technology cannot run PPAPI browser plugins on non-x86 architecture computers, which means that domestically produced CPU computers cannot directly use browser applications under the Windows platform.
By starting the business server proxy service program, the WebAssembly module is used to draw canvas element objects within the HTML5 page, and the PPAPI container is started through the x86 interpreter to realize plugin calls across CPU architectures. Socket communication and Chromium interface are used for plugin rendering and event response.
This enables non-x86 architecture computers, especially those with domestically produced CPUs, to directly run browser applications on the Windows platform, reducing the difficulty of ecosystem adaptation and software compatibility.
Smart Images

Figure CN119576431B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer program technology, and specifically relates to a solution for calling PPAPI browser plugins across CPU architectures. Background Technology
[0002] NPAPI plugins are small computer programs that extend standard browser functionality. They use the Netscape standard interface as their coding standard to interact and communicate with browsers such as Chrome and Firefox, primarily for Flash multimedia playback, online banking authentication, and encrypted communication. In 2010, Google proposed a new generation of NPAPI standards based on sandboxing technology: the Pepper Plugin API, or PPAPI for short. The interface standard remained largely unchanged, but development was changed to use LLVM, significantly improving plugin security. Since both NPAPI and PPAPI use C as their primary development language, they are closely related to CPU architecture and operating system type.
[0003] As my country's requirements for computer autonomy and security gradually increase, computers based on controllable or self-developed architectures such as ARM, RISC-V, and LoongArch are developing rapidly. These computers are often non-x86 architecture computers, and therefore cannot run most PPAPI browser plugins.
[0004] This invention proposes a method for calling PPAPI browser plugins, which solves the problem of running information systems that rely on this type of plugin on non-x86 architecture computers. Summary of the Invention
[0005] The purpose of this invention is to provide a solution for calling PPAPI browser plugins across CPU architectures, overcoming the shortcomings of the prior art, realizing the calling of PPAPI browser plugins across CPU architectures, and enabling PPAPI plugins that rely on x86 architecture functions to run on non-x86 architecture computers.
[0006] To solve the above problems, the technical solution adopted by the present invention is as follows:
[0007] A solution for calling PPAPI browser plugins across CPU architectures includes the following steps:
[0008] Step 1: Start the business server agent service program;
[0009] Step 2: Use the WebAssembly module to draw canvas element objects within the HTML5-developed page;
[0010] Step 3: The canvas element object starts and runs the PPAPI container through the X86 interpreter via the business server agent service program;
[0011] Step 4: The PPAPI container calls and renders the PPAPI browser plugin;
[0012] Step 5: The PPAPI container returns startup information and communication port information to the canvas element object via the business server agent program;
[0013] Step 6: Establish direct communication between the canvas element object and the PPAPI container to complete the event invocation and response feedback of the plugin.
[0014] Furthermore, the business server proxy service program mentioned in step 1 includes a server and a client. The server runs on the local computer, and the client runs in an x86 interpreter. The server and the client communicate directly using Socket.
[0015] Furthermore, the WebAssembly module mentioned in step 2 interacts with the browser through the Javascript module. The WebAssembly module is used for decoding, displaying, and rendering video images, as well as capturing and encapsulating user interaction events. The Javascript module is used for responding to and processing browser events, responding to and processing plugin interfaces, and processing AJAX communication instances.
[0016] Furthermore, in step 3, the canvas element object sends a service start command to the service server agent program via AJAX communication, and the command is transmitted via XML, SOAP or JSON.
[0017] Furthermore, step 3 includes the following specific steps:
[0018] Step 31: The canvas element object sends a service start command to the service server proxy server via AJAX communication;
[0019] Step 32: After receiving the instruction, the business server agent program will start the PPAPI container in the x86 interpreter, set the PPAPI container to the specified size, and announce the container event response port.
[0020] Furthermore, the PPAPI container described in step 4 calls and runs the PPAPI browser plugin through the Chromium interface;
[0021] Chromium's surface renderer is captured in real time by PPAPI and converted into a video stream using mjpeg streaming.
[0022] Furthermore, in step 5, the PPAPI container requests one random port number for both TCP and UDP protocols, which are used to open the RESTful event port and the rendering interface echo, respectively. After the port request is completed, the port information is sent back to the servo proxy server client using the TCP protocol.
[0023] Furthermore, step 6 includes the following specific steps:
[0024] Step 61: The canvas element object initiates a heartbeat polling process with the business server agent until it receives the PPAPI communication port announcement;
[0025] Step 62: Upon receiving the notification, the canvas element sends the command "PPB_Complete" to the given port of the PPAPI container via the Restful protocol to complete the startup process, and creates a MediaSource multimedia video object to render the plugin rendering image returned from the UDP port.
[0026] Compared with the prior art, the present invention has the following beneficial effects:
[0027] This invention provides a solution for cross-CPU architecture PPAPI browser plugin calls, enabling non-x86 architecture computers to use PPAPI functions under the x86 instruction set. This allows non-x86 architecture computers, especially those with domestically produced CPUs, to directly run most browser applications currently available on the Windows platform. This significantly reduces the difficulty of ecosystem adaptation and improves software ecosystem compatibility. Attached Figure Description
[0028] Figure 1 This is a flowchart illustrating a solution for calling PPAPI browser plugins across CPU architectures. Detailed Implementation
[0029] 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.
[0030] like Figure 1 As shown, the present invention provides a solution for calling PPAPI browser plugins across CPU architectures, comprising the following steps:
[0031] Step 1: Start the business server agent service program
[0032] In this step, the business server proxy program runs synchronously, consisting of a client and a server. The server runs on the local computer, while the client runs in an x86 interpreter. They communicate directly using sockets.
[0033] In a specific instance, the two communicate using UDP via port 65550.
[0034] The business server agent exposes ports to the local computer for system scheduling. In a specific example, TCP port 44440 is used.
[0035] The business server agent client uses the exposed ports inside the x86 container to send back responses. In a specific example, TCP port 44440 is used.
[0036] In this specific example, the business server agent client runs in a Linux-ARM64 to Windows-x86 interpreted translation environment, but is not limited to this translation method. Similar scenarios such as Linux-ARM64 to Linux-x86 and Linux-LoongArch64 to Linux-Arm also fall under this implementation method, and the translation environment can also include a virtual machine environment.
[0037] Step 2: Use WebAssembly to draw canvas element objects within an HTML5-developed page.
[0038] In this step, WebAssembly is implemented in C, while the interaction with the browser is handled by JavaScript. JavaScript is primarily used for browser event handling, plugin interface handling, and AJAX communication instance processing. WebAssembly is mainly used for video image decoding, display, rendering, and capturing and encapsulating user interaction events. If the plugin's size is specified using the `<object>` tag in the instance, WebAssembly will reserve its container control; otherwise, it will draw the image based on the real-time display size of the parent container, and perform relative coordinate pair transformations.
[0039] Step 3: The canvas element object starts and runs the PPAPI container using the x86 interpreter via the server agent.
[0040] In this step, the canvas element sends a service startup command to the service server proxy server via AJAX communication. The command is transmitted using XML, SOAP, JSON, etc. In this specific example, the canvas element sends a JSON object to port 44440, which contains the fields: clientWidth, clientHeight, and loginHerf.
[0041] After receiving the JSON object instruction, the server proxy server will start the PPAPI container in the x86 translator, set the PPAPI container to the specified size, and then announce the container event response port as 44440.
[0042] Step 4: The PPAPI container calls and renders the PPAPI browser plugin.
[0043] In this step, the PPAPI container uses Chromium's interface to call and run the PPAPI browser plugin.
[0044] The surface renderer of Chromium is captured in real time by PPAPI and converted into a video stream using mjpeg streaming.
[0045] Step 5: The PPAPI container returns startup information and communication port information to the canvas element object via the servo agent.
[0046] In this step, the PPAPI container requests one random port number each for TCP and UDP protocols, to be used for opening RESTful event ports and rendering interface echoes, respectively. After port requests are completed, the port information is sent back to the server proxy server client using the TCP protocol. In this specific example, ports 3000 (TCP) and 4000 (UDP) are used.
[0047] Step F: The canvas element object and the PPAPI container establish direct communication to complete the event invocation and response feedback of the plugin.
[0048] In this step, the canvas element object initiates a heartbeat polling with the servo agent server until it receives the PPAPI communication port announcement.
[0049] Upon receiving the notification, the canvas element sends the command "PPB_Complete" to the given port of the PPAPI container via the Restful protocol to complete the startup process, and creates a MediaSource multimedia video object to render the plugin rendering image returned from the UDP port.
[0050] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered in all respects as exemplary and non-limiting, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.
Claims
1. A solution for calling PPAPI browser plugins across CPU architectures, characterized in that: Includes the following steps: Step 1: Start the business server agent service program; Step 2: Use the WebAssembly module to draw canvas element objects within the HTML5-developed page; Step 3: The canvas element object starts and runs the PPAPI container through the X86 interpreter via the business server agent service program; Step 4: The PPAPI container calls and renders the PPAPI browser plugin; Step 5: The PPAPI container returns startup information and communication port information to the canvas element object via the business server agent program; Step 6: Establish direct communication between the canvas element object and the PPAPI container to complete the event invocation and response feedback of the plugin; The business server proxy service program mentioned in step 1 includes a server and a client. The server runs on the local computer, and the client runs in an x86 interpreter. The server and the client communicate directly using Socket. Step 6 includes the following specific steps: Step 61: The canvas element object initiates a heartbeat polling process with the business server agent until it receives the PPAPI communication port announcement; Step 62: Upon receiving the notification, the canvas element sends the command "PPB_Complete" to the given port of the PPAPI container via the Restful protocol to complete the startup process, and creates a MediaSource multimedia video object to render the plugin rendering image returned from the UDP port.
2. The solution for cross-CPU architecture calling PPAPI browser plugins according to claim 1, characterized in that: In step 2, the WebAssembly module interacts with the browser through the Javascript module. The WebAssembly module is used for decoding, displaying, and rendering video images, as well as capturing and encapsulating user interaction events. The Javascript module is used for responding to and processing browser events, responding to and processing plugin interfaces, and processing AJAX communication instances.
3. The solution for cross-CPU architecture calling PPAPI browser plugins according to claim 1, characterized in that: In step 3, the canvas element object sends a service start command to the service server agent program via AJAX communication. The command is transmitted via XML, SOAP, or JSON.
4. The solution for cross-CPU architecture calling of PPAPI browser plugins according to claim 3, characterized in that: Step 3 includes the following specific steps: Step 31: The canvas element object sends a service start command to the service server agent program via AJAX communication; Step 32: After receiving the instruction, the business server agent program will start the PPAPI container in the x86 interpreter, set the PPAPI container to the specified size, and announce the container event response port.
5. The solution for cross-CPU architecture calling PPAPI browser plugins according to claim 1, characterized in that: The PPAPI container described in step 4 calls and runs the PPAPI browser plugin through the Chromium interface; Chromium's surface renderer is captured in real time by PPAPI and converted into a video stream using mjpeg streaming.
6. The solution for cross-CPU architecture calling PPAPI browser plugins according to claim 1, characterized in that: In step 5, the PPAPI container requests one random port number for TCP and one random port number for UDP protocols, which are used to open the RESTful event port and the rendering interface echo, respectively. After the port request is completed, the port information is sent back to the client of the servo agent program using the TCP protocol.
Citation Information
Patent Citations
User-defined chart plug-in online design method and device
CN112882703A
Method and device for loading and using local plug-in in browser and computing equipment
CN114721745A