CN111638906B - SDK (software development kit) access method, device and system - Google Patents

SDK (software development kit) access method, device and system Download PDF

Info

Publication number
CN111638906B
CN111638906B CN202010410070.XA CN202010410070A CN111638906B CN 111638906 B CN111638906 B CN 111638906B CN 202010410070 A CN202010410070 A CN 202010410070A CN 111638906 B CN111638906 B CN 111638906B
Authority
CN
China
Prior art keywords
sdk
application
version information
information
target
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
CN202010410070.XA
Other languages
Chinese (zh)
Other versions
CN111638906A (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.)
Zhengzhou Apas Digital Cloud Information Technology Co ltd
Original Assignee
Zhengzhou Apas Digital Cloud Information Technology 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 Zhengzhou Apas Digital Cloud Information Technology Co ltd filed Critical Zhengzhou Apas Digital Cloud Information Technology Co ltd
Priority to CN202010410070.XA priority Critical patent/CN111638906B/en
Publication of CN111638906A publication Critical patent/CN111638906A/en
Application granted granted Critical
Publication of CN111638906B publication Critical patent/CN111638906B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/315Object-oriented languages

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • Stored Programmes (AREA)

Abstract

The application discloses a Software Development Kit (SDK) access method, a device and a system, wherein the method comprises the following steps: acquiring an application identifier and version information of a target application from a project terminal; based on the application identification and the version information, acquiring a configuration file corresponding to the application identification and the version information from a background server, wherein the configuration file comprises parameter information of an SDK (software development kit) accessed to a target application and a service to which the SDK belongs; generating a target code for accessing the SDK and creating an empty class with a hook method based on the parameter information of the SDK and the service to which the SDK belongs; an empty class with a hook method is added to the project terminal, and object code is added to the empty class. Therefore, the empty class with the hook method can automatically call the code, so that the self-starting of the access SDK can be completed based on the hook method, the speed of accessing the SDK can be increased, and the software product development efficiency can be improved.

Description

