CN112306584A - Application program operation control method, device, medium and equipment - Google Patents

Application program operation control method, device, medium and equipment Download PDF

Info

Publication number
CN112306584A
CN112306584A CN202011120086.3A CN202011120086A CN112306584A CN 112306584 A CN112306584 A CN 112306584A CN 202011120086 A CN202011120086 A CN 202011120086A CN 112306584 A CN112306584 A CN 112306584A
Authority
CN
China
Prior art keywords
function
registered
functions
registration
application program
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
CN202011120086.3A
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 ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network 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 ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN202011120086.3A priority Critical patent/CN112306584A/en
Publication of CN112306584A publication Critical patent/CN112306584A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4488Object-oriented
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/903Querying
    • G06F16/90335Query processing
    • G06F16/90344Query processing by using string matching 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
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Stored Programmes (AREA)

Abstract

The present disclosure provides an application program operation control method, apparatus, medium, and device, the method including: when an application program is started, dynamically constructing an auxiliary function, wherein the auxiliary function is used for registering a pre-compiled registration function list into the application program, and the registration function list comprises a plurality of registration functions which are ordered according to a preset condition; acquiring a function set to be registered of the application program, and sequencing functions to be registered in the function set to be registered, wherein the function set to be registered comprises a plurality of functions to be registered; and calling the auxiliary function, traversing the function set to be registered, and registering the precompiled registration function into the function to be registered. The application program operation control method effectively reduces the volume of the file packet and improves the security of file access.

Description

