CN109213533B - Advertisement SDK dynamic loading method, device and terminal - Google Patents

Advertisement SDK dynamic loading method, device and terminal Download PDF

Info

Publication number
CN109213533B
CN109213533B CN201710513966.9A CN201710513966A CN109213533B CN 109213533 B CN109213533 B CN 109213533B CN 201710513966 A CN201710513966 A CN 201710513966A CN 109213533 B CN109213533 B CN 109213533B
Authority
CN
China
Prior art keywords
file
advertisement
preset
bundle
configuration file
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201710513966.9A
Other languages
Chinese (zh)
Other versions
CN109213533A (en
Inventor
孙向作
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
TCL Technology Group Co Ltd
Original Assignee
TCL Technology Group Co Ltd
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 TCL Technology Group Co Ltd filed Critical TCL Technology Group Co Ltd
Priority to CN201710513966.9A priority Critical patent/CN109213533B/en
Publication of CN109213533A publication Critical patent/CN109213533A/en
Application granted granted Critical
Publication of CN109213533B publication Critical patent/CN109213533B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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

Abstract

The invention is suitable for the technical field of communication, and provides a method, a device and a terminal for dynamically loading an advertisement SDK (software development kit). when a system is started, a preset service framework is loaded; acquiring a preset configuration file through the preset service framework; loading and starting a bundle file corresponding to the advertisement SDK according to the preset configuration file; the preset service frame is used for sending broadcast information containing the starting of the advertisement SDK so that a preset application can obtain the display information of the advertisement SDK for advertisement display, the preset service frame is used for loading and starting the bundle file corresponding to the advertisement SDK to realize the starting of the advertisement SDK, the application can conveniently call advertisement materials in the bundle file, so that jar packages corresponding to the advertisement SDK do not need to be packaged in each application any more, the workload is reduced, the working efficiency is improved, and the problem of file increase caused by the fact that each application packages jar packages is effectively solved.

Description

Advertisement SDK dynamic loading method, device and terminal
Technical Field
The invention belongs to the technical field of advertisement SDK loading, and particularly relates to a dynamic advertisement SDK loading method, a dynamic advertisement SDK loading device and a dynamic advertisement SDK loading terminal.
Background
With the popularization of intelligent terminal equipment and the development of mobile application markets, more and more merchants choose to put advertisements on the application of the intelligent terminal equipment so as to achieve the purpose of popularizing commodities. At present, an application on an intelligent terminal device based on an Android platform generally receives an advertisement distributed by an advertisement platform by calling an interface in an advertisement SDK (Software Development Kit), issues the application to the Android application market, and pushes the advertisement to a terminal client through the application.
Generally, if an APP (Application) needs to access an advertisement SDK of a third party, the APP needs to be imported as a resource of a project, then coding is performed, and then an interface of an external SDK is called to realize implantation of an external advertisement. Thus, for the same advertisement SDK, when multiple applications need to use the advertisement SDK, the jar packages corresponding to the advertisement SDK need to be packaged in respective projects, that is, an advertisement jar package needs to be embedded in each application showing the advertisement.
Moreover, when the APP displaying the advertisement no longer displays the advertisement, that is, when the advertisement SDK is no longer needed, the advertisement jar packet needs to be removed and the compiling application needs to be adapted again, so that the workload is increased and the efficiency is low.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method, an apparatus, a terminal and a computer-readable storage medium for dynamically loading an advertisement SDK, so as to solve the problems that when multiple applications need to use an advertisement SDK in an existing advertisement SDK loading method, jar packages corresponding to the advertisement SDK need to be packaged in respective projects, that is, an advertisement jar package needs to be embedded in each application displaying an advertisement, so that workload is increased and efficiency is low.
A first aspect of an embodiment of the present invention provides a method for dynamically loading an advertisement SDK, including:
loading a preset service framework when a system is started;
acquiring a preset configuration file through the preset service framework;
loading and starting a bundle file corresponding to the advertisement SDK according to the preset configuration file;
and sending broadcast information containing the starting of the advertisement SDK through the preset service frame so that a preset application acquires display information of the advertisement SDK for advertisement display.
A second aspect of the embodiments of the present invention provides an advertisement SDK dynamic loading apparatus, including:
the framework loading unit is used for loading a preset service framework when the system is started;
the file acquisition unit is used for acquiring a preset configuration file through the preset service framework;
the file loading unit is used for loading and starting a bundle file corresponding to the advertisement SDK according to the preset configuration file;
and the information sending unit is used for sending broadcast information containing the starting of the advertisement SDK through the preset service frame so as to enable a preset application to obtain the display information of the advertisement SDK for advertisement display.
A third aspect of an embodiment of the present invention provides a terminal, including:
the advertisement SDK dynamic loading method comprises a memory, a processor and a computer program which is stored in the memory and can run on the processor, wherein the steps of the advertisement SDK dynamic loading method provided by the first aspect of the embodiment of the invention are realized when the computer program is executed by the processor.
Wherein the computer program comprises:
the framework loading unit is used for loading a preset service framework when the system is started;
the file acquisition unit is used for acquiring a preset configuration file through the preset service framework;
the file loading unit is used for loading and starting a bundle file corresponding to the advertisement SDK according to the preset configuration file;
and the information sending unit is used for sending broadcast information containing the starting of the advertisement SDK through the preset service frame so as to enable a preset application to obtain the display information of the advertisement SDK for advertisement display.
A fourth aspect of the embodiments of the present invention provides a computer-readable storage medium, where a computer program is stored, where the computer program, when executed by a processor, implements the steps of the advertisement SDK dynamic loading method provided in the first aspect of the embodiments of the present invention.
Wherein the computer program comprises:
the framework loading unit is used for loading a preset service framework when the system is started;
the file acquisition unit is used for acquiring a preset configuration file through the preset service framework;
the file loading unit is used for loading and starting a bundle file corresponding to the advertisement SDK according to the preset configuration file;
and the information sending unit is used for sending broadcast information containing the starting of the advertisement SDK through the preset service frame so as to enable a preset application to obtain the display information of the advertisement SDK for advertisement display.
Compared with the prior art, the embodiment of the invention has the following beneficial effects: the preset service frame is loaded in the system, and the bundle file corresponding to the advertisement SDK is loaded and started through the preset service frame to start the advertisement SDK, so that the preset application obtains the advertisement material information in the bundle file through the preset interface protocol without packing the advertisement SDK in the preset application.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a flowchart of an implementation of a method for dynamically loading an advertisement SDK according to an embodiment of the present invention;
fig. 2 is a flowchart of a specific implementation of a method for obtaining a preset configuration file through the preset service framework according to an embodiment of the present invention;
fig. 3 is a flowchart of a specific implementation of a method for loading and starting a bundle file corresponding to an advertisement SDK according to a preset configuration file according to an embodiment of the present invention;
fig. 4 is a specific implementation flow of a method for dynamically uninstalling an advertisement SDK according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of an advertisement SDK dynamic loading apparatus according to an embodiment of the present invention;
fig. 6 is a schematic diagram of a terminal according to an embodiment of the present invention.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
In order to explain the technical means of the present invention, the following description will be given by way of specific examples. Referring to fig. 1, fig. 1 shows an implementation flow of a dynamic advertisement SDK loading method according to an embodiment of the present invention, which is detailed as follows:
in step S101, at the time of system startup, a preset service framework is loaded.
In the embodiment of the present invention, the preset Service framework is specifically an osgi (open Service Gateway initiative) Service framework. Herein, the OSGI service framework is also referred to as an OSGI service platform, and the OSGI service platform includes an OSGI framework for implementing and providing a runtime environment of OSGI functions, and OSGI standard services for defining reusable APIs (Application Programming interfaces) for performing common tasks.
And embedding an OSGI frame in the Android system, and loading the OSGI service frame when the Android system is started to realize the operation of the system service of the OSGI frame. Specifically, an OsgiFramework service is added in an Android system, and is registered in a system management service, and when the system is started, the service is started correspondingly, so that an interface for acquiring an OSGI framework instance is provided for the outside, and the interface is also called an OSGI framework interface.
In step S102, a preset configuration file is obtained through the preset service framework.
The advertisement SDK is a jar package which is compiled and declared by adopting Java language, an interface in the advertisement SDK can be called by an application to receive the advertisement distributed by an advertisement platform by packaging the jar package, and a bundle file is loaded in the OSGI platform. Here, the bundle file may be simply understood as a jar package added with metadata including readable information for providing a user with related help information of the bundle file, file identification information for identifying necessary information of the bundle file, and code visibility information.
Wherein the readable information may include:
Bundle-Name: as an abbreviated name for bundle files;
Bundle-Description: describing the function of the bundle file;
Bundle-DocURL: providing a document related to the bundle file;
Bundle-Category: defining a set of category names separated by commas;
Bundle-Vendor: information about the bundle provider;
Bundle-ContactAddress: information about the bundle provider;
bundle-copy: information about the bundle provider.
The file identification information is specifically a unique identifier in the bundle file, each bundle file has a unique identifier, and the identifier is composed of a symbolic name and a bundle version number of the bundle file.
The Bundle-SymbolincName is the symbolic name of Bundle file, which is consistent with the naming method of java package, and can directly adopt the package name as the symbolic name. The Bundle-Version, i.e. Bundle Version number, and the format of the Bundle file Version number agreed by the OSGI specification is as follows: major version number, minor version number, micro version number, qualifier.
Here, the preset configuration file includes at least one bundle file information, which is specifically bundle file information corresponding to the advertisement SDK. Specifically, the preset configuration file comprises an action to be executed by the advertisement SDK, a bundle file package name and a bundle file downloading address.
More specifically, the file format of the preset configuration file is as follows:
action, bundle file package name and bundle file url address;
advertisement id _1, advertisement name, advertisement type and advertisement material url address;
.........;
advertisement id _ n, advertisement name, advertisement type, advertisement material url address;
the advertisement type may be divided into advertisement display types, such as an advertisement SDK _ picture _ bundle file, an advertisement SDK _ text _ bundle file, an advertisement SDK _ video _ bundle file, and the like; the advertisement can be classified according to the display position and divided into advertisement position types, such as an advertisement SDK _ tile advertisement _ bundle file, an advertisement SDK _ power-on advertisement _ bundle file, an advertisement SDK _ timing advertisement _ bundle file, and the like. In practical application, the SDK of the corresponding advertisement can be realized according to specific conditions, compiled into a jar package and converted into a corresponding bundle file according to the file format.
The advertisement material is specifically the advertisement content to be displayed and the display information corresponding to the advertisement SDK. The advertisement material url address is a network download address for downloading the advertisement material required to be displayed.
Here, the conversion of the jar packet corresponding to the advertisement SDK into the bundle file may be implemented by a conversion tool in the preset service framework, for example, the metadata is added to a META-INF/manual entry of the jar file by using a bnd tool and converted into the bundle file.
In another specific embodiment of the present invention, a specific implementation flow of the method for obtaining the preset configuration file through the preset service framework is further included, which is specifically shown in fig. 2:
in step S201, a version number of the preset configuration file is obtained from the cloud server.
In step S202, the acquired version number of the preset configuration file is compared with the version number of the configuration file in the local server.
In step S203, if the version number of the acquired preset configuration file is greater than the version number of the configuration file in the local server, the version number of the configuration file in the local server is updated to the acquired version number of the configuration file through the preset service framework, and the configuration file corresponding to the acquired version number of the configuration file is downloaded.
In the embodiment of the invention, the advertisement developer stores the advertisement SDK of the latest version in the cloud server, so that the application in the Android system can conveniently obtain the advertisement SDK of the latest version.
Here, if the version number of the configuration file in the cloud server is equal to or smaller than the version number of the configuration file in the local server, it is indicated that the configuration file of the currently running bundle file is the latest version of the configuration file and does not need to be downloaded again.
In step S103, a bundle file corresponding to the advertisement SDK is loaded and started according to the preset configuration file.
In step S104, broadcast information including the start of the advertisement SDK is sent through the preset service framework, so that a preset application obtains display information of the advertisement SDK for advertisement display.
In the embodiment of the present invention, a specific implementation flow of step S103 loading and starting the bundle file corresponding to the advertisement SDK according to the preset configuration file is shown in fig. 3:
in step S301, the preset configuration file is analyzed, and a bundle file package name corresponding to the advertisement SDK in the preset configuration file is obtained.
In step S302, it is queried from a pre-established database whether a bundle file including the bundle file package name is stored.
In the embodiment of the invention, the pre-established database stores the related information of the bundle file, specifically including the bundle ID, the symbol name of the bundle, the version number and the running state of the bundle.
And the bundle ID is distributed from small to large by the OSGI framework according to the sequence of the loading time of the bundle file in the loading process of the bundle file.
Each advertisement SDK comprises a bundle file package name, the bundle file package name is specifically a bundle symbol name in the related information of the bundle file, and whether the bundle file comprising the bundle file package name is stored or not can be inquired from a pre-established database according to the bundle file package name.
If the pre-established database stores the bundle file comprising the bundle file package name, the advertisement SDK is loaded in the database, and the version of the configuration file corresponding to the advertisement SDK is the latest version.
In the embodiment of the invention, the pre-established database is the database which is established when the OSGI service framework is loaded in the Android system for the first time and the bundle file corresponding to the advertisement SDK is loaded and started through the acquired OSGI framework interface. That is, after the Android system is started, the bundle files corresponding to all the advertisement SDKs in the Android system are all in a starting state, that is, the advertisement SDKs are in a starting state, and information of all the bundle files, including a bundle ID, a symbol name, a version number and a bundle running state of the bundle, is stored in the established database.
In step S303, if no bundle file containing the bundle file package name is stored, an interface of a preset service framework is called to load and start the bundle file, and the database is updated.
In the embodiment of the invention, if the bundle file with the same name as the bundle file package name is stored in the database, the advertisement SDK corresponding to the bundle file is loaded in the system, and the bundle file does not need to be loaded and started again.
Herein, the step of calling an interface of a preset service framework to load and start the bundle file specifically includes:
binding a preset service frame, calling a BundleContext interface of the preset service frame, and installing and starting the bundle file through the BundleContext interface until all the bundle files are installed. When a bundle file is installed and started for the first time in an Android system, a database for storing the information of the bundle file is established so as to realize actions such as loading (updating) and unloading of the bundle file.
In an application scenario, an advertisement SDK newly developed by an advertisement developer carries a certain brand television advertisement, and the latest product including the television needs to be displayed on certain applications in the Android system. Assuming that the bundle file package name included in the advertisement SDK is com.tv.xxx, it needs to be shown in three applications in the Android system, which are application 1, application 2, and application 3, respectively, and the method can be implemented by the following steps:
A. the configuration file with the pre-compiled file version number of 0.0.1 is deployed in a cloud server, and the specific format of the configuration file is as follows:
add、com.tv.xxx、http://xxx.xxx.xxx
1. television, video, http:// yy.yy.yyy.y
B. Analyzing the configuration file, acquiring a bundle file package name corresponding to the advertisement SDK, inquiring whether a bundle file with the same bundle file package name as the bundle file package name is contained in a database, and if not, executing the step C; otherwise, exiting.
C. Binding an OSGI service framework to obtain a BundleContext;
D. install () and start () interfaces load and start the bundle file.
E. And updating the related information of the bundle file, such as the bundle ID, the symbol name of the bundle, the version number and the bundle starting state, into a database.
F. And sending the broadcast information started by the bundle file through an OSGI service framework.
G. The application 1, the application 2 and the application 3 respectively input the advertisement name of the television to the bundle file through a preset interface protocol, so that the bundle file analyzes the configuration file according to the advertisement name to obtain the corresponding advertisement material url address, the advertisement material in the advertisement material url address is downloaded and returned to the application as an output parameter, and the application receives the advertisement material and then displays the advertisement at the corresponding position.
Here, the specific steps of starting the bundle file corresponding to the advertisement SDK are as follows:
A. an OSGI framework instance, for example, a getframeworklnstance () method, is obtained through a proxy GetFrameworkSerivceProxy of a GetFrameworkSerivce service in an OSGI service framework.
B. Getboundlecontext () method obtains the BundleContext by calling framework.
C. Install a bundle file in a configuration file in a local server by calling a bundle context.
D. And acquiring the ID of the current Bundle by calling a getBundleid () method of the Bundle successfully returned by installation. And respectively acquiring the symbol name and the version number of the Bundle file by calling a getSymbolincName () method and getVersion () method of the Bundle.
E. The building database stores the symbol name, the version number and the bundle running state of each bundle ID and the bundle.
F. Start () method starts the bundle file.
Preferably, in order to reduce the running resources of the Android system and improve the running efficiency, when an application calling a certain advertisement SDK in the system is not displaying an advertisement, the running resources of the Android system may be reduced by unloading a bundle file corresponding to the advertisement SDK, and specifically, after step S102, a specific implementation flow of the advertisement SDK dynamic unloading method is further included, as shown in fig. 4:
in step S401, the preset configuration file is analyzed, and the bundle file package name corresponding to the advertisement SDK in the preset configuration file is acquired.
In step S402, a bundle file corresponding to the bundle file package corresponding to the advertisement SDK is queried from a pre-established database, and a bundle ID of the bundle file is acquired.
In step S403, broadcast information including uninstalling the advertisement SDK is sent through the preset service framework, so that a preset application stops obtaining the display information corresponding to the advertisement SDK.
In step S404, a preset interface is called through a preset service framework to uninstall the bundle file, and the database is updated.
In an application scenario of the embodiment of the present invention, assuming that an advertisement included in an advertisement SDK is a television advertisement of a certain brand, a bundle file package name included in the advertisement SDK is com.xxx.xxx, and three existing applications, namely application 1, application 2, and application 3, all need to show the advertisement in their own applications, when the three applications no longer need to show the advertisement due to a certain business contract or other system factors, the advertisement SDK may be uninstalled to reduce operating resources of an Android system by the following steps:
A. the method comprises the following steps of deploying a configuration file with a pre-compiled file version number higher than a local configuration file version number in an Android system in a cloud server, wherein the configuration file has a specific format as follows:
uninsatll、com.xxx.xxx、null
B. and analyzing the configuration file, acquiring the bundle file packet name corresponding to the advertisement SDK in the configuration file, and inquiring a bundle file with the same bundle file packet name as the bundle file packet name from a database.
C. Acquiring the bundle ID of the bundle file from a database
D. Advertising SDK notifies (e.g., by sending a broadcast) applications that rely on the advertising SDK to present advertisements to stop obtaining advertising material
E. Call the bundlecontext.uninstantall (id) interface in the OSGI service framework to uninstall the bundle file.
F. And updating the related information of the bundle file, such as the bundle ID, the symbol name of the bundle, the version number and the unloading state of the bundle, into a database.
In order to further reduce the operating resources of the Android system and save the bandwidth resources, after step S404, the method further includes:
broadcasting the advertisement SDK unloading information through a preset service frame to inform a preset application that the advertisement SDK is unloaded completely, so that the preset application does not request to acquire the bundle file corresponding to the advertisement SDK any more.
In the embodiment of the invention, the preset service frame is loaded in the Android system, and the bundle file corresponding to the advertisement SDK is loaded and started through the preset service frame to start the advertisement SDK, so that the preset application obtains the advertisement material information in the bundle file through the preset interface protocol without packing the advertisement SDK in the preset application, and thus when a plurality of applications need to load the same advertisement SDK, only the bundle file corresponding to the advertisement SDK needs to be loaded once through the preset service frame, the bundle file in the preset service frame is called according to the preset interface protocol to realize advertisement display, and jar packages do not need to be packed in each project of each application, the workload of packing the advertisement SDK is reduced, the working efficiency of the system is improved, and the problem of file increase caused by packing jar packages of each application is effectively avoided. Furthermore, when the application for displaying the advertisement does not need to display the advertisement again, the bundle file corresponding to the advertisement SDK is unloaded through the preset service framework without adaptive modification of the application for displaying the advertisement, so that the workload of the system is further reduced, and the working efficiency is improved.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
Corresponding to the advertisement SDK dynamic loading method described in the foregoing embodiment, fig. 5 illustrates a schematic diagram of an advertisement SDK dynamic loading apparatus provided in an embodiment of the present invention, and for convenience of description, only a part related to the embodiment of the present invention is shown.
Referring to fig. 5, the apparatus includes:
a frame loading unit 51, configured to load a preset service frame when the system is started;
a file obtaining unit 52, configured to obtain a preset configuration file through the preset service framework;
the file loading unit 53 is configured to load and start a bundle file corresponding to the advertisement SDK according to the preset configuration file;
and an information sending unit 54, configured to send broadcast information including the advertisement SDK started through the preset service framework, so that a preset application obtains display information of the advertisement SDK for advertisement display.
Further, the file acquiring unit 52 includes:
the version number obtaining subunit is used for obtaining the version number of the preset configuration file from the cloud server;
a version number comparison subunit, configured to compare the acquired version number of the preset configuration file with a configuration file version number in a local server;
and the file acquisition subunit is used for updating the version number of the configuration file in the local server to the acquired version number of the configuration file through the preset service framework and downloading the configuration file corresponding to the acquired version number of the configuration file if the acquired version number of the preset configuration file is greater than the version number of the configuration file in the local server.
Specifically, the file loading unit 53 includes:
the first file analysis subunit is used for analyzing the preset configuration file and acquiring the bundle file packet name corresponding to the advertisement SDK in the preset configuration file;
the first file inquiring subunit is used for inquiring whether a bundle file containing the bundle file package name is stored in a pre-established database;
and the file loading subunit is used for calling an interface of a preset service framework to load and start the bundle file and updating the database if the bundle file containing the bundle file package name is not stored.
Specifically, the file loading subcell is specifically configured to:
binding a preset service frame, calling a BundleContext interface of the preset service frame, and installing and starting the bundle file through the BundleContext interface.
Further, the apparatus further includes a file unloading unit, the file unloading unit including:
the second file analysis subunit is used for analyzing the preset configuration file and acquiring the bundle file packet name corresponding to the advertisement SDK in the preset configuration file;
the second file query subunit is used for querying a bundle file corresponding to the bundle file package name corresponding to the advertisement SDK from a pre-established database and acquiring the bundle ID of the bundle file;
the broadcast notification subunit is configured to send, through the preset service framework, broadcast information including uninstalling the advertisement SDK, so that a preset application stops obtaining display information corresponding to the advertisement SDK;
and the file unloading subunit is used for calling a preset interface through a preset service framework to unload the bundle file and updating the database.
Fig. 6 is a schematic diagram of a terminal according to an embodiment of the present invention. As shown in fig. 6, the terminal 6 of this embodiment includes: a processor 60, a memory 61 and a computer program 62 stored in said memory 61 and executable on said processor 60. The processor 60, when executing the computer program 62, implements the steps in the above-described embodiments of the advertisement SDK dynamic loading method, such as the steps 101 to 104 shown in fig. 1. Alternatively, the processor 60, when executing the computer program 62, implements the functions of the units in the above-described device embodiments, such as the functions of the modules 51 to 54 shown in fig. 5.
Illustratively, the computer program 62 may be divided into one or more units, which are stored in the memory 61 and executed by the processor 60 to accomplish the present invention. The one or more units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program 62 in the terminal 6. For example, the computer program 62 may be divided into a frame loading unit 51, a file acquiring unit 52, a file loading unit 53, and an information sending unit 54, and the specific functions of each unit are as follows:
a frame loading unit 51, configured to load a preset service frame when the system is started;
a file obtaining unit 52, configured to obtain a preset configuration file through the preset service framework;
the file loading unit 53 is configured to load and start a bundle file corresponding to the advertisement SDK according to the preset configuration file;
and an information sending unit 54, configured to send broadcast information including the advertisement SDK started through the preset service framework, so that a preset application obtains display information of the advertisement SDK for advertisement display.
The terminal 6 may be a desktop computer, a notebook, a palm computer, a smart phone, or other terminal equipment. The terminal 6 may include, but is not limited to, a processor 60, a memory 61. It will be appreciated by those skilled in the art that fig. 6 is only an example of a terminal 6 and does not constitute a limitation of the terminal 6, and that it may comprise more or less components than those shown, or some components may be combined, or different components, for example the terminal may further comprise input output devices, network access devices, buses, etc.
The Processor 60 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 61 may be an internal storage unit of the terminal 6, such as a hard disk or a memory of the terminal 6. The memory 61 may also be an external storage device of the terminal 6, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) and the like provided on the terminal 6. Further, the memory 61 may also include both an internal storage unit and an external storage device of the terminal 6. The memory 61 is used for storing the computer program and other programs and data required by the terminal. The memory 61 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other ways. For example, the above-described embodiments of the apparatus/terminal device are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (10)