SDK (software development kit) access method, device and system
Technical Field
The present application relates to the field of software development, and in particular, to a method, an apparatus, and a system for accessing a software development kit SDK.
Background
A Software Development Kit (SDK) may be understood as a collection of Development tools used by a worker to build application Software for a particular Software package, software framework, hardware platform, operating system, etc., to assist in developing relevant documents, paradigms, and tools for a certain class of Software products.
Generally, when relevant documents of a certain type of software products are developed, the SDK needs to be accessed in the software products, specifically, a worker may manually write access codes of the SDK and manually call the access codes in the software products, so as to complete access to the SDK.
However, the workload of the staff when writing and calling the access codes manually is large, which results in low working efficiency of the staff, and the speed of accessing the SDK is slow, which results in low efficiency when developing software products.
Disclosure of Invention
The embodiment of the application provides a software development kit SDK access method, device and system, which are used for solving the problem that the SDK access speed is low in the prior art, so that the efficiency in developing software products is low.
In order to solve the above technical problem, the embodiment of the present application is implemented as follows:
in a first aspect, a software development kit SDK access method is provided, which is applied to a plug-in server and includes:
acquiring an application identifier and version information of a target application from a project terminal;
acquiring a configuration file corresponding to the application identifier and the version information from a background server based on the application identifier and the version information, wherein the configuration file comprises parameter information of an SDK (software development kit) accessed to the target application and a service to which the SDK belongs;
generating a target code for accessing the SDK and creating an empty class with a hook method based on the parameter information of the SDK and the service to which the SDK belongs;
adding the empty class with the hook method to the project terminal, and adding the object code to the empty class.
In a second aspect, a software development kit SDK access apparatus is provided, which is applied to a plug-in server, and includes:
the first acquisition module is used for acquiring the application identifier and the version information of the target application from the project terminal;
a second obtaining module, configured to obtain, from a background server, a configuration file corresponding to the application identifier and the version information based on the application identifier and the version information, where the configuration file includes parameter information of an SDK accessed to the target application and a service to which the SDK belongs;
the generating module is used for generating a target code for accessing the SDK and creating an empty class with a hook method based on the parameter information of the SDK and the service to which the SDK belongs;
and the adding module is used for adding the empty class with the hook method to the project terminal and adding the target code to the empty class.
In a third aspect, an SDK access system for a software development kit is provided, which includes a project terminal, a background server and a plug-in server, wherein:
the project terminal stores application identification and version information of target application in advance;
the background server side stores a plurality of configuration files corresponding to different application identifications and version information in advance, and one configuration file comprises parameter information of an SDK (software development kit) accessed to one application;
the plug-in server side acquires the application identifier and the version information of the target application from the project terminal; acquiring a configuration file corresponding to the application identifier and the version information from the background server based on the application identifier and the version information, wherein the configuration file comprises parameter information of the SDK and the service to which the SDK belongs; generating a target code for accessing the SDK and creating an empty class with a hook method based on the parameter information included in the configuration file and the service to which the SDK belongs; adding the empty class with the hook method to the project terminal, and adding the object code to the empty class.
In a fourth aspect, an electronic device is provided, which includes:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to:
acquiring an application identifier and version information of a target application from a project terminal;
acquiring a configuration file corresponding to the application identifier and the version information from a background server based on the application identifier and the version information, wherein the configuration file comprises parameter information of an SDK (software development kit) accessed to the target application and a service to which the SDK belongs;
generating a target code for accessing the SDK and creating an empty class with a hook method based on the parameter information of the SDK and the service to which the SDK belongs;
adding the empty class with the hook method to the project terminal, and adding the object code to the empty class.
In a fifth aspect, a computer-readable storage medium is presented, the computer-readable storage medium storing one or more programs that, when executed by an electronic device comprising a plurality of application programs, cause the electronic device to perform the method of:
acquiring an application identifier and version information of a target application from a project terminal;
based on the application identifier and the version information, obtaining a configuration file corresponding to the application identifier and the version information from a background server, wherein the configuration file comprises parameter information of an SDK (software development kit) accessed to the target application and a service to which the SDK belongs:
generating a target code for accessing the SDK and creating an empty class with a hook method based on the parameter information of the SDK and the service to which the SDK belongs;
adding the empty class with the hook method to the project terminal, and adding the object code to the empty class.
The embodiment of the application adopts at least one technical scheme which can achieve the following beneficial effects:
according to the technical scheme provided by the embodiment of the application, when the SDK needs to be accessed into a certain target application, the plug-in server can acquire the application identification and the version information of the target application from the project terminal; acquiring corresponding parameter information including the SDK and a configuration file of the service to which the SDK belongs from a background server based on the application identifier and the version information; and generating object codes for accessing the SDK and creating an empty class with a hook method based on the configuration file, adding the empty class with the hook method to the project terminal, and adding the object codes to the empty class. Therefore, the empty class with the hook method can automatically call the code, so that after the target code is inserted into the empty class, the self-starting of the access SDK can be completed based on the hook method, and the target code of the access SDK does not need to be manually written and called, so that the speed of accessing the SDK can be increased, and the development efficiency of software products can be improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only some embodiments described in the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without any creative effort.
Fig. 1 is a schematic flowchart of an SDK access method of a software development kit according to an embodiment of the present application;
FIG. 2 is a flow chart illustrating a Software Development Kit (SDK) access method according to an embodiment of the present application;
FIG. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
FIG. 4 is a block diagram of an SDK access device according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an SDK access system of a software development kit according to an embodiment of the present application.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The main idea of the embodiment of the application is as follows: on the basis of the current project terminal (which can be understood as target terminal equipment accessing the SDK), a background server and a plug-in server are added, through interaction of the background server and the plug-in server, a target code for accessing the SDK is added into a null class with a hook method, and the target code for accessing the SDK is automatically called based on the self-characteristic (code can be automatically called) of the null class with the hook method, so that the self-starting of accessing the SDK is realized, the target code for accessing the SDK does not need to be manually written and called, the speed for accessing the SDK can be improved, and the development efficiency of software products is improved.
The technical solutions provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings.
Fig. 1 is a flowchart illustrating a software development kit SDK access method according to an embodiment of the present application. The execution subject of this embodiment may be a plug-in server, and the method is described below.
S102: and acquiring the application identification and the version information of the target application from the project terminal.
In S102, when a Software Development Kit (SDK) needs to be accessed to a certain target application, the plug-in server may obtain an application identifier and version information of the target application from the project terminal.
In this embodiment, the project terminal may store the application identifier and the version information of the target application in advance, and when the plug-in server wants to obtain the application identifier and the version information of the target application, the application identifier and the version information may be directly obtained from the project terminal.
Optionally, the project terminal may also pre-store the application identifier and the version information of the target application in a local target file (for example, a key file of an integrated development tool (XCode) project root directory of the target application), and when the plug-in server wants to obtain the application identifier and the version information of the target application, the plug-in server may obtain the target file from the project terminal, and may obtain the application identifier and the version information of the target application by analyzing the target file.
It should be noted that the application identifier and the version information of the target application stored in the project terminal may be created and obtained by the background server and acquired from the background server, or may be pre-stored in the project terminal after the application identifier and the version information of the target application are created and obtained by the background server, and the specific implementation manner may refer to the corresponding step in S104, which is not described in detail herein.
S104: and acquiring a configuration file corresponding to the application identifier and the version information from a background server based on the application identifier and the version information, wherein the configuration file comprises parameter information of the SDK accessed to the target application and the service of the SDK.
In S104, when the SDK needs to be accessed to a certain target application, the plugin server may obtain a configuration file corresponding to the application identifier and the version information from the background server based on the obtained application identifier and version information.
Specifically, the configuration file may be pre-stored in the background server, and when the plugin server needs to obtain the corresponding configuration file from the background server based on the application identifier and the version information of the target application, the plugin server may initiate a network request to the background server based on the application identifier and the version information of the target application, where the network request is used to request the background server to find whether the configuration file corresponding to the application identifier and the version information of the target application exists in the background server, and the background server pre-stores the configuration files corresponding to the application identifiers and the version information of different applications.
After receiving the network request, the background server may locally search whether to store a configuration file corresponding to the application identifier and the version information of the target application, and if so, the background server may return the configuration file to the plugin server, so that the plugin server may obtain the configuration file corresponding to the application identifier and the version information from the background server.
It should be noted that the configuration file is generated by the background server based on the service to which the SDK belongs and the parameter information of the SDK, where the service to which the SDK belongs is selected by the background server from the services to which a plurality of SDKs are previously recorded according to the service requirement of the target application, and the parameter information of the SDK is obtained by the background server after parameter setting is performed on the SDK template corresponding to the selected service to which the SDK belongs.
Generally, the parameter information of the SDK may include at least one of SDK dependency information, SDK template information, SDK configuration information (e.g., a configuration file named info. Plist), compilation options (Build Settings), and extension application information (extension app), wherein the SDK template information may include SDK template parameters and parameter values corresponding to the SDK template parameters, and the extension application information (extension app) may be understood as a specific application in the IOS operating system.
Optionally, the background server may generate data in a yaml format according to the service to which the SDK belongs and the parameter information of the SDK, and store the data in a configuration file, where the configuration file may specifically be a SDK-config.
In this embodiment, the background server may obtain the configuration file in advance by specifically:
the method comprises the following steps: and creating a plurality of services according to business requirements, and classifying the services. Such as advertising, statistics, etc.
Step two: the method comprises the steps of inputting a plurality of SDKs, setting services and version information of the SDKs.
On one hand, the plurality of SDKs can be recorded at one time at the background service end, so that the SDKs can be accessed based on the plurality of SDKs which are recorded in the background service end in advance when the SDKs are subsequently accessed, the access cost of the SDKs is reduced, and the access efficiency of the SDKs is improved. On the other hand, the services to which the plurality of SDKs belong can be set based on different services, and one SDK can correspond to one service, so that the user can directly select the SDK accessing the service corresponding to the service requirement based on the service requirement, and the operation complexity of the user can be reduced.
Further, library names may be specified for the plurality of SDKs, a version number of a public library (SDK) may be set, and version information of a service to which the plurality of SDKs belong may be set.
Optionally, in order to facilitate better subsequent access to the SDK, configuration information (info. Plist) and compilation options (Build Settings) may be added to multiple SDKs, and subsequently, when accessing the SDK, the configuration information (info. Plist) and compilation options (Build Settings) in the project terminal may be adaptively modified.
Optionally, in order to simplify a subsequent process of accessing the SDK, SDK templates may be created for different entered SDKs in the background server, and each SDK template includes corresponding SDK template parameters, where one SDK may correspond to one SDK template, so that when the SDK is subsequently accessed, the SDK that needs to be accessed may be directly determined based on the SDK template, thereby simplifying the process of accessing the SDK.
Step three: a plurality of application identifications are created.
According to different services, an application identifier can be created for each service, so that the SDK to be accessed can be conveniently determined based on the application identifier.
Step four: and creating a plurality of applications according to the business requirements.
The background server may add basic information to the multiple applications, which may specifically include names, package names, and basic data of the system to which the application belongs.
Step five: and selecting the service to which the SDK needing to be accessed belongs for a plurality of applications.
Specifically, according to the service requirement of the target application, the service to which the SDK to which the target application needs to access belongs may be selected from a plurality of services to which the SDKs are previously recorded.
Step six: and setting the parameter information of the SDK corresponding to the service according to the selected service.
The parameter information of the SDK may be obtained by performing parameter setting on an SDK template corresponding to the service to which the SDK belongs, and specifically, the parameter information of the SDK may be set according to the service to which the SDK needs to be accessed.
In summary, the background server may create a plurality of applications in advance, and may generate a plurality of configuration files in advance based on the plurality of applications, that is, the background server may store configuration files corresponding to different application identifiers and version information in advance (including configuration files of the target application), and when the configuration files of the target application need to be obtained, the plugin server may obtain the configuration files corresponding to the application identifiers and the version information from different configuration files stored in advance by the background server.
S106: and generating an object code for accessing the SDK and creating an empty class with a hook method based on the parameter information of the SDK and the service to which the SDK belongs.
In S106, the plug-in service end may download the acquired configuration file to the local, analyze the configuration file, obtain the SDK template information based on the analysis result (the parameter information of the SDK and the service to which the SDK belongs), and generate the target code for accessing the SDK according to the SDK template information.
Optionally, while generating the object code for accessing the SDK, the plug-in server may create a null class with a hook method based on the SDK template information.
It should be noted that the template method patterns in the design pattern can be divided into two main categories: template method and basic method, and the basic method can be divided into: abstract methods, concrete methods and hook methods, wherein a hook method is a null implementation for an abstract method or a method defined in an interface. The empty class with hook method in this embodiment may include a load method in a class method in Objective-C language, where a property in Objective-C language may be automatically called when the class is loaded, that is, a property of the empty class with hook method may be understood as a property of having an automatic call code when it is working. In this way, subsequent self-starting when accessing the SDK can be facilitated.
S108: adding the empty class with the hook method to the project terminal, and adding the object code to the empty class.
In S108, in order to facilitate completing automatically accessing the SDK, the empty class with the hook method may be added to the project terminal, and the object code may be added to the empty class, so that the empty class with the hook method may automatically call the code, and thus, after the object code is inserted into the empty class, the self-starting of accessing the SDK may be completed based on the hook method, and the object code accessing the SDK does not need to be manually written and called, so as to improve the speed of accessing the SDK, and further improve the efficiency of software product development.
In this embodiment, in order to avoid that the parameter information of the SDK does not adapt to the project terminal well when accessing the SDK, after adding the object code to the null class, the following operations may also be performed on the parameter information of the accessed SDK according to the actual situation:
firstly, the method comprises the following steps: in the case where the configuration information and the compiling option in the project terminal are not adapted to the SDK configuration information and the compiling option of the SDK, the SDK configuration information and the compiling option (Build Settings) of the SDK may be updated.
Secondly, the method comprises the following steps: whether a Podfile file is included in the project terminal can be determined, wherein the Podfile file is a configuration file of public library (SDK) dependency configuration and is used for managing dependency information of the public library. If so, the Podfile file may be updated based on the SDK dependency information; if not, a Podfile file may be generated based on the SDK dependency information.
Thirdly, the method comprises the following steps: it may be determined whether or not an extension application (extension app) needs to be created in the project terminal, and if necessary, a target (target) of the extension application (extension app) may be created based on the extension application (extension app) in the SDK parameter information.
Fourthly: in the case that the SDK is updated, a third-party open source library (e.g., cocoadods) may be called to update the SDK and the dependent library associated with the SDK to the project terminal, so that it may be avoided that the project terminal continues to use the non-updated SDK for access in the case that the SDK is updated.
It should be noted that, in an actual application scenario, the above operations are relatively independent, and there is no specific execution sequence, so that the flexibility of the SDK access method provided by this embodiment can be effectively improved.
Preferably, the plug-in server can be developed by using a ruby language, so that, on one hand, the ruby language is a language of an operating system and does not need to be additionally installed, and on the other hand, the ruby language is a script language and is superior to other compiling languages in the aspects of development, debugging and the like.
In addition, the background server provided by the application can be developed by adopting a server language, such as Delphi, C + +,. Net, java, php, python, and the like.
Optionally, in this embodiment, before accessing the SDK, a plug-in command may be preset, where the plug-in command may include a command for executing an object code for generating the SDK, and updating the SDK configuration information, the compiling option, and the like for accessing the SDK, and when a user writes the plug-in command into a command line, the plug-in command may be regarded as needing to access the SDK for the project terminal.
Optionally, in order to facilitate recording of various data generated in this embodiment, the background server provided in this embodiment may include a database, where the database may include service information of a service created according to a service requirement, basic information of a plurality of applications, parameter information of the SDK, data in a yaml format generated based on the service to which the SDK belongs and the parameter information of the SDK, a path for downloading the data in the yaml format to the local, and the like.
For facilitating understanding of the technical solutions provided in the embodiments of the present application, refer to fig. 2. Fig. 2 is a schematic flowchart of an embodiment of an SDK access method of a software development kit according to the present application, which may specifically include the following steps:
s201: and the background server side creates services in advance according to the service requirements.
The background server can classify the services, such as advertisement class, statistics class, and the like. And storing the service information into a database of the background server.
S202: the background server side inputs a plurality of SDKs in advance, and sets the services and version information of the plurality of SDKs.
In order to simplify the subsequent process of accessing the SDK, SDK templates may be created for different entered SDKs in the background server, and each SDK template includes corresponding SDK template parameters, where one SDK may correspond to one SDK template, and thus, when the SDK is subsequently accessed, the SDK to be accessed may be directly determined based on the SDK template, thereby simplifying the process of accessing the SDK.
Alternatively, the SDK template and template parameters may be saved to a database.
S203: the background server creates a plurality of application identifications in advance.
According to different services, an application identifier can be created for each service, so that the SDK to be accessed can be conveniently determined based on the application identifier.
S204: and the background server stores the application identification and the version information of the target application in a target file of the project terminal.
S205: and the background server side creates a plurality of applications in advance according to the service requirements.
The background server may add basic information to the multiple applications, and specifically may include a name, a package name, and basic data of the system to which the background server belongs.
S206: and the background server selects the service to which the SDK needing to be accessed belongs for a plurality of applications.
Specifically, the service to which the SDK that the target application needs to access belongs may be selected from services to which a plurality of SDKs that are previously entered according to the service requirement of the target application belong.
S207: and the background server sets the parameter information of the SDK corresponding to the selected service according to the selected service.
Specifically, the parameter information of the SDK may be set according to the service to which the SDK that the target application needs to access belongs.
S208: and the background server generates a configuration file according to the service and parameter information of the SDK.
The configuration file is generated by the background server side based on the service to which the SDK belongs and the parameter information of the SDK, wherein the service to which the SDK belongs is selected by the background server side from a plurality of pre-recorded services to which the SDK belongs according to the service requirement of the target application, and the parameter information of the SDK is obtained by the background server side after parameter setting is carried out on the SDK template corresponding to the selected service to which the SDK belongs.
S209: and the plug-in server acquires the target file from the project terminal and analyzes the target file to obtain the application identifier and the version information of the target application.
Specifically, the plug-in server may analyze the target file by using a plug-in developed in the ruby language to obtain an application identifier and version information of the target application.
S210: and the plug-in server acquires a corresponding configuration file from the background server according to the application identifier and the version information.
Specifically, the plug-in server may initiate a network request to the background server based on the application identifier and the version information of the target application acquired from the project terminal, find whether a configuration file corresponding to the application identifier and the version information exists in the background server, and if so, may acquire the configuration file corresponding to the application identifier and the version information from the background server.
S211: and the plug-in server analyzes the configuration file to obtain the parameter information of the SDK and the service to which the SDK belongs.
S212: and the plug-in service terminal generates a target code for accessing the SDK and creates an empty class with a hook method based on the parameter information of the SDK and the service to which the SDK belongs.
And obtaining SDK template information based on the parameter information of the SDK and the service to which the SDK belongs, generating a target code for accessing the SDK according to the SDK template information, and creating a null class with a hook method.
It should be noted that the property of the null class with hook method can be understood as the property of having an automatic calling code when working. In this way, subsequent self-starting when accessing the SDK can be facilitated.
S213: and the plug-in server adds the empty class with the hook method to the project terminal and adds the object code to the empty class.
In order to facilitate the completion of the automatic access of the SDK, the empty class with the hook method can be added into the project terminal, and the target code is added into the empty class, so that the empty class with the hook method can automatically call the code, and after the target code is inserted into the empty class, the self-starting of the access of the SDK can be completed based on the hook method, the target code for accessing the SDK does not need to be manually written and called, so that the speed of accessing the SDK can be increased, and the development efficiency of software products can be improved.
S214: and the plug-in server updates the SDK configuration information and the compiling options of the SDK.
In the case where the configuration information (info.plist) and the compilation option (Build Settings) in the project terminal are not properly matched with the SDK configuration information (info.plist) and the compilation option (Build Settings) of the SDK, the SDK configuration information (info.plist) and the compilation option (Build Settings) of the SDK may be updated.
S215: and the plug-in server establishes the target of the extended application based on the extended application in the SDK parameter information.
Specifically, it may be determined whether or not an extension application (extension app) needs to be created in the project terminal, and if necessary, a target (target) of the extension application (extension app) may be created based on the extension application (extension app) in the SDK parameter information.
S216: and the plug-in service end updates the Podfile file in the project terminal.
Specifically, the plug-in server may determine whether the project terminal includes the Podfile file, and if so, may update the Podfile file based on the SDK dependency information; and if not, the plug-in server generates a Podfile file based on the SDK dependency information.
S217: and updating the SDK and the dependency base associated with the SDK into the project terminal.
In the case that the SDK is changed, a third-party open source library (e.g., cocoadods) may be called to update the SDK and the dependency library associated with the SDK to the project terminal, so that it is avoided that the project terminal continues to use the unrefreshed SDK for access even when the SDK is updated.
According to the technical scheme provided by the embodiment of the application, when the SDK needs to be accessed into a certain target application, the plug-in server can acquire the application identification and the version information of the target application from the project terminal; acquiring corresponding parameter information including the SDK and a configuration file of the service to which the SDK belongs from a background server based on the application identifier and the version information; and generating object codes for accessing the SDK and creating an empty class with a hook method based on the configuration file, adding the empty class with the hook method to the project terminal, and adding the object codes to the empty class. Therefore, the empty class with the hook method can automatically call the code, so that after the target code is inserted into the empty class, the self-starting of the access SDK can be completed based on the hook method, and the target code of the access SDK does not need to be manually written and called, so that the speed of accessing the SDK can be increased, and the development efficiency of software products can be improved.
The foregoing description of specific embodiments of the present application has been presented. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
Fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present application. Referring to fig. 3, at a hardware level, the electronic device includes a processor, and optionally further includes an internal bus, a network interface, and a memory. The Memory may include a Memory, such as a Random-Access Memory (RAM), and may further include a non-volatile Memory, such as at least 1 disk Memory. Of course, the electronic device may also include hardware required for other services.
The processor, the network interface, and the memory may be connected to each other via an internal bus, which may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 3, but this does not indicate only one bus or one type of bus.
And the memory is used for storing programs. In particular, the program may include program code comprising computer operating instructions. The memory may include both memory and non-volatile storage and provides instructions and data to the processor.
The processor reads a corresponding computer program from the nonvolatile memory into the memory and then runs the computer program to form the software development kit SDK access device on a logic level. The processor is used for executing the program stored in the memory and is specifically used for executing the following operations:
acquiring an application identifier and version information of a target application from a project terminal;
acquiring a configuration file corresponding to the application identifier and the version information from a background server based on the application identifier and the version information, wherein the configuration file comprises parameter information of an SDK (software development kit) accessed to the target application and a service to which the SDK belongs;
generating a target code for accessing the SDK and creating an empty class with a hook method based on the parameter information of the SDK and the service to which the SDK belongs;
adding the empty class with the hook method to the project terminal, and adding the object code to the empty class.
The method performed by the software development kit SDK access device according to the embodiment shown in fig. 3 of the present application may be applied to or implemented by a processor. The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or instructions in the form of software. The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), application Specific Integrated Circuits (ASICs), field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory, and a processor reads information in the memory and completes the steps of the method in combination with hardware of the processor.
The electronic device may further execute the method in fig. 1, and implement the functions of the software development kit SDK access apparatus in the embodiment shown in fig. 1, which is not described herein again in this embodiment of the present application.
Of course, besides the software implementation, the electronic device of the present application does not exclude other implementations, such as a logic device or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and may also be hardware or a logic device.
Embodiments of the present application also provide a computer-readable storage medium storing one or more programs, where the one or more programs include instructions, which when executed by a portable electronic device including a plurality of application programs, enable the portable electronic device to perform the method of the embodiment shown in fig. 1, and are specifically configured to:
acquiring an application identifier and version information of a target application from a project terminal;
acquiring a configuration file corresponding to the application identifier and the version information from a background server based on the application identifier and the version information, wherein the configuration file comprises parameter information of an SDK (software development kit) accessed to the target application and a service to which the SDK belongs;
generating a target code for accessing the SDK and creating an empty class with a hook method based on the parameter information of the SDK and the service to which the SDK belongs;
adding the empty class with the hook method to the project terminal, and adding the object code to the empty class.
Fig. 4 is a schematic structural diagram of the software development kit SDK access device 40 according to an embodiment of the present application. Referring to fig. 4, in a software implementation, the software development kit SDK access device 40 is applied to a plug-in server, and may include: a first obtaining module 41, a second obtaining module 42, a generating module 43, and an adding module 44, wherein:
a first obtaining module 41, configured to obtain an application identifier and version information of a target application from a project terminal;
a second obtaining module 42, configured to obtain, from a background server, a configuration file corresponding to the application identifier and the version information based on the application identifier and the version information, where the configuration file includes parameter information of an SDK accessed to the target application and a service to which the SDK belongs;
a generating module 43, which generates an object code for accessing the SDK and creates an empty class with a hook method based on the parameter information of the SDK and the service to which the SDK belongs;
and the adding module 44 is used for adding the empty class with the hook method to the project terminal and adding the object code to the empty class.
Optionally, the configuration file is generated by the background server based on the service to which the SDK belongs and the parameter information of the SDK, wherein the service to which the SDK belongs is selected by the background server from a plurality of services to which the SDKs belong, which are previously entered according to the service requirement of the target application, and the parameter information of the SDK is obtained by the background server after parameter setting is performed on the SDK template corresponding to the selected service to which the SDK belongs.
Optionally, the parameter information of the SDK includes at least one of SDK dependency information, SDK template information, SDK configuration information, compilation option, and extended application information;
the SDK template information comprises SDK template parameters and parameter values corresponding to the SDK template parameters.
Optionally, the second obtaining module 42 generates an object code for accessing the SDK based on the parameter information of the SDK and the service to which the SDK belongs, and includes:
and generating the target code for accessing the SDK based on the SDK template information.
Optionally, the adding module 44 further updates the SDK configuration information and the compiling option after adding the object code to the empty class.
Optionally, the SDK accessing apparatus 40 further includes a determining module 45, where:
the judging module 45 judges whether the SDK is changed after the adding module 44 adds the empty class with the hook method to the project terminal and adds the object code to the empty class;
if so, calling a third-party open source library, and updating the SDK and a dependency library associated with the SDK into the project terminal.
Optionally, the second obtaining module 42, based on the application identifier and the version information, obtains, from a background server, a configuration file corresponding to the application identifier and the version information, and includes:
based on the application identification and the version information, whether a configuration file corresponding to the application identification and the version information exists is searched in the background server, and the configuration file corresponding to different application identifications and version information is stored in the background server in advance;
and if so, acquiring a configuration file corresponding to the application identifier and the version information.
The first obtaining module 41 obtains the application identifier and version information of the target application from the project terminal, and includes:
reading a target file from the project terminal, wherein the target file is obtained by the project terminal after acquiring the application identifier and the version information from the background server side and storing the application identifier and the version information, and the target file comprises the application identifier and the version information;
and analyzing the target file to obtain the application identification and the version information of the target application.
The software development kit SDK access device 40 provided in this embodiment of the present application may further execute the method in fig. 1 and fig. 2, and implement the functions of the software development kit SDK access device in the embodiments shown in fig. 1 and fig. 2, which are not described herein again.
Fig. 5 is a schematic structural diagram of an SDK access system of a software development kit according to an embodiment of the present application. Please refer to fig. 5.
The software development kit SDK access system shown in fig. 5 includes a project terminal 51, a background server 52 and a plug-in server 53, where:
the project terminal 51 stores the application identifier and version information of the target application in advance;
the background server 52 prestores a plurality of configuration files corresponding to different application identifiers and version information, and one configuration file includes parameter information of an SDK accessing one application;
the plug-in server 53 obtains the application identifier and version information of the target application from the project terminal 51; based on the application identifier and the version information, obtaining a configuration file corresponding to the application identifier and the version information from the background server 52, where the configuration file includes parameter information of the SDK and a service to which the SDK belongs; generating a target code for accessing the SDK and creating an empty class with a hook method based on the parameter information included in the configuration file and the service to which the SDK belongs; adding the empty class with the hook method to the project terminal, and adding the object code to the empty class.
The project terminal 51 provided in this application example can implement each process implemented by the terminal device in the method embodiment of fig. 1 to fig. 2, the background server 52 can implement each process implemented by the server in the method embodiment of fig. 1 to fig. 2, and the plug-in server 53 can implement each process implemented by the server in the method embodiment of fig. 1 to fig. 2, and is not described here again to avoid repetition.
In short, the above description is only a preferred embodiment of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. The use of the phrase "including a" does not exclude the presence of other, identical elements in the process, method, article, or apparatus that comprises the same element, whether or not the same element is present in all of the same element.
The embodiments in the present application are described in a progressive manner, and the same and similar parts among the embodiments can be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.

