Target plug-in determination method and device, storage medium and electronic equipment

By introducing intermediate layer and cross-platform development tools, the unified interface calls target plug-ins of different operating systems, solving the problem that the unified interface calls target plug-ins in the existing technology is unable to be unified interface calls, and realizing the unified interface calling capability of cross-platform development.

CN119537049APending Publication Date: 2025-02-28QINGDAO HAIER TECH +2
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411486945.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-23
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

In the prior art, it is impossible to use a unified interface to call the target plug-ins of different operating systems, which leads to developers need to call the target plug-ins through the interfaces of different operating systems, and it is impossible to achieve unified interface calls.

Method used

By introducing an intermediate layer into the application software, the first target interface of the intermediate layer is called to forward the function request to the intermediate layer, and the intermediate layer then calls the second target interface of the cross-platform development tool to forward the function request to the cross-platform development tool, and finally determine the corresponding target plug-in from the plug-in manager based on the function name of the function request.

Benefits of technology

It realizes the ability to use a unified interface to call the target plug-in on different operating systems, solves the problem that developers need to write codes on different platforms separately, and improves development efficiency and code maintenance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119537049A_ABST
    Figure CN119537049A_ABST
Patent Text Reader

Abstract

The invention discloses a target plug-in determination method and device, a storage medium and electronic equipment, and relates to the technical field of smart homes. The target plug-in determination method comprises the following steps: under the condition that application software receives a function request sent by a target object, forwarding the function request to an intermediate layer by calling a first target interface of the intermediate layer; a second target interface of a cross-platform development tool is called through the middle layer, the function request is forwarded to the cross-platform development tool, and the cross-platform development tool is injected into webpage components of different systems; and determining a corresponding target plug-in from a plug-in manager according to the function name of the function request. By adopting the technical scheme, the problem that the target plug-ins of different operating systems cannot be called by using a unified interface in the related technology is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of smart home technology, and in particular to a method and device for determining a target plug-in, a storage medium, and an electronic device. Background Art

[0002] In mobile application development, there are significant differences in the native environments and Webview container implementations of different operating systems (such as iOS, Android, and HarmonyOS). These differences are not only reflected in the API calling method, but also involve multiple aspects such as data processing, permission management, and performance optimization. In the face of these differences, when developers implement application software to call target plug-ins of different operating systems, they need to call target plug-ins of different operating systems through the interfaces of different operating systems, and cannot use a unified interface to call target plug-ins of different operating systems.

[0003] In view of the problem in the related art that a unified interface cannot be used to call target plug-ins of different operating systems, no effective solution has been proposed yet. Summary of the invention

[0004] The embodiments of the present application provide a method and device for determining a target plug-in, a storage medium, and an electronic device, so as to at least solve the problem in the related art that a unified interface cannot be used to call target plug-ins of different operating systems.

[0005] According to an embodiment of the present application, a method for determining a target plug-in is provided, comprising: when application software receives a function request issued by a target object, forwarding the function request to the middle layer by calling a first target interface of the middle layer; calling a second target interface of a cross-platform development tool through the middle layer, and forwarding the function request to the cross-platform development tool, wherein the cross-platform development tool is injected into web page components of different systems; and determining a corresponding target plug-in from a plug-in manager according to a function name of the function request.

[0006] In an optional embodiment, the function request is forwarded to the middle layer by calling the first target interface of the middle layer, including: loading a library file of the middle layer, wherein the first target interface is stored in the library file; obtaining the first target interface from the library file, and encapsulating the function request according to a first target format allowed to be parsed by the middle layer; and calling the first target interface to forward the encapsulated function request to the middle layer.

[0007] In an optional embodiment, before calling the second target interface of the cross-platform development tool through the middle layer, the method further includes: determining whether the cross-platform development tool is injected into the web page component of the different system; if it is determined that the cross-platform development tool has been injected into the web page component of the different system, inserting the second target interface into the cross-platform development tool, wherein the second target interface is used to receive the function request forwarded by the middle layer and the plug-in manager to the cross-platform development tool.