1. An advertisement SDK dynamic loading method is characterized by comprising the following steps:
loading a preset service framework when a system is started; wherein the preset service framework is an OSGI service framework;
acquiring a preset configuration file through the preset service framework, wherein the preset configuration file comprises the following steps: converting a jar package corresponding to the advertisement SDK into a bundle file through a conversion tool in a preset service frame, wherein the preset configuration file comprises at least one bundle file information, and the bundle file information corresponding to the advertisement SDK comprises an action to be executed by the advertisement SDK, a bundle file package name and a bundle file downloading address;
loading and starting a bundle file corresponding to the advertisement SDK according to the preset configuration file; the advertisement SDK is a jar packet which is compiled and compiled by adopting Java language;
sending broadcast information containing the starting of the advertisement SDK through the preset service framework so that a preset application acquires display information of the advertisement SDK for advertisement display, wherein the advertisement display method comprises the following steps: and inputting an advertisement name to the bundle file through a preset interface protocol, so that the bundle file analyzes a configuration file according to the advertisement name to obtain a corresponding advertisement material url address, downloading the advertisement material in the advertisement material url address, returning the advertisement material as an output parameter to a preset application, and carrying out advertisement display at a corresponding position after the preset application receives the advertisement material.
2. The method of claim 1, wherein the step of obtaining the preset configuration file through the preset service framework further comprises:
acquiring the version number of the preset configuration file from a cloud server;
comparing the acquired version number of the preset configuration file with the version number of the configuration file in a local server;
and if the version number of the acquired preset configuration file is greater than the version number of the configuration file in the local server, updating the version number of the configuration file in the local server to the version number of the acquired configuration file through the preset service framework, and downloading the configuration file corresponding to the version number of the acquired configuration file.
3. The method according to claim 1 or 2, wherein the step of loading and starting the bundle file corresponding to the advertisement SDK according to the preset configuration file comprises:
analyzing the preset configuration file to obtain a bundle file packet name corresponding to the advertisement SDK in the preset configuration file;
inquiring whether a bundle file containing the bundle file package name is stored in a pre-established database;
and if the bundle file containing the bundle file package name is not stored, calling an interface of a preset service framework to load and start the bundle file, and updating the database.
4. The method of claim 1 or 2, wherein after the step of obtaining a preset configuration file through the preset service framework, further comprising:
analyzing the preset configuration file to obtain a bundle file packet name corresponding to the advertisement SDK in the preset configuration file;
inquiring a bundle file corresponding to the bundle file package name corresponding to the advertisement SDK from a pre-established database, and acquiring the bundle ID of the bundle file;
sending broadcast information containing uninstalled advertisement SDK through the preset service frame so that a preset application stops obtaining display information corresponding to the advertisement SDK;
and calling a preset interface through a preset service frame to unload the bundle file, and updating the database.
5. The method of claim 4, wherein the step of calling an interface of a preset service framework to load and start the bundle file specifically comprises:
binding a preset service frame, calling a BundleContext interface of the preset service frame, and installing and starting the bundle file through the BundleContext interface.
6. An advertisement SDK dynamic loading device, comprising:
the framework loading unit is used for loading a preset service framework when the system is started; wherein the preset service framework is an OSGI service framework;
the file acquisition unit is used for acquiring a preset configuration file through the preset service framework, and comprises: converting a jar package corresponding to the advertisement SDK into a bundle file through a conversion tool in a preset service frame, wherein the preset configuration file comprises at least one bundle file information, and the bundle file information corresponding to the advertisement SDK comprises an action to be executed by the advertisement SDK, a bundle file package name and a bundle file downloading address;
the file loading unit is used for loading and starting a bundle file corresponding to the advertisement SDK according to the preset configuration file; the advertisement SDK is a jar packet which is compiled and compiled by adopting Java language;
the information sending unit is configured to send broadcast information including the advertisement SDK started through the preset service framework so that a preset application obtains display information of the advertisement SDK for advertisement display, and includes: and inputting an advertisement name to the bundle file through a preset interface protocol, so that the bundle file analyzes a configuration file according to the advertisement name to obtain a corresponding advertisement material url address, downloading the advertisement material in the advertisement material url address, returning the advertisement material as an output parameter to a preset application, and carrying out advertisement display at a corresponding position after the preset application receives the advertisement material.
7. The apparatus of claim 6, wherein the file acquisition unit further comprises:
the version number obtaining subunit is used for obtaining the version number of the preset configuration file from the cloud server;
a version number comparison subunit, configured to compare the acquired version number of the preset configuration file with a configuration file version number in a local server;
and the file acquisition subunit is used for updating the version number of the configuration file in the local server to the acquired version number of the configuration file through the preset service framework and downloading the configuration file corresponding to the acquired version number of the configuration file if the acquired version number of the preset configuration file is greater than the version number of the configuration file in the local server.
8. The apparatus of claim 6 or 7, wherein the file loading unit comprises:
the file analysis subunit is used for analyzing the preset configuration file and acquiring the bundle file packet name corresponding to the advertisement SDK in the preset configuration file;
the file query subunit is used for querying whether a bundle file containing the bundle file package name is stored in a pre-established database;
and the file loading subunit is used for calling an interface of a preset service framework to load and start the bundle file and updating the database if the bundle file containing the bundle file package name is not stored.
9. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the advertisement SDK dynamic loading method according to any one of claims 1 to 5 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, carries out the steps of the method for dynamic loading of an advertisement SDK according to any one of claims 1 to 5.
CN201710513966.9A 2017-06-29 2017-06-29 Advertisement SDK dynamic loading method, device and terminal Active CN109213533B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710513966.9A CN109213533B (en) 2017-06-29 2017-06-29 Advertisement SDK dynamic loading method, device and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710513966.9A CN109213533B (en) 2017-06-29 2017-06-29 Advertisement SDK dynamic loading method, device and terminal

