CN113741946A - Method, device and equipment for cutting public interface function library and readable storage medium - Google Patents

Method, device and equipment for cutting public interface function library and readable storage medium Download PDF

Info

Publication number
CN113741946A
CN113741946A CN202110983601.9A CN202110983601A CN113741946A CN 113741946 A CN113741946 A CN 113741946A CN 202110983601 A CN202110983601 A CN 202110983601A CN 113741946 A CN113741946 A CN 113741946A
Authority
CN
China
Prior art keywords
interface function
function
function library
public interface
shell
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.)
Granted
Application number
CN202110983601.9A
Other languages
Chinese (zh)
Other versions
CN113741946B (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.)
Nanjing Third Generation Communication Technology Co ltd
Fiberhome Telecommunication Technologies Co Ltd
Original Assignee
Nanjing Third Generation Communication Technology Co ltd
Fiberhome Telecommunication Technologies 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 Nanjing Third Generation Communication Technology Co ltd, Fiberhome Telecommunication Technologies Co Ltd filed Critical Nanjing Third Generation Communication Technology Co ltd
Priority to CN202110983601.9A priority Critical patent/CN113741946B/en
Publication of CN113741946A publication Critical patent/CN113741946A/en
Application granted granted Critical
Publication of CN113741946B publication Critical patent/CN113741946B/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4482Procedural

Landscapes

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

Abstract

The application relates to a method, a device and equipment for cutting a public interface function library and a readable storage medium, relating to the technical field of network communication and comprising the steps of creating a public interface function library set, wherein the public interface function library set comprises a plurality of public interface function libraries, and each public interface function library comprises a plurality of public interface functions; creating a shell function library set, wherein the shell function library set comprises shell functions which correspond to the public interface functions one by one, each shell function is internally provided with a fixed return value, and after a shell function is called, if the fixed return value is returned, the public interface function library where the public interface function corresponding to the called shell function is located is determined to be cut; and cutting at least one public interface function library in the public interface function library set to obtain a new public interface function library set. The method and the device have the advantages that the customizable cutting of the public interface function library is realized, the codes of the component functions do not need to be modified, and the cutting efficiency and reliability of the public interface function library are effectively improved.

Description

