CN110990296B - Identification method of class component, server, terminal and storage medium - Google Patents

Identification method of class component, server, terminal and storage medium Download PDF

Info

Publication number
CN110990296B
CN110990296B CN201911328097.8A CN201911328097A CN110990296B CN 110990296 B CN110990296 B CN 110990296B CN 201911328097 A CN201911328097 A CN 201911328097A CN 110990296 B CN110990296 B CN 110990296B
Authority
CN
China
Prior art keywords
class
class component
component
client
access information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911328097.8A
Other languages
Chinese (zh)
Other versions
CN110990296A (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.)
Douyin Vision Co Ltd
Original Assignee
Douyin Vision 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 Douyin Vision Co Ltd filed Critical Douyin Vision Co Ltd
Priority to CN201911328097.8A priority Critical patent/CN110990296B/en
Publication of CN110990296A publication Critical patent/CN110990296A/en
Application granted granted Critical
Publication of CN110990296B publication Critical patent/CN110990296B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3628Software debugging of optimised code

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The application relates to a method for identifying a class of components, a server, a terminal and a storage medium. The method comprises the following steps: acquiring a class component set to be detected corresponding to an application program; wherein the class component set comprises identification information of at least two class components; access information is acquired, wherein the access information is generated after a client accesses a first type component in the type component set and runs a detection program arranged in the first type component; the access information characterizes the mapping relation between the identification information of the first type component and the access characteristic information of the first type component accessed by the client; and obtaining the identification information of the first class component based on the access information, and removing the first class component corresponding to the access characteristic information of the client from the class component set to obtain a target class component set containing the identification information of the second class component. Therefore, a foundation is laid for effectively identifying useless classes for the client and reducing the volume of the application program.

Description