Publications (2)

Publication Number Publication Date
CN109213533A CN109213533A (en) 2019-01-15
CN109213533B true CN109213533B (en) 2021-08-06

Family

ID=64960561

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710513966.9A Active CN109213533B (en) 2017-06-29 2017-06-29 Advertisement SDK dynamic loading method, device and terminal

Country Status (1)

Country Link
CN (1) CN109213533B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109240733A (en) * 2017-07-03 2019-01-18 Tcl集团股份有限公司 A kind of method and terminal updating advertisement SDK based on Android system
CN111970542B (en) * 2020-08-21 2022-08-09 广州欢网科技有限责任公司 System and method for supporting SDK monitoring without upgrading self-advertising app compatibility of smart television
CN114528016A (en) * 2020-10-28 2022-05-24 花瓣云科技有限公司 Data processing system, method, terminal equipment and server
CN113377432A (en) * 2021-06-17 2021-09-10 上海臣星软件技术有限公司 Advertisement running method, device, equipment and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101571876A (en) * 2009-05-26 2009-11-04 华为技术有限公司 Script program operation logic expansion method, server and client

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101636457B1 (en) * 2009-12-28 2016-07-05 삼성전자주식회사 The image forming apparatus which operates based on framework can owns function among a plurality of bundle and method for installing of bundle in the image forming apparatus
US20140248943A1 (en) * 2013-02-28 2014-09-04 Joshua Marc Burgin Presenting sequenced sponsored content within an online game
FR3006526B1 (en) * 2013-05-29 2015-06-26 Univ Pau Et Des Pays De L Adour DYNAMIC LOADING OF APPLICATION COMPONENTS
US9411612B2 (en) * 2013-11-12 2016-08-09 Software Ag Techniques for creating and/or maintaining scalable heterogeneous read-only federations of registries
CN104780449A (en) * 2015-03-18 2015-07-15 福建新大陆通信科技股份有限公司 Method and system for screening unidirectional set-top box advertisement
CN105335289A (en) * 2015-11-05 2016-02-17 浙江大学 Rapid customization method of configuration driven testing platform software system
CN105511902B (en) * 2015-11-09 2019-11-12 Tcl集团股份有限公司 A kind of method and system of Android platform module dynamically load
CN105592086B (en) * 2015-12-22 2019-09-17 Tcl集团股份有限公司 A kind of method and device for Android platform managing firewall
CN105759965A (en) * 2016-02-16 2016-07-13 广东工业大学 Mobile advertisement interactive system and method based on Internet of Things
CN105843654A (en) * 2016-04-14 2016-08-10 广州市久邦数码科技有限公司 Method and system for implementing dynamic loading of advertisement SDK (software development kit)

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101571876A (en) * 2009-05-26 2009-11-04 华为技术有限公司 Script program operation logic expansion method, server and client

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
Design of an OSGi-Based WSN Gateway;Zhi Li ET AL;《 2013 IEEE 9th International Conference on Mobile Ad-hoc and Sensor Networks》;20140130;全文 *
ios下动态加载系统库文件的方法;胡必玲等;《合肥师范学院学报》;20151130;第33卷(第6期);全文 *
基于OSGi的移动广告平台订单系统;杨林等;《计算机系统应用》;20111231;第20卷(第3期);全文 *