[0008] In an optional embodiment, determining the corresponding target plug-in from the plug-in manager according to the function name of the function request includes: parsing the function request through the cross-platform development tool to obtain the function name of the function request; determining a third target interface from the plug-in manager according to the function name, wherein the plug-in manager stores the correspondence between all target plug-ins, third target interfaces and function names; and determining the target plug-in through the third target interface and according to the function name.

[0009] In an optional embodiment, after determining the corresponding target plug-in from the plug-in manager according to the function name of the function request, the method also includes: sending the function request to the target plug-in through the third target interface; parsing the function request through the target plug-in, and obtaining a first execution result of the target plug-in executing the function request; processing the first execution result according to a second target format allowed to be parsed by the application software to obtain a second execution result.

[0010] In an optional embodiment, after determining the corresponding target plug-in from the plug-in manager according to the function name of the function request, the method further includes: forwarding the second execution result to the plug-in manager through the third target interface; when the plug-in manager receives the second execution result, forwarding the second execution result to the cross-platform development tool by calling the second target interface.

[0011] In an optional embodiment, after forwarding the execution result called back to the plug-in manager to the cross-platform development tool, the method further includes: forwarding the second execution result in the cross-platform development tool to the middle layer through the second target interface; and sending the second execution result to the application software through the first target interface when the middle layer receives the second execution result.

[0012] According to another aspect of the present invention, a device for determining a target plug-in is also provided, comprising: a first forwarding module, for forwarding the function request to the middle layer by calling the first target interface of the middle layer when the application software receives a function request issued by the target object; a second forwarding module, for calling the second target interface of a cross-platform development tool through the middle layer to forward the function request to the cross-platform development tool, wherein the cross-platform development tool is injected into web page components of different systems; and a calling module, for determining the corresponding target plug-in from the plug-in manager according to the function name of the function request.

[0013] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned method for determining the target plug-in at runtime.

[0014] According to another aspect of an embodiment of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the method for determining the target plug-in through the computer program.

[0015] According to another aspect of the embodiments of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the method for determining the target plug-in is implemented.

[0016] In an embodiment of the present application, when the application software receives a function request from a target object, the received function request is passed to the middle layer by calling the first target interface of the middle layer. The middle layer calls the second target interface of the cross-platform development tool, and the function request is further forwarded to the cross-platform development tool that has been injected into the web page components of different systems. After the cross-platform development tool successfully receives the function request, the corresponding target plug-in is called from the plug-in manager according to the function name of the function request. The above technical solution solves the problem in the related art that a unified interface cannot be used to call target plug-ins of different operating systems. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0018] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0019] Figure 1 It is a hardware environment diagram of a method for determining a target plug-in according to an embodiment of the present application;

[0020] Figure 2 is a flowchart of a method for determining a target plug-in according to an embodiment of the present application;

[0021] Figure 3 is an interactive schematic diagram of a method for determining a target plug-in according to an embodiment of the present application;

[0022] Figure 4 A timing diagram of target plug-in registration in a target plug-in determination method according to an embodiment of the present application;

[0023] Figure 5 It is a structural block diagram of a device for determining a target plug-in according to an embodiment of the present application. DETAILED DESCRIPTION

[0024] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0026] According to one aspect of an embodiment of the present application, a method for determining a target plug-in is provided. The method for determining a target plug-in is widely used in smart home, smart home, smart home device ecology, smart house ecology and other whole-house intelligent digital control application scenarios. Optionally, in this embodiment, the above-mentioned method for determining a target plug-in can be applied to Figure 1In the hardware environment composed of the smart device 102 and the operating system 104 shown in FIG. Figure 1 As shown, the smart device 102 is connected to the operating system 104 via a network, and can be used to provide services (such as application services, etc.) for the smart device 102 or a client installed on the smart device 102. A database can be set on the smart device 102 or independently of the smart device 102 to provide data storage services for the smart device 102 and the operating system 104. Cloud computing and / or edge computing services can be configured on the smart device 102 or independently of the smart device 102 to provide data computing services for the smart device 102 and the operating system 104.

