Data processing method, data display method, server, terminal and storage medium

By obtaining the feature matrix of the application for similarity calculation, the problem of low similarity judgment efficiency and high misjudgment rate of mini-programs is solved, and fast and accurate similarity detection is achieved, which is suitable for homogeneous judgment of large-scale mini-programs. .

CN114489784BActive Publication Date: 2025-01-07TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011255697.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-11
Publication Date
2025-01-07
Estimated Expiration
2040-11-11

AI Technical Summary

Technical Problem

It is difficult for the existing technology to efficiently judge the similarity between multiple mini programs, especially when the number of mini programs is huge, manual review efficiency is low and the misjudgment rate is high, so it is impossible to effectively solve the phenomenon of homogeneity.

Method used

By obtaining the feature matrix of the two applications, performing similarity operations based on the key structural information in the code data, calculating the similarity and outputting the results, improving the accuracy and efficiency of the detection.

Benefits of technology

It realizes rapid and accurate judgment of the similarity between two applications, overcomes misjudgments caused by code obfuscation, saves computing time, and is suitable for similarity detection of large-scale mini-programs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114489784B_ABST
    Figure CN114489784B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention discloses a data processing method, a data display method, a server, a terminal and a storage medium, wherein the data processing method may include: obtaining a first characteristic matrix corresponding to a first application and a second characteristic matrix corresponding to a second application; performing a similarity operation on the first characteristic matrix and the second characteristic matrix to obtain the similarity between the first characteristic matrix and the second characteristic matrix; and outputting the similarity between the first application and the second application based on the similarity between the first characteristic matrix and the second characteristic matrix. The embodiment of the present invention improves the efficiency and accuracy of similarity detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a data processing method, a data display method server, a terminal and a storage medium. Background Art

[0002] With the development of technology, running subprograms (or mini-programs) in a client has become a popular way of running applications, such as running a food ordering mini-program in WeChat, running a game mini-program in QQ, etc. Such mini-programs can be used without downloading or installing, saving the terminal's memory usage of downloaded applications and improving the user experience.

[0003] However, as the number of mini-programs increases, the phenomenon of homogeneity among mini-programs also emerges. At present, the way to determine whether there is homogeneity among mini-programs is manual review. However, the manual review method has problems such as labor consumption, low review efficiency, and high misjudgment rate. As time goes by, the number of mini-programs running may even reach tens of thousands, and it is almost impossible to complete the task by manual review. Therefore, how to efficiently judge the similarity between a mini-program or application and other mini-programs or applications has become a hot topic in today's research. Summary of the invention

[0004] The embodiments of the present invention provide a data processing method, a data display method, a server, a terminal and a storage medium, which can accurately determine the similarity between two application programs.

[0005] On the one hand, an embodiment of the present invention provides a data processing method, including:

[0006] Obtaining a first characteristic matrix corresponding to a first application and a second characteristic matrix corresponding to a second application, wherein the first characteristic matrix is ​​obtained based on code data corresponding to the first application, and the second characteristic matrix corresponding to the second application is obtained based on code data corresponding to the second application;

[0007] Performing a similarity operation on the first feature matrix and the second feature matrix to obtain a similarity between the first feature matrix and the second feature matrix;

[0008] Based on the similarity between the first feature matrix and the second feature matrix, the similarity between the first application and the second application is output.

[0009] In one aspect, an embodiment of the present invention provides a data display method, comprising:

[0010] Acquire a similarity between a first application and a second application, where the similarity between the first application and the second application is determined by a server performing a similarity calculation based on a first feature matrix corresponding to the first application and a second feature matrix corresponding to the second application;

[0011] Displaying a similarity detection result interface, and displaying the similarity between the first application and the second application on the similarity detection result interface;

[0012] Among them, the first feature matrix is ​​obtained based on the code data corresponding to the first application, and the second feature matrix corresponding to the second application is obtained based on the code data corresponding to the second application. The first feature matrix is ​​used to reflect the key structural information in the code data corresponding to the first application, and the second feature matrix is ​​used to reflect the key structural information in the code data corresponding to the second application.

[0013] In one aspect, an embodiment of the present invention provides a data processing device, comprising:

[0014] An acquisition unit, configured to acquire a first characteristic matrix corresponding to a first application and a second characteristic matrix corresponding to a second application, wherein the first characteristic matrix is ​​obtained based on code data corresponding to the first application; and the second characteristic matrix corresponding to the second application is obtained based on code data corresponding to the second application;

[0015] a processing unit, configured to perform a similarity operation on the first feature matrix and the second feature matrix to obtain a similarity between the first feature matrix and the second feature matrix;

[0016] An output unit is used to output the similarity between the first application and the second application based on the similarity between the first feature matrix and the second feature matrix.

[0017] In one aspect, an embodiment of the present invention provides a data display device, including:

[0018] an acquisition unit, configured to acquire a similarity between a first application and a second application, wherein the similarity between the first application and the second application is determined by a server performing a similarity operation based on a first feature matrix corresponding to the first application and a second feature matrix corresponding to the second application;

[0019] A display unit, configured to display a similarity detection result interface, and display the similarity between the first application and the second application on the similarity detection result interface;

[0020] Among them, the first feature matrix is ​​obtained based on the code data corresponding to the first application, and the second feature matrix corresponding to the second application is obtained based on the code data corresponding to the second application. The first feature matrix is ​​used to reflect the key structural information in the code data corresponding to the first application, and the second feature matrix is ​​used to reflect the key structural information in the code data corresponding to the second application.

[0021] In one aspect, an embodiment of the present invention provides a server, including:

[0022] a processor adapted to implement one or more instructions, and

[0023] A computer storage medium storing one or more instructions, wherein the first one or more instructions are suitable for being loaded and executed by the processor:

[0024] Obtain a first feature matrix corresponding to a first application and a second feature matrix corresponding to a second application, wherein the first feature matrix is ​​obtained based on code data corresponding to the first application, and the second feature matrix corresponding to the second application is obtained based on code data corresponding to the second application; perform a similarity operation on the first feature matrix and the second feature matrix to obtain the similarity between the first feature matrix and the second feature matrix; and output the similarity between the first application and the second application based on the similarity between the first feature matrix and the second feature matrix.

[0025] On the one hand, an embodiment of the present invention provides a terminal, including:

[0026] a processor adapted to implement one or more instructions; and,

[0027] A computer storage medium storing one or more instructions, wherein the one or more instructions are suitable for being loaded by the processor and performing the following steps:

[0028] Obtaining a similarity between a first application and a second application, where the similarity between the first application and the second application is determined by a server performing a similarity calculation based on a first feature matrix corresponding to the first application and a second feature matrix corresponding to the second application; displaying a similarity detection result interface, and displaying the similarity between the first application and the second application on the similarity detection result interface;

[0029] Among them, the first feature matrix is ​​obtained based on the code data corresponding to the first application, and the second feature matrix corresponding to the second application is obtained based on the code data corresponding to the second application. The first feature matrix is ​​used to reflect the key structural information in the code data corresponding to the first application, and the second feature matrix is ​​used to reflect the key structural information in the code data corresponding to the second application.

[0030] On the one hand, an embodiment of the present invention provides a computer storage medium, characterized in that the computer storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, they are used to execute:

[0031] Obtain a first feature matrix corresponding to a first application and a second feature matrix corresponding to a second application, wherein the first feature matrix is ​​obtained based on code data corresponding to the first application, and the second feature matrix corresponding to the second application is obtained based on code data corresponding to the second application; perform a similarity operation on the first feature matrix and the second feature matrix to obtain the similarity between the first feature matrix and the second feature matrix; and output the similarity between the first application and the second application based on the similarity between the first feature matrix and the second feature matrix.

[0032] Alternatively, when the computer program instructions are executed by the processor, they are also used to execute:

[0033] Obtaining a similarity between a first application and a second application, where the similarity between the first application and the second application is determined by a server performing a similarity calculation based on a first feature matrix corresponding to the first application and a second feature matrix corresponding to the second application; displaying a similarity detection result interface, and displaying the similarity between the first application and the second application on the similarity detection result interface;

[0034] Among them, the first feature matrix is ​​obtained based on the code data corresponding to the first application, and the second feature matrix corresponding to the second application is obtained based on the code data corresponding to the second application. The first feature matrix is ​​used to reflect the key structural information in the code data corresponding to the first application, and the second feature matrix is ​​used to reflect the key structural information in the code data corresponding to the second application.

[0035] In one aspect, an embodiment of the present invention provides a computer program product or a computer program, wherein the computer program product or the computer program includes computer instructions, wherein the computer instructions are stored in a computer-readable storage medium; a processor of a server reads the computer instructions from the computer storage medium, and the processor executes:

[0036] Obtain a first feature matrix corresponding to a first application and a second feature matrix corresponding to a second application, wherein the first feature matrix is ​​obtained based on code data corresponding to the first application, and the second feature matrix corresponding to the second application is obtained based on code data corresponding to the second application; perform a similarity operation on the first feature matrix and the second feature matrix to obtain the similarity between the first feature matrix and the second feature matrix; and output the similarity between the first application and the second application based on the similarity between the first feature matrix and the second feature matrix.