Also Published As

Publication number Publication date
CN109213533A (en) 2019-01-15

Similar Documents

Publication Publication Date Title
CN109213533B (en) Advertisement SDK dynamic loading method, device and terminal
CN111930382B (en) Application page access method, device and equipment
CN104731625A (en) Method, device and mobile terminal for loading plugin
CN104077162A (en) Mobile terminal application template updating and issuing method and device
CN107133064B (en) Page hot updating method and device for native application
CN108279941B (en) Application program compression method and device
CN106569880B (en) Method and system for dynamically sharing resources between Android applications
CN105487905A (en) Updating method and device of hybrid application
CN106598678A (en) Method and device for supplying application installation packages to terminal equipment
JP2011516987A (en) Method and apparatus for managing mobile device software
CN107818023B (en) Thread-based message processing method, intelligent device and storage medium
CN109039730B (en) Server cluster and server cluster configuration information management method
CN103793248A (en) Method and device for upgrading application program
CN111625260A (en) Method and system based on mixed mobile application program upgrading
CN112631649A (en) Intelligent contract management method, device, terminal equipment and medium
CN113064685A (en) H5 page loading method and device
CN110888639A (en) Business code compiling and packaging method and device
CN101980503B (en) Method, device and system for managing widget application
CN109343970B (en) Application program-based operation method and device, electronic equipment and computer medium
CN108845800B (en) Method, device, equipment and storage medium for realizing component extension function
CN109683992B (en) Method and apparatus for managing objects
WO2023020071A1 (en) Upgrade package acquisition method and smart device
CN112732277B (en) Java multi-service application automatic installation and deployment integration method and system
CN110502251B (en) Application installation method and device
CN109669679B (en) Service detection and processing method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 516006 TCL science and technology building, No. 17, Huifeng Third Road, Zhongkai high tech Zone, Huizhou City, Guangdong Province

Applicant after: TCL Technology Group Co.,Ltd.

Address before: 516006 Guangdong province Huizhou Zhongkai hi tech Development Zone No. nineteen District

Applicant before: TCL RESEARCH AMERICA Inc.

GR01 Patent grant
GR01 Patent grant