Method, device and equipment for cutting public interface function library and readable storage medium
Technical Field
The present application relates to the field of network communication technologies, and in particular, to a method, an apparatus, a device, and a readable storage medium for clipping a common interface function library.
Background
The current communication field platform needs to face the access of various devices, and the hardware conditions of different devices have certain limitations, especially the limitation of storage and the limitation of running memory. Therefore, under a unified platform code architecture, customized component functions and external common interface function library cutting of components are required to be realized for different device forms so as to meet different requirements of different devices on the size, functions and operation of a software package, and the influence on the starting and operation of the reserved component function codes is always ensured to be reduced as much as possible in the cutting process, so that the uniformity, the sharing and the integrity of the platform codes are maintained, and the project management cost of the platform for multi-product access is reduced.
The realization of the component function often depends on the calling of an external interface provided by a common interface function library, so that the opening of the component library depends on the common interface function library completely, therefore, if the common interface function library is cut, the problem that part of symbols are undefined is caused, and all components depending on the common interface function library cannot run normally.
In the related art, the problem of undefined symbol is generally solved by changing a program code for calling an interface of a common interface function library in a component code, so as to realize the cutting of the common interface function library and further realize the customization of the component function; however, different devices need to realize different customized component functions, so that the number of component functions which need to be customized is huge, if a common interface function library is cut in a way of changing program codes to realize the customized component functions, the problem of large program code changing area exists, and further the problem of low efficiency and poor reliability of the customized cutting of the common interface function library exists, so that the customized cutting of the common interface function library cannot be simply and effectively realized.
Disclosure of Invention
The embodiment of the application provides a method, a device and equipment for cutting a public interface function library and a readable storage medium, which are used for solving the problems that the function of a customized component is realized by cutting the public interface function library in a program code changing mode in the related art, the program code changing area is large, the customized cutting efficiency of the public interface function library is low, and the reliability is poor.
In a first aspect, a method for clipping a public interface function library is provided, which includes the following steps:
creating a public interface function library set, wherein the public interface function library set comprises a plurality of public interface function libraries, and each public interface function library comprises a plurality of public interface functions;
creating a shell function library set, wherein the shell function library set comprises shell functions which correspond to the public interface functions one by one, each shell function is internally provided with a fixed return value, and after a shell function is called, if the fixed return value is returned, the public interface function library where the public interface function corresponding to the called shell function is located is determined to be cut;
and cutting at least one public interface function library in the public interface function library set to obtain a new public interface function library set.
In some embodiments, after the step of cutting at least one common interface function library in the common interface function library set to obtain a new common interface function library set, the method further includes:
calling a shell function to be executed;
determining a common interface function to be executed corresponding to the shell function to be executed;
detecting whether the public interface function to be executed exists in the new public interface function library set or not;
and if so, calling the common interface function to be executed from the new common interface function library set.
In some embodiments, the detecting whether the common interface function to be executed exists in the new common interface function library set includes:
if not, returning the fixed return value of the shell function to be executed, and calling a new shell function to be executed.
In some embodiments, the method further comprises:
creating a function address management table;
and storing the function name and the function address of the called public interface function in the function address management table in an associated manner.
In some embodiments, after the step of determining the common interface function to be executed corresponding to the shell function to be executed, the method further includes:
detecting whether the function address management table has the common interface function to be executed or not;
if the function name exists, calling the public interface function to be executed according to the function address corresponding to the function name of the public interface function to be executed;
if not, executing the step of detecting whether the public interface function to be executed exists in the new public interface function library set.
In some embodiments, the cutting at least one public interface function library in the public interface function library set to obtain a new public interface function library set includes:
determining the function of the component to be deleted according to the component function and the customized component function corresponding to the common interface function library set;
and cutting the public interface function library corresponding to the function of the component to be deleted in the public interface function library set to obtain a new public interface function library set.
In a second aspect, a clipping device for a common interface function library is provided, which includes:
a first creating unit configured to create a common interface function library set, the common interface function library set including a plurality of common interface function libraries, each common interface function library including a plurality of common interface functions;
a second creating unit, configured to create a shell function library set, where the shell function library set includes shell functions corresponding to each public interface function one to one, and each shell function has a built-in fixed return value, and after a shell function is called, if a fixed return value is returned, it is determined that the public interface function library where the public interface function corresponding to the called shell function is located has been cut;
and the cutting unit is used for cutting at least one public interface function library in the public interface function library set to obtain a new public interface function library set.
In some embodiments, the cropping device further comprises an execution unit to:
calling a shell function to be executed;
determining a common interface function to be executed corresponding to the shell function to be executed;
detecting whether the public interface function to be executed exists in the new public interface function library set or not;
and if so, calling the common interface function to be executed from the new common interface function library set.
In a third aspect, a computer device is provided, comprising: the device comprises a memory and a processor, wherein at least one instruction is stored in the memory, and the at least one instruction is loaded and executed by the processor to realize the clipping method of the common interface function library.
In a fourth aspect, a computer-readable storage medium is provided, which stores computer instructions that, when executed by a computer, cause the computer to perform the aforementioned method of clipping a common interface function library.
The beneficial effect that technical scheme that this application provided brought includes: the customized cutting of the public interface function library is realized, the code of the component function does not need to be modified, and the cutting efficiency and reliability of the public interface function library are effectively improved.
The embodiment of the application provides a method, a device and equipment for cutting a public interface function library and a readable storage medium, wherein a public interface function library set is created, the public interface function library set comprises a plurality of public interface function libraries, and each public interface function library comprises a plurality of public interface functions; creating a shell function library set, wherein the shell function library set comprises shell functions which correspond to the public interface functions one by one, each shell function is internally provided with a fixed return value, and after a shell function is called, if the fixed return value is returned, the public interface function library where the public interface function corresponding to the called shell function is located is determined to be cut; and cutting at least one public interface function library in the public interface function library set to obtain a new public interface function library set. Therefore, in the embodiment of the application, by setting the shell functions corresponding to the common interface functions, after the common interface function library where a certain common interface function is located is cut, the device can directly learn that the device does not have the component function corresponding to the cut common interface function library through the fixed return value of the corresponding shell function without modifying the code of the component function and changing the calling mode of the function, so that the customizable cutting of the common interface function library is realized; moreover, the execution of the shell function can enable the main program to normally run into the next method, and the running of the main program caused by undefined problems of the symbols is avoided. Therefore, under the condition that the normal operation of the main program is ensured, the customized cutting of the public interface function library is realized, the codes of the component functions do not need to be modified, and the cutting efficiency and the reliability of the public interface function library are effectively improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flowchart of a method for clipping a common interface function library according to an embodiment of the present disclosure;
FIG. 2 is a flow diagram illustrating library compilation and loading provided by an embodiment of the present application;
fig. 3 is a schematic structural diagram of a clipping device for a common interface function library according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, 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 some embodiments of the present application, but not all 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 embodiment of the application provides a method, a device and equipment for cutting a public interface function library and a readable storage medium, which can solve the problems of large program code changing area, low customization cutting efficiency and poor reliability of the public interface function library existing in the prior art that the customized component function is realized by cutting the public interface function library in a program code changing mode.
Referring to fig. 1 and fig. 2, an embodiment of the present application provides a flow chart diagram of a clipping method for a common interface function library, which includes the following steps:
s1: creating a common interface function library set, wherein the common interface function library set comprises a plurality of common interface function libraries, and each common interface function library comprises a plurality of common interface functions.
Exemplarily, a public interface function library set is created, an LIB dynamic library is created for each public interface function library, specifically, all public interface function code files lib.c in each public interface function library are compiled to generate a dynamic library file lib.so, the public interface function code file includes implementation codes of all public interface functions of which a certain component is abstract to the outside, that is, the public interface function library includes a plurality of public interface functions, such as implementation codes of fun () functions, each public interface function is named and a corresponding fixed return value is defined, and then the LIB dynamic library where the function is located can be determined by the name of the public interface function. Each public interface function library corresponds to one component function, and each public interface function corresponds to one sub-component function.
S2: and creating a shell function library set, wherein the shell function library set comprises shell functions corresponding to each public interface function one by one, each shell function is internally provided with a fixed return value, and after a shell function is called, if the fixed return value is returned, the public interface function library where the public interface function corresponding to the called shell function is located is determined to be cut.
Exemplarily, a shell function library set is created, wherein the shell function library set comprises a plurality of shell function libraries, each shell function library corresponds to a common interface function library one by one, that is, the shell function library set comprises shell functions corresponding to each common interface function one by one; creating a LIB _ EX dynamic library for each shell function library, specifically, compiling all shell function code files LIB _ ex.c in each shell function library to generate a dynamic library file LIB _ ex.so, where the shell function code file contains implementation codes of shell functions corresponding to public interface functions in a certain public interface function library.
For example, a certain common interface function library A includes common interface functions A _ fun _1(), A _ fun _2(), and A _ fun _3(), the shell function library a' contains shell functions having a mapping relation with the function name of each common interface function in the common interface function library a, such as shell functions a _ fun _1_ EX (), a _ fun _2_ EX () and a _ fun _3_ EX (), that is, each common interface function has its corresponding shell function, and each shell function has a fixed return value, and when a shell function is called, if the fixed return value is returned, determining that the common interface function library in which the common interface function corresponding to the called shell function is located has been cut, the service can judge the called function to be implemented as a shell function according to the fixed return value, and further can distinguish a real implementation mode and further flow processing.
S3: cutting at least one public interface function library in the public interface function library set to obtain a new public interface function library set; specifically, determining the function of the component to be deleted according to the component function and the customized component function corresponding to the common interface function library set; and cutting the public interface function library corresponding to the function of the component to be deleted in the public interface function library set to obtain a new public interface function library set.
Exemplarily, different devices have different requirements for the size, the function and the operation of a software package, so that the device can be preset with component functions according to the actual requirements of the device, and a component function code file comp.c is compiled to generate a dynamic library file comp.so, the component function code file contains all function implementation codes owned by the current component, and a common interface function in an LIB dynamic library is called in the component function codes, so as to ensure the normal operation of the component functions; the method comprises the steps that the function of a component to be deleted is determined according to a customized component function preset by equipment and a component function corresponding to a public interface function library set, the function of the component to be deleted is a component function which is not needed by the equipment in all component functions corresponding to the public interface function library set, the public interface function library corresponding to the function of the component to be deleted in the public interface function library set is cut, namely the public interface function library corresponding to the component function which is not needed by the equipment in the public interface function library set is cut, and a new public interface function library set only keeps the public interface function library corresponding to the component function which is needed by the equipment;
the unnecessary component functions of the equipment can be confirmed by a fixed return value returned after accessing the shell function corresponding to the public interface function, namely when the main program receives the fixed return value, the equipment does not have the component functions corresponding to the cut public interface function library, and the main program can directly enter the next method, so that the normal operation of the main program is ensured, the customized cutting of the public interface function library is realized, and the occupation of software inclusion volume and memory resources during operation is further reduced; therefore, the embodiment of the application not only realizes the functions of unified loading, starting and management aiming at the existing components, but also adds an external public interface function library in a unified form, reduces the repeated writing of flow codes such as interaction, communication and the like among the components, and reduces the maintenance difficulty of the component interaction interface.
Compiling and linking a main Program code file program.c to generate an executable file Program, wherein the main Program code file comprises other implementation codes required by the operation of a main Program; in some embodiments, the code files are all composed of a common interface function code file, a common interface shell function code file, a component function code file and a main Program code file, respective library files and executable programs are generated according to corresponding compiling rules, and all shell function libraries Lib _ ex.so are used as basic libraries to be linked into the executable file Program, so that all common interface functions are guaranteed to be defined in the executable file uniformly provided by the platform, and the most simplified shell implementation is achieved, thereby not only guaranteeing integrity and uniformity, but also reducing the occupation of memory by assembly codes generated by unnecessary functions.
Selecting a component function library Comp.so and a public interface function library lib.so for customizing different equipment forms to load, namely loading a loading model customized according to equipment after starting and executing an execution file Program; specifically, the common interface function library lib.so is loaded according to a preset configuration file (the configuration file is designed based on a customized component function), then the component function libraries comp.so required by the equipment are sequentially loaded, and meanwhile, the component operation entry is called and the component operation flow is started. According to the method and the device, flexible assembly function and public interface function library cutting is achieved according to actual storage limitation and function requirements of the device, customized requirements are achieved, and the above process ensures that once the assembly is started, the public interface function library which depends on the assembly can be called and executed regardless of whether the public interface function library is loaded or not, namely, a shell function mechanism is used for decoupling symbol dependence between the assembly code and the public interface function library, so that the assembly function code does not need to be modified when the public interface function library is cut, and a function calling mode does not need to be changed.
Therefore, in some embodiments, the definitions of the external common interface functions provided by all the components must conform to the unified planning of the platform, and simultaneously, one-to-one corresponding shell functions are generated according to the designed common interface functions, and the implementation codes of the shell functions are designed uniformly and return values are fixed, so that the service of the calling interface can be conveniently distinguished from a real implementation mode and further flow processing.
It can be seen that, in the embodiment of the present application, by setting shell functions corresponding to common interface functions one to one, after a common interface function library where a certain common interface function is located is cut, a device can directly learn that the device does not have a component function corresponding to the cut common interface function library through a fixed return value of the shell function corresponding to the common interface function, without modifying a code of the component function and changing a calling mode of the function, thereby realizing customizable cutting of the common interface function library; moreover, the execution of the shell function can enable the main program to normally run into the next method, and the running of the main program caused by undefined problems of the symbols is avoided. Therefore, under the condition that the normal operation of the main program is ensured, the customized cutting of the public interface function library is realized, the codes of the component functions do not need to be modified, and the cutting efficiency and the reliability of the public interface function library are effectively improved.
Further, in this embodiment of the present application, after the step of cutting at least one common interface function library in the common interface function library set to obtain a new common interface function library set, the method further includes: calling a shell function to be executed; determining a common interface function to be executed corresponding to the shell function to be executed; detecting whether the public interface function to be executed exists in the new public interface function library set or not; if yes, calling the public interface function to be executed from the new public interface function library set; if not, returning the fixed return value of the shell function to be executed, and calling a new shell function to be executed.
Exemplarily, different devices have different component functions, so that the component functions of the devices need to be designed in a customized manner, when the devices do not have the subcomponent functions corresponding to a certain common interface function, the common interface function library where the common interface function is located is cut out from the common interface function library set, and a fixed return value is embedded in the corresponding shell function.
Therefore, when the device realizes the customized component function, the main program calls a certain shell function to be executed and analyzes the shell function to be executed to obtain a public interface function to be executed, if the subcomponent function corresponding to the public interface function to be executed is required by the device, the public interface function to be executed can be found in the corresponding public interface function library in the new public interface function library set, the function address corresponding to the public interface function to be executed is obtained, and the true execution result of the function can be obtained by executing the function address;
if the subcomponent function corresponding to the common interface function to be executed is not required by the device, the common interface function set where the common interface function to be executed is located is cut, so the common interface function to be executed cannot be found in a new common interface function library set, at this time, a fixed return value of the shell function corresponding to the common interface function to be executed is returned, and after receiving the fixed return value, the main program can directly jump to the next method, thereby realizing the customized component function of the device.
Further, in an embodiment of the present application, the method further includes the steps of:
creating a function address management table;
and storing the function name and the function address of the called public interface function in the function address management table in an associated manner.
Exemplarily, a device generally has a very rich and large number of component functions, some component functions are all necessary for all devices, some component functions are unique to part of the devices, and some component functions are common to part of the devices, so that all component functions necessary for all devices and the function names and function addresses of common interface functions corresponding to the sub-component functions called by the components can be associated and imported into the function address management table in advance, when the device is to realize the necessary or called component functions, the components can directly realize the component functions by accessing the addresses of the common interface functions corresponding to the function address management table, the program running efficiency is improved, and the program starting time is reduced.
Further, in this embodiment of the present application, after the step of determining the common interface function to be executed corresponding to the shell function to be executed, the method further includes the following steps:
detecting whether a function name of the common interface function to be executed exists in the function address management table;
if the function name exists, calling the public interface function to be executed according to the function address corresponding to the function name of the public interface function to be executed;
if not, executing the step of detecting whether the public interface function to be executed exists in the new public interface function library set.
Exemplarily, when the main program reads the common interface function to be executed, it is first judged whether the function address management table includes the function name of the common interface function to be executed, if so, the function address corresponding to the function name of the common interface function to be executed is obtained, and the function address is directly executed; if not, continuously searching whether the function name of the to-be-executed public interface function exists in the new public interface function library set, after the function name of the to-be-executed public interface function is searched, acquiring and executing a function address corresponding to the function name of the to-be-executed public interface function, and updating the function name and the function address of the to-be-executed public interface function into a function address management table in an associated manner so that the component can directly execute the public interface function in function address management next time.
The embodiment of the application will be further explained by combining a specific application scenario with a scenario in which a component calls a common interface function in the running process of a main program.
N1: when the main program runs, loading a shell function library set and loading a new public interface function library set according to a preset configuration file, calling a shell function to be executed in the component code flow, analyzing the shell function to be executed to obtain a public interface function to be executed, and turning to the step N2;
for example, the common interface function library set includes a common interface function library a (the common interface function library a corresponds to the component function a), a common interface function library B (the common interface function library B corresponds to the component function B), and the common interface function library a includes common interface functions a _ fun _1(), a _ fun _2(), and a _ fun _3(), and the common interface function library B includes common interface functions B _ fun _1(), B _ fun _2(), and B _ fun _3 (); the shell function library set includes a shell function library a 'and a shell function library B', the shell function library a 'includes shell functions a _ fun _1_ EX (), a _ fun _2_ EX (), and a _ fun _3_ EX (), and the shell function library B' includes shell functions B _ fun _1_ EX (), B _ fun _2_ EX (), and B _ fun _3_ EX (); if the component function B is a function which is not needed by the equipment, the common interface function library B is cut from the common interface function library set, and only the common interface function library A exists in the new common interface function library set. At this time, when the main program is loaded, only the common interface function library a and all the shell function libraries (i.e., the shell function library a 'and the shell function library B') are loaded.
N2: searching whether a function name of the current common interface function to be executed exists in the function address management table, if so, turning to the step N7, and if not, turning to the step N3;
if the function name of the to-be-executed public interface function exists in the function management table, the to-be-executed public interface function is called, and the last step can be directly skipped; if the function name of the to-be-executed public interface function does not exist in the current function management table, the to-be-executed public interface function is called by the service for the first time, and the next step needs to be executed at the moment;
n3: determining a public interface function library where the public interface function to be executed is located according to the function name of the public interface function, judging whether the current program loads the corresponding lib.so, if so, turning to the step N4, and if not, turning to the step N5;
assuming that the shell function to be executed is a _ fun _1_ EX (), the name of the function of the common interface function to be executed is a _ fun _1(), the common interface function to be executed belongs to the common interface function library a, and the common interface function library a is already loaded in step N1, which indicates that the subcomponent function corresponding to the interface function to be executed is required by the device, so that the corresponding function address can be found in the common interface function library a;
assuming that the shell function to be executed is B _ fun _1_ EX (), the name of the function of the common interface function to be executed is B _ fun _1(), and the common interface function to be executed belongs to the common interface function library B, but since the common interface function library B has been cut, the common interface function library B is not loaded in step N1, which indicates that the subcomponent function corresponding to the interface function to be executed is not required by the device, and at this time, only the fixed return value of the shell function to be executed B _ fun _1_ EX () needs to be returned.
N4: so, searching a function address corresponding to the function name of the common interface function to be executed in lib, executing the function address, and turning to the step N6;
n5: so, returning a fixed return value of the shell function in the linked Lib _ ex.so, and executing the next method after the main program receives the fixed return value;
if the current program is not loaded with lib.so, the common interface function library is cut, the common interface function to be executed does not exist, and the equipment does not have the sub-component function corresponding to the common interface function to be executed;
n6: updating the correlation between the searched function address and the function name into a function address management table;
n7: and acquiring a function address corresponding to the function name of the common interface function to be executed and executing the function address, namely calling a function in the function address management table.
Therefore, in some embodiments, the selection of the component calling the common interface function may select the function implementation manner according to the loading condition of the common interface function library in the current program as described above, and after the service acquires the fixed return value, the service may sense whether the currently executed function is a shell function, perform special processing according to a flow requirement, or ignore a current processing result.
Referring to fig. 3, an embodiment of the present application further provides a clipping device for a common interface function library, including a first creating unit, a second creating unit, and a clipping unit;
the first creating unit is used for creating a public interface function library set, the public interface function library set comprises a plurality of public interface function libraries, and each public interface function library comprises a plurality of public interface functions;
the second creating unit is used for creating a shell function library set, the shell function library set comprises shell functions corresponding to the public interface functions one by one, each shell function is internally provided with a fixed return value, and after a shell function is called, if the fixed return value is returned, the public interface function library where the public interface function corresponding to the called shell function is located is determined to be cut;
the cutting unit is used for cutting at least one public interface function library in the public interface function library set to obtain a new public interface function library set.
Furthermore, in this embodiment of the present application, the clipping apparatus for a common interface function library further includes an execution unit, configured to:
calling a shell function to be executed;
determining a common interface function to be executed corresponding to the shell function to be executed;
detecting whether the public interface function to be executed exists in the new public interface function library set or not;
if yes, calling the public interface function to be executed from the new public interface function library set;
if not, returning the fixed return value of the shell function to be executed, and calling a new shell function to be executed.
Furthermore, in this embodiment of the present application, the execution unit is further configured to create a function address management table; and storing the function name and the function address of the called public interface function in the function address management table in an associated manner.
Further, in this embodiment of the present application, the execution unit is further configured to:
detecting whether the function address management table has the common interface function to be executed or not;
if the function name exists, calling the public interface function to be executed according to the function address corresponding to the function name of the public interface function to be executed;
if not, executing the step of detecting whether the public interface function to be executed exists in the new public interface function library set.
Furthermore, in an embodiment of the present application, the clipping unit is specifically configured to:
determining the function of the component to be deleted according to the component function and the customized component function corresponding to the common interface function library set;
and cutting the public interface function library corresponding to the function of the component to be deleted in the public interface function library set to obtain a new public interface function library set.
It should be noted that, as will be clear to those skilled in the art, for convenience and brevity of description, the specific working processes of the apparatus and the units described above may refer to the corresponding processes in the foregoing cutting method embodiment of the common interface function library, and are not described herein again.
The apparatus provided by the above embodiments may be implemented in the form of a computer program, which can be run on a computer device as shown in fig. 4.
An embodiment of the present application further provides a computer device, including: the system comprises a memory, a processor and a network interface which are connected through a system bus, wherein at least one instruction is stored in the memory, and the at least one instruction is loaded and executed by the processor so as to realize all steps or part of steps of the cutting method of the public interface function library.
The network interface is used for performing network communication, such as sending distributed tasks. Those skilled in the art will appreciate that the architecture shown in fig. 4 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
The Processor may be a CPU, other general purpose Processor, a DigitaL SignaL Processor (DSP), an AppLication Specific Integrated Circuit (ASIC), an off-the-shelf programmable Gate Array (FPGA) or other programmable logic device, discrete Gate or transistor logic device discrete hardware component, etc. The general purpose processor may be a microprocessor or the processor may be any conventional processor or the like, the processor being the control center of the computer device and the various interfaces and lines connecting the various parts of the overall computer device.
The memory may be used to store computer programs and/or modules, and the processor may implement various functions of the computer device by executing or executing the computer programs and/or modules stored in the memory, as well as by invoking data stored in the memory. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a video playing function, an image playing function, etc.), and the like; the storage data area may store data (such as video data, image data, etc.) created according to the use of the cellular phone, etc. In addition, the memory may include high speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure DigitaL (SD) Card, a FLash memory Card (FLash Card), at least one magnetic disk storage device, a FLash memory device, or other volatile solid state storage device.
The embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, all or part of the steps of the aforementioned clipping method for the common interface function library are implemented.
The embodiments of the present application may implement all or part of the foregoing processes, or may be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the computer program may implement the steps of the foregoing methods. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer readable medium may include: any entity or device, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer memory, Read-only memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunication signals, software distribution medium, etc., capable of carrying computer program code. It should be noted that the computer readable medium may contain other components which may be suitably increased or decreased as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, in accordance with legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunications signals.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, server, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is merely exemplary of the present application and is presented to enable those skilled in the art to understand and practice the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method for cutting a public interface function library is characterized by comprising the following steps:
creating a public interface function library set, wherein the public interface function library set comprises a plurality of public interface function libraries, and each public interface function library comprises a plurality of public interface functions;
creating a shell function library set, wherein the shell function library set comprises shell functions which correspond to the public interface functions one by one, each shell function is internally provided with a fixed return value, and after a shell function is called, if the fixed return value is returned, the public interface function library where the public interface function corresponding to the called shell function is located is determined to be cut;
and cutting at least one public interface function library in the public interface function library set to obtain a new public interface function library set.
2. The method for clipping a common interface function library according to claim 1, wherein after the step of clipping at least one common interface function library in the common interface function library set to obtain a new common interface function library set, the method further comprises:
calling a shell function to be executed;
determining a common interface function to be executed corresponding to the shell function to be executed;
detecting whether the public interface function to be executed exists in the new public interface function library set or not;
and if so, calling the common interface function to be executed from the new common interface function library set.
3. The method for clipping the common interface function library according to claim 2, wherein the detecting whether the common interface function to be executed exists in the new common interface function library set comprises:
if not, returning the fixed return value of the shell function to be executed, and calling a new shell function to be executed.
4. A method of pruning a common interface function library according to claim 2, wherein the method further comprises:
creating a function address management table;
and storing the function name and the function address of the called public interface function in the function address management table in an associated manner.
5. The method for clipping a common interface function library according to claim 4, wherein after the step of determining the common interface function to be executed corresponding to the shell function to be executed, the method further comprises:
detecting whether the function address management table has the common interface function to be executed or not;
if the function name exists, calling the public interface function to be executed according to the function address corresponding to the function name of the public interface function to be executed;
if not, executing the step of detecting whether the public interface function to be executed exists in the new public interface function library set.
6. The method for clipping a common interface function library according to claim 1, wherein the clipping at least one common interface function library in the common interface function library set to obtain a new common interface function library set comprises:
determining the function of the component to be deleted according to the component function and the customized component function corresponding to the common interface function library set;
and cutting the public interface function library corresponding to the function of the component to be deleted in the public interface function library set to obtain a new public interface function library set.
7. A clipping device for a common interface function library, comprising:
a first creating unit configured to create a common interface function library set, the common interface function library set including a plurality of common interface function libraries, each common interface function library including a plurality of common interface functions;
a second creating unit, configured to create a shell function library set, where the shell function library set includes shell functions corresponding to each public interface function one to one, and each shell function has a built-in fixed return value, and after a shell function is called, if a fixed return value is returned, it is determined that the public interface function library where the public interface function corresponding to the called shell function is located has been cut;
and the cutting unit is used for cutting at least one public interface function library in the public interface function library set to obtain a new public interface function library set.
8. The apparatus of claim 7, wherein the apparatus further comprises an execution unit configured to:
calling a shell function to be executed;
determining a common interface function to be executed corresponding to the shell function to be executed;
detecting whether the public interface function to be executed exists in the new public interface function library set or not;
and if so, calling the common interface function to be executed from the new common interface function library set.
9. A computer device, comprising: a memory and a processor, the memory having stored therein at least one instruction, the at least one instruction being loaded and executed by the processor to implement the method of clipping of a common interface function library of any of claims 1 to 6.
10. A computer-readable storage medium characterized by: the computer storage medium stores computer instructions that, when executed by a computer, cause the computer to perform the method of clipping of a common interface function library of any one of claims 1 to 6.
CN202110983601.9A 2021-08-25 2021-08-25 Clipping method, device and equipment of public interface function library and readable storage medium Active CN113741946B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110983601.9A CN113741946B (en) 2021-08-25 2021-08-25 Clipping method, device and equipment of public interface function library and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110983601.9A CN113741946B (en) 2021-08-25 2021-08-25 Clipping method, device and equipment of public interface function library and readable storage medium

