Method, device, equipment and medium for determining modification function points based on bytecode

Through the method of determining the functional point based on bytecode in microservices and large application systems, the problem of code receiving difficulties caused by the flow of R & D personnel and low test efficiency is solved. efficiency.

CN114281401BActive Publication Date: 2025-01-28DIGITAL GUANGDONG NETWORK CONSTR CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111592403.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-23
Publication Date
2025-01-28
Estimated Expiration
2041-12-23

AI Technical Summary

Technical Problem

During the research and development process of microservices and large application systems, the flow of R&D personnel makes it difficult to take over the code. All functional points need to be tested at each release, reducing R&D efficiency and wasting resources.

Method used

By obtaining the current deployment version package and the latest version package, determine the latest version of the package for the modified structure of the current deployment version, the execution method reference symbol analysis engine, the construction method body instruction model and structure influence analysis diagram, determine the modified structure, Modify function points.

Benefits of technology

Quickly and accurately determine the modification function points in two different versions to avoid testing all function points one by one, improve research and development efficiency, and save R & D resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114281401B_ABST
    Figure CN114281401B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device, equipment and medium for determining modified function points based on bytecode, including: obtaining the current deployed version package and the latest version package, determining the modified structure of the latest version package relative to the current deployed version package; executing the method body reference symbol resolution engine according to the current deployed version package and the latest version package, respectively constructing the method body instruction model corresponding to the bytecode in the current deployed version package and the latest version package; constructing the structure impact analysis diagram of the current deployed version package and the latest version package according to the method body instruction model; determining the modified function points in the modified structure according to the structure impact analysis diagram and the modified structure. Based on the above method, the modified function points in two different version packages can be quickly and accurately determined, thereby avoiding the need to test all function points one by one when the function code is modified, thereby improving R&D efficiency and saving R&D resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present application relate to the field of software system processing, and in particular, to a method, apparatus, device, and medium for determining a modification function point based on bytecode. Background Art

[0002] In the process of developing microservices and large-scale application systems, there is usually a turnover of R&D personnel, which leads to other people taking over the code designed by the mobile R&D personnel. Considering that the coupling degree of the code designed by the mobile R&D personnel may affect other code modules designed by the subsequent R&D personnel, the personnel who take over need to test all functional points every time they release the version. This will not only reduce R&D efficiency, but also greatly waste R&D resources. Summary of the invention

[0003] The embodiments of the present application provide a method, apparatus, device and medium for determining modified function points based on bytecode, which can quickly and accurately determine the modified function points in two different version packages, thereby avoiding testing all function points one by one when the function code is modified, thereby improving R&D efficiency and saving R&D resources.

[0004] In a first aspect, an embodiment of the present application further provides a method for determining a modification function point based on a bytecode, the method comprising:

[0005] Get the currently deployed version package and the latest version package, and determine the modified structure of the latest version package relative to the currently deployed version package;

[0006] According to the currently deployed version package and the latest version package, the method body reference symbol resolution engine is executed to respectively construct the method body instruction models of the corresponding bytecodes in the currently deployed version package and the latest version package;

[0007] According to the method body instruction model, the structure impact analysis diagrams of the current deployed version package and the latest version package are constructed respectively;

[0008] According to the structure impact analysis diagram and the modified structure, determine the modified function points in the modified structure.

[0009] In a second aspect, an embodiment of the present application further provides a device for determining a modification function point based on a bytecode, the device comprising:

[0010] A determination module is used to obtain the currently deployed version package and the latest version package, and determine the modified structure of the latest version package relative to the currently deployed version package; a construction module is used to execute the method body reference symbol resolution engine according to the currently deployed version package and the latest version package, and respectively construct the method body instruction model corresponding to the bytecode in the currently deployed version package and the method body instruction model corresponding to the bytecode in the latest version package;

[0011] The construction module is also used to construct the structure impact analysis diagrams of the current deployed version package and the latest version package respectively according to the method body instruction model;

[0012] The determination module is also used to determine the modification function points in the modified structure according to the structure impact analysis diagram and the modified structure.

[0013] In a third aspect, an embodiment of the present application further provides a computer device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, a method for determining modification function points based on bytecode as provided in any embodiment of the present application is implemented.

[0014] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the method for determining a modified function point based on a bytecode as provided in any embodiment of the present application is implemented.