[0037] The processor of the terminal reads the computer instructions from the computer storage medium, and the processor executes the computer instructions to perform:

[0038] Obtaining a similarity between a first application and a second application, where the similarity between the first application and the second application is determined by a server performing a similarity calculation based on a first feature matrix corresponding to the first application and a second feature matrix corresponding to the second application; displaying a similarity detection result interface, and displaying the similarity between the first application and the second application on the similarity detection result interface;

[0039] Among them, the first feature matrix is ​​obtained based on the code data corresponding to the first application, and the second feature matrix corresponding to the second application is obtained based on the code data corresponding to the second application. The first feature matrix is ​​used to reflect the key structural information in the code data corresponding to the first application, and the second feature matrix is ​​used to reflect the key structural information in the code data corresponding to the second application.

[0040] In an embodiment of the present invention, the server determines the similarity between the first application and the second application based on the similarity between the first feature matrix corresponding to the first application and the second feature matrix corresponding to the second application. The first feature matrix is ​​obtained based on the code data corresponding to the first application, and the first feature matrix is ​​used to reflect the key structural information in the code data corresponding to the first application. The second feature matrix is ​​obtained based on the code data corresponding to the second application, and the second feature matrix is ​​used to reflect the key structural information in the code data corresponding to the second application. In other words, comparing the similarity between the first feature matrix and the second feature matrix is ​​equivalent to comparing the key structural information in the code data of the first application with the key structural information in the code data of the second application. If the key structural information of the two is highly similar, it indicates that the code data of the two are highly similar, which also indicates that the similarity between the two applications is highly similar, and vice versa.

[0041] When determining the similarity between the first application and the second application as described above, the structural information in the code data between the two is taken into account, which can overcome the situation where similarity detection is misjudged due to code confusion, thereby improving the accuracy of similarity detection; in addition, the embodiment of the present invention extracts key structural information in the code data and does not compare all the code data one by one, which saves computing time and can improve the efficiency of similarity detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for the implementation description are briefly introduced below. Obviously, the accompanying drawings in the following description are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0043] Figure 1 It is a structural diagram of a similarity detection video management system provided by an embodiment of the present invention;

[0044] Figure 2 It is a flowchart of an interactive data processing method provided by an embodiment of the present invention;

[0045] Figure 3 is a schematic diagram of an abstract syntax tree provided by an embodiment of the present invention;

[0046] FIG4a is a schematic diagram of an initial feature matrix provided by an embodiment of the present invention;

[0047] Figure 4b is a flow chart of similarity detection provided by an embodiment of the present invention;

[0048] Figure 5It is a flow chart of a data display method provided by an embodiment of the present invention;

[0049] Figure 6a is a schematic diagram of an interface for displaying similarity detection results provided by an embodiment of the present invention;

[0050] Figure 6b is a schematic diagram of displaying similarity on a similarity detection result interface provided by an embodiment of the present invention;

[0051] Figure 6c is a schematic diagram of displaying similarity on a similarity detection result interface provided by an embodiment of the present invention;

[0052] Figure 6d is a schematic diagram of displaying a program startup code of a second application program provided by an embodiment of the present invention;

[0053] Figure 6e is a schematic diagram showing a running interface of a second application program provided by an embodiment of the present invention;

[0054] Figure 6f is a schematic diagram of adding other similar applications provided by an embodiment of the present invention;

[0055] Figure 7 is a structural schematic diagram of a data processing device provided by an embodiment of the present invention;

[0056] Figure 8 It is a structural schematic diagram of a data display device provided by an embodiment of the present invention;

[0057] Fig. 9 It is a structural diagram of a server provided by an embodiment of the present invention;

[0058] Fig.10 It is a schematic diagram of the structure of a terminal provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0059] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.

[0060] The embodiment of the present invention provides a data processing scheme and a data display scheme. In a specific implementation, a server obtains a first feature matrix corresponding to a first application and a second feature matrix corresponding to a second application. The first feature matrix is ​​obtained based on the code data corresponding to the first application and is used to reflect the key structural information in the code data corresponding to the first application; similarly, the second feature matrix is ​​obtained based on the code data corresponding to the second application and is used to reflect the key structural information in the code data corresponding to the second application. Further, the similarity between the first feature matrix and the second feature matrix is ​​calculated, and then the similarity between the first application and the second application is determined according to the similarity between the first feature matrix and the second feature matrix. Since the first matrix and the second feature matrix respectively reflect the key structural information in the code data of the first application and the structural information in the code data of the second application, and since the key structural information of an application is the main structure for realizing the function of the corresponding application, the similarity of the two applications is determined by comparing the similarity of the main structures in the two applications, which can improve the accuracy and efficiency of similarity detection. After obtaining the similarity between the first application and the second application, the server can send it to the terminal, and the terminal displays the similarity between the first application and the second application in the interface.

[0061] Based on the above data processing scheme and data display scheme, the embodiment of the present invention provides a similarity detection system, please refer to Figure 1 , is a structural diagram of a similarity detection system provided in an embodiment of the present invention. Figure 1 The similarity detection system shown can accurately and efficiently detect the similarity between the first application and the second application.

[0062] In one embodiment, Figure 1 The similarity detection system shown may include a terminal 101 and a server 102. The terminal 101 may include a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, a smart car, a smart TV, and other devices; the server 102 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, and big data and artificial intelligence platforms.

[0063] In one embodiment, a user may input a similarity detection operation for performing similarity detection on a first application and a second application through terminal 101; after receiving the similarity detection operation input by the user, terminal 101 may send a similarity detection request to the server, and carry identification information of the first application and identification information of the second application in the similarity detection request, and the identification information may be represented as AppID; server 102 obtains a first feature matrix corresponding to the first application and a second feature matrix corresponding to the second application according to the similarity detection request sent by terminal 101; further, a similarity operation is performed on the first feature matrix and the second feature matrix to obtain the similarity between the first feature matrix and the second feature matrix, so that the similarity between the first application and the second application may be determined based on the similarity between the first feature matrix and the second feature matrix.

[0064] In one embodiment, after server 102 determines the similarity between the first application and the second application, it notifies terminal 101 to display the similarity between the first application and the second application in the similarity detection result interface. The user can understand the similarity between the first application and the second application through the similarity detection result interface of terminal 101.

[0065] In one embodiment, the first feature matrix is ​​obtained based on the code data corresponding to the first application, and the first feature matrix is ​​used to reflect the key structural information in the code data of the first application. The second feature matrix is ​​obtained based on the code data corresponding to the second application, and the second feature matrix is ​​used to reflect the key structural information in the code data of the second application. The key structural information refers to the main code structure that realizes the function of the corresponding application. Figure 1 In the similarity detection system shown, the server 102 takes into account the structural information in the code data between the first feature matrix and the second feature matrix when determining the similarity between the two, which can overcome the situation where the similarity detection is misjudged due to code confusion, thereby improving the accuracy of the similarity detection; in addition, when performing similarity comparison, the embodiment of the present invention extracts key structural information from the code data, and does not compare all code structures one by one, which saves computing time and can improve the efficiency of similarity detection.

[0066] Based on the above similarity detection system, an embodiment of the present invention provides a data processing method. Figure 2 , which is a flow chart of a data processing method provided in an embodiment of the present invention. Figure 2 The data processing method shown can be executed by a server, specifically by a processor of the server. Figure 2 The data processing method may include the following steps:

[0067] Step S201: Obtain a first characteristic matrix corresponding to a first application and a second characteristic matrix corresponding to a second application.

[0068] In one embodiment, the first feature matrix is ​​used to reflect the key structural information in the code data corresponding to the first application, and the second feature matrix is ​​used to reflect the key structural information in the code data corresponding to the second application. It can be seen that the first feature matrix is ​​obtained based on the code data corresponding to the first application, and the second feature matrix is ​​obtained based on the code data corresponding to the second application.

[0069] Optionally, the method of obtaining the first feature matrix based on the code data corresponding to the first application and the method of obtaining the second feature matrix based on the code data corresponding to the second application are the same. The following takes the first feature matrix as an example to introduce how to obtain the first feature matrix based on the code data corresponding to the first application. In the specific implementation:

[0070] Obtain code data corresponding to the first application; compile the code data corresponding to the first application into an abstract syntax tree, the abstract syntax tree representing the syntax structure of the code data in a tree form, the abstract syntax tree including multiple levels, each level including multiple nodes; traverse the abstract syntax tree to determine the node type to which each node in multiple nodes of each level in the multiple levels belongs; generate a feature vector corresponding to the corresponding level according to the node type to which each node in multiple nodes of each level belongs; combine the feature vectors corresponding to each level in a preset order to obtain a first feature matrix corresponding to the first application.

[0071] Among them, the abstract syntax tree, also called AST (Abstract Syntax Tree), is an abstract representation of the grammatical structure of the source code. In other words, the abstract syntax tree represents the grammatical structure of the programming language in a tree form, and each node on the tree represents a structure of the source code.

[0072] Optionally, the implementation method of compiling the code data corresponding to the first application into an abstract syntax tree may be: the code data corresponding to the first application is encoded by a compiler to obtain an abstract syntax tree corresponding to the code data of the first application. The compiler is a computer program that converts source code written in a certain programming language into another programming language, and the compiler may include any one or more of @babel / parser, acorn, etc. In the embodiment of the present invention, the source code refers to the code data corresponding to the first application, which may be JavaScript code, and the other programming language may refer to an abstract syntax tree.