Application program operation control method, device, medium and equipment
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method, an apparatus, a medium, and a device for controlling application program operation.
Background
For performance and security reasons, some functionality of android applications needs to be implemented at the bottom layer (native layer) using the so file. The application usually runs java code, the java code needs to call the bottom functions during running, the common method is that some bottom functions are declared in the java code, and when the bottom functions are called, the system queries the associated functions in the corresponding so file and executes the associated functions, so that the purpose of calling the functions in the so file from the java code is achieved.
The technical problems in the prior art are as follows: how to register the underlying function to the java layer enables accurate invocation of the function in the so file during execution. The existing registration modes of the underlying function have two types: 1. and statically registering, defining and exporting the function name of the called function as a ' Java ' package name ' class name ' method name ', and finding the function according to the function and the information of the class when the system executes the corresponding Java native function. 2. And dynamic registration, namely calling a register native function in the JNI _ OnLoad function to register.
Both of the above-mentioned registration methods increase packet size and have certain security issues: static registration needs to export a called function, the function name of the called function is inevitably in a so file, and the function name is usually longer according to the format regulation, so that a certain volume of the so file is occupied, and the function can be directly determined according to the function name after the so file is decompiled, thereby causing the problem of safety. When dynamically registering, the function name and the function signature character string of each registered native function need to be stored in the so file, and the problems of enclosure volume and safety also exist.
Disclosure of Invention
The present disclosure is directed to an application program operation control method, apparatus, medium, and device, which may solve at least one of the above-mentioned problems. The specific scheme is as follows:
according to a specific embodiment of the present disclosure, the present disclosure provides an application program operation control method, including: when an application program is started, dynamically constructing an auxiliary function, wherein the auxiliary function is used for registering a pre-compiled registration function list into the application program, and the registration function list comprises a plurality of registration functions which are ordered according to a preset condition; acquiring a function set to be registered of the application program, and sequencing functions to be registered in the function set to be registered, wherein the function set to be registered comprises a plurality of functions to be registered; and calling the auxiliary function, traversing the function set to be registered, and registering the precompiled registration function into the function to be registered.
Optionally, the list of registration functions is generated by: classifying a plurality of registration functions belonging to the same class into a function group according to the class to which the registration functions belong; sorting the plurality of function groups obtained by classification according to the length of the class name to which the function groups belong; and sorting the plurality of registered functions in the sorted function group.
Optionally, the sorting the plurality of function groups obtained by the classification according to the length of the class name to which the function group belongs includes: sorting the plurality of function groups obtained by classification according to a class name length ascending mode; and sorting the function groups with the same class name length according to an ASCII code sequence.
Optionally, the sorting the plurality of registered functions in the sorted function group includes: each called registration function is matched with a character string, and the character string comprises a function name and a parameter type of a bottom-layer method in the application program corresponding to the registration function; sequencing a plurality of registration functions in the sequenced function group according to the ascending mode of the character string length; and sorting the plurality of registration functions with the same character string length according to an ASCII code sequence.
Optionally, the obtaining a function set to be registered of the application program, and sorting functions to be registered in the function set to be registered includes: sorting classes containing functions to be registered in the application program; acquiring all functions to be registered in the current class to form a function subset to be registered; and traversing the class, and forming a function set to be registered by a plurality of function subsets to be registered.
Optionally, the sorting the classes containing the functions to be registered in the application program includes: sorting the classes containing the functions to be registered in the application program according to a class name length ascending mode; and sequencing the functions to be registered with the same class name length according to the ASCII code sequence.
Optionally, the obtaining all functions to be registered in the current class to form a function subset to be registered, and then includes: constructing a character string for each function to be registered in the function subset to be registered, and sequencing the character strings, wherein the character strings comprise function names and parameter types; and traversing the function subset to be registered, and transferring the function information to be registered to the auxiliary function, wherein the function information to be registered comprises a current index value.
Optionally, the calling the auxiliary function, traversing the set of functions to be registered, and registering the precompiled registration function in the function to be registered, includes: calling the auxiliary function, traversing the function set to be registered, acquiring the precompiled registration function information according to the current index value, and registering the precompiled registration function in the function to be registered.
According to a specific embodiment of the present disclosure, the present disclosure provides an application program operation control apparatus, including: the system comprises a construction unit, a storage unit and a processing unit, wherein the construction unit is used for dynamically constructing an auxiliary function when an application program is started, the auxiliary function is used for registering a pre-compiled registration function list into the application program, and the registration function list comprises a plurality of registration functions which are ordered according to a preset condition; the acquiring unit is used for acquiring a function set to be registered of the application program and sequencing the functions to be registered in the function set to be registered, wherein the function set to be registered comprises a plurality of functions to be registered; and the registration unit is used for calling the auxiliary function, traversing the function set to be registered and registering the precompiled registration function into the function to be registered.
According to a specific embodiment of the present disclosure, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method as defined in any one of the above.
According to a specific embodiment of the present disclosure, there is provided an electronic apparatus including: one or more processors; storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to carry out a method as claimed in any preceding claim.
Compared with the prior art, the scheme of the embodiment of the disclosure at least has the following beneficial effects: according to the method and the device, a registration function list is compiled in advance, the registration function list comprises a plurality of registration functions which are ordered according to preset conditions, when an application program is started, an ordered function set to be registered of the application program is obtained, the precompiled registration function is registered in the function to be registered by calling a dynamically constructed auxiliary function, and the function registration can be accurately carried out due to the fact that the precompiled registration function and the function to be registered are ordered and have a corresponding relation, and therefore a bottom layer function can be dynamically called. The function registration method effectively reduces the volume of the file packet and improves the security of file access.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure. It is to be understood that the drawings in the following description are merely exemplary of the disclosure, and that other drawings may be derived from those drawings by one of ordinary skill in the art without the exercise of inventive faculty. In the drawings:
FIG. 1 shows a flow chart of an application run control method according to an embodiment of the disclosure;
FIG. 2 illustrates a flow diagram of helper function creation according to an embodiment of the present disclosure;
FIG. 3 shows a flow chart of an application run control method according to an embodiment of the disclosure;
FIG. 4 is a schematic diagram illustrating an application run control apparatus according to an embodiment of the present disclosure;
fig. 5 shows an electronic device connection structure schematic according to an embodiment of the present disclosure.
Detailed Description
To make the objects, technical solutions and advantages of the present disclosure clearer, the present disclosure will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present disclosure, rather than all embodiments. All other embodiments, which can be derived by one of ordinary skill in the art from the embodiments disclosed herein without making any creative effort, shall fall within the scope of protection of the present disclosure.
The terminology used in the embodiments of the present disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. As used in the disclosed embodiments and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise, and "a plurality" typically includes at least two.
It should be understood that the term "and/or" as used herein is merely one type of association that describes an associated object, meaning that three relationships may exist, e.g., a and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
The words "if", as used herein, may be interpreted as "at … …" or "at … …" or "in response to a determination" or "in response to a detection", depending on the context. Similarly, the phrases "if determined" or "if detected (a stated condition or event)" may be interpreted as "when determined" or "in response to a determination" or "when detected (a stated condition or event)" or "in response to a detection (a stated condition or event)", depending on the context.
It is also noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that an article or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such article or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in the article or device in which the element is included.
Alternative embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
The operating program developed by the android system generally comprises a bottom layer (native layer) developed based on an editing language such as C or C + +, an art virtual machine layer running on the bottom layer (native layer), and a Java assembly layer running on the art virtual machine layer, wherein the Java assembly layer is mainly written by a Java language. In the process of program development and execution, the Java layer can call the bottom executable function through the virtual machine layer to execute related tasks.
According to the method and the device for registering the function, a registration function list is compiled in advance, the registration function list comprises a plurality of registration functions which are ordered according to the preset conditions, when an application program is started, the ordered function set to be registered of the application program is obtained, the precompiled registration function is registered in the function to be registered by calling a dynamically constructed auxiliary function, and the function registration can be accurately carried out due to the fact that the precompiled registration function and the function to be registered are ordered and have a corresponding relation, and the method and the device are as follows.
As shown in fig. 1, the present disclosure provides an application program operation control method, including the following method steps:
step S102: when an application program is started, an auxiliary function is dynamically constructed, and the auxiliary function is used for registering a pre-compiled registration function list into the application program, wherein the registration function list comprises a plurality of registration functions which are ordered according to a preset condition.
The application program is any independently-running program developed based on java, and includes but is not limited to APP and window programs applied to an android system. The description is preferably given by taking APP applied to the android system as an example.
In the APP development process, the so file needs to be compiled, and then the compiled so file is compressed into an installation package of the APP for calling in subsequent execution. Specifically, in the so compiling process, all the called registry functions are put into one list, which is called a registry function list funclst.
As shown in fig. 2, when an application is started, a system dynamically constructs an auxiliary function, specifically, after the application is started, a so file is loaded, then the system calls a JNI _ OnLoad function of the so file, an implementation function Helper of a native function Helper of a java layer Helper class is registered in the function in a dynamic registration manner, and the implementation function Helper is recorded as an auxiliary function Helper, and the auxiliary function Helper is used for registering a pre-compiled list of registered functions in a subsequent step. The native function refers to a bottom-layer function called at a java layer when the program runs.
Generating the list of registration functions by: classifying a plurality of registration functions belonging to the same class into a function group according to the class to which the registration functions belong; sorting the plurality of function groups obtained by classification according to the length of the class name to which the function groups belong; and sorting the plurality of registered functions in the sorted function group.
The sorting of the plurality of function groups obtained by classification according to the length of the class name to which the function groups belong includes: sorting the plurality of function groups obtained by classification according to a class name length ascending mode; and sorting the function groups with the same class name length according to an ASCII code sequence.
The sorting the plurality of registered functions in the sorted function group includes: each called registration function is matched with a character string, and the character string comprises a function name and a parameter type of a bottom-layer method in the application program corresponding to the registration function; sequencing a plurality of registration functions in the sequenced function group according to the ascending mode of the character string length; and sorting the plurality of registration functions with the same character string length according to an ASCII code sequence.
The registration functions in the registration function list funclst are sorted according to a certain rule, and the specific operation is as follows, as shown in fig. 2, a plurality of registration functions in the same class are grouped into a function group, and all the function groups are sorted first: the row with short length of the located class name is arranged in front, the row with long length of the located class name is arranged in back, and the same length is sorted according to the ASCII code sequence. The ordering rule of multiple registered functions in the same function group may be, for example: first, each called registration function is matched to a corresponding string: the formation rule of the character string is that the function name of the java native function corresponding to the registration function and all parameter types form the character string, the character string is recorded as a registration character string methodNuameAndParamsComp, sorting is carried out according to the length of the registration character string, the short length of the registration character string methodNuameAndParamsComp is arranged in front, the long length is arranged in the back, and the same length is sorted according to the ASCII code sequence. The sorted function list funclst is obtained according to the above rules.
Through the sequencing of the registration functions in the precompiled so file, the registration functions at corresponding positions can be accurately acquired in the application program execution registration process, and the efficiency and accuracy of function registration are improved.
Step S104: and acquiring a function set to be registered of the application program, and sequencing functions to be registered in the function set to be registered, wherein the function set to be registered comprises a plurality of functions to be registered.
The android system obtains a function set to be registered of the application program, sorts functions to be registered in the function set to be registered, the function set to be registered is a function set which needs to call a bottom function in the execution process of the application program, the function set to be registered comprises a plurality of functions to be registered, each function to be registered needs to call the bottom function through a virtual machine to execute related tasks when executing corresponding tasks, and the method specifically comprises the following steps: sorting classes containing functions to be registered in the application program, wherein each class comprises a plurality of functions to be registered, sorting the classes containing the functions to be registered in the application program according to a class name length ascending mode, and sorting the functions to be registered with the same class name length according to an ASCII code sequence; firstly, acquiring all functions to be registered in a current class to form a function subset to be registered under the current class; and traversing all classes in the application program to obtain a function subset to be registered under each class, and forming a function set to be registered by a plurality of function subsets to be registered.
The obtaining of all functions to be registered in the current class and the forming of the function to be registered subset may include a sorting step, specifically: and constructing a character string for each function to be registered in the function subset to be registered, and sequencing the character strings, wherein the character strings comprise function names and parameter types, the sequencing is carried out according to the length of the character strings, the character strings with short length are arranged in the front, the character strings with long length are arranged in the back, and the character strings with the same length are sequenced according to an ASCII code sequence.
And traversing the function subset to be registered, and transferring the relevant information of the function to be registered in the function subset to be registered to the auxiliary function hellperfunc, wherein the function information to be registered comprises a current index value.
As a specific embodiment, as shown in fig. 3, after the application is started, a so file is loaded, and then the system calls a JNI _ OnLoad function of the so file, in which an implementation function hellfunc of a native function hellper of a java layer Helper class is registered in a dynamic registration manner and is recorded as an auxiliary function hellnonfunc.
After a program is started, a system calls all functions to be registered of a Helper class of a java layer, the functions to be registered are recorded as a function set register, an index variable idx is firstly created in the function set register, the index variable idx is set to be-1, and then all classes containing a native function are sequenced: the short class names are arranged in the front, the long class names are arranged in the back, and the same length is arranged according to the ASCII code sequence. Then, each class is processed according to the above sorting sequence, for example, the currently processed class is currClz, a function getDecleardmethods of the currClz is called to obtain all functions of the class, the functions are marked as a function set all methods, all the native functions in the function set all methods are found out to obtain a native function set, the native function set is marked as an all native methods, and all the functions in the native function set are sorted, the specific sorting process is that a character string is formed by a function name and all parameter types of each native function and is marked as a methodAmdParamsRem, and then the character string is sorted according to the sorting rule: the short length of the string methodNameAndParamsRuntime is ranked first, the long length is ranked last, and the same length is ranked in the order of ASCII codes.
Step S106: and calling the auxiliary function, traversing the function set to be registered, and registering the precompiled registration function into the function to be registered.
The system calls the auxiliary function, traverses the function set to be registered, and registers the precompiled registration function into the function to be registered, which specifically comprises: after the program is started, the system calls the auxiliary function, the idx is 0, the function set to be registered starts to be traversed, the precompiled registration function information is obtained according to the current index value, and the precompiled registration function is registered in the function to be registered.
As a specific implementation, the implementation process includes traversing the sorted native function set alloivemethods, for example, making the currently processed function be currMethod, increasing the index value idx by 1, that is, idx is changed from-1 to 0, starting traversal, then transferring the index value idx and the function name, the function signature, and the current class currClz of the current function currMethod to the native layer through the native function, the native layer executing the auxiliary function hellFunc, the auxiliary function hellFunc obtaining the index value idx and the function name, the function signature, and the current class Clz of the current function Method registering the function list funcList with index idx equal to 0 to the current function by the RegisterNativefunctions, thereby completing registration of the current function currod, then making the function equal to 1, completing registration of a function, completing traversal of the current class under the function set allover, and after all the traversal of the current function set allover with the curriculz, the registration of the precompiled registration function in all the so files is completed.
The so only derives the JNI _ OnLoad function, and no method name character string and method signature character string related to any native method exist in the so, so that the safety of the so is improved. The packet volume can be reduced because the method names and method signature strings of all native methods are dynamically acquired at runtime, rather than being stored in so or java code.
According to the method and the device for dynamically calling the native functions, the list of the called functions is stored in the so file, the lists of all the native functions are established during program operation, two elements at corresponding positions in the two lists are matched through an index parameter consistency mechanism, and then registration is carried out through the register native functions, so that the bottom layer functions can be dynamically called. The function registration method effectively reduces the volume of the file packet and improves the security of file access.
In addition, the present disclosure also provides an apparatus embodiment adapted to the above embodiment, for implementing the method steps described in the above embodiment, and the explanation based on the same name and meaning is the same as that of the above embodiment, and has the same technical effect as that of the above embodiment, and is not described again here.
As shown in fig. 4, according to an embodiment of the present disclosure, the present disclosure provides an application program operation control apparatus including:
the building unit 402: the method is used for dynamically constructing an auxiliary function when an application program is started, wherein the auxiliary function is used for registering a pre-compiled registration function list into the application program, and the registration function list comprises a plurality of registration functions which are ordered according to a preset condition.
The building unit 402 is further configured to: and placing all called registration functions in a registration function list, sorting the registration functions according to a preset condition, grouping a plurality of registration functions in the same class into a function group, sorting the function group, and sorting the plurality of registration functions in the function group. Wherein said sorting the set of functions, sorting a plurality of registered functions within the set of functions, comprises: sorting the set of functions: the class names of the function groups are arranged in front of the class names with short lengths, and the class names of the function groups with the same length are sorted according to an ASCII code sequence; and sorting a plurality of registered functions within the set of functions: each called registration function is matched with a character string, the character string is short in length and arranged in front, the character strings are the same in length and are sorted according to an ASCII code sequence, and the character string comprises a function name and a parameter type of a bottom-layer method in the application program corresponding to the registration function.
The acquisition unit 404: the function set to be registered is used for obtaining the function set to be registered of the application program, and the functions to be registered in the function set to be registered are sequenced, wherein the function set to be registered comprises a plurality of functions to be registered.
The android system obtains a function set to be registered of the application program, sorts functions to be registered in the function set to be registered, the function set to be registered is a function set which needs to call a bottom function in the execution process of the application program, the function set to be registered comprises a plurality of functions to be registered, each function to be registered needs to call the bottom function through a virtual machine to execute related tasks when executing corresponding tasks, and the method specifically comprises the following steps: sorting classes containing functions to be registered in the application program, wherein each class comprises a plurality of functions to be registered; firstly, acquiring all functions to be registered in a current class to form a function subset to be registered under the current class; and traversing all classes in the application program to obtain a function subset to be registered under each class, and forming a function set to be registered by a plurality of function subsets to be registered.
The obtaining unit 404 is further configured to construct a character string for each function to be registered in the subset of functions to be registered, and sort the character strings, where the character string includes a function name and a parameter type, the sorting is performed according to the length of the character string, the character string with a short length is arranged in the front, the character string with a long length is arranged in the back, and the character strings with the same length are sorted according to an ASCII code sequence. And traversing the function subset to be registered, and transferring the relevant information of the function to be registered in the function subset to be registered to the auxiliary function hellperfunc, wherein the function information to be registered comprises a current index value.
The registration unit 406: the function set is used for calling the auxiliary function, traversing the function set to be registered and registering the precompiled registration function into the function to be registered.
The registering unit 406 is further configured to, after the program is started, the system calls the auxiliary function, where idx is 0, starts to traverse the function set to be registered, obtains the pre-compiled registration function information according to the current index value, and registers the pre-compiled registration function in the function to be registered.
The so only derives the JNI _ OnLoad function, and no method name character string and method signature character string related to any native method exist in the so, so that the safety of the so is improved. The packet volume can be reduced because the method names and method signature strings of all native methods are dynamically acquired at runtime, rather than being stored in so or java code.
According to the method and the device for dynamically calling the native functions, the list of the called functions is stored in the so file, the lists of all the native functions are established during program operation, two elements at corresponding positions in the two lists are matched through an index parameter consistency mechanism, and then registration is carried out through the register native functions, so that the bottom layer functions can be dynamically called. The function registration method effectively reduces the volume of the file packet and improves the security of file access.
As shown in fig. 5, the present embodiment 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 one processor to cause the at least one processor to perform the method steps of the above embodiments.
The disclosed embodiments provide a non-volatile computer storage medium having stored thereon computer-executable instructions that may perform the method steps as described in the embodiments above.
Referring now to FIG. 5, shown is a schematic diagram of an electronic device suitable for use in implementing embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 5, the electronic device may include a processing means (e.g., central processing unit, graphics processor, etc.) 501 that may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage means 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data necessary for the operation of the electronic apparatus are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other by a bus 505. An input/output (I/O) interface 505 is also connected to bus 505.
Generally, the following devices may be connected to the I/O interface 505: input devices 506 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 505 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, etc.; storage devices 508 including, for example, magnetic tape, hard disk, etc.; and a communication device 505. The communication means 505 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. While fig. 5 illustrates an electronic device having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 505, or installed from the storage means 508, or installed from the ROM 502. The computer program performs the above-described functions defined in the methods of the embodiments of the present disclosure when executed by the processing device 501.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having 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. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
Computer program code for carrying out operations for aspects of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of an element does not in some cases constitute a limitation on the element itself.

