CN114968200A - Software development kit assembly method, related device and computer program product - Google Patents

Software development kit assembly method, related device and computer program product Download PDF

Info

Publication number
CN114968200A
CN114968200A CN202210730841.2A CN202210730841A CN114968200A CN 114968200 A CN114968200 A CN 114968200A CN 202210730841 A CN202210730841 A CN 202210730841A CN 114968200 A CN114968200 A CN 114968200A
Authority
CN
China
Prior art keywords
target
component
software development
development kit
functional
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.)
Pending
Application number
CN202210730841.2A
Other languages
Chinese (zh)
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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and 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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202210730841.2A priority Critical patent/CN114968200A/en
Publication of CN114968200A publication Critical patent/CN114968200A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/10Requirements analysis; Specification techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • 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/70Software maintenance or management
    • G06F8/73Program documentation

Landscapes

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

Abstract

The disclosure provides a software development kit assembling method, a related device and a computer program product, and relates to the technical field of software development and component assembly. The method comprises the following steps: acquiring a target function requirement of a target software development kit to be created; determining a target function component for realizing the target function requirement; the method comprises the following steps that a plurality of functional components and a plurality of dependent components are split according to a known software development kit in advance according to a minimum functional unit; determining a target dependent component which enables the target functional component to normally operate through a preset routing framework and a byte code modification technology; the routing framework is used for realizing normal calling among the components; and assembling each target function component and each dependency component through the route annotation in the route frame to obtain the target software development kit. The scheme improves the generation efficiency of the customized software development kit, the automation degree is higher, the manual intervention is less, and the development effort is reduced.

Description