[0073] For example, the code data corresponding to the first application is:

[0074] function log (s) {

[0075] console.log(s);

[0076] }

[0077] log('Hello world');

[0078] The code data corresponding to the first application is converted by the encoder to obtain an abstract syntax tree such as Figure 3 As shown, Figure 3 The abstract syntax tree shown is a tree structure, which may include level A and level B. Level A and level B each include multiple nodes, for example, 301 and 302 are two nodes included in level A, and 303 and 304 are two nodes included in level B.

[0079] From the above, it can be seen that after obtaining the abstract syntax tree corresponding to the first application, the abstract syntax tree is traversed to determine the node type to which each node in the multiple nodes of each level in the multiple levels belongs. The node type may include characters, function definitions, function calls, variable definitions, variable calls, etc.

[0080] In the specific implementation, the abstract syntax tree is traversed in the form of breadth-first traversal. According to the estree specification in the JavaScript standard, the type of each node at each level in the abstract syntax tree is counted. Among them, estree is an unofficial syntax expression standard in the JavaScript community. Estree is a json-style AST. The popular bable and eslint implementations are also based on estree. Estree is a relatively simple static syntax description. In addition to being very useful in source code analysis and conversion, it can also be used for language learning. Use estree as a quick index of specifications. If you encounter any doubts, you can quickly locate the official description of the specification through this index. The specification contains static and dynamic descriptions of the syntax.

[0081] Optionally, after determining the node type to which each node in each level in the abstract syntax tree belongs, the server generates a feature vector corresponding to the corresponding level according to the node type to which each node in multiple nodes in each level belongs.

[0082] In a specific implementation, the feature vector corresponding to the corresponding level is generated according to the node type to which each node in the multiple nodes of each level belongs, including: obtaining multiple preset node types; generating an initial feature vector according to the multiple preset node types, the dimension of the initial feature vector is equal to the number of the multiple preset node types, and each element position of the initial feature vector corresponds to a preset node type; determining the number of nodes belonging to each preset node type in the multiple nodes of the corresponding level according to the node type to which each node in each level belongs; writing the number of nodes belonging to any preset node type as an element value into the element position corresponding to any preset node type in the initial feature vector, to obtain the feature vector corresponding to any level.

[0083] The above-mentioned multiple preset node types can be selected and sorted from the node types provided by estree. For example, 9 node types selected and sorted from the node types provided by estree are used as multiple preset node types. These multiple preset node types can be node types that appear frequently and are used frequently in a piece of code. Optionally, the multiple preset node types can include any one or more of Literal, VariableDefinition, VariableCalled, FunctionDefinition, AssignmentExpression, FunctionCalled, Subscripting, ForLoops, and Conditions.

[0084] After obtaining multiple preset node types, the server further generates an initial feature vector based on the multiple preset node types. The initial feature vector can be a row vector whose dimension is equal to the number of multiple preset node types. Each element position in the initial feature vector corresponds to a preset node type. The element value at each element position in the initial feature vector can be empty, or can be other initial values, such as 0.

[0085] For example, assuming that the number of the multiple preset node types obtained is 9, namely character, variable definition, variable call, function definition, assignment expression, function call, subscript, loop, and condition, the initial feature vector generated according to the multiple preset node types can be as follows Figure 4a As shown, assuming that the element value at each element position in the initial feature vector is empty, the order of each element position in the feature vector from left to back corresponds to the above multiple preset types one by one, for example, the first element position corresponds to the preset node type character, the second element position corresponds to the preset node type variable definition, and so on. Figure 4aThe initial feature vector shown. It should be understood that the above example only lists a correspondence between an element position and a preset type. In actual applications, the first element position can correspond to any one of the other preset types except characters. Similarly, other element positions can also correspond to preset types that have not been matched among multiple preset types. The specific correspondence between element positions and preset types is not limited in the embodiments of the present invention.

[0086] Further, the server determines the number of nodes belonging to each preset node type among the multiple nodes of the corresponding level according to the node type of each node in each level. For example, the server determines Figure 3 In the layer A, there is a node of Subscripting in part 3A, a node of FunctionDefinition in part 301, three nodes of VariableCalled in part 3B, and a node of FunctionCalled in part 302. For node types other than the above-mentioned node types among the multiple preset node types, the layer A does not include nodes of other node types.

[0087] Therefore, the number of nodes belonging to each preset node type among the multiple nodes included in level A are: character Literal—0, variable definition VariableDefinition—0, variable call VariableCalled—3, function definition FunctionDefinition—1, assignment expression AssignmentExpression—0, function call FunctionCalled—0, subscript Subscripting—1, loop ForLoops—0, condition Conditions—0.

[0088] For example, the server determines Figure 3In the included level B, there is a node of variable call VariableCalled in part 3C, a node of function call FunctionCalled in part 304, and a node of character Literal in part 303. Therefore, the number of nodes of each preset node type in the multiple nodes included in level B is respectively: character Literal—1, variable definition VariableDefinition—0, variable call VariableCalled—1, function definition FunctionDefinition—0, assignment expression AssignmentExpression—0, function call FunctionCalled—1, subscript Subscripting—0, loop ForLoops—0, condition Conditions—0.

[0089] Fill in the number of nodes of each preset node type in level A into Figure 4a At the corresponding position of the initial feature vector shown in FIG, the feature vector corresponding to level A is obtained, which is expressed as [0 0 3 1 0 1 1 0 0]; and the number of nodes belonging to each preset node type in level B is filled into Figure 4a At the corresponding position of the initial feature vector shown, the feature vector corresponding to level B is obtained, expressed as [1 0 1 0 0 1 0 0 0].

[0090] As can be seen from the above, the feature vector corresponding to level A and the feature vector corresponding to level B are combined in a preset order to obtain the first feature matrix corresponding to the first application. The preset order can be the order from large to small levels or the order from small to large levels. The feature vector corresponding to level A and the feature vector corresponding to level B are combined in the order from small to large levels to obtain the first feature matrix, which can be expressed as: [1 0 1 0 0 1 0 0 0 00 3 1 0 1 1 0 0].

[0091] In one embodiment, the server may determine the second feature matrix corresponding to the second application based on the above-mentioned method for determining the first feature matrix. The number of the second application may be at least one. In order to improve the efficiency of similarity detection, the server may determine the second feature matrix corresponding to each second application before obtaining the first application, and store it in a database; when similarity detection is required for the first application, the second feature matrices corresponding to multiple second applications are directly obtained from the database.

[0092] Step S202: Perform a similarity operation on the first feature matrix and the second feature matrix to obtain the similarity between the first feature matrix and the second feature matrix.

[0093] In one embodiment, the server may determine the similarity between the first feature matrix and the second feature matrix based on the cosine angle between the first feature matrix and the second feature matrix. In a specific implementation, the first feature matrix and the second feature matrix are input into the cosine similarity calculation rule for operation to obtain the angle between the first feature matrix and the second feature matrix; the similarity between the first feature matrix and the second feature matrix is ​​determined based on the angle between the first feature matrix and the second feature matrix; wherein, the smaller the angle between the first feature matrix and the second feature matrix, the greater the similarity between the first feature matrix and the second feature matrix; the larger the angle between the first feature matrix and the second feature matrix, the smaller the similarity between the first feature matrix and the second feature matrix.

[0094] The first feature matrix and the second feature matrix are input into the cosine similarity calculation rule for operation, and the angle between the first feature matrix and the second feature matrix can be expressed by the following formula (1):

[0095] (1)

[0096] in, represents similarity, cos represents cosine function, A represents the first characteristic matrix, B represents the second characteristic matrix, i represents the i-th column, n represents the number of columns of the first characteristic matrix, and also represents the number of columns of the second characteristic matrix.

[0097] The similarity between the first characteristic matrix and the second characteristic matrix is ​​determined based on the angle between the first characteristic matrix and the second characteristic matrix obtained by formula (1). If the angle is larger, it means that the direction difference is larger and the similarity is lower; conversely, if the angle is smaller, it means that the direction difference is smaller and the similarity is higher.

[0098] Optionally, determining the similarity between the first characteristic matrix and the second characteristic matrix based on the angle between the first characteristic matrix and the second characteristic matrix may include: presetting a correspondence between the angle and the similarity, for example, angle A corresponds to similarity A, and the similarity decreases by B for every increase in the angle by B; or, angle A corresponds to similarity A, and angle C corresponds to similarity C; and determining the similarity between the first characteristic matrix and the second characteristic matrix according to the correspondence between the angle and the similarity and the angle between the first characteristic matrix and the second characteristic matrix.

[0099] Step S203: output the similarity between the first application and the second application based on the similarity between the first feature matrix and the second feature matrix.

[0100] In one embodiment, after obtaining the similarity between the first feature matrix and the second feature matrix according to step S201 and step S202, the similarity between the first application and the second application is further determined according to the similarity between the first feature matrix and the second feature matrix.