Claims (10)

1. An application program operation control method, comprising:
when an application program is started, dynamically constructing an auxiliary function, wherein the auxiliary function is used for registering a pre-compiled registration function list into the application program, and the registration function list comprises a plurality of registration functions which are ordered according to a preset condition;
acquiring a function set to be registered of the application program, and sequencing functions to be registered in the function set to be registered, wherein the function set to be registered comprises a plurality of functions to be registered;
and calling the auxiliary function, traversing the function set to be registered, and registering the precompiled registration function into the function to be registered.
2. The method of claim 1, wherein the list of registration functions is generated by: classifying a plurality of registration functions belonging to the same class into a function group according to the class to which the registration functions belong;
sorting the plurality of function groups obtained by classification according to the length of the class name to which the function groups belong;
and sorting the plurality of registered functions in the sorted function group.
3. The method of claim 2, wherein said sorting the sorted plurality of said sets of functions by length of the belonged class name comprises:
sorting the plurality of function groups obtained by classification according to a class name length ascending mode;
and sorting the function groups with the same class name length according to an ASCII code sequence.
4. The method of claim 2, wherein the sorting for the plurality of registered functions within the sorted set of functions comprises:
each called registration function is matched with a character string, and the character string comprises a function name and a parameter type of a bottom-layer method in the application program corresponding to the registration function;
sequencing a plurality of registration functions in the sequenced function group according to the ascending mode of the character string length;
and sorting the plurality of registration functions with the same character string length according to an ASCII code sequence.
5. The method of claim 1, wherein the obtaining the set of functions to be registered of the application program and sorting the functions to be registered in the set of functions to be registered comprises:
sorting classes containing functions to be registered in the application program;
acquiring all functions to be registered in the current class to form a function subset to be registered;
and traversing the class, and forming a function set to be registered by a plurality of function subsets to be registered.
6. The method of claim 5, wherein the sorting the classes in the application program containing the functions to be registered comprises:
sorting the classes containing the functions to be registered in the application program according to a class name length ascending mode;
and sequencing the functions to be registered with the same class name length according to the ASCII code sequence.
7. The method as claimed in claim 6, wherein said obtaining all functions to be registered in the current class, forming a subset of functions to be registered, then comprises:
constructing a character string for each function to be registered in the function subset to be registered, and sequencing the character strings, wherein the character strings comprise function names and parameter types;
and traversing the function subset to be registered, and transferring the function information to be registered to the auxiliary function, wherein the function information to be registered comprises a current index value.
8. An application program operation control device, comprising:
the system comprises a construction unit, a storage unit and a processing unit, wherein the construction unit is used for dynamically constructing an auxiliary function when an application program is started, the auxiliary function is used for registering a pre-compiled registration function list into the application program, and the registration function list comprises a plurality of registration functions which are ordered according to a preset condition;
an obtaining unit, configured to obtain a function set to be registered of the application program, and sort the functions to be registered in the function set to be registered, where the function set to be registered includes multiple functions to be registered
And the registration unit is used for calling the auxiliary function, traversing the function set to be registered and registering the precompiled registration function into the function to be registered.
9. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, carries out the method according to any one of claims 1 to 8.
10. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to carry out the method of any one of claims 1 to 8.
CN202011120086.3A 2020-10-19 2020-10-19 Application program operation control method, device, medium and equipment Pending CN112306584A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011120086.3A CN112306584A (en) 2020-10-19 2020-10-19 Application program operation control method, device, medium and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011120086.3A CN112306584A (en) 2020-10-19 2020-10-19 Application program operation control method, device, medium and equipment