Publications (2)

Publication Number Publication Date
CN113741946A true CN113741946A (en) 2021-12-03
CN113741946B CN113741946B (en) 2023-06-09

Family

ID=78732811

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110983601.9A Active CN113741946B (en) 2021-08-25 2021-08-25 Clipping method, device and equipment of public interface function library and readable storage medium

Country Status (1)

Country Link
CN (1) CN113741946B (en)

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6449659B1 (en) * 1997-07-14 2002-09-10 Microsoft Corporation System for instance customization with application independent programming of controls
US7840968B1 (en) * 2003-12-17 2010-11-23 Mcafee, Inc. Method and system for containment of usage of language interfaces
CN102622227A (en) * 2011-09-13 2012-08-01 北京科技大学 Component model supporting dynamic configuration, and component factory
CN103077332A (en) * 2012-12-28 2013-05-01 飞天诚信科技股份有限公司 Method and device for running packer application with self-checking
CN103942281A (en) * 2014-04-02 2014-07-23 北京中交兴路车联网科技有限公司 Method and device for operating object persistently stored
CN104123135A (en) * 2014-07-04 2014-10-29 北京思特奇信息技术股份有限公司 Method and device for unifying background interfaces
JP2017134655A (en) * 2016-01-28 2017-08-03 株式会社デンソー On-vehicle apparatus and computer program
CN107103211A (en) * 2016-02-19 2017-08-29 腾讯科技(深圳)有限公司 SDK is sent, using issue, using operation method and device
US20180113685A1 (en) * 2016-10-24 2018-04-26 International Business Machines Corporation Local Function Call Tailoring for Function Pointer Calls
CN109885489A (en) * 2019-01-31 2019-06-14 清华大学 Data contention detection method and device in driver
CN111240684A (en) * 2020-01-03 2020-06-05 北京字节跳动网络技术有限公司 Cutting method and device of JS code, medium and electronic equipment
CN113010081A (en) * 2014-08-02 2021-06-22 苹果公司 Context specific user interface
CN113094255A (en) * 2020-01-08 2021-07-09 北京密境和风科技有限公司 Simulation test method, device and system for data interface

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6449659B1 (en) * 1997-07-14 2002-09-10 Microsoft Corporation System for instance customization with application independent programming of controls
US7840968B1 (en) * 2003-12-17 2010-11-23 Mcafee, Inc. Method and system for containment of usage of language interfaces
CN102622227A (en) * 2011-09-13 2012-08-01 北京科技大学 Component model supporting dynamic configuration, and component factory
CN103077332A (en) * 2012-12-28 2013-05-01 飞天诚信科技股份有限公司 Method and device for running packer application with self-checking
CN103942281A (en) * 2014-04-02 2014-07-23 北京中交兴路车联网科技有限公司 Method and device for operating object persistently stored
CN104123135A (en) * 2014-07-04 2014-10-29 北京思特奇信息技术股份有限公司 Method and device for unifying background interfaces
CN113010081A (en) * 2014-08-02 2021-06-22 苹果公司 Context specific user interface
JP2017134655A (en) * 2016-01-28 2017-08-03 株式会社デンソー On-vehicle apparatus and computer program
CN107103211A (en) * 2016-02-19 2017-08-29 腾讯科技(深圳)有限公司 SDK is sent, using issue, using operation method and device
US20180113685A1 (en) * 2016-10-24 2018-04-26 International Business Machines Corporation Local Function Call Tailoring for Function Pointer Calls
CN109885489A (en) * 2019-01-31 2019-06-14 清华大学 Data contention detection method and device in driver
CN111240684A (en) * 2020-01-03 2020-06-05 北京字节跳动网络技术有限公司 Cutting method and device of JS code, medium and electronic equipment
CN113094255A (en) * 2020-01-08 2021-07-09 北京密境和风科技有限公司 Simulation test method, device and system for data interface

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李沸乐;杨文聪;: "5G轻量化核心网总体方案研究与设计", 移动通信, no. 01, pages 20 - 24 *