[0101] Optionally, based on the similarity between the first feature matrix and the second feature matrix, the similarity between the first application and the second application is output, including: determining the similarity between the first application and the second application based on the similarity between the first feature matrix and the second feature matrix; sending the similarity between the first application and the second application to the terminal so that the terminal displays the similarity between the first application and the second application.

[0102] As an optional implementation, determining the similarity between the first application and the second application based on the similarity between the first feature matrix and the second feature matrix may include: using the similarity between the first feature matrix and the second feature matrix as the similarity between the first application and the second application.

[0103] As another optional implementation, the determining the similarity between the first application and the second application based on the similarity between the first feature matrix and the second feature matrix may also include: determining the weight of the key structural information represented by the first feature matrix in the code data of the first application, and the weight of the key structural information represented by the second feature matrix in the code data of the second application; and performing operations based on the first feature matrix, the second feature matrix and their respective weights to obtain the similarity between the first application and the second application.

[0104] In one embodiment, after the server determines the first feature matrix of the first application, it can be stored in a database to facilitate subsequent similarity comparison between the first application and other applications. Figure 2 The process of the data processing method shown in the embodiment can be as follows Figure 4b As shown, it can mainly include converting code data into an abstract syntax tree, traversing the abstract syntax tree to generate a first feature matrix, storing the first feature matrix into a database; then obtaining a second feature matrix of a second application from the database; performing similarity detection based on the first feature matrix and the second feature matrix, and finally outputting the detection result.

[0105] In one embodiment, the first application includes a subprogram running in a first client, and the second application includes a subprogram running in a second client; the first client and the second client are the same client; or, the first client and the second client are different clients.

[0106] In practice, testing is performed using the example that both the first application and the second application are mini-programs. For mini-programs, which have a large amount of code, the present invention has a strong anti-obfuscation capability. By performing operations such as replacing variables, changing operators, and modifying code word order in the code of the mini-program, it will hardly cause much interference to the similarity detection results.

[0107] Through data statistics deployed on the existing network, any full-scale code similarity detection can be controlled within about 35 seconds as shown in Table 1 below.

[0108] Table 1

[0109]

[0110] In an embodiment of the present invention, the server determines the similarity between the first application and the second application based on the similarity between the first feature matrix corresponding to the first application and the second feature matrix corresponding to the second application. The first feature matrix is ​​obtained based on the code data corresponding to the first application, and the first feature matrix is ​​used to reflect the key structural information in the code data corresponding to the first application. The second feature matrix is ​​obtained based on the code data corresponding to the second application, and the second feature matrix is ​​used to reflect the key structural information in the code data corresponding to the second application. In other words, comparing the similarity between the first feature matrix and the second feature matrix is ​​equivalent to comparing the key structural information in the code data of the first application with the key structural information in the code data of the second application. If the key structural information of the two is highly similar, it indicates that the code data of the two are highly similar, which also indicates that the similarity between the two applications is highly similar, and vice versa.

[0111] When determining the similarity between the first application and the second application as described above, the structural information in the code data between the two is taken into account, which can overcome the situation where similarity detection is misjudged due to code confusion, thereby improving the accuracy of similarity detection; in addition, the embodiment of the present invention extracts key structural information in the code data and does not compare all the code data one by one, which saves computing time and can improve the efficiency of similarity detection.

[0112] Based on the above data processing method, an embodiment of the present invention provides a data display method. Figure 5 , which is a flow chart of a data display method provided in an embodiment of the present invention. Figure 5 The data display method shown can be executed by a terminal, and specifically can be executed by a processor of the terminal. Figure 5 The data display method shown may include the following steps:

[0113] Step S501: Receive the similarity between the first application and the second application sent by the server.

[0114] In one embodiment, the first application may refer to a subprogram running in a first client, such as a mini-program running in an instant messaging application, a social application, a shopping application, or a payment application. The second application may refer to a subprogram running in a second client. The first client and the second client may be the same or different.

[0115] In one embodiment, the similarity between the first application and the second application can be determined by the server based on the similarity between a first feature matrix corresponding to the first application and a second feature matrix corresponding to the second application after receiving a similarity detection request sent by the terminal.

[0116] Optionally, the similarity detection request may be generated after the terminal detects a similarity detection operation, for example, the terminal displays a similarity detection interface to the review user such as Figure 6a As shown, the similarity detection interface may include an identifier 601 of a first application and an identifier 602 of at least one second application, as well as a similarity detection control 603, which may be expressed as "start detection". When the reviewing user triggers the similarity detection control 603, the terminal detects the similarity detection operation, then generates a similarity detection request and sends the similarity detection request to the server.

[0117] After receiving the similarity detection request sent by the terminal, the server determines to perform similarity detection between the first application and the second application based on the similarity between the first feature matrix corresponding to the first application and the second feature matrix corresponding to the second application.

[0118] In one embodiment, the first feature matrix is ​​determined based on the code data corresponding to the first application. In a specific implementation, the server can convert the code data corresponding to the first application into an abstract syntax tree through a compiler; then traverse the abstract syntax tree in the form of breadth-first traversal, and determine the node type to which each node in each level of the abstract syntax tree belongs according to the estree specification in the JavaScript standard. Then, obtain multiple preset node types, and determine the feature vectors corresponding to the corresponding levels by counting the number of nodes belonging to each preset node type in each level; finally, combine the feature vectors corresponding to each level in a certain order to obtain the first feature matrix corresponding to the first application. Similarly, the second feature matrix corresponding to the second application can be obtained using the same method as above.

[0119] In one embodiment, after the server obtains the first feature matrix corresponding to the first application and the second feature matrix corresponding to the second application, the similarity between the first feature matrix and the second feature matrix can be determined by the angle between the first feature matrix and the second feature matrix; further, the similarity between the first application and the second application can be determined based on the similarity between the first feature matrix and the second feature matrix.

[0120] In the prior art, the method of performing similarity detection between two applications may include detection based on code fingerprints. Code fingerprints are generally statistical information about code data, such as the number of code lines, the number of conditions, the number of loops, the number of variables, etc. If the code fingerprints of two pieces of code data have a high similarity, then it is considered that the two pieces of code data have a high similarity, thereby determining that the applications corresponding to the two pieces of code data have a high similarity. However, since this method ignores the structural information of the code data and has a single detection dimension, if the code data of the first application is obfuscated, such as modifying the order of the code, deleting operators, etc., it will have a greater impact on the detection result. Alternatively, when the feature counts extracted from two dissimilar pieces of code data are close, the result of the similarity detection may be that the applications corresponding to the two dissimilar code data have a high similarity.

[0121] In addition, when performing similarity comparison based on the abstract syntax tree, the entire abstract syntax tree can be traversed to determine the similarity between two copies of code data. However, this operation results in high time complexity, low running speed, and consumes more server resources. It is not suitable for scenarios where one copy of code data is compared with tens of thousands of copies of code data one by one.

[0122] Compared with the above two similarity detection methods, the server in the embodiment of the present invention performs similarity detection based on the feature matrices corresponding to the two applications. Since the key structural information in the code data is taken into consideration, the accuracy of the similarity detection is improved while saving running time.

[0123] After obtaining the similarity between the first application and the second application, the server may return the similarity between the first application and the second application to the terminal, so that the terminal displays the similarity between the first application and the second application to the review user.

[0124] Step S502: displaying a similarity detection result interface, and displaying the similarity between the first application and the second application on the similarity detection result interface.

[0125] In one embodiment, after the terminal receives the similarity between the first application and the second application sent by the server, the terminal can display the similarity between the first application and the second application in the similarity detection result interface. In a specific implementation, the similarity detection result interface may include an application identification list item and a similarity list item, and the display of the similarity between the first application and the second application in the similarity detection result interface includes: displaying the application identification of the second application at the first position of the application identification list item; and displaying the similarity between the second application and the first application at a position corresponding to the first position in the similarity list item.

[0126] That is, the similarity between the first application and the second application is displayed in the form of a list in the similarity detection result interface. Figure 6b , is a schematic diagram of displaying similarity in a similarity detection result interface provided by an embodiment of the present invention, where 600 represents the similarity detection result interface, 601 represents an application identification list item, which is expressed as AppID, and 602 represents a similarity list item, which is expressed as code similarity. The terminal displays the application identification of the second application at the first position 601A of 601, and displays the similarity between the first application and the second application at a position 602A corresponding to the first position 601A in the similarity list item 602.

[0127] Optionally, if there are multiple second applications, the similarities between the first application and each second application can be displayed in the similarity detection result interface in the order of the similarity between each second application and the first application from large to small, or from small to large. For example, assuming that there are two second applications, see Figure 6c, which is another schematic diagram of displaying similarity in a similarity detection result interface provided by an embodiment of the present invention. It can be seen that the application identifiers of the two second applications are respectively displayed at the first position 601A and the second position 603A of the application identifier list item, and the similarity between each of the two second applications and the first application is respectively displayed at the position 61A corresponding to the first position and the position 62A corresponding to the second position in the similarity list item.

[0128] In one embodiment, the similarity detection result interface may also include a program startup list item, and the program startup code corresponding to the second application is displayed at a position corresponding to the first position in the program startup code list item; when the program startup code is scanned, the second application is run in the terminal that scans the program startup code, so that the user using the terminal can review the similarity between the first application and the second application through the running interface of the second application and the running interface of the first application. The program startup code may be a QR code, a bar code, or other identification code that uniquely identifies the second application.