[0027] The network may include but is not limited to at least one of the following: wired network, wireless network. The wired network may include but is not limited to at least one of the following: wide area network, metropolitan area network, local area network, and the wireless network may include but is not limited to at least one of the following: WIFI (Wireless Fidelity), Bluetooth. The smart device 102 and the operating system 104 may not be limited to PC, mobile phone, tablet computer, smart air conditioner, smart range hood, smart refrigerator, smart oven, smart stove, smart washing machine, smart water heater, smart washing equipment, smart dishwasher, smart projection equipment, smart TV, smart clothes drying rack, smart curtain, smart audio and video, smart socket, smart audio, smart speaker, smart fresh air equipment, smart kitchen and bathroom equipment, smart bathroom equipment, smart sweeping robot, smart window cleaning robot, smart mopping robot, smart air purification equipment, smart steamer, smart microwave oven, smart kitchen treasure, smart purifier, smart water dispenser, system platform, etc.

[0028] In this embodiment, a method for determining a target plug-in is provided, which is applied to the above-mentioned smart device. Figure 2 : is a flowchart of a method for determining a target plug-in according to an embodiment of the present application, and the process includes the following steps:

[0029] Step S202, when the application software receives a function request from the target object, forwarding the function request to the middle layer by calling the first target interface of the middle layer;

[0030] Step S204, calling the second target interface of the cross-platform development tool through the middle layer, forwarding the function request to the cross-platform development tool, wherein the cross-platform development tool is injected into the web page components of different systems;

[0031] Step S206: determining a corresponding target plug-in from the plug-in manager according to the function name of the function request.

[0032] In an embodiment of the present application, when the application software receives a function request issued by the target object, the function request is forwarded to the middle layer by calling the first target interface of the middle layer; the second target interface of the cross-platform development tool is called through the middle layer to forward the function request to the cross-platform development tool, wherein the cross-platform development tool is injected into web page components of different systems; and the corresponding target plug-in is determined from the plug-in manager according to the function name of the function request.

[0033] In an optional embodiment, the function request is forwarded to the middle layer by calling the first target interface of the middle layer, including: loading a library file of the middle layer, wherein the first target interface is stored in the library file; obtaining the first target interface from the library file, and encapsulating the function request according to a first target format allowed to be parsed by the middle layer; and calling the first target interface to forward the encapsulated function request to the middle layer.

[0034] Alternatively, suppose there is an H5 application that wants to implement positioning functions on different platforms. In the absence of an intermediate layer, the H5 application needs to write code that interacts with the native positioning interfaces of iOS, Android, and HarmonyOS respectively, and the code for each platform is different. But with the intermediate layer, the H5 application only needs to load the library file of the intermediate layer and obtain the call method of the intermediate layer, that is, the first target interface, from the library file, call the call method of the intermediate layer, and encapsulate the function request in the first target format allowed by the intermediate layer to be parsed, and forward the getLocation request, that is, the function request, to the intermediate layer by calling the first target interface.

[0035] In an optional embodiment, before calling the second target interface of the cross-platform development tool through the middle layer, the method further includes: determining whether the cross-platform development tool is injected into the web page component of the different system; if it is determined that the cross-platform development tool has been injected into the web page component of the different system, inserting the second target interface into the cross-platform development tool, wherein the second target interface is used to receive the function request forwarded by the middle layer and the plug-in manager to the cross-platform development tool.

[0036] When the H5 application wants to call the native functions of the operating system (such as accessing the camera, obtaining the geographic location, etc.), it does not interact directly with the operating system, but calls a call method provided by the middle layer (i.e., the first target interface). The middle layer will check whether JSBridge (i.e., the cross-platform development tool of this embodiment) has been correctly injected into the WebView of the current system (i.e., the web page component of this embodiment). For example, on iOS devices, the middle layer will confirm whether JSBridge has been added to the WebView environment as an Objective-C or Swift class; on Android devices, it will check whether JSBridge has been added as a Java or Kotlin class; on HarmonyOS devices, it will ensure that JSBridge exists in the form of JS or eTS. Once it is confirmed that JSBridge has been injected into the WebView of the current system, the middle layer will insert a second target interface in JSBridge. The role of this second target interface is to receive and process any function requests from the middle layer and the plug-in manager. For example, if the H5 application wants to call the camera function, it will send a function request such as takePhoto to the middle layer through the call method of the middle layer, and the middle layer will forward this function request to JSBridge through the second target interface.