[0015] The embodiment of the present application provides a method, apparatus, device and storage medium for determining modified function points based on bytecodes. The method may include: obtaining the current deployed version package and the latest version package, and determining the modified structure of the latest version package relative to the current deployed version package; executing the method body reference symbol resolution engine according to the current deployed version package and the latest version package, and respectively constructing the method body instruction model corresponding to the bytecode in the current deployed version package and the latest version package; constructing the structure impact analysis diagram of the current deployed version package and the latest version package according to the method body instruction model; determining the modified function points in the modified structure according to the structure impact analysis diagram and the modified structure. Based on the above method, the modified function points in two different version packages can be quickly and accurately determined, thereby avoiding the need to test all function points one by one when the function code is modified, thereby improving R&D efficiency and saving R&D resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 A flowchart of a method for determining a modification function point based on bytecode provided in an embodiment of the present application;

[0017] Figure 1a A schematic diagram of a structural impact analysis diagram provided in an embodiment of the present application;

[0018] Figure 1b A flow chart of a method for constructing a method body instruction model corresponding to the bytecode in the current deployed version package and a method body instruction model corresponding to the bytecode in the latest version package provided by an embodiment of the present application;

[0019] Figure 2It is a flow chart of a method for determining the impact index of each function package in the current deployment version package and the latest version package, and the impact index of the bytecode contained in each function package, provided by an embodiment of the present application;

[0020] Figure 3 It is a schematic diagram of the structure of a device for determining a modification function point based on bytecode provided in an embodiment of the present application;

[0021] Figure 4 It is a schematic diagram of the structure of the computer device in the embodiment of the present application. DETAILED DESCRIPTION

[0022] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for ease of description, only the parts related to the present application, rather than all structures, are shown in the accompanying drawings.

[0023] In addition, in the embodiments of the present application, words such as "optionally" or "exemplarily" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "optionally" or "exemplarily" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "optionally" or "exemplarily" is intended to present related concepts in a specific way.

[0024] It should be noted that in the embodiments of the present application, the method body instruction model of the corresponding bytecode in the current deployment version package and the latest version package can be understood as the method body instruction model of the corresponding bytecode in the current deployment version package and the method body instruction model of the corresponding bytecode in the latest version package. The structural impact analysis diagram of the current deployment version package and the latest version package can be understood as the structural impact analysis diagram of the current deployment version package and the structural impact analysis diagram of the latest version package. Similarly, the impact index of each function package in the current deployment version package and the latest version package can be understood as the impact index of each function package in the current deployment version package and the impact index of each function package in the latest version package. Correspondingly, other descriptions similar to the above-mentioned limitations on the bytecodes contained in each function package, the method body instruction model of the corresponding bytecode, etc. can all be understood as the bytecodes contained in each function package corresponding to the current deployment version package and the latest version package, and the method body instruction model of the corresponding bytecode, etc., which are not repeated here one by one.

[0025] Figure 1A flowchart of a method for determining modification function points based on bytecodes provided in an embodiment of the present application. The method can be applied to various microservice systems or large-scale application systems (for example, government service systems, etc.). The method can be executed by a device for determining modification function points based on bytecodes provided in an embodiment of the present application. The device can be implemented in software and / or hardware. In a specific embodiment, the device can be integrated in a computer device, which can be a server, for example. The following embodiments will be described by taking the device integrated in a computer device as an example. Figure 1 As shown, the method may include but is not limited to the following steps:

[0026] S101. Obtain a currently deployed version package and a latest version package, and determine a modified structure of the latest version package relative to the currently deployed version package.

[0027] In the embodiments of the present application, the currently deployed version package can be understood as a designed software package, and the latest version package can be understood as a software package that is updated or redesigned from the currently deployed version package. The currently deployed version package and the latest version package have different corresponding version numbers, that is, the currently deployed version package and the latest version package can be distinguished by the version number. The above-mentioned modified structure represents the structure of the latest version package that is updated or redesigned relative to the currently deployed version package. The modified structure only exists in the latest version package, but not in the currently deployed version package.

[0028] S102: Execute the method body reference symbol resolution engine according to the currently deployed version package and the latest version package, and respectively construct method body instruction models corresponding to the bytecodes in the currently deployed version package and the latest version package.

[0029] Exemplarily, the implementation of this step may include: traversing the current deployment version package and the latest version package respectively, determining the bytecodes contained in each function package in the current deployment version package and the latest version package; executing the method body reference symbol resolution engine based on the bytecodes contained in each function package in the current deployment version package and the latest version package, and generating dynamic links corresponding to the bytecodes; constructing method body instruction models corresponding to the bytecodes in the current deployment version package and the latest version package respectively according to the bytecodes contained in each function package in the current deployment version package and the latest version package, and the dynamic links corresponding to each bytecode. Further, the above-mentioned execution of the method body reference symbol resolution engine can be understood as running a certain section of program code and parsing the relevant method body instructions. The method body reference symbol resolution engine may include an instruction counter. In the process of executing the method body reference symbol resolution engine, the current execution process can be determined by the indication of the instruction counter, for example, the dynamic link corresponding to a certain bytecode currently parsed, etc.

