CN-121996309-A - Plug-in operation method, electronic equipment, storage medium and chip system
Abstract
The application provides a plug-in operation method, an electronic device, a storage medium and a chip system, wherein in the method, when the electronic device operates a first plug-in a first browser, the electronic device can convert a protocol of a first instruction from the first plug-in to obtain a second instruction, the electronic device can translate a first interface called by the first plug-in into a second interface, the second instruction is transmitted through the second interface, and the electronic device can transcode the second instruction to obtain a third instruction, and operate the third instruction to display a page of the first browser. According to the method, the electronic device can run the first plug-in which is not suitable for the first operating system and the first browser in the first browser, and cross-operating system use of the first plug-in can be achieved.
Inventors
- HE SHUJIE
Assignees
- 华为终端有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20241101
Claims (11)
- 1. A plug-in running method, applied to an electronic device, the electronic device including a first browser and a first operating system, the first browser being adapted to the first operating system, the first browser having a first plug-in deployed therein, the first plug-in being adapted to a second operating system and not adapted to the first operating system, the method comprising: When the first plug-in the first browser is operated, converting a protocol of a first instruction from the first plug-in to obtain a second instruction, wherein the protocol of the second instruction is adapted to the first browser; Translating a first interface called by the first plug-in into a second interface, and transmitting the second instruction through the second interface, wherein the second interface is adapted to the first browser; transcoding the second instruction to obtain a third instruction, wherein the third instruction is adapted to the first operating system; And executing the third instruction and displaying the page of the first browser.
- 2. The method of claim 1, wherein the first browser includes a proxy module that, when running the first plug-in the first browser, translates a protocol of a first instruction from the first plug-in, comprising: the first browser loads the first plug-in; the proxy module converts the protocol of the first instruction to obtain the second instruction; The proxy module sends the second instruction to the first operating system; The translating the first interface called by the first plug-in into a second interface, and transmitting the second instruction through the second interface includes: The first operating system translates the first interface into a second interface and transmits the second instruction through the second interface; Transcoding the second instruction to obtain a third instruction, including: The first operating system transcodes the second instruction to obtain a third instruction; Executing the third instruction, and displaying the page of the first browser, including: and the first operating system executes the third instruction so that the electronic equipment displays the page of the first browser.
- 3. The method of claim 2, wherein the proxy module comprises a first unit, the first unit being connected to the first operating system through a preset channel; The proxy module converts the protocol of the first instruction to obtain the second instruction, and the method comprises the following steps: The first unit converts the protocol of the first instruction to obtain the second instruction; And the first unit sends the second instruction to the first operating system through the preset channel.
- 4. The method of claim 3, wherein the first operating system includes an interface translation module and an instruction transcoding module, a second unit is operated in the interface translation module, the interface translation module operates the second unit, and is used for simulating a process of starting the second operating system, and the first unit and the second unit are connected through the preset channel; the first unit sends the second instruction to the first operating system through the preset channel, and the second instruction comprises: the first unit sends the second instruction to the second unit through the preset channel; the second unit processes the second instruction based on the progress of the second operating system; The first operating system translating the first interface to a second interface and transmitting the second instruction through the second interface, comprising: The interface translation module translates the first interface into a second interface and sends the second instruction to the instruction transcoding module through the second interface; the first operating system transcodes the second instruction to obtain a third instruction, which comprises the following steps: And the instruction transcoding module transcodes the second instruction to obtain a third instruction.
- 5. The method of claim 4, wherein the interface translation module has an interface conversion relationship configured therein, and wherein the interface translation module translates the first interface into a second interface, comprising: and translating the first interface into a second interface according to the interface conversion relation.
- 6. The method of any of claims 1-5, wherein the second operating system is a Windows operating system and the first operating system is a non-Windows operating system.
- 7. The method of claim 6, wherein the first plug-in comprises at least one of an ActiveX plug-in, a Silverlight plug-in, and an office automation plug-in.
- 8. An electronic device, the electronic device comprising: one or more processors and memory; The memory is coupled with the one or more processors, the memory for storing computer program code comprising computer instructions that the one or more processors invoke to cause the electronic device to perform the method of any of claims 1-7.
- 9. A chip system for application to an electronic device, the chip system comprising one or more processors configured to invoke computer instructions to cause the electronic device to perform the method of any of claims 1-7.
- 10. A computer readable storage medium comprising computer instructions which, when run on an electronic device, cause the electronic device to perform the method of any of claims 1-7.
- 11. A computer program product, characterized in that the computer program product comprises computer program code which, when run on an electronic device, causes the electronic device to perform the method according to any of claims 1-7.
Description
Plug-in operation method, electronic equipment, storage medium and chip system Technical Field The embodiment of the application relates to the technical field of plugins, in particular to a plugin operation method, electronic equipment, a storage medium and a chip system. Background In order to extend the functionality of an application, a plug-in may be deployed in the application, and an application running plug-in may implement the extended functionality. By taking an application as a browser for example, a plug-in can be deployed in the browser in advance, and the function of the browser can be enriched by the browser running plug-in, for example, the plug-in enables the browser to play animation, audio, video and the like, so that the audiovisual experience of a user when browsing a page of the browser is further enhanced. Currently, the number and variety of plug-ins are large, and the operating systems to which the plug-ins are adapted are different, how the plug-ins can be used across the operating systems is of great importance for the promotion of application functions. Disclosure of Invention The embodiment of the application provides a plug-in operation method, electronic equipment, a storage medium and a chip system, which can realize the use of plug-ins across operating systems so as to further improve the application function. In a first aspect, an embodiment of the present application provides a method for running a plug-in, where a main body for executing the method may be an electronic device or a chip in the electronic device, and an electronic device is described below as an example. In the method, the electronic device may include a first browser and a first operating system. The first browser is adapted to a first operating system, a first plug-in is deployed in the first browser, and the first plug-in is adapted to a second operating system and is not adapted to the first operating system. Wherein the adaptation of the first browser to the first operating system may be understood as the first browser may run in the first operating system. The first plug-in is adapted to the second operating system and is not adapted to the first operating system, and the first plug-in can be operated in the second operating system but cannot be operated in the first operating system. When the electronic device runs the first plug-in the first browser, the electronic device can convert the protocol of the first instruction from the first plug-in to obtain a second instruction, and the protocol of the second instruction is adapted to the first browser. After obtaining the second instruction, the electronic device may translate the first interface invoked by the first plug-in into a second interface, and transmit the second instruction through the second interface. Wherein the second interface is adapted to the first browser. The electronic device may transcode the second instruction to obtain a third instruction. Wherein the third instruction is adapted to the first operating system. The electronic device may execute the third instruction and display a page of the first browser. Because the protocol of the first instruction from the first plug-in is not adapted to the first browser, the first interface called by the first plug-in is not adapted to the first browser, so that the first browser cannot smoothly transmit the first instruction, and in addition, the format or expression mode of the instruction of the first plug-in is also not adapted to the first operating system, so that the electronic device cannot correctly read the instruction of the first plug-in, and cannot run the first plug-in the first browser. Therefore, in the embodiment of the application, when the first plug-in is executed in the first browser of the first operating system, the electronic device may convert a protocol of the first instruction from the first plug-in into a protocol adapted to an interface of the first browser, translate the first interface called by the first plug-in into an interface adapted to the first browser, and convert the instruction of the first plug-in into an instruction adapted to the first operating system. Therefore, the instruction of the first plug-in can be smoothly transmitted, and the electronic equipment can also correctly read the instruction of the first plug-in, so that the electronic equipment can run the first plug-in the first browser, and the cross-operating system use of the first plug-in is realized. In addition, the method can save cost without the help of the computing power of the cloud platform, and can improve the performance of the electronic equipment without consuming the local computing power of the electronic equipment. The following explains the operation method of the plug-in unit provided by the embodiment of the application from the interaction angle of each module in the electronic equipment: In one possible implementation, the first browser may include a proxy module. W