Also Published As

Publication number Publication date
CN113741946B (en) 2023-06-09

Similar Documents

Publication Publication Date Title
US20190324772A1 (en) Method and device for processing smart contracts
CN107402792B (en) Integration method, device, equipment and storage medium of application software installation package
CN113157345A (en) Automatic starting method and device for front-end engineering
CN110795353A (en) Debugging method, device and equipment for fast application and storage medium
CN113986402A (en) Function calling method and device, electronic equipment and storage medium
CN112230927A (en) File redirection method, code loading control method and device
CN109739487B (en) Business logic processing method and device and computer readable storage medium
CN110688320B (en) Global variable detection method and device and terminal equipment
CN110018831B (en) Program processing method, program processing apparatus, and computer-readable storage medium
CN113741946B (en) Clipping method, device and equipment of public interface function library and readable storage medium
CN114911541B (en) Processing method and device of configuration information, electronic equipment and storage medium
CN116431127A (en) Low code development method, system, equipment and readable storage medium
CN117170634A (en) Code compiling method and device, storage medium and electronic equipment
CN111880803B (en) Software construction method and device applied to multiple platforms
CN111708519B (en) Service component processing method, device, equipment and storage medium
CN114201174A (en) Construction method and device of hybrid mobile application, electronic equipment and storage medium
CN110502296B (en) Method, equipment and storage medium for displaying firmware upgrading command
CN115794260B (en) Simple dynamic loading method for DSP software library
CN112540835B (en) Method and device for operating hybrid machine learning model and related equipment
CN114416219B (en) System function calling method, device, electronic equipment and readable medium
CN113419735B (en) Plug-in optimization method and device
CN111090466B (en) Optimization method, device, equipment and storage medium of call instruction
CN111144086B (en) Log formatting method and device, electronic equipment and storage medium
CN117421001A (en) Page loading method and device based on componentization development, electronic equipment and medium
CN117539499A (en) Project compiling preprocessing method, device, equipment and medium based on python

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