WO2021052054A1 - 插件实现的方法和插件实现的系统 - Google Patents

插件实现的方法和插件实现的系统 Download PDF

Info

Publication number
WO2021052054A1
WO2021052054A1 PCT/CN2020/107681 CN2020107681W WO2021052054A1 WO 2021052054 A1 WO2021052054 A1 WO 2021052054A1 CN 2020107681 W CN2020107681 W CN 2020107681W WO 2021052054 A1 WO2021052054 A1 WO 2021052054A1
Authority
WO
WIPO (PCT)
Prior art keywords
plug
interface
module
software module
instruction
Prior art date
Application number
PCT/CN2020/107681
Other languages
English (en)
French (fr)
Inventor
蔺振超
丁超
涂林林
王劲飞
陈晓轩
宁维赛
陈中领
刘磊
姜钦华
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to EP20864942.6A priority Critical patent/EP4024207A4/en
Publication of WO2021052054A1 publication Critical patent/WO2021052054A1/zh
Priority to US17/697,498 priority patent/US11880695B2/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44536Selecting among different versions

Definitions

  • This application relates to the field of electronic devices, and more specifically, to a method and a system for implementing plug-ins in electronic devices.
  • One type of operating system is an open source operating system, such as Android operating system and linux operating system; the other type of operating system is a closed source operating system, such as Apple’s operation.
  • System microphone operation system, IOS
  • IOS Internet of mobile devices
  • For the open source operating system various terminal manufacturers will do in-depth development based on the open source operating system, add plug-ins, and customize terminal software including various plug-ins to expand the business functions of the terminal.
  • the open source operating system is recorded as open source software.
  • the plug-in is developed based on the code compilation of the open source software, and, in order to be able to call the plug-in of the terminal software in the open source software, at the same time, the code of the open source software needs to be changed accordingly, which makes the open source software and the terminal The software depends on each other, and the decoupling between open source software and terminal software cannot be achieved.
  • the system includes a plug-in module and a terminal software module extended by a terminal manufacturer for open source software.
  • the plug-in module can The call to the first plug-in interface is completed by loading the default implementation of the first plug-in interface.
  • the plug-in module is used to implement the default implementation of the plug-in interface, so that the open source software module can operate normally, so as to ensure the electronic
  • the normal operation of the equipment makes the open source software module no longer dependent on the terminal software module, and realizes the decoupling of the terminal software module and the open source software module.
  • a plug-in implementation system includes a plug-in module and a terminal software module, the plug-in module includes a default implementation of a first plug-in interface, and the terminal software module does not include the first plug-in interface Business realization of, wherein the plug-in module is used for:
  • the default implementation of the first plug-in interface is loaded.
  • the plug-in module by adding a plug-in module to the system, in the case that there is no service realization of the first plug-in interface in the terminal software module, the plug-in module can be implemented by loading the default implementation of the first plug-in interface To complete the call to the first plug-in interface.
  • the plug-in module is used to implement the default implementation of the plug-in interface, so that the open source software module can operate normally, so as to ensure the electronic
  • the normal operation of the equipment makes the open source software module no longer dependent on the terminal software module, and realizes the decoupling of the terminal software module and the open source software module.
  • the plug-in module is specifically used for:
  • the plug-in module in the case that the terminal software module does not have the service realization of the first plug-in interface, the plug-in module can determine that there is no first plug-in interface in the terminal software module through the feedback instruction fed back by the system.
  • Business realization flexibly choose to load the default implementation of the first plug-in interface, so that the open source software module can operate normally, to ensure the normal operation of electronic equipment as much as possible, so that the open source software module no longer depends on the terminal software module, and the terminal software is realized Decoupling of modules and open source software modules.
  • the terminal software module includes a plug-in service factory, the plug-in module includes a plug-in default factory, the plug-in default factory includes the first plug-in interface, and the plug-in business factory inherits the first plug-in interface, The terminal software module inherits the default implementation of the first plug-in interface; and,
  • the plug-in module is specifically configured to: send a second instruction for invoking the first plug-in interface to the terminal software module according to the first instruction;
  • the terminal software module is configured to load the default implementation of the first plug-in interface according to the second instruction.
  • the plug-in implementation system provided by this application adopts the factory mode.
  • the terminal software module can inherit the default of the first plug-in interface in the plug-in module.
  • the system queries whether there is a business implementation of the first plug-in interface, it can only query and need to query whether there is a plug-in business factory once.
  • the plug-in module calls the plug-in interface multiple times, the time caused by the query can be reduced. Delay, greatly improving system performance.
  • system further includes an open source software module; and, the plug-in module is specifically used for:
  • a fourth instruction is sent to the open source software module, where the fourth instruction is used to load the first service implementation in the open source software module of the current version.
  • an adaptation module is added to the system.
  • the adaptation module can be sent to the open source software module based on the current version of the open source software module Instructions to instruct to load the business realization in the open source software module of the current version. It can be seen that the adaptation module acts as a bridge between the open source software module and the terminal software module, shielding the change of the open source software module.
  • the open source software module changes, the terminal software module does not change, so that the terminal software module does not change. Rely on open source software modules.
  • the system further includes an open source software module; and, the version number of the terminal software module is the first version, the version number of the open source software module is the second version, and the first version is the same as the first version.
  • the second version is different.
  • system further includes an open source software module, and the open source software module is used for:
  • the terminal software module is modified, and the version number of the modified terminal software module is the third version, and the third version is different from the first version.
  • the terminal software module includes the service realization of the second plug-in interface; and, the plug-in module is also used to:
  • the second plug-in interface is called to load the service implementation of the second plug-in interface.
  • system further includes an open source software module
  • the open source software module is used to: uninstall the terminal software module;
  • the plug-in module is used to:
  • the terminal software module is not installed in the system
  • the plug-in loading module judges whether the terminal software module is installed in the system according to the instruction sent by the open source software module for loading the service realization of the plug-in interface, which can effectively avoid the terminal software module.
  • the normal operation of electronic equipment makes open source software modules no longer dependent on terminal software modules.
  • the plug-in module includes a plug-in loading module and a plug-in default implementation module, and the plug-in default implementation module includes a default implementation of the first plug-in interface; and,
  • the plug-in loading module is used for:
  • the default implementation of the first plug-in interface in the plug-in default module is loaded.
  • the first plug-in interface is any one of the following: a dual-card management interface, a full Netcom interface, a hot plug interface, a Tiantong interface, and a 5G call interface.
  • a plug-in implementation system includes an open source software module, an adaptation module, and a terminal software module, where:
  • the terminal software module is used to send a third instruction to the adaptation module, and the third instruction is used to load the first service implementation;
  • the adaptation module is configured to send a fourth instruction to the open source software module according to the current version of the open source software module, where the fourth instruction is used to load the first service implementation in the open source software module of the current version.
  • a plug-in implementation method is provided, which is applied to a system including a plug-in module and a terminal software module.
  • the plug-in module includes a default implementation of a first plug-in interface, and the terminal software module does not include the first plug-in interface.
  • the service realization of the plug-in interface, the method includes:
  • the plug-in module loads the default implementation of the first plug-in interface according to the first instruction.
  • the plug-in module loads the default implementation of the first plug-in interface according to the first instruction, including:
  • the plug-in module sends a second instruction for invoking the first plug-in interface to the terminal software module according to the first instruction;
  • the plug-in module loads the default implementation of the first plug-in interface according to the first feedback instruction for the second instruction fed back by the system, and the first feedback instruction is used to indicate that the terminal software module does not include The service realization of the first plug-in interface.
  • the terminal software module includes a plug-in service factory, the plug-in module includes a plug-in default factory, the plug-in default factory includes the first plug-in interface, and the plug-in business factory inherits the first plug-in interface, The terminal software module inherits the default implementation of the first plug-in interface; and,
  • the plug-in module loads the default implementation of the first plug-in interface according to the first instruction, including:
  • the plug-in module sends a second instruction for invoking the first plug-in interface to the terminal software module according to the first instruction;
  • the terminal software module loads the default implementation of the first plug-in interface according to the second instruction.
  • system further includes an open source software module; and, the method further includes:
  • the plug-in module receives a third instruction sent by the terminal software module, where the third instruction is used to load a first service implementation;
  • the plug-in module sends a fourth instruction to the open source software module according to the current version of the open source software module, where the fourth instruction is used to load the first service implementation in the open source software module of the current version.
  • the version number of the terminal software module is a first version
  • the version number of the open source software module is a second version
  • the first version is different from the second version
  • the method further includes:
  • the terminal software module is modified, and the version number of the modified terminal software module is the third version, and the third version is different from the first version.
  • the terminal software module includes the service realization of the second plug-in interface; and, the method includes:
  • the plug-in module acquires a fifth instruction, where the fifth instruction is used to load the service implementation of the second plug-in interface;
  • the plug-in module calls the second plug-in interface to load the service implementation of the second plug-in interface according to the fifth instruction.
  • the method further includes:
  • the plug-in module determines, according to the sixth instruction, that the terminal software module is not installed in the system
  • the plug-in module loads the default implementation of the first plug-in interface.
  • the first plug-in interface is any one of the following: a dual-card management interface, a full Netcom interface, a hot plug interface, a Tiantong interface, and a 5G call interface.
  • a plug-in implementation method is provided, which is applied to a system including an open source software module, an adaptation module, and a terminal software module, and the method includes:
  • the terminal software module sends a third instruction to the adaptation module, where the third instruction is used to load the first service implementation;
  • the adaptation module sends a fourth instruction to the open source software module according to the current version of the open source software module, where the fourth instruction is used to load the first service implementation in the open source software module of the current version.
  • a computer program product includes computer program code, and the calculation program code includes the system of the first aspect and/or the second aspect described above.
  • a computer-readable medium for storing a computer program, and the computer program includes the system of the first aspect and/or the second aspect described above.
  • a chip including a processor, configured to call and run the system of the first aspect and/or the second aspect stored in the memory from the memory.
  • another chip including: an input interface, an output interface, a processor, and a memory.
  • the input interface, output interface, the processor and the memory are connected by an internal connection path, and the processing The device is used to execute the system of the first aspect and/or the second aspect stored in the memory.
  • an electronic device including: a display screen and a processor, the processor is coupled to a memory, and the memory is configured to store the system of the first aspect and/or the second aspect.
  • FIGS 1 to 4 are schematic block diagrams of the system implemented by the plug-in provided by the present application.
  • 5 to 7 are schematic flowcharts of the plug-in implementation method provided by this application.
  • Fig. 8 is another schematic block diagram of a system implemented by a plug-in provided by the present application.
  • FIG. 9 is another schematic flowchart of the plug-in implementation method provided by the present application.
  • 10 to 12 are another schematic block diagrams of the system implemented by the plug-in provided in the present application.
  • FIG. 13 and FIG. 14 are schematic structural diagrams of the electronic device provided by the present application.
  • Fig. 15 is another exemplary structure diagram of the electronic device provided by the present application.
  • open source software and terminal software depend on each other, and the decoupling between open source software and terminal software cannot be achieved.
  • the versions of open source software and terminal software must be consistent.
  • the open source software may be Android (android) software
  • the terminal software may be an emotional user interface (EMUI) software developed by Huawei based on the Android software. Both the Android software and the EMUI software are version 9.0.
  • the terminal manufacturer extends 3 plug-ins and defines 3 plug-in interfaces to realize the communication between open source software and terminal software.
  • the terminal software must also install 3 plug-in interfaces corresponding to the three plug-in interfaces.
  • a plug-in service is implemented to realize the plug-in functions of the three types of plug-ins to ensure the consistency of the plug-in interface and the plug-in function, so as to ensure the normal operation of open source software.
  • the plug-in interface is a 5G call interface
  • the corresponding plug-in function is a 5G call function.
  • terminal manufacturers based on various practical considerations, the defined plug-in interface is not consistent with the achievable plug-in functions. This situation will affect the normal operation of open source software and seriously reduce the user experience.
  • terminal manufacturers want to extend a variety of differentiated terminal software for open source software to meet the needs of different scenarios, for example, open source
  • the software is version 3, and 5 plug-in interfaces are defined.
  • the terminal software can be developed based on the open source software of version 3 to generate multiple versions of terminal software.
  • the terminal software of version 1 can implement 3 plug-in functions, and the terminal of version 2
  • the software can realize 4 plug-in functions, and the terminal software of version 3 can realize 5 plug-in functions.
  • terminal manufacturers want to define multiple plug-in interfaces at one time to meet possible future user needs.
  • the current terminal software has the corresponding plug-in function of each plug-in interface, that is, the plug-in function of the terminal software is not consistent with the plug-in interface.
  • the terminal software can be gradually added Realizable plug-in functions.
  • the plug-in business implementation of the plug-in needs to be uninstalled to remove the plug-in function of the plug-in, and the code of the terminal software will happen Changes, if the code of the open source software is not adaptively changed, it will cause the terminal to fail to boot, or cause the abnormal function of the open source software, and the normal use of the terminal cannot be realized.
  • open source software relies on terminal software. If the plug-in function of the terminal software is inconsistent with the plug-in interface defined by the terminal manufacturer, it will seriously affect the normal operation of the open source software and the normal operation of electronic equipment. Based on this, this application provides a system and method for plug-in implementation.
  • the system includes a plug-in module extended by a terminal manufacturer for open source software.
  • One or more plug-in interfaces are defined in the plug-in module to provide the functionality of the plug-in interface.
  • the plug-in module includes a plug-in loading module and a plug-in default implementation module.
  • the plug-in default implementation module includes a plug-in default implementation corresponding to the at least one plug-in interface one-to-one.
  • the plug-in loading module may be based on a plug-in interface sent by open source software for loading a certain plug-in interface.
  • the plug-in module can be used to realize the default implementation or business realization of the plug-in interface, which realizes the normal operation of the open source software. Realize the normal operation of electronic equipment.
  • open source software sends commands related to a certain plug-in interface, whether the plug-in module implements the default implementation of the plug-in interface or the business implementation, for open source software, all you see are the completion of the command In other words, what you see is the completion of the function of the plug-in interface (although the plug-in function of the plug-in interface is not completed by the default implementation), so, the normal operation of the open source software can be realized to realize the electronic device normal operation.
  • this application can extend different versions of terminal software for the same open source software, so as to achieve the scenario requirements where the plug-in interface and the plug-in function are inconsistent.
  • this application can define multiple plug-in interfaces at one time, and add corresponding plug-in functions multiple times based on user needs to cope with possible future user needs.
  • this application may only need to change the terminal software without changing the open source software. Illustratively, only the terminal software is upgraded without upgrading the Android software.
  • Fig. 1 is a schematic diagram of a system implemented by a plug-in provided by this application.
  • the system 100 includes an open source software module 110, a plug-in module 120, and a terminal software module 130.
  • the open source software module 110 includes source code of an open source system.
  • the open source system may be an android operating system or a linux operating system.
  • the purpose of the plug-in module 120 is to provide the default capabilities of the plug-in interface extended by the terminal manufacturer. When the actual functions of the plug-in interface cannot be implemented in the terminal software module 130, the default capabilities of the plug-in interface are implemented to ensure as much as possible The normal operation of the system.
  • the terminal software module 130 is defined by the terminal manufacturer, and is a terminal software with a terminal personalized style developed based on open source software, which can realize the actual function of the plug-in interface extended by the terminal manufacturer.
  • the content of the terminal software module 120 of the plug-in module 120 will be described in detail.
  • the plug-in module 120 defines plug-in interfaces of M plug-ins, which are used to implement communication between the Android software 110 and the terminal software 130.
  • the plug-in module 120 includes a plug-in loading module 121 and a plug-in default implementation module 122.
  • the plug-in default implementation module 122 includes default implementations of M plug-in interfaces.
  • the default implementation of the plug-in interface corresponds to the service implementation of the plug-in interface.
  • the business implementation of the plug-in interface can be understood as the real implementation of the plug-in interface, which can realize the actual function of the plug-in interface, and the default implementation of the plug-in interface can be understood as the false implementation of the plug-in interface, in the case that the business implementation of the plug-in interface cannot be realized
  • the next step is to implement the default implementation of the plug-in interface.
  • the business implementation of the plug-in interface is an enhanced function of the default implementation of the plug-in interface.
  • the M plug-in interfaces may include at least one of the following: a dual-card management interface, a full Netcom interface, a hot-swappable interface, a Tiantong interface, and a 5G call interface.
  • the plug-in interface is a 5G call interface
  • the service implementation of the 5G call interface is a 5G call function
  • the default implementation of the 5G call interface can be any of 4G call function, 3G call function, or 2G call.
  • the plug-in interface is a dual-card management interface
  • the service implementation of the dual-card management interface is a dual-card management function
  • the default implementation of the dual-card management interface may be a single-card management function
  • the plug-in interface is a hot-plug interface
  • the business realization of the hot-plug interface is a hot-plug function.
  • the so-called hot-plug function means that when the peripheral device is connected to the electronic device, it can be re- When turned on, the electronic device can sense the peripheral device to transmit signals with the peripheral device.
  • the default implementation of the hot plug interface is that when the peripheral device is connected to the electronic device, the peripheral device needs to be restarted to scan the peripheral device to sense the peripheral device.
  • the plug-in interface is a full Netcom interface
  • the service implementation of the full Netcom interface is a full Netcom function.
  • the so-called full Netcom function means that the electronic device can support various operators, and the user switches from one operator to another. It can be connected to the electronic device during the business.
  • the default implementation of the full Netcom interface can be that the electronic device supports one operator, and the user can connect to the network provided by the operator, but cannot connect to the network provided by other operators.
  • the default implementation of the plug-in interface may be an inherent business implementation in the open source software module, or an empty implementation, or a business implementation extended by the terminal manufacturer, which is not limited in this application. In the following, these three situations will be explained separately.
  • the plug-in interface is a 5G call interface.
  • the open source software module 110 can be built in.
  • the 4G call function is implemented as the default implementation of the 5G plug-in interface.
  • the 3G call function is inherent in the open source software module 110, and the terminal manufacturer has upgraded the 3G call function twice to realize the 4G call function and the 5G call function.
  • the terminal manufacturer can expand the 4G function.
  • the call function is implemented as the default of the 5G call interface.
  • the empty implementation can be used as the plug-in The default implementation of the interface.
  • the plug-in loading module 121 can determine whether the terminal software module 130 includes the service realization of the plug-in interface based on the instruction sent by the open source software module 110 for invoking the service realization of the plug-in interface. If the terminal software module 130 includes the plug-in For the service realization of the interface, the service realization of the plug-in interface is loaded. If the service realization of the plug-in interface is not included in the terminal software module 130, the default implementation of the plug-in interface is loaded.
  • the terminal software module 130 includes a plug-in service realization module 131, and the plug-in service realization module 131 includes service realization of N plug-in interfaces.
  • the plug-in service realization module 131 includes service realization of N plug-in interfaces. Taking the M plug-in interfaces defined in the plug-in module 120 including the full Netcom interface, the hot-swappable interface, the dual-card management interface, and the plug-in module 120 including the default implementation of the 3 types of plug-in interfaces as an example, for N plug-in interfaces and M plug-in interfaces The relationship of the interface is explained.
  • the N plug-in interfaces may be the M plug-in interfaces defined in the plug-in module 120 by the terminal manufacturer, that is, the terminal software module 130 has the plug-in functions of the M plug-in interfaces.
  • the terminal software module 130 has full Netcom functions, hot-swappable functions, and dual-card management functions. This situation can be understood as the plug-in interface is consistent with the plug-in function.
  • the N plug-in interfaces may include a part of the M plug-in interfaces. That is, although the terminal manufacturer defines M plug-in interfaces in the plug-in module 120, the terminal software module 130 has the M plug-in interfaces.
  • the plug-in functions of a part of the plug-in interfaces of the plug-in interfaces For example, the terminal software module 130 has any plug-in function of full Netcom function, hot plug function and dual card management function, or the terminal software module 130 has any two of Netcom function, hot plug function and dual card management function. kind of plug-in function.
  • the N plug-in interfaces may include a part of the M plug-in interfaces and other plug-in interfaces, and the other plug-in interfaces do not belong to the M plug-in interfaces.
  • the terminal software module 130 can only realize the plug-in functions of a part of the M plug-in interfaces, and the functions of the other plug-in interfaces cannot be realized temporarily.
  • the terminal software module 130 has a full Netcom function and a 5G call function, wherein the 5G call interface corresponding to the 5G call function is not a plug-in interface defined in the plug-in module 120.
  • the N plug-in interfaces may include the M plug-in interfaces and other plug-in interfaces.
  • the terminal software module 130 can also only implement the plug-in functions of the M plug-in interfaces, and the other plug-in interfaces The function of is temporarily unavailable.
  • the terminal software module 130 not only has full Netcom function, hot swap function, dual card management function and 5G call function.
  • the 5G call interface corresponding to the 5G call function is not the plug-in interface defined in the plug-in module 120.
  • the plug-in service implementation module 131 points to the plug-in default implementation module 122 through an arrow, which indicates that the service implementation of the plug-in interface and the corresponding default implementation are implemented in inheritance mode.
  • the default implementation is the parent class, and the business implementation is Subclass, this design can always ensure the external uniformity of the plug-in interface, that is, whether the plug-in module implements the default implementation of the plug-in interface or the business implementation of the plug-in interface, for open source software modules, what you always see is M plug-in interfaces defined by the terminal manufacturer.
  • FIG. 2 to 4 show another schematic diagram of the system implemented by the plug-in provided by this application. It should be understood that the systems shown in FIG. 2 to FIG. 4 are only schematic illustrations, and should not constitute a limitation to this application.
  • Figure 2 may correspond to a situation where the plug-in interface and the plug-in function are consistent.
  • four plug-in interfaces are defined in the plug-in module 120.
  • the plug-in loading module 121 can call the four plug-in interfaces.
  • the plug-in default implementation module 121 includes the default implementations of the four plug-in interfaces; the terminal software module 130
  • the plug-in functions of the four plug-in interfaces can be realized, and the plug-in service realization module 131 includes the service realization of the four plug-in interfaces.
  • the version of the plug-in module 120 is consistent with the version of the terminal software module 130, for example, both are version 3.0.
  • Figure 3 may correspond to the situation where the plug-in interface and the plug-in function are inconsistent.
  • four plug-in interfaces are defined in the plug-in module 120.
  • the plug-in loading module 121 can call the four plug-in interfaces.
  • the plug-in default implementation module 121 includes the default implementations of the four plug-in interfaces; the terminal software module 130 Only the plug-in functions of 3 of the 4 plug-in interfaces can be realized, and the plug-in service realization module 131 includes the service realization of the 3 plug-in interfaces. Subsequently, the terminal manufacturer can install the remaining service implementation of the plug-in interface in the terminal software module 130 based on actual needs.
  • the version number of the plug-in module 120 is different from the version number of the terminal software module 130.
  • the plug-in module 120 is version 3.0 and the terminal software module 130 is version 2.0.
  • the terminal software module may be upgraded to version 3.0, and the service implementation of the remaining plug-in interfaces in the plug-in module 120 may be added, so that the plug-in interface and the plug-in function are consistent.
  • the plug-in interface shown in FIG. 3 it is impossible for the plug-in interface shown in FIG. 3 to be inconsistent with the plug-in function, otherwise it will cause the open source software module to fail to run, the electronic device cannot be turned on, or the system's function is seriously abnormal, causing the electronic device to fail. use.
  • the plug-in interface and the plug-in function are not inconsistent, which reflects the inconsistency of the version numbers of the two, but does not affect the normal operation of the open source software module and electronic equipment.
  • the plug-in module intelligently determines to load the terminal software module Business realization.
  • the plug-in interface is inconsistent with the plug-in function, the following situations may also be included.
  • the terminal manufacturer defines three plug-in interfaces in the plug-in module 120, and the plug-in service realization module 131 of the terminal software module 130 may include the service realization of the three plug-in interfaces and the service realization of other plug-in interfaces.
  • the current electronic device It can only realize the plug-in functions of the 3 plug-in interfaces, and cannot realize the plug-in functions of other plug-in interfaces. In the future, it can be considered based on the actual situation.
  • the plug-in functions of other plug-in interfaces are relatively stable, it can be in the plug-in module Add other plug-in interfaces to realize the plug-in functions of other plug-in interfaces.
  • the version of the plug-in module 120 is different from the version of the terminal software module 130.
  • the plug-in module is version 2.0
  • the terminal software module 130 is version 3.0.
  • the plug-in module 120 is upgraded to version 3.0, keeping Consistency with plug-in functions.
  • the system 100 includes an open source software module 110 and a plug-in module 120.
  • the default implementation in the plug-in module 120 can be loaded to realize the function requirements of the open source software module 110 for a certain plug-in interface.
  • This situation can correspond to the embodiments shown in FIG. 5 and FIG. 6.
  • the plug-in module includes the default implementation of the first plug-in interface
  • the terminal software module does not include the service implementation of the first plug-in interface as an example
  • the plug-in module may also include other default implementations of M-1 plug-in interfaces.
  • the terminal software module does not include the service realization of the first plug-in interface, and may include the service realization of other plug-in interfaces.
  • the other plug-in interfaces may be the M-1 plug-in interfaces or the M-1 plug-in interfaces.
  • a part of the plug-in interface in the interface can also be a part of the plug-in interface of the M-1 plug-in interface and the plug-in interface that does not exist in the plug-in module, or it can be the plug-in interface that does not exist in the M plug-in interface and the plug-in module.
  • the first plug-in interface may be a 5G plug-in interface
  • the other plug-in interfaces may be at least one of a full Netcom interface, a hot plug interface, and a dual-card management interface.
  • the open source software module generates a first instruction based on a user operation, and the first instruction is used to load the service implementation of the first plug-in interface.
  • user operations may be operations in various forms, which are not limited in this application.
  • the user operation may be a user's click operation or sliding operation on the display screen of the electronic device, or the user's voice input.
  • the open source software module Based on the user operation, the open source software module generates the first instruction corresponding to the user operation.
  • the first instruction is used to load the service realization of the first plug-in interface. It can be understood that, through the user operation, the user wants the system to implement the first plug-in The plug-in function of the interface to meet the demand.
  • the user enters user operations by dialing the number and clicking the call button. Based on the user operation, the open source software module knows that the user wants to make a call. Moreover, because the plug-in module defines a 5G call interface, priority is given to using 5G call Therefore, the first command related to the 5G call function can be generated, and the first plug-in interface is a 5G plug-in interface.
  • the first command can be a 5G call command for realizing the 5G call function, or a call command for realizing the call function. If the first command is a call command, the plug-in loading module will preferentially call the 5G call based on the call command. interface.
  • the open source software module sends the first instruction.
  • the plug-in loading module receives the first instruction.
  • the plug-in loading module loads the default implementation of the first plug-in interface according to the first instruction.
  • the plug-in default realization module can be loaded The default implementation of the first plug-in interface.
  • the plug-in module loads the default implementation of the first plug-in interface to complete the implementation of the first plug-in interface. transfer.
  • the plug-in module can be used to implement the default implementation or business implementation of the plug-in interface, so that the open source software module can operate normally, and Ensure the normal operation of electronic equipment as much as possible, so that the open source software module no longer depends on the terminal software module, and the decoupling of the terminal software module and the open source software module is realized.
  • the plug-in loading module may determine, according to the first instruction, that the plug-in service realization module does not include the service realization of the first plug-in interface, and further, load the service realization of the first plug-in interface.
  • step S220 will be described through steps S221, S222, and S223.
  • the plug-in loading module sends a second instruction for invoking the first plug-in interface to the plug-in service realization module according to the first instruction.
  • the plug-in loading module may determine, according to the first instruction, that the open source software module wants to call the first plug-in interface to implement the plug-in function of the first plug-in interface. Therefore, the plug-in loading module can call the first plug-in interface through the second instruction, so as to facilitate the service realization of loading the first plug-in interface and realize the plug-in function of the first plug-in interface.
  • the plug-in loading module may send an instruction to the system to determine whether a terminal software module is installed in the system. In this way, for the situation that the terminal software module shown in FIG. 4 is uninstalled, this step can effectively avoid the abnormal operation of the open source software module caused by the uninstallation of the terminal software module.
  • the system can determine whether a terminal software module is installed in the system according to the instruction sent by the plug-in loading module. If the terminal software module is not installed in the system, the system sends a feedback instruction to the plug-in loading module to indicate that there is no terminal software module installed in the system. Install the terminal software module. If the terminal software module is installed in the system, the plug-in loading module sends a second instruction to call the first plug-in interface to the plug-in service realization module without receiving the feedback instruction sent by the system.
  • the plug-in loading module receives a first feedback instruction for the second instruction sent by the system, and the first feedback instruction is used to indicate that the terminal software module (plug-in service implementation module) does not include the first plug-in interface.
  • the terminal software module plug-in service implementation module
  • the system can determine whether the plug-in service realization module includes the service realization of the first plug-in interface, and if the service realization of the first plug-in interface is not included, the system sends the first feedback instruction to the plug-in loading module so that the plug-in
  • the loading module may determine that the plug-in service realization module does not include the service realization of the first plug-in interface. In this way, the plug-in loading module can load the default implementation of the first plug-in interface.
  • the plug-in loading module sends a ninth instruction to the plug-in default implementation module according to the first feedback instruction to load the default implementation of the first plug-in interface.
  • the 5G call interface is defined in the plug-in module, and the default implementation module of the plug-in includes the default implementation of the 5G call interface.
  • the default implementation is the 4G call function.
  • the plug-in service realization module in the terminal software module does not include the service realization of the 5G plug-in interface. , That is, it does not have 5G call function.
  • the user inputs a user operation by dialing a number and clicking the call button. Based on the user operation, the open source software module generates a first instruction and sends the first instruction.
  • the first instruction is a call instruction.
  • the plug-in loading module knows that the user wants to make a call, and since the 5G call interface is defined in the plug-in module, priority is given to using 5G call, and the second command is sent to the plug-in business module to call the 5G call interface. This second command is recorded as a 5G call command.
  • the system can determine that the plug-in service realization module does not include the service realization of the 5G plug-in interface, and send the first feedback command to the plug-in loading module.
  • the plug-in loading module loads the default implementation of the 5G call interface according to the first feedback instruction, that is, realizes the 4G call function.
  • the plug-in loading module implements the 4G call function
  • the user may be prompted in a possible manner to inform the user that the current 4G call function is implemented, so that the user can independently choose whether to use the current 4G call function.
  • the possible manner may be a pop-up interface window, or output a voice prompt, etc.
  • This situation can correspond to the embodiment shown in FIG. 7.
  • the plug-in module includes the default implementation of the first plug-in interface
  • the terminal software module includes the service implementation of the first plug-in interface as an example.
  • the plug-in module may also include the default implementation of other plug-in interfaces
  • the terminal software module may also include the service implementation of other plug-in interfaces, which is not limited in this application.
  • the open source software module generates a first instruction based on a user operation, and the first instruction is used to load the service implementation of the first plug-in interface.
  • step S201 For the description of this step, reference may be made to the related description of step S201 in case 1, which will not be repeated here.
  • the open source software module sends the first instruction.
  • the plug-in loading module receives the first instruction.
  • the plug-in loading module loads the service implementation of the first plug-in interface according to the first instruction.
  • the plug-in service realization module includes the service realization of the first plug-in interface
  • the plug-in function of the first plug-in interface can be realized, that is, the plug-in loading module can load the service realization of the first plug-in interface.
  • the plug-in loading module loads the service realization of the first plug-in interface according to the first instruction, including:
  • the plug-in loading module may send a second instruction for invoking the first plug-in interface to the plug-in service realization module according to the first instruction.
  • the plug-in service realization module may load the service realization of the first plug-in interface based on the second instruction.
  • the plug-in loading module can load the service realization of the first plug-in interface through the plug-in service realization module.
  • step S221 For the description of the second instruction sent by the plug-in loading module, reference may be made to the related description of step S221 in case 1, which will not be repeated here.
  • the plug-in service implementation module sends a second feedback instruction to the plug-in loading module, where the second feedback instruction is used to instruct the plug-in loading module to successfully invoke the service implementation of the first plug-in interface.
  • the second feedback instruction may also be understood as used to instruct the plug-in service realization module to include the service realization of the first plug-in interface.
  • the default implementation module of the plug-in includes the default implementation of the 5G call interface.
  • the default implementation is the 4G call function.
  • the plug-in service realization module in the terminal software module includes the service realization of the 5G plug-in interface. That is, it has a 5G call function.
  • the user inputs a user operation by dialing a number and clicking the call button. Based on the user operation, the open source software module generates a first instruction and sends the first instruction.
  • the first instruction is a call instruction.
  • the plug-in loading module knows that the user wants to make a call, and since the 5G call interface is defined in the plug-in module, priority is given to using 5G call, and the second command is sent to the plug-in business module to call the 5G call interface. This second command is recorded as a 5G call command.
  • the plug-in loading module loads the service implementation of the 5G call interface according to the 5G call command, that is, realizes the 5G call function.
  • the reflection mechanism can be used to query whether the service implementation of the plug-in interface exists.
  • This query process is time-consuming and has a large performance overhead.
  • the plug-in loading module calls multiple plug-in interfaces through multiple instructions, one instruction calls one plug-in Interface
  • the system needs to perform multiple queries to determine whether there is a business implementation of the plug-in interface. Assuming that the plug-in loading module calls an instruction of a plug-in interface, it takes 0.1ms for the system to query whether there is a service implementation of the plug-in interface. If there are 10 instructions to call the plug-in interface, the query process only takes 1ms, and the delay is long. , Affect system performance.
  • this application proposes to adopt the factory model, that is, adding plug-in business factories, through which the number of system queries can be reduced to improve system performance.
  • the prior art requires 10 queries and takes 1ms.
  • the plug-in business factory by adopting the plug-in business factory, it is possible to query only once, and query whether there is plug-in business based on the first instruction. Since the factory has determined whether there is a plug-in business factory, there is no need to query again for subsequent instructions, which greatly reduces the time delay and improves the system performance.
  • the following describes the system implemented by the plug-in provided by this application in conjunction with FIG. 8. Further, taking the system shown in FIG. 8 as an example, in conjunction with FIG. 9, the method for implementing the plug-in provided by this application will be described.
  • FIG. 8 shows another schematic diagram of a system implemented by the plug-in provided by this application.
  • a plug-in default factory 123 is added to the plug-in module 120
  • a plug-in business factory 132 is added to the terminal software module 130.
  • the plug-in business factory 132 and the plug-in default factory 123 are also implemented by inheritance.
  • the plug-in default factory 123 is the parent class and the plug-in business factory 132 is the subclass. This design can always ensure the external unity of the plug-in interface.
  • the plug-in module 120 defines M plug-in interfaces, the plug-in default factory 123 includes the M plug-in interfaces, and the plug-in default implementation module includes default implementations of the M plug-in interfaces.
  • the plug-in service realization module 131 of the terminal software module 130 may include service realizations of N plug-in interfaces.
  • the plug-in service realization module 131 includes the service realization of the M plug-in interfaces
  • the plug-in service factory also includes the M plug-in interfaces, which can realize the plug-in function of each plug-in interface.
  • the plug-in service realization module 131 includes the service realization of M1 plug-in interfaces of the M plug-in interfaces, M1 is less than or equal to N, and the plug-in service realization module 131 inherits the default values of M-M1 plug-in interfaces in the M plug-in interfaces At the same time, the plug-in business factory 132 inherits the M-M1 plug-in interfaces. That is, from the final result, the plug-in service factory 132 includes M plug-in interfaces, and the plug-in service implementation module 131 includes service implementations of M1 plug-in interfaces and default implementations of M-M1 plug-in interfaces.
  • the plug-in business factory 132 provides M plug-in interfaces, which can implement M functions. As for whether the M functions are completed by default implementation or business implementation, it does not matter. Therefore, as long as the terminal software module 130 is installed in the system, regardless of whether there is a plug-in interface service implementation in the plug-in service implementation module 131, the plug-in loading module 121 can successfully call the service implementation or default implementation of the plug-in interface through the plug-in business factory 132. However, in the case of business implementation without a plug-in interface, the default implementation of the plug-in interface is implemented. In the case of a business implementation with a plug-in interface and the plug-in interface belongs to the M plug-in interfaces, it is the plug-in interface that is implemented Business realization.
  • the system may include multiple plug-in business factories.
  • Each plug-in business factory corresponds to a business type.
  • the plug-in interfaces are classified into different plug-in business factories according to the business type.
  • the type of the plug-in default factory and the plug-in There is a one-to-one correspondence between the types of business factories. Assuming that the system includes 3 plug-in service factories and 3 plug-in default factories, corresponding to multimedia services, short-range communication services, and communication services, respectively.
  • the M plug-in interfaces can be divided into 3 categories, and the plug-in interfaces corresponding to the multimedia services belong to those corresponding to the multimedia services.
  • the plug-in default factory, the plug-in interface corresponding to the short-range communication service belongs to the plug-in default factory corresponding to the short-range communication service
  • the plug-in interface corresponding to the communication service belongs to the plug-in default factory corresponding to the communication service
  • the plug-in service factory corresponding to the multimedia service inherits the corresponding multimedia service
  • the plug-in interface of the plug-in default factory, the plug-in business factory corresponding to the short-range communication business inherits the plug-in interface of the plug-in default factory corresponding to the short-range communication business
  • the plug-in business factory corresponding to the communication business inherits the plug-in interface of the plug-in default factory corresponding to the communication business.
  • Fig. 9 shows a schematic diagram of the plug-in implementation method provided by the present application.
  • the modules involved in the embodiment corresponding to FIG. 9 may correspond to the modules in FIG. 8.
  • the plug-in module includes the default implementation of the first plug-in interface
  • the terminal software module does not include the services of the first plug-in interface.
  • the plug-in module may also include the default implementation of other plug-in interfaces
  • the terminal software module may also include the service implementation of other plug-in interfaces, which is not limited in this application.
  • the terminal software module includes a plug-in service factory
  • the plug-in module includes a plug-in default factory
  • the plug-in default factory includes the first plug-in interface
  • the plug-in business factory inherits the first plug-in interface
  • the terminal software module inherits the first plug-in interface.
  • the open source software module generates a first instruction based on a user operation, and the first instruction is used to load the service implementation of the first plug-in interface.
  • the open source software module sends the first instruction.
  • the plug-in loading module receives the first instruction.
  • the plug-in loading module sends a second instruction to call the first plug-in interface to the plug-in service factory according to the first instruction.
  • the plug-in loading module may determine, according to the first instruction, that the open source software module wants to call the first plug-in interface to implement the plug-in function of the first plug-in interface. Therefore, the plug-in loading module can call the first plug-in interface through the second instruction, so as to load the service realization of the first plug-in interface and realize the plug-in function of the first plug-in interface.
  • the plug-in loading module may send an instruction to the system to determine whether a terminal software module is installed in the system.
  • this step can effectively avoid the abnormal operation of the open source software module caused by the uninstallation of the terminal software module.
  • a terminal software module is installed in the system, for a system with a plug-in business factory and a plug-in default factory, because the plug-in business factory inherits the plug-in interface of the plug-in default factory and the plug-in business implementation module inherits the plug-in default implementation module
  • the default implementation of there is no need to determine whether the terminal software module includes the service realization of the first plug-in interface, nor does it need to send feedback instructions from the system without the service realization of the first plug-in interface, only through the plug-in business factory Determine by yourself whether you need to load the default implementation or the business implementation of the first plug-in interface. No matter which implementation is loaded, it can be understood as the realization of the function of the first plug-in interface.
  • the plug-in service factory loads the default implementation of the first plug-in interface according to the second instruction.
  • the plug-in business implementation module does not include the business implementation of the first plug-in interface, but inherits the default implementation of the first plug-in interface in the plug-in default implementation module, the plug-in business implementation module has the default implementation of the first plug-in interface, Therefore, the plug-in service factory loads the default implementation of the first plug-in interface according to the second instruction.
  • the plug-in implementation method provided in this application adopts the factory mode.
  • the terminal software module can inherit the default of the first plug-in interface in the plug-in module.
  • the system queries whether there is a business implementation of the first plug-in interface, it can only query and need to query whether there is a plug-in business factory once.
  • the plug-in module calls the plug-in interface multiple times, the time caused by the query can be reduced. Delay, greatly improving system performance.
  • plug-in business implementation module includes the business implementation of a certain plug-in interface
  • whether the plug-in loading module is loaded through the plug-in business factory is the business implementation of the plug-in interface or the default implementation, it is considered that the plug-in loading module has successfully called the plug-in interface.
  • the version numbers of the open source software module, the plug-in module, and the terminal software module illustrate that the solution provided in this application can realize the decoupling of the open source software module and the terminal software module, so that the open source software module does not depend on the terminal software module.
  • the version number of the terminal software module is a first version
  • the version number of the open source software module is a second version
  • the first version is different from the second version
  • the first version is version 2.0
  • the second version is version 3.0.
  • the method further includes:
  • the terminal software module is changed, and the version number of the terminal software module after the change is the third version, which is different from the first version.
  • the modified terminal software module can be in any of the following situations: increase the number of service implementations of the plug-in interface; reduce the number of service implementations of the plug-in interface; upgrade and optimize the business implementation of the original plug-in interface
  • the business implementation of the original plug-in interface for example, the business implementation function of the original plug-in interface is to support SD video playback, and the business implementation function of the modified plug-in interface is to support high-definition video playback.
  • changing the terminal software module can be to upgrade or roll back the terminal software module, or it can be that the user uninstalls one terminal software module and then reinstalls another terminal software module.
  • This application does not make any limitation, as long as it is a terminal software module Just make changes.
  • the plug-in function of the terminal software module before the change is not consistent with the plug-in interface, and the version number of the terminal software module is inconsistent with the open source software module.
  • the change of the terminal software module does not affect the open source software module.
  • Changing the terminal software module does not change the open source software module, and the version number of the terminal software module after the change is the third version.
  • the version number of the terminal software module is the same as the version number of the plug-in module.
  • the version number of the terminal software module and the version number of the plug-in module after the change are both version 3.0.
  • the version number of the plug-in module is the same as the version number of the open source software module.
  • the plug-in function of the terminal software module is consistent with the defined plug-in interface, and the version number of the terminal software module is the same as the version number of the plug-in module, the version numbers of the open source software module, the plug-in module, and the terminal software module are all the same.
  • the terminal software module will be uninstalled.
  • the system includes an open source software module 110 and a plug-in module 120. If there is no terminal software module 130, the plug-in can be loaded.
  • the default implementation in the module 120 realizes the function requirements of the open source software for a certain plug-in interface.
  • the method of loading the default implementation in the plug-in module 120 in the scenario of uninstalling the terminal software module is exemplarily described.
  • the method further includes:
  • the open source software module sends a sixth instruction to the plug-in loading module, where the sixth instruction is used to load the service implementation of the first plug-in interface;
  • the plug-in loading module determines that the terminal software module is not installed in the system
  • the plug-in loading module loads the default implementation of the first plug-in interface.
  • the plug-in loading module can determine whether the terminal software module is installed in the system according to the sixth instruction sent by the open source software module for loading the service realization of the first plug-in interface, and if it is not installed, load the first plug-in interface.
  • the default implementation of a plug-in interface of course, in the case of installation, the plug-in loading module will send an instruction to call the first plug-in interface.
  • the plug-in loading module can send an instruction to the system, and the system can determine whether a terminal software module is installed in the system according to the instruction sent by the plug-in loading module. If the terminal software module is not installed in the system, the system loads the plug-in The module sends a feedback instruction to indicate that the terminal software module is not installed in the system. If the terminal software module is installed in the system, the plug-in loading module sends the first call to the plug-in service implementation module without receiving the feedback instruction sent by the system. Instructions for the plug-in interface.
  • the plug-in loading module judges whether the terminal software module is installed in the system according to the instructions sent by the open source software module to load the service realization of the plug-in interface, which can effectively avoid the terminal software module.
  • the normal operation of electronic equipment makes open source software modules no longer dependent on terminal software modules.
  • the plug-in loading module of the plug-in module and the plug-in default implementation module are provided, the plug-in loading module can determine whether a certain plug-in interface service is realized in the terminal software module, and if it exists, it loads the service realization of the plug-in interface If it does not exist, load the default implementation of the plug-in interface.
  • the plug-in can be extended to extend the business functions of the terminal, but also, when the plug-in interface and the plug-in function are inconsistent, the default implementation or business implementation of the plug-in interface can be realized through the plug-in module, and the normal operation of the open source software is realized.
  • the normal operation of electronic equipment makes open source software modules no longer dependent on terminal software modules.
  • the code of the open source software module changes, and the code of the terminal software module must also change.
  • the version of the open source software module is upgraded, the version of the terminal software module must also be upgraded, the version of the open source software module must be rolled back, and the version of the terminal software module must also be rolled back.
  • the terminal software module depends on the open source software module.
  • this application proposes that the adaptation module can be used as a bridge between the open source software module and the terminal software module to shield the change of the open source software module.
  • the adaptation module can be used as a bridge between the open source software module and the terminal software module to shield the change of the open source software module.
  • the open source software module Since it involves the interaction between the open source software module and the terminal software module, as an adaptation module of the intermediate bridge, when the software is designed, it is necessary to adapt the functions related to the plug-in function of the terminal software in the open source software module, in order to facilitate the description , To record the functions related to the plug-in function of the terminal software in the open source software module as related functions, so that the related functions do not change. For the terminal software module, only know that the open source software module provides these related functions. As for the realization of these related functions The terminal software module does not perceive whether the code of the terminal changes. In this way, the open source software module is shielded from the change of the terminal software module through the adaptation module.
  • the relevant functions in the open source software module change, multiple versions of the relevant functions can be compatible in the adaptation module. Taking the picture refresh function as an example, version 1 corresponds to function 1, and version 2 corresponds to function 2.
  • the adaptation module can be based on the current version of the open source software module to load the business implementation (or function module) of the open source software module.
  • the adaptation module may also be referred to as an Android open-source project (AOSP) adaptation module.
  • AOSP Android open-source project
  • the adaptation module is used for the terminal software module to load the service realization of the open source software module
  • the plug-in loading module and the plug-in default realization module of the above embodiment are used for the open source software module to load the service realization of the terminal software module.
  • the open source software module and the terminal software module can be loaded with each other to realize the business. It can be understood that when the user wants the system to implement some functions, but the open source software module cannot be completed, in this case, the cooperation of the terminal software module is required, and the plug-in loading module and the plug-in default implementation module can be used to load the terminal software module. Realization; when some functions are inherent in the open source software module itself and do not need to be developed by the terminal software module, in this case, the business of loading the open source software module can be realized through the adaptation module.
  • FIGS. 10 and 11 show another schematic diagram of the system implemented by the plug-in provided by this application.
  • FIG. 10 corresponds to FIG. 1
  • an adaptation module is added to the system shown in FIG. 1
  • FIG. 11 corresponds to FIG. 8, and an adaptation module 124 is added to the system shown in FIG. 8.
  • FIGS. 10 and 11 when the terminal software module 130 needs to load the service realization of the open source software module 110, the service realization of the open source software module 110 is loaded through the adaptation module 124.
  • the default implementation of the plug-in interface is in the open source software module 110
  • the service realization of the open source software module 110 can be loaded by the adaptation module 124.
  • Fig. 12 shows another schematic diagram of the system implemented by the plug-in provided by this application.
  • the plug-in loading module and the plug-in default implementation module may not be required, including an open source software module 210, an adaptation module 220, and a terminal software module 230.
  • the terminal software module 230 includes multiple plug-ins.
  • the plug-in service realization module of the service realization of the interface when the terminal software module 230 needs to load the service realization of the open source software module 210, the service realization of the open source software module 210 is loaded through the adaptation module 220.
  • the system 200 shown in FIG. 12 adds an adaptation module 220.
  • terminal software modules, adaptation modules, and open source software modules in the following embodiments may be modules corresponding to FIGS. 10 to 12.
  • the method further includes:
  • the terminal software module sends a third instruction to the adaptation module, where the third instruction is used to instruct to load the first service implementation;
  • the adaptation module sends a fourth instruction to the open source software module according to the current version of the open source software module, where the fourth instruction is used to load the first service implementation in the open source software module of the current version.
  • the plug-in service realization module of the terminal software module can send the fourth instruction to load the first service realization in the open source software module.
  • the adaptation module can determine the current version For the version number of the open source software module, after determining the version number of the open source software module of the current version, the fourth instruction instructs to load the first service realization in the open source software module of the current version.
  • the user inputs a user operation by dialing a number and clicking the call button. Based on the user operation, the open source software module generates a first instruction and sends the first instruction.
  • the first instruction is a call instruction.
  • the plug-in loading module gives priority to using 5G calls, and sends a second command to the plug-in service implementation module to call the 5G call interface, which can be recorded as a 5G call command.
  • the plug-in loading module loads the service implementation of the 5G call interface according to the 5G call command, that is, realizes the 5G call function.
  • the plug-in service implementation module can send a third instruction to the adaptation module to instruct to load the sound playback function in the open source software module.
  • the adaptation module determines that the current version of the open source software module is version 3, and then according to the open source software module’s In version 3.0, a fourth instruction is sent to the open source software module to instruct to load the sound playing function of the open source software module of version 3.0.
  • the embodiment of the present application also provides a corresponding electronic device, and the electronic device includes a corresponding module for executing the foregoing embodiment.
  • the module can be software, hardware, or a combination of software and hardware.
  • FIG. 13 shows a schematic structural diagram of an electronic device.
  • the electronic device 1000 may be any possible electronic device including the system provided in this application.
  • the electronic device may be a portable electronic device that also contains other functions such as a personal digital assistant and/or a music player function, such as a mobile phone, a tablet computer, and a wearable electronic device with wireless communication function (such as a smart watch) Wait.
  • the above-mentioned portable electronic device may also be other portable electronic devices, such as a laptop computer (Laptop) and the like. It should also be understood that, in some other embodiments, the above-mentioned electronic device may not be a portable electronic device, but a desktop computer.
  • the electronic device 1000 may include one or more processors 1001, and the processor 1001 may also be referred to as a processing unit, which may implement certain control functions.
  • the processor 1001 may be a general-purpose processor or a special-purpose processor. For example, it can be a baseband processor or a central processing unit.
  • the baseband processor can be used to process the communication protocol and communication data
  • the central processor can be used to control the electronic device, execute the software program, and process the data of the software program.
  • the processor 1001 may also store instructions and/or data 1003, and the instructions and/or data 1003 may be executed by the processor, so that the electronic device 1000 executes the foregoing method embodiments. Method described in.
  • the processor 1001 may include a transceiver unit for implementing receiving and sending functions.
  • the transceiver unit may be a transceiver circuit, or an interface, or an interface circuit.
  • the transceiver circuits, interfaces, or interface circuits used to implement the receiving and transmitting functions can be separated or integrated.
  • the foregoing transceiver circuit, interface, or interface circuit may be used for code/data reading and writing, or the foregoing transceiver circuit, interface, or interface circuit may be used for signal transmission or transmission.
  • the electronic device 1000 may include a circuit, and the circuit may implement the sending or receiving or communication function in the foregoing method embodiment.
  • the electronic device 1000 may include one or more memories 1002, on which instructions 1004 may be stored, and the instructions may be executed on the processor, so that the electronic device 1000 executes the foregoing method implementation.
  • data may also be stored in the memory.
  • instructions and/or data may also be stored in the processor.
  • the processor and the memory can be provided separately or integrated together.
  • the corresponding relationship described in the foregoing method embodiment may be stored in a memory or in a processor.
  • the electronic device 1000 may further include a transceiver 1005 and/or an antenna 1006.
  • the processor 1001 may be referred to as a processing unit, and controls the electronic device 1000.
  • the transceiver 1005 may be called a transceiver unit, a transceiver, a transceiver circuit or a transceiver, etc., for implementing the transceiver function.
  • the electronic device 1000 in the embodiment of the present application can be used to perform the methods described in FIG. 5, FIG. 6, FIG. 7 and FIG. 9 in the embodiments of the present application, and it can also be used to perform the methods described in the above two or more figures.
  • the method of mutual integration can be used to perform the methods described in FIG. 5, FIG. 6, FIG. 7 and FIG. 9 in the embodiments of the present application, and it can also be used to perform the methods described in the above two or more figures.
  • the method of mutual integration can be used to perform the methods described in FIG. 5, FIG. 6, FIG. 7 and FIG. 9 in the embodiments of the present application, and it can also be used to perform the methods described in the above two or more figures.
  • the method of mutual integration can be used to perform the methods described in FIG. 5, FIG. 6, FIG. 7 and FIG. 9 in the embodiments of the present application, and it can also be used to perform the methods described in the above two or more figures.
  • the method of mutual integration can be used to perform the methods described in FIG. 5, FIG. 6,
  • an electronic device 1000 may include: a processor 1001.
  • the electronic device 1000 is configured to execute each process and step corresponding to each module in the above method 200.
  • a processor 1001. The electronic device 1000 is configured to execute each process and step corresponding to each module in the above method 200.
  • FIG. 14 provides a schematic structural diagram of an electronic device.
  • the electronic device 1100 includes a processor, a memory, a control circuit, an antenna, and an input and output device.
  • the processor is mainly used to process the communication protocol and communication data, and to control the entire terminal, execute the software program, and process the data of the software program.
  • the memory is mainly used to store software programs and data.
  • the radio frequency circuit is mainly used for the conversion of baseband signal and radio frequency signal and the processing of radio frequency signal.
  • the antenna is mainly used to send and receive radio frequency signals in the form of electromagnetic waves.
  • Input and output devices such as touch screens, display screens, keyboards, etc., are mainly used to receive data input by users and output data to users.
  • the processor can read the software program in the storage unit, parse and execute the instructions of the software program, and process the data of the software program.
  • the processor performs baseband processing on the data to be sent, and then outputs the baseband signal to the radio frequency circuit.
  • the radio frequency circuit processes the baseband signal to obtain a radio frequency signal and sends the radio frequency signal through the antenna in the form of electromagnetic waves. .
  • the radio frequency circuit receives the radio frequency signal through the antenna, the radio frequency signal is further converted into a baseband signal, and the baseband signal is output to the processor, and the processor converts the baseband signal into data and performs processing on the data. deal with.
  • FIG. 14 only shows a memory and a processor. In actual electronic devices, there may be multiple processors and memories.
  • the memory may also be referred to as a storage medium or a storage device, etc., which is not limited in the embodiment of the present invention.
  • the processor may include a baseband processor and a central processing unit.
  • the baseband processor is mainly used to process communication protocols and communication data.
  • the central processing unit is mainly used to control the entire electronic device and execute Software program, processing the data of the software program.
  • the processor in FIG. 14 integrates the functions of the baseband processor and the central processing unit.
  • the baseband processor and the central processing unit may also be independent processors and are interconnected by technologies such as a bus.
  • the electronic device may include multiple baseband processors to adapt to different network standards, the electronic device may include multiple central processors to enhance its processing capability, and various components of the electronic device may be connected through various buses.
  • the baseband processor can also be expressed as a baseband processing circuit or a baseband processing chip.
  • the central processing unit can also be expressed as a central processing circuit or a central processing chip.
  • the function of processing the communication protocol and the communication data may be built in the processor, or stored in the storage unit in the form of a software program, and the processor executes the software program to realize the baseband processing function.
  • FIG. 15 shows another schematic structural diagram of the electronic device provided by this application.
  • the electronic device includes a middle frame 1210, function keys 1220, a display screen 1230, a socket 1240, a processor, and a system provided by the present application.
  • the system is stored in a memory, and the function keys 1220 and socket 1240 It is arranged on the middle frame 1210, and the display screen is arranged on one side of the middle frame 1210.
  • the electronic device 1200 may be a mobile phone.
  • first and second are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features.
  • the features defined with “first” and “second” may explicitly or implicitly include one or more of these features.
  • At least one refers to one or more, and “multiple” refers to two or more.
  • At least part of the element refers to part or all of the element.
  • And/or describes the association relationship of the associated object, indicating that there can be three relationships, for example, A and/or B, which can mean: A alone exists, A and B exist at the same time, and B exists alone, where A, B can be singular or plural.
  • the character “/” generally indicates that the associated objects before and after are in an "or” relationship.
  • the disclosed system, device, and method may be implemented in other ways.
  • the device embodiments described above are merely illustrative, for example, the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components may be combined or It can be integrated into another system, or some features can be ignored or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium.
  • the technical solution of the present application essentially or the part that contributes to the existing technology or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program code .

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)