[0037] In an optional embodiment, determining the corresponding target plug-in from the plug-in manager according to the function name of the function request includes: parsing the function request through the cross-platform development tool to obtain the function name of the function request; determining a third target interface from the plug-in manager according to the function name, wherein the plug-in manager stores the correspondence between all target plug-ins, third target interfaces and function names; and determining the target plug-in through the third target interface and according to the function name.

[0038] Optionally, assume that the H5 application needs to call the target plug-in of the operating system to implement the remote control function of the device. When the target object issues a function request for remote control of the device in the H5 application, the function request will be encapsulated and passed to the middle layer, and then the middle layer will call the second target interface of JSBridge and send the function request to JSBridge. After receiving the function request, JSBridge will start to parse the function request. The key to parsing is to extract the function name in the request, such as remoteControlDevice here. After JSBridge parses the function name, it will query the list of plug-ins stored in the plug-in manager. The plug-in manager stores all target plug-ins and the function names corresponding to all target plug-ins, as well as the corresponding third target interface (i.e., the specific calling method of the target plug-in). For example, for the function name remoteControlDevice, the plug-in manager will store the corresponding target plug-in and the calling interface of the target plug-in (i.e., the third target interface). After determining the target plug-in and the third target interface corresponding to the function name, JSBridge will call the target plug-in through the third target interface.

[0039] In an optional embodiment, after determining the corresponding target plug-in from the plug-in manager according to the function name of the function request, the method also includes: sending the function request to the target plug-in through the third target interface; parsing the function request through the target plug-in, and obtaining a first execution result of the target plug-in executing the function request; processing the first execution result according to a second target format allowed to be parsed by the application software to obtain a second execution result.

[0040] Optionally, when the target object adjusts the temperature on the H5 page and clicks the "Confirm" button, the H5 application will issue a function request with the function name setAirConditionerTemperature through the middle layer. This function request will be encapsulated by the middle layer and forwarded to JSBridge by the middle layer through the second target interface. After receiving the function request, JSBridge will find the corresponding target plug-in from the plug-in manager according to the function name in the function request, such as "smart air conditioning control plug-in", where the target plug-in has been associated with a specific third target interface when registered. JSBridge sends the function request to the target plug-in through this third target interface. After receiving the function request, the target plug-in will parse the parameters in the function request, such as the temperature value adjusted by the target object, and then start to execute specific native logic, such as calling the device control API to change the temperature of the smart air conditioner. After executing the function request, the target plug-in will generate a first execution result, such as success or failure of temperature setting. The target plug-in processes the first execution result according to the second target format that the H5 application can understand.

[0041] In an optional embodiment, after determining the corresponding target plug-in from the plug-in manager according to the function name of the function request, the method further includes: forwarding the second execution result to the plug-in manager through the third target interface; when the plug-in manager receives the second execution result, forwarding the second execution result to the cross-platform development tool by calling the second target interface.

[0042] Optionally, when the smart air conditioning control plug-in, i.e., the target plug-in, completes the temperature setting function, the target plug-in generates a first execution result, such as "setting success" or "setting failure", processes the first execution result according to the second target format that the H5 application allows to parse, obtains a second execution result, and sends the second execution result to the plug-in manager through a third target interface (e.g., returnResult). After receiving the second execution result, the plug-in manager calls the second target interface (e.g., sendToJSBridge) and sends the second execution result to the cross-platform development tool, i.e., JSBridge.

[0043] In an optional embodiment, after forwarding the execution result called back to the plug-in manager to the cross-platform development tool, the method further includes: forwarding the second execution result in the cross-platform development tool to the middle layer through the second target interface; and sending the second execution result to the application software through the first target interface when the middle layer receives the second execution result.