[0030] S103: Construct structure impact analysis diagrams of the current deployed version package and the latest version package respectively according to the method body instruction model.

[0031] Exemplarily, the currently deployed version package and the latest version package can be traversed to determine the impact index of each function package in the currently deployed version package and the latest version package, and the impact index of the bytecode contained in each function package. Then, according to the acquired impact index of each function package, the impact index of the bytecode contained in each function package, and the method body instruction model of each bytecode obtained in the above step S102, the structure impact analysis diagram of the currently deployed version package and the structure impact analysis diagram of the latest version package are respectively constructed.

[0032] It should be noted that the above-mentioned impact indexes can also be understood as coupling divergence, or whether the node has child nodes. For example, when the coupling divergence is 0, it means that the node is the last node and does not have child nodes; when the coupling divergence is not 0, it means that the node has child nodes, then the impact index (or coupling divergence) corresponding to the node is the hash code of the fifth version of the message digest algorithm (Message Digest Algorithm, MD5) composed of the impact index of all nodes connected to the current node. Based on the impact index of each function package and the impact index of the bytecode contained in each function package, the association relationship between each function package and each bytecode can be determined. The method body instruction model of the bytecode can also be understood as a specific description of the bytecode presented in the form of a model. Then, after obtaining the impact index of each function package in the current deployment version package and the latest version package, the impact index of the bytecode contained in each function package, and the method body instruction model corresponding to each bytecode, the structure impact analysis diagram of the current deployment version package and the structure impact analysis diagram of the latest version package can be obtained. For example, based on the impact index of the corresponding function package and the impact index of the bytecode contained in the corresponding function package, the structure impact analysis diagram framework of the current deployed version package and the latest version package are respectively built, and then the specific description of each node in the structure impact analysis diagram framework is further improved based on the method body instruction model of each bytecode, so as to finally obtain the structure impact analysis diagram of the current deployed version package and the structure impact analysis diagram of the latest version package.

[0033] S104. Determine a modification function point in the modified structure according to the structure impact analysis diagram and the modified structure.

[0034] Since the structure impact analysis diagrams corresponding to the current deployed version package and the latest version package respectively contain specific descriptions of each node in the current deployed version package and the latest version package, after determining the modified structure of the latest version package relative to the current deployed version package, the specific modified functional points in the modified structure of the latest version package relative to the current deployed version package can be determined based on the structure and the structure impact analysis diagrams corresponding to the current deployed version package and the latest version package.

[0035] For example, based on the modification structure, at least one function point contained in the modification structure is determined in the current deployment version package, and the at least one determined function point is determined as the first function point; according to the modification structure, at least one function point contained in the modification structure is determined in the latest deployment version package, and the at least one determined function point is determined as the second function point; the first function points in the current deployment version package and the second function points in the latest version package are matched in a traversal manner, and when the front or bytes of any function point in the modification structure of the latest version package are different from all the first function points in the modification structure of the current deployment version package, determine that any function point in the second function point is a modified function point in the modification structure of the latest version package relative to the current deployment version package.

[0036] For example, Figure 1a Taking the structure impact analysis diagram shown in the figure (the structure impact analysis diagram of the current deployed version package, or the structure impact analysis diagram of the latest version package, Byte[]methodinstr in the figure represents the method body instruction code (or understood as the byte instruction code), and Blshipaflink linkrefs[……] represents the symbol reference list between method bodies) as an example, starting from the root node, find the impact index of the first function package (or method body) in the structure presented in the figure. If the structure impact analysis diagram of the current deployed version package and the structure impact analysis diagram of the latest version package have the same impact index, it means that there is no modified structure in the path, then stop the deep search and change the search path. If there is a different impact index in the search path, it means that the corresponding node is a modified structure, then you can continue to find the node with a node coupling divergence of 0. Further, the search results can be recorded in affected_method_list, so that based on affected_method_list, you can clearly understand the impact of the method body modification on other related function points or method bodies, and then you can remind relevant personnel to conduct targeted functional testing to improve R&D efficiency.

[0037] That is, in the embodiment of the present application, the specific modification function point in the modified structure can be determined in the structure impact analysis diagram by back-propagating the impact index.