Abstract

本申请提供了一种插件实现的系统和方法,系统包括插件模块和终端软件模块,在终端软件模块中不存在第一插件接口的业务实现的情况下,插件模块可以通过加载该第一插件接口的默认实现以完成针对该第一插件接口的调用。这样,不仅可以扩展插件以扩展终端的业务功能,而且,在插件接口与插件功能不一致的情况下,通过插件模块来实现插件接口的默认实现,使得开源软件模块能够正常运行,以尽可能保证电子设备的正常运行,使得开源软件模块不再依赖于终端软件模块,实现了终端软件模块与开源软件模块的解耦。

Description

插件实现的方法和插件实现的系统
本申请要求于2019年9月18日提交中国专利局、申请号为201910883745.X、申请名称为“插件实现的方法和插件实现的系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及电子设备领域,更具体地,涉及电子设备中的插件实现的方法和插件实现的系统。
背景技术
目前,电子设备主要应用两类操作系统,一类操作系统是开源操作系统,例如,安卓(android)操作系统,linux操作系统;另一类操作系统是闭源操作系统,例如,苹果公司的操作系统(iphone operation system,IOS)操作系统。对于开源操作系统,各个终端厂商都会基于开源操作系统做深度开发,增加插件,定制包括各种插件的终端软件,以扩展终端的业务功能。
为了便于描述,将开源操作系统记为开源软件。在定制终端软件的插件时,插件基于开源软件的代码编译开发,并且,为了能够在开源软件中调用终端软件的插件,同时,需要对开源软件的代码做相应改变,这就使得开源软件与终端软件之间相互依赖,无法实现开源软件与终端软件之间的解耦。
发明内容
本申请提供一种插件实现的系统和方法,该系统包括终端厂商为开源软件扩展的插件模块和终端软件模块,在终端软件模块中不存在第一插件接口的业务实现的情况下,插件模块可以通过加载该第一插件接口的默认实现以完成针对该第一插件接口的调用。这样,不仅可以扩展插件以扩展终端的业务功能,而且,在插件接口与插件功能不一致的情况下,通过插件模块来实现插件接口的默认实现,使得开源软件模块能够正常运行,以尽可能保证电子设备的正常运行,使得开源软件模块不再依赖于终端软件模块,实现了终端软件模块与开源软件模块的解耦。
第一方面,提供了一种插件实现的系统,所述系统包括插件模块和终端软件模块,所述插件模块包括第一插件接口的默认实现,所述终端软件模块不包括所述第一插件接口的业务实现,其中,所述插件模块用于:
获取第一指令,所述第一指令用于加载所述第一插件接口的业务实现;
根据所述第一指令,加载所述第一插件接口的默认实现。
因此,本申请提供的插件实现的系统,通过在系统中增加插件模块,在终端软件模块中不存在第一插件接口的业务实现的情况下,插件模块可以通过加载该第一插件接口的默 认实现以完成针对该第一插件接口的调用。这样,不仅可以扩展插件以扩展终端的业务功能,而且,在插件接口与插件功能不一致的情况下,通过插件模块来实现插件接口的默认实现,使得开源软件模块能够正常运行,以尽可能保证电子设备的正常运行,使得开源软件模块不再依赖于终端软件模块,实现了终端软件模块与开源软件模块的解耦。
可选地,所述插件模块具体用于:
根据所述第一指令,向所述终端软件模块发送调用所述第一插件接口的第二指令;
根据所述系统反馈的针对所述第二指令的第一反馈指令,加载所述第一插件接口的默认实现,所述第一反馈指令用于指示所述终端软件模块中不包括所述第一插件接口的业务实现。
因此,本申请提供的插件实现的系统,在终端软件模块中不存在第一插件接口的业务实现的情况下,插件模块可以通过系统反馈的反馈指令确定终端软件模块中不存在第一插件接口的业务实现,灵活地选择加载该第一插件接口的默认实现,使得开源软件模块能够正常运行,以尽可能保证电子设备的正常运行,使得开源软件模块不再依赖于终端软件模块,实现了终端软件模块与开源软件模块的解耦。
可选地,所述终端软件模块包括插件业务工厂,所述插件模块包括插件默认工厂,所述插件默认工厂包括所述第一插件接口,所述插件业务工厂继承有所述第一插件接口,所述终端软件模块继承有所述第一插件接口的默认实现;以及,
所述插件模块具体用于:根据所述第一指令,向所述终端软件模块发送调用所述第一插件接口的第二指令;
所述终端软件模块用于:根据所述第二指令,加载所述第一插件接口的默认实现。
因此,本申请提供的插件实现的系统,采用工厂模式,通过在终端软件模块中增加插件业务工厂以及在插件模块中增加插件默认工厂,终端软件模块可以继承该插件模块中第一插件接口的默认实现,这样,系统在查询是否存在该第一插件接口的业务实现时,可以仅查询且需要查询一次是否存在插件业务工厂,对于插件模块多次调用插件接口的情况,可以减少由于查询引起的时延,大大提高了系统性能。
可选地,所述系统还包括开源软件模块;以及,所述插件模块具体用于:
接收所述终端软件模块发送的第三指令,所述第三指令用于加载第一业务实现;
根据所述开源软件模块的当前版本,向所述开源软件模块发送第四指令,所述第四指令用于加载当前版本的开源软件模块中的第一业务实现。
因此,本申请提供的插件实现的系统,系统中增加了适配模块,在终端软件模块需要加载开源软件模块的业务实现时,适配模块可以基于开源软件模块的当前版本,向开源软件模块发送指令,以指示加载当前版本的开源软件模块中的业务实现。可以看出,该适配模块作为开源软件模块和终端软件模块之间的桥梁,屏蔽了开源软件模块的变化,可以在开源软件模块发生变化时,终端软件模块不发生变化,使得终端软件模块不依赖开源软件模块。
可选地,所述系统还包括开源软件模块;以及,所述终端软件模块的版本号为第一版本,所述开源软件模块的版本号为第二版本,所述第一版本与所述第二版本不同。
可选地,所述系统还包括开源软件模块,所述开源软件模块用于:
更改所述终端软件模块,更改后的所述终端软件模块的版本号是第三版本,所述第三 版本与所述第一版本不同。
可选地,所述终端软件模块包括第二插件接口的业务实现;以及,所述插件模块还用于:
获取第五指令,所述第五指令用于加载所述第二插件接口的业务实现;
根据所述第五指令,调用所述第二插件接口以加载所述第二插件接口的业务实现。
可选地,所述系统还包括开源软件模块;
所述开源软件模块用于:卸载所述终端软件模块;
所述插件模块用于:
获取第六指令,所述第六指令用于加载所述第一插件接口的业务实现;
根据所述第六指令,确定所述系统中未安装所述终端软件模块;
加载所述第一插件接口的默认实现。
因此,本申请提供的插件实现的系统,插件加载模块通过根据开源软件模块发送的用于加载插件接口的业务实现的指令,判断系统中是否安装有终端软件模块,可以有效地避免由于终端软件模块被卸载而导致的开源软件模块的不正常运行的情况,并且,在判断系统未安装有终端软件模块的情况下,插件加载模块加载插件接口的默认实现,使得开源软件模块可以正常运行,以实现电子设备的正常运行,使得开源软件模块不再依赖终端软件模块。
可选地,所述插件模块包括插件加载模块和插件默认实现模块,所述插件默认实现模块包括第一插件接口的默认实现;以及,
所述插件加载模块用于:
获取第一指令,所述第一指令用于加载所述第一插件接口的业务实现;
根据所述第一指令,加载所述插件默认模块中所述第一插件接口的默认实现。
可选地,所述第一插件接口是以下任一项:双卡管理接口、全网通接口、热插拔接口、天际通接口和5G通话接口。
第二方面,提供了一种插件实现的系统,所述系统包括开源软件模块、适配模块和终端软件模块,其中,
所述终端软件模块用于向所述适配模块发送第三指令,所述第三指令用于加载第一业务实现;
所述适配模块用于根据所述开源软件模块的当前版本,向所述开源软件模块发送第四指令,所述第四指令用于加载当前版本的开源软件模块中的第一业务实现。
第三方面,提供了一种插件实现的方法,应用于包括插件模块和终端软件模块的系统中,所述插件模块包括第一插件接口的默认实现,所述终端软件模块不包括所述第一插件接口的业务实现,所述方法包括:
所述插件模块获取第一指令,所述第一指令用于加载所述第一插件接口的业务实现;
所述插件模块根据所述第一指令,加载所述第一插件接口的默认实现。
可选地,所述插件模块根据所述第一指令,加载所述第一插件接口的默认实现,包括:
所述插件模块根据所述第一指令,向所述终端软件模块发送调用所述第一插件接口的第二指令;
所述插件模块根据所述系统反馈的针对所述第二指令的第一反馈指令,加载所述第一 插件接口的默认实现,所述第一反馈指令用于指示所述终端软件模块中不包括所述第一插件接口的业务实现。
可选地,所述终端软件模块包括插件业务工厂,所述插件模块包括插件默认工厂,所述插件默认工厂包括所述第一插件接口,所述插件业务工厂继承有所述第一插件接口,所述终端软件模块继承有所述第一插件接口的默认实现;以及,
所述插件模块根据所述第一指令,加载所述第一插件接口的默认实现,包括:
所述插件模块根据所述第一指令,向所述终端软件模块发送调用所述第一插件接口的第二指令;
所述终端软件模块根据所述第二指令,加载所述第一插件接口的默认实现。
可选地,所述系统还包括开源软件模块;以及,所述方法还包括:
所述插件模块接收所述终端软件模块发送的第三指令,所述第三指令用于加载第一业务实现;
所述插件模块根据所述开源软件模块的当前版本,向所述开源软件模块发送第四指令,所述第四指令用于加载当前版本的开源软件模块中的第一业务实现。
可选地,所述终端软件模块的版本号为第一版本,所述开源软件模块的版本号为第二版本,所述第一版本与所述第二版本不同。
可选地,所述方法还包括:
更改所述终端软件模块,更改后的终端软件模块的版本号是第三版本,所述第三版本与所述第一版本不同。
可选地,所述终端软件模块包括第二插件接口的业务实现;以及,所述方法包括:
所述插件模块获取第五指令,所述第五指令用于加载所述第二插件接口的业务实现;
所述插件模块根据所述第五指令,调用所述第二插件接口以加载所述第二插件接口的业务实现。
可选地,所述方法还包括:
卸载所述终端软件模块;
所述插件模块获取第六指令,所述第六指令用于加载所述第一插件接口的业务实现;
所述插件模块根据所述第六指令,确定所述系统中未安装所述终端软件模块;
所述插件模块加载所述第一插件接口的默认实现。
可选地,所述第一插件接口是以下任一项:双卡管理接口、全网通接口、热插拔接口、天际通接口和5G通话接口。
第四方面,提供了一种插件实现的方法,应用于包括开源软件模块、适配模块和终端软件模块的系统中,所述方法包括:
所述终端软件模块向所述适配模块发送第三指令,所述第三指令用于加载第一业务实现;
所述适配模块根据所述开源软件模块的当前版本,向所述开源软件模块发送第四指令,所述第四指令用于加载当前版本的开源软件模块中的第一业务实现。
第五方面,提供了一种计算机程序产品,所述计算机程序产品包括:计算机程序代码,所述计算程序代码包括上述第一方面和/或第二方面的系统。
第六方面,提供了一种计算机可读介质,用于存储计算机程序,该计算机程序包括上 述第一方面和/或第二方面的系统。
第七方面,提供了一种芯片,包括处理器,用于从存储器中调用并运行所述存储器中存储的上述第一方面和/或第二方面的系统。
第八方面,提供另一种芯片,包括:输入接口、输出接口、处理器和存储器,所述输入接口、输出接口、所述处理器以及所述存储器之间通过内部连接通路相连,所述处理器用于执行所述存储器中存储的上述第一方面和/或第二方面的系统。
第九方面,提供了一种电子设备,包括:显示屏和处理器,所述处理器与存储器耦合,所述存储器用于存储上述第一方面和/或第二方面的系统。
附图说明
图1至图4是本申请提供的插件实现的系统的示意性框图。
图5至图7是本申请提供的插件实现的方法的示意图流程图。
图8是本申请提供的插件实现的系统的另一示意性框图。
图9是本申请提供的插件实现的方法的另一示意图流程图。
图10至图12是本申请提供的插件实现的系统的另一示意性框图。
图13和图14是本申请提供的电子设备的示意性结构图。
图15是本申请提供的电子设备的另一示例性结构图。
具体实施方式
下面将结合附图,对本申请中的技术方案进行描述。
在现有技术中,开源软件与终端软件两者相互依赖,无法实现开源软件与终端软件之间的解耦,一个很明显的例子就是开源软件与终端软件的版本必须保持一致。示例性地,开源软件可以是安卓(android)软件,终端软件可以是华为基于安卓软件进行开发的情感化用户界面(emotion user interface,EMUI)软件,安卓软件和EMUI软件都是9.0版本。
以下,对现有技术的开源软件和终端软件的设计以及出现的问题说明。
在现有技术中,假设,终端厂商扩展3个插件,定义了3个插件接口,用于实现开源软件与终端软件之间的通信,终端软件中也必须安装与该3个插件接口对应的3个插件业务实现,实现该3种插件的插件功能,以保证插件接口与插件功能的一致性,才能保证开源软件的正常运行。例如,插件接口是5G通话接口,对应的插件功能则是5G通话功能。但是,终端厂商基于各种实际情况考虑,定义的插件接口与可实现的插件功能并不一致,这种情况会影响开源软件的正常运行,严重降低用户体验。
在第一种可能的场景中,为了减少耦合,实现开源软件和终端软件实现灵活组合,终端厂商想要为开源软件扩展具有差异化的多种终端软件,以适用不同的场景需求,例如,开源软件是版本3,被定义了5个插件接口,终端软件可以基于版本3的开源软件做深度开发,生成多种版本的终端软件,版本1的终端软件可以实现3个插件功能,版本2的终端软件可以实现4个插件功能,版本3的终端软件可以实现有5个插件功能。
在第二种可能的场景中,为了减少耦合,实现开源软件和终端软件实现灵活组合,,终端厂商想要一次性定义多个插件接口,以应对未来可能的用户需求,但是,基于当前的用户需求,并不需要当前的终端软件具有每个插件接口对应的插件功能,也就是说,终端 软件具有的插件功能与插件接口并不一致,后续,可以基于用户的实际需求,在终端软件慢慢增加可实现的插件功能。
在第三种可能的场景中,由于某些原因,例如,终端软件的某个插件的运行出现故障,需要卸载该插件的插件业务实现,以去掉该插件的插件功能,终端软件的代码会发生变化,在开源软件的代码不做适应性改变的情况下,会导致终端无法开机,或者,导致开源软件功能的异常,无法实现终端的正常使用,在现有技术中,为了保证终端的正常运行,必须对开源软件的代码做相应改变,例如,终端软件的版本回退,开源软件的版本也必须回退,终端软件的版本升级,开源软件的版本也必须升级,以保证插件接口与终端软件具备的插件功能的一致性,才能保证开源软件的正常运行。
总之,开源软件依赖终端软件,在终端软件具备的插件功能与终端厂商定义的插件接口不一致性的情况下,会严重影响开源软件的正常运行,影响电子设备的正常运行。基于此,本申请提供了一种插件实现的系统和方法,该系统包括终端厂商为开源软件扩展的插件模块,该插件模块中定义了一个或多个插件接口,可以提供插件接口的功能的缺省能力,开源软件可以通过该插件模块实现终端软件的插件功能,并且,在插件接口与插件功能不一致的情况下,可以通过插件模块提供的缺省能力,尽可能保证开源软件的正常运行,使得开源软件不依赖终端软件。其中,该插件模块包括插件加载模块和插件默认实现模块,插件默认实现模块包括与该至少一个插件接口一一对应的插件默认实现,插件加载模块可以基于开源软件发送的用于加载某个插件接口的业务实现的指令,判断终端软件中是否存在该插件接口的业务实现,若存在,则加载该插件接口的业务实现,若不存在,则加载该插件接口的默认实现。这样,不仅可以扩展插件以扩展终端的业务功能,而且,在插件接口与插件功能不一致的情况下,可以通过插件模块来实现插件接口的默认实现或业务实现,实现了开源软件的正常运行,以实现电子设备的正常运行。
可以理解的是,开源软件发送与某个插件接口相关的命令,无论通过插件模块实现的是该插件接口的默认实现还是业务实现,对于开源软件来说,看到的都是完成了针对该命令的事情,或者说,看到的都是完成了该插件接口的功能(虽然通过默认实现完成的并不是该插件接口的插件功能),所以,才可以实现开源软件的正常运行,实现电子设备的正常运行。
相比于现有技术来说,在第一种可能的场景中,本申请可以为同一个开源软件扩展具有差异化的多种版本的终端软件,实现插件接口与插件功能不一致的场景需求。在第二种可能的场景中,本申请可以一次性定义多个插件接口,基于用户需求多次增加对应的插件功能,以应对未来可能的用户需求。在第三种可能的场景中,本申请可以仅需要改变终端软件而不需要改变开源软件,示例性地,仅升级终端软件而不升级安卓软件。
图1是本申请提供的插件实现的系统的示意图。系统100包括开源软件模块110、插件模块120和终端软件模块130。其中,开源软件模块110包括开源系统源代码,例如,开源系统可以是android操作系统、linux操作系统。插件模块120的目的在于提供终端厂商扩展的插件接口的缺省能力,在终端软件模块130中无法实现该插件接口的实际功能的情况下,通过实现该插件接口的缺省能力,以尽可能保证系统的正常运行。终端软件模块130是由终端厂商定义的,基于开源软件开发的具有终端个性化风格的终端软件,可以实现终端厂商扩展的插件接口的实际功能。以下,对插件模块120的终端软件模块120的内 容做详细说明。
插件模块120中定义了M个插件的插件接口,用于实现安卓软件110与终端软件130之间的通信。插件模块120包括插件加载模块121和插件默认实现模块122。
插件默认实现模块122包括M个插件接口的默认实现,针对同一个插件接口,插件接口的默认实现与该插件接口的业务实现对应。插件接口的业务实现可以理解为该插件接口的真实实现,能够实现该插件接口的实际功能,插件接口的默认实现可以理解为该插件接口的虚假实现,在该插件接口的业务实现无法实现的情况下,退而求其次实现该插件接口的默认实现。或者,可以这么理解,插件接口的业务实现是该插件接口的默认实现的增强型功能。
可选地,该M个插件接口可以包括以下至少一项:双卡管理接口、全网通接口、热插拔接口、天际通接口和5G通话接口。
以下,结合插件接口,对插件接口的业务实现和默认实现分别做说明。
例如,若插件接口是5G通话接口,那么,5G通话接口的业务实现是5G通话功能,5G通话接口的默认实现可以是4G通话功能、3G通话功能或2G通话中的任一种。
再例如,若插件接口是双卡管理接口,那么,双卡管理接口的业务实现是双卡管理功能,双卡管理接口的默认实现可以是单卡管理功能。
再例如,若插件接口是热插拔接口,那么,热插拔接口的业务实现是热插拔功能,所谓的热插拔功能,就是外围设备与电子设备连接的情况下,可以在不需要重新开机的情况下,电子设备可以感知外围设备,以和外围设备传输信号,热插拔接口的默认实现就是在外围设备与电子设备连接的情况下,需要重新开机扫描外围设备才能感知外围设备。
再例如,若插件接口是全网通接口,那么,全网通接口的业务实现是全网通功能,所谓的全网通功能,就是电子设备可以支持各种运营商,用户从一个运营商切换至另一个运营商时,都可以和电子设备实现网络连接,全网通接口的默认实现可以是电子设备支持一个运营商,用户可以连接至该运营商提供的网络,但不可以连接至其他运营商提供的网络。
可选地,插件接口的默认实现可以是开源软件模块中固有的业务实现,也可以是空实现,也可以是终端厂商扩展的业务实现,本申请对此不做任何限定。以下,对这3种情况分别做说明。
例如,假设,开源软件模块110中固有4G通话功能,终端厂商想对该4G通话功能升级,扩展了5G通话功能,插件接口是5G通话接口,这种情况下,可以将开源软件模块110中固有的4G通话功能作为5G插件接口的默认实现。
再例如,假设,开源软件模块110中固有3G通话功能,终端厂商对该3G通话功能做了两次升级,分别实现4G通话功能和5G通话功能,此种情况下,可以将终端厂商扩展的4G通话功能作为5G通话接口的默认实现。
再例如,假设,终端厂商需要扩展一个插件接口的插件功能,开源软件模块110中并不存在该插件功能的低配版,例如,天际通功能,此种情况下,可以将空实现作为该插件接口的默认实现。
插件加载模块121可以基于开源软件模块110发送的用于调用某个插件接口的业务实现的指令,判断终端软件模块130中是否包括有该插件接口的业务实现,若终端软件模 块130中包括该插件接口的业务实现,则加载该插件接口的业务实现,若终端软件模块130中未包括该插件接口的业务实现,则加载该插件接口的默认实现。
终端软件模块130包括插件业务实现模块131,插件业务实现模块131包括N个插件接口的业务实现。以插件模块120中定义的M个插件接口包括全网通接口、热插拔接口、双卡管理接口以及插件模块120包括该3种插件接口的默认实现为例,对N个插件接口与M个插件接口的关系做解释。
可选地,该N个插件接口可以是终端厂商在插件模块120中定义的M个插件接口该M个插件接口,也就是说,终端软件模块130具备该M个插件接口的插件功能。例如,终端软件模块130具备全网通功能、热插拔功能和双卡管理功能。这种情况可以理解为插件接口与插件功能一致。
以下,是插件接口与插件功能不一致的情况。
可选地,该N个插件接口可以包括该M个插件接口中的一部分插件接口,也就是说,虽然终端厂商在插件模块120中定义了M个插件接口,但是,终端软件模块130具备该M个插件接口中一部分插件接口的插件功能。例如,终端软件模块130具备全网通功能、热插拔功能和双卡管理功能中的任一种插件功能,或,终端软件模块130具备网通功能、热插拔功能和双卡管理功能中任意两种插件功能。
可选地,该N个插件接口可以包括该M个插件接口中的一部分插件接口和其他插件接口,该其他插件接口不属于该M个插件接口。不过,在此种情况下,终端软件模块130也仅能实现该M个插件接口中的一部分插件接口的插件功能,该其他插件接口的功能暂时无法实现。例如,终端软件模块130具备全网通功能和5G通话功能,其中,5G通话功能对应的5G通话接口并不是定义在插件模块120的插件接口。
可选地,该N个插件接口可以包括该M个插件接口和其他插件接口,不过,在此种情况下,终端软件模块130也仅能实现该M个插件接口的插件功能,该其他插件接口的功能暂时无法实现。例如,终端软件模块130不仅具备全网通功能、热插拔功能、双卡管理功能和5G通话功能,其中,5G通话功能对应的5G通话接口并不是定义在插件模块120的插件接口。
示例性地,继续参考图2,插件业务实现模块131通过箭头指向插件默认实现模块122,表示的是插件接口的业务实现与对应的默认实现采用继承方式实现,默认实现是父类,业务实现是子类,这种设计可以始终保证插件接口对外的统一性,即,通过插件模块无论实现的是插件接口的默认实现,还是插件接口的业务实现,对于开源软件模块来说,始终看到的是终端厂商定义的M个插件接口。
图2至图4所示为本申请提供的插件实现的系统的另一示意图。应理解,图2至图4所示的系统仅为示意性说明,不应对本申请构成限定。
参考图2,图2可以对应插件接口与插件功能一致的情况。示例性地,插件模块120中定义了4个插件接口,对应地,插件加载模块121可以调用该4个插件接口,插件默认实现模块121中包括该4个插件接口的默认实现;终端软件模块130可实现该4个插件接口的插件功能,插件业务实现模块131中包括该4个插件接口的业务实现。示例性地,可以认为插件模块120的版本与终端软件模块130的版本一致,例如,都是3.0版本。
参考图3,图3可以对应插件接口与插件功能不一致的情况。示例性地,插件模块 120中定义了4个插件接口,对应地,插件加载模块121可以调用该4个插件接口,插件默认实现模块121中包括该4个插件接口的默认实现;终端软件模块130仅可实现该4个插件接口中3个插件接口的插件功能,插件业务实现模块131中包括3个插件接口的业务实现。后续,终端厂商可以基于实际需求,在终端软件模块130中安装剩余一个插件接口的业务实现。示例性地,实现中,可以认为插件模块120的版本号与终端软件模块130的版本号不同,例如,插件模块120是3.0版本,终端软件模块130是2.0版本。后续,可以基于实际需求,升级终端软件模块至3.0版本,增加插件模块120中剩余插件接口的业务实现,使得插件接口与插件功能保持一致。
应理解,现有技术是不可能存在图3所示的插件接口与插件功能不一致的情况,不然会导致开源软件模块无法运行,电子设备无法开机,或者,系统的功能严重异常,导致电子设备不可用。而在本申请中,插件接口和插件功能并不一致,体现的是两者的版本号的不一致,但是,并不影响开源软件模块以及电子设备的正常运行,由插件模块智能判断加载终端软件模块中的业务实现。
需要说明的是,在插件接口与插件功能不一致的情况中,也可以包括如下情况。例如,终端厂商在插件模块120中定义了3个插件接口,终端软件模块130的插件业务实现模块131中可以包括该3个插件接口的业务实现以及其他插件接口的业务实现,不过,电子设备当前也只能实现该3个插件接口的插件功能,无法实现其他插件接口的插件功能,后续,可以基于实际情况考虑,例如,在其他插件接口的插件功能比较稳定的情况下,可以在插件模块中增加其他插件接口,以实现其他插件接口的插件功能。示例性地,实现中,可以认为插件模块120的版本与终端软件模块130的版本不同,例如,插件模块是2.0版本,终端软件模块130是3.0版本,后续,插件模块120升级至3.0版本,保持与插件功能的一致性。
参考图4,在有些场景中,例如,终端软件模块130出现问题,运行不稳定,终端软件模块130会被卸载,此种情况中,系统100包括开源软件模块110和插件模块120,在没有终端软件模块130的情况下,可以加载插件模块120中的默认实现,实现开源软件模块110针对某个插件接口的功能的需求。
也应理解,现有技术也是不可能存在图4所示的仅具有插件接口而无终端软件模块的情况,不然会导致开源软件模块无法运行,电子设备无法开机,或者,系统的功能严重异常,导致电子设备不可用。而在本申请中,开源软件模块的运行不依赖终端软件模块,卸载终端软件模块后开源软件依然能正常运行。
以上,结合图1至图4对本申请提供的插件实现的系统做了详细描述。结合图5至图7,对本申请提供的插件实现的方法做详细说明。图5至图7对应的实施例涉及的各个模块可以对应图1中的各个模块。
下面,针对插件模块加载插件接口的默认实现和加载插件接口的业务实现的两种情况分别进行说明。
情况1(插件模块加载插件接口的默认实现)
该情况可以对应图5和图6所示的实施例。
为了便于描述,以终端厂商定义的M个插件接口中的第一插件接口为例,即,插件模块包括第一插件接口的默认实现,终端软件模块不包括该第一插件接口的业务实现为 例,对本申请进行说明。
应理解,插件模块中还可以包括其他的M-1个插件接口的默认实现。还应理解,终端软件模块不包括该第一插件接口的业务实现,可以包括其他插件接口的业务实现,该其他插件接口可以是该M-1个插件接口,也可以是该M-1个插件接口中的一部分插件接口,也可以是该M-1个插件接口的一部分插件接口和插件模块中不存在的插件接口,也可以是该M个插件接口与插件模块中不存在的插件接口,本申请不做任何限定。例如,第一插件接口可以是5G插件接口,其他插件接口可以是全网通接口、热插拔接口以及双卡管理接口中的至少一个。
在S201中,开源软件模块基于用户操作,生成第一指令,该第一指令用于加载所述第一插件接口的业务实现。
示例性地,用户操作可以是各种形式的操作,本申请不做任何限定。例如,用户操作可以用户在电子设备的显示屏上的点击操作或滑动操作等,也可以是用户的语音输入等。基于用户操作,开源软件模块生成对应该用户操作的第一指令,该第一指令用于加载该第一插件接口的业务实现,可以这么理解,通过用户操作,用户想要系统实现该第一插件接口的插件功能,以满足需求。
以打电话为例,用户通过拨号码以及点击呼叫键输入用户操作,开源软件模块基于该用户操作,知道用户想要打电话,而且,由于插件模块中定义有5G通话接口,优先考虑使用5G通话,因此,可以生成与5G通话功能相关的第一指令,第一插件接口是5G插件接口。该第一指令可以是用于实现5G通话功能的5G通话指令,也可以是用于实现通话功能的通话指令,若该第一指令是通话指令,插件加载模块基于该通话指令,优先调用5G通话接口。
在S210中,开源软件模块发送该第一指令。对应地,插件加载模块接收该第一指令。
在S220中,该插件加载模块根据该第一指令,加载该第一插件接口的默认实现。
可以理解,在插件业务实现模块中不包括第一插件接口的业务实现的情况下,插件加载模块无法加载该第一插件接口的业务实现,因此,在本申请中,可以加载插件默认实现模块中该第一插件接口的默认实现。
因此,本申请提供的插件实现的方法,在终端软件模块中不存在第一插件接口的业务实现的情况下,插件模块通过加载该第一插件接口的默认实现以完成针对该第一插件接口的调用。这样,不仅可以扩展插件以扩展终端的业务功能,而且,在插件接口与插件功能不一致的情况下,可以通过插件模块来实现插件接口的默认实现或业务实现,使得开源软件模块能够正常运行,以尽可能保证电子设备的正常运行,使得开源软件模块不再依赖于终端软件模块,实现了终端软件模块与开源软件模块的解耦。
示例性地,插件加载模块可以根据该第一指令,确定插件业务实现模块中不包括该第一插件接口的业务实现,进而,加载该第一插件接口的业务实现。
下面,参考图6,通过步骤S221、S222和S223对步骤S220进行说明。
在S221中,该插件加载模块根据该第一指令,向该插件业务实现模块发送调用该第一插件接口的第二指令。
插件加载模块可以根据该第一指令,确定开源软件模块想要调用该第一插件接口以实现该第一插件接口的插件功能。因此,插件加载模块可以通过第二指令调用该第一插件接 口,以便于加载该第一插件接口的业务实现,实现该第一插件接口的插件功能。
可选地,在插件加载模块向插件业务实现模块发送第二指令之前,插件加载模块可以向系统发送一个指令,以确定系统中是否安装有终端软件模块。这样,对于图4所示的终端软件模块被卸载的情况,通过该步骤可以有效地避免由于终端软件模块被卸载而导致的开源软件模块的不正常运行的情况。
示例性地,系统可以根据插件加载模块发送的该指令,判断系统中是否安装有终端软件模块,若系统中未安装有终端软件模块,则系统向插件加载模块发送一个反馈指令以指示系统中未安装终端软件模块,若系统中安装有终端软件模块,则插件加载模块在未收到系统发送的反馈指令的情况下,向插件业务实现模块发送调用第一插件接口的第二指令。
在S222中,该插件加载模块接收系统发送的针对该第二指令的第一反馈指令,该第一反馈指令用于指示该终端软件模块(插件业务实现模块)中不包括该第一插件接口的业务实现。
也就是说,系统可以判断插件业务实现模块中是否包括第一插件接口的业务实现,在不包括该第一插件接口的业务实现的情况下,向插件加载模块发送第一反馈指令,以使插件加载模块可以确定该插件业务实现模块中不包括该第一插件接口的业务实现。这样,插件加载模块可以加载该第一插件接口的默认实现。
在S223中,该插件加载模块根据该第一反馈指令,向插件默认实现模块发送第九指令,以加载该第一插件接口的默认实现。
以下,以第一插件接口是5G通话接口为例,结合情况1,对本申请实施例进一步做说明。
假设,插件模块中定义了5G通话接口,插件默认实现模块中包括5G通话接口的默认实现,该默认实现是4G通话功能,终端软件模块中的插件业务实现模块中不包括5G插件接口的业务实现,即,不具备5G通话功能。
1、用户通过拨号码以及点击呼叫键输入用户操作,开源软件模块基于该用户操作,生成第一指令,以及,发送该第一指令,可选地,该第一指令是通话指令。
2、插件加载模块根据该通话指令,知道用户想要打电话,而且,由于插件模块中定义有5G通话接口,优先考虑使用5G通话,向插件业务模块发送第二命令以调用5G通话接口,可以将该第二命令记为5G通话命令。
3、系统可以判断插件业务实现模块中不包括5G插件接口的业务实现,向插件加载模块发送第一反馈命令。
4、插件加载模块根据该第一反馈指令,加载5G通话接口的默认实现,即,实现4G通话功能。
可选地,当插件加载模块实现4G通话功能时,可以通过可能的方式提示用户,以告知用户目前实现的是4G通话功能,便于用户自主选择是否需要使用当前的4G通话功能。示例性地,该可能的方式可以是弹出界面窗口,或者,输出语音提示等。
情况2(插件模块加载插件接口的业务实现)
该情况可以对应图7所示的实施例。
为了便于描述,以终端厂商定义的M个插件接口中的第一插件接口为例,即,插件模块包括第一插件接口的默认实现,终端软件模块包括该第一插件接口的业务实现为例, 对本申请进行说明。应理解,插件模块也可以包括其他插件接口的默认实现,终端软件模块也可以包括其他插件接口的业务实现,本申请不做任何限定。
在S201中,开源软件模块基于用户操作,生成第一指令,该第一指令用于加载该第一插件接口的业务实现。
关于该步骤的描述可以参考情况1的步骤S201的相关描述,此处不再赘述。
在S210中,开源软件模块发送该第一指令。对应地,插件加载模块接收该第一指令。
在S230中,该插件加载模块根据该第一指令,加载该第一插件接口的业务实现。
可以理解,在插件业务实现模块中包括第一插件接口的业务实现的情况下,可以实现该第一插件接口的插件功能,即,插件加载模块可以加载该第一插件接口的业务实现。
可选地,在插件业务实现模块中包括该第一插件接口的业务实现的情况下,该插件加载模块根据该第一指令,加载该第一插件接口的业务实现,包括:
插件加载模块可以根据该第一指令,向该插件业务实现模块发送调用该第一插件接口的第二指令。
该插件业务实现模块可以基于该第二指令,加载该第一插件接口的业务实现。
可以这么理解,插件加载模块可以通过插件业务实现模块加载该第一插件接口的业务实现。
关于插件加载模块发送第二指令的描述可以参考情况1中步骤S221的相关描述,此处不再赘述。
可选地,插件业务实现模块向插件加载模块发送第二反馈指令,该第二反馈指令用于指示该插件加载模块成功调用该第一插件接口的业务实现。或者,该第二反馈指令也可以理解为用于指示该插件业务实现模块中包括该第一插件接口的业务实现。
以下,继续以第一插件接口是5G通话接口为例,结合情况2,对本申请实施例进一步做说明。
假设,插件模块中定义了5G通话接口,插件默认实现模块中包括5G通话接口的默认实现,该默认实现是4G通话功能,终端软件模块中的插件业务实现模块中包括5G插件接口的业务实现,即,具备5G通话功能。
1、用户通过拨号码以及点击呼叫键输入用户操作,开源软件模块基于该用户操作,生成第一指令,以及,发送该第一指令,可选地,该第一指令是通话指令。
2、插件加载模块根据该通话指令,知道用户想要打电话,而且,由于插件模块中定义有5G通话接口,优先考虑使用5G通话,向插件业务模块发送第二命令以调用5G通话接口,可以将该第二命令记为5G通话命令。
3、插件加载模块根据该5G通话命令,加载5G通话接口的业务实现,即,实现5G通话功能。
在本申请中,可以通过反射机制查询插件接口的业务实现是否存在,这个查询过程是比较耗时,性能开销较大在插件加载模块通过多个指令调用多个插件接口时,一个指令调用一个插件接口,通过反射机制确定查询插件接口的业务实现是否存在时,系统需要进行多次查询以确定是否存在插件接口的业务实现。假设,插件加载模块调用一个插件接口的指令,系统查询是否存在该插件接口的业务实现的过程需要0.1ms,若有10个调用插件接口的指令的话,仅查询过程就占用1ms,时延较长,影响系统性能。
基于此,本申请提出采用工厂模式,即,增加插件业务工厂,通过插件业务工厂可以减少系统的查询次数,以提高系统性能。例如,继续以上述10个指令为例,现有技术中需要查询10次,占用1ms,而在本申请中,通过采用插件业务工厂,可以仅查询一次,基于第一个指令查询是否存在插件业务工厂,由于已经确定是否存在插件业务工厂,对于后续的指令,可以不需要再次进行查询,大大减少了时延,提高了系统性能。以下,结合图8,对本申请提供的插件实现的系统做一描述,进一步,以图8所示的系统为例,结合图9,对本申请提供的插件实现的方法做描述。
图8所示为本申请提供的插件实现的系统的另一示意图。相比于图1至图4所示的系统,在图8的系统中,在插件模块120中增加了插件默认工厂123,在终端软件模块130中增加了插件业务工厂132。示例性地,插件业务工厂132和插件默认工厂123也采用了继承方式来实现,插件默认工厂123是父类,插件业务工厂132是子类,这种设计可以始终保证插件接口对外的统一性。
插件模块120定义了M个插件接口,插件默认工厂123中包括该M个插件接口,插件默认实现模块中包括该M个插件接口的默认实现。
终端软件模块130的插件业务实现模块131中可以包括N个插件接口的业务实现,其中,关于该N个插件接口与该M个插件接口的关系可以参考上文描述,此处不再赘述。当插件业务实现模块131中包括该M个插件接口的业务实现时,该插件业务工厂也包括该M个插件接口,可以实现每个插件接口的插件功能。当插件业务实现模块131中包括该M个插件接口的M1个插件接口的业务实现时,M1小于或等于N,插件业务实现模块131继承有该M个插件接口中M-M1个插件接口的默认实现,同时,插件业务工厂132继承有该M-M1个插件接口。也就是说,从最终结果来看,插件业务工厂132包括M个插件接口,插件业务实现模块131包括M1个插件接口的业务实现和M-M1个插件接口的默认实现。在插件加载模块看来,插件业务工厂132提供了M个插件接口,可以实现M个功能,至于该M个功能哪些是由默认实现完成还是业务实现完成,并不关心。所以,只要系统中安装有终端软件模块130,无论插件业务实现模块131中是否存在插件接口的业务实现,插件加载模块121都可以通过插件业务工厂132成功调用插件接口的业务实现或默认实现,只不过,在没有插件接口的业务实现的情况下,实现的是插件接口的默认实现,在有插件接口的业务实现且该插件接口属于该M个插件接口的情况下,实现的是该插件接口的业务实现。
示例性地,系统中可以包括多个插件业务工厂,每个插件业务工厂对应一种业务类型,将插件接口按照业务类型分类至不同的插件业务工厂中,对应地,插件默认工厂的类型与插件业务工厂的类型一一对应。假设,系统包括3个插件业务工厂和3个插件默认工厂,分别对应多媒体业务、短距离通信业务以及通讯业务,M个插件接口可以分为3类,对应多媒体业务的插件接口归属对应多媒体业务的插件默认工厂,对应短距离通信业务的插件接口归属对应短距离通信业务的插件默认工厂,对应通讯业务的插件接口归属对应通讯业务的插件默认工厂,对应多媒体业务的插件业务工厂继承对应多媒体业务的插件默认工厂的插件接口,对应短距离通信业务的插件业务工厂继承对应短距离通信业务的插件默认工厂的插件接口,对应通讯业务的插件业务工厂继承对应通讯业务的插件默认工厂的插件接口。
这样,通过采用工厂模式,可以实现插件接口的分类,同类使得代码逻辑更清晰。例如,所有的多媒体类型的插件接口,都放在多媒体类型的插件业务工厂。
应理解,上述图2至图4的场景也可以完全对应图8的系统,仅需要在图2至图4的插件模块中增加插件默认实现以及终端软件模块中增加插件业务工厂就行,为了简洁,此处不再赘述。
图9所示的是本申请提供的插件实现的方法的示意图。图9对应的实施例涉及的各个模块可以对应图8中的各个模块。
同理,为了便于描述,以终端厂商定义的M个插件接口中的第一插件接口为例,即,插件模块包括第一插件接口的默认实现,终端软件模块不包括该第一插件接口的业务实现为例,对本申请进行说明。应理解,插件模块也可以包括其他插件接口的默认实现,终端软件模块也可以包括其他插件接口的业务实现,本申请不做任何限定。
在该例子中,终端软件模块包括插件业务工厂,插件模块包括插件默认工厂,该插件默认工厂包括该第一插件接口,该插件业务工厂继承有该第一插件接口,该终端软件模块继承有该第一插件接口的默认实现。
在S201中,开源软件模块基于用户操作,生成第一指令,该第一指令用于加载所述第一插件接口的业务实现。
在S210中,开源软件模块发送该第一指令。对应地,插件加载模块接收该第一指令。
上述两个步骤的具体描述可以参考图5至图7对应的实施例中S201和S210的相关描述,此处不再赘述。
在S224中,插件加载模块根据该第一指令,向插件业务工厂发送调用该第一插件接口的第二指令。
插件加载模块可以根据该第一指令,确定开源软件模块想要调用该第一插件接口以实现该第一插件接口的插件功能。因此,插件加载模块可以通过第二指令调用该第一插件接口,以便于加载该第一插件接口的业务实现,实现该第一插件接口的插件功能。
可选地,在插件加载模块向插件业务实现模块发送第二指令之前,插件加载模块可以向系统发送一个指令,以确定系统中是否安装有终端软件模块。这样,对于终端软件模块被卸载的情况,通过该步骤可以有效地避免由于终端软件模块被卸载而导致的开源软件模块的不正常运行的情况。其中,关于该步骤的具体描述可以参考上文关于步骤S221的描述,不再赘述。
需要说明的是,若确定系统中安装有终端软件模块,对于有插件业务工厂以及插件默认工厂的系统,由于插件业务工厂继承了插件默认工厂的插件接口以及插件业务实现模块继承了插件默认实现模块的默认实现,可以不需要再判断终端软件模块中是否包括第一插件接口的业务实现,也不需要在没有第一插件接口的业务实现的情况下由系统发送反馈指令,只需要通过插件业务工厂自行判断需要加载第一插件接口的默认实现还是业务实现,无论加载哪种实现,都可以理解为实现了第一插件接口的功能。
在S225中,该插件业务工厂根据该第二指令,加载该第一插件接口的默认实现。
由于插件业务实现模块中不包括该第一插件接口的业务实现,但是继承了插件默认实现模块中该第一插件接口的默认实现,该插件业务实现模块中存在该第一插件接口的默认实现,所以,该插件业务工厂根据该第二指令,加载该第一插件接口的默认实现就行。
因此,本申请提供的插件实现的方法,采用工厂模式,通过在终端软件模块中增加插件业务工厂以及在插件模块中增加插件默认工厂,终端软件模块可以继承该插件模块中第一插件接口的默认实现,这样,系统在查询是否存在该第一插件接口的业务实现时,可以仅查询且需要查询一次是否存在插件业务工厂,对于插件模块多次调用插件接口的情况,可以减少由于查询引起的时延,大大提高了系统性能。
可以看出,无论插件业务实现模块中是否包括某个插件接口的业务实现,插件加载模块通过插件业务工厂加载的是插件接口的业务实现还是默认实现,都认为插件加载模块成功调用了插件接口的功能。
以下,通过开源软件模块、插件模块以及终端软件模块的版本号,说明本申请提供的方案可以实现开源软件模块与终端软件模块的解耦,使得开源软件模块不依赖终端软件模块。
在本申请中,针对插件接口与插件功能不一致的情况,以版本号为例对本申请进行说明。
可选地,该终端软件模块的版本号为第一版本,该开源软件模块的版本号为第二版本,该第一版本与该第二版本不同。
例如,第一版本为2.0版本,第二版本为3.0版本。
可选地,该方法还包括:
更改该终端软件模块,更改后的该终端软件模块的版本号为第三版本,该第三版本与该第一版本不同。
示例性地,更改后的终端软件模块可以是以下任一种情况:增加了插件接口的业务实现的数量;减少了插件接口的业务实现的数量;对于原有的插件接口的业务实现做升级优化了原有的插件接口的业务实现,例如,原有的插件接口的业务实现的功能是支持标清视频播放,更改后的插件接口的业务实现的功能是支持高清视频播放。
示例性地,更改终端软件模块可以是升级或回退该终端软件模块,可以是用户卸载一个终端软件模块后再重新安装另一个终端软件模块,本申请不做任何限定,只要是对终端软件模块做修改即可。
示例性地,未更改前的终端软件模块具备的插件功能与插件接口并不一致,终端软件模块与开源软件模块的版本号不一致,基于本申请,终端软件模块的变化不影响开源软件模块,可以仅更改终端软件模块,不改变开源软件模块,更改后的该终端软件模块的版本号为第三版本。
在终端软件模块具备的插件功能与定义的插件接口一致时,终端软件模块的版本号与插件模块的版本号相同。例如,更改后的该终端软件模块的版本号与插件模块的版本号都是3.0版本。
示例性地,插件模块的版本号与开源软件模块的版本号相同。
基于此,在终端软件模块具备的插件功能与定义的插件接口一致,终端软件模块的版本号与插件模块的版本号相同时,开源软件模块、插件模块以及终端软件模块的版本号都相同。
如前所述,例如图4,在有些场景中,终端软件模块会被卸载,此种情况中,系统包括开源软件模块110和插件模块120,在没有终端软件模块130的情况下,可以加载插件 模块120中的默认实现,实现开源软件针对某个插件接口的功能的需求。以下,示例性地说明在卸载终端软件模块的场景中,加载插件模块120中的默认实现的方式。
可选地,该方法还包括:
卸载该终端软件模块;
该开源软件模块向该插件加载模块发送第六指令,该第六指令用于加载该第一插件接口的业务实现;
该插件加载模块根据该第六指令,确定该系统中未安装该终端软件模块;
该插件加载模块加载该第一插件接口的默认实现。
也就是说,插件加载模块可以根据开源软件模块发送的用于加载第一插件接口的业务实现的第六指令,确定系统中是否安装有该终端软件模块,在未安装的情况下,加载该第一插件接口的默认实现,当然,在安装的情况下,插件加载模块会发送调用该第一插件接口的指令。
示例性地,插件加载模块可以向系统发送一个指令,系统可以根据插件加载模块发送的该指令,判断系统中是否安装有终端软件模块,若系统中未安装有终端软件模块,则系统向插件加载模块发送一个反馈指令以指示系统中未安装终端软件模块,若系统中安装有终端软件模块,则插件加载模块在未收到系统发送的反馈指令的情况下,向插件业务实现模块发送调用第一插件接口的指令。
因此,本申请提供的插件实现的方法,插件加载模块通过根据开源软件模块发送的用于加载插件接口的业务实现的指令,判断系统中是否安装有终端软件模块,可以有效地避免由于终端软件模块被卸载而导致的开源软件模块的不正常运行的情况,并且,在判断系统未安装有终端软件模块的情况下,插件加载模块加载插件接口的默认实现,使得开源软件模块可以正常运行,以实现电子设备的正常运行,使得开源软件模块不再依赖终端软件模块。
在上述实施例中,通过提供的插件模块的插件加载模块和插件默认实现模块,插件加载模块可以判断终端软件模块中是否某个插件接口的业务实现,若存在,则加载该插件接口的业务实现,若不存在,则加载该插件接口的默认实现。这样,不仅可以扩展插件以扩展终端的业务功能,而且,在插件接口与插件功能不一致的情况下,可以通过插件模块实现插件接口的默认实现或业务实现,实现了开源软件的正常运行,以实现电子设备的正常运行,使得开源软件模块不再依赖终端软件模块。
反过来说,由于终端软件模块是基于开源软件模块做深度开发定制的,所以,开源软件模块的代码发生变化,终端软件模块的代码也必须发生变化。例如,开源软件模块的版本升级,终端软件模块的版本也必须升级,开源软件模块的版本回退,终端软件模块的版本也必须回退。也就是说,终端软件模块依赖开源软件模块。
基于此,本申请提出可以采用适配模块,作为开源软件模块和终端软件模块之间的桥梁,以屏蔽开源软件模块的变化,在开源软件模块发生变化时,终端软件模块不发生变化,使得终端软件模块不依赖开源软件模块。
由于涉及的是开源软件模块与终端软件模块之间的交互,作为中间桥梁的适配模块,软件设计时,需要将开源软件模块中与终端软件的插件功能相关的功能做适配,为了便于描述,将开源软件模块中与终端软件的插件功能相关的功能记为相关功能,使相关功能不 发生变化,对于终端软件模块来说,仅知道开源软件模块提供了这些相关功能,至于实现这些相关功能的代码是否发生变化,终端软件模块并不感知,这样,通过适配模块屏蔽了开源软件模块对终端软件模块的变化。并且,若开源软件模块中的相关功能发生变化,可以在适配模块内兼容多版本的相关功能。以图片刷新功能为例,版本1对应函数1,版本2对应函数2,适配模块可以基于开源软件模块的当前版本,加载开源软件模块的业务实现(或者,功能模块)。
示例性地,在开源软件模块是安卓软件模块时,适配模块也可以称为安卓开放源代码项目(android open-source project,AOSP)适配模块。
应理解,适配模块用于终端软件模块加载开源软件模块中的业务实现,上述实施例的插件加载模块和插件默认实现模块用于开源软件模块加载终端软件模块的业务实现,两者结合,就可以实现开源软件模块与终端软件模块互相加载业务实现的事情。可以这么理解,当用户想要系统实现一些功能,但是,开源软件模块无法完成,这种情况下,需要终端软件模块的配合,就可以通过插件加载模块和插件默认实现模块加载终端软件模块的业务实现;当有些功能是开源软件模块本身固有的,不需要终端软件模块自己开发,这种情况下,可以通过适配模块加载开源软件模块的业务实现。
图10和图11所示为本申请提供的插件实现的系统的另一示意图。图10对应图1,在图1所示的系统中增加了适配模块,图11对应图8,在图8所示的系统中增加了适配模块124。在图10和图11中,当终端软件模块130需要加载开源软件模块110的业务实现时,通过适配模块124加载开源软件模块110的业务实现,当插件接口的默认实现是开源软件模块110内固有的业务实现时,可以通过适配模块124加载开源软件模块110的业务实现。
图12所示为本申请提供的插件实现的系统的再一示意图。在图12所示的系统200中,可以不需要插件加载模块和插件默认实现模块,包括开源软件模块210、适配模块220和终端软件模块230,其中,终端软件模块230中包括具有多个插件接口的业务实现的插件业务实现模块,当终端软件模块230需要加载开源软件模块210的业务实现时,通过适配模块220加载开源软件模块210的业务实现。可以这么理解,相比于现有技术,图12所示的系统200增加了适配模块220,在开源软件模块210发生变化时,终端软件模块230不发生变化,使得终端软件模块230不依赖开源软件模块210。
以下,对终端软件模块通过适配模块加载开源软件模块的业务实现的过程做说明。应理解,下述实施例的终端软件模块、适配模块以及开源软件模块可以是图10至12对应的各个模块。
可选地,该方法还包括:
该终端软件模块向该适配模块发送第三指令,该第三指令用于指示加载第一业务实现;
该适配模块根据该开源软件模块的当前版本,向该开源软件模块发送第四指令,该第四指令用于加载当前版本的开源软件模块中的第一业务实现。
在该过程中,可以具体由终端软件模块的插件业务实现模块发送该第四指令,以加载开源软件模块中的第一业务实现,适配模块接收到该第三指令后,可以判断当前版本的开源软件模块的版本号,在确定当前版本的开源软件模块的版本号后,通过第四指令指示加 载当前版本的开源软件模块中的第一业务实现。
下面,继续以5G通话为例,结合插件加载模块和适配模块,说明开源软件模块与终端软件模块之间相互加载对方的业务实现的过程。
1、用户通过拨号码以及点击呼叫键输入用户操作,开源软件模块基于该用户操作,生成第一指令,以及,发送该第一指令,可选地,该第一指令是通话指令。
2、插件加载模块根据该通话指令,优先考虑使用5G通话,向插件业务实现模块发送第二命令以调用5G通话接口,可以将该第二命令记为5G通话命令。
3、插件加载模块根据该5G通话命令,加载5G通话接口的业务实现,即,实现5G通话功能。
4、在实现5G通话过程中,或者,在加载5G通话接口的业务实现的过程中,需要使用声音播放功能,由于该功能是开源软件模块固有的业务实现,因此,可以加载开源软件模块中的声音播放功能。基于此,插件业务实现模块可以向适配模块发送第三指令,以指示加载开源软件模块中的声音播放功能,适配模确定该开源软件模块的当前版本为版本3,则根据开源软件模块的3.0版本,向该开源软件模块发送第四指令,以指示加载3.0版本的开源软件模块的声音播放功能。
应理解,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
相应于上述方法实施例给出的方法,本申请实施例还提供了相应的电子设备,所述电子设备包括用于执行上述实施例相应的模块。所述模块可以是软件,也可以是硬件,或者是软件和硬件结合。
图13给出了一种电子设备的示意图结构图。所述电子设备1000可以是包括有本申请提供的系统的任一种可能的电子设备。在一些实施例中,电子设备可以是还包含其它功能诸如个人数字助理和/或音乐播放器功能的便携式电子设备,诸如手机、平板电脑、具备无线通讯功能的可穿戴电子设备(如智能手表)等。上述便携式电子设备也可以是其它便携式电子设备,诸如膝上型计算机(Laptop)等。还应当理解的是,在其他一些实施例中,上述电子设备也可以不是便携式电子设备,而是台式计算机。
所述电子设备1000可以包括一个或多个处理器1001,所述处理器1001也可以称为处理单元,可以实现一定的控制功能。所述处理器1001可以是通用处理器或者专用处理器等。例如可以是基带处理器或中央处理器。基带处理器可以用于对通信协议以及通信数据进行处理,中央处理器可以用于对电子设备进行控制,执行软件程序,处理软件程序的数据。
在一种可选的设计中,处理器1001也可以存有指令和/或数据1003,所述指令和/或数据1003可以被所述处理器运行,使得所述电子设备1000执行上述方法实施例中描述的方法。
在另一种可选的设计中,处理器1001中可以包括用于实现接收和发送功能的收发单元。例如该收发单元可以是收发电路,或者是接口,或者是接口电路。用于实现接收和发送功能的收发电路、接口或接口电路可以是分开的,也可以集成在一起。上述收发电路、接口或接口电路可以用于代码/数据的读写,或者,上述收发电路、接口或接口电路可以用于信号的传输或传递。
在又一种可能的设计中,电子设备1000可以包括电路,所述电路可以实现前述方法实施例中发送或接收或者通信的功能。
可选的,所述电子设备1000中可以包括一个或多个存储器1002,其上可以存有指令1004,所述指令可在所述处理器上被运行,使得所述电子设备1000执行上述方法实施例中描述的方法。可选的,所述存储器中还可以存储有数据。可选的,处理器中也可以存储指令和/或数据。所述处理器和存储器可以单独设置,也可以集成在一起。例如,上述方法实施例中所描述的对应关系可以存储在存储器中,或者存储在处理器中。
可选的,所述电子设备1000还可以包括收发器1005和/或天线1006。所述处理器1001可以称为处理单元,对所述电子设备1000进行控制。所述收发器1005可以称为收发单元、收发机、收发电路或者收发器等,用于实现收发功能。
本申请实施例中的电子设备1000可以用于执行本申请实施例中图5、图6、图7以及图9描述的方法也可以用于执行上述两个图或更多个图中描述的方法相互结合的方法。
在一种可能的设计中,一种电子设备1000可包括:处理器1001。电子设备1000用于执行上述方法200中各个模块对应的各个流程和步骤。具体描述可以参考上述实施例的描述,为了简洁,此处不再赘述。
图14提供了一种电子设备的示意图结构图。为了便于说明,图14仅示出了电子设备的主要部件。如图14所示,电子设备1100包括处理器、存储器、控制电路、天线以及输入输出装置。处理器主要用于对通信协议以及通信数据进行处理,以及对整个终端进行控制,执行软件程序,处理软件程序的数据。存储器主要用于存储软件程序和数据。射频电路主要用于基带信号与射频信号的转换以及对射频信号的处理。天线主要用于收发电磁波形式的射频信号。输入输出装置,例如触摸屏、显示屏,键盘等主要用于接收用户输入的数据以及对用户输出数据。
当电子设备开机后,处理器可以读取存储单元中的软件程序,解析并执行软件程序的指令,处理软件程序的数据。当需要通过无线发送数据时,处理器对待发送的数据进行基带处理后,输出基带信号至射频电路,射频电路将基带信号进行处理后得到射频信号并将射频信号通过天线以电磁波的形式向外发送。当有数据发送到电子设备时,射频电路通过天线接收到射频信号,该射频信号被进一步转换为基带信号,并将基带信号输出至处理器,处理器将基带信号转换为数据并对该数据进行处理。
为了便于说明,图14仅示出了一个存储器和处理器。在实际的电子设备中,可以存在多个处理器和存储器。存储器也可以称为存储介质或者存储设备等,本发明实施例对此不做限制。
作为一种可选的实现方式,处理器可以包括基带处理器和中央处理器,基带处理器主要用于对通信协议以及通信数据进行处理,中央处理器主要用于对整个电子设备进行控制,执行软件程序,处理软件程序的数据。图14中的处理器集成了基带处理器和中央处理器的功能,本领域技术人员可以理解,基带处理器和中央处理器也可以是各自独立的处理器,通过总线等技术互联。本领域技术人员可以理解,电子设备可以包括多个基带处理器以适应不同的网络制式,电子设备可以包括多个中央处理器以 增强其处理能力,电子设备的各个部件可以通过各种总线连接。所述基带处理器也可以表述为基带处理电路或者基带处理芯片。所述中央处理器也可以表述为中央处理电路或者中央处理芯片。对通信协议以及通信数据进行处理的功能可以内置在处理器中,也可以以软件程序的形式存储在存储单元中,由处理器执行软件程序以实现基带处理功能。
图15所示为本申请提供的电子设备的另一示意性结构图。如图15所示,电子设备包括中框1210、功能键1220、显示屏1230、插口1240、处理器以及本申请提供的系统,示例性地,该系统存储于存储器中,功能键1220和插口1240设置在中框1210上,显示屏设置在中框1210的一侧。示例性地,电子设备1200可以是手机。
需要说明的是,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。
在本申请实施例中,“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“元件的至少部分”是指元件的部分或全部。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A、B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计 算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。