Software development kit assembly method, related device and computer program product
Technical Field
The present disclosure relates to the field of data processing technologies, and in particular, to the field of software development and component assembly technologies, and in particular, to a method and an apparatus for assembling a software development kit, an electronic device, a computer-readable storage medium, and a computer program product.
Background
Android (Chinese name: Android) service function SDK (Software Development Kit) often needs to modify modules to complete required SDKs due to some customization requirements, which wastes a great deal of research and Development energy to complete the combination and capability assembly of the modules.
In the face of such customization requirements, a branch is usually pulled from a code library, and overall customization requirement development is completed on the basis of the branch, and part of functions are packaged into a function library for direct reference, for example, some demanding parties need sharing capability on an SDK tape, and some demanding parties need DNS (Domain Name System) resolution capability on the SDK tape, so that customization development on the branch is needed, and development efforts and cost are still consumed.
Disclosure of Invention
The embodiment of the disclosure provides a software development kit assembling method, a software development kit assembling device, electronic equipment, a computer readable storage medium and a computer program product.
In a first aspect, an embodiment of the present disclosure provides a software development kit assembling method, including: acquiring a target function requirement of a target software development kit to be created; determining a target function component for realizing the target function requirement; the method comprises the following steps that a plurality of functional components and a plurality of dependent components are split according to a known software development kit in advance according to a minimum functional unit; determining a target dependent component which enables the target functional component to normally operate through a preset routing framework and a byte code modification technology; the routing framework is used for realizing normal calling among the components; and assembling each target function component and each dependency component through the route annotation in the route frame to obtain the target software development kit.
In a second aspect, an embodiment of the present disclosure provides a software development kit assembling device, including: a target function requirement acquisition unit configured to acquire a target function requirement of a target software development kit to be created; a target function component determination unit configured to determine a target function component for achieving the target function requirement; the method comprises the following steps that a plurality of functional components and a plurality of dependent components are split according to a known software development kit in advance according to a minimum functional unit; the target dependent component determining unit is configured to determine a target dependent component enabling the target functional component to normally operate through a preset routing framework and a byte code modification technology; the routing framework is used for realizing normal calling among the components; and the target software development kit generating unit is configured to assemble each target function component and each dependency component through the route annotation in the route frame to obtain the target software development kit.
In a third aspect, an embodiment of the present disclosure provides an electronic device, including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to cause the at least one processor to perform the method of assembling a software development kit as described in any one of the implementations of the first aspect when executed.
In a fourth aspect, the disclosed embodiments provide a non-transitory computer-readable storage medium storing computer instructions for enabling a computer to implement the software development kit assembly method as described in any one of the implementations of the first aspect when executed.
In a fifth aspect, the embodiments of the present disclosure provide a computer program product comprising a computer program, which when executed by a processor is capable of implementing the software development kit assembly method as described in any implementation manner of the first aspect.
According to the software development kit assembly scheme, a target function component which is split from a known software development kit and corresponds to a target function requirement is determined according to the obtained target function requirement of the target software development kit, then a target dependent component for enabling the target function component to be normally executed is more flexibly and accurately determined in a primary compiling process by means of a pre-constructed routing framework and a bytecode modification technology, and finally normal assembly of the target function component and the target dependent component is completed through routing annotation of the routing framework to obtain the target software development kit. The scheme improves the generation efficiency of the customized software development kit, the automation degree is higher, the manual intervention is less, and the development effort is reduced.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
Other features, objects and advantages of the disclosure will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture to which the present disclosure may be applied;
FIG. 2 is a flowchart of a software development kit assembly method provided by an embodiment of the present disclosure;
FIG. 3 is a flowchart of a method for splitting a functional component and a dependent component according to an embodiment of the present disclosure;
FIG. 4 is a flowchart of a method for generating a target code set according to an embodiment of the present disclosure;
FIG. 5 is a flow chart of a method of determining a target dependent component provided by an embodiment of the present disclosure;
FIG. 6 is a flowchart of a method for assembling a target software development kit according to an embodiment of the present disclosure;
fig. 7 is a block diagram of a software development kit assembling apparatus according to an embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of an electronic device adapted to execute a software development kit assembly method according to an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of embodiments of the present disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness. It should be noted that, in the present disclosure, the embodiments and features of the embodiments may be combined with each other without conflict.
In the technical scheme of the disclosure, the collection, storage, use, processing, transmission, provision, disclosure and other processing of the personal information of the related user are all in accordance with the regulations of related laws and regulations and do not violate the good customs of the public order.
Fig. 1 illustrates an exemplary system architecture 100 to which embodiments of the software development kit assembly method, apparatus, electronic device, and computer-readable storage medium of the present disclosure may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. Various applications for realizing information communication between the terminal devices 101, 102, 103 and the server 105, such as an SDK development application, an SDK processing application, an instant messaging application, etc., may be installed on the terminal devices 101, 102, 103 and the server 105.
The terminal apparatuses 101, 102, 103 and the server 105 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices with display screens, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like; when the terminal devices 101, 102, and 103 are software, they may be installed in the electronic devices listed above, and they may be implemented as multiple software or software modules, or may be implemented as a single software or software module, and are not limited in this respect. When the server 105 is hardware, it may be implemented as a distributed server cluster composed of multiple servers, or may be implemented as a single server; when the server is software, the server may be implemented as a plurality of software or software modules, or may be implemented as a single software or software module, which is not limited herein.
The server 105 may provide various services through various built-in applications, and taking an SDK development class application that may provide an SDK assembly class service as an example, the server 105 may implement the following effects when running the electronic album class application: firstly, receiving target function requirements of a target software development kit to be created, which are transmitted by terminal equipment 101, 102 and 103 through a network 104; secondly, determining a target function component for realizing the target function requirement, and splitting a plurality of function components and a plurality of dependency components according to a known software development kit according to a minimum function unit in advance; then, determining a target dependent component enabling the target functional component to normally operate through a preset routing framework and a byte code modification technology, wherein the routing framework is used for realizing normal calling among the components; finally, assembling each target function component and each dependency component through the route annotation in the route framework to obtain the target software development kit.
Further, the server 105 may send the developed target software development kit to the terminal devices 101, 102, and 103 directly through the network 104, so that the terminal devices 101, 102, and 103 may perform localization processing based on the target software development kit, or may provide only calling interfaces to the terminal devices 101, 102, and 103.
It should be noted that the target function requirements of the target software development kit may be temporarily acquired from the terminal devices 101, 102, and 103 through the network 104, or may be stored locally in the server 105 in advance in various ways. Thus, when the server 105 detects that such data is already stored locally (e.g., a pending task remaining before starting processing), it may choose to retrieve such data directly from locally, in which case the exemplary system architecture 100 may also not include the terminal devices 101, 102, 103 and the network 104.
The software development kit assembling method provided in the subsequent embodiments of the present disclosure is generally performed by the server 105 having the software development kit generating capability, and accordingly, the software development kit assembling apparatus is also generally disposed in the server 105. However, it should be noted that when the terminal devices 101, 102, and 103 also have the capability and resource meeting the requirements, the terminal devices 101, 102, and 103 may also complete the above operations performed by the server 105 through the SDK development application installed thereon, and then output the same result as the server 105. Particularly, when there are a plurality of terminal devices having different computation capabilities at the same time, but the SDK development application determines that the terminal device has a strong computation capability and a large amount of computing resources are left, the terminal device may execute the above computation, so as to appropriately reduce the computation pressure of the server 105, and accordingly, the software development kit assembly apparatus may be provided in the terminal devices 101, 102, and 103. In such a case, the exemplary system architecture 100 may also not include the server 105 and the network 104.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring to fig. 2, fig. 2 is a flowchart of a software development kit assembly method according to an embodiment of the present disclosure, where the process 200 includes the following steps:
step 201: acquiring a target function requirement of a target software development kit to be created;
this step is intended to acquire, by an execution subject of the software development kit assembly method (e.g., the server 105 shown in fig. 1), the target function requirements of the target software development kit that the user wants.
The target function requirement is used for describing the function requirement of a user on a target software development kit, and the software development kit with a specific requirement on an image aspect is taken as an example and may be required to have an image classification capability, a portrait recognition capability, a portrait part deduction function and the like; for example, a software development kit with specific requirements for speech may require speech-to-text capability, denoising capability, human voice highlighting capability, etc.
Step 202: determining a target function component for realizing the target function requirement;
on the basis of step 201, this step is intended to determine a target function component for realizing a target function requirement by the execution subject described above. The functional components are components which can realize single functions and are obtained by splitting a large number of known software development kits, and the target functional components are specific functional components which can be used for realizing target function requirements in all the split functional components. Without additional requirements, a single functional requirement may correspond to only a single functional component, while a complex functional component may correspond to only a collection of functional components.
In addition, after a large number of known software development kits are split, in addition to obtaining functional components capable of implementing a single function, dependent components for ensuring normal execution of the functional components, such as a running environment component, a running library, a function library, a precondition library, and the like, can be usually split, that is, one software development kit can be considered to be composed of the functional components and the dependent components.
Step 203: determining a target dependent component which enables the target functional component to normally operate through a preset routing framework and a byte code modification technology;
on the basis of step 202, this step is intended to determine the target dependent component that makes the target functional component operate normally, and the determination is made in a way that is determined by a preset routing framework and bytecode modification technology for realizing normal call between components.
The routing framework is used for determining that each functional component can normally operate so as to meet the requirement of the target function, and in order to ensure that each functional component can normally operate, a target dependent component which can normally execute the functional components needs to be further determined according to the selected target functional component, and the target dependent components are assembled in a proper manner, namely, operation time sequence. Meanwhile, in order to enable the functional components to be matched with each other and realize normal circulation and identification of data in the functional components, a uniform format and a data processing standard which the functional components should follow are also agreed on the routing framework.
To achieve the purpose of "write once, run everywhere", Virtual Machine providers have released many JVMs (Java Virtual machines) that can run on different platforms, and the role of the Virtual machines is to load and execute a kind of bytecode independent of the platform. In short, the Java program has two stages from writing completion to running, wherein the first stage is to compile Java files into class files; the second phase is the JVM load class file, interpret and execute.
The bytecode of the class file is modified, so that the function of the modified part can be enabled to be effective by reloading the modified bytecode without modifying the Java program. Among them, the bytecode modification technology generally includes the following categories:
ASM: a lightweight bytecode operation framework, which directly relates to JVM bottom layer operations and instructions; CGLIB: the method belongs to a dynamic weaving (after byte code loading) technology, is realized based on ASM, and has high performance; JAVAssist: the method belongs to a dynamic weaving technology, is simple to operate, has a strong interface and has poorer performance than ASM; ASPECTJ: static weave-in (before bytecode loading) framework, commonly used for AOP programming framework.
Taking a bytecode modification technology defined by a dynamic weaving framework as an example, a bytecode file can be written into an agent through a JVM (a set of interface tools for operating the JVM provided by the JVM, event hooks are registered through an interface, and predefined hooks are triggered when a JVM event is triggered), and after a Java program is started, the bytecode file is dynamically loaded into a virtual machine in an Attach API (capability of communication between provided JVM processes), so that modification of the bytecode is realized.
Step 204: and assembling each target function component and each dependency component through the route annotation in the route framework to obtain the target software development kit.
On the basis of step 203, the step is to be implemented by the execution subject through specific calls of each functional component recorded in the route annotation in the route framework, so as to assemble each target functional component and each dependency component according to the contents, and finally obtain the target software development kit. Namely, the route annotation is configured in advance and recorded in the routing framework, and the route annotation mainly records the specific implementation (such as interface, calling code and the like) of mutual calling between the functional components in detail in an annotated manner.
According to the method for assembling the software development kit, the target function component which is split from the known software development kit and corresponds to the target function requirement is determined according to the obtained target function requirement of the target software development kit, then the target dependent component used for enabling the target function component to be normally executed is more flexibly and accurately determined in the primary compiling process by means of a pre-constructed routing framework and a byte code modification technology, and finally the normal assembly of the target function component and the target dependent component is completed through the routing annotation of the routing framework, so that the target software development kit is obtained. The scheme improves the generation efficiency of the customized software development kit, the automation degree is higher, the manual intervention is less, and the development effort is reduced.
In order to better understand how to split the functional components and the dependent components according to the known software development kit, the embodiment further illustrates an implementation manner of splitting the functional components and the dependent components through fig. 3, which may be taken as a pre-step in the process 200 that supports the normal execution of the step 202, where the process 300 includes the following steps:
step 301: acquiring a known software development kit and corresponding known function requirements;
step 302: determining an original code set corresponding to each known functional requirement according to a known software development kit;
step 303: synthesizing a plurality of original code sets with known function requirements, and determining a target code set;
steps 301-303 describe how to obtain the target code set corresponding to each known function requirement from a plurality of known software development kits, that is, obtaining a plurality of known software development kits and the known function requirements corresponding to the known software development kits first; then, the original code sets corresponding to each known functional requirement are separated from the known software development kit, and since even though the same known functional requirement may appear as different original code sets, then a plurality of original code sets of the same known functional requirement are subjected to comprehensive processing to determine the target code set uniquely corresponding to the known functional requirement.
Specifically, during the comprehensive processing, a specific code language and a specific code format may be selected as specific requirements of the target code set, and what code language and code format are specifically selected may be flexibly selected according to actual situations, which is not specifically limited herein.
Step 304: separating partial codes contained in the target code set and used for providing calling interfaces for the outside;
step 305: packaging the target code set with the part of codes removed into a functional component corresponding to the integrated functional requirement;
on the basis of step 303, step 304 and step 304 describe how to obtain an implementation scheme of the functional component, that is, first, a part of code included in the target code set for providing a call interface to the outside is separated to remove a part of the function requirement corresponding to the target code set for providing a call capability to the outside, so that the functional component obtained by final encapsulation no longer includes a capability for providing a call interface to the outside, thereby avoiding a call exception or a function exception caused by the functional component obtained by encapsulation including an unnecessary function.
Step 306: and determining a dependent code set for enabling the functional components to normally run, and packaging the dependent code set to obtain a plurality of dependent components.
On the basis of step 303, this step is intended to determine, by the execution body described above, a dependent code set for causing the functional component to operate normally, and encapsulate a plurality of dependent components according to the dependent code set.
Step 306, consistent with the integration process provided in step 303, may also employ the same integration process when determining the dependent code set.
Through steps 301 to 306, the present embodiment provides a specific implementation manner for obtaining a functional component and a dependent component according to a known software development kit by splitting, and in particular includes removing a part of code which may be included in the functional component and is used for providing a call function to the outside when the functional component is obtained by encapsulation, so that the functional component is only used for implementing a corresponding function, and further, a call exception or a function exception is avoided when each functional component is subsequently used.
Furthermore, part of the code separated in step 304 may be packaged as a calling interface component corresponding to the function component, that is, the part of the code for implementing the externally provided calling function is declared as a single calling interface component in a packaging manner, so that the software development kit can be minimally unitized, and the software development kit with specific requirements can be assembled in an automated manner.
Referring to fig. 4, fig. 4 is a flowchart of a method for generating a target code set according to an embodiment of the present disclosure, that is, a specific implementation manner is provided for step 303 in the flow 300 shown in fig. 3, other steps in the flow 300 are not adjusted, and a new complete embodiment is obtained by replacing step 303 with the specific implementation manner provided in this embodiment. Wherein the process 400 comprises the following steps:
step 401: determining an object format to be followed by the codes in the object code set;
step 402: converting each original code set with the same known function requirement into a new code set with a target format;
step 403: and unifying the variable names in each new code set to obtain a target code set.
Steps 401 to 403 describe a comprehensive processing scheme of code sets using a predetermined target format and a uniform variable name, that is, converting each original code set required by a known function into a new code set in the target format, specifically, if there is an original code set in the target format, the original code set may be retained and the original code sets in other formats may be directly deleted, and if there is no original code set in the target format, the new code set in the target format needs to be obtained by converting the code format; then, unifying the variable names in each new code set is to remove the constraints of different known software development toolkit contexts, so that the obtained target code set is more universal.
Referring to fig. 5, fig. 5 is a flowchart of a method for determining a target dependent component according to an embodiment of the present disclosure, that is, a specific implementation manner is provided for step 203 in the flowchart 200 shown in fig. 2, other steps in the flowchart 200 are not adjusted, and a new complete embodiment is obtained by replacing step 203 with the specific implementation manner provided in this embodiment. Wherein the process 500 comprises the following steps;
step 501: performing preliminary compiling on each target function component through an initial routing framework to obtain a preliminary compiling result;
step 502: and determining a dependency missing part in the preliminary compiling result through a byte code modification technology, and determining a target dependency component corresponding to the dependency missing part according to the routing annotation of the routing framework.
That is, in this embodiment, each target function component is first primarily compiled through an initial routing framework to obtain a primary compilation result, then a dependency missing portion in the primary compilation result is determined through a bytecode modification technology on the basis of the primary compilation result, and finally a target dependency component corresponding to the dependency missing portion is determined according to a routing annotation of the routing framework.
Referring to fig. 6, fig. 6 is a flowchart of a method for assembling a target software development kit according to an embodiment of the present disclosure, that is, a specific implementation manner is provided for step 204 in the flow 200 shown in fig. 2, other steps in the flow 200 are not adjusted, and the specific implementation manner provided in this embodiment is used to replace step 204 to obtain a new complete embodiment. Wherein the process 600 comprises the following steps:
step 601: modifying the initial routing framework by using a target dependent component through a routing annotation and bytecode modification technology;
step 602: and injecting implementation contents for normally calling each component into the corrected routing framework, and adding a calling interface component of the functional component with the external calling requirement into an external outlet to obtain a target software development kit.
That is, in this embodiment, an initial routing frame is modified by using a target dependent component through a routing annotation and bytecode modification technology, then implementation contents for normally calling each component are injected into the modified routing frame to obtain the modified routing frame, and then a call interface component of a functional component having a need for external call is added to an external outlet of the modified routing frame to finally obtain a target software development kit.
In order to better understand the solution provided by the present application, the present embodiment further combines a specific implementation scenario to provide a specific implementation solution, which includes the following implementation points:
1): splitting the existing SDK into various components according to functions, and if a certain component has an external interface, independently extracting the component into a calling interface component;
2): developing a routing framework and a routing annotation library, marking the specific implementation of the interface externally provided by each component through routing annotation, injecting the specific implementation into the routing framework through a byte code modification technology during compiling, and completing all the calls to the functions of other components by acquiring corresponding routing annotation;
3) using a compiling plug-in, completing the modification of a routing framework through a routing annotation and a byte code modification technology, injecting a specific implementation into the routing framework, adding an external interface of the component into an external outlet of the SDK, and further dynamically generating a method for providing an integral SDK to the outside;
4) the SDK compiling engineering is needed, namely, mainly compiling plug-ins are integrated and external outlet interface classes are predefined, and then the needed functional components can be generated by the compiling system through the compiling plug-ins.
The above-mentioned realization main points can be split into two systems at the implementation level, namely component split and routing system and compiling plug-in bytecode modification system, wherein:
a) component splitting and routing system
1. All functions need to be split into components with smaller granularity according to function modules, if a component has an Interface provided for the outside, the component needs to be separately declared as a component of an Interface (API), the implementation of the API needs to be completed, and the service implementation of the corresponding Interface needs to be declared by using annotations;
2. when the interfaces provided by other components are used, the interfaces are directly acquired through the routing framework and can be directly called;
3. the routing interface and the routing annotation complete the construction and the realization of the whole routing framework, and the routing framework depends on the byte code modification technology of the compiling plug-in.
b) Compiling plug-in byte code modification system
The compiling plug-in byte code modification system mainly has two functions, the first function is to act on a routing framework, and the calling implementation of all the components providing services is injected into the routing framework so as to facilitate the calling of other components; the second aspect is that all the initialization entry classes of the whole assembly are scanned and uniformly injected into the exit interface classes in the SDK compiling project, and the initialization entry classes are transmitted to the corresponding assemblies in the whole SDK life cycle method, for example, the initialization interfaces, and some new interfaces of some assemblies for the SDK are modified through byte codes, and the new methods are also added into the SDK entry classes, so that a plurality of functional interfaces which need to be provided externally are added into the SDK, and the SDK entry classes do not need to be modified independently.
With further reference to fig. 7, as an implementation of the methods shown in the above-mentioned figures, the present disclosure provides an embodiment of a software development kit assembling device, which corresponds to the embodiment of the method shown in fig. 2, and which can be applied in various electronic devices.
As shown in fig. 7, the software development kit assembling apparatus 700 of the present embodiment may include: a target function requirement obtaining unit 701, a target function component determining unit 702, a target dependent component determining unit 703, and a target software development kit generating unit 704. The target function requirement acquiring unit 701 is configured to acquire a target function requirement of a target software development kit to be created; a target function component determination unit 702 configured to determine a target function component for implementing the target function requirement; the method comprises the following steps that a plurality of functional components and a plurality of dependent components are split according to a known software development kit in advance according to a minimum functional unit; a target dependent component determining unit 703 configured to determine a target dependent component that enables the target functional component to operate normally through a preset routing framework and a bytecode modification technique; the routing framework is used for realizing normal calling among the components; and the target software development kit generating unit 704 is configured to assemble each target function component and each dependency component through the route annotation in the routing framework to obtain the target software development kit.
In the present embodiment, in the software development kit assembling apparatus 700: the specific processes of the target function requirement obtaining unit 701, the target function component determining unit 702, the target dependent component determining unit 703 and the target software development kit generating unit 704 and the technical effects thereof can refer to the related descriptions of step 201 and step 204 in the corresponding embodiment of fig. 2, which are not described herein again.
In some optional implementations of this embodiment, the software development kit assembling apparatus 700 may further include:
a sample acquisition unit configured to acquire a known software development kit and corresponding known functional requirements;
an original code set determination unit configured to determine an original code set corresponding to each known functional requirement according to a known software development kit;
a target code set determining unit configured to determine a target code set by integrating a plurality of original code sets of the same known function requirement;
the separation unit is configured to separate partial codes contained in the target code set and used for providing a calling interface for the outside;
a functional component packaging unit configured to package the target code set from which the partial code is removed as a functional component corresponding to the integrated functional requirement;
and the dependent component packaging unit is configured to determine a dependent code set for enabling the functional component to normally run, and package the dependent components according to the dependent code set to obtain a plurality of dependent components.
In some optional implementations of this embodiment, the software development kit assembling apparatus 700 may further include:
and the calling interface component packaging unit is configured to package the separated part of the code into a calling interface component corresponding to the functional component.
In some optional implementations of this embodiment, the target code set determining unit may be further configured to:
determining an object format to be followed by the codes in the object code set;
converting each original code set with the same known function requirement into a new code set with a target format;
and unifying the variable names in each new code set to obtain a target code set.
In some optional implementations of this embodiment, the target dependent component determining unit 703 may be further configured to:
performing preliminary compiling on each target function component through an initial routing framework to obtain a preliminary compiling result;
and determining a dependency missing part in the preliminary compiling result through a byte code modification technology, and determining a target dependency component corresponding to the dependency missing part according to the routing annotation of the routing framework.
In some optional implementations of this embodiment, the target software development kit generating unit 704 may be further configured to:
modifying the initial routing framework by using a target dependent component through a routing annotation and bytecode modification technology;
and injecting implementation contents for normally calling each component into the corrected routing framework, and adding a calling interface component of the functional component with the external calling requirement into an external outlet to obtain a target software development kit.
The present embodiment exists as an apparatus embodiment corresponding to the method embodiment, and the software development kit assembling apparatus provided by the present embodimentAccording to the obtained target function requirement of the target software development kit, determining a target function component which is split from a known software development kit and corresponds to the target function requirement, then determining a target dependent component which is used for enabling the target function component to normally execute more flexibly and more accurately in a preliminary compiling process by means of a pre-constructed routing framework and a bytecode modification technology, and finally completing normal assembly of the target function component and the target dependent component through routing annotation of the routing framework to obtain the target software development kit. The scheme improves the generation efficiency of the customized software development kit, the automation degree is higher, the manual intervention is less, and the development effort is reduced.
According to an embodiment of the present disclosure, the present disclosure also provides an electronic device including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to cause the at least one processor to perform the software development kit assembly method described in any of the above embodiments when executed.
According to an embodiment of the present disclosure, there is also provided a readable storage medium storing computer instructions for enabling a computer to implement the software development kit assembling method described in any of the above embodiments when executed.
According to an embodiment of the present disclosure, there is also provided a computer program product, which when executed by a processor is capable of implementing the software development kit assembly method described in any of the above embodiments.
FIG. 8 illustrates a schematic block diagram of an example electronic device 800 that can be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 8, the apparatus 800 includes a computing unit 801 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM)802 or a computer program loaded from a storage unit 808 into a Random Access Memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored. The calculation unit 801, the ROM 802, and the RAM 803 are connected to each other by a bus 804. An input/output (I/O) interface 805 is also connected to bus 804.
A number of components in the device 800 are connected to the I/O interface 805, including: an input unit 806, such as a keyboard, a mouse, or the like; an output unit 807 such as various types of displays, speakers, and the like; a storage unit 808, such as a magnetic disk, optical disk, or the like; and a communication unit 809 such as a network card, modem, wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
Computing unit 801 may be a variety of general and/or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and the like. The computing unit 801 performs the various methods and processes described above, such as the software development kit assembly method. For example, in some embodiments, the software development kit assembly method may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 808. In some embodiments, part or all of the computer program can be loaded and/or installed onto device 800 via ROM 802 and/or communications unit 809. When loaded into RAM 803 and executed by computing unit 801, a computer program may perform one or more steps of the software development kit assembly method described above. Alternatively, in other embodiments, the computing unit 801 may be configured to perform the software development kit assembly method by any other suitable means (e.g., by way of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The Server may be a cloud Server, which is also called a cloud computing Server or a cloud host, and is a host product in a cloud computing service system, so as to solve the defects of high management difficulty and weak service extensibility in the conventional physical host and Virtual Private Server (VPS) service.
According to the technical scheme of the embodiment of the disclosure, the target function component which is split from the known software development kit and corresponds to the target function requirement is determined according to the obtained target function requirement of the target software development kit, then the target dependent component used for enabling the target function component to be normally executed is more flexibly and accurately determined in the primary compiling process by means of a pre-constructed routing framework and a bytecode modification technology, and finally the normal assembly of the target function component and the target dependent component is completed through the routing annotation of the routing framework, so that the target software development kit is obtained. The scheme improves the generation efficiency of the customized software development kit, the automation degree is higher, the manual intervention is less, and the development effort is reduced.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved, and the present disclosure is not limited herein.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.

Claims (15)

1. A software development kit assembly method, comprising:
acquiring a target function requirement of a target software development kit to be created;
determining a target functional component for implementing the target functional requirement; the method comprises the following steps that a plurality of functional components and a plurality of dependent components are split according to a known software development kit in advance according to a minimum functional unit;
determining a target dependent component enabling the target functional component to normally operate through a preset routing framework and a byte code modification technology; wherein the routing framework is used for realizing normal calling between components;
and assembling each target function component and each dependency component through the route annotation in the route framework to obtain the target software development kit.
2. The method of claim 1, further comprising:
acquiring the known software development toolkit and corresponding known function requirements;
determining an original code set corresponding to each of the known functional requirements according to the known software development kit;
synthesizing a plurality of original code sets of the same known function requirement to determine a target code set;
separating partial code contained in the target code set and used for providing a calling interface for the outside;
packaging the target code set with the partial codes removed into a functional component corresponding to the integrated functional requirement;
and determining a dependent code set for enabling the functional components to normally run, and packaging the dependent codes to obtain a plurality of the dependent components.
3. The method of claim 2, further comprising:
and packaging the separated part of codes into a calling interface component corresponding to the functional component.
4. The method of claim 2, wherein the synthesizing a plurality of original code sets of the same known functional requirement to determine a target code set comprises:
determining an object format to which the code in the object code set should conform;
converting each original code set of the same known function requirement into a new code set of the target format;
and unifying the variable names in the new code sets to obtain the target code set.
5. The method of any one of claims 1-4, wherein the determining, by a preset routing framework and bytecode modification technique, the target dependent component that makes the target functional component function properly comprises:
performing preliminary compiling on each target function component through an initial routing framework to obtain a preliminary compiling result;
determining a dependency missing part in the preliminary compiling result through the byte code modification technology, and determining a target dependency component corresponding to the dependency missing part according to the routing annotation of the routing framework.
6. The method of claim 3, wherein said assembling each of said target functional components and each of said dependent components through a routing annotation in said routing framework to obtain said target software development kit comprises:
revising an initial routing framework using the target dependent component via the route annotation and the bytecode modification technique;
and injecting implementation contents for normally calling each component into the corrected routing framework, and adding a calling interface component of the functional component with the external calling requirement into an external outlet to obtain the target software development kit.
7. A software development kit assembly apparatus, comprising:
a target function requirement acquisition unit configured to acquire a target function requirement of a target software development kit to be created;
a target function component determination unit configured to determine a target function component for implementing the target function requirement; the method comprises the following steps that a plurality of functional components and a plurality of dependent components are split according to a known software development kit in advance according to a minimum functional unit;
the target dependent component determining unit is configured to determine a target dependent component enabling the target functional component to normally operate through a preset routing framework and a byte code modification technology; wherein the routing framework is used for realizing normal calling between components;
and the target software development kit generating unit is configured to assemble each target function component and each dependency component through the route annotation in the routing framework to obtain the target software development kit.
8. The apparatus of claim 7, further comprising:
a sample acquisition unit configured to acquire the known software development kit and corresponding known functional requirements;
an original code set determination unit configured to determine an original code set corresponding to each of the known functional requirements from the known software development kit;
a target code set determining unit configured to determine a target code set by integrating a plurality of original code sets of the same kind of known function requirements;
a separation unit configured to separate a part of code included in the target code set for providing a call interface to outside;
a functional component packaging unit configured to package the target code set from which the partial code is removed as a functional component corresponding to the integrated functional requirement;
and the dependent component packaging unit is configured to determine a dependent code set for enabling the functional components to normally run, and package the dependent components according to the dependent codes to obtain a plurality of the dependent components.
9. The apparatus of claim 8, further comprising:
and the calling interface component packaging unit is configured to package the separated part of the code into a calling interface component corresponding to the functional component.
10. The apparatus of claim 8, wherein the target code set determination unit is further configured to:
determining an object format to which the code in the object code set should conform;
converting each original code set of the same known function requirement into a new code set of the target format;
and unifying the variable names in the new code sets to obtain the target code set.
11. The apparatus of any of claims 7-10, wherein the target dependent component determination unit is further configured to:
performing preliminary compiling on each target function component through an initial routing framework to obtain a preliminary compiling result;
determining a dependency missing part in the preliminary compiling result through the byte code modification technology, and determining a target dependency component corresponding to the dependency missing part according to the routing annotation of the routing framework.
12. The apparatus of claim 9, wherein the target software development kit generation unit is further configured to:
modifying an initial routing framework using the target dependent component via the route annotation and the bytecode modification technique;
and injecting implementation contents for normally calling each component into the corrected routing framework, and adding a calling interface component of the functional component with the external calling requirement into an external outlet to obtain the target software development kit.
13. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the software development kit assembly method of any one of claims 1-6.
14. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the software development kit assembly method of any one of claims 1-6.
15. A computer program product comprising a computer program which, when executed by a processor, carries out the steps of the software development kit assembly method according to any one of claims 1 to 6.
CN202210730841.2A 2022-06-24 2022-06-24 Software development kit assembly method, related device and computer program product Pending CN114968200A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210730841.2A CN114968200A (en) 2022-06-24 2022-06-24 Software development kit assembly method, related device and computer program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210730841.2A CN114968200A (en) 2022-06-24 2022-06-24 Software development kit assembly method, related device and computer program product

Publications (1)

Publication Number Publication Date
CN114968200A true CN114968200A (en) 2022-08-30

Family

ID=82965076

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210730841.2A Pending CN114968200A (en) 2022-06-24 2022-06-24 Software development kit assembly method, related device and computer program product

Country Status (1)

Country Link
CN (1) CN114968200A (en)

Similar Documents

Publication Publication Date Title
CN105718289B (en) Component relation establishing method and equipment
CN113010181B (en) Deployment method and device of operators in deep learning framework and electronic equipment
US20140089893A1 (en) Dynamically building locale objects or subsections of locale objects based on historical data
CN111367510A (en) Android function module development method and device
CN111427569B (en) Method and device for adapting installation-free program, electronic equipment and storage medium
CN110895471A (en) Installation package generation method, device, medium and electronic equipment
CN111427583A (en) Component compiling method and device, electronic equipment and computer readable storage medium
CN111506368B (en) Method, device, equipment and storage medium for converting asynchronous call into synchronous call
CN115509522A (en) Interface arranging method and system for low-code scene and electronic equipment
US9141353B2 (en) Dynamically building locale objects at run-time
CN114217789A (en) Function component expansion method, device, equipment, storage medium and program product
CN115543440A (en) Method for migrating android project to android-like system, electronic equipment and storage medium
CN109408057B (en) Method, device, medium and computing equipment for automatically generating codes
CN114911541B (en) Processing method and device of configuration information, electronic equipment and storage medium
CN114968200A (en) Software development kit assembly method, related device and computer program product
CN114840195A (en) Privatization method for iOS SDK static library
CN112328241B (en) Method and device for creating Android library module dependency relationship in application program development
CN114579334A (en) Communication method, communication device, electronic equipment and storage medium
CN114168151A (en) Container-based program compiling method and device, electronic equipment and storage medium
CN113094086A (en) Component integration method and device, computer-readable storage medium and electronic equipment
CN112764802A (en) Business logic customization method and device, electronic equipment and storage medium
CN111782196A (en) MVP architecture-based development method and device
CN113986388B (en) Program set loading method, system, electronic device and storage medium
CN112929675B (en) Image resource compression method and device and electronic equipment
CN114064148B (en) Data processing method, 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