[0044] Optionally, after JSBridge receives the second execution result forwarded by the plug-in manager, JSBridge will send the second execution result back to the middle layer by calling the second target interface (such as invokeCallback). After the middle layer receives the second execution result forwarded by JSBridge, it will check the format and content of the result to ensure that it conforms to the format that the H5 application can understand. Then, the middle layer will call the first target interface (such as returnResultToH5) to send the result to the H5 application.

[0045] In order to better understand the process of the above-mentioned target plug-in determination method, the process of the above-mentioned target plug-in determination implementation method is described below in combination with an optional embodiment, but it is not used to limit the technical solution of the embodiment of the present application.

[0046] Figure 3 is an interactive schematic diagram of a method for determining a target plug-in according to an embodiment of the present application, such as Figure 3 As shown, specifically including the following:

[0047] When the application software receives a function request from the target object, the function request is forwarded to the middle layer by calling the first target interface of the middle layer, and the middle layer forwards the function request to the cross-platform development tool by calling the second target interface of the cross-platform development tool. When the cross-platform development tool receives a function request, the target plug-in is called from the plug-in manager according to the function name of the function request, and the function request is forwarded to the target plug-in. The target plug-in parses the function request and executes the function request to obtain the first execution result obtained by executing the function request. The first execution result is processed according to the second target format allowed to be parsed by the application software to obtain the second execution result, and the second execution result is transmitted to the application software step by step through the plug-in manager, the cross-platform development tool and the middle layer. Among them, the cross-platform development tool is injected into the web page components of different systems. Whenever the operating system needs to add a new native function, it only needs to develop a specific target plug-in and register it in the plug-in management layer, which can be called by all application software using the middle layer.

[0048] Optionally, assume a scenario: when the target object clicks the "View Device Location" button on the H5 page, the device's positioning plug-in is called to obtain the device's geographic location. The specific content of implementing the above function request is as follows: when the target object clicks the "View Device Location" button, the H5 page calls the call method provided by the middle layer to pass the function request, wherein the function request contains the function name actionName and other parameters, and the function name actionName is getDeviceLocation. After the middle layer receives the call from the H5 application, it forwards the function request to the operating system by calling the JSBridge.call method mounted on the webpage component. After JSBridge receives the function request and identifies the function name actionName, it sends the function request to the plug-in manager running on iOS, Android or HarmonyOS through the native message channel. In the operating system, the plug-in manager searches for the registered C-layer plug-in (i.e., the third target interface of the target plug-in) according to the function name actionName, which is the target interface of the positioning plug-in in this embodiment. After the plug-in manager finds the target interface of the positioning plug-in, it calls the corresponding D-layer plug-in (i.e., the target plug-in), which is the positioning plug-in in this embodiment, to execute specific positioning logic. The D-layer plug-in will call the corresponding positioning API according to the characteristics of the operating system. After the D-layer plug-in completes the above function request, it returns the device's geographic location information to JSBridge in a unified format. After JSBridge receives the result, it calls the callback function of the middle layer and returns the geographic location information to the H5 page. After the H5 page receives the geographic location information, it can be displayed on the map, allowing the target object to see the real-time location of the device.

[0049] Figure 4 According to the timing diagram of the target plug-in registration in the target plug-in determination method of the embodiment of the present application, as shown in Figure 4 As shown, specifically including the following:

[0050] When the H5 application is started and initialized, the plug-in manager registers all target plug-ins. When the webview (i.e., web page component) is initialized, JSBridge (i.e., cross-platform development tool) is integrated and mounted to the webview. Specifically, JSBridge has a call method (i.e., the second target interface), which has the same name as the first target interface provided by the middle layer, so that the H5 application can call it through the middle layer. The call method is the key to communication between the H5 application and the target plug-in, and is used to receive the call request of the H5 application. When the H5 application sends a function request through the middle layer, the request will carry a function name action name, which is the core identifier of the function request. After receiving the request, the middle layer will forward the request to the message channel of the webview through the call method of JSBridge. Subsequently, the message channel will search and match the corresponding target plug-in in the plug-in manager according to the function name action name. After the match is successful, the target plug-in will be called, the corresponding function request will be executed, and the execution result will be returned to JSBridge, and finally returned to the H5 application through the middle layer to complete the entire call process.