Claims (21)

  1. 一种插件实现的系统,其特征在于,所述系统包括插件模块和终端软件模块,所述插件模块包括第一插件接口的默认实现,所述终端软件模块不包括所述第一插件接口的业务实现,其中,所述插件模块用于:
    获取第一指令,所述第一指令用于加载所述第一插件接口的业务实现;
    根据所述第一指令,加载所述第一插件接口的默认实现。
  2. 根据权利要求1所述的系统,其特征在于,所述插件模块具体用于:
    根据所述第一指令,向所述终端软件模块发送调用所述第一插件接口的第二指令;
    根据所述系统反馈的针对所述第二指令的第一反馈指令,加载所述第一插件接口的默认实现,所述第一反馈指令用于指示所述终端软件模块中不包括所述第一插件接口的业务实现。
  3. 根据权利要求1所述的系统,其特征在于,所述终端软件模块包括插件业务工厂,所述插件模块包括插件默认工厂,所述插件默认工厂包括所述第一插件接口,所述插件业务工厂继承有所述第一插件接口,所述终端软件模块继承有所述第一插件接口的默认实现;以及,
    所述插件模块具体用于:根据所述第一指令,向所述终端软件模块发送调用所述第一插件接口的第二指令;
    所述终端软件模块用于:根据所述第二指令,加载所述第一插件接口的默认实现。
  4. 根据权利要求1至3中任一项所述的系统,其特征在于,所述系统还包括开源软件模块;以及,所述插件模块具体用于:
    接收所述终端软件模块发送的第三指令,所述第三指令用于加载第一业务实现;
    根据所述开源软件模块的当前版本,向所述开源软件模块发送第四指令,所述第四指令用于加载当前版本的开源软件模块中的第一业务实现。
  5. 根据权利要求1至4中任一项所述的系统,其特征在于,所述系统还包括开源软件模块;以及,所述终端软件模块的版本号为第一版本,所述开源软件模块的版本号为第二版本,所述第一版本与所述第二版本不同。
  6. 根据权利要求5所述的系统,其特征在于,所述系统还包括开源软件模块,所述开源软件模块用于:
    更改所述终端软件模块,更改后的所述终端软件模块的版本号是第三版本,所述第三版本与所述第一版本不同。
  7. 根据权利要求1至6中任一项所述的系统,其特征在于,所述终端软件模块包括第二插件接口的业务实现;以及,所述插件模块还用于:
    获取第五指令,所述第五指令用于加载所述第二插件接口的业务实现;
    根据所述第五指令,调用所述第二插件接口以加载所述第二插件接口的业务实现。
  8. 根据权利要求1至7中任一项所述的系统,其特征在于,所述系统还包括开源软件模块;
    所述开源软件模块用于:卸载所述终端软件模块;
    所述插件模块用于:
    获取第六指令,所述第六指令用于加载所述第一插件接口的业务实现;
    根据所述第六指令,确定所述系统中未安装所述终端软件模块;
    加载所述第一插件接口的默认实现。
  9. 根据权利要求1至8中任一项所述的系统,其特征在于,所述插件模块包括插件加载模块和插件默认实现模块,所述插件默认实现模块包括第一插件接口的默认实现;以及,
    所述插件加载模块用于:
    获取第一指令,所述第一指令用于加载所述第一插件接口的业务实现;
    根据所述第一指令,加载所述插件默认模块中所述第一插件接口的默认实现。
  10. 根据权利要求1至9中任一项所述的方法,其特征在于,所述第一插件接口是以下任一项:双卡管理接口、全网通接口、热插拔接口、天际通接口和5G通话接口。
  11. 一种插件实现的方法,其特征在于,应用于包括插件模块和终端软件模块的系统中,所述插件模块包括第一插件接口的默认实现,所述终端软件模块不包括所述第一插件接口的业务实现,所述方法包括:
    所述插件模块获取第一指令,所述第一指令用于加载所述第一插件接口的业务实现;
    所述插件模块根据所述第一指令,加载所述第一插件接口的默认实现。
  12. 根据权利要求11所述的方法,其特征在于,所述插件模块根据所述第一指令,加载所述第一插件接口的默认实现,包括:
    所述插件模块根据所述第一指令,向所述终端软件模块发送调用所述第一插件接口的第二指令;
    所述插件模块根据所述系统反馈的针对所述第二指令的第一反馈指令,加载所述第一插件接口的默认实现,所述第一反馈指令用于指示所述终端软件模块中不包括所述第一插件接口的业务实现。
  13. 根据权利要求11所述的方法,其特征在于,所述终端软件模块包括插件业务工厂,所述插件模块包括插件默认工厂,所述插件默认工厂包括所述第一插件接口,所述插件业务工厂继承有所述第一插件接口,所述终端软件模块继承有所述第一插件接口的默认实现;以及,
    所述插件模块根据所述第一指令,加载所述第一插件接口的默认实现,包括:
    所述插件模块根据所述第一指令,向所述终端软件模块发送调用所述第一插件接口的第二指令;
    所述终端软件模块根据所述第二指令,加载所述第一插件接口的默认实现。
  14. 根据权利要求11至13中任一项所述的方法,其特征在于,所述系统还包括开源软件模块;以及,所述方法还包括:
    所述插件模块接收所述终端软件模块发送的第三指令,所述第三指令用于加载第一业务实现;
    所述插件模块根据所述开源软件模块的当前版本,向所述开源软件模块发送第四指令,所述第四指令用于加载当前版本的开源软件模块中的第一业务实现。
  15. 根据权利要求11至14中任一项所述的方法,其特征在于,所述终端软件模块的 版本号为第一版本,所述开源软件模块的版本号为第二版本,所述第一版本与所述第二版本不同。
  16. 根据权利要求15所述的方法,其特征在于,所述方法还包括:
    更改所述终端软件模块,更改后的终端软件模块的版本号是第三版本,所述第三版本与所述第一版本不同。
  17. 根据权利要求11至16中任一项所述的方法,其特征在于,所述终端软件模块包括第二插件接口的业务实现;以及,所述方法包括:
    所述插件模块获取第五指令,所述第五指令用于加载所述第二插件接口的业务实现;
    所述插件模块根据所述第五指令,调用所述第二插件接口以加载所述第二插件接口的业务实现。
  18. 根据权利要求11至17中任一项所述的方法,其特征在于,所述方法还包括:
    卸载所述终端软件模块;
    所述插件模块获取第六指令,所述第六指令用于加载所述第一插件接口的业务实现;
    所述插件模块根据所述第六指令,确定所述系统中未安装所述终端软件模块;
    所述插件模块加载所述第一插件接口的默认实现。
  19. 根据权利要求11至18中任一项所述的方法,其特征在于,所述第一插件接口是以下任一项:双卡管理接口、全网通接口、热插拔接口、天际通接口和5G通话接口。
  20. 一种电子设备,其特征在于,所述电子设备包括显示屏和如权利要求1至10中任一项所述的系统。
  21. 一种芯片,其特征在于,包括处理器,用于从存储器中调用并运行所述存储器中存储的指令,使得安装有所述芯片的电子设备执行如权利要求11至19中任一项所述的方法。