Identification method of class component, server, terminal and storage medium
Technical Field
The present application relates to the field of computers, and in particular, to a method for identifying a class of components, a server, a terminal, and a storage medium.
Background
For a program that iterates continuously and quickly, the unnecessary codes and resources can continuously increase, and occupy the volume of the program package, for example, for an Android program that iterates continuously and quickly, the unnecessary codes and resources occupy a large part of the volume of the Android application package (Android application package, APK), so in order to reduce the occupation of resources, the unnecessary codes and related resources need to be found out and deleted to prevent accumulation.
In the prior art, the mutual reference relation of codes is usually found out before compiling or during compiling through static code analysis, the codes without references are identified as useless codes, and then the identified useless codes are deleted to reduce useless resource occupation. However, in actual project engineering, due to business iteration, the code with reference relation is marked as reference by means of two comparison schemes, such as an AB scheme, but the code with reference relation is also left in the project as useless code due to business iteration. Alternatively, unreasonable setting of the code architecture may also cause unwanted code to be referenced, such as the parent class method being overwritten by the child class, the code in the parent class method not being invoked but still remaining in the item, and obviously, the existing method cannot identify unwanted classes in the above scenario.
Disclosure of Invention
In order to solve the problems, the application provides a method for identifying class components, a server, a terminal and a storage medium, which can screen class components to be detected based on access characteristic information of a client, and lay a foundation for effectively identifying useless classes for the client, and further lay a foundation for reducing the volume of an application program.
In a first aspect, an embodiment of the present application provides a method for identifying a class component, which is applied to a server, where the method includes:
acquiring a class component set to be detected corresponding to an application program; wherein the class component set comprises identification information of at least two class components;
access information is acquired, wherein the access information is generated after a client accesses a first type component in the type component set and runs a detection program arranged in the first type component; the access information characterizes the mapping relation between the identification information of the first type component and the access characteristic information of the first type component accessed by the client;
and obtaining the identification information of the first class component based on the access information, and removing the first class component corresponding to the access characteristic information of the client from the class component set to obtain a target class component set containing the identification information of the second class component.
Here, the class components in the class component set are screened based on the access information, and the access information is generated after the client accesses the class components, so that the second class components, namely useless classes, for the client can be effectively identified, and a foundation is laid for reducing the package volume of the application program. In addition, because the screening method of the embodiment of the application is not carried out based on the reference relation among the class components, but is carried out on the access information of the client, compared with the existing method for screening the useless class through the reference relation, the screening method has higher screening accuracy and wider application scene, and therefore, the embodiment of the application can lay a foundation for maximally deleting useless resources and reducing the inclusion area of the application program.
In a specific embodiment, the method further comprises:
determining the reference relation characteristics between the second class components in the target class component set;
determining a characteristic value of the second class component based on the reference relation characteristic;
selecting at least one target second class component from the set of target class components based at least on the feature values of the second class components;
and deleting the code data corresponding to the at least one target second-class component from the application program so as to remove the code data of the target second-class component which does not correspond to the access characteristic information of the client.
Here, when the determined second class components are more, in order to avoid time and effort consumption in further carding and improve carding efficiency, the reference relation characteristics between the second class components can be determined, for example, the reference relation characteristics between the second class components are determined by utilizing an aggregation mode, so that the reliability of the target second class components determined based on the reference relation characteristics is greatly improved, and further, a foundation is further laid for effectively reducing the number of useless classes and reducing the inclusion volume of an application program.
In a specific embodiment, the method further comprises:
determining code data corresponding to the second type of component;
and deleting the code data corresponding to the second type of components from the application program to remove the code data of the second type of components which do not correspond to the access characteristic information of the client.
Here, the second type component obtained by screening is a type not corresponding to the access information of the client, so that the code data corresponding to the second type component in the application program can be deleted based on the second type component, thereby reducing useless resources and further reducing the package volume of the application program.
In a specific embodiment, before the access information is obtained, the method further includes:
setting a detection program in a constructor of class components of the class component set; or setting a detection program in an initialization function of the class component set;
wherein the detection program is capable of running and generating the access information after the client accesses the class component.
Here, in order to obtain the access information of the client, a detection program is set in the constructor of the class component or in the initializing function, so that after the client accesses the class component, the set detection function can be operated to generate the access information, thereby laying a foundation for effectively obtaining the access information of the client, further laying a foundation for effectively reducing the number of useless classes and reducing the inclusion volume of the application program.
In a second aspect, an embodiment of the present application provides a method for identifying a class component, which is applied to a client, where the method includes:
accessing a first class component in a class component set to be detected, which corresponds to an application program, wherein the class component set contains identification information of at least two class components;
running a detection program arranged on the first type component, and generating access information based on the detection program, wherein the access information characterizes the mapping relation between the identification information of the first type component and the access characteristic information of the first type component accessed by the client;
storing the access information; and after detecting that the running state of the application program meets the preset rule, sending the access information.
The detection program is arranged in the class component, and after the client accesses the class component, the detection program can be operated to generate access information, so that a foundation is laid for the server to screen the class component based on the access information, and further a foundation is laid for effectively reducing the number of useless classes and reducing the inclusion area of the application program.
In a third aspect, an embodiment of the present application provides a server, including:
the acquisition unit is used for acquiring a class component set to be detected corresponding to the application program; wherein the class component set comprises identification information of at least two class components; access information is acquired, wherein the access information is generated after a client accesses a first type component in the type component set and runs a detection program arranged in the first type component; the access information characterizes the mapping relation between the identification information of the first type component and the access characteristic information of the first type component accessed by the client;
the processing unit is used for obtaining the identification information of the first class of components based on the access information, and obtaining a target class component set containing the identification information of the second class of components after removing the first class of components corresponding to the access characteristic information of the client from the class component set.
In a specific embodiment, the processing unit is further configured to:
determining the reference relation characteristics between the second class components in the target class component set;
determining a characteristic value of the second class component based on the reference relation characteristic;
selecting at least one target second class component from the set of target class components based at least on the feature values of the second class components;
and deleting the code data corresponding to the at least one target second-class component from the application program so as to remove the code data of the target second-class component which does not correspond to the access characteristic information of the client.
In a specific embodiment, the processing unit is further configured to:
determining code data corresponding to the second type of component;
and deleting the code data corresponding to the second type of components from the application program to remove the code data of the second type of components which do not correspond to the access characteristic information of the client.
In a specific embodiment, the processing unit is further configured to: setting a detection program in a constructor of class components of the class component set; or setting a detection program in an initialization function of the class component set;
wherein the detection program is capable of running and generating the access information after the client accesses the class component.
In a fourth aspect, an embodiment of the present application provides a terminal, provided with a client, the terminal including:
the access unit is used for accessing a first class component in a class component set to be detected, which corresponds to the application program, wherein the class component set contains identification information of at least two class components;
the information generation unit is used for running a detection program arranged on the first type component and generating access information based on the detection program, wherein the access information represents the mapping relation between the identification information of the first type component and the access characteristic information of the first type component accessed by the client;
a transmitting unit configured to store the access information; and after detecting that the running state of the application program meets the preset rule, sending the access information.
In a fifth aspect, an embodiment of the present application provides a server, including:
one or more processors;
a memory communicatively coupled to the one or more processors;
one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, the one or more application programs configured to perform the above method applied to the server side.
A sixth method, provided in an embodiment of the present application, is a terminal, provided with a client, including:
one or more processors;
a memory communicatively coupled to the one or more processors;
one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, the one or more application programs configured to perform the above method applied to the client side.
In a seventh aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the method described above as applied to a server side; alternatively, the method described above as applied to the client side is implemented.
Therefore, the class components in the class component set are screened based on the access information, and the access information is generated after the client accesses the class components, so that the second class components, namely useless classes, for the client can be effectively identified, and a foundation is laid for reducing the package volume of the application program. In addition, because the screening method of the embodiment of the application is not carried out based on the reference relation among the class components, but is carried out on the access information of the client, compared with the existing method for screening the useless class through the reference relation, the screening method has higher screening accuracy and wider application scene, and therefore, the embodiment of the application can lay a foundation for maximally deleting useless resources and reducing the inclusion area of the application program.
Drawings
FIG. 1 is a schematic diagram of an implementation flow of a method for identifying class components according to an embodiment of the present application;
FIG. 2 is a schematic diagram of an embodiment of a method for identifying class components in a specific application scenario;
FIG. 3 is a second schematic implementation flow chart of the identification method of the class component according to the embodiment of the present application;
FIG. 4 is a schematic diagram of a logic unit of a server according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a hardware structure of a server according to an embodiment of the present application;
FIG. 6 is a schematic diagram of a logic unit of a terminal according to an embodiment of the present application;
fig. 7 is a schematic diagram of a hardware structure of a terminal according to an embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
In some of the procedures described in the specification and claims of the present application and the above figures, a plurality of operations appearing in a particular order are included, but it should be clearly understood that the procedures may include more or less operations, and that the operations may be performed in order or in parallel.
Aiming at the problems in the prior art, the scheme of the application needs to solve the following problems: 1) How to locate the useless resources without reference relation; 2) How to comb these useless resources.
For the first problem, the inventive solution analyzes the unwanted code from the user's (i.e., the client as described by the inventive solution). An additional program (i.e., the detection program according to the present application) is executed in the initialization process of each class (i.e., the class component according to the present application), and the access information of the class is reported to the server (i.e., the server according to the present application), where, because the user quantity is very large, the class that is not reported on the server can be regarded as a useless class (i.e., the second class component according to the present application).
For the second problem, the scheme of the application carries out useless class aggregation on multiple versions of the same program, calculates the mutual reference relation between useless classes, and finally carries out carding and checking based on the calculated useless class priority so as to lock useless resources. Thus, after the useless resources are determined, the useless resources with or without the reference relation are deleted, and the volume of the application program is reduced to a greater extent.
Based on the above, the embodiment of the application provides a method for identifying a class of components, a server, a terminal and a storage medium; specifically, fig. 1 is a schematic implementation flow chart of a method for identifying class components according to an embodiment of the present application, as shown in fig. 1, where the method includes:
step 101: the method comprises the steps that a server obtains a class component set to be detected corresponding to an application program; the class component set comprises identification information of at least two class components.
In practical applications, the class components to be detected may be all class components corresponding to multiple versions of the application program. Of course, in order to avoid deleting class components that the client cannot access but have influence on the overall performance or maintaining normal operation and the like, all class components corresponding to multiple versions can be screened, and a class component set to be detected can be screened. Here, the class component to be detected obtained by screening can determine whether it is a useless resource through the access of the client.
Step 102: the method comprises the steps that a server obtains access information, wherein the access information is generated after a client accesses a first type component in the first type component set and runs a detection program arranged in the first type component; and the access information characterizes the mapping relation between the identification information of the first-class component and the access characteristic information of the client accessing the first-class component.
In a specific example, to ensure that the access information can be acquired, the server needs to set a detection program in the class component in advance, specifically, set a detection program in a constructor of the class component set; or setting a detection program in an initialization function of the class component set, wherein the detection program can be operated after the client accesses the class component and generates the access information, so that after the client accesses the class component, the detection program arranged in the class component is operated to generate the access information, and further, a foundation is laid for determining useless resources based on the access information of the client.
Here, in order to avoid increasing the packet size and increasing the performance overhead, the detection program is provided in the initialization program, and here, the constructor and the initialization function are included in the initialization program. In practical application, the class component to be detected contains a plurality of constructors during construction, and a calling relationship may exist in the plurality of constructors, at this time, if each constructor is provided with a detection program or two or more constructors, repeated reporting is caused, so in order to avoid repeated reporting, one target constructor is selected from the plurality of constructors of the class component to be detected, and the detection program is set in the selected target constructor, thereby avoiding repeated reporting on the basis that access information reporting can be realized.
In a specific example, the access information acquired by the server side is generated after the client side accesses the class component, specifically, as shown in fig. 2, the client side accesses a first class component in the class component set to be detected corresponding to the application program; the method comprises the steps that a client runs a detection program arranged on a first type component and generates access information based on the detection program, wherein the access information represents a mapping relation between identification information of the first type component and access characteristic information of the first type component accessed by the client; the client stores the access information. In practical application, after generating the access information, the client stores the access information in the cache; of course, in order to avoid occupying excessive network resources to transmit the access information, the client sends the access information after detecting that the running state of the application program meets a preset rule, for example, after detecting that the client starts the application program, that is, when the client is in a state of running in the foreground or running in the background, the client does not send the access information to the server, but sends the access information to the server after switching from the off state to the on state (that is, starting), so that the server is convenient to screen class components based on the access information, and useless resources are deleted. Of course, the foregoing preset rule is only used to explain the sending timing, and in practical application, the sending timing may be set according to the actual requirement, which is not limited by the embodiment of the present application.
Step 103: the server obtains the identification information of the first type of components based on the access information, and obtains a target type of component set containing the identification information of the second type of components after removing the first type of components corresponding to the access characteristic information of the client from the type of component set.
In a specific example, after the target class component set is determined, code data corresponding to the second class component is obtained based on the identification information of the second class component, and then the code data corresponding to the second class component is deleted from the application program, so that the code data of the second class component which is not corresponding to the access characteristic information of the client is removed, and the package volume of the application program is reduced.
In another specific example, after the target class component set is determined, code data corresponding to the second class component is not directly deleted, and secondary screening is performed to avoid misdeletion, where when more second class components exist in the determined target class component set, if manual screening is performed one by one, time and labor are inevitably consumed, labor cost is increased, and efficiency is reduced, so that in order to effectively perform secondary screening, the obtained second class components can be processed in an aggregation manner, specifically, reference relation characteristics among the second class components in the target class component set are determined by using an aggregation method, feature values of the second class components are determined based on the reference relation characteristics, at least one target second class component is selected from the target class component set at least based on the feature values of the second class component, and code data of the second class component, which is not corresponding to access feature information of a client, is deleted from the application program. In practical application, after determining the feature value of the second class component, the second class component may be further ranked based on the feature value, and then at least one target second class component is selected based on the ranking result, so that code data corresponding to all the target second class components is deleted in the application program.
Of course, in practical application, after deleting the code data of the second class component or the target second class component, the multimedia resources, such as pictures, referenced by the second class component or the target second class component are deleted correspondingly, so that the package volume of the application program is further reduced.
Therefore, the class components in the class component set are screened based on the access information, and the access information is generated after the client accesses the class components, so that the second class components, namely useless classes, for the client can be effectively identified, and a foundation is laid for reducing the package volume of the application program. In addition, because the screening method of the embodiment of the application is not carried out based on the reference relation among the class components, but is carried out on the access information of the client, compared with the existing method for screening the useless class through the reference relation, the screening method has higher screening accuracy and wider application scene, and therefore, the embodiment of the application can lay a foundation for maximally deleting useless resources and reducing the inclusion area of the application program.
The following describes embodiments of the present application in further detail with reference to specific application programs, specifically, reporting identification information of all classes (i.e., class components described above, in this example, simply referred to as classes) in the APK to a server for storage. In practical application, in order to avoid the increase of the packet size and increase the performance overhead, a detection program is set for each class in the APK, for example, a detection program is inserted into the initialization running program, and the detection is used to store the access information of the class into a cache and report the access information to the server, so that the server can acquire the access information of the class, for example, the server can record the access times of the reported class, where, based on the long-time and large number of user reports, the server can count the class reported for 0 times and consider the class reported for 0 times as a useless class. The method comprises the following specific steps:
step 1: a white list is established without instrumentation to exclude network libraries, native libraries, etc.
Step 2: after Proguard, class (class) is traversed, excluding classes in the whitelist, generating a set of classes to be detected.
Step 3: and storing the set of the classes to be detected into a file, and uploading the file to a server for storage.
Step 4: traversing the set of classes to be detected, modifying byte codes, and instrumentation is performed on all initialization programs to insert detection programs.
In practical applications, the initialization program includes class configuration (< init >) (i.e., a constructor) and class initialization (< clinit >) (i.e., an initializer function), however, in order to ensure performance, only < clinit > may be instrumented, and the embodiment of the present application is not limited thereto, and only the instrumentation method will be described below, and when the present application is applied, an alternative choice may be selected according to practical requirements.
It should be noted that, the class may include a plurality of constructors, and call relationships exist between the constructors, so, in order to avoid repeated pile insertion and repeated reporting, pile insertion may be performed on only one constructor in the class; the specific flow is shown in figure 3, all the programs of the class to be detected are traversed, whether the class is an initialization program is judged, if yes, whether other construction functions are called by the this keyword is contained is judged, if yes, pile insertion is not carried out, repeated calling is avoided, and the process is ended; otherwise, stake-in is performed to insert the detection program. And < clinit > is detected, then the pile is directly inserted.
Step 5: after running the instrumentation program, a unique identification number (Identity document, ID) is generated for each class to be instrumented.
Here, the unique ID of the class may be constructed using high and low bits of integers to represent different information such as class name, method name, etc., to reduce the storage pressure.
Step 6: and running a instrumentation program, storing the unique ID of the class accessed by the client into a mapping relation cache table of ID call information of the client, if the mapping relation cache table is available, creating ID call information +1, and if the mapping relation cache table is not available, creating ID-call information, and calling information +1. Here, the mapping relation cache table characterizes a mapping relation between unique IDs of classes and call information.
Step 7: and when detecting that the application program is at a certain time, reporting the mapping relation cache table to the server.
Thus, useless classes are obtained after long-term data statistics. Here, since there may be a large number of useless classes, it takes time and effort to comb one by one, so that multiple versions of useless classes can be aggregated, thereby greatly reducing the number of useless classes and improving the reliability of the finally determined useless classes. For example,
after the useless classes are primarily determined, the reference relation among the useless classes is analyzed, and then the useless classes are sequenced according to the reference relation, so that secondary screening is performed, a foundation is laid for efficiently determining the useless classes, and meanwhile, a foundation is laid for effectively reducing the volume of the package.
In order to implement the above method applied to the server side, the embodiment of the present application further provides a server, as shown in fig. 4, where the server includes:
an obtaining unit 41, configured to obtain a class component set to be detected corresponding to an application program; wherein the class component set comprises identification information of at least two class components; access information is acquired, wherein the access information is generated after a client accesses a first type component in the type component set and runs a detection program arranged in the first type component; the access information characterizes the mapping relation between the identification information of the first type component and the access characteristic information of the first type component accessed by the client;
the processing unit 42 is configured to obtain identification information of a first class component based on the access information, and remove the first class component corresponding to the access feature information of the client from the class component set to obtain a target class component set containing identification information of a second class component.
In a specific embodiment, the processing unit 42 is further configured to:
determining the reference relation characteristics between the second class components in the target class component set;
determining a characteristic value of the second class component based on the reference relation characteristic;
selecting at least one target second class component from the set of target class components based at least on the feature values of the second class components;
and deleting the code data corresponding to the at least one target second-class component from the application program so as to remove the code data of the target second-class component which does not correspond to the access characteristic information of the client.
In a specific embodiment, the processing unit 42 is further configured to:
determining code data corresponding to the second type of component;
and deleting the code data corresponding to the second type of components from the application program to remove the code data of the second type of components which do not correspond to the access characteristic information of the client.
In a specific embodiment, the processing unit 42 is further configured to: setting a detection program in a constructor of class components of the class component set; or setting a detection program in an initialization function of the class component set;
wherein the detection program is capable of running and generating the access information after the client accesses the class component.
The embodiment of the application also provides a server, which comprises: one or more processors; a memory communicatively coupled to the one or more processors; one or more applications; wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to perform the above method applied to the server side.
In a specific example, the server according to the embodiment of the present application may be in the structure shown in fig. 5, where the server includes at least a processor 51, a storage medium 52, and at least one external communication interface 53; the processor 51, the storage medium 52 and the external communication interface 53 are all connected by a bus 54. The processor 51 may be an electronic component with a processing function, such as a microprocessor, a central processing unit, a digital signal processor, or a programmable logic array. The storage medium has stored therein computer executable code capable of performing the method applied to the server side as described in any of the above embodiments. In practical applications, both the acquisition unit 41 and the processing unit 42 may be implemented by the processor 51.
It should be noted here that: the description of the server embodiment above is similar to the description of the method applied to the server, and has the same advantages as those of the method embodiment, so that a detailed description is omitted. For technical details not disclosed in the server embodiments of the present application, those skilled in the art will understand with reference to the description of the method embodiments of the present application applied to the server side, and for the sake of economy, the description is omitted here.
In order to implement the method applied to the client side, the embodiment of the application also provides a terminal, which is provided with a client, as shown in fig. 6, and the terminal comprises:
an access unit 61, configured to access a first class component in a class component set to be detected corresponding to an application program, where the class component set includes identification information of at least two class components;
an information generating unit 62, configured to run a detection program set in the first type component, and generate access information based on the detection program, where the access information characterizes a mapping relationship between identification information of the first type component and access feature information of the first type component accessed by the client;
a transmitting unit 63 for storing the access information; and after detecting that the running state of the application program meets the preset rule, sending the access information.
The embodiment of the application also provides a terminal, which comprises: one or more processors; a memory communicatively coupled to the one or more processors; one or more applications; wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, the one or more application programs configured to apply to the client-side method.
In a specific example, as shown in fig. 7, the terminal according to the embodiment of the present application includes a processor 71 and a memory 72; the memory 72 is for storing a program for executing the above-described method applied to the client side; the processor 71 is configured to execute programs stored in the memory 72. Further, as shown in fig. 7, the terminal provided by the embodiment of the present application further includes an input device 73 (e.g., a touch screen, a camera, a microphone, etc.), an output device 74 (e.g., a display screen, a speaker, etc.), a communication module 75, and a power module 76.
The memory 72, the input device 73, the output device 74, the communication module 75, and the power module 76 are connected to the processor 71 through a serial port, a bus, or a USB interface.
Here, for a single processor terminal, the processor 71 is a CPU (central processing unit); for the dual processor terminal, the processor 71 includes a master processor and a slave processor, and the master processor executes an application program to implement the method for providing the client side according to the embodiment of the present application, and if communication with the outside is required, the slave processor controls the communication module to implement the method in cooperation; for a terminal including a GPU (graphics processor) and a CPU, the processor 71 refers to the GPU and the CPU, and the GPU and the CPU cooperate to implement a method for providing a client side according to an embodiment of the present application.
It should be noted that for different terminals (single processor smartphones, dual processor smartphones, smart wearable devices, tablet computers, etc.), it is possible to include more or less hardware structures than the terminal shown in fig. 7, but it is within the scope of the present application as long as the memory 72 and the processor 71 are included and the functions applied to the client side method embodiments described above can be implemented.
Here, it should be noted that: the description of the terminal embodiment above is similar to the description of the method applied to the client side above, and has the same beneficial effects as those of the method embodiment, so that a detailed description is omitted. For technical details not disclosed in the terminal embodiment of the present application, those skilled in the art will understand with reference to the description of the method embodiment of the present application applied to the client side, and for economy, the description is omitted herein.
The embodiment of the application also provides a computer readable storage medium storing a computer program which, when executed by a processor, implements a method applied to a server side; alternatively, a method as applied to the client side is implemented.
Here, a computer-readable storage medium may be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable read-only memory (CDROM). In addition, the computer-readable storage medium may even be paper or other suitable medium upon which the program is printed, as the program may be electronically captured, via, for instance, optical scanning of the paper or other medium, then compiled, interpreted, or otherwise processed in a suitable manner, if necessary, and then stored in a computer memory.
It should be understood that all or part of the steps carried out in the method of the above embodiment may be implemented by a program, which may be stored in a computer readable storage medium, and the program, when executed, includes one or a combination of the steps of the method embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing module, or each unit may exist alone physically, or two or more units may be integrated in one module. The integrated modules may be implemented in hardware or in software functional modules. The integrated modules may also be stored in a computer readable storage medium if implemented in the form of software functional modules and sold or used as a stand-alone product. The storage medium may be a read-only memory, a magnetic or optical disk, or the like.
The embodiments described above are only some, but not all, embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to fall within the scope of the application.