Claims (12)

1. A Software Development Kit (SDK) access method is applied to a plug-in server and comprises the following steps:
acquiring an application identifier and version information of a target application from a project terminal;
acquiring a configuration file corresponding to the application identifier and the version information from a background server based on the application identifier and the version information, wherein the configuration file comprises parameter information of an SDK (software development kit) accessed to the target application and a service to which the SDK belongs;
generating a target code for accessing the SDK and creating an empty class with a hook method based on the parameter information of the SDK and the service to which the SDK belongs;
adding the empty class with the hook method to the project terminal, and adding the object code to the empty class.
2. The method of claim 1,
the configuration file is generated by the background server based on the service to which the SDK belongs and the parameter information of the SDK, wherein the service to which the SDK belongs is selected by the background server from a plurality of pre-recorded services to which the SDK belongs according to the service requirement of the target application, and the parameter information of the SDK is obtained by the background server after parameter setting is performed on the SDK template corresponding to the selected service to which the SDK belongs.
3. The method of claim 1,
the parameter information of the SDK comprises at least one of SDK dependency information, SDK template information, SDK configuration information, compiling options and extended application information;
the SDK template information comprises SDK template parameters and parameter values corresponding to the SDK template parameters.
4. The method of claim 3, wherein generating an object code for accessing the SDK based on the parameter information of the SDK and a service to which the SDK belongs comprises:
and generating the target code for accessing the SDK based on the SDK template information.
5. The method of claim 3, wherein after adding the object code to the null class, the method further comprises:
and updating the SDK configuration information and the compiling options.
6. The method of claim 1, wherein after adding the empty class with hooking method to the project terminal and adding the object code to the empty class, the method further comprises:
judging whether the SDK is changed or not;
if so, calling a third-party open source library, and updating the SDK and the dependency library associated with the SDK into the project terminal.
7. The method of claim 1, wherein obtaining a configuration file corresponding to the application identifier and the version information from a backend server based on the application identifier and the version information comprises:
based on the application identification and the version information, whether a configuration file corresponding to the application identification and the version information exists is searched in the background server, and the configuration file corresponding to different application identifications and version information is stored in the background server in advance;
and if so, acquiring a configuration file corresponding to the application identifier and the version information.
8. The method of claim 1, wherein obtaining the application identification and version information of the target application from the project terminal comprises:
reading a target file from the project terminal, wherein the target file is obtained by the project terminal after acquiring the application identifier and the version information from the background server side and storing the application identifier and the version information, and the target file comprises the application identifier and the version information;
and analyzing the target file to obtain the application identification and the version information of the target application.
9. A Software Development Kit (SDK) access system is characterized by comprising a project terminal, a background server and a plug-in server, wherein:
the project terminal stores an application identifier and version information of a target application in advance;
the background server side stores a plurality of configuration files corresponding to different application identifications and version information in advance, and one configuration file comprises parameter information of an SDK (software development kit) accessed to one application;
the plug-in server side acquires the application identifier and the version information of the target application from the project terminal; acquiring a configuration file corresponding to the application identifier and the version information from the background server based on the application identifier and the version information, wherein the configuration file comprises parameter information of the SDK and the service to which the SDK belongs; generating a target code for accessing the SDK and creating an empty class with a hook method based on the parameter information included in the configuration file and the service to which the SDK belongs; adding the empty class with the hook method to the project terminal, and adding the object code to the empty class.
10. A Software Development Kit (SDK) access device is applied to a plug-in server and comprises the following components:
the first acquisition module is used for acquiring an application identifier and version information of a target application from the project terminal;
a second obtaining module, configured to obtain, from a background server, a configuration file corresponding to the application identifier and the version information based on the application identifier and the version information, where the configuration file includes parameter information of an SDK accessed to the target application and a service to which the SDK belongs;
the generating module is used for generating a target code for accessing the SDK and creating an empty class with a hook method based on the parameter information of the SDK and the service to which the SDK belongs;
and the adding module is used for adding the empty class with the hook method to the project terminal and adding the target code to the empty class.
11. An electronic device, comprising:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to:
acquiring an application identifier and version information of a target application from a project terminal;
acquiring a configuration file corresponding to the application identifier and the version information from a background server based on the application identifier and the version information, wherein the configuration file comprises parameter information of an SDK (software development kit) accessed to the target application and a service to which the SDK belongs;
generating a target code for accessing the SDK and creating an empty class with a hook method based on the parameter information of the SDK and the service to which the SDK belongs;
adding the empty class with the hook method to the project terminal, and adding the object code to the empty class.
12. A computer-readable storage medium storing one or more programs which, when executed by an electronic device including a plurality of application programs, cause the electronic device to perform a method of:
acquiring an application identifier and version information of a target application from a project terminal;
acquiring a configuration file corresponding to the application identifier and the version information from a background server based on the application identifier and the version information, wherein the configuration file comprises parameter information of an SDK (software development kit) accessed to the target application and a service to which the SDK belongs;
generating a target code for accessing the SDK and creating an empty class with a hook method based on the parameter information of the SDK and the service to which the SDK belongs;
adding the empty class with the hook method to the project terminal, and adding the object code to the empty class.
CN202010410070.XA 2020-05-15 2020-05-15 SDK (software development kit) access method, device and system Active CN111638906B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010410070.XA CN111638906B (en) 2020-05-15 2020-05-15 SDK (software development kit) access method, device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010410070.XA CN111638906B (en) 2020-05-15 2020-05-15 SDK (software development kit) access method, device and system