PCT/CN2020/107681 2019-09-18 2020-08-07 插件实现的方法和插件实现的系统 WO2021052054A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP20864942.6A EP4024207A4 (en) 2019-09-18 2020-08-07 EXTENSION IMPLEMENTATION METHOD AND EXTENSION IMPLEMENTATION SYSTEM
US17/697,498 US11880695B2 (en) 2019-09-18 2022-03-17 Plug-in implementation method and plug-in implementation system

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910883745.X 2019-09-18
CN201910883745.XA CN110764836B (zh) 2019-09-18 2019-09-18 插件实现的方法和插件实现的系统

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/697,498 Continuation US11880695B2 (en) 2019-09-18 2022-03-17 Plug-in implementation method and plug-in implementation system

Publications (1)

Publication Number Publication Date
WO2021052054A1 true WO2021052054A1 (zh) 2021-03-25

Family

ID=69330121

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/107681 WO2021052054A1 (zh) 2019-09-18 2020-08-07 插件实现的方法和插件实现的系统

Country Status (4)

Country Link
US (1) US11880695B2 (zh)
EP (1) EP4024207A4 (zh)
CN (2) CN112181514B (zh)
WO (1) WO2021052054A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117707614A (zh) * 2024-02-01 2024-03-15 浙商银行股份有限公司 基于Maven插件的工程依赖组件监测方法及装置

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112181514B (zh) 2019-09-18 2021-08-20 华为技术有限公司 插件实现的方法和插件实现的系统
CN111475227B (zh) * 2020-04-02 2022-02-01 深圳创维-Rgb电子有限公司 业务插件加载实现方法、装置和终端设备

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110185340A1 (en) * 2010-01-27 2011-07-28 Oracle International Corporation Software modeling framework
CN103365644A (zh) * 2012-04-10 2013-10-23 腾讯科技(深圳)有限公司 一种扩展软件功能的方法及装置
CN105955787A (zh) * 2016-05-18 2016-09-21 深圳市掌玩网络技术有限公司 一种用于Android系统的插件加载方法及装置
CN107870787A (zh) * 2016-09-26 2018-04-03 平安科技(深圳)有限公司 应用程序插件化加载方法及系统
CN109840079A (zh) * 2019-01-02 2019-06-04 郑州云海信息技术有限公司 一种智能开源云开发平台及方法
CN110413259A (zh) * 2018-04-28 2019-11-05 中兴通讯股份有限公司 Android服务框架、实现扩展服务的方法及装置
CN110764836A (zh) * 2019-09-18 2020-02-07 华为技术有限公司 插件实现的方法和插件实现的系统
CN111596967A (zh) * 2020-04-27 2020-08-28 中国银联股份有限公司 应用功能配置方法、终端设备、服务器及存储介质