Claims (10)

1. A method for identifying a class of components, the method being applied to a server, the method comprising:
acquiring a class component set to be detected corresponding to an application program, setting a detection program for each class component of the class component set in an application program package of the application program, wherein the detection program can run and generate access information after a client accesses the corresponding class component; wherein the class component set comprises identification information of at least two class components;
access information is acquired, wherein the access information is generated after a client accesses a first type component in the type component set and runs a detection program arranged in the first type component; the access information characterizes the mapping relation between the identification information of the first type component and the access characteristic information of the first type component accessed by the client;
and obtaining the identification information of the first class component based on the access information, removing the first class component corresponding to the access characteristic information of the client from the class component set, and obtaining a target class component set containing the identification information of the second class component, wherein the second class component is a class component corresponding to the access information which is not reported by the client.
2. The method according to claim 1, wherein the method further comprises:
determining the reference relation characteristics between the second class components in the target class component set;
determining a characteristic value of the second class component based on the reference relation characteristic;
selecting at least one target second class component from the set of target class components based at least on the feature values of the second class components;
and deleting the code data corresponding to the at least one target second-class component from the application program so as to remove the code data of the target second-class component which does not correspond to the access characteristic information of the client.
3. The method according to claim 1, wherein the method further comprises:
determining code data corresponding to the second type of component;
and deleting the code data corresponding to the second type of components from the application program to remove the code data of the second type of components which do not correspond to the access characteristic information of the client.
4. The method according to claim 1 or 2, wherein said setting a detection program for each class component of said set of class components in an application package of said application program comprises:
setting a detection program in a constructor of class components of the class component set; or, setting a detection program in an initialization function of the class component set.
5. A method for identifying a class of components, the method being applied to a client, the method comprising:
accessing a first class component in a class component set to be detected, which corresponds to an application program, wherein the class component set contains identification information of at least two class components, a detection program corresponding to each class component in the class component set is arranged in an application program package of the application program, and the detection program can run and generate access information after a client accesses the corresponding class component;
running a detection program arranged on the first type component, and generating access information based on the detection program, wherein the access information characterizes the mapping relation between the identification information of the first type component and the access characteristic information of the first type component accessed by the client;
storing the access information;
after detecting that the running state of the application program meets a preset rule, sending the access information, wherein the access information is used for a server to obtain a target class component set containing identification information of a second class component from the class component set, and the second class component is a class component corresponding to the access information which is not reported by the client.
6. A server, comprising:
the acquisition unit is used for acquiring a class component set to be detected corresponding to the application program; wherein the class component set comprises identification information of at least two class components; access information is acquired, wherein the access information is generated after a client accesses a first type component in the type component set and runs a detection program arranged in the first type component; the access information characterizes the mapping relation between the identification information of the first type component and the access characteristic information of the first type component accessed by the client;
the processing unit is used for setting a detection program for each class component of the class component set in an application program package of the application program, obtaining identification information of a first class component based on the access information, removing the first class component corresponding to the access characteristic information of the client from the class component set to obtain a target class component set containing the identification information of a second class component, wherein the second class component is a class component corresponding to the access information which is not reported by the client, and the detection program can run and generate the access information after the client accesses the corresponding class component.
7. A terminal, characterized in that a client is provided, the terminal comprising:
the access unit is used for accessing a first class component in a class component set to be detected, which corresponds to an application program, wherein the class component set contains identification information of at least two class components, a detection program corresponding to each class component in the class component set is arranged in an application program package of the application program, and the detection program can run and generate access information after a client accesses the corresponding class component;
the information generation unit is used for running a detection program arranged on the first type component and generating access information based on the detection program, wherein the access information represents the mapping relation between the identification information of the first type component and the access characteristic information of the first type component accessed by the client;
a transmitting unit configured to store the access information; after detecting that the running state of the application program meets a preset rule, sending the access information, wherein the access information is used for a server to obtain a target class component set containing identification information of a second class component from the class component set, and the second class component is a class component corresponding to the access information which is not reported by the client.
8. A server, comprising:
one or more processors;
a memory communicatively coupled to the one or more processors;
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications configured to perform the method of any of claims 1 to 4.
9. A terminal, characterized in that it is provided with a client, comprising:
one or more processors;
a memory communicatively coupled to the one or more processors;
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications configured to perform the method of claim 5.
10. A computer readable storage medium storing a computer program, characterized in that the program when executed by a processor implements the method according to any one of claims 1 to 4 or the program when executed by a processor implements the method according to claim 5.
CN201911328097.8A 2019-12-20 2019-12-20 Identification method of class component, server, terminal and storage medium Active CN110990296B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911328097.8A CN110990296B (en) 2019-12-20 2019-12-20 Identification method of class component, server, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911328097.8A CN110990296B (en) 2019-12-20 2019-12-20 Identification method of class component, server, terminal and storage medium