[0051] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, an operating terminal, or a network device, etc.) to execute the methods of each embodiment of the present application.

[0052] Figure 5 is a structural block diagram of a device for determining a target plug-in according to an embodiment of the present application; Figure 5 As shown, including:

[0053] A first forwarding module 50 is used for forwarding the function request to the intermediate layer by calling the first target interface of the intermediate layer when the application software receives the function request sent by the target object;

[0054] A second forwarding module 52, configured to call a second target interface of a cross-platform development tool through the middle layer, and forward the function request to the cross-platform development tool, wherein the cross-platform development tool is injected into a webpage component of a different system;

[0055] The calling module 54 is used to determine the corresponding target plug-in from the plug-in manager according to the function name of the function request.

[0056] In an embodiment of the present application, when the application software receives a function request from a target object, the function request is forwarded to the middle layer by calling the first target interface of the middle layer; the function request is forwarded to the cross-platform development tool by calling the second target interface of the cross-platform development tool through the middle layer, wherein the cross-platform development tool is injected into a web page component of a different system; and the corresponding target plug-in is determined from the plug-in manager according to the function name of the function request. The above technical solution solves the problem in the related art that a unified interface cannot be used to call target plug-ins of different operating systems.

[0057] In an optional embodiment, the first forwarding module 50 is also used to load the library file of the intermediate layer, wherein the first target interface is stored in the library file; obtain the first target interface from the library file, and encapsulate the function request according to the first target format allowed to be parsed by the intermediate layer; and call the first target interface to forward the encapsulated function request to the intermediate layer.

[0058] In an optional embodiment, the second forwarding module 52 is further used to determine whether the cross-platform development tool is injected into the web page component of the different system; when it is determined that the cross-platform development tool has been injected into the web page component of the different system, the second target interface is inserted into the cross-platform development tool, wherein the second target interface is used to receive the function request forwarded by the middle layer and the plug-in manager to the cross-platform development tool.

[0059] In an optional embodiment, the calling module 54 is further used to parse the function request through the cross-platform development tool to obtain the function name of the function request; determine the third target interface from the plug-in manager according to the function name, wherein the plug-in manager stores the correspondence between all target plug-ins, the third target interface and the function name; and determine the target plug-in through the third target interface and according to the function name.

[0060] In an optional embodiment, the calling module 54 is also used to send the function request to the target plug-in through the third target interface; parse the function request through the target plug-in, and obtain a first execution result of the target plug-in executing the function request; process the first execution result according to a second target format allowed to be parsed by the application software to obtain a second execution result.

[0061] In an optional embodiment, the calling module 54 is also used to forward the second execution result to the plug-in manager through the third target interface; when the plug-in manager receives the second execution result, the second execution result is forwarded to the cross-platform development tool by calling the second target interface.

[0062] In an optional embodiment, the calling module 54 is also used to forward the second execution result in the cross-platform development tool to the middle layer through the second target interface; when the middle layer receives the second execution result, the second execution result is sent to the application software through the first target interface.

[0063] An embodiment of the present application further provides a storage medium, which includes a stored program, wherein the program executes any of the above methods when it is run.

[0064] Optionally, in this embodiment, the storage medium may be configured to store program codes for executing the following steps:

[0065] S1, when the application software receives a function request from a target object, forwarding the function request to the intermediate layer by calling a first target interface of the intermediate layer;

[0066] S2, calling the second target interface of the cross-platform development tool through the middle layer, forwarding the function request to the cross-platform development tool, wherein the cross-platform development tool is injected into the web page components of different systems;

[0067] S3: Determine a corresponding target plug-in from the plug-in manager according to the function name of the function request.