Family Cites Families (31)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7240323B1 (en) * 2001-07-26 2007-07-03 Emc Corporation Plug and play interface for user actions
US20050132352A1 (en) * 2003-12-11 2005-06-16 Konica Minolta Business Technologies, Inc. Installation of hardware devices
US20060041665A1 (en) * 2004-05-27 2006-02-23 Karnik Neeran M Network services applications
US8661420B2 (en) * 2004-08-03 2014-02-25 Oracle International Corporation System and method for runtime interface versioning
US8010636B2 (en) * 2008-12-02 2011-08-30 Verizon Patent And Licensing Inc. Generic broadband application and plug-ins
TWI374637B (en) * 2008-12-31 2012-10-11 Ind Tech Res Inst Information transmission and service integration system and method thereof
CN101937353B (zh) * 2010-09-20 2014-11-05 中兴通讯股份有限公司 一种插件部署和加载的方法及装置
US20130198606A1 (en) * 2012-01-30 2013-08-01 Microsoft Corporation Software application distribution in documents
CN103425517B (zh) * 2012-05-14 2017-03-29 中兴通讯股份有限公司 扩展软件功能的方法、上层软件客户端及拉远功能服务器
CN103309674B (zh) * 2013-06-25 2016-08-10 深圳中兴网信科技有限公司 一种软件架构系统
CN104601651A (zh) * 2014-11-18 2015-05-06 浪潮(北京)电子信息产业有限公司 NaaS的多级插件系统
CN105373396B (zh) * 2015-08-14 2018-01-05 腾讯科技(深圳)有限公司 插件平台中的插件更新加载方法和装置
US20170168807A1 (en) * 2015-12-14 2017-06-15 Le Holdings (Beijing) Co., Ltd. Method and electronic device for updating application program
CN105389222B (zh) * 2015-12-15 2018-12-21 中国科学院声学研究所 一种动态调用原生接口的方法、装置和系统
CN106909408B (zh) * 2015-12-23 2020-09-11 北京奇虎科技有限公司 一种调用应用程序的apk插件的方法及装置
FI20165019A (fi) * 2016-01-13 2017-07-14 Valmet Automation Oy Toiminnon suorittaminen palveluun teollisessa automaatiojärjestelmässä
CN105912366B (zh) * 2016-04-14 2019-07-05 广州久邦世纪科技有限公司 一种桌面应用程序插件化的实现方法
CN106126299B (zh) * 2016-06-30 2020-03-03 百度在线网络技术(北京)有限公司 业务插件的处理方法及装置
CN106569794B (zh) * 2016-09-23 2020-03-24 北京五八信息技术有限公司 应用程序开发装置
CN106874047B (zh) * 2017-01-25 2020-08-04 广东神马搜索科技有限公司 分布式系统调度方法、装置及分布式系统
CN108874554B (zh) * 2017-05-09 2020-11-10 腾讯科技(深圳)有限公司 信息通信方法及装置
CN107203683B (zh) * 2017-07-24 2018-04-06 中国人民解放军国防科学技术大学 卫星导航系统级开源仿真系统的建立方法
CN107911401B (zh) * 2017-08-04 2021-11-26 深圳壹账通智能科技有限公司 应用插件扩展功能方法及应用服务器
CN109614158B (zh) * 2017-09-30 2021-11-26 北京国双科技有限公司 一种插件的调用方法、系统、存储介质和处理器
CN107908397A (zh) * 2017-10-09 2018-04-13 上海壹账通金融科技有限公司 基于ios系统的软件框架的建立方法及应用服务器
CN109901817A (zh) * 2017-12-11 2019-06-18 镇江共远软件开发有限公司 一种软件架构系统
CN108563472B (zh) * 2018-04-03 2021-07-09 北京奇虎科技有限公司 基于多开应用的服务插件加载方法及装置
CN108984224A (zh) * 2018-06-13 2018-12-11 中国平安人寿保险股份有限公司 一种插件管理方法、计算机可读存储介质及终端设备
CN108959605A (zh) * 2018-07-13 2018-12-07 彩讯科技股份有限公司 用于网页的截图方法、装置、计算机设备和存储介质
CN109582400B (zh) * 2018-11-30 2023-02-21 北京小米移动软件有限公司 程序调用方法及装置
CN110162345B (zh) * 2019-05-05 2022-02-18 网宿科技股份有限公司 一种应用程序访问方法、装置和存储介质

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110185340A1 (en) * 2010-01-27 2011-07-28 Oracle International Corporation Software modeling framework
CN103365644A (zh) * 2012-04-10 2013-10-23 腾讯科技(深圳)有限公司 一种扩展软件功能的方法及装置
CN105955787A (zh) * 2016-05-18 2016-09-21 深圳市掌玩网络技术有限公司 一种用于Android系统的插件加载方法及装置
CN107870787A (zh) * 2016-09-26 2018-04-03 平安科技(深圳)有限公司 应用程序插件化加载方法及系统
CN110413259A (zh) * 2018-04-28 2019-11-05 中兴通讯股份有限公司 Android服务框架、实现扩展服务的方法及装置
CN109840079A (zh) * 2019-01-02 2019-06-04 郑州云海信息技术有限公司 一种智能开源云开发平台及方法
CN110764836A (zh) * 2019-09-18 2020-02-07 华为技术有限公司 插件实现的方法和插件实现的系统
CN111596967A (zh) * 2020-04-27 2020-08-28 中国银联股份有限公司 应用功能配置方法、终端设备、服务器及存储介质

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4024207A4

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117707614A (zh) * 2024-02-01 2024-03-15 浙商银行股份有限公司 基于Maven插件的工程依赖组件监测方法及装置