Publications (2)

Publication Number Publication Date
CN110990296A CN110990296A (en) 2020-04-10
CN110990296B true CN110990296B (en) 2023-10-13

Family

ID=70074345

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911328097.8A Active CN110990296B (en) 2019-12-20 2019-12-20 Identification method of class component, server, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN110990296B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106547683A (en) * 2015-09-22 2017-03-29 阿里巴巴集团控股有限公司 A kind of redundant code detection method and device
CN106802860A (en) * 2015-11-25 2017-06-06 阿里巴巴集团控股有限公司 Useless class detection method and device
CN108628751A (en) * 2018-05-17 2018-10-09 北京三快在线科技有限公司 A kind of useless dependence item detection method and device
CN110399721A (en) * 2018-12-28 2019-11-01 腾讯科技(深圳)有限公司 A kind of software identification method and server and client

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20100011740A (en) * 2008-07-25 2010-02-03 엘지전자 주식회사 Host and client device and method for changing class thereof

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106547683A (en) * 2015-09-22 2017-03-29 阿里巴巴集团控股有限公司 A kind of redundant code detection method and device
CN106802860A (en) * 2015-11-25 2017-06-06 阿里巴巴集团控股有限公司 Useless class detection method and device
CN108628751A (en) * 2018-05-17 2018-10-09 北京三快在线科技有限公司 A kind of useless dependence item detection method and device
CN110399721A (en) * 2018-12-28 2019-11-01 腾讯科技(深圳)有限公司 A kind of software identification method and server and client

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
移动互联网音视频类协议识别技术研究与实现;赵政;《信息网络安全》(第12期);61-64 *