[0129] As an optional implementation, the program startup code is displayed at the position corresponding to the first position in the program startup code list item when the trigger control displayed at the position corresponding to the first position in the program startup code list is triggered. Figure 6b In the program startup code list item in the similarity detection result interface, a trigger control 6B is displayed at the position corresponding to the first position in 6A, which can be expressed as "preview"; when 6B is triggered, the program startup code corresponding to the second application is displayed, such as Figure 6d As shown in Figure 661.

[0130] Optionally, when the program launch code is scanned, before the second application is run in the terminal scanning the program launch code, a prompt message of whether to run and authorization may be output, and after receiving the user's confirmation operation on the prompt message, the second application is started to run and the running interface of the second application is displayed. Figure 6d In step 661, a prompt message may be outputted in the terminal of user A, such as "XX application requires authorization login to run, are you sure to run it?"; user A may input a confirmation operation for the prompt message in the terminal, such as the prompt message also includes a confirmation button and a cancel button. When user A clicks the confirmation button, it indicates that user A has input a confirmation operation for the above prompt message. At this time, the terminal of user A may display the running interface of the second application program such as Figure 6e As shown in Figure 663.

[0131] In one embodiment, the user first displays the running interface of the second application and the running interface of the first application. Figure 6e As shown in 660, the similarity between the two applications is compared. Optionally, the similarity detection result interface may also include a review list item such as whether the similarity is accurately determined. Figure 6b As shown in 6C and the evaluation list items are as follows Figure 6b 6D. An accuracy setting control may be displayed at a position corresponding to the first position in the audit list item. When the accuracy setting control is turned on, it indicates that the similarity between the second application and the first application determined by the server is accurate; when the accuracy setting control is turned off, it indicates that the similarity between the second application and the first application determined by the server is inaccurate.

[0132] Furthermore, if user A determines that the similarity between the first application and the second application displayed in the similarity detection result interface is accurate after comparing the two application running interfaces, the accuracy setting control in the review list item can be set to an on state. In addition, user A can also enter evaluation content of the similarity detection result in the evaluation list item, such as the detection is quite accurate and the detection is very helpful.

[0133] In one embodiment, the similarity detection structure interface also includes an operation control for supplementing an application that is similar to the first application; when the operation control is triggered, an add window is displayed, the add window including an application identifier input area and a confirmation control; when a target application identifier exists in the application identifier input area and the confirmation control is triggered, the similarity detection result interface displays the similarity between the application indicated by the target application identifier and the first application.

[0134] For example, suppose in Figure 6b In the similarity detection result interface 601 shown, 11 represents an operation control for supplementing an application similar to the first application, which is expressed as "adding a missing similar applet". When user A clicks the operation control 11, an adding window is displayed, such as Figure 6f As shown in 12; the add window 12 includes an application identifier input area 22 and a confirmation control 33; when the target application identifier is entered in 22 and the confirmation control 33 is clicked, the application indicated by the target application identifier, assuming that it is the target application, and the similarity between it and the first application are displayed in the similarity detection result interface. For specific information on how to display the similarity between the first application and the target application in the similarity detection result interface, please refer to the above-described implementation method of displaying the similarity between the first application and the second application in the similarity detection result interface, which will not be repeated here.

[0135] In an embodiment of the present invention, the server can determine the similarity between the first application and the second application based on the similarity between the first feature matrix of the first application and the second feature matrix of the second application. The first feature matrix is ​​obtained based on the code data corresponding to the first application, and can be used to reflect the key structural information in the code data of the first application. The second feature matrix is ​​obtained based on the code data corresponding to the second application, and can be used to reflect the key structural information in the code data of the second application. If the key structural information in the code data of the two applications is similar, the similarity between the two applications is relatively large. Therefore, determining the similarity between the two applications based on the key structural information can ensure a high accuracy of similarity detection, and the obfuscation operation of the code data will not affect the detection result; in addition, compared with the prior art of comparing any one code data with other multiple code data one by one, its detection efficiency can be controlled at an extremely high level.

[0136] In addition, the terminal may display the similarity between the first application and the second application in the similarity detection result interface in the form of a list, so as to intuitively understand the similarity between the two applications.

[0137] Based on the above data processing method embodiment, the present invention provides a data processing device. Figure 7 , which is a structural diagram of a data processing device provided in an embodiment of the present invention. Figure 7 The data processing device can run the following units:

[0138] An acquisition unit 701 is used to acquire a first characteristic matrix corresponding to a first application and a second characteristic matrix corresponding to a second application, wherein the first characteristic matrix is ​​obtained based on code data corresponding to the first application, and the second characteristic matrix corresponding to the second application is obtained based on code data corresponding to the second application;

[0139] The processing unit 702 is configured to perform a similarity operation on the first feature matrix and the second feature matrix to obtain a similarity between the first feature matrix and the second feature matrix;

[0140] The output unit 703 is configured to output the similarity between the first application and the second application based on the similarity between the first feature matrix and the second feature matrix.

[0141] In one embodiment, the acquisition unit 701 performs the following steps when acquiring the first feature matrix corresponding to the first application:

[0142] Obtain code data corresponding to the first application; compile the code data corresponding to the first application into an abstract syntax tree, the abstract syntax tree representing the syntax structure of the code data in a tree form, the abstract syntax tree including multiple levels, each level including multiple nodes; traverse the abstract syntax tree to determine the node type to which each node in multiple nodes of each level in the multiple levels belongs; generate a feature vector corresponding to the corresponding level according to the node type to which each node in multiple nodes of each level belongs; combine the feature vectors corresponding to each level in a preset order to obtain a first feature matrix corresponding to the first application.

[0143] In one embodiment, when the acquisition unit 701 generates a feature vector corresponding to a corresponding level according to the node type to which each node in the plurality of nodes at each level belongs, the acquisition unit 701 performs the following steps:

[0144] Acquire multiple preset node types; generate an initial feature vector according to the multiple preset node types, wherein the dimension of the initial feature vector is equal to the number of the multiple preset node types, and each element position of the initial feature vector corresponds to a preset node type; determine the number of nodes belonging to each preset node type in multiple nodes of the corresponding level according to the node type to which each node in each level belongs; write the number of nodes belonging to any preset node type as an element value into the element position corresponding to any preset node type in the initial feature vector, and obtain the feature vector corresponding to each level.

[0145] In one embodiment, when the processing unit 702 performs a similarity operation on the first feature matrix and the second feature matrix to obtain the similarity between the first feature matrix and the second feature matrix, the processing unit 702 performs the following steps:

[0146] The first feature matrix and the second feature matrix are input into the cosine similarity calculation rule for operation to obtain the angle between the first feature matrix and the second feature matrix; the similarity between the first feature matrix and the second feature matrix is ​​determined based on the angle between the first feature matrix and the second feature matrix; wherein, the smaller the angle between the first feature matrix and the second feature matrix, the greater the similarity between the first feature matrix and the second feature matrix; the larger the angle between the first feature matrix and the second feature matrix, the smaller the similarity between the first feature matrix and the second feature matrix.

[0147] In one embodiment, the first application includes a subprogram running in a first client, and the second application includes a subprogram running in a second client; the first client and the second client are the same client; or, the first client and the second client are different clients.

[0148] According to one embodiment of the present invention, Figure 2 The steps involved in the data processing method shown can be Figure 7 The data processing device shown in FIG. 1 is executed by each unit in the data processing device shown in FIG. Figure 2 The step S201 can be performed by Figure 7 The acquisition unit 701 in the data processing device shown in FIG. 1 is executed, and step S202 can be performed by Figure 7 The processing unit 902 in the data processing device shown in FIG. 1 is used to perform step S203. Figure 7 The output unit 903 in the data processing device shown is executed.

[0149] According to another embodiment of the present invention, Figure 7 The various units in the data processing device shown can be combined into one or several other units separately or in whole, or one (some) of the units can be further divided into multiple smaller units in function, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present invention. The above-mentioned units are divided based on logical functions. In practical applications, the function of one unit can also be realized by multiple units, or the functions of multiple units can be realized by one unit. In other embodiments of the present invention, other units can also be included based on the data processing device. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented by the collaboration of multiple units.

[0150] According to another embodiment of the present invention, the program can be executed by running a program on a general computing device such as a computer including a central processing unit (CPU), a random access memory medium (RAM), a read-only memory medium (ROM), and other processing elements and storage elements. Figure 2 A computer program (including program code) for each step involved in the corresponding method shown in FIG. Figure 7 The data processing device shown in the embodiment of the present invention is used to implement the data processing method of the embodiment of the present invention. The computer program can be recorded on a computer-readable storage medium, for example, and loaded into the above-mentioned computing device through the computer-readable storage medium and run therein.

[0151] In an embodiment of the present invention, the server determines the similarity between the first application and the second application based on the similarity between the first feature matrix corresponding to the first application and the second feature matrix corresponding to the second application. The first feature matrix is ​​obtained based on the code data corresponding to the first application, and the first feature matrix is ​​used to reflect the key structural information in the code data corresponding to the first application. The second feature matrix is ​​obtained based on the code data corresponding to the second application, and the second feature matrix is ​​used to reflect the key structural information in the code data corresponding to the second application. In other words, comparing the similarity between the first feature matrix and the second feature matrix is ​​equivalent to comparing the key structural information in the code data of the first application with the key structural information in the code data of the second application. If the similarity of the key structural information of the two is high, it indicates that the similarity of the code data of the two is high, which also indicates that the similarity between the two applications is high, and vice versa.

