[go: up one dir, main page]

CN118502814B - Software modification evaluation method, device, equipment and medium based on byte codes - Google Patents

Software modification evaluation method, device, equipment and medium based on byte codes Download PDF

Info

Publication number
CN118502814B
CN118502814B CN202410962721.4A CN202410962721A CN118502814B CN 118502814 B CN118502814 B CN 118502814B CN 202410962721 A CN202410962721 A CN 202410962721A CN 118502814 B CN118502814 B CN 118502814B
Authority
CN
China
Prior art keywords
mapping table
bytecode
index mapping
target
key part
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202410962721.4A
Other languages
Chinese (zh)
Other versions
CN118502814A (en
Inventor
韩爱生
金华利
原雷
马文哲
丁乔
赵佳钰
张二青
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou New China And Big Polytron Technologies Inc
Original Assignee
Hangzhou New China And Big Polytron Technologies Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou New China And Big Polytron Technologies Inc filed Critical Hangzhou New China And Big Polytron Technologies Inc
Priority to CN202410962721.4A priority Critical patent/CN118502814B/en
Publication of CN118502814A publication Critical patent/CN118502814A/en
Application granted granted Critical
Publication of CN118502814B publication Critical patent/CN118502814B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a software modification evaluation method, device, equipment and medium based on byte codes. The method comprises the following steps: acquiring a target byte code file of a software target version and a byte code file to be evaluated of a to-be-online version; determining the change content of the on-line version to be compared with the target version according to the target byte code file and the byte code file to be evaluated; a potential impact of the modified content is determined and an evaluation report is generated based on the potential impact and the modified content. The embodiment of the invention can improve the evaluation efficiency of byte code modification.

Description

一种基于字节码的软件改动评估方法、装置、设备及介质A bytecode-based software modification assessment method, device, equipment and medium

技术领域Technical Field

本发明涉及软件开发技术领域,尤其涉及一种基于字节码的软件改动评估方法、装置、设备及介质。The present invention relates to the technical field of software development, and in particular to a bytecode-based software modification evaluation method, device, equipment and medium.

背景技术Background Art

在软件开发和维护过程中,代码的改动是不可避免的,尤其当接口层面的代码发生变动时。During software development and maintenance, code changes are inevitable, especially when code at the interface level changes.

传统的静态解析技术往往采取全量分析的方法,即对整个字节码进行全面的解析和分析。然而,这种方法在处理大型或频繁变动的代码库时,效率低下且消耗大量计算资源,无法满足现代软件开发对快速迭代和持续集成的要求。Traditional static analysis technology often adopts the method of full analysis, that is, comprehensive parsing and analysis of the entire bytecode. However, this method is inefficient and consumes a lot of computing resources when dealing with large or frequently changing code bases, and cannot meet the requirements of modern software development for rapid iteration and continuous integration.

发明内容Summary of the invention

本发明提供了一种基于字节码的软件改动评估方法、装置、设备及介质,以提高字节码改动的评估效率。The present invention provides a bytecode-based software modification evaluation method, device, equipment and medium to improve the evaluation efficiency of bytecode modifications.

根据本发明的一方面,提供了一种基于字节码的软件改动评估方法,包括:According to one aspect of the present invention, a bytecode-based software modification assessment method is provided, comprising:

获取软件目标版本的目标字节码文件和待上线版本的待评估字节码文件;Obtain the target bytecode file of the target version of the software and the bytecode file to be evaluated of the version to be launched;

根据所述目标字节码文件和所述待评估字节码文件确定所述待上线版本相对所述目标版本的改动内容;Determine the changes of the to-be-released version relative to the target version according to the target bytecode file and the to-be-evaluated bytecode file;

确定所述改动内容的潜在影响,并根据所述潜在影响和所述改动内容生成评估报告。Determine the potential impact of the modified content, and generate an assessment report based on the potential impact and the modified content.

根据本发明的另一方面,提供了一种基于字节码的软件改动评估装置,包括:According to another aspect of the present invention, there is provided a bytecode-based software modification assessment device, comprising:

获取软件目标版本的目标字节码文件和待上线版本的待评估字节码文件;Obtain the target bytecode file of the target version of the software and the bytecode file to be evaluated of the version to be launched;

根据所述目标字节码文件和所述待评估字节码文件确定所述待上线版本相对所述目标版本的改动内容;Determine the changes of the to-be-released version relative to the target version according to the target bytecode file and the to-be-evaluated bytecode file;

确定所述改动内容的潜在影响,并根据所述潜在影响和所述改动内容生成评估报告。Determine the potential impact of the modified content, and generate an assessment report based on the potential impact and the modified content.

根据本发明的另一方面,提供了一种计算机程序产品,包括计算机程序,所述计算机程序在被处理器执行时实现根据本发明任一实施例所述的基于字节码的软件改动评估方法。According to another aspect of the present invention, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the bytecode-based software modification assessment method according to any embodiment of the present invention is implemented.

根据本发明的另一方面,提供了一种电子设备,所述电子设备包括:According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

至少一个处理器;以及at least one processor; and

与所述至少一个处理器通信连接的存储器;其中,a memory communicatively connected to the at least one processor; wherein,

所述存储器存储有可被所述至少一个处理器执行的计算机程序,所述计算机程序被所述至少一个处理器执行,以使所述至少一个处理器能够执行本发明任一实施例所述的基于字节码的软件改动评估方法。The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the bytecode-based software modification assessment method described in any embodiment of the present invention.

根据本发明的另一方面,提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机指令,所述计算机指令用于使处理器执行时实现本发明任一实施例所述的基于字节码的软件改动评估方法。According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, wherein the computer instructions are used to enable a processor to implement the bytecode-based software modification assessment method described in any embodiment of the present invention when executed.

本发明实施例通过在字节码维度上分析改动内容及其影响,并生成评估报告,在保证改动评估准确性的基础上,相比现有人工为主的评估方式,极大地提高了改动的评估效率。The embodiment of the present invention analyzes the modified content and its impact in the bytecode dimension and generates an evaluation report, thereby greatly improving the modification evaluation efficiency compared to the existing manual evaluation method while ensuring the accuracy of the modification evaluation.

应当理解,本部分所描述的内容并非旨在标识本发明的实施例的关键或重要特征,也不用于限制本发明的范围。本发明的其它特征将通过以下的说明书而变得容易理解。It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

图1是根据本发明一实施例提供的一种基于字节码的软件改动评估方法的流程图;FIG1 is a flow chart of a bytecode-based software modification assessment method according to an embodiment of the present invention;

图2是根据本发明又一实施例提供的一种基于字节码的软件改动评估方法的流程图;FIG2 is a flow chart of a bytecode-based software modification assessment method according to another embodiment of the present invention;

图3是根据本发明又一实施例提供的一种基于字节码的软件改动评估方法的结构示意图;FIG3 is a schematic diagram of the structure of a bytecode-based software modification assessment method according to another embodiment of the present invention;

图4是实现本发明实施例的电子设备的结构示意图。FIG. 4 is a schematic diagram of the structure of an electronic device implementing an embodiment of the present invention.

具体实施方式DETAILED DESCRIPTION

为了使本技术领域的人员更好地理解本发明方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分的实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本发明保护的范围。In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本发明的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

图1为本发明一实施例提供的一种基于字节码的软件改动评估方法的流程图,本实施例可适用于评估人员输入目标字节码文件和待评估字节码文件后,系统自行分析改动内容及其影响后输出评估报告的情况,该方法可以由基于字节码的软件改动评估装置来执行,该装置可以采用硬件和/或软件的形式实现,该装置可配置于具备相应数据处理能力的电子设备中,例如软件开发管理系统。如图1所示,该方法包括:FIG1 is a flow chart of a bytecode-based software modification evaluation method provided by an embodiment of the present invention. This embodiment is applicable to the situation where the evaluator inputs the target bytecode file and the bytecode file to be evaluated, and the system automatically analyzes the content of the modification and its impact and then outputs an evaluation report. The method can be executed by a bytecode-based software modification evaluation device, which can be implemented in the form of hardware and/or software. The device can be configured in an electronic device with corresponding data processing capabilities, such as a software development management system. As shown in FIG1 , the method includes:

S110、获取软件目标版本的目标字节码文件和待上线版本的待评估字节码文件。S110 , obtaining a target bytecode file of the target version of the software and a bytecode file to be evaluated of the version to be launched.

其中,字节码文件包括但不限于.class文件、.jar包、.war文件以及其他JVM编程语言的编译产物。Among them, bytecode files include but are not limited to .class files, .jar packages, .war files, and compilation products of other JVM programming languages.

具体的,软件迭代和版本控制过程中,将软件的已上线版本或基准版本作为目标版本。接收评估人员输入的目标版本的软件编译后的目标字节码文件和待上线版本的软件编译后的待评估字节码文件。Specifically, during the software iteration and version control process, the online version or the baseline version of the software is used as the target version. The target bytecode file compiled from the target version of the software and the bytecode file to be evaluated compiled from the version to be launched input by the evaluator are received.

S120、根据所述目标字节码文件和所述待评估字节码文件确定所述待上线版本相对所述目标版本的改动内容。S120: Determine the changes of the to-be-released version relative to the target version according to the target bytecode file and the to-be-evaluated bytecode file.

其中,改动内容包括关键内容上的改动和非关键内容上的改动。The changes include changes to key content and changes to non-key content.

具体的,使用专门的差异对比工具或算法,比较两个版本的不同字节码文件,从而精确识别出待上线版本相对目标版本的改动内容,例如改动的方法、指令或界面元素。比较的目的是为了识别待上线版本中做了哪些更改,从而评估这些更改可能对系统行为、性能和稳定性产生的影响。这对于确保软件质量、进行回归测试以及识别潜在的风险和问题至关重要。Specifically, use a special difference comparison tool or algorithm to compare the different bytecode files of the two versions, so as to accurately identify the changes in the version to be launched relative to the target version, such as the changed methods, instructions or interface elements. The purpose of the comparison is to identify what changes have been made in the version to be launched, so as to evaluate the impact of these changes on system behavior, performance and stability. This is crucial for ensuring software quality, performing regression testing, and identifying potential risks and problems.

S130、确定所述改动内容的潜在影响,并根据所述潜在影响和所述改动内容生成评估报告。S130: Determine the potential impact of the modified content, and generate an assessment report based on the potential impact and the modified content.

具体的,基于预先配置的评估规则,根据改动内容及其改动类型,来评估这些改动内容在系统性能、功能逻辑、安全性、兼容性等各方面的潜在影响。Specifically, based on pre-configured evaluation rules, the potential impact of these changes on system performance, functional logic, security, compatibility, etc. is evaluated according to the changes and their types.

在系统性能方面:评估改动内容是否可能导致性能下降或提升,如循环结构的优化、内存分配的变化等。In terms of system performance: evaluate whether the changes may lead to performance degradation or improvement, such as optimization of loop structure, changes in memory allocation, etc.

在功能逻辑方面:评估改动是否可能引入新的逻辑错误、死循环、异常处理等。In terms of functional logic: evaluate whether the changes may introduce new logical errors, dead loops, exception handling, etc.

在安全性方面:评估改动是否可能增加安全风险,如未经检查的用户输入、敏感信息的暴露等。In terms of security: Assess whether the changes may increase security risks, such as unchecked user input, exposure of sensitive information, etc.

在兼容性方面:评估改动是否可能破坏与旧版本的兼容性,或影响其他依赖此部分的代码。In terms of compatibility: evaluate whether the changes may break compatibility with older versions or affect other code that depends on this part.

在确定改动内容及其潜在影响后,系统会根据这两部分内容以及其他必要的参考信息,生成一份评估报告。对于该评估报告,系统会将其推送给相应的评估人员或直接在操作终端上进行显示。After determining the content of the change and its potential impact, the system will generate an assessment report based on these two parts and other necessary reference information. For this assessment report, the system will push it to the corresponding assessor or display it directly on the operation terminal.

本发明实施例通过在字节码维度上分析改动内容及其影响,并生成评估报告,在保证改动评估准确性的基础上,相比现有人工为主的评估方式,极大地提高了改动的评估效率。The embodiment of the present invention analyzes the modified content and its impact in the bytecode dimension and generates an evaluation report, thereby greatly improving the modification evaluation efficiency compared to the existing manual evaluation method while ensuring the accuracy of the modification evaluation.

图2为本发明又一实施例提供的一种基于字节码的软件改动评估方法的流程图,本实施例在上述实施例的基础上进行了优化改进。如图2所示,该方法包括:FIG2 is a flowchart of a bytecode-based software modification evaluation method provided by another embodiment of the present invention. This embodiment is optimized and improved on the basis of the above embodiment. As shown in FIG2, the method includes:

S210、获取软件目标版本的目标字节码文件和待上线版本的待评估字节码文件。S210: Obtain the target bytecode file of the target version of the software and the bytecode file to be evaluated of the version to be launched.

S220、基于所述目标字节码文件中各关键部分的识别结果,建立所述目标字节码文件的第一索引映射表;基于所述待评估字节码文件中各关键部分的识别结果,建立所述待评估字节码文件的第二索引映射表。S220: Based on the recognition results of the key parts in the target bytecode file, establish a first index mapping table of the target bytecode file; based on the recognition results of the key parts in the bytecode file to be evaluated, establish a second index mapping table of the bytecode file to be evaluated.

S230、根据所述第一索引映射表和所述第二索引映射表确定所述待上线版本相对所述目标版本在关键部分上的改动内容。S230: Determine changes in key parts of the to-be-released version relative to the target version according to the first index mapping table and the second index mapping table.

其中,关键部分是软件的字节码中被认为对软件功能、软件性能有重大影响的部分,包括但不限于字节码中的方法定义、类定义、关键字段、常量池中的字符串和类引用等部分。索引映射表至少包含每一关键部分的标识符和该关键部分在字节码文件中的具体位置。The key part is the part of the bytecode of the software that is considered to have a significant impact on the software function and performance, including but not limited to method definitions, class definitions, key fields, strings in the constant pool, and class references in the bytecode. The index mapping table contains at least the identifier of each key part and the specific location of the key part in the bytecode file.

具体的,本发明提供了三种关键部分的识别方案,分别为人工识别、静态识别和动态识别。这三种识别方式可以择一使用,也可以结合使用:Specifically, the present invention provides three key part recognition schemes, namely manual recognition, static recognition and dynamic recognition. These three recognition methods can be used one by one or in combination:

在人工识别中,由具有丰富经验的开发人员或架构师根据代码的结构和设计模式来判断哪些部分是程序的骨架和核心,并将识别结果输入到系统中。In manual identification, experienced developers or architects determine which parts are the skeleton and core of the program based on the structure and design patterns of the code, and input the identification results into the system.

在静态识别中,系统使用静态代码分析工具来识别关键的类、方法和变量等部分,得到关键部分的识别结果,这些工具可以分析代码的复杂性、依赖关系和其他指标,帮助定位关键部分。In static identification, the system uses static code analysis tools to identify key classes, methods, variables and other parts, and obtains the identification results of key parts. These tools can analyze the complexity, dependencies and other indicators of the code to help locate the key parts.

在动态识别中,系统通过软件运行时的性能监控和调试,观察哪些代码部分在执行过程中被频繁调用或消耗大量资源,从而判断其是否关键,得到关键部分的识别结果。In dynamic identification, the system monitors and debugs the performance of the software at runtime to observe which code parts are frequently called or consume a lot of resources during execution, so as to determine whether they are critical and obtain the identification results of the critical parts.

针对当前字节码文件(目前字节码文件或待识别字节码文件),系统根据其识别结果为每个关键部分均创建一个唯一的标识符,并将关键部分的标识符与其在当前文件中的位置信息一一关联,形成当前字节码文件的索引映射表(第一索引映射表或第二索引映射表),预处理结束。For the current bytecode file (the current bytecode file or the bytecode file to be identified), the system creates a unique identifier for each key part based on its identification results, and associates the identifier of the key part with its position information in the current file one by one to form an index mapping table of the current bytecode file (the first index mapping table or the second index mapping table), and the preprocessing is completed.

如果没有关键部分的索引,比较过程可能是逐字节或逐行进行的,非常耗时。但是如果有关键部分的索引,系统可以直接定位到字节码中的关键部分,并比较两个字节码文件在关键部分上的变化,无需比较两个字节码文件在非关键部分上的变化,这大大提高了差异检测的速度。If there is no index of the key part, the comparison process may be performed byte by byte or line by line, which is very time-consuming. However, if there is an index of the key part, the system can directly locate the key part in the bytecode and compare the changes in the key part of the two bytecode files without comparing the changes in the non-key part of the two bytecode files, which greatly improves the speed of difference detection.

可选的,所述根据所述第一索引映射表和所述第二索引映射表确定所述待上线版本相对所述目标版本在关键部分上的改动内容包括:Optionally, determining the changes in the key part of the to-be-released version relative to the target version according to the first index mapping table and the second index mapping table includes:

根据所述第一索引映射表和所述第二索引映射表确定非共有关键部分;Determine a non-common key portion according to the first index mapping table and the second index mapping table;

根据所述第一索引映射表和所述第二索引映射表确定共有关键部分以及所述共有关键部分在所述目标字节码文件的第一位置和在所述待评估字节码文件的第二位置;Determine a common key portion according to the first index mapping table and the second index mapping table and a first position of the common key portion in the target bytecode file and a second position of the bytecode file to be evaluated;

根据所述目标字节码文件中第一位置的字节码和所述待评估字节码文件中第二位置的字节码确定所述共有关键部分的改动内容;Determining the modified content of the common key part according to the bytecode at the first position in the target bytecode file and the bytecode at the second position in the bytecode file to be evaluated;

将所述共有关键部分的改动内容和非共有关键部分确定为所述待上线版本相对所述目标版本在关键部分上的改动内容。The modified content of the shared key part and the non-shared key part are determined as the modified content of the to-be-released version in the key part relative to the target version.

其中,共有关键部分是在第一索引映射表和第二索引映射表中均出现的关键部分。非共有关键部分是只在第一索引映射表或只在第二索引映射表中出现的关键部分,分为新增关键部分和删除关键部分两类。The shared key part is a key part that appears in both the first index mapping table and the second index mapping table. The non-shared key part is a key part that appears only in the first index mapping table or only in the second index mapping table, and is divided into two categories: a newly added key part and a deleted key part.

具体的,差异检测时会首先查询第一和第二索引映射表,确定两个字节码的共有和非共有关键部分。对于后者,可毫无疑问地确定其是待上线版本相对目标版本在关键部分上的改动内容。对于前者,则需要进一步分析:Specifically, when detecting differences, the first and second index mapping tables are queried to determine the common and non-common key parts of the two bytecodes. For the latter, it can be determined without a doubt that it is the change in the key part of the version to be launched relative to the target version. For the former, further analysis is required:

查询第一索引映射表和第二索引映射表,确定共有关键部分在目标字节码文件的第一位置,例如目标字节码文件的第2-4行,共有关键部分在待评估字节码文件的第二位置,例如待评估字节码文件的第5-6行。将第一位置的字节码和第二位置的字节码进行比对,若对比结果显示字节码完全一致,则确定该共有关键部分未改进,不属于改动内容;若对比结果显示字节码不完全一致,则确定该共有关键部分有改进,属于改动内容。The first index mapping table and the second index mapping table are queried to determine that the common key part is at the first position of the target bytecode file, such as lines 2-4 of the target bytecode file, and the common key part is at the second position of the bytecode file to be evaluated, such as lines 5-6 of the bytecode file to be evaluated. The bytecode at the first position is compared with the bytecode at the second position. If the comparison result shows that the bytecodes are completely consistent, it is determined that the common key part has not been improved and is not a modified content; if the comparison result shows that the bytecodes are not completely consistent, it is determined that the common key part has been improved and is a modified content.

此外,基本索引还在可以提供改动的精确位置,使得评估人员能够快速理解哪些具体的代码行或指令发生了变化,例如:In addition, basic indexing provides the precise location of changes, allowing assessors to quickly understand which specific lines of code or instructions have changed, for example:

1、直接定位改动点:1. Directly locate the change point:

当识别出有改动的字节码部分后,系统会利用索引中的位置信息直接定位到改动的具体代码行或指令,并显示给评估人员,这样评估人员可以迅速看到哪些代码被修改。When the modified bytecode section is identified, the system uses the location information in the index to directly locate the specific line of code or instruction that was modified and displays it to the evaluator, so that the evaluator can quickly see which code has been modified.

2、对比改动前后的内容:2. Compare the content before and after the change:

系统可以通过索引快速提取出改动前后的代码片段,并显示给评估人员,以便评估人员可以清晰地看到哪些代码被添加、删除或修改,从而准确理解改动的具体内容。The system can quickly extract code snippets before and after the changes through indexing and display them to the evaluator so that the evaluator can clearly see which codes have been added, deleted or modified, and accurately understand the specific content of the changes.

3、可视化展示改动:3. Visual display changes:

利用基本索引,系统可以将改动部分以高亮或其他形式在代码编辑器中显示出来,这样评估人员可以直观地看到改动点,提高分析的准确性。Using basic indexes, the system can highlight the changed parts or display them in other forms in the code editor, so that evaluators can intuitively see the changed points and improve the accuracy of the analysis.

S240、从所述第一索引映射表和所述第二索引映射表中获取所述改动内容对应的辅助评估元数据;将所述改动内容、所述辅助评估元数据和其他参考数据输入改动影响预测模型,得到所述改动内容的潜在影响程度和潜在影响类型。S240. Obtain auxiliary evaluation metadata corresponding to the changed content from the first index mapping table and the second index mapping table; input the changed content, the auxiliary evaluation metadata and other reference data into a change impact prediction model to obtain a potential impact degree and potential impact type of the changed content.

其中,潜在影响程度包括轻微影响、中等影响和严重影响。潜在影响类型包括:性能下降、功能错误和安全性问题。其他参考数据包括如历史改动数据、错误记录等。所述辅助评估元数据包括下述至少一种:方法的调用关系、方法的依赖信息和类的继承关系。The potential impact levels include minor impact, medium impact, and severe impact. Potential impact types include performance degradation, functional errors, and security issues. Other reference data include historical change data, error records, etc. The auxiliary evaluation metadata includes at least one of the following: method call relationships, method dependency information, and class inheritance relationships.

具体的,索引不仅包含了关键部分的位置信息,还可以包含其他有助于差异检测的辅助评估元数据,例如关键部分的哈希值、修改时间、方法的调用关系、方法的依赖信息和类的继承关系等。在改动检测过程中,可以利用这些元数据来进一步优化比对策略以及后续的影响评估,例如通过比较哈希值可以快速判断某个关键部分是否发生了变化,而无需进行实际的字节码比较。在影响评估过程中,辅助评估元数据中记录的历史改动记录和错误日志可以帮助预测出当前改动可能引入的潜在问题,从而提前进行风险防范;辅助评估元数据中记录的以往测试信息和改动点的影响范围,可以帮助确定哪些测试用例需要重新执行,以确保改动没有引入新的问题;当某个方法有改进时,辅助评估元数据中记录的调用关系和依赖信息可以帮助快速理解这个方法被哪些其他方法调用,以及它调用了哪些方法,以便快速评估出改动可能影响的范围。Specifically, the index not only contains the location information of the key part, but also other auxiliary evaluation metadata that helps with difference detection, such as the hash value of the key part, modification time, method call relationship, method dependency information, and class inheritance relationship. In the process of change detection, these metadata can be used to further optimize the comparison strategy and subsequent impact assessment. For example, by comparing the hash value, you can quickly determine whether a key part has changed without the need for actual bytecode comparison. In the impact assessment process, the historical change records and error logs recorded in the auxiliary evaluation metadata can help predict potential problems that may be introduced by the current change, so as to prevent risks in advance; the previous test information and the impact range of the change point recorded in the auxiliary evaluation metadata can help determine which test cases need to be re-executed to ensure that the change does not introduce new problems; when a method is improved, the call relationship and dependency information recorded in the auxiliary evaluation metadata can help quickly understand which other methods this method is called by, and which methods it calls, so as to quickly assess the possible impact of the change.

根据历史改动内容及其实际影响程度和实际影响类型,生成训练样本及其影响程度标签和影响类型标签。选择合适的机器学习模型(如决策树、随机森林、神经网络等),通过训练样本对其进行训练,并使用交叉验证等技术来评估模型的性能,训练完成得到改动影响预测模型。在实际应用中,可以使用该模型来预测新改动对系统的潜在影响,从而辅助开发团队做出更明智的决策。实际预测时,将改动内容、所述辅助评估元数据和其他参考数据输入影响预测模型,模型预测并输出对改动内容的潜在影响程度和潜在影响类型。Generate training samples and their impact labels and impact type labels based on historical changes and their actual impact levels and types. Select a suitable machine learning model (such as decision tree, random forest, neural network, etc.), train it with training samples, and use cross-validation and other techniques to evaluate the performance of the model. After training, obtain the change impact prediction model. In practical applications, the model can be used to predict the potential impact of new changes on the system, thereby assisting the development team in making more informed decisions. During actual prediction, the change content, the auxiliary evaluation metadata and other reference data are input into the impact prediction model, and the model predicts and outputs the potential impact level and potential impact type on the change content.

S250、获取所述改动内容的依赖网络图和扩散路径图;获取所述潜在影响对应的历史修复措施。S250, obtaining a dependency network diagram and a diffusion path diagram of the modified content; and obtaining historical repair measures corresponding to the potential impact.

S260、基于预设的报告模板,根据所述依赖网络图、所述扩散路径图、所述改动内容、所述辅助评估元数据、所述潜在影响和所述历史修复措施生成图文评估报告。S260. Based on a preset report template, generate a graphic assessment report according to the dependency network diagram, the diffusion path diagram, the changed content, the auxiliary assessment metadata, the potential impacts and the historical repair measures.

其中,扩散路径和依赖网络可以帮助评估人员快速理解改动的方法被哪些其他方法调用,以及它调用了哪些方法。这样,评估人员可以评估出改动可能影响的范围。Among them, diffusion paths and dependency networks can help evaluators quickly understand which other methods the modified method is called by and which methods it calls. In this way, evaluators can assess the possible impact of the change.

具体的,根据第一索引映射表和所述第二索引映射表获取改动内容的辅助评估元数据,根据辅助评估元数据中记载的方法调用关系、方法依赖信息、类继承关系等辅助评估信息,确定改动内容的依赖网络和扩散路径,并生成对应的依赖网络图和扩散路径图。查找数据库中与当前改动内容相似或一致的历史改动内容,并确定历史改动内容的历史修复措施。将依赖网络图、扩散路径图、改动内容、辅助评估元数据、潜在影响和历史修复措施逐一填入报告模板的相应的位置,生成图文评估报告。Specifically, the auxiliary evaluation metadata of the changed content is obtained according to the first index mapping table and the second index mapping table, and the dependency network and diffusion path of the changed content are determined according to the auxiliary evaluation information such as the method call relationship, method dependency information, class inheritance relationship, etc. recorded in the auxiliary evaluation metadata, and the corresponding dependency network diagram and diffusion path diagram are generated. Search the database for historical changes that are similar or consistent with the current changes, and determine the historical repair measures for the historical changes. Fill in the dependency network diagram, diffusion path diagram, changed content, auxiliary evaluation metadata, potential impacts and historical repair measures into the corresponding positions of the report template one by one to generate a graphic evaluation report.

本发明实施例结合多种信息数据生成图文评估报告,提高了图文评估报告的参考价值,便于评估人员快速理解改动内容并做出决策。The embodiment of the present invention combines a variety of information data to generate a graphic evaluation report, thereby improving the reference value of the graphic evaluation report and facilitating evaluators to quickly understand the modified content and make decisions.

图3为本发明又一实施例提供的一种基于字节码的软件改动评估装置的结构示意图。如图3所示,该装置包括:FIG3 is a schematic diagram of the structure of a bytecode-based software modification assessment device provided by another embodiment of the present invention. As shown in FIG3 , the device includes:

文件获取模块310,用于获取软件目标版本的目标字节码文件和待上线版本的待评估字节码文件;The file acquisition module 310 is used to acquire the target bytecode file of the target version of the software and the bytecode file to be evaluated of the version to be launched;

改动确定模块320,用于根据所述目标字节码文件和所述待评估字节码文件确定所述待上线版本相对所述目标版本的改动内容;A change determination module 320, configured to determine the changes of the to-be-released version relative to the target version according to the target bytecode file and the to-be-evaluated bytecode file;

报告生成模块330,用于确定所述改动内容的潜在影响,并根据所述潜在影响和所述改动内容生成评估报告。The report generation module 330 is used to determine the potential impact of the modified content and generate an evaluation report based on the potential impact and the modified content.

本发明实施例所提供的基于字节码的软件改动评估装置可执行本发明任意实施例所提供的基于字节码的软件改动评估方法,具备执行方法相应的功能模块和有益效果。The bytecode-based software modification evaluation device provided in the embodiment of the present invention can execute the bytecode-based software modification evaluation method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

可选的,改动确定模块320包括:Optionally, the modification determination module 320 includes:

第一索引建立单元,用于基于所述目标字节码文件中各关键部分的识别结果,建立所述目标字节码文件的第一索引映射表;A first index establishing unit, configured to establish a first index mapping table of the target bytecode file based on the recognition results of each key part in the target bytecode file;

第二索引建立单元,用于基于所述待评估字节码文件中各关键部分的识别结果,建立所述待评估字节码文件的第二索引映射表;A second index establishing unit, configured to establish a second index mapping table of the bytecode file to be evaluated based on the recognition results of each key part in the bytecode file to be evaluated;

改动确定单元,用于根据所述第一索引映射表和所述第二索引映射表确定所述待上线版本相对所述目标版本在关键部分上的改动内容。A change determination unit is used to determine the changes in the key parts of the version to be launched relative to the target version according to the first index mapping table and the second index mapping table.

可选的,改动确定单元具体用于:根据所述第一索引映射表和所述第二索引映射表确定非共有关键部分;Optionally, the change determination unit is specifically used to: determine the non-common key part according to the first index mapping table and the second index mapping table;

根据所述第一索引映射表和所述第二索引映射表确定共有关键部分以及所述共有关键部分在所述目标字节码文件的第一位置和在所述待评估字节码文件的第二位置;Determine a common key portion according to the first index mapping table and the second index mapping table and a first position of the common key portion in the target bytecode file and a second position of the bytecode file to be evaluated;

根据所述目标字节码文件中第一位置的字节码和所述待评估字节码文件中第二位置的字节码确定所述共有关键部分的改动内容;Determining the modified content of the common key part according to the bytecode at the first position in the target bytecode file and the bytecode at the second position in the bytecode file to be evaluated;

将所述共有关键部分的改动内容和非共有关键部分确定为所述待上线版本相对所述目标版本在关键部分上的改动内容。The modified content of the shared key part and the non-shared key part are determined as the modified content of the to-be-released version in the key part relative to the target version.

可选的,报告生成模块330包括;Optionally, the report generation module 330 includes;

分析数据获取单元,用于从所述第一索引映射表和所述第二索引映射表中获取所述改动内容对应的辅助评估元数据;An analysis data acquisition unit, configured to acquire auxiliary evaluation metadata corresponding to the modified content from the first index mapping table and the second index mapping table;

影响确定单元,用于将所述改动内容、所述辅助评估元数据和其他参考数据输入改动影响预测模型,得到所述改动内容的潜在影响程度和潜在影响类型。The impact determination unit is used to input the modified content, the auxiliary evaluation metadata and other reference data into the modification impact prediction model to obtain the potential impact degree and potential impact type of the modified content.

可选的,报告生成模块330包括:Optionally, the report generation module 330 includes:

分析图获取单元,用于获取所述改动内容的依赖网络图和扩散路径图;An analysis diagram acquisition unit, used to acquire a dependency network diagram and a diffusion path diagram of the modified content;

措施获取单元,用于获取所述潜在影响对应的历史修复措施;A measure acquisition unit, used to acquire historical repair measures corresponding to the potential impact;

报告生成单元,用于基于预设的报告模板,根据所述依赖网络图、所述扩散路径图、所述改动内容、所述辅助评估元数据、所述潜在影响和所述历史修复措施生成图文评估报告。A report generation unit is used to generate a graphic evaluation report based on a preset report template, according to the dependency network diagram, the diffusion path diagram, the changed content, the auxiliary evaluation metadata, the potential impact and the historical repair measures.

可选的,所述辅助评估元数据包括下述至少一种:方法的调用关系、方法的依赖信息和类的继承关系。Optionally, the auxiliary evaluation metadata includes at least one of the following: method calling relationship, method dependency information, and class inheritance relationship.

进一步说明的基于字节码的软件改动评估装置也可执行本发明任意实施例所提供的基于字节码的软件改动评估方法,具备执行方法相应的功能模块和有益效果。The bytecode-based software modification assessment device further described can also execute the bytecode-based software modification assessment method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

图4示出了可以用来实施本发明的实施例的电子设备40的结构示意图。电子设备旨在表示各种形式的数字计算机,诸如,膝上型计算机、台式计算机、工作台、个人数字助理、服务器、刀片式服务器、大型计算机、和其它适合的计算机。电子设备还可以表示各种形式的移动装置,诸如,个人数字处理、蜂窝电话、智能电话、可穿戴设备(如头盔、眼镜、手表等)和其它类似的计算装置。本文所示的部件、它们的连接和关系、以及它们的功能仅仅作为示例,并且不意在限制本文中描述的和/或者要求的本发明的实现。FIG4 shows a block diagram of an electronic device 40 that can be used to implement an embodiment of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and/or required herein.

如图4所示,电子设备40包括至少一个处理器41,以及与至少一个处理器41通信连接的存储器,如只读存储器(ROM)42、随机访问存储器(RAM)43等,其中,存储器存储有可被至少一个处理器执行的计算机程序,处理器41可以根据存储在只读存储器(ROM)42中的计算机程序或者从存储单元48加载到随机访问存储器(RAM)43中的计算机程序,来执行各种适当的动作和处理。在RAM 43中,还可存储电子设备40操作所需的各种程序和数据。处理器41、ROM 42以及RAM 43通过总线44彼此相连。输入/输出(I/O)接口45也连接至总线44。As shown in FIG4 , the electronic device 40 includes at least one processor 41, and a memory connected to the at least one processor 41 in communication, such as a read-only memory (ROM) 42, a random access memory (RAM) 43, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 41 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 42 or the computer program loaded from the storage unit 48 to the random access memory (RAM) 43. In the RAM 43, various programs and data required for the operation of the electronic device 40 can also be stored. The processor 41, the ROM 42, and the RAM 43 are connected to each other via a bus 44. An input/output (I/O) interface 45 is also connected to the bus 44.

电子设备40中的多个部件连接至I/O接口45,包括:输入单元46,例如键盘、鼠标等;输出单元47,例如各种类型的显示器、扬声器等;存储单元48,例如磁盘、光盘等;以及通信单元49,例如网卡、调制解调器、无线通信收发机等。通信单元49允许电子设备40通过诸如因特网的计算机网络和/或各种电信网络与其他设备交换信息/数据。A number of components in the electronic device 40 are connected to the I/O interface 45, including: an input unit 46, such as a keyboard, a mouse, etc.; an output unit 47, such as various types of displays, speakers, etc.; a storage unit 48, such as a disk, an optical disk, etc.; and a communication unit 49, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 49 allows the electronic device 40 to exchange information/data with other devices through a computer network such as the Internet and/or various telecommunication networks.

处理器41可以是各种具有处理和计算能力的通用和/或专用处理组件。处理器41的一些示例包括但不限于中央处理单元(CPU)、图形处理单元(GPU)、各种专用的人工智能(AI)计算芯片、各种运行机器学习模型算法的处理器、数字信号处理器(DSP)、以及任何适当的处理器、控制器、微控制器等。处理器41执行上文所描述的各个方法和处理,例如基于字节码的软件改动评估方法。The processor 41 may be a variety of general and/or special processing components with processing and computing capabilities. Some examples of the processor 41 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 41 executes the various methods and processes described above, such as the bytecode-based software modification assessment method.

在一些实施例中,基于字节码的软件改动评估方法可被实现为计算机程序,其被有形地包含于计算机可读存储介质,例如存储单元48。在一些实施例中,计算机程序的部分或者全部可以经由ROM 42和/或通信单元49而被载入和/或安装到电子设备40上。当计算机程序加载到RAM 43并由处理器41执行时,可以执行上文描述的基于字节码的软件改动评估方法的一个或多个步骤。备选地,在其他实施例中,处理器41可以通过其他任何适当的方式(例如,借助于固件)而被配置为执行基于字节码的软件改动评估方法。In some embodiments, the bytecode-based software modification assessment method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 48. In some embodiments, part or all of the computer program may be loaded and/or installed on the electronic device 40 via the ROM 42 and/or the communication unit 49. When the computer program is loaded into the RAM 43 and executed by the processor 41, one or more steps of the bytecode-based software modification assessment method described above may be performed. Alternatively, in other embodiments, the processor 41 may be configured to execute the bytecode-based software modification assessment method in any other appropriate manner (e.g., by means of firmware).

本文中以上描述的系统和技术的各种实施方式可以在数字电子电路系统、集成电路系统、场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、芯片上系统的系统(SOC)、负载可编程逻辑设备(CPLD)、计算机硬件、固件、软件、和/或它们的组合中实现。这些各种实施方式可以包括:实施在一个或者多个计算机程序中,该一个或者多个计算机程序可在包括至少一个可编程处理器的可编程系统上执行和/或解释,该可编程处理器可以是专用或者通用可编程处理器,可以从存储系统、至少一个输入装置、和至少一个输出装置接收数据和指令,并且将数据和指令传输至该存储系统、该至少一个输入装置、和该至少一个输出装置。Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and/or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

用于实施本发明的方法的计算机程序可以采用一个或多个编程语言的任何组合来编写。这些计算机程序可以提供给通用计算机、专用计算机或其他可编程数据处理装置的处理器,使得计算机程序当由处理器执行时使流程图和/或框图中所规定的功能/操作被实施。计算机程序可以完全在机器上执行、部分地在机器上执行,作为独立软件包部分地在机器上执行且部分地在远程机器上执行或完全在远程机器或服务器上执行。Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions/operations specified in the flow chart and/or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

在本发明的上下文中,计算机可读存储介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的计算机程序。计算机可读存储介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。备选地,计算机可读存储介质可以是机器可读信号介质。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

为了提供与用户的交互,可以在电子设备上实施此处描述的系统和技术,该电子设备具有:用于向用户显示信息的显示装置(例如,CRT(阴极射线管)或者LCD(液晶显示器)监视器);以及键盘和指向装置(例如,鼠标或者轨迹球),用户可以通过该键盘和该指向装置来将输入提供给电子设备。其它种类的装置还可以用于提供与用户的交互;例如,提供给用户的反馈可以是任何形式的传感反馈(例如,视觉反馈、听觉反馈、或者触觉反馈);并且可以用任何形式(包括声输入、语音输入或者、触觉输入)来接收来自用户的输入。To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

可以将此处描述的系统和技术实施在包括后台部件的计算系统(例如,作为数据服务器)、或者包括中间件部件的计算系统(例如,应用服务器)、或者包括前端部件的计算系统(例如,具有图形用户界面或者网络浏览器的用户计算机,用户可以通过该图形用户界面或者该网络浏览器来与此处描述的系统和技术的实施方式交互)、或者包括这种后台部件、中间件部件、或者前端部件的任何组合的计算系统中。可以通过任何形式或者介质的数字数据通信(例如,通信网络)来将系统的部件相互连接。通信网络的示例包括:局域网(LAN)、广域网(WAN)、区块链网络和互联网。The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

计算系统可以包括客户端和服务器。客户端和服务器一般远离彼此并且通常通过通信网络进行交互。通过在相应的计算机上运行并且彼此具有客户端-服务器关系的计算机程序来产生客户端和服务器的关系。服务器可以是云服务器,又称为云计算服务器或云主机,是云计算服务体系中的一项主机产品,以解决了传统物理主机与VPS服务中,存在的管理难度大,业务扩展性弱的缺陷。A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

应该理解,可以使用上面所示的各种形式的流程,重新排序、增加或删除步骤。例如,本发明中记载的各步骤可以并行地执行也可以顺序地执行也可以不同的次序执行,只要能够实现本发明的技术方案所期望的结果,本文在此不进行限制。It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

上述具体实施方式,并不构成对本发明保护范围的限制。本领域技术人员应该明白的是,根据设计要求和其他因素,可以进行各种修改、组合、子组合和替代。任何在本发明的精神和原则之内所作的修改、等同替换和改进等,均应包含在本发明保护范围之内。The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (7)

1.一种基于字节码的软件改动评估方法,其特征在于,所述方法包括:1. A bytecode-based software modification assessment method, characterized in that the method comprises: 获取软件目标版本的目标字节码文件和待上线版本的待评估字节码文件;Obtain the target bytecode file of the target version of the software and the bytecode file to be evaluated of the version to be launched; 根据所述目标字节码文件和所述待评估字节码文件确定所述待上线版本相对所述目标版本的改动内容;Determine the changes of the to-be-released version relative to the target version according to the target bytecode file and the to-be-evaluated bytecode file; 确定所述改动内容的潜在影响,并根据所述潜在影响和所述改动内容生成评估报告;Determine the potential impact of the changes and generate an assessment report based on the potential impact and the changes; 其中,所述根据所述目标字节码文件和所述待评估字节码文件确定所述待上线版本相对所述目标版本的改动内容包括:The step of determining the changes of the to-be-released version relative to the target version according to the target bytecode file and the to-be-evaluated bytecode file includes: 基于所述目标字节码文件中各关键部分的识别结果,建立所述目标字节码文件的第一索引映射表;Based on the recognition results of the key parts in the target bytecode file, establishing a first index mapping table of the target bytecode file; 基于所述待评估字节码文件中各关键部分的识别结果,建立所述待评估字节码文件的第二索引映射表;Based on the recognition results of the key parts in the bytecode file to be evaluated, a second index mapping table of the bytecode file to be evaluated is established; 根据所述第一索引映射表和所述第二索引映射表确定所述待上线版本相对所述目标版本在关键部分上的改动内容;关键部分是软件的字节码中被认为对软件功能、软件性能有重大影响的部分;Determine, according to the first index mapping table and the second index mapping table, the changes in the key part of the version to be launched relative to the target version; the key part is the part of the bytecode of the software that is considered to have a significant impact on the software function and software performance; 其中,所述根据所述第一索引映射表和所述第二索引映射表确定所述待上线版本相对所述目标版本在关键部分上的改动内容包括:The determining, according to the first index mapping table and the second index mapping table, the changes in the key parts of the to-be-released version relative to the target version includes: 根据所述第一索引映射表和所述第二索引映射表确定非共有关键部分;非共有关键部分是只在第一索引映射表或只在第二索引映射表中出现的关键部分;Determine a non-shared key part according to the first index mapping table and the second index mapping table; the non-shared key part is a key part that only appears in the first index mapping table or only appears in the second index mapping table; 根据所述第一索引映射表和所述第二索引映射表确定共有关键部分以及所述共有关键部分在所述目标字节码文件的第一位置和在所述待评估字节码文件的第二位置;共有关键部分是在第一索引映射表和第二索引映射表中均出现的关键部分;Determine a common key portion according to the first index mapping table and the second index mapping table and the common key portion at a first position in the target bytecode file and at a second position in the bytecode file to be evaluated; the common key portion is a key portion that appears in both the first index mapping table and the second index mapping table; 根据所述目标字节码文件中第一位置的字节码和所述待评估字节码文件中第二位置的字节码确定所述共有关键部分的改动内容;Determining the modified content of the common key part according to the bytecode at the first position in the target bytecode file and the bytecode at the second position in the bytecode file to be evaluated; 将所述共有关键部分的改动内容和非共有关键部分确定为所述待上线版本相对所述目标版本在关键部分上的改动内容。The modified content of the shared key part and the non-shared key part are determined as the modified content of the to-be-released version in the key part relative to the target version. 2.根据权利要求1所述的方法,其特征在于,所述确定所述改动内容的潜在影响包括:2. The method according to claim 1, wherein determining the potential impact of the modified content comprises: 从所述第一索引映射表和所述第二索引映射表中获取所述改动内容对应的辅助评估元数据;Acquire auxiliary evaluation metadata corresponding to the modified content from the first index mapping table and the second index mapping table; 将所述改动内容、所述辅助评估元数据和其他参考数据输入改动影响预测模型,得到所述改动内容的潜在影响程度和潜在影响类型。The modified content, the auxiliary evaluation metadata and other reference data are input into a modification impact prediction model to obtain the potential impact degree and potential impact type of the modified content. 3.根据权利要求2所述的方法,其特征在于,所述辅助评估元数据包括下述至少一种:方法的调用关系、方法的依赖信息和类的继承关系。3. The method according to claim 2 is characterized in that the auxiliary evaluation metadata includes at least one of the following: method calling relationship, method dependency information and class inheritance relationship. 4.根据权利要求2所述的方法,其特征在于,所述根据所述潜在影响和所述改动内容生成评估报告包括:4. The method according to claim 2, wherein generating an assessment report according to the potential impact and the modified content comprises: 获取所述改动内容的依赖网络图和扩散路径图;Obtaining a dependency network diagram and a diffusion path diagram of the modified content; 获取所述潜在影响对应的历史修复措施;Obtain historical remediation measures corresponding to the potential impacts; 基于预设的报告模板,根据所述依赖网络图、所述扩散路径图、所述改动内容、所述辅助评估元数据、所述潜在影响和所述历史修复措施生成图文评估报告。Based on a preset report template, a graphic assessment report is generated according to the dependency network diagram, the diffusion path diagram, the changed content, the auxiliary assessment metadata, the potential impact and the historical repair measures. 5.一种基于字节码的软件改动评估装置,其特征在于,所述装置包括:5. A bytecode-based software modification assessment device, characterized in that the device comprises: 文件获取模块,用于获取软件目标版本的目标字节码文件和待上线版本的待评估字节码文件;A file acquisition module is used to acquire the target bytecode file of the target version of the software and the bytecode file to be evaluated of the version to be launched; 改动确定模块,用于根据所述目标字节码文件和所述待评估字节码文件确定所述待上线版本相对所述目标版本的改动内容;A change determination module, used to determine the changes of the to-be-released version relative to the target version according to the target bytecode file and the to-be-evaluated bytecode file; 报告生成模块,用于确定所述改动内容的潜在影响,并根据所述潜在影响和所述改动内容生成评估报告;A report generation module, used to determine the potential impact of the modified content and generate an evaluation report based on the potential impact and the modified content; 其中,所述改动确定模块包括:Wherein, the modification determination module includes: 第一索引建立单元,用于基于所述目标字节码文件中各关键部分的识别结果,建立所述目标字节码文件的第一索引映射表;A first index establishing unit, configured to establish a first index mapping table of the target bytecode file based on the recognition results of each key part in the target bytecode file; 第二索引建立单元,用于基于所述待评估字节码文件中各关键部分的识别结果,建立所述待评估字节码文件的第二索引映射表;A second index establishing unit, configured to establish a second index mapping table of the bytecode file to be evaluated based on the recognition results of each key part in the bytecode file to be evaluated; 改动确定单元,用于根据所述第一索引映射表和所述第二索引映射表确定所述待上线版本相对所述目标版本在关键部分上的改动内容;关键部分是软件的字节码中被认为对软件功能、软件性能有重大影响的部分;a change determination unit, configured to determine the changes of the to-be-released version in a key part relative to the target version according to the first index mapping table and the second index mapping table; the key part is a part of the bytecode of the software that is considered to have a significant impact on the software function and software performance; 其中,改动确定单元具体用于:根据所述第一索引映射表和所述第二索引映射表确定非共有关键部分;非共有关键部分是只在第一索引映射表或只在第二索引映射表中出现的关键部分;根据所述第一索引映射表和所述第二索引映射表确定共有关键部分以及所述共有关键部分在所述目标字节码文件的第一位置和在所述待评估字节码文件的第二位置;共有关键部分是在第一索引映射表和第二索引映射表中均出现的关键部分;根据所述目标字节码文件中第一位置的字节码和所述待评估字节码文件中第二位置的字节码确定所述共有关键部分的改动内容;将所述共有关键部分的改动内容和非共有关键部分确定为所述待上线版本相对所述目标版本在关键部分上的改动内容。Among them, the change determination unit is specifically used to: determine the non-common key part according to the first index mapping table and the second index mapping table; the non-common key part is the key part that only appears in the first index mapping table or only in the second index mapping table; determine the common key part and the common key part at the first position of the target bytecode file and the second position of the bytecode file to be evaluated according to the first index mapping table and the second index mapping table; the common key part is the key part that appears in both the first index mapping table and the second index mapping table; determine the changed content of the common key part according to the bytecode at the first position in the target bytecode file and the bytecode at the second position in the bytecode file to be evaluated; determine the changed content of the common key part and the non-common key part as the changed content of the key part of the version to be launched relative to the target version. 6.一种电子设备,其特征在于,所述电子设备包括:6. An electronic device, characterized in that the electronic device comprises: 至少一个处理器;以及at least one processor; and 与所述至少一个处理器通信连接的存储器;其中,a memory communicatively connected to the at least one processor; wherein, 所述存储器存储有可被所述至少一个处理器执行的计算机程序,所述计算机程序被所述至少一个处理器执行,以使所述至少一个处理器能够执行权利要求1-4中任一项所述的基于字节码的软件改动评估方法。The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the bytecode-based software modification assessment method according to any one of claims 1 to 4. 7.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机指令,所述计算机指令用于使处理器执行时实现权利要求1-4中任一项所述的基于字节码的软件改动评估方法。7. A computer-readable storage medium, characterized in that the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the bytecode-based software modification assessment method according to any one of claims 1 to 4 when executed.
CN202410962721.4A 2024-07-18 2024-07-18 Software modification evaluation method, device, equipment and medium based on byte codes Active CN118502814B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410962721.4A CN118502814B (en) 2024-07-18 2024-07-18 Software modification evaluation method, device, equipment and medium based on byte codes

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410962721.4A CN118502814B (en) 2024-07-18 2024-07-18 Software modification evaluation method, device, equipment and medium based on byte codes

Publications (2)

Publication Number Publication Date
CN118502814A CN118502814A (en) 2024-08-16
CN118502814B true CN118502814B (en) 2024-10-25

Family

ID=92245118

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410962721.4A Active CN118502814B (en) 2024-07-18 2024-07-18 Software modification evaluation method, device, equipment and medium based on byte codes

Country Status (1)

Country Link
CN (1) CN118502814B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108874652A (en) * 2017-05-09 2018-11-23 北京京东尚科信息技术有限公司 It tests and assesses certainly the method, apparatus estimated and electronic equipment for software
CN109117164A (en) * 2018-06-22 2019-01-01 北京大学 Micro services update method and system based on key element difference analysis

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8655886B1 (en) * 2011-03-25 2014-02-18 Google Inc. Selective indexing of content portions
CN105608346A (en) * 2015-12-25 2016-05-25 北京奇虎科技有限公司 ELF file protection method and system based on ARM instruction virtualization
CN109299004B (en) * 2018-06-22 2020-08-25 北京大学 Method and system for analyzing difference of key elements
CN109032706B (en) * 2018-07-16 2022-10-11 百度在线网络技术(北京)有限公司 Intelligent contract execution method, device, equipment and storage medium
CN112506569B (en) * 2020-12-14 2023-06-20 杭州趣链科技有限公司 A bytecode execution method, bytecode execution device and terminal equipment
EP4232913A1 (en) * 2020-12-17 2023-08-30 Huawei Technologies Co., Ltd. Versioned relational dataset management

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108874652A (en) * 2017-05-09 2018-11-23 北京京东尚科信息技术有限公司 It tests and assesses certainly the method, apparatus estimated and electronic equipment for software
CN109117164A (en) * 2018-06-22 2019-01-01 北京大学 Micro services update method and system based on key element difference analysis

Also Published As

Publication number Publication date
CN118502814A (en) 2024-08-16

Similar Documents

Publication Publication Date Title
CN117851575B (en) Large language model question-answer optimization method and device, electronic equipment and storage medium
CN116089258B (en) Data migration test method, device, equipment, storage medium and program product
CN116107589A (en) Automatic compiling method, device, device and storage medium of software code
CN118820089A (en) Code processing method, device, electronic device and medium
CN111966578A (en) Automatic evaluation method for android compatibility defect repair effect
CN116303013A (en) Source code analysis method, device, electronic equipment and storage medium
CN116108453A (en) Logical vulnerability detection method, device, equipment and storage medium
CN114610608A (en) Test case processing method and device, electronic equipment and storage medium
CN118502814B (en) Software modification evaluation method, device, equipment and medium based on byte codes
CN116401113B (en) Environment verification method, device and medium for accelerator card with heterogeneous many-core architecture
CN118940266A (en) Data testing method and device, and electronic equipment
CN116737121A (en) Software development management method, device, system, equipment and storage medium
CN116483735A (en) Method, device, storage medium and equipment for impact analysis of code changes
CN116226673A (en) Training method of buffer region vulnerability recognition model, vulnerability detection method and device
CN116185874A (en) Test report generation method, device, equipment and storage medium
CN115080382A (en) Code testing method, device, equipment and medium
CN115292178A (en) Test data searching method, device, storage medium and terminal
CN119358551B (en) Word stock generation method, device, equipment and medium
CN118276933B (en) Method, device, equipment and medium for processing software compatibility problem
CN116955504B (en) Data processing method and device, electronic equipment and storage medium
CN116383834B (en) Detection method for source code vulnerability detection tool abnormality and related equipment
CN111274146B (en) Code measurement method, device, electronic equipment and medium
CN119416779A (en) Log field extraction method, device, equipment and medium based on machine learning
CN118350485A (en) Training method, device, equipment and medium of log error judgment model
CN118585448A (en) A test case generation method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20240816

Assignee: Hangzhou Haolian Intelligent Technology Co.,Ltd.

Assignor: Hangzhou new China and the big Polytron Technologies Inc.

Contract record no.: X2024980042943

Denomination of invention: A bytecode based software modification evaluation method, device, equipment, and medium

Granted publication date: 20241025

License type: Common License

Record date: 20241231

EE01 Entry into force of recordation of patent licensing contract