Publications (2)

Publication Number Publication Date
CN111638906A CN111638906A (en) 2020-09-08
CN111638906B true CN111638906B (en) 2023-02-03

Family

ID=72330341

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010410070.XA Active CN111638906B (en) 2020-05-15 2020-05-15 SDK (software development kit) access method, device and system

Country Status (1)

Country Link
CN (1) CN111638906B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112181388B (en) * 2020-09-25 2024-03-01 广州虎牙科技有限公司 Initializing method and device of SDK (software development kit) component, storage medium and control terminal
CN112463128A (en) * 2020-12-08 2021-03-09 北京指掌易科技有限公司 Software development kit behavior control method and device
CN112546622A (en) * 2020-12-09 2021-03-26 广州博冠信息科技有限公司 Method, device, storage medium and computer equipment for realizing game live broadcast in application
CN112667509B (en) * 2020-12-28 2023-04-07 郑州阿帕斯数云信息科技有限公司 SDK access test method and device
CN112764729B (en) * 2021-01-08 2024-02-06 深圳依时货拉拉科技有限公司 Application software development method, device, computer equipment and readable storage medium
CN113986387A (en) * 2021-10-28 2022-01-28 上海米哈游璃月科技有限公司 Project configuration information loading method and device, electronic equipment and storage medium
CN114363990B (en) * 2021-12-28 2024-01-12 上海黑眸智能科技有限责任公司 Equipment end network distribution method and system compatible with multiple APP, equipment end and APP end
CN114637514A (en) * 2022-03-29 2022-06-17 上海移远通信技术股份有限公司 SDK compiling method, device, terminal and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107463359A (en) * 2016-06-02 2017-12-12 深圳市慧动创想科技有限公司 A kind of convenient method in iOS ipa bag code implants
CN107589947A (en) * 2017-08-02 2018-01-16 成都极娱网络科技有限公司 A kind of SDK cut-in methods, client and system
CN107704260A (en) * 2017-10-31 2018-02-16 广东小天才科技有限公司 A kind of method and system for the SDK for updating application software
CN108563435A (en) * 2018-04-19 2018-09-21 北京百度网讯科技有限公司 The method and device of code building
CN109976761A (en) * 2019-02-27 2019-07-05 平安科技(深圳)有限公司 Generation method, device and the terminal device of Software Development Kit
CN110196712A (en) * 2019-04-15 2019-09-03 成都飞逸计算机服务有限公司 Software development methodology and server based on Cloud Server
CN110531985A (en) * 2019-08-09 2019-12-03 浙江大搜车软件技术有限公司 SDK initial method and system, electronic equipment, storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170147323A1 (en) * 2015-11-25 2017-05-25 Le Holding (Beijing) Co., Ltd. Method and electronic device for upgrading software development kit of an application
CN110442373B (en) * 2018-05-02 2022-12-16 中移(苏州)软件技术有限公司 Copyright information adding method, device and medium
CN110990020A (en) * 2019-11-24 2020-04-10 苏州浪潮智能科技有限公司 Software compiling method and device, electronic equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107463359A (en) * 2016-06-02 2017-12-12 深圳市慧动创想科技有限公司 A kind of convenient method in iOS ipa bag code implants
CN107589947A (en) * 2017-08-02 2018-01-16 成都极娱网络科技有限公司 A kind of SDK cut-in methods, client and system
CN107704260A (en) * 2017-10-31 2018-02-16 广东小天才科技有限公司 A kind of method and system for the SDK for updating application software
CN108563435A (en) * 2018-04-19 2018-09-21 北京百度网讯科技有限公司 The method and device of code building
CN109976761A (en) * 2019-02-27 2019-07-05 平安科技(深圳)有限公司 Generation method, device and the terminal device of Software Development Kit
CN110196712A (en) * 2019-04-15 2019-09-03 成都飞逸计算机服务有限公司 Software development methodology and server based on Cloud Server
CN110531985A (en) * 2019-08-09 2019-12-03 浙江大搜车软件技术有限公司 SDK initial method and system, electronic equipment, storage medium