[0068] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0069] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0070] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0071] S1, when the application software receives a function request from a target object, forwarding the function request to the intermediate layer by calling a first target interface of the intermediate layer;

[0072] S2, calling the second target interface of the cross-platform development tool through the middle layer, forwarding the function request to the cross-platform development tool, wherein the cross-platform development tool is injected into the web page components of different systems;

[0073] S3: Determine a corresponding target plug-in from the plug-in manager according to the function name of the function request.

[0074] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.

[0075] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any one of the above method embodiments are implemented.

[0076] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.

[0077] The embodiments of the present application also provide a computer program, which includes computer instructions, which are stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the steps in any one of the above method embodiments.

[0078] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.

[0079] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.

[0080] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for determining a target plug-in, characterized in that: include: When the application software receives a function request from the target object, forwarding the function request to the intermediate layer by calling the first target interface of the intermediate layer; Calling a second target interface of a cross-platform development tool through the middle layer to forward the function request to the cross-platform development tool, wherein the cross-platform development tool is injected into web page components of different systems; The corresponding target plug-in is determined from the plug-in manager according to the function name of the function request.

2. The method for determining a target plug-in according to claim 1, characterized in that: Forwarding the function request to the intermediate layer by calling a first target interface of the intermediate layer includes: Loading the library file of the intermediate layer, wherein the first target interface is stored in the library file; Acquire the first target interface from the library file, and encapsulate the function request in a first target format that is parsable by the intermediate layer; The first target interface is called to forward the encapsulated function request to the intermediate layer.

3. The method for determining a target plug-in according to claim 1, characterized in that: Before calling the second target interface of the cross-platform development tool through the intermediate layer, the method further includes: Determining whether the cross-platform development tool is injected into the web page components of the different systems; When it is determined that the cross-platform development tool has been injected into the web page component of the different system, the second target interface is inserted into the cross-platform development tool, wherein the second target interface is used to receive the function request forwarded by the middle layer and the plug-in manager to the cross-platform development tool.

4. The method for determining a target plug-in according to claim 1, characterized in that: Determining a corresponding target plug-in from the plug-in manager according to the function name of the function request includes: Parsing the function request by the cross-platform development tool to obtain a function name of the function request; Determining a third target interface from the plug-in manager according to the function name, wherein the plug-in manager stores a correspondence between all target plug-ins, third target interfaces and function names; The target plug-in is determined through the third target interface and according to the function name.

5. The method for determining a target plug-in according to claim 4, characterized in that: After determining the corresponding target plug-in from the plug-in manager according to the function name of the function request, the method further includes: sending the function request to the target plug-in via the third target interface; Parsing the function request through the target plug-in, and obtaining a first execution result of the target plug-in executing the function request; The first execution result is processed according to a second target format that is parsable by the application software to obtain a second execution result.

6. The method for determining a target plug-in according to claim 5, characterized in that: After determining the corresponding target plug-in from the plug-in manager according to the function name of the function request, the method further includes: forwarding the second execution result to the plug-in manager through the third target interface; When the plug-in manager receives the second execution result, the second execution result is forwarded to the cross-platform development tool by calling the second target interface.

7. The method for determining a target plug-in according to claim 6, characterized in that: After forwarding the execution result called back into the plug-in manager to the cross-platform development tool, the method further comprises: forwarding the second execution result in the cross-platform development tool to the middle layer through the second target interface; When the intermediate layer receives the second execution result, the second execution result is sent to the application software through the first target interface.

8. A device for determining a target plug-in, characterized in that: include: A first forwarding module, configured to forward the function request to the intermediate layer by calling a first target interface of the intermediate layer when the application software receives a function request sent by the target object; A second forwarding module, configured to call a second target interface of a cross-platform development tool through the middle layer, and forward the function request to the cross-platform development tool, wherein the cross-platform development tool is injected into web page components of different systems; The calling module is used to determine the corresponding target plug-in from the plug-in manager according to the function name of the function request.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method described in any one of claims 1 to 7 when executed.

10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 7 through the computer program.

Citation Information

Cited By

  • Plug-in calling method, device and equipment

    CN121455561A