Also Published As

Publication number Publication date
EP4024207A1 (en) 2022-07-06
US20220222090A1 (en) 2022-07-14
US11880695B2 (en) 2024-01-23
CN112181514A (zh) 2021-01-05
CN112181514B (zh) 2021-08-20
CN110764836A (zh) 2020-02-07
CN110764836B (zh) 2024-02-09
EP4024207A4 (en) 2022-10-26

Similar Documents

Publication Publication Date Title
CN109101352B (zh) 图像处理算法架构、算法调用方法、装置、存储介质及移动终端
EP3197059B1 (en) Method for controlling sim card and sd card and electronic device implementing the same
US7730236B2 (en) Cellular phone and portable storage device using the same
US20060160569A1 (en) Cellular phone and portable storage device using the same
WO2021052054A1 (zh) 插件实现的方法和插件实现的系统
US20090064202A1 (en) Support layer for enabling same accessory support across multiple platforms
CN111309216B (zh) 列表页面的显示方法、装置、计算机设备及存储介质
US8964610B2 (en) System and method of reducing factory program time for wireless devices
CN111176701A (zh) 一种基于外部存储卡的固件升级方法和装置
WO2023087696A1 (zh) 通信模组及其外部接口配置方法、配置装置和存储介质
CN106919391B (zh) 面向智能手机的可定制操作系统组件的嵌入式系统
CN110737558A (zh) 自动布署efi shell系统执行测试的方法、装置、计算机设备及存储介质
CN109086102A (zh) 诊断软件的动态加载方法、装置及存储介质
CN116431546B (zh) 参数配置方法、电子设备、存储介质及程序产品
EP1843556A1 (en) A mobile terminal and boot method thereof
WO2020113421A1 (zh) 一种挂载文件系统的方法、终端设备及存储介质
KR20070094167A (ko) 이동 단말기에서 메모리를 이용한 멀티 운영 체제 구동장치 및 방법
WO2022161024A1 (zh) 升级提示方法、终端设备及计算机可读存储介质
US6820141B2 (en) System and method of determining the source of a codec
CN111258810A (zh) 一种切换数据源的实现方法、系统、终端设备和存储介质
US7958207B2 (en) Method of installing software for enabling a connection of a phone to an interconnected network
CN113760577B (zh) 一种动态连接答题装置及处理方法、控制装置、存储介质
CN219496987U (zh) 一种ops装置及显示设备
CN115033139B (zh) 启动应用程序界面的方法及相关装置
CN111885194B (zh) 通讯应用的通讯方法及装置、电子设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20864942

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2020864942

Country of ref document: EP

Effective date: 20220329