Also Published As

Publication number Publication date
CN111638906A (en) 2020-09-08

Similar Documents

Publication Publication Date Title
CN111638906B (en) SDK (software development kit) access method, device and system
CN111124906B (en) Tracking method, compiling method and device based on dynamic embedded points and electronic equipment
CN107992307B (en) Function compiling method and device
US10025694B1 (en) Monitoring activity of software development kits using stack trace analysis
CN109033772B (en) Verification information input method and device
CN111124480B (en) Method and device for generating application program package, electronic equipment and storage medium
CN106776266B (en) Configuration method of test tool and terminal equipment
CN111984264B (en) Static library generation method and device
CN111399840A (en) Module development method and device
CN114064594A (en) Data processing method and device
CN116610568A (en) Method, device, equipment and medium for identifying dependency relationship of codes
CN111596951A (en) Method and device for configuring engineering file
CN114268538A (en) Configuration method and device of front-end route
CN113946803A (en) Method and device for automatic bypass by having anti-debugging mechanism for target program
CN111949297B (en) Block chain intelligent contract upgrading method and device and electronic equipment
CN110442353B (en) Installation package management method and device and electronic equipment
CN108133123B (en) Application program identification method and system
CN108563578B (en) SDK compatibility detection method, device, equipment and readable storage medium
CN111475148A (en) Third-party dependent library isolation method and device, electronic equipment and storage medium
CN115794214A (en) Application module metadata management method, device, storage medium and device
CN114528214A (en) Unit testing method and device
CN112711405B (en) Method, equipment and storage medium for generating add-delete-modify-check application program interface
CN110688430B (en) Method and device for obtaining data bypass and electronic equipment
CN109840273B (en) Method and device for generating file
CN112486497A (en) Compiling configuration file generation method and device, electronic equipment and storage medium

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
GR01 Patent grant
GR01 Patent grant