Component startup method and device
By setting a one-to-one mapping relationship between the target dynamic stub and the target component, the component can be started directly, which solves the problem of slow component startup caused by the dynamic stub allocator and improves the user experience.
Patent Information
- Application Number
- CN202010921557.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-04
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2040-09-04
AI Technical Summary
The component startup speed in the existing technology is slow, which affects the user experience. This is mainly because the dynamic stub allocator needs to call across processes to allocate and start dynamic stubs, resulting in a prolonged process.
By setting a one-to-one mapping relationship between the target dynamic pile and the target component, the component can be started directly through the target dynamic pile, avoiding the intermediate steps of the dynamic pile allocator and improving the startup speed.
Significantly improves the startup speed of components, improves user experience, and simplifies the use process of dynamic stubs.
Smart Images

Figure CN114153513B
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of information technology, and in particular to a component startup method and device. Background Art
[0002] Plugin technology originated from the installation-free running of Android application packages (APK). Through plugin technology, infrequently used functional modules in an application can be made into plugins and directly loaded at runtime, thereby reducing the size of the application installation package and realizing dynamic expansion of application functions.
[0003] In the related art, components need to be configured in extensible markup language (xml) to be perceived by the system. However, since the components in the plug-in cannot be added to xml, they cannot be perceived by the system, so they need to be proxied through piles. Piles usually include static piles and dynamic piles. Since dynamic piles are reusable, they can be released after use, and can proxy other components after release. Therefore, dynamic piles are usually used to proxy components.
[0004] However, when starting a component through a dynamic stub, you need to first use a cross-process call to let the dynamic stub allocator allocate a dynamic stub for the component, and then use a cross-process call again to start the corresponding component. This prolongs the process of starting the component, which in turn makes the component start too slowly, affecting the user experience. Summary of the invention
[0005] The embodiments of the present application provide a component startup method and device to solve the technical problem of slow component startup speed in the prior art.
[0006] In the first aspect, an embodiment of the present application provides a component startup method, which is applied to a component startup device, and the component startup device can be a terminal device such as a mobile phone, a laptop computer, etc. The method includes: receiving a startup instruction for a target dynamic pile triggered by a user operating a first application installed on the terminal device, the startup instruction is used to instruct to start a target component in a plug-in to be run; if it is detected that there is a one-to-one mapping relationship between the target component and the target dynamic pile, the target component is loaded by starting the target dynamic pile, and the target dynamic pile is used to proxy the interface call and life cycle of the target component.
[0007] In the above method, a one-to-one mapping is set for the target dynamic stub and the target component, so that there is no need to allocate dynamic stubs to the component through a dynamic stub allocator. The dynamic stub can be directly started through the target dynamic stub that has a one-to-one mapping with the target component, thereby improving the startup speed of the component and enhancing the user experience.
[0008] As a possible implementation, before receiving a startup instruction for a target dynamic pile triggered by a user operating a first application installed on a terminal device, the method further includes: establishing a one-to-one mapping relationship between the target dynamic pile and the target component; and setting a validity period for the one-to-one mapping relationship between the target dynamic pile and the target component.
[0009] Through this possible implementation, on the basis of setting the validity period, a one-to-one mapping relationship between a target dynamic pile and different target components in different time periods can be established, thereby improving the utilization rate of the dynamic pile.
[0010] As a possible implementation, establishing a one-to-one mapping relationship between the target dynamic stub and the target component includes: acquiring configuration information of the target component; and establishing a one-to-one mapping relationship between the target dynamic stub and the target component according to the configuration information of the target component.
[0011] Through this possible implementation, a one-to-one mapping relationship between the target dynamic stub and the target component can be simply and quickly established by acquiring configuration information.
[0012] As a possible implementation manner, the obtaining the configuration information of the target component includes: after installing the plug-in, obtaining the configuration information of the target component from an installation package of the plug-in.
[0013] As a possible implementation, the configuration information of the target component includes a stub configuration table.
[0014] As a possible implementation manner, the establishing of a one-to-one mapping relationship between the target dynamic stub and the target component includes:
[0015] According to the target dynamic pile corresponding to the target component in the pile configuration table, a one-to-one mapping relationship between the target dynamic pile and the target component is established.
[0016] As a possible implementation manner, before establishing the one-to-one mapping relationship between the target dynamic pile and the target component, the method further includes: querying the occupancy status of the target dynamic pile; and establishing the one-to-one mapping relationship between the target dynamic pile and the target component includes: if the target dynamic pile is not occupied, establishing the one-to-one mapping relationship between the target dynamic pile and the target component.
[0017] Through this possible implementation, before establishing the mapping relationship, it is possible to first detect whether the target dynamic pile is occupied, thereby avoiding affecting the component that is occupying the target dynamic pile.
[0018] As a possible implementation, the establishing a one-to-one mapping relationship between the target dynamic stub and the target component further includes: if the target dynamic stub is occupied, establishing a one-to-one mapping relationship between the target dynamic stub and the target component after the target dynamic stub is released.
[0019] As a possible implementation, setting the validity period of the one-to-one mapping relationship between the target dynamic stub and the target component includes: setting the validity period of the one-to-one mapping relationship between the target dynamic stub and the target component in a stub link list.
[0020] As a possible implementation, the establishing a one-to-one mapping relationship between the target dynamic stub and the target component includes: querying an idle dynamic stub; and establishing a one-to-one mapping relationship between the idle dynamic stub and the target component as the target dynamic stub.
[0021] As a possible implementation, after setting the validity period of the one-to-one mapping relationship between the target dynamic stub and the target component, the method further includes: sending the stub address of the target dynamic stub to the first application and / or operating system.
[0022] As a possible implementation, the validity period is permanent.
[0023] In a second aspect, an embodiment of the present application provides a component starting device, the device comprising:
[0024] A receiving module, configured to receive a start instruction for a target dynamic stub triggered by a user operating a first application installed on a terminal device, wherein the start instruction is used to instruct to load a target component in a plug-in to be run;
[0025] The processing module is used to load the target component by starting the target dynamic stub if a one-to-one mapping relationship between the target component and the target dynamic stub is detected. The target dynamic stub is used to proxy the interface call and life cycle of the target component.
[0026] As a possible implementation, the processing module is further used to establish a one-to-one mapping relationship between the target dynamic pile and the target component; and set a validity period of the one-to-one mapping relationship between the target dynamic pile and the target component.
[0027] As a possible implementation, the processing module is specifically used to obtain configuration information of the target component; and establish a one-to-one mapping relationship between the target dynamic stub and the target component according to the configuration information of the target component.
[0028] As a possible implementation manner, the processing module is specifically configured to obtain the configuration information of the target component from the installation package of the plug-in after the plug-in is installed.
[0029] As a possible implementation, the configuration information of the target component includes a stub configuration table.
[0030] As a possible implementation, the processing module is specifically configured to establish a one-to-one mapping relationship between the target dynamic pile and the target component according to the target dynamic pile corresponding to the target component in the pile configuration table.
[0031] As a possible implementation manner, the processing module is further used to query the occupancy status of the target dynamic pile; if the target dynamic pile is not occupied, a one-to-one mapping relationship between the target dynamic pile and the target component is established.
[0032] As a possible implementation manner, the processing module is further configured to establish a one-to-one mapping relationship between the target dynamic stub and the target component after the target dynamic stub is released if the target dynamic stub is occupied.
[0033] As a possible implementation, the processing module is specifically configured to set a validity period of a one-to-one mapping relationship between the target dynamic stub and the target component in a stub link list.
[0034] As a possible implementation, the processing module is specifically used to query idle dynamic piles; and establish a one-to-one mapping relationship between the idle dynamic piles and the target components as target dynamic piles.
[0035] As a possible implementation manner, the device further includes:
[0036] The sending module is used to send the stub address of the target dynamic stub to the first application and / or the operating system.
[0037] As a possible implementation, the validity period is permanent.
[0038] In a third aspect, an embodiment of the present application provides a readable storage medium having a computer program stored thereon; when the computer program is executed, the component startup method described in the first aspect is implemented.
[0039] In a fourth aspect, an embodiment of the present application provides an electronic device, comprising: a processor and a transceiver; the memory is coupled to the processor, and the processor is used to execute the method described in the first aspect.
[0040] In a fifth aspect, an embodiment of the present application provides a program product, which includes a computer program, and the computer program is stored in a readable storage medium. At least one processor of a component startup device can read the computer program from the readable storage medium, and the at least one processor executes the computer program so that the communication device implements the component startup method described in the first aspect.
[0041] In a thirteenth aspect, an embodiment of the present application provides a chip, comprising: a processor and an interface, wherein the interface is used to obtain a program or instruction, and the processor is used to call the program or instruction to execute the method described in the first aspect.
[0042] The embodiment of the present application provides a component startup method and device, first receiving a startup instruction for a target dynamic pile triggered by a user through a first application installed on an operating terminal device, the startup instruction is used to indicate the loading of a target component in a plug-in to be run, and then, if it is detected that there is a one-to-one mapping relationship between the target component and the target dynamic pile, the target component is loaded by starting the target dynamic pile, and the target dynamic pile is used to proxy the interface call and life cycle of the target component. Compared with the prior art, the present application sets a one-to-one mapping between the target dynamic pile and the target component, so that there is no need to allocate dynamic piles to the component through a dynamic pile allocator, and the dynamic pile can be directly started through the target dynamic pile that has a one-to-one mapping with the target component, thereby improving the startup speed of the component and improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 A schematic diagram of a dynamic pile and a static pile provided in an embodiment of the present application;
[0044] Figure 2 A schematic diagram of a newly added static pile provided in an embodiment of the present application;
[0045] Figure 3 A schematic diagram of a scenario of a component startup method provided in an embodiment of the present application;
[0046] Figure 4 A schematic diagram of a flow chart of a component startup method provided in an embodiment of the present application;
[0047] Figure 5 A flowchart of another component startup method provided in an embodiment of the present application;
[0048] Figure 6 A schematic diagram of component startup provided in an embodiment of the present application;
[0049] Figure 7 A flowchart of another component startup method provided in an embodiment of the present application;
[0050] Figure 8 A schematic diagram of another component startup provided in an embodiment of the present application;
[0051] Fig. 9 A schematic diagram of the structure of a component starting device provided in an embodiment of the present application;
[0052] Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution in the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is a part of the embodiment of the present invention, not all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0054] Plugin technology originated from the installation-free running of Android application packages (APK). Through plugin technology, infrequently used functional modules in an application can be made into plugins and directly loaded at runtime, thereby reducing the size of the application installation package and realizing dynamic expansion of application functions.
[0055] In the related art, components need to be configured in extensible markup language (xml) to be perceived by the system. Figure 1 A schematic diagram of a dynamic pile and a static pile provided in an embodiment of the present application. Figure 1 The mapping relationship between dynamic piles and components is a 1-to-n relationship, and dynamic piles are mainly allocated to components dynamically through the pile manager. When an application wants to start a component, it needs to first allocate a dynamic pile through the dynamic pile allocator, and then the application can start the component through this dynamic pile. The mapping relationship between static piles and components is a 1-to-1 relationship, and the component corresponding to the static pile is fixed. When an application wants to start a component proxied by a static pile, it only needs to directly start the pile of the static pile, and the static pile will directly load the corresponding component.
[0056] Compared with dynamic piles, since the mapping relationship of static piles is fixed, there is no need to obtain the pile address at startup. The component can be pulled up by directly starting the static pile, which greatly improves the performance. Figure 2 This is a schematic diagram of a newly added static pile provided in an embodiment of the present application. Figure 2As shown, when a component that uses a static stub is to be added to the plug-in, a static stub needs to be added to the container APK, which makes it impossible to publish the plug-in APK independently. The newly added component can only run in the latest version of the container APK, which greatly limits the ability of the plug-in APK to be published independently.
[0057] Therefore, dynamic piles with stronger reusability are usually used in the prior art. However, when starting a component through a dynamic pile, it is necessary to first use a cross-process call to let the dynamic pile allocator allocate a dynamic pile for the component, and then use a cross-process call again to start the corresponding component. This results in a prolonged process of starting the component, which in turn makes the startup speed of the component too slow, affecting the user experience.
[0058] In actual applications, plug-in components have strict requirements on startup performance. In some cases, the startup performance of a component directly affects the usage rate of the component. For example, the startup performance of the payment page in a payment plug-in directly affects the user payment conversion rate and the payment income.
[0059] To solve the above problems, the embodiments of the present application provide a component startup method and device, thereby improving the startup speed of the component and improving the user experience. Since a one-to-one mapping relationship is set between the component and the dynamic pile in the present application, when a third-party application starts a component, it is no longer necessary to allocate a dynamic pile to the component through a dynamic pile allocator, and can be directly started through the corresponding target dynamic pile, thereby improving the startup speed of the component and improving the user experience.
[0060] The application scenarios of this application are described below.
[0061] Figure 3 A schematic diagram of a component startup method provided in an embodiment of the present application. Figure 3 If the third-party application on the terminal device detects that the user clicks on the payment, the third-party application will send a request to start the payment page (plug-in APK) component in the payment application (container APK). At this time, after receiving the request from the third-party application, the payment application will query the specific component of the plug-in APK loaded in the blank page through the stub manager, then load the plug-in APK through the runtime environment, and then load the component in through the proxy stub.
[0062] Among them, the embodiment of the present application does not limit the type of application and the type of plug-in, and can be specifically set according to actual conditions. The above-mentioned terminal device can also be called terminal Terminal, user equipment (UE), mobile station (MS), mobile terminal (MT), etc. The terminal device 101 can be a mobile phone, a tablet computer (pad), a computer with wireless transceiver function, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal in industrial control, a wireless terminal in self driving, a wireless terminal in remote medical surgery, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, etc. The above-mentioned terminal device can be applied to 5G network, and even the future 6G network or 7G network.
[0063] In addition, the terminal device can be deployed on land, including indoors or outdoors, handheld or vehicle-mounted; it can also be deployed on the water surface; it can also be deployed on an airplane, balloon, or artificial satellite in the air. The embodiment of the present application does not limit the application scenario of the terminal device.
[0064] It should be noted that the component startup method involved in the embodiment of the present application can be applied to Figure 3 The scenario shown is not limited to this, and can also be applied to other scenarios that require starting components.
[0065] It can be understood that the above-mentioned component startup method can be implemented by the component startup device provided in the embodiment of the present application. The component startup device can be part or all of a certain device, such as the above-mentioned terminal device or a chip of the terminal device.
[0066] The following is an example of a terminal device integrated or installed with relevant execution codes, and the technical solution of the embodiment of the present application is described in detail with a specific embodiment. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.
[0067] Figure 4 This is a flow chart of a component startup method provided in an embodiment of the present application. This embodiment relates to the process of how a server starts a component in a plug-in through a dynamic stub. Figure 4 As shown, the method includes:
[0068] Step S101: receiving a start instruction for a target dynamic stub triggered by a user operating a first application installed on a terminal device, where the start instruction is used to instruct to start a target component in a plug-in to be run.
[0069] In the present application, when the first application needs to call a target component in a plug-in, a startup instruction for a target dynamic stub may be sent, and after receiving the startup instruction, the terminal device may load the target component in the plug-in to be run.
[0070] Among them, the embodiments of the present application do not limit the first application, plug-ins and components. Exemplarily, the first application can be a shopping application, a chat application, a video application, etc. Exemplarily, the plug-in can be a payment plug-in, an audio plug-in, etc. Exemplarily, commonly used components can be divided into application components (activity), service components (service), content provider components (content provider) and broadcast receiver components (broadcast receiver). Among them, activity is used to provide the screen for interaction with payment, service is used to run a service program in the background, content provider is used for data interaction and sharing between processes, and broadcast receiver is used to receive and respond to broadcasts from applications or systems. It should be noted that any of the above types of components can be started in the embodiments of the present application.
[0071] Step S102: If it is detected that there is a one-to-one mapping relationship between the target component and the target dynamic stub, the target component is loaded by starting the target dynamic stub, and the target dynamic stub is used to proxy the interface call and life cycle of the target component.
[0072] In this step, after receiving the startup instruction sent by the first application, the terminal device can detect whether there is a one-to-one mapping relationship between the target component and the dynamic stub. If it is detected that there is a one-to-one mapping relationship between the target component and the target dynamic stub, the target component is loaded by starting the target dynamic stub.
[0073] In some embodiments, if no one-to-one mapping relationship is detected between the target component and any dynamic stub, a dynamic stub allocator is first used to allocate a dynamic stub to the component through a cross-process call, and then the corresponding component is started again through a cross-process call.
[0074] It should be noted that the embodiment of the present application does not limit how to detect whether a target component has a one-to-one mapping relationship with a target dynamic pile. In an optional implementation, after receiving a startup instruction, the target dynamic pile can check the target component with which it has a one-to-one mapping relationship through the dynamic pile distributor. If a target component with which it has a one-to-one mapping relationship is checked, the target component is started. If there is no target component with which it has a one-to-one mapping relationship, no component is started.
[0075] In some embodiments, the one-to-one mapping relationship may also be set with a validity period. Accordingly, after the target dynamic stub checks the target component with which it has a one-to-one mapping relationship, it may also check the validity period of the one-to-one mapping relationship. If it is within the validity period, the target component is loaded; if it is not within the validity period, no component is started.
[0076] In order to ensure that the dynamic stub allocator does not need to allocate a dynamic stub to the component when a startup indication is received, before receiving a startup indication for a target dynamic stub sent by the first application, the first terminal may establish a one-to-one mapping relationship between the target dynamic stub and the target component, and set a validity period for the one-to-one mapping relationship between the target dynamic stub and the target component.
[0077] It should be noted that the embodiment of the present application does not limit the time for establishing a one-to-one mapping relationship between the target dynamic pile and the target component. In an optional implementation, a one-to-one mapping relationship between the target dynamic pile and the target component can be established immediately after the plug-in is installed.
[0078] In addition, in the embodiments of the present application, a one-to-one mapping relationship between a target dynamic stub and a target component may be established in a variety of different ways.
[0079] In an optional implementation, after installing the plug-in, the terminal device can obtain the configuration information of the target component from the installation package of the plug-in. Subsequently, according to the configuration information of the target component, a one-to-one mapping relationship between the target dynamic pile and the target component is established. Wherein, the configuration information of the target component includes a pile configuration table. Accordingly, the terminal device can establish a one-to-one mapping relationship between the target dynamic pile and the target component according to the target dynamic pile corresponding to the target component in the pile configuration table.
[0080] It should be noted that, in some embodiments, after determining the target dynamic pile corresponding to the target component in the configuration information, this target dynamic pile may be in an occupied state, if a one-to-one mapping relationship between the target dynamic pile and the target component is set up at this moment, the normal operation of the assembly occupying this target dynamic pile may be affected. Therefore, before setting up a one-to-one mapping relationship between the target dynamic pile and the target component, the occupancy of the target dynamic pile can be queried, if the target dynamic pile is not occupied, then the one-to-one mapping relationship between the target dynamic pile and the target component is set up immediately. If the target dynamic pile is occupied, a one-to-one mapping relationship between the target dynamic pile and the target component is set up after the target dynamic pile is released.
[0081] In addition, the validity period of the one-to-one mapping relationship between the target dynamic stub and the target component may be specifically set in the stub link list.
[0082] In another optional implementation, the terminal device may query for idle dynamic piles, then establish a one-to-one mapping relationship between the idle dynamic piles as target dynamic piles and target components, and finally send the pile address of the target dynamic pile to the first application and / or operating system.
[0083] In the present application, by establishing a one-to-one mapping relationship between a target dynamic pile and a target component and setting a validity period, it is equivalent to converting a dynamic pile into a static pile within the validity period.
[0084] The embodiment of the present application provides a component startup method, first receiving a startup instruction sent by a first application, the startup instruction is used to indicate the target component in the plug-in to be run to be loaded, and then, if it is detected that there is a one-to-one mapping relationship between the target component and the target dynamic pile, the target component is loaded by starting the target dynamic pile, and the target dynamic pile is used to proxy the interface call and life cycle of the target component. Compared with the prior art, the present application sets a one-to-one mapping between the target dynamic pile and the target component, so that there is no need to allocate dynamic piles to the component through a dynamic pile distributor, and the dynamic pile can be directly started by the target dynamic pile that has a one-to-one mapping with the target component, thereby improving the startup speed of the component and improving the user experience.
[0085] Based on the above embodiment, two methods of establishing a one-to-one mapping relationship between a target dynamic pile and a target component are provided below. In the first method, if the target dynamic pile corresponding to the target component has been pre-set, a one-to-one mapping relationship between the target dynamic pile and the target component can be established directly according to the configuration information of the target component.
[0086] Figure 5 A flowchart of another component startup method provided in an embodiment of the present application is provided. Figure 6This is a schematic diagram of a component startup provided in an embodiment of the present application. This embodiment involves a specific process of how a terminal device establishes a one-to-one mapping relationship between a target dynamic pile and a target component according to the configuration information of the target component. Figure 5 and Figure 6 As shown, the method includes:
[0087] Step S201: Obtain configuration information of the target component.
[0088] In some embodiments, after installing the plug-in, the terminal device can obtain the configuration information of the target component from the installation package of the plug-in. The configuration information includes the stub configuration table
[0089] For example, Figure 6 As shown, after the container APK of the first application downloads and installs the plug-in, it will scan the configuration information of the components in the plug-in. Then the communication module in the dynamic pile distributor of the terminal device obtains the configuration information, and then the configuration reading module in the dynamic pile distributor reads the pile configuration table in the plug-in configuration information.
[0090] Step S202: establishing a one-to-one mapping relationship between the target dynamic stub and the target component according to the configuration information of the target component.
[0091] In this step, after the terminal device obtains the configuration information of the target component, a one-to-one mapping relationship between the target dynamic pile and the target component can be established according to the configuration information of the target component.
[0092] It should be noted that the embodiment of the present application does not limit how to establish a one-to-one mapping relationship between the target dynamic pile and the target component. In an optional implementation, a one-to-one mapping relationship between the target dynamic pile and the target component can be established according to the target dynamic pile corresponding to the target component in the pile configuration table.
[0093] For example, Figure 6 As shown, if the configuration information of component B is read to indicate that component B corresponds to dynamic pile 1, a one-to-one mapping relationship can be set between component B and the dynamic pile 1 corresponding to component B. Accordingly, dynamic pile 1 can be used as the startup entry of component B.
[0094] In an optional embodiment, before the one-to-one mapping relationship between the target dynamic pile and the target component is established, the first terminal can also query the occupancy of the target dynamic pile. If the target dynamic pile is not occupied, then the one-to-one mapping relationship between the target dynamic pile and the target component is established. If the target dynamic pile is occupied, the one-to-one mapping relationship between the target dynamic pile and the target component is established after the target dynamic pile is released.
[0095] For example, Figure 6As shown, the configuration reading module in the dynamic pile allocator can query the pile link list through the query module in the dynamic pile allocator to determine whether the current dynamic pile 1 is occupied. Figure 6 If dynamic pile 1 is already occupied by component A, after waiting for component 1 to be released, the configuration reading module inserts a one-to-one mapping relationship between dynamic pile 1 and component B into the pile link list through the pile link module in the dynamic pile allocator, and points dynamic pile 1 to component B. If dynamic pile 1 is not occupied, the one-to-one mapping relationship between dynamic pile 1 and component B is directly inserted into the pile link list.
[0096] Step S203: setting the validity period of the one-to-one mapping relationship between the target dynamic stub and the target component.
[0097] In this step, after the terminal device establishes a one-to-one mapping relationship between the target dynamic pile and the target component according to the configuration information of the target component, the validity period of the one-to-one mapping relationship between the target dynamic pile and the target component may be set.
[0098] The embodiment of the present application does not limit how to set the validity period of the one-to-one mapping relationship between the target dynamic stub and the target component. In an optional implementation, the validity period of the one-to-one mapping relationship between the target dynamic stub and the target component can be set in the stub link list.
[0099] For example, Figure 6 As shown, the configuration reading module sets the validity period of the dynamic pile 1 in the validity period of the pile link table through the time control module.
[0100] Among them, the validity period of the target dynamic pile involved in the embodiment of the present application can be set to permanent.
[0101] Step S204: receiving a start instruction sent by the first application, where the start instruction is used to instruct to load a target component in the plug-in to be run.
[0102] Step S205: If it is detected that there is a one-to-one mapping relationship between the target component and the target dynamic stub, the target component is loaded by starting the target dynamic stub, and the target dynamic stub is used to proxy the interface call and life cycle of the target component.
[0103] In this embodiment, the specific implementation process and implementation principle of steps S204 to S205 are the same as Figure 4 Step S101 to step S102 are similar and will not be repeated here.
[0104] Embodiment of the present application, by obtaining the configuration information of target component, then according to the configuration information of target component, set up the one-to-one mapping relationship between target dynamic pile and target component, thereby dynamic pile is converted to static pile, makes the application using plug-in load target component by starting the target dynamic pile corresponding to target component, improves the starting speed of component.In addition, by the mode of configuration information, dynamic pile is converted, and its scope of use is wider, and dynamic piles of all types can be converted to static pile.And the mode of the startup component of the present application is completely consistent with native logic, and there is no need to add extra data in the startup information to indicate the need to start the component, thereby reducing learning cost and error rate.
[0105] Based on the above embodiment, the second method of establishing a one-to-one mapping relationship between a target dynamic pile and a target component is described below. In the second method, if the target dynamic pile corresponding to the target component is not pre-set, the idle dynamic pile can be directly queried, and then the idle dynamic pile is used as the target dynamic pile to establish a one-to-one mapping relationship with the target component.
[0106] Figure 7 A flowchart of another component startup method provided in an embodiment of the present application is shown below. Figure 8 Another schematic diagram of component startup provided in an embodiment of the present application relates to a specific process of how a terminal device establishes a one-to-one mapping relationship between a target dynamic pile and a target component by querying an idle dynamic pile. Figure 7 Shown and Figure 8 As shown, the method includes:
[0107] Step S301: Query idle dynamic piles.
[0108] Step S302: Establish a one-to-one mapping relationship between the idle dynamic stub and the target component as the target dynamic stub.
[0109] Step S303: Send the stub address of the target dynamic stub to the first application and / or the operating system.
[0110] In this application, it is necessary to establish a one-to-one mapping relationship between the target dynamic pile and the target component. The terminal device can directly query the idle dynamic pile, and use the idle dynamic pile as the target dynamic pile to establish a one-to-one mapping relationship with the target component. Subsequently, the pile address of the target dynamic pile is sent to the first application and / or the operating system.
[0111] For example, Figure 8As shown, the plug-in can call the pile link module through the communication module of the dynamic pile distributor to link an idle dynamic pile address for component B. Secondly, the plug-in calls the pile query module through the communication module of the dynamic pile distributor to query the dynamic pile address corresponding to component B. Then, through the time control module, the validity period of this pile address is set to permanent. Finally, the queried dynamic pile address is registered in the system or sent to other users. After that, the user can directly start component B through this address to achieve the effect of static pile.
[0112] Step S304: setting the validity period of the one-to-one mapping relationship between the target dynamic stub and the target component.
[0113] Step S305: receiving a start instruction sent by the first application, where the start instruction is used to instruct to load a target component in the plug-in to be run.
[0114] Step S306: If it is detected that there is a one-to-one mapping relationship between the target component and the target dynamic stub, the target component is loaded by starting the target dynamic stub, and the target dynamic stub is used to proxy the interface call and life cycle of the target component.
[0115] In this embodiment, the specific implementation process and implementation principle of steps S304 to S306 are the same as Figure 5 Steps S203 to S205 are similar and will not be repeated here.
[0116] The embodiment of the present application directly converts a dynamic pile into a static pile by interacting with a dynamic pile distributor. It is often applicable to the scenario where a component needs to be registered in the system in the running state. For example, register a component (jobservice) with the system. Since the system will continue to reflect the entry address of the call service, the entry address cannot be in the form of a dynamic pile and needs to be converted to a static pile.
[0117] In this application, the one-to-one mapping relationship between the target dynamic pile and the target component can be registered in the system so that it can be used by the system callback. In addition, the pile address can be dynamically allocated, and the idle pile address can be used to convert it into a static pile without considering the pile occupancy problem.
[0118] The embodiment of the present application provides a component startup method, first receiving a startup instruction sent by a first application, the startup instruction is used to indicate the target component in the plug-in to be run to be loaded, and then, if it is detected that there is a one-to-one mapping relationship between the target component and the target dynamic pile, the target component is loaded by starting the target dynamic pile, and the target dynamic pile is used to proxy the interface call and life cycle of the target component. Compared with the prior art, the present application sets a one-to-one mapping between the target dynamic pile and the target component, so that there is no need to allocate dynamic piles to the component through a dynamic pile distributor, and the dynamic pile can be directly started by the target dynamic pile that has a one-to-one mapping with the target component, thereby improving the startup speed of the component and improving the user experience.
[0119] A person of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk, etc., various media that can store program codes.
[0120] Fig. 9 This is a schematic diagram of the structure of a component startup device provided in an embodiment of the present application. The component startup device can be used to execute the above Figures 4 to 8 In the component startup method in the illustrated embodiment, the component startup device may be the terminal device itself, or may be a component or integrated circuit inside the terminal device, such as a chip. Fig. 9 As shown, the component starting device 40 includes: a receiving module 41, a processing module 42, and a sending module 43;
[0121] The receiving module 41 is used to receive a start instruction for a target dynamic pile triggered by a user operating a first application installed on a terminal device, where the start instruction is used to instruct to load a target component in a plug-in to be run;
[0122] The processing module 42 is used to load the target component by starting the target dynamic stub if it is detected that there is a one-to-one mapping relationship between the target component and the target dynamic stub, and the target dynamic stub is used to proxy the interface call and life cycle of the target component.
[0123] In an optional implementation, the processing module 42 is further configured to establish a one-to-one mapping relationship between the target dynamic pile and the target component; and set a validity period for the one-to-one mapping relationship between the target dynamic pile and the target component.
[0124] In an optional implementation, the processing module 42 is specifically configured to obtain configuration information of the target component; and establish a one-to-one mapping relationship between the target dynamic stub and the target component according to the configuration information of the target component.
[0125] In an optional implementation, the processing module 42 is specifically configured to obtain the configuration information of the target component from the installation package of the plug-in after the plug-in is installed.
[0126] In an optional implementation, the configuration information of the target component includes a stub configuration table.
[0127] In an optional implementation, the processing module 42 is specifically configured to establish a one-to-one mapping relationship between the target dynamic pile and the target component according to the target dynamic pile corresponding to the target component in the pile configuration table.
[0128] In an optional implementation, the processing module 42 is further used to query the occupancy status of the target dynamic pile; if the target dynamic pile is not occupied, a one-to-one mapping relationship between the target dynamic pile and the target component is established.
[0129] In an optional implementation, the processing module 42 is further configured to establish a one-to-one mapping relationship between the target dynamic stub and the target component after the target dynamic stub is released if the target dynamic stub is occupied.
[0130] In an optional implementation, the processing module 42 is specifically configured to set a validity period of a one-to-one mapping relationship between a target dynamic stub and a target component in the stub link list.
[0131] In an optional implementation, the processing module 42 is specifically used to query idle dynamic piles; and establish a one-to-one mapping relationship between the idle dynamic piles and the target components as target dynamic piles.
[0132] In an optional embodiment, the device further includes:
[0133] The sending module 43 is used to send the stub address of the target dynamic stub to the first application and / or the operating system.
[0134] In an optional implementation, the validity period is permanent.
[0135] The component startup device provided in the embodiment of the present application can execute the component startup method executed by the terminal device in the above method embodiment. Its implementation principle and technical effect are similar and will not be repeated here.
[0136] Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown in FIG. Fig.10 As shown, the electronic device may include: at least one processor 51 and a memory 52. Fig.10 An electronic device is shown using a processor as an example.
[0137] The memory 52 is used to store programs. Specifically, the programs may include program codes, and the program codes include computer operation instructions.
[0138] The memory 52 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0139] The processor 51 is used to execute the computer execution instructions stored in the memory 52 to implement the above form generation method;
[0140] The processor 51 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.
[0141] Optionally, in a specific implementation, if the communication interface, the memory 52 and the processor 51 are implemented independently, the communication interface, the memory 52 and the processor 51 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc., but it does not mean that there is only one bus or one type of bus.
[0142] Optionally, in a specific implementation, if the communication interface, the memory 52 and the processor 51 are integrated on a chip, the communication interface, the memory 52 and the processor 51 can communicate through an internal interface.
[0143] The present application embodiment also provides a chip, including a processor and an interface. The interface is used to input and output data or instructions processed by the processor. The processor is used to execute the method provided in the above method embodiment. The chip can be applied to a terminal device.
[0144] The embodiment of the present application provides a computer-readable storage medium, which stores instructions. When the instructions are executed, the computer executes the method executed in the above embodiment of the present application;
[0145] An embodiment of the present application provides a program product, including a computer program, which is stored in a readable storage medium. At least one processor of a component startup device can read the computer program from the readable storage medium, and at least one processor executes the computer program so that the communication device implements the component startup method of the first aspect.
[0146] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0147] It should be noted that the division of modules in the embodiments of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. The functional modules in the embodiments of the present application may be integrated into a processing module, or each module may exist physically separately, or two or more modules may be integrated into one module. The above-mentioned integrated modules may be implemented in the form of hardware or in the form of software functional modules.
[0148] If the integrated module is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or 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 a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of each embodiment method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program codes.
[0149] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loading and executing computer program instructions on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, a data center, etc. that contains one or more available media integrated. The available medium can be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.
Claims
1. A component startup method, characterized in that: include: Receiving a start instruction for a target dynamic stub triggered by a user operating a first application installed on a terminal device, wherein the start instruction is used to instruct to start a target component in a plug-in to be run; If it is detected that there is a one-to-one mapping relationship between the target component and the target dynamic stub, the target component is loaded by starting the target dynamic stub, and the target dynamic stub is used to proxy the interface call and life cycle of the target component; Before receiving a start instruction for a target dynamic pile triggered by a user operating a first application installed on a terminal device, the method further includes: Establishing a one-to-one mapping relationship between the target dynamic stub and the target component; The validity period of the one-to-one mapping relationship between the target dynamic stub and the target component is set.
2. The method according to claim 1, characterized in that The establishing of a one-to-one mapping relationship between the target dynamic stub and the target component includes: Obtaining configuration information of the target component; A one-to-one mapping relationship between the target dynamic stub and the target component is established according to the configuration information of the target component.
3. The method according to claim 2, characterized in that The obtaining the configuration information of the target component includes: After the plug-in is installed, the configuration information of the target component is obtained from the installation package of the plug-in.
4. The method according to claim 2 or 3, characterized in that: The configuration information of the target component includes a stub configuration table.
5. The method according to claim 4, characterized in that The establishing of a one-to-one mapping relationship between the target dynamic stub and the target component includes: According to the target dynamic pile corresponding to the target component in the pile configuration table, a one-to-one mapping relationship between the target dynamic pile and the target component is established.
6. The method according to claim 2, characterized in that Before establishing a one-to-one mapping relationship between the target dynamic stub and the target component, the method further includes: Querying the occupancy status of the target dynamic pile; The establishing of a one-to-one mapping relationship between the target dynamic stub and the target component includes: If the target dynamic stub is not occupied, a one-to-one mapping relationship between the target dynamic stub and the target component is established.
7. The method according to claim 6, characterized in that The step of establishing a one-to-one mapping relationship between the target dynamic pile and the target component further includes: If the target dynamic stub is occupied, a one-to-one mapping relationship between the target dynamic stub and the target component is established after the target dynamic stub is released.
8. The method according to claim 1, characterized in that The setting of the validity period of the one-to-one mapping relationship between the target dynamic pile and the target component includes: The validity period of the one-to-one mapping relationship between the target dynamic stub and the target component is set in the stub link list.
9. The method according to claim 1, characterized in that: The establishing of a one-to-one mapping relationship between the target dynamic stub and the target component includes: Query the idle dynamic piles; The idle dynamic stub is used as a target dynamic stub to establish a one-to-one mapping relationship with the target component.
10. The method according to claim 9, characterized in that After setting the validity period of the one-to-one mapping relationship between the target dynamic stub and the target component, the method further includes: The stub address of the target dynamic stub is sent to the first application and / or the operating system.
11. The method according to any one of claims 1, 8-10, characterized in that: The stated validity period is permanent.
12. A component starting device, characterized in that: include: A receiving module, configured to receive a start instruction for a target dynamic pile triggered by a user operating a first application installed on a terminal device, wherein the start instruction is used to instruct to start a target component in a plug-in to be run; A processing module, configured to load the target component by starting the target dynamic stub if a one-to-one mapping relationship between the target component and the target dynamic stub is detected, wherein the target dynamic stub is used to proxy the interface call and life cycle of the target component; The processing module is further used to establish a one-to-one mapping relationship between the target dynamic pile and the target component; and set a validity period of the one-to-one mapping relationship between the target dynamic pile and the target component.
13. The device according to claim 12, characterized in that The processing module is specifically used to obtain the configuration information of the target component; and to establish a one-to-one mapping relationship between the target dynamic pile and the target component according to the configuration information of the target component.
14. The device according to claim 13, characterized in that The processing module is specifically used to obtain the configuration information of the target component from the installation package of the plug-in after the plug-in is installed.
15. The device according to claim 13 or 14, characterized in that The configuration information of the target component includes a stub configuration table.
16. The device according to claim 15, characterized in that The processing module is specifically used to establish a one-to-one mapping relationship between the target dynamic pile and the target component according to the target dynamic pile corresponding to the target component in the pile configuration table.
17. The device according to claim 13, characterized in that The processing module is further used to query the occupancy status of the target dynamic pile; if the target dynamic pile is not occupied, a one-to-one mapping relationship between the target dynamic pile and the target component is established.
18. The device according to claim 16, characterized in that The processing module is further configured to establish a one-to-one mapping relationship between the target dynamic stub and the target component after the target dynamic stub is released if the target dynamic stub is occupied.
19. The device according to claim 12, characterized in that The processing module is specifically used to set the validity period of the one-to-one mapping relationship between the target dynamic stub and the target component in the stub link list.
20. The device according to claim 12, characterized in that The processing module is specifically used to query idle dynamic piles; and to establish a one-to-one mapping relationship between the idle dynamic piles and the target components as target dynamic piles.
21. The device according to claim 20, characterized in that The device also includes: The sending module is used to send the stub address of the target dynamic stub to the first application and / or the operating system.
22. The device according to any one of claims 12, 19-21, characterized in that: The stated validity period is permanent.
23. A readable storage medium, characterized in that: The readable storage medium stores a computer program; when the computer program is executed, the component startup method according to any one of claims 1 to 11 is implemented.
24. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory is coupled to the processor, and the processor is used to execute the method according to any one of claims 1 to 11.
25. A computer program product, characterized in that The method comprises instructions which, when executed on a computer, cause the computer to execute the method according to any one of claims 1 to 11.
26. A chip, characterized in that: The method comprises a processor and an interface, wherein the interface is used to obtain a program or an instruction, and the processor is used to call the program or the instruction to execute the method according to any one of claims 1 to 11.