[0038] It should be noted that the modification structure in the above-mentioned currently deployed version package may be empty, and at least one function point contained in the modification structure may also be empty. That is, the modification structure may be a structure newly developed and designed by the latest version package relative to the currently deployed version, then the modification structure does not exist in the currently deployed version package, that is, the modification structure in the currently deployed version package is empty.

[0039] The embodiment of the present application provides a method for determining modified function points based on bytecode, the method comprising: obtaining the current deployment version package and the latest version package, determining the modified structure of the latest version package relative to the current deployment version package; executing the method body reference symbol resolution engine according to the current deployment version package and the latest version package, respectively constructing the method body instruction model corresponding to the bytecode in the current deployment version package and the latest version package; constructing the structure impact analysis diagram of the current deployment version package and the latest version package according to the method body instruction model; determining the modified function points in the modified structure according to the structure impact analysis diagram and the modified structure. Based on the above method, the modified function points in two different version packages can be quickly and accurately determined, thereby avoiding the need to test all function points one by one when the function code is modified, thereby improving R&D efficiency and saving R&D resources.

[0040] In one example, in the above step S101, the implementation method of determining the modified structure of the latest version package relative to the currently deployed version package may include: traversing the currently deployed version package and the latest version package respectively, determining the impact index of each function package in the currently deployed version package, and the impact index of each function package in the latest version package. Then, according to the impact index of each function package in the currently deployed version package and the impact index of each function package in the latest version package, determine the modified structure of the latest version package relative to the currently deployed version package.

[0041] For example, in an embodiment of the present application, both the currently deployed version package and the latest version package can implement multiple different functions. Specifically, the multiple different functions can be implemented by each function package included in the currently deployed version package and the latest version package. Furthermore, each function package (package) also includes at least one bytecode (class bytecode), that is, the relationship between the function package and the bytecode can be understood as a tree diagram, for example, the function package is a tree type node, and the bytecode is a leaf type node under the tree node.

[0042] Exemplarily, an implementation method for determining the impact index of each function package in the above-mentioned different version packages may include: extracting the bytecodes contained in each function package in the currently deployed version package and the bytecodes contained in each function package in the latest version package in a traversal manner; processing the bytecodes contained in the above-mentioned extracted function packages based on a message digest algorithm to determine the hash code of the bytecode; and then, determining the impact index of each function package in the currently deployed version package and the impact index of each function package in the latest version package according to the obtained hash code of the bytecode.

[0043] Optionally, the message digest algorithm may adopt the fifth version of the message digest algorithm (Message Digest Algorithm, MD5).

[0044] After obtaining the impact index of each function package, the impact index of each function package in the latest version package can be matched with the impact index of each function package in the currently deployed version package in a traversal manner, and the modified structure of the latest version package relative to the currently deployed version package can be determined based on the matching result. Exemplarily, the modified structure can be a function package or a function point (or method body) contained in a function package.

[0045] For example, when the impact index of any function package in the latest version package is different from the impact index of all function packages in the currently deployed version package, determine that any function package is the modified structure of the latest version package relative to the currently deployed version package. For example, assuming that the latest version package contains function packages A, B, and C, and the currently deployed version package contains function packages A and B, the impact indexes of function packages A and B in the currently deployed version package are the same as those of function packages A and B in the latest version package, while the impact index of function package C in the latest version package is different from the impact indexes of function packages A and B in the currently deployed version package, indicating that function package C in the latest version package is the latest developed and designed function package, then function package C is the modified structure of the latest version package relative to the currently deployed version package.

[0046] Further, in the embodiment of the present application, the above traversal matching method can be to traverse and match the function packages in the current deployment version package and the latest version package in a tree diagram from top to bottom. Figure 1b As shown, in an example, in the above step S102, the implementation method of generating the dynamic link corresponding to the bytecode may include but is not limited to the following methods:

[0047] S1001. Extract a method description table based on the bytecodes contained in each function package in the currently deployed version package and the bytecodes contained in each function package in the latest version package.

[0048] Specifically, the method description table may include a variable table, a bytecode structure total code element table, a constant pool, a method signature, a method exit, and the like.

[0049] S1002. Determine the bytecode structure information body of the corresponding bytecode according to the variable table, the bytecode structure total code element table and the constant pool contained in the method description table.

[0050] After extracting the method description table of each bytecode, the variable table, method signature, method exit, bytecode structure total code element table and constant pool (const-pool) contained in the method description table can be parsed out, and then the bytecode structure information body of the bytecode corresponding to the method description table is determined in the constant pool according to the bytecode (for example, hexadecimal bytecode) and the bytecode structure total code element table. The bytecode structure information body may include attribute information about the bytecode, such as the attribute name index (attribute_name_index), attribute length (attribute_length), method body bytecode instruction length (code-length) and method execution logic instruction mnemonics (i.e., bytecode instructions of code-length length). That is, the bytecode structure information body can be understood as a specific description of the bytecode related information, and the reference information between the bytecodes can be determined based on the bytecode structure information body.