[0152] When determining the similarity between the first application and the second application as described above, the structural information in the code data between the two is taken into account, which can overcome the situation where similarity detection is misjudged due to code confusion, thereby improving the accuracy of similarity detection; in addition, the embodiment of the present invention extracts key structural information in the code data and does not compare all the code data one by one, which saves computing time and can improve the efficiency of similarity detection.

[0153] Based on the above-mentioned data display method embodiment, the present invention provides a data display device. Figure 8 , which is a structural diagram of a data display device provided in an embodiment of the present invention. Figure 8 The data display device shown can run the following units:

[0154] An acquiring unit 801 is used to acquire a similarity between a first application and a second application, where the similarity between the first application and the second application is determined by a server performing a similarity operation based on a first feature matrix corresponding to the first application and a second feature matrix corresponding to the second application;

[0155] A display unit 802 is used to display a similarity detection result interface, and display the similarity between the first application and the second application on the similarity detection result interface;

[0156] Among them, the first feature matrix is ​​obtained based on the code data corresponding to the first application, and the second feature matrix corresponding to the second application is obtained based on the code data corresponding to the second application. The first feature matrix is ​​used to reflect the key structural information in the code data corresponding to the first application, and the second feature matrix is ​​used to reflect the key structural information in the code data corresponding to the second application.

[0157] In one embodiment, the similarity detection result interface includes an application identification list item and a similarity list item. When the display unit 802 displays the similarity between the first application and the second application on the similarity detection result interface, the display unit 802 performs the following steps:

[0158] The application identifier of the second application is displayed at a first position of the application identifier list item; and the similarity between the second application and the first application is displayed at a position corresponding to the first position in the similarity list item.

[0159] In one embodiment, the similarity detection result interface also includes a program startup code list item, and the program startup code corresponding to the second application is displayed at a position corresponding to the first position in the program startup code list item; when the program startup code is scanned, the second application is run in the terminal that scans the program startup code, so that a user using the terminal can review the similarity between the first application and the second application through the running interface of the second application and the running interface of the first application.

[0160] In one embodiment, the similarity detection result interface includes an operation control for supplementing an application that is similar to the first application; the display unit 802 is also used to display an add window when the operation control is triggered, and the add window includes an application identifier input area and a confirmation control; when a target application identifier exists in the application identifier input area and the confirmation control is triggered, the similarity detection result interface displays the similarity between the application indicated by the target application identifier and the first application.

[0161] In one embodiment, the first application includes a subprogram running in a first client, and the second application includes a subprogram running in a second client; the first client and the second client are the same client; or, the first client and the second client are different clients.

[0162] According to one embodiment of the present invention, Figure 5 The data display method shown may involve various steps. Figure 8 The data shown is executed by each unit in the device. For example, Figure 5 The step S501 can be performed by Figure 8 The data display device shown in FIG. 1 is used to obtain the data. The acquisition unit 801 in the data display device shown in FIG. 1 is used to obtain the data. Step S502 can be performed by Figure 8 The display unit 802 in the data display device shown is used for execution.

[0163] According to another embodiment of the present invention, Figure 8 The various units in the data display device shown can be combined into one or several other units separately or in whole, or one (some) of the units can be further divided into multiple functionally smaller units to form the same operation, which does not affect the realization of the technical effects of the embodiments of the present invention. The above-mentioned units are divided based on logical functions. In practical applications, the function of one unit can also be realized by multiple units, or the functions of multiple units can be realized by one unit. In other embodiments of the present invention, other units can also be included based on the data display device. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented by the collaboration of multiple units.

[0164] According to another embodiment of the present invention, the program can be executed by running a program on a general computing device such as a computer including a central processing unit (CPU), a random access memory medium (RAM), a read-only memory medium (ROM), and other processing elements and storage elements. Figure 5 A computer program (including program code) for each step involved in the corresponding method shown in FIG. Figure 8 The data display device shown in the embodiment of the present invention is used to implement the data display method of the embodiment of the present invention. The computer program can be recorded on a computer-readable storage medium, for example, and loaded into the above-mentioned computing device through the computer-readable storage medium and run therein.

[0165] In an embodiment of the present invention, the server can determine the similarity between the first application and the second application based on the similarity between the first feature matrix of the first application and the second feature matrix of the second application. The first feature matrix is ​​obtained based on the code data corresponding to the first application, and can be used to reflect the key structural information in the code data of the first application. The second feature matrix is ​​obtained based on the code data corresponding to the second application, and can be used to reflect the key structural information in the code data of the second application. If the key structural information in the code data of the two applications is similar, the similarity between the two applications is relatively large. Therefore, determining the similarity between the two applications based on the key structural information can ensure a high accuracy of similarity detection, and the obfuscation operation of the code data will not affect the detection result; in addition, compared with the prior art of comparing any one code data with other multiple code data one by one, its detection efficiency can be controlled at an extremely high level.

[0166] In addition, the terminal may display the similarity between the first application and the second application in the similarity detection result interface in the form of a list, so as to intuitively understand the similarity between the two applications.

[0167] Based on the above data processing method and data processing device embodiments, the present invention provides a server. Fig. 9 , is a structural diagram of a server provided in an embodiment of the present invention. Fig. 9 The server may include at least a processor 901, an input interface 902, an output interface 903, and a computer storage medium 904. The processor 901, the input interface 902, the output interface 903, and the computer storage medium 904 may be connected via a bus or other means.

[0168] The computer storage medium 904 may be stored in the memory of the server, the computer storage medium 601 is used to store a computer program, the computer program includes program instructions, and the processor 901 is used to execute the program instructions stored in the computer storage medium 904. The processor 901 (or CPU (Central Processing Unit)) is the computing core and control core of the server, which is suitable for implementing one or more instructions, specifically suitable for loading and executing:

[0169] Obtain a first feature matrix corresponding to a first application and a second feature matrix corresponding to a second application, wherein the first feature matrix is ​​obtained based on code data corresponding to the first application, and the second feature matrix corresponding to the second application is obtained based on code data corresponding to the second application; perform a similarity operation on the first feature matrix and the second feature matrix to obtain the similarity between the first feature matrix and the second feature matrix; and output the similarity between the first application and the second application based on the similarity between the first feature matrix and the second feature matrix.

[0170] In an embodiment of the present invention, the server determines the similarity between the first application and the second application based on the similarity between the first feature matrix corresponding to the first application and the second feature matrix corresponding to the second application. The first feature matrix is ​​obtained based on the code data corresponding to the first application, and the first feature matrix is ​​used to reflect the key structural information in the code data corresponding to the first application. The second feature matrix is ​​obtained based on the code data corresponding to the second application, and the second feature matrix is ​​used to reflect the key structural information in the code data corresponding to the second application. In other words, comparing the similarity between the first feature matrix and the second feature matrix is ​​equivalent to comparing the key structural information in the code data of the first application with the key structural information in the code data of the second application. If the key structural information of the two is highly similar, it indicates that the code data of the two are highly similar, which also indicates that the similarity between the two applications is highly similar, and vice versa.

[0171] When determining the similarity between the first application and the second application as described above, the structural information in the code data between the two is taken into account, which can overcome the situation where similarity detection is misjudged due to code confusion, thereby improving the accuracy of similarity detection; in addition, the embodiment of the present invention extracts key structural information in the code data and does not compare all the code data one by one, which saves computing time and can improve the efficiency of similarity detection.

[0172] Based on the above-mentioned data display method and data display device embodiments, the present invention provides a terminal. Fig.10 , is a structural diagram of a terminal provided in an embodiment of the present invention. Fig.10 The terminal shown may include at least a processor 1001, an input interface 1002, an output interface 1003, and a computer storage medium 1004. The processor 1001, the input interface 1002, the output interface 1003, and the computer storage medium 1004 may be connected via a bus or other means.

[0173] The computer storage medium 1004 may be stored in the memory of the terminal, the computer storage medium 601 is used to store a computer program, the computer program includes program instructions, and the processor 1001 is used to execute the program instructions stored in the computer storage medium 1004. The processor 1001 (or CPU (Central Processing Unit)) is the computing core and control core of the terminal, which is suitable for implementing one or more instructions, specifically suitable for loading and executing:

[0174] Obtaining a similarity between a first application and a second application, where the similarity between the first application and the second application is determined by a server performing a similarity calculation based on a first feature matrix corresponding to the first application and a second feature matrix corresponding to the second application; displaying a similarity detection result interface, and displaying the similarity between the first application and the second application on the similarity detection result interface;

[0175] Among them, the first feature matrix is ​​obtained based on the code data corresponding to the first application, and the second feature matrix corresponding to the second application is obtained based on the code data corresponding to the second application. The first feature matrix is ​​used to reflect the key structural information in the code data corresponding to the first application, and the second feature matrix is ​​used to reflect the key structural information in the code data corresponding to the second application.

