Method, device, electronic device and storage medium for generating code change information
By comparing new and old code segments and call relationship chains, code change information is generated, which solves the problem of systematic, global and intelligent code change impact assessment in large-scale software updates, and improves the efficiency and accuracy of software development.
Patent Information
- Application Number
- CN202210068454.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-20
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2042-01-20
AI Technical Summary
During large-scale software program updates, existing technologies make it difficult to systematically, globally, and intelligently assess the impact of code changes, resulting in high R&D costs, numerous risks, and incomplete bug discovery.
By comparing the old and new codes, the changed code segments are determined, the affected modules are identified based on the call relationship chain, and comprehensive code change information is generated, including development and maintenance related information, to provide a comprehensive impact assessment.
It enables in-depth exploration and comprehensive evaluation of code changes, helping to quickly and accurately discover anomalies, reduce the overall cost of the development and testing process, and improve software development efficiency.
Smart Images

Figure CN114416569B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, in particular to the field of computer software management, and more particularly to a method, device, electronic device, and storage medium for generating code change information. Background Art
[0002] Today, internet-connected electronic products have become an integral part of human life, and the software programs within them have provided users with services for years. Over the years, these programs have been constantly updated. As program size increases, the cost of iteration becomes higher. Even small code modifications can have significant impacts, including many hidden, high-risk changes that pose risks to subsequent program operation. Summary of the Invention
[0003] The present disclosure provides a method, device, electronic device, and storage medium for generating code change information, which can intelligently provide comprehensive code change information to users.
[0004] According to one aspect of the present disclosure, a method for generating code change information is provided, which may include the following steps:
[0005] Compare the acquired new code with the stored old code to determine the changed code segment;
[0006] Determine the affected modules based on the changed code segment;
[0007] Code change information is generated based on the development-related information of the changed code segment and the maintenance-related information of the affected module.
[0008] According to another aspect of the present disclosure, a device for generating code change information is provided, the device comprising:
[0009] A comparison module is used to compare the acquired new code with the stored old code to determine the changed code segment;
[0010] Determine module, used to determine the affected module according to the changed code segment;
[0011] The generating module is used to generate code change information based on the development related information of the changed code segment and the maintenance related information of the affected module.
[0012] According to another aspect of the present disclosure, there is provided an electronic device, comprising:
[0013] at least one processor; and
[0014] a memory communicatively connected to the at least one processor; wherein,
[0015] The memory stores instructions that can be executed by the at least one processor. The instructions are executed by the at least one processor to enable the at least one processor to perform the method in any embodiment of the present disclosure.
[0016] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided. The computer instructions are used to cause a computer to execute the method in any embodiment of the present disclosure.
[0017] According to another aspect of the present disclosure, a computer program product is provided, including a computer program / instruction, wherein the computer program / instruction implements the method in any embodiment of the present disclosure when executed by a processor.
[0018] The technology disclosed in this disclosure first determines the changed code segments by comparing the old and new codes, and then determines the affected modules based on the changed code segments. This process can deeply explore all changes brought about by the code change; then, the relevant information of the changed code segments and the relevant information of the affected modules are combined to generate code change information. This step helps analyze and evaluate the impact of the change on the entire program, helping relevant personnel to quickly and accurately discover anomalies caused by code changes.
[0019] 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 disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The accompanying drawings are provided to facilitate a better understanding of the present invention and do not constitute a limitation of the present disclosure.
[0021] Figure 1 is a flowchart of a method for generating code change information according to an embodiment of the present disclosure;
[0022] Figure 2 is a schematic diagram of the relationship between program codes and modules according to an embodiment of the present disclosure;
[0023] Figure 3 is a schematic diagram of a process for determining affected modules according to an embodiment of the present disclosure;
[0024] Figure 4 is a structural diagram of a device for generating code change information according to an embodiment of the present disclosure;
[0025] Figure 5 is a structural diagram of a determination module according to an embodiment of the present disclosure;
[0026] Figure 6The present invention is a block diagram of an electronic device according to a method for generating code change information according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0027] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0028] The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The term "at least one" in this article means any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C, can mean including any one or more elements selected from the set consisting of A, B, and C. The terms "first" and "second" in this article refer to multiple similar technical terms and distinguish them, and do not mean to limit the order or to limit to only two. For example, the first feature and the second feature refer to two categories / two features. The first feature can be one or more, and the second feature can also be one or more.
[0029] In addition, numerous specific details are provided in the following detailed description to better illustrate the present disclosure. Those skilled in the art will appreciate that the present disclosure can be practiced without certain specific details. In some instances, methods, means, components, and circuits well known to those skilled in the art are not described in detail in order to highlight the main points of the present disclosure.
[0030] In recent years, with the popularization of the Internet and the increase in mobile devices, almost everyone has a smart device. Smart devices involve many different types of software programs, such as apps based on smart devices, which can provide users with a variety of different services. With the development of the Internet industry, many apps have been providing services to users for more than 10 years. Over the years, the scale of program products has continued to increase. On this basis, the cost of product iteration will become increasingly high, and the impact will be greater, which will directly lead to increased R&D costs. Generally speaking, we evaluate the costs brought about by program product updates from the following aspects:
[0031] In terms of scale: Generally speaking, lightweight products have tens of thousands of lines of code, while super apps have millions or more. The larger the program, the greater the workload required during the update process.
[0032] R&D: Generally speaking, a lightweight product can be developed by just a few people, but a super APP requires hundreds or thousands of R&D personnel. The coordination and communication between these personnel are costs.
[0033] Quality: For super apps, due to their diverse functionality, large staff size, and high collaboration costs, changes to some modules present low risk for most coordinating modules. However, there are also situations where impacts may not be perceived in advance due to miscommunication. The feature development process requires multiple testing sessions. Each testing session fixes known bugs and also impacts related dependencies, leading to high regression testing costs.
[0034] Detectability: For super apps, the prerequisite for detection or evaluation is understanding the program. The more thorough the understanding of the program, the higher the cost. However, as a program development step that has become highly streamlined, there are no clear standards for the evaluation and verification of the impact of program updates. The effectiveness of previous evaluations and verifications can only be tested by the subsequent program operation, which is a post-effect verification step.
[0035] Impact: For super apps, the more basic the modules, the greater the impact, the greater the risk of the changes, and the higher the cost of subsequent repairs.
[0036] In summary, the quality and cost of software development (and updates) are influenced by many factors. The larger the scale, the higher the coordination costs and the resulting risk discovery costs. This is especially true when modifying foundational modules, as the impact is widespread and feedback is often less clear, making it easy to overlook some of the hidden impacts. Systematizing the assessment and analysis process and establishing automated detection based on the causes of risk and cost can significantly improve software development engineering efficiency.
[0037] Generally speaking, after R&D personnel complete the development of the updated code, they will submit it for testing. After receiving the newly developed program package, testers will follow certain steps to test and find problems (bugs), and then feedback to the R&D personnel. After receiving the feedback, the R&D personnel will fix the bugs, obtain a new fixed version, and send it to the testers. The testers will test the new fixed version and close the bug if they are sure that the bug has been fixed. This cycle will repeat until all bugs are fixed, and the product corresponding to the final fixed version will be released to users. In summary, the above process requires testers to manually discover bugs based on their experience and understanding of the product, and then feedback to the developers to finally obtain the fixed program product. However, in the following situations, bugs that are easy to be overlooked will occur:
[0038] First, due to the large code size, some new developers may not be familiar with the functions and may unintentionally create relatively hidden bugs that affect the normal operation of the product.
[0039] Second, some functional changes did not result in changes to the business presentation layer, resulting in testers not discovering hidden bugs.
[0040] Third, some functional points were indirectly affected by changes in basic modules, but because the entry point was deep, they were not discovered to have been indirectly affected and were not tested;
[0041] Fourth, during the testing process, there are many other factors that may affect the test results of bugs, such as the system's public parameters, network parameters, cookies, and the switching process between the test environment, development environment, and online environment, which may make bugs difficult to detect.
[0042] Fifth, during the communication process between R&D and testers, R&D will introduce and review the program to the testers. However, due to the limitations of R&D's expressiveness and testers' comprehension, some problems may arise due to differences in understanding, thus affecting bug discovery.
[0043] Sixth, changes in one module often affect multiple modules, but R&D personnel or testers do not have a global understanding of the affected modules and only know the direction they are responsible for, which leads to test omissions.
[0044] On this basis, there is an urgent need for a systematic, global, and intelligent code change assessment system to conduct a comprehensive and combined analysis of the code changes generated by R&D personnel during the bug repair (or function optimization) process, and to conduct an intelligent and comprehensive assessment of the impact of code changes; based on the evaluation results, effective and purposeful testing can ultimately be achieved to quickly discover anomalies caused by changes and reduce the overall cost of the development and testing process.
[0045] According to an embodiment of the present disclosure, a method for generating code change information is provided. Figure 1 FIG. 1 is a flow chart of a method for generating code change information according to an embodiment of the present disclosure, which specifically includes:
[0046] S101: Compare the acquired new code with the stored old code to determine the changed code segment;
[0047] In one example, when a user submits code, the evaluation solution (system) is triggered. Specifically, different analysis platforms can be used to identify, parse, and analyze different development languages. In this step, the submitted code is compared with the corresponding old code to determine the changes between the two code generations.
[0048] S102: Determine the affected module based on the changed code segment;
[0049] In one example, the affected modules include the business module to which the changed code belongs and the associated modules affected by the changed code. Specifically, the relationship between the program code and the module is as follows: Figure 2 As shown, the modules of the program include m1, m2, m3, and m4, wherein m1 includes code segments F11, F12, and F13, m2 includes code segment F21, m3 includes code segment F31, and m4 includes code segment F41. The affected modules can be determined by the calling relationship between programs or modules.
[0050] S103: Generate code change information based on the development-related information of the changed code segment and the maintenance-related information of the affected module.
[0051] In one example, development-related information of a changed code segment, such as information representing details related to the change, and maintenance-related information of the affected modules are combined to generate comprehensive code change information.
[0052] Using the above example, the submitted new code can be compared with the stored old code to generate logical change information, including development-related information for the changed code segment. Changes at the interface level can then be tracked to identify the affected modules and obtain maintenance-related information for the affected modules. Ultimately, comprehensive code change information is obtained. This information allows for in-depth exploration of all aspects of the new code's impact, effectively assessing its impact. This helps relevant personnel accurately and thoroughly identify problems in advance, allowing them to address them accordingly, reducing the probability of errors during subsequent code execution and improving overall code development efficiency.
[0053] The above example can be used to optimize the software development process, especially for large-scale software, and can be used to support infrastructure optimization.
[0054] In one embodiment, a method for determining an affected module is provided. Figure 3 FIG. 1 is a flow chart of determining affected modules according to an embodiment of the present disclosure. Specifically, the affected modules are determined through the following steps:
[0055] S301: Determine the business module to which the changed code segment belongs;
[0056] In one example, Figure 2 As shown, the changed code segment is F11 (the changed code segment may be a function, a loop or a constant in the code segment, which is not specifically limited here), and it is determined that the business module to which it belongs is m1.
[0057] S302: Obtain the call relationship chain of the business module;
[0058] In one example, the calling relationship chain of the business module is obtained. The calling relationship chain mainly represents the calling relationship of the business module or the code in the business module, such as Figure 2 As shown, there are 4 call chains related to m1. One is that code F31 in the m3 module calls code F11 in m1, one is that code F11 in m1 calls code F13, and one is that code F12 in m1 is called by code F21 in the m2 module, and then code F21 is called by code F41 in the m4 module.
[0059] S303: Determine the associated module from the modules on the call relationship chain;
[0060] In one example, the associated module includes a directly associated first module and an indirectly associated second module, and the step of determining the associated module specifically includes:
[0061] A first module that directly calls the business module is determined from the modules on the call relationship chain, and then a second module that indirectly calls the business module is determined from the modules on the call relationship chain. Finally, the first module and the second module are determined as associated modules.
[0062] In one example, the changed code is F11. Through the call relationship chain, it is determined that the change of code F11 will have a direct impact on code F31. Therefore, the m3 module to which code F31 belongs is determined as the first module directly called;
[0063] In one example, the changed code is F13. Through the call relationship chain, it is determined that the change of code F13 will have a direct impact on code F11, so m1 is determined as the first module directly called; and the change of code F13 will have an indirect impact on code F31, so m3 is determined as the second module indirectly called;
[0064] In one example, the changed code is F12. Through the call relationship chain, it is determined that the change of code F12 will have a direct impact on code F21, so m2 is determined as the first module directly called; and the change of code F12 will have an indirect impact on code F41, so m4 is determined as the second module indirectly called;
[0065] In one example, the changed code is F21. Through the call relationship chain, it is determined that the change of code F21 will have a direct impact on code F41, so m4 is determined as the first module directly called.
[0066] Using this approach, based on the dependencies in the call chain, we identify the first module directly affected by a direct call and the second module indirectly affected by an indirect call, combining them into a cohesive module. By leveraging the calls or dependencies between programs and modules, we can deeply explore and comprehensively capture all affected cohesive modules. This approach can also be used to capture modules with deeper functional access points or less obvious dependencies, ensuring that information about modules affected by code changes is not missed.
[0067] S301: Determine the business module and the associated module as affected modules.
[0068] In one example, if the change code is F21, the business module it belongs to is m2, and the associated module is m4, then these two modules are merged to obtain the affected modules. This solution allows for efficient, accurate, and comprehensive changes to all modules involved in the code change, ensuring that no affected modules are missed, thus paving the way for further operations.
[0069] In one example, before step S103, the step also includes obtaining development-related information of the changed code segment, wherein the development-related information includes development project information and / or developer information; the development project information is all relevant information about the development code, specifically including: development task number, old code submission time, new code submission time or at least one of the changed code segment content; the developer information is relevant information about all personnel related to the development, including: at least one of coding personnel information, programmer information, program tester information, and development responsible person information. Among them, the relevant information of the personnel involved includes personnel name, work number, business direction, business focus, contact information, etc. By adopting the above method, all detailed information related to the updated code can be fully known, and corresponding data preparation is made for generating comprehensive and accurate code change information and sending the corresponding code change information to the corresponding staff.
[0070] In one example, before step S103, the process also includes obtaining maintenance-related information of the affected module, wherein the maintenance-related information includes module ownership information and / or maintenance personnel information; the module ownership information includes: at least one of platform information or business direction information; the maintenance personnel information includes: at least one of module person in charge information, module tester information, or module maintainer information. The relevant information of the personnel involved includes personnel name, work number, business direction, business focus, contact information, etc. By adopting the above method, the relevant maintenance information and personnel information of the affected modules can be fully obtained, and the corresponding data preparation is made for generating comprehensive and accurate code change information and sending the corresponding code change information to the corresponding staff.
[0071] In one example, after obtaining the code change information, the process also includes: receiving a preview request for the code change information, wherein the preview request includes the identity information of the previewer; then, extracting the first target information from the code change information based on the preview request; and finally, displaying the first target information to the previewer. Specifically, the preview request for the code change information can be explicit or implicit. The explicit one can be obtained by the relevant staff by clicking a special button or key; the implicit one can be automatically displayed when certain relevant personnel perform specific operations. For example, when a developer submits code, the code change information is generated immediately after the code is uploaded. Then, based on the identity information of the developer, the relevant first target information is extracted from the code change information. The relevant first target information includes but is not limited to the specific content of the code change that the developer is concerned about, such as the function analysis involved in the change, and the relevant personnel of the affected module, etc. It also includes the affected module, such as displaying "has an impact on the m1 module." After extracting the first target information, it can be flexibly displayed to relevant personnel to prompt the impact of the code change. It can be displayed directly on the upload page, or the display entrance of the first target information can be displayed at the code change point. The specific details can be displayed through the corresponding specific operations. Similarly, during the quality inspection process, the quality inspectors (reviewers) can also flexibly display the relevant first target information through the above method. Through the above example, a flexible display method is designed for the personnel who will actively handle the new code, that is, the display is based on the operations of such personnel. Through this display method, all information related to the new code can be received, helping such personnel to better complete the processing tasks related to the new code.
[0072] In one example, after obtaining the code change information, it also includes: obtaining the correspondence between the system modules, module-related personnel and concerns; based on the correspondence, determining the relevant personnel corresponding to the affected module and the concerns of the relevant personnel; based on the concerns of the relevant personnel, extracting the second target information from the code change information; and sending the second target information to the relevant personnel. Specifically, obtain the relevant information of all modules in the system to which the new code belongs, including the relevant personnel and the concerns of the relevant personnel, wherein the system module includes all affected modules. Then, after determining the affected modules, determine the corresponding relevant personnel and concerns from the relevant information of all the above modules, wherein the specific information of the relevant personnel is shown in the following table:
[0073] Table 1 Schematic diagram of module responsible persons relationship
[0074]
[0075] For example, if the m1 module is determined to be affected, it can be learned that the relevant persons in charge of the module are Zhang Yi and Li Yi; then, based on the relevant information of the relevant personnel, their focus can be confirmed, and pre-set focus can also be obtained. For example, it is pre-set that Li Yi, the test person in charge of the m1 module, is concerned about the relevant information of the m1 module and the relevant information of the m2 module. Then, based on the focus, the second target information is extracted, such as extracting all information related to the m1 module and the m2 module from the code change information, and then the extracted second target information is actively sent to the corresponding personnel (i.e., Li Yi). It should be noted here that the sending method is not limited to email, and can also be through other forms, such as other WeChat notifications, etc. Through the above method, a proactive display method is designed for relevant personnel who will not actively operate on the new code, that is, these personnel do not need to perform any operations, that is, they will be proactively informed of the code change information and its impact through emails, text notifications, etc. Using this method, the personnel responsible for maintenance can obtain information related to their own business brought about by the code change in a more timely manner, and make timely assessments and consider whether to perform relevant follow-up operations.
[0076] In one example, the above solution can be implemented by evaluating an operating system, which includes the following modules:
[0077] (1) Event monitoring module: When the user submits the code, the system is triggered.
[0078] (2) Module relationship configuration module: Execute the above solution to obtain development-related information and maintain the specific steps of related information, including determining the module's ownership, such as module name, R&D manager, test manager, department, etc.
[0079] (3) Impact analysis module: Execute the steps related to the generation of code change information, specifically including: comparing the new code submitted by the user with the old code that has been stored in the library, determining the change points, finding the code's ownership relationship based on the change points, finding all related modules through the call relationship, obtaining all relevant information of the related modules, and generating code change information; marking directly affected modules or indirectly affected modules, and further marking the relationship between the responsible persons of all related modules, such as whether they are from the same department, etc.; generating a report based on the code change information in a predetermined format. It should be noted that code comparison can be implemented based on the existing code version management system, such as comparing the changes between two codes in the same code repository, the same file, and the same function.
[0080] (IV) Impact Prompt Module: In the above solution, the relevant steps of displaying the first target information according to the preview request are specifically divided into two parts: 1) In response to the code submission action of the R&D personnel, the impact of the current modification is prompted; 2) In response to the reviewer's review of the code, there is a display entry at the code change point to display the impact details.
[0081] (5) Impact Notification Module: Executes the step of actively sending the second target information to relevant personnel in the above solution, so that the change information and impact information can be actively or automatically combined into one and sent to relevant personnel; such as the test manager, R&D manager, etc.
[0082] like Figure 4 As shown, an embodiment of the present disclosure provides a device 400 for generating code change information, the device comprising:
[0083] Comparison module 401, used to compare the acquired new code with the stored old code to determine the changed code segment;
[0084] A determination module 402 is configured to determine an affected module based on the changed code segment;
[0085] The generating module 403 is configured to generate code change information based on the development-related information of the changed code segment and the maintenance-related information of the affected module.
[0086] like Figure 5 As shown, in an embodiment of the present disclosure, a determination module 402 is provided, which includes:
[0087] A business module determining unit 501 is used to determine the business module to which the changed code segment belongs;
[0088] The relationship chain acquisition unit 502 is used to acquire the call relationship chain of the business module;
[0089] An associated module determining unit 503 is configured to determine an associated module from the modules on the call relationship chain;
[0090] The affected module determining unit 504 determines the service module and the associated module as affected modules.
[0091] According to the above device, the association module determination unit is configured to:
[0092] Determine the first module that directly calls the business module from the modules on the call relationship chain;
[0093] Determine, from the modules on the call relationship chain, a second module that indirectly calls the business module;
[0094] The first module and the second module are determined as associated modules.
[0095] According to the above device, before the generation module, it also includes:
[0096] A first acquiring unit is configured to acquire development-related information of the changed code segment, wherein the development-related information includes development project information and / or developer information;
[0097] The development project information includes at least one of: a development task number, an old code submission time, a new code submission time, or a changed code segment content;
[0098] The developer information includes at least one of: coder information, programmer information, program tester information, and development responsible person information.
[0099] According to the above device, before the generation module, it also includes:
[0100] A second acquiring unit is configured to acquire maintenance-related information of the affected module, wherein the maintenance-related information includes module ownership information and / or maintenance personnel information;
[0101] The module ownership information includes: at least one of the platform information or the business direction information;
[0102] The maintenance personnel information includes at least one of: module person in charge information, module tester information or module maintainer information.
[0103] The device for generating the code change information is further used to:
[0104] receiving a preview request for the code change information, wherein the preview request includes identity information of a previewer;
[0105] extracting first target information from the code change information according to the preview request;
[0106] The first target information is presented to the previewing person.
[0107] The device for generating the code change information is further used to:
[0108] Obtain the correspondence between system modules, module-related personnel and focus points;
[0109] According to the corresponding relationship, determine the relevant personnel corresponding to the affected module and the focus of the relevant personnel;
[0110] extracting second target information from the code change information according to the concerns of the relevant personnel;
[0111] The second target information is sent to the relevant person.
[0112] The functions of each module in each device of the embodiment of the present disclosure can be found in the corresponding description of the above method and will not be repeated here.
[0113] In the technical solutions disclosed herein, the acquisition, storage, and application of user personal information involved comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0114] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0115] Figure 6 A schematic block diagram of an example electronic device 600 that can be used to implement embodiments of the present disclosure is shown. 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 assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are provided as examples only and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0116] like Figure 6 As shown, the device 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. Various programs and data required for the operation of the device 600 can also be stored in the RAM 603. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0117] Various components in device 600 are connected to I / O interface 605, including an input unit 606, such as a keyboard, mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a magnetic disk, optical disk, etc.; and a communication unit 609, such as a network card, modem, wireless communication transceiver, etc. The communication unit 609 allows device 600 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0118] The computing unit 601 can be a variety of general-purpose and / or specialized processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 601 performs the various methods and processes described above, such as the method for generating code change information. For example, in some embodiments, the method for generating code change information can be implemented as a computer software program that is tangibly contained in a machine-readable medium, such as the storage unit 608. In some embodiments, part or all of the computer program can be loaded and / or installed on the device 600 via the ROM 602 and / or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the computing unit 601, one or more steps of the method for generating code change information described above can be performed. Alternatively, in other embodiments, the computing unit 601 can be configured to perform the method for generating code change information by any other appropriate means (e.g., by means of firmware).
[0119] Various embodiments of the systems and techniques described 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), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes 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.
[0120] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0121] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can 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.
[0122] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer 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 pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0123] The systems and techniques described herein can be implemented in a computing system that includes back-end 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 front-end components (e.g., a user computer having 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 back-end components, middleware components, or front-end components. The components of the system can 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), and the Internet.
[0124] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact through a communication network. The client-server relationship arises through computer programs running on the respective computers and having a client-server relationship with each other. The server may be a cloud server, a server in a distributed system, or a server integrated with a blockchain.
[0125] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not a limitation herein.
[0126] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the scope of protection of this disclosure.
Claims
1. A method for generating code change information, comprising: Compare the acquired new code with the stored old code to determine the changed code segment; Determining the affected modules based on the changed code segment; wherein the affected modules include the business module to which the changed code segment belongs and associated modules on a call relationship chain of the business module; the associated modules include a first module that directly calls the business module and a second module that indirectly calls the business module; the call relationship chain is used to represent the call relationship of the business module or the call relationship of the code in the business module; Generate code change information based on the development-related information of the changed code segment and the maintenance-related information of the affected module; Obtaining a correspondence between system modules, module-related personnel, and focus points based on the new code; wherein the system modules include all modules of the system to which the new code belongs, and the affected modules are in the system modules; Determining, based on the corresponding relationship, relevant personnel corresponding to the affected modules and the concerns of the relevant personnel; wherein the concerns of the relevant personnel include system modules that the relevant personnel are responsible for and / or system modules that the relevant personnel are concerned about; extracting second target information from the code change information according to the concerns of the relevant personnel; The second target information is sent to the relevant personnel.
2. The method according to claim 1, before generating the code change information based on the development-related information of the changed code segment and the maintenance-related information of the affected module, further comprising: Acquiring development-related information of the changed code segment, wherein the development-related information includes development project information and / or developer information; The development project information includes at least one of: a development task number, an old code submission time, a new code submission time, or a changed code segment content; The developer information includes at least one of: coder information, programmer information, program tester information, and development responsible person information.
3. The method according to claim 1, before generating the code change information based on the development-related information of the changed code segment and the maintenance-related information of the affected module, further comprising: Acquiring maintenance-related information of the affected module, wherein the maintenance-related information includes module ownership information and / or maintenance personnel information; The module ownership information includes: at least one of platform information or business direction information; The maintenance personnel information includes at least one of: module person in charge information, module tester information or module maintainer information.
4. The method according to claim 1, further comprising: receiving a preview request for the code change information, wherein the preview request includes identity information of a previewer; extracting first target information from the code change information according to the preview request; The first target information is presented to the previewing person.
5. A device for generating code change information, comprising: A comparison module is used to compare the acquired new code with the stored old code to determine the changed code segment; a determination module configured to determine affected modules based on the changed code segment; wherein the affected modules include the business module to which the changed code segment belongs and associated modules in a call relationship chain of the business module; the associated modules include a first module that directly calls the business module and a second module that indirectly calls the business module; the call relationship chain is used to represent the call relationship of the business module or the call relationship of the code in the business module; A generating module, configured to generate code change information based on the development-related information of the changed code segment and the maintenance-related information of the affected module; The device for generating code change information is further used to: Obtaining a correspondence between system modules, module-related personnel, and focus points based on the new code; wherein the system modules include all modules of the system to which the new code belongs, and the affected modules are in the system modules; Determining, based on the corresponding relationship, relevant personnel corresponding to the affected modules and the concerns of the relevant personnel; wherein the concerns of the relevant personnel include system modules that the relevant personnel are responsible for and / or system modules that the relevant personnel are concerned about; extracting second target information from the code change information according to the concerns of the relevant personnel; The second target information is sent to the relevant personnel.
6. The apparatus according to claim 5, further comprising: A first acquiring unit is configured to acquire development-related information of the changed code segment, wherein the development-related information includes development project information and / or developer information; The development project information includes at least one of: a development task number, an old code submission time, a new code submission time, or a changed code segment content; The developer information includes at least one of: coder information, programmer information, program tester information, and development responsible person information.
7. The apparatus according to claim 5, further comprising: A second acquiring unit is configured to acquire maintenance-related information of the affected module, wherein the maintenance-related information includes module ownership information and / or maintenance personnel information; The module ownership information includes: at least one of platform information or business direction information; The maintenance personnel information includes at least one of: module person in charge information, module tester information or module maintainer information.
8. The device according to claim 5, further used for: receiving a preview request for the code change information, wherein: The preview request includes the identity information of the preview person; extracting first target information from the code change information according to the preview request; The first target information is presented to the previewing person.
9. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 4.
10. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-4.
11. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Devops architecture change iteration method and device, computer equipment and storage medium
CN111414157A
Code difference detection method and device
CN113900962A