Publications (1)

Publication Number Publication Date
CN112306584A true CN112306584A (en) 2021-02-02

Family

ID=74328292

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011120086.3A Pending CN112306584A (en) 2020-10-19 2020-10-19 Application program operation control method, device, medium and equipment

Country Status (1)

Country Link
CN (1) CN112306584A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114168224A (en) * 2021-12-06 2022-03-11 杭州筑龙信息技术股份有限公司 Application program starting method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060129989A1 (en) * 2004-12-09 2006-06-15 Christian Fleischer System and method for registering native libraries with non-native enterprise program code
CN108733988A (en) * 2017-04-19 2018-11-02 北京洋浦伟业科技发展有限公司 The guard method of executable program on Android platform
CN109960597A (en) * 2019-03-28 2019-07-02 武汉斗鱼鱼乐网络科技有限公司 A kind of dynamic registration method and relevant apparatus of Applied layer interface
CN111124545A (en) * 2019-12-25 2020-05-08 北京奇艺世纪科技有限公司 Application program starting method and device, electronic equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060129989A1 (en) * 2004-12-09 2006-06-15 Christian Fleischer System and method for registering native libraries with non-native enterprise program code
CN108733988A (en) * 2017-04-19 2018-11-02 北京洋浦伟业科技发展有限公司 The guard method of executable program on Android platform
CN109960597A (en) * 2019-03-28 2019-07-02 武汉斗鱼鱼乐网络科技有限公司 A kind of dynamic registration method and relevant apparatus of Applied layer interface
CN111124545A (en) * 2019-12-25 2020-05-08 北京奇艺世纪科技有限公司 Application program starting method and device, electronic equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
RU_YIN_HAI: "Java字符串排序(根据字节及字符长度进行排序)"", 《CSDN:HTTPS://BLOG.CSDN.NET/RU_YIN_HAI/ARTICLE/DETAILS/106573771》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114168224A (en) * 2021-12-06 2022-03-11 杭州筑龙信息技术股份有限公司 Application program starting method and device, electronic equipment and storage medium
CN114168224B (en) * 2021-12-06 2024-02-20 杭州筑龙信息技术股份有限公司 Application program starting method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN109976793B (en) Application program running method, device, equipment and medium
CN109726217B (en) Database operation method, device, equipment and storage medium
CN110764748B (en) Code calling method, device, terminal and storage medium
CN112817657B (en) Application program starting item loading method, device, system and storage medium
CN112395253B (en) Index file generation method, terminal device, electronic device and medium
CN110781658B (en) Resume analysis method, resume analysis device, electronic equipment and storage medium
CN111068328A (en) Game advertisement configuration table generation method, terminal device and medium
CN111309304B (en) Method, device, medium and electronic equipment for generating IDL file
CN113407165B (en) SDK generation and self-upgrade method, device, readable medium and equipment
CN112306584A (en) Application program operation control method, device, medium and equipment
CN112527302B (en) Error detection method and device, terminal and storage medium
CN111124541B (en) Configuration file generation method, device, equipment and medium
CN111796865B (en) Byte code file modification method, device, terminal equipment and medium
CN113448585B (en) Compiling method and device of thread pool, electronic equipment and storage medium
CN112631608A (en) Compiling method, device, terminal and storage medium
CN111797009A (en) Method and device for detecting code compatibility and electronic equipment
CN112068814A (en) Method, device, system and medium for generating executable file
CN114780107B (en) Grammar analysis method and device of rule running file and decision engine
CN112711400B (en) View processing method, device and storage medium
CN113342633B (en) Performance test method and device
WO2024109090A1 (en) Hybrid execution method and apparatus of programmable logic controller, device, and medium
CN111209225B (en) Method, device, medium and electronic equipment for acquiring real address
CN117311838A (en) File processing method, device, equipment and storage medium based on dynamic plug-in
CN116450289A (en) Data processing method, device, storage medium and electronic equipment
CN114968260A (en) Hybrid pre-compiling method and device, electronic equipment and storage medium

Legal Events

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

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant after: Tiktok vision (Beijing) Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant before: BEIJING BYTEDANCE NETWORK TECHNOLOGY Co.,Ltd.

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant after: Douyin Vision Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant before: Tiktok vision (Beijing) Co.,Ltd.

CB02 Change of applicant information
RJ01 Rejection of invention patent application after publication

Application publication date: 20210202

RJ01 Rejection of invention patent application after publication