[0051] S1003, decompile the bytecode structure information body into bytecode instruction code.

[0052] S1004, parsing the bytecode instruction code, and obtaining the dynamic link corresponding to the bytecode.

[0053] The above process of generating dynamic links can be understood as the process of executing the method body reference symbol resolution engine. By executing the above process, the instructions in the method body can be parsed to generate dynamic links corresponding to the bytecodes, and the current parsed bytecode instruction code can be determined based on the indication of the instruction counter to obtain the implementation process of the dynamic link.

[0054] Exemplarily, the above implementation process can be explained by the following example. For example, assuming that the method body of bytecode A is applied to the method body of bytecode B, that is, methodA of ClassA is applied to methodB of ClassB, then part of the bytecode content can be intercepted, such as the method table and constant pool. Further,

[0055] Assume that there is a constant in the constant pool pointing to methodB of ClassB, as follows:

[0056]

[0057] Then get invokevirtual#4 (i.e. constant #4 in the above constant pool), which points to the ClassA.methodA:()V method body, which can be a simple reference symbol of the fully qualified name of the method body, that is, the dynamic link inside the bytecode corresponding to the method body.

[0058] Similarly, the above method can also be used to obtain reference symbols of fully qualified names of elements such as function packages, bytecodes, interfaces, etc.

[0059] In another example, an implementation method of constructing method body instruction models corresponding to the bytecodes in the current deployment version package and the latest version package respectively based on each bytecode and the dynamic link corresponding to the acquired bytecode may include: extracting a method description table based on the bytecode, i.e., the above step S1001, and then constructing method body instruction models corresponding to the bytecodes in the current deployment version package and the latest version package respectively according to the dynamic link corresponding to the acquired bytecode and the variable table, method signature, and method exit contained in the method description table.

[0060] like Figure 2 As shown, in one example, in the above step S103, the implementation method of respectively determining the impact index of each function package in the currently deployed version package, the impact index of the bytecode contained in each function package, and the impact index of each function package in the latest version package, and the impact index of the bytecode contained in each function package according to the hash code of the bytecode may include but is not limited to the following steps:

[0061] S201. Sort the hash codes of the bytecodes included in each function package in the currently deployed version package, and determine a set consisting of the sorted hash codes as a first set.

[0062] S202: sort the hash codes of the bytecodes included in each function package in the latest version package, and determine a set consisting of the sorted hash codes as a second set.

[0063] S203: Process the first set and the second set respectively based on the summary information algorithm to determine a hash code of the first set and a hash code of the second set.

[0064] S204: Determine the hash code of the first set and the hash code of the second set as the impact index of the corresponding function package in the currently deployed version package and the impact index of the corresponding function package in the latest version package, respectively.

[0065] S205. Determine the hash code of the bytecode as the impact index of the corresponding bytecode included in the corresponding function package in the currently deployed version package and the impact index of the corresponding bytecode included in the corresponding function package in the latest version package.

[0066] Figure 3A schematic diagram of a structure of a device for determining a modification function point based on a bytecode provided in an embodiment of the present application, such as Figure 3 As shown, the device may include: a determination module 301 and a construction module 302.

[0067] The determination module is used to obtain the currently deployed version package and the latest version package, and determine the modified structure of the latest version package relative to the currently deployed version package;

[0068] A construction module is used to execute the method body reference symbol resolution engine according to the currently deployed version package and the latest version package, and respectively construct the method body instruction model of the corresponding bytecode in the currently deployed version package and the latest version package;

[0069] The construction module is also used to construct the structure impact analysis diagrams of the current deployed version package and the latest version package respectively according to the method body instruction model;

[0070] The determination module is also used to determine the modification function points in the modified structure according to the structure impact analysis diagram and the modified structure.

[0071] In one example, the determination module is used to traverse the current deployment version package and the latest version package respectively, determine the impact index of each function package in the current deployment version package, and the impact index of each function package in the latest version package. Then, according to the impact index of each function package in the current deployment version package and the impact index of each function package in the latest version package, determine the modification structure of the latest version package relative to the current deployment version package.

[0072] Specifically, the above-mentioned determination module is used to match the impact index of each function package in the latest version package with the impact index of each function package in the currently deployed version package in a traversal manner; when the impact index of any function package in the latest version package is different from the impact index of all function packages in the currently deployed version package, determine that any function package is the modification structure of the latest version package relative to the currently deployed version.