[0176] In an embodiment of the present invention, the server can determine the similarity between the first application and the second application based on the similarity between the first feature matrix of the first application and the second feature matrix of the second application. The first feature matrix is ​​obtained based on the code data corresponding to the first application, and can be used to reflect the key structural information in the code data of the first application. The second feature matrix is ​​obtained based on the code data corresponding to the second application, and can be used to reflect the key structural information in the code data of the second application. If the key structural information in the code data of the two applications is similar, the similarity between the two applications is relatively large. Therefore, determining the similarity between the two applications based on the key structural information can ensure a high accuracy of similarity detection, and the obfuscation operation of the code data will not affect the detection result; in addition, compared with the prior art of comparing any one code data with other multiple code data one by one, its detection efficiency can be controlled at an extremely high level.

[0177] In addition, the terminal may display the similarity between the first application and the second application in the similarity detection result interface in the form of a list, so as to intuitively understand the similarity between the two applications.

[0178] The embodiment of the present invention also provides a computer storage medium (Memory), which is a memory device in a terminal or server for storing programs and data. It is understandable that the computer storage medium here can include both built-in storage media in the terminal or server, and of course, can also include extended storage media supported by the terminal or server. The computer storage medium provides a storage space, which stores the operating system of the terminal or server. In addition, one or more instructions suitable for being loaded and executed by the processor 901 or 1001 are also stored in the storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer storage medium here can be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as at least one disk storage; optionally, it can also be at least one computer storage medium located away from the aforementioned processor.

[0179] In one embodiment, the computer storage medium can be loaded by the processor 901 and execute one or more instructions stored in the computer storage medium to implement the above-mentioned Figure 2 In a specific implementation, one or more instructions in the computer storage medium are loaded by the processor 901 and execute the following steps:

[0180] Obtain a first feature matrix corresponding to a first application and a second feature matrix corresponding to a second application, wherein the first feature matrix is ​​obtained based on code data corresponding to the first application, and the second feature matrix corresponding to the second application is obtained based on code data corresponding to the second application; perform a similarity operation on the first feature matrix and the second feature matrix to obtain the similarity between the first feature matrix and the second feature matrix; and output the similarity between the first application and the second application based on the similarity between the first feature matrix and the second feature matrix.

[0181] In one embodiment, when the processor 901 obtains the first feature matrix corresponding to the first application, it performs the following steps: obtaining code data corresponding to the first application; compiling the code data corresponding to the first application into an abstract syntax tree, the abstract syntax tree representing the grammatical structure of the code data in a tree form, the abstract syntax tree including multiple levels, each level including multiple nodes; traversing the abstract syntax tree to determine the node type to which each node in the multiple nodes of each level in the multiple levels belongs; generating a feature vector corresponding to the corresponding level according to the node type to which each node in the multiple nodes of each level belongs; combining the feature vectors corresponding to each level in a preset order to obtain the first feature matrix corresponding to the first application.

[0182] In one embodiment, when the processor 901 generates a feature vector corresponding to a corresponding level according to the node type to which each node in the multiple nodes of each level belongs, the processor 901 performs the following steps: obtaining multiple preset node types; generating an initial feature vector according to the multiple preset node types, wherein the dimension of the initial feature vector is equal to the number of the multiple preset node types, and each element position of the initial feature vector corresponds to a preset node type; determining the number of nodes belonging to each preset node type in the multiple nodes of the corresponding level according to the node type to which each node in each level belongs; writing the number of nodes belonging to any preset node type as an element value into the element position corresponding to the any preset node type in the initial feature vector, to obtain a feature vector corresponding to each level.

[0183] In one embodiment, when the processor 901 performs a similarity operation on the first feature matrix and the second feature matrix to obtain the similarity between the first feature matrix and the second feature matrix, the processor 901 performs the following steps:

[0184] The first feature matrix and the second feature matrix are input into the cosine similarity calculation rule for operation to obtain the angle between the first feature matrix and the second feature matrix; the similarity between the first feature matrix and the second feature matrix is ​​determined based on the angle between the first feature matrix and the second feature matrix; wherein, the smaller the angle between the first feature matrix and the second feature matrix, the greater the similarity between the first feature matrix and the second feature matrix; the larger the angle between the first feature matrix and the second feature matrix, the smaller the similarity between the first feature matrix and the second feature matrix.

[0185] In one embodiment, the first application includes a subprogram running in a first client, and the second application includes a subprogram running in a second client; the first client and the second client are the same client; or, the first client and the second client are different clients.

[0186] In an embodiment of the present invention, the server determines the similarity between the first application and the second application based on the similarity between the first feature matrix corresponding to the first application and the second feature matrix corresponding to the second application. The first feature matrix is ​​obtained based on the code data corresponding to the first application, and the first feature matrix is ​​used to reflect the key structural information in the code data corresponding to the first application. The second feature matrix is ​​obtained based on the code data corresponding to the second application, and the second feature matrix is ​​used to reflect the key structural information in the code data corresponding to the second application. In other words, comparing the similarity between the first feature matrix and the second feature matrix is ​​equivalent to comparing the key structural information in the code data of the first application with the key structural information in the code data of the second application. If the key structural information of the two is highly similar, it indicates that the code data of the two are highly similar, which also indicates that the similarity between the two applications is highly similar, and vice versa.

[0187] When determining the similarity between the first application and the second application as described above, the structural information in the code data between the two is taken into account, which can overcome the situation where similarity detection is misjudged due to code confusion, thereby improving the accuracy of similarity detection; in addition, the embodiment of the present invention extracts key structural information in the code data and does not compare all the code data one by one, which saves computing time and can improve the efficiency of similarity detection.

[0188] In other embodiments, the computer storage medium can be loaded by the processor 1001 and execute one or more instructions stored in the computer storage medium to implement the above-mentioned Figure 5 In a specific implementation, one or more instructions in the computer storage medium are loaded by the processor 1001 and execute the following steps:

[0189] Obtain the similarity between a first application and a second application, wherein the similarity between the first application and the second application is determined by a server performing a similarity operation based on a first feature matrix corresponding to the first application and a second feature matrix corresponding to the second application; display a similarity detection result interface, and display the similarity between the first application and the second application on the similarity detection result interface; wherein the first feature matrix is ​​obtained based on the code data corresponding to the first application, and the second feature matrix corresponding to the second application is obtained based on the code data corresponding to the second application, and the first feature matrix is ​​used to reflect key structural information in the code data corresponding to the first application, and the second feature matrix is ​​used to reflect key structural information in the code data corresponding to the second application.

[0190] In one embodiment, the similarity detection result interface includes an application identification list item and a similarity list item. When the processor 1001 displays the similarity between the first application and the second application on the similarity detection result interface, it performs the following steps: displaying the application identification of the second application at the first position of the application identification list item; and displaying the similarity between the second application and the first application at a position corresponding to the first position in the similarity list item.

[0191] In one embodiment, the similarity detection result interface also includes a program startup code list item, and the program startup code corresponding to the second application is displayed at a position corresponding to the first position in the program startup code list item; when the program startup code is scanned, the second application is run in the terminal that scans the program startup code, so that a user using the terminal can review the similarity between the first application and the second application through the running interface of the second application and the running interface of the first application.

[0192] In one embodiment, the similarity detection result interface includes an operation control for supplementing an application that is similar to the first application; the processor 1001 is also used to: when the operation control is triggered, display an add window, the add window including an application identifier input area and a confirmation control; when there is a target application identifier in the application identifier input area and the confirmation control is triggered, display the similarity between the application indicated by the target application identifier and the first application in the similarity detection result interface.

[0193] In one embodiment, the first application includes a subprogram running in a first client, and the second application includes a subprogram running in a second client; the first client and the second client are the same client; or, the first client and the second client are different clients.

[0194] In an embodiment of the present invention, the server can determine the similarity between the first application and the second application based on the similarity between the first feature matrix of the first application and the second feature matrix of the second application. The first feature matrix is ​​obtained based on the code data corresponding to the first application, and can be used to reflect the key structural information in the code data of the first application. The second feature matrix is ​​obtained based on the code data corresponding to the second application, and can be used to reflect the key structural information in the code data of the second application. If the key structural information in the code data of the two applications is similar, the similarity between the two applications is relatively large. Therefore, determining the similarity between the two applications based on the key structural information can ensure a high accuracy of similarity detection, and the obfuscation operation of the code data will not affect the detection result; in addition, compared with the prior art of comparing any one code data with other multiple code data one by one, its detection efficiency can be controlled at an extremely high level.

[0195] In addition, the terminal may display the similarity between the first application and the second application in the similarity detection result interface in the form of a list, so as to intuitively understand the similarity between the two applications.

[0196] According to one aspect of the present application, an embodiment of the present invention further provides a computer product or a computer program, the computer product or the computer program including a computer instruction, the computer instruction being stored in a computer-readable storage medium. Optionally, the processor 901 reads the computer instruction from the computer-readable storage medium, and the processor 901 executes the computer instruction so that the server executes Figure 2 The data processing method shown is specifically:

[0197] Obtain a first feature matrix corresponding to a first application and a second feature matrix corresponding to a second application, wherein the first feature matrix is ​​obtained based on code data corresponding to the first application, and the second feature matrix corresponding to the second application is obtained based on code data corresponding to the second application; perform a similarity operation on the first feature matrix and the second feature matrix to obtain the similarity between the first feature matrix and the second feature matrix; and output the similarity between the first application and the second application based on the similarity between the first feature matrix and the second feature matrix.

[0198] Optionally, the processor 1001 reads the computer instruction from a computer-readable storage medium, and the processor 1001 executes the computer instruction so that the server executes Figure 5 The data display method shown is, specifically:

[0199] Obtain the similarity between a first application and a second application, wherein the similarity between the first application and the second application is determined by a server performing a similarity operation based on a first feature matrix corresponding to the first application and a second feature matrix corresponding to the second application; display a similarity detection result interface, and display the similarity between the first application and the second application on the similarity detection result interface; wherein the first feature matrix is ​​obtained based on the code data corresponding to the first application, and the second feature matrix corresponding to the second application is obtained based on the code data corresponding to the second application, and the first feature matrix is ​​used to reflect key structural information in the code data corresponding to the first application, and the second feature matrix is ​​used to reflect key structural information in the code data corresponding to the second application.

Claims

1. A data processing method, characterized in that: include: Obtain a first feature matrix corresponding to a first application and a second feature matrix corresponding to a second application, wherein the first feature matrix is ​​obtained by combining feature vectors corresponding to each level in an abstract syntax tree formed by compiling code data corresponding to the first application in a preset order; the second feature matrix corresponding to the second application is obtained by combining feature vectors corresponding to each level in an abstract syntax tree formed by compiling code data corresponding to the second application in a preset order, wherein the first feature matrix is ​​used to reflect key structural information in the code data corresponding to the first application, and the second feature matrix is ​​used to reflect key structural information in the code data corresponding to the second application, wherein the key structural information refers to a main code structure for realizing application functions; Performing a similarity operation on the first feature matrix and the second feature matrix to obtain a similarity between the first feature matrix and the second feature matrix; Based on the similarity between the first feature matrix and the second feature matrix, the similarity between the first application and the second application is output.

2. The method according to claim 1, characterized in that The obtaining of a first feature matrix corresponding to the first application includes: Obtaining code data corresponding to the first application; Compile the code data corresponding to the first application into an abstract syntax tree, wherein the abstract syntax tree represents the syntax structure of the code data in a tree form, and the abstract syntax tree includes multiple levels, and each level includes multiple nodes; Traversing the abstract syntax tree to determine the node type to which each of the multiple nodes in each of the multiple levels belongs; Generate a feature vector corresponding to the corresponding level according to the node type to which each node in the plurality of nodes at each level belongs; The feature vectors corresponding to each level are combined in a preset order to obtain a first feature matrix corresponding to the first application.

3. The method according to claim 2, characterized in that The step of generating a feature vector corresponding to a corresponding level according to the node type to which each node in the plurality of nodes at each level belongs includes: Get multiple preset node types; Generate an initial feature vector according to the multiple preset node types, the dimension of the initial feature vector is equal to the number of the multiple preset node types, and each element position of the initial feature vector corresponds to a preset node type; According to the node type to which each node in each level belongs, determining the number of nodes belonging to each preset node type among the multiple nodes of the corresponding level; The number of nodes belonging to any preset node type is written as an element value into the element position corresponding to any preset node type in the initial feature vector to obtain the feature vector corresponding to each level.

4. The method according to claim 1, characterized in that The performing a similarity operation on the first feature matrix and the second feature matrix to obtain the similarity between the first feature matrix and the second feature matrix includes: Inputting the first feature matrix and the second feature matrix into a cosine similarity calculation rule for operation to obtain an angle between the first feature matrix and the second feature matrix; Determine the similarity between the first feature matrix and the second feature matrix based on the angle between the first feature matrix and the second feature matrix; Among them, the smaller the angle between the first feature matrix and the second feature matrix, the greater the similarity between the first feature matrix and the second feature matrix; the larger the angle between the first feature matrix and the second feature matrix, the smaller the similarity between the first feature matrix and the second feature matrix.

5. The method according to any one of claims 1 to 4, characterized in that: The first application includes a subprogram running in a first client, and the second application includes a subprogram running in a second client; the first client and the second client are the same client; or the first client and the second client are different clients.

6. A data display method, characterized in that: include: Acquire a similarity between a first application and a second application, where the similarity between the first application and the second application is determined by a server performing a similarity calculation based on a first feature matrix corresponding to the first application and a second feature matrix corresponding to the second application; Displaying a similarity detection result interface, and displaying the similarity between the first application and the second application on the similarity detection result interface; Among them, the first feature matrix is ​​obtained by combining the feature vectors corresponding to each level in the abstract syntax tree formed by compiling the code data corresponding to the first application in a preset order; the second feature matrix corresponding to the second application is obtained by combining the feature vectors corresponding to each level in the abstract syntax tree formed by compiling the code data corresponding to the second application in a preset order; the first feature matrix is ​​used to reflect the key structural information in the code data corresponding to the first application, and the second feature matrix is ​​used to reflect the key structural information in the code data corresponding to the second application; the key structural information refers to the main code structure that realizes the application function.

7. The method according to claim 6, characterized in that The similarity detection result interface includes an application identification list item and a similarity list item, and the similarity between the first application and the second application is displayed on the similarity detection result interface, including: The application identifier of the second application is displayed at a first position of the application identifier list item; and the similarity between the second application and the first application is displayed at a position corresponding to the first position in the similarity list item.

8. The method according to claim 7, characterized in that The similarity detection result interface further includes a program startup code list item, and the program startup code corresponding to the second application program is displayed at a position in the program startup code list item corresponding to the first position; When the program launch code is scanned, the second application is run in the terminal that scans the program launch code, so that a user using the terminal can review the similarity between the first application and the second application through the running interface of the second application and the running interface of the first application.

9. The method according to claim 6, characterized in that The similarity detection result interface includes an operation control for supplementing an application similar to the first application; when the operation control is triggered, an add window is displayed, the add window includes an application identifier input area and a confirmation control; When a target application identifier exists in the application identifier input area and the determination control is triggered, the similarity between the application indicated by the target application identifier and the first application is displayed on the similarity detection result interface.

10. The method according to any one of claims 6 to 9, characterized in that: The first application includes a subprogram running in a first client, and the second application includes a subprogram running in a second client; the first client and the second client are the same client; or the first client and the second client are different clients.

11. A data processing device, characterized in that: include: an acquisition unit, configured to acquire a first feature matrix corresponding to a first application and a second feature matrix corresponding to a second application, wherein the first feature matrix is ​​obtained by combining feature vectors corresponding to each level in an abstract syntax tree formed by compiling code data corresponding to the first application in a preset order; and the second feature matrix corresponding to the second application is obtained by combining feature vectors corresponding to each level in an abstract syntax tree formed by compiling code data corresponding to the second application in a preset order; the first feature matrix is ​​used to reflect key structural information in the code data corresponding to the first application, and the second feature matrix is ​​used to reflect key structural information in the code data corresponding to the second application, and the key structural information refers to a main code structure for realizing application functions; a processing unit, configured to perform a similarity operation on the first feature matrix and the second feature matrix to obtain a similarity between the first feature matrix and the second feature matrix; An output unit is used to output the similarity between the first application and the second application based on the similarity between the first feature matrix and the second feature matrix.

12. A data display device, characterized in that: include: an acquisition unit, configured to acquire a similarity between a first application and a second application, wherein the similarity between the first application and the second application is determined by a server performing a similarity operation based on a first feature matrix corresponding to the first application and a second feature matrix corresponding to the second application; A display unit, configured to display a similarity detection result interface, and display the similarity between the first application and the second application on the similarity detection result interface; Among them, the first feature matrix is ​​obtained by combining the feature vectors corresponding to each level in the abstract syntax tree formed by compiling the code data corresponding to the first application in a preset order, and the second feature matrix corresponding to the second application is obtained by combining the feature vectors corresponding to each level in the abstract syntax tree formed by compiling the code data corresponding to the second application in a preset order. The first feature matrix is ​​used to reflect the key structure information in the code data corresponding to the first application, and the second feature matrix is ​​used to reflect the key structure information in the code data corresponding to the second application, and the key structure information refers to the main code structure that realizes the application function.

13. A server, characterized in that: include: a processor adapted to implement one or more instructions, and A computer storage medium storing one or more instructions, wherein the one or more instructions are suitable for being loaded by the processor and executing the data processing method according to any one of claims 1 to 5.

14. A terminal, characterized in that: include a processor adapted to implement one or more instructions, and A computer storage medium storing one or more instructions, wherein the one or more instructions are suitable for being loaded by the processor and executing the data display method according to any one of claims 6 to 10.

15. A computer storage medium, characterized in that: The computer storage medium stores computer program instructions, which, when executed by a processor, are used to execute the data processing method according to any one of claims 1 to 5; or, when executed by a processor, the computer program instructions are used to execute the data display method according to any one of claims 6 to 10.

Citation Information

Patent Citations

  • Applet code similarity determination method and device, server and storage medium

    CN111562920A

  • Similarity evaluation program, similarity evaluation apparatus and similarity evaluation method

    JP2008046695A