Also Published As

Publication number Publication date
CN110990296A (en) 2020-04-10

Similar Documents

Publication Publication Date Title
US9729671B2 (en) Systems and processes for computer log analysis
US10102047B2 (en) In-memory data analytic system that provides an integrated tracking mechanism for explicit memory resources
US20160224329A1 (en) Automated software configuration management
CN111680008B (en) Log processing method and system, readable storage medium and intelligent device
CN110688096B (en) Method and device for constructing application program containing plug-in, medium and electronic equipment
CN112099798B (en) Method and device for counting time consumption of public function execution, storage medium and terminal
CN112769706B (en) Componentized routing method and system
CN111274512A (en) Page loading method, device and medium
CN114531477B (en) Method and device for configuring functional components, computer equipment and storage medium
CN109828859B (en) Mobile terminal memory analysis method and device, storage medium and electronic equipment
CN112667405A (en) Information processing method, device, equipment and storage medium
CN107526623B (en) Data processing method and device
CN111177113A (en) Data migration method and device, computer equipment and storage medium
CN112559088A (en) Configuration file optimization method, device, server and storage medium
CN111767056A (en) Source code compiling method, executable file running method and terminal equipment
CN116028455A (en) Data processing method and device, storage medium and electronic equipment
CN105468412A (en) Dynamic packaging method and dynamic packaging device
CN116126742A (en) Memory access method, device, server and storage medium
CN111427782A (en) Operation method, device, equipment and storage medium of android dynamic link library
CN110022341B (en) Data transmission method and related equipment
CN110990296B (en) Identification method of class component, server, terminal and storage medium
CN110659189B (en) Application program generation method and device, cloud server and readable storage medium
CN111046393B (en) Vulnerability information uploading method and device, terminal equipment and storage medium
CN110569157B (en) Storage testing method, device, server and storage medium
CN109271543B (en) Thumbnail display method and device, terminal and computer-readable 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
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.

GR01 Patent grant
GR01 Patent grant