[0073] In one example, the above-mentioned construction module may include a traversal unit, a generation unit and a construction unit;

[0074] The traversal unit is used to traverse the current deployment version package and the latest version package respectively, and determine the bytecodes contained in each function package in the current deployment version package and the bytecodes contained in each function package in the latest version package;

[0075] A generation unit is used to execute a method body reference symbol resolution engine based on the bytecodes contained in each function package in the current deployment version package and the latest version package, and generate a dynamic link corresponding to the bytecode;

[0076] The construction unit is used to construct the method body instruction model of the corresponding bytecode in the current deployment version package and the method body instruction model of the corresponding bytecode in the latest version package, respectively, based on the bytecodes contained in each function package in the current deployment version package, the bytecodes contained in each function package in the latest version package, and the dynamic links corresponding to each bytecode.

[0077] Exemplarily, the generation unit is specifically used to extract the method description table based on the bytecodes contained in each function package in the currently deployed version package and the bytecodes contained in each function package in the latest version package; determine the bytecode structure information body corresponding to the bytecode according to the variable table, bytecode structure total code element table and constant pool contained in the method description table; deassemble the bytecode structure information body into byte instruction code; parse the byte instruction code to obtain the dynamic link corresponding to the bytecode.

[0078] Exemplarily, the construction unit is used to extract the method description table based on the bytecode; and, according to the dynamic link obtained by the generation unit, and the variable table, method signature, and method exit contained in the method description table, respectively construct the method body instruction model corresponding to the bytecode in the current deployment version package and the method body instruction model corresponding to the bytecode in the latest version package. In one example, the above construction model can also be used to traverse the current deployment version package and the latest version package respectively, determine the impact index of each function package in the current deployment version package, the impact index of the bytecode contained in each function package, and the impact index of each function package in the latest version package, and the impact index of the bytecode contained in each function package; and, according to the impact index of each function package corresponding to the current deployment version package, the impact index of the bytecode contained in each function package, the method body instruction model and the impact index of each function package corresponding to the latest version package, the impact index of the bytecode contained in each function package, and the method body instruction model, respectively construct the structure impact analysis diagram of the current deployment version package and the structure impact analysis diagram of the latest version package.

[0079] Exemplarily, the construction module can be specifically used to extract the bytecodes contained in each function package in the currently deployed version package and the bytecodes contained in each function package in the latest version package in a traversal manner; process the bytecode based on the summary information algorithm to determine the hash code of the bytecode; and determine the impact index of each function package in the currently deployed version package, the impact index of the bytecode contained in each function package, and the impact index of each function package in the latest version package and the impact index of the bytecode contained in each function package according to the hash code of the bytecode.

[0080] For example, the construction module can be used to sort the hash codes of the bytecodes contained in each function package in the currently deployed version package, and determine the set consisting of the sorted hash codes as the first set; sort the hash codes of the bytecodes contained in each function package in the latest version package, and determine the set consisting of the sorted hash codes as the second set; process the first set and the second set respectively based on the summary information algorithm to determine the hash code of the first set and the hash code of the second set; determine the hash code of the first set and the hash code of the second set as the impact index of the corresponding function package in the currently deployed version package and the impact index of the corresponding function package in the latest version package respectively; determine the hash code of the bytecode as the impact index of the corresponding bytecode contained in the corresponding function package in the currently deployed version package and the impact index of the corresponding bytecode contained in the corresponding function package in the latest version package respectively.

[0081] In one example, the above-mentioned determination module is also used to determine at least one function point contained in the modified structure in the current deployment version package based on the modified structure, and determine the at least one determined function point as the first function point; determine at least one function point contained in the modified structure in the latest deployment version package based on the modified structure, and determine the at least one determined function point as the second function point; match the first function point and the second function point in a traversal manner, and determine any function point in the second function point as the modified function point in the modified structure when the front or bytes of any function point in the second function point are different from all the first function points.

[0082] The above-mentioned device for determining the modification function point based on the bytecode can execute Figure 1-Figure 2 The provided method for determining modification function points based on bytecode has corresponding devices and beneficial effects in the method.

[0083] Figure 4 A schematic diagram of the structure of a computer device provided in Embodiment 4 of the present invention is shown in FIG. Figure 4 As shown, the computer device includes a controller 401, a memory 402, an input device 403, and an output device 404; the number of controllers 401 in the computer device can be one or more. Figure 4 A controller 401 is taken as an example; the controller 401, the memory 402, the input device 403 and the output device 404 in the computer device can be connected by a bus or other means. Figure 4 The example of connecting through bus is taken in the following.

[0084] The memory 402 is a computer-readable storage medium that can be used to store software programs, computer executable programs, and modules, such as Figure 1 , Figure 2The program instructions / modules corresponding to the method for determining the modification function point based on the bytecode in the embodiment (for example, the acquisition module 301, the determination module 302, and the construction module 303 in the apparatus for determining the modification function point based on the bytecode). The controller 401 executes various functions and data processing of the computer device by running the software programs, instructions, and modules stored in the memory 402, that is, the method for determining the modification function point based on the bytecode is implemented.

[0085] The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 402 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 402 may further include a memory remotely arranged relative to the controller 401, and these remote memories may be connected to the terminal / server via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0086] The input device 403 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the computer device. The output device 404 may include a display device such as a display screen.

[0087] The embodiment of the present application also provides a storage medium containing computer executable instructions, which, when executed by a computer controller, is used to execute a method for determining a modification function point based on a bytecode, the method comprising: Figure 1 Steps shown.

[0088] Through the above description of the implementation method, the technicians in the relevant field can clearly understand that the present application can be implemented with the help of software and necessary general hardware, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application can be essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0089] It is worth noting that the modules included in the above-mentioned device for determining the modification function points based on bytecode are only divided according to functional logic, but are not limited to the above-mentioned division method. As long as the corresponding functions can be achieved, it is not used to limit the protection scope of this application.

[0090] Note that the above are only preferred embodiments of the present application and the technical principles used. Those skilled in the art will understand that the present application is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the appended claims.

Claims

1. A method for determining a modification function point based on bytecode, characterized in that: include: Obtaining a currently deployed version package and a latest version package, and determining a modified structure of the latest version package relative to the currently deployed version package; According to the currently deployed version package and the latest version package, a method body reference symbol resolution engine is executed to respectively construct method body instruction models corresponding to the bytecodes in the currently deployed version package and the latest version package; According to the method body instruction model, constructing structure impact analysis diagrams of the currently deployed version package and the latest version package respectively; Determining a modification function point in the modified structure according to the structure impact analysis diagram and the modified structure; The method body reference symbol resolution engine is executed according to the currently deployed version package and the latest version package to respectively construct the method body instruction models of the corresponding bytecodes in the currently deployed version package and the latest version package, including: Traversing the currently deployed version package and the latest version package respectively, and determining the bytecodes contained in each function package in the currently deployed version package and the latest version package; Based on the bytecodes contained in each function package in the current deployed version package and the latest version package, a method body reference symbol resolution engine is executed to generate a dynamic link corresponding to the bytecode; According to the bytecode and the dynamic link, respectively construct method body instruction models corresponding to the bytecode in the current deployment version package and the latest version package; The method body reference symbol resolution engine is executed based on the bytecodes contained in each function package in the current deployment version package and the latest version package to generate a dynamic link corresponding to the bytecode, including: Extracting a method description table based on the bytecodes contained in each function package in the currently deployed version package and the bytecodes contained in each function package in the latest version package respectively; Determine the bytecode structure information body of the corresponding bytecode according to the variable table, the bytecode structure total code element table and the constant pool contained in the method description table; Decompiling the bytecode structure information body into bytecode instruction codes; Parsing the bytecode instruction code to obtain a dynamic link corresponding to the bytecode; The step of constructing the method body instruction models of the corresponding bytecodes in the current deployment version package and the latest version package respectively according to the bytecode and the dynamic link includes: Extracting the method description table based on the bytecode; According to the variable table, method signature, and method exit contained in the dynamic link and the method description table, method body instruction models of the corresponding bytecodes in the current deployment version package and the latest version package are constructed respectively.

2. The method according to claim 1, characterized in that The determining of the modified structure of the latest version package relative to the currently deployed version package includes: Traversing the currently deployed version package and the latest version package respectively, and determining the impact index of each function package in the currently deployed version package and the latest version package; According to the impact index of each function package in the current deployed version package and the latest version package, a modification structure of the latest version package relative to the current deployed version package is determined.

3. The method according to claim 2, characterized in that The determining, according to the impact index of each function package in the current deployed version package and the latest version package, a modified structure of the latest version package relative to the current deployed version package includes: Matching the impact index of each function package in the latest version package with the impact index of each function package in the currently deployed version package in a traversal manner; When the impact index of any function package in the latest version package is different from the impact indexes of all function packages in the currently deployed version package, it is determined that the any function package is a modified structure of the latest version package relative to the currently deployed version package.

4. The method according to claim 1, characterized in that: According to the method body instruction model, a structure impact analysis diagram of the currently deployed version package and the latest version package is constructed respectively, including: Traversing the currently deployed version package and the latest version package respectively, determining the impact index of each function package in the currently deployed version package and the latest version package, and the impact index of the bytecode contained in each function package; According to the impact index of each function package, the impact index of the bytecode contained in each function package and the method body instruction model, the structure impact analysis diagrams of the current deployment version package and the latest version package are respectively constructed.

5. The method according to claim 4, characterized in that The determining of the impact index of each function package in the currently deployed version package and the latest version package, and the impact index of the bytecode contained in each function package, includes: Extracting the bytecodes contained in each function package in the currently deployed version package and the bytecodes contained in each function package in the latest version package in a traversal manner; Processing the bytecode based on a summary information algorithm to determine a hash code of the bytecode; The impact index of each function package in the current deployment version package and the latest version package, and the impact index of the bytecode included in each function package are determined respectively according to the hash code of the bytecode.

6. The method according to claim 5, characterized in that The determining, according to the hash code of the bytecode, respectively the impact index of each function package in the current deployed version package and the latest version package, and the impact index of the bytecode contained in each function package, comprises: Sorting the hash codes of the bytecodes contained in each function package in the currently deployed version package, and determining a set consisting of the sorted hash codes as a first set; Sorting the hash codes of the bytecodes included in each function package in the latest version package, and determining a set consisting of the sorted hash codes as a second set; Processing the first set and the second set respectively based on a summary information algorithm to determine a hash code of the first set and a hash code of the second set; Determine the hash code of the first set and the hash code of the second set as the impact index of the corresponding function package in the currently deployed version package and the impact index of the corresponding function package in the latest version package respectively; The hash code of the bytecode is determined as an impact index of the corresponding bytecode contained in the corresponding function package in the currently deployed version package and an impact index of the corresponding bytecode contained in the corresponding function package in the latest version package.

7. The method according to any one of claims 1 to 3, characterized in that: The step of determining the modification function point in the modified structure according to the structure impact analysis diagram and the modified structure includes: Determining at least one function point included in the modified structure in the current deployment version package according to the modified structure, and determining the determined at least one function point as a first function point; Determining at least one function point included in the modified structure in the latest version package according to the modified structure, and determining the determined at least one function point as a second function point; The first function point and the second function point are matched in a traversal manner, and when the front or bytes of any function point in the second function point are different from those of all the first function points, any function point in the second function point is determined to be a modified function point in the modified structure.

8. A device for determining a modification function point based on bytecode, characterized in that: include: A determination module, used to obtain a currently deployed version package and a latest version package, and determine a modified structure of the latest version package relative to the currently deployed version package; A construction module, used to execute a method body reference symbol resolution engine according to the currently deployed version package and the latest version package, and respectively construct method body instruction models corresponding to the bytecodes in the currently deployed version package and the latest version package; The construction module is further used to construct the structure impact analysis diagrams of the current deployment version package and the latest version package respectively according to the method body instruction model; The determining module is further used to determine the modification function point in the modified structure according to the structure impact analysis diagram and the modified structure; Wherein, the construction module includes a traversal unit, a generation unit and a construction unit; The traversal unit is used to traverse the current deployment version package and the latest version package respectively, and determine the bytecodes included in each function package in the current deployment version package and the latest version package; The generating unit is used to execute the method body reference symbol resolution engine based on the bytecodes contained in each function package in the current deployment version package and the latest version package, and generate a dynamic link corresponding to the bytecode; The construction unit is used to construct method body instruction models corresponding to the bytecodes in the current deployment version package and the latest version package respectively according to the bytecodes and the dynamic link; The generating unit is specifically used to extract a method description table based on the bytecodes contained in each function package in the currently deployed version package and the bytecodes contained in each function package in the latest version package; determine the bytecode structure information body of the corresponding bytecode according to the variable table, bytecode structure total code element table and constant pool contained in the method description table; decompile the bytecode structure information body into a bytecode instruction code; parse the bytecode instruction code to obtain a dynamic link corresponding to the bytecode; Among them, the construction unit is specifically used to extract the method description table based on the bytecode; according to the dynamic link and the variable table, method signature, and method exit contained in the method description table, the method body instruction model of the corresponding bytecode in the current deployment version package and the latest version package is constructed respectively.

9. A computer device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for determining a modification function point based on a bytecode as described in any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for determining a modification function point based on a bytecode as described in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Packing deployment method, device, system, electronic equipment and storage media of program

    CN108897571A

  • Metadata updating method and device, electronic equipment and computer readable storage medium

    CN112685433A