Method, device and equipment for analyzing change code influence range and storage medium

By comparing the change code with the original code and combining historical call records, the target system use cases affected by the change code is determined, and the problem of inability to detect the impact of code changes on system use cases in the existing technology is solved, and efficient and accurate impact analysis is achieved .

CN119396686APending Publication Date: 2025-02-07TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310919623.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-24
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

The prior art is difficult to determine the impact of changing codes on front-end system use cases, resulting in the inability to detect and repair code changes that may lead to online accidents in a timely manner.

Method used

By comparing the change code with the original code and combining historical call records, the target system use cases affected by the change code are determined, thereby analyzing the scope of the change code.

Benefits of technology

It realizes the rapid and accurate determination of the impact of changing code on system use cases, reduces the probability of online accidents, and improves the security of code changes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119396686A_ABST
    Figure CN119396686A_ABST
Patent Text Reader

Abstract

The invention relates to the field of code processing, and provides a change code influence range analysis method and device, equipment and a storage medium. The method comprises the following steps: constructing a mapping relationship between an original system case and a corresponding original code based on the mapping relationship between the original system case and a calling interface and calling data of the calling interface for at least one original code, and further, comparing code files before and after modification to obtain a corresponding original code; according to the method, the change code and the original code of which the business logic is changed are obtained, and then the target system case influenced in the modification is quickly and accurately determined based on the mapping relation between the original system case recorded in each historical calling record and the corresponding original code; the problem that in an existing analysis scheme, only changed codes which can influence operation of other codes after modification can be determined, but the fact that the changed codes can influence use functions of system cases at the front end cannot be determined is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] In order to meet the business needs of people in their daily lives, various application software are developed to provide corresponding services. During the software development process, relevant codes will be modified according to the current development needs, but some of the changed codes will affect the normal operation of other codes. Therefore, how to determine the changed codes that will affect the operation of other codes is an urgent problem to be solved.

[0003] Initially, manual analysis was performed based on the experience of developers. However, as business logic became more and more complex and the amount of code continued to increase, the difficulty of manual analysis also increased, making it easy for serious online accidents to occur due to missed tests or misdetection.

[0004] Therefore, an analysis solution combining GIT DIFF and decompilation testing is often used. First, GIT DIFF is used to compare the code files before and after the change to determine the changed codes in the code files after the change. Then, a decompilation test is performed on each changed code separately. Based on the test results, the changed codes that will affect the operation of other codes after modification are screened out from each changed code.

[0005] However, after the code is compiled, it will not reflect whether the system use cases that provide services to the target object are also affected. Therefore, although the above method can determine the changed code that will affect the operation of other codes after modification, it is impossible to determine which system use cases on the front end will be affected by the changed code. As a result, the development object fails to detect the relevant system use cases in time and determine whether there are abnormalities inside them. Once an abnormality occurs in the system use case during online operation, the application software will not be able to provide services to the outside world, affecting the normal use of the software and causing serious online accidents.

[0006] In view of this, the present application proposes a method for analyzing the impact scope of code changes. Summary of the invention

[0007] The embodiments of the present application provide a method, apparatus, device and storage medium for analyzing the scope of impact of a code change to solve the problem of how to determine system use cases affected by the changed code.

[0008] In a first aspect, an embodiment of the present application provides a method for analyzing the scope of impact of a code change, including:

[0009] When detecting that a changed code file obtained by a modification operation exists in the system, obtaining the changed code file, and obtaining an original code file corresponding to the changed code file;

[0010] Comparing the original code file with the changed code file, obtaining the changed code with changed business logic based on the comparison result, and obtaining the original code corresponding to the changed code from the original code file;

[0011] From each historical call record, obtain at least one target call record associated with the original code, and determine the original system use case in the at least one target call record as the target system use case affected in this modification; wherein each of the historical call records is based on a first call record containing a first mapping relationship between the corresponding original system use case and the associated call interface, and is generated by the call data of the call interface to at least one original code, and the original code originates from an original code file associated with the one original system use case.

[0012] In a second aspect, an embodiment of the present application further provides a method for analyzing the scope of impact of a change code, which is applied in a payment business scenario and includes:

[0013] When detecting that a changed code file obtained through a modification operation exists in the payment service system, obtaining the changed code file, and obtaining an original code file corresponding to the changed code file;

[0014] Compare the original code file and the changed code file, determine the palm-swipe payment class code whose business logic has changed in the changed code file based on the comparison result, and obtain the original code corresponding to the palm-swipe payment class code from the original business code file;

[0015] From each historical call record, obtain at least one target call record associated with the original code, and determine the original system use case in the at least one target call record as the target system use case affected in this modification; wherein each of the historical call records is based on a first call record containing a first mapping relationship between the corresponding original system use case and the associated call interface, and is generated by the call data of the call interface to at least one original code, and the original code originates from an original code file associated with the one original system use case.

[0016] In a third aspect, the embodiment of the present application further provides a device for analyzing the scope of impact of a change code, including:

[0017] A detection unit, configured to obtain the changed code file and the original code file corresponding to the changed code file when detecting that a changed code file obtained by a modification operation exists in the system;

[0018] An analyzing unit, configured to compare the original code file with the changed code file, obtain the changed code with the changed business logic based on the comparison result, and obtain the original code corresponding to the changed code from the original code file;

[0019] From each historical call record, obtain at least one target call record associated with the original code, and determine the original system use case in the at least one target call record as the target system use case affected in this modification; wherein each of the historical call records is based on a first call record containing a first mapping relationship between the corresponding original system use case and the associated call interface, and is generated by the call data of the call interface to at least one original code, and the original code originates from an original code file associated with the one original system use case.

[0020] Optionally, the analysis device for the scope of impact of the change code further includes a generation unit, and the generation unit generates each of the historical call records in the following manner:

[0021] Acquire a first call record including a first mapping relationship between a call interface and an associated original system use case, and call data of the call interface to at least one original code;

[0022] Based on the first call record and at least one call data, a second mapping relationship between the original system use case and the corresponding original code is obtained respectively, and the obtained at least one second mapping relationship is recorded in the corresponding historical call record.

[0023] Optionally, the generating unit is used for:

[0024] The first call record and the at least one call data are respectively spliced ​​to obtain at least one second call record, wherein the second call record contains a second mapping relationship between the original system use case and the original code;

[0025] Based on the second mapping relationship included in the at least one second call record, a corresponding historical call record is generated.

[0026] Optionally, the device for analyzing the scope of impact of the changed code further includes a mapping unit, and the mapping unit obtains the first call record in the following manner:

[0027] In response to a use case service request for the one original system use case, when calling the one associated call interface, parsing the use case service request to obtain the use case information carried by the use case service request;

[0028] The interface identifier of the calling interface and the use case information of the one original system use case are filled into a preset information template to obtain a first calling record including a mapping relationship between the calling interface and the one original system use case.

[0029] Optionally, the analysis unit is used to:

[0030] Respectively obtaining at least one initial function declaration in the changed code file, and obtaining an initial function implementation of each of the at least one initial function declaration;

[0031] Deleting the code contents that have no impact on the business logic in the at least one initial function implementation respectively, obtaining the corresponding target function implementation, and determining the initial function declaration associated with the at least one target function implementation as the target function declaration;

[0032] At least one objective function declaration and a corresponding objective function implementation are respectively compared with the original code file to obtain corresponding comparison results.

[0033] Optionally, the analysis unit is used to:

[0034] Comparing the at least one objective function declaration and the corresponding objective function implementation with at least one reference function declaration and the corresponding reference function implementation in the original code file, respectively;

[0035] When there are an objective function declaration and an objective reference function declaration that declare the same, the objective reference function implementation corresponding to the objective reference function declaration is compared with the objective function implementation corresponding to the objective function declaration to obtain a corresponding comparison result.

[0036] Optionally, the analysis unit is used to:

[0037] When the comparison result is that no matching target function declaration and target function implementation are retrieved, the reference function declaration and corresponding reference function implementation that failed to match are used as the change code for the change in business logic;

[0038] When the comparison result is that the declarations are the same but the function implementations are different, the corresponding target function declaration and target function implementation in the change code file are used as the change code with the change in business logic.

[0039] Optionally, the analysis unit is used to:

[0040] Scan each line of code content in the change code file in turn, wherein each time a line is scanned, the line of code content is matched with the set extraction rule, and when the match is consistent, the line of code content is determined as an initial function declaration or an initial function implementation.

[0041] Optionally, the analysis unit is used to:

[0042] Formatting the at least one initial function implementation to obtain a corresponding candidate function implementation;

[0043] Delete the code content that has no impact on the business logic in at least one candidate function implementation respectively to obtain the corresponding target function implementation; wherein the code content that has no impact on the business logic includes at least one of the following: code comments, code content without programming syntax, and code content without business implementation.

[0044] In a fourth aspect, an embodiment of the present application further provides a device for analyzing the impact range of a change code, the device being applied in a payment service scenario, comprising:

[0045] A detection unit, configured to obtain the changed code file and the original code file corresponding to the changed code file when detecting that a changed code file obtained by a modification operation exists in the payment service system;

[0046] An analysis unit is used to compare the original code file with the changed code file, determine the palm-swipe payment class code whose business logic has changed in the changed code file based on the comparison result, and obtain the original code corresponding to the palm-swipe payment class code from the original business code file;

[0047] From each historical call record, obtain at least one target call record associated with the original code, and determine the original system use case in the at least one target call record as the target system use case affected in this modification; wherein each of the historical call records is based on a first call record containing a first mapping relationship between the corresponding original system use case and the associated call interface, and is generated by the call data of the call interface to at least one original code, and the original code originates from an original code file associated with the one original system use case.

[0048] In a fifth aspect, an embodiment of the present application further provides a computer device, comprising a processor and a memory, wherein the memory stores program code, and when the program code is executed by the processor, the processor executes the steps of any one of the above-mentioned methods for analyzing the scope of influence of a code change.

[0049] In a sixth aspect, an embodiment of the present application further provides a computer-readable storage medium, which includes a program code. When the program product is run on a computer device, the program code is used to enable the computer device to execute any step of the above-mentioned method for analyzing the scope of influence of a code change.

[0050] In a seventh aspect, an embodiment of the present application further provides a computer program product, including computer instructions, which are executed by a processor to perform the steps of any of the above-mentioned methods for analyzing the scope of impact of changing a code.

[0051] The beneficial effects of this application are as follows:

[0052] An embodiment of the present application provides a method, apparatus, device and storage medium for analyzing the scope of impact of a change code, the method comprising: when detecting that a change code file obtained through a modification operation exists in a system, obtaining the change code file and obtaining an original code file corresponding to the change code file; based on a comparison result between the original code file and the change code file, obtaining the change code in which the business logic has changed, and obtaining the original code corresponding to the change code from the original code file; obtaining at least one target call record associated with the original code from each historical call record, and determining the original system use case in the at least one target call record as the target system use case affected in this modification.

[0053] Based on the mapping relationship between the original system use case and the calling interface, as well as the calling data of the calling interface to at least one original code, a mapping relationship between the original system use case and the corresponding original code is constructed. Furthermore, by comparing the code files before and after the modification, the changed code and the original code with changed business logic are obtained. Then, based on the mapping relationship between the original system use case and the corresponding original code recorded in each historical call record, the target system use case affected by this modification is quickly and accurately determined, which solves the problem in the existing analysis scheme that only the changed code that will affect the operation of other codes after the modification can be determined, but it is impossible to determine which system use cases on the front end will be affected by the changed code.

[0054] Moreover, developers can also conduct key inspections on the affected call interfaces, system use cases, and other links before releasing the business development system and after the system goes online to determine whether it can operate normally, uncover potential operational problems as early as possible, and reduce the probability of online accidents in the system.

[0055] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0057] Figure 1A This is an optional schematic diagram of an application scenario in an embodiment of the present application;

[0058] Figure 1B A schematic diagram of the structure of the analysis system provided in the embodiment of the present application;

[0059] Figure 2A A schematic diagram of a process for analyzing the scope of impact of code changes provided in an embodiment of the present application;

[0060] Figure 2B A logical diagram for analyzing the impact scope of code changes provided in an embodiment of the present application;

[0061] Figure 2C A schematic diagram of a process for obtaining a change code provided in an embodiment of the present application;

[0062] Figure 2D A schematic diagram of a function with one parameter provided for an embodiment of the present application;

[0063] Figure 2E A schematic diagram of the code file extraction result provided in the embodiment of the present application;

[0064] Figure 2F A schematic diagram showing the comparison of the code file before and after denoising provided in the embodiment of the present application;

[0065] Figure 2G A schematic diagram of a process for generating a historical call record provided in an embodiment of the present application;

[0066] Figure 2H A logical diagram of generating historical call records provided in an embodiment of the present application;

[0067] Fig.2I A schematic diagram of a use case call provided in an embodiment of the present application;

[0068] Figure 3A A schematic diagram of a process for analyzing the impact scope of a code change in an online payment scenario provided in an embodiment of the present application;

[0069] Figure 3B A logical schematic diagram for analyzing the impact scope of a code change in an online payment scenario provided in an embodiment of the present application;

[0070] Figure 4 A schematic diagram of the structure of a device for analyzing the scope of influence of a change code provided in an embodiment of the present application;

[0071] Figure 5 A schematic diagram of the structure of a device for analyzing the scope of influence of a change code provided in an embodiment of the present application;

[0072] Figure 6A schematic diagram of a hardware structure of a computer device to which an embodiment of the present application is applied;

[0073] Figure 7 A schematic diagram of the hardware composition structure of another computer device to which the embodiment of the present application is applied. DETAILED DESCRIPTION

[0074] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the technical solution of the present application, rather than all of the embodiments. Based on the embodiments recorded in the application documents, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the technical solution of the present application.

[0075] Some of the terms used in the embodiments of the present application are explained below to facilitate understanding by those skilled in the art.

[0076] 1. Cloud technology:

[0077] The present application relates to the field of cloud technology. Cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and network in a wide area network or a local area network to achieve data calculation, storage, processing, and sharing.

[0078] Specifically, cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. that apply the cloud computing business model. The resource pool composed of cloud technology can be used on demand and is more flexible and convenient.

[0079] Cloud computing technology will become an important support for cloud technology, mainly solving the problem of requiring a large amount of computing and storage resources in the background services of cloud technology network systems. Cloud technology network systems include but are not limited to video websites, image websites and more portal websites. With the rapid development and application of the Internet industry, in the future, each item may have its own identification mark, which needs to be transmitted to the background system for logical processing, and data of different levels will be processed separately. All kinds of industry data need a strong system backing as technical support, which can only be achieved through cloud computing.

[0080] 2. Cloud computing:

[0081] In a narrow sense, cloud computing refers to the delivery and use model of information technology (IT) infrastructure, which is to obtain the required resources through the network in an on-demand, easily scalable manner; while in a broad sense, cloud computing refers to the delivery and use model of services, which is to obtain the required services through the network in an on-demand, easily scalable manner. Such services can be related to IT, software, the Internet, or other services.

[0082] Cloud computing is the product of the integration of traditional computer and network technologies such as grid computing, distributed computing, parallel computing, utility computing, network storage technologies, virtualization, and load balancing. With the development of the Internet, real-time data streams, and the diversification of connected devices, as well as the demand for search services, social networks, mobile commerce, and open collaboration, cloud computing has developed rapidly. Different from the previous parallel distributed computing, the birth of cloud computing has promoted a revolutionary change in the entire Internet model and enterprise management model from the perspective of concept.

[0083] 3. Artificial Intelligence (AI):

[0084] Artificial intelligence is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making.

[0085] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics and other technologies; artificial intelligence software technologies mainly include computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0086] With the research and advancement of artificial intelligence technology, artificial intelligence has been studied and applied in many fields, such as common smart homes, smart customer service, virtual assistants, smart speakers, smart marketing, unmanned driving, autonomous driving, robots, smart medical care, etc. I believe that with the development of technology, artificial intelligence will be applied in more fields and play an increasingly important role.

[0087] 4. Use Case represents the services provided by the system. It defines how the system is used by the actor and describes a conversation between the actor and the system in order to use a complete function provided by the system.

[0088] Among them, participants refer to people or other systems that exist outside the system and interact with the system. They represent the users of the system or the usage environment.

[0089] 5. Message-Digest Algorithm 5 (MD5) is a hash function used in the field of information encryption and decryption. Its function is to "compress" large amounts of information into a confidential format before signing the private key with digital signature software.

[0090] The following is a brief introduction to the design concept of the embodiment of the present application:

[0091] In order to meet the business needs of people in their daily lives, various application software are developed to provide corresponding services. During the software development process, relevant codes will be modified according to the current development needs, but some of the changed codes will affect the normal operation of other codes. Therefore, how to determine the changed codes that will affect the operation of other codes is an urgent problem to be solved.

[0092] Initially, manual analysis was performed based on the experience of developers. However, as business logic became more and more complex and the amount of code continued to increase, the difficulty of manual analysis also increased, making it easy for serious online accidents to occur due to missed tests or misdetection.

[0093] At present, the general analysis solution is to use GIT DIFF combined with decompilation test. First, GIT DIFF is used to compare the code files before and after the change to determine the changed codes in the code files after the change. Then, decompilation test is performed on each changed code separately. Based on the test results, the changed codes that will affect the operation of other codes after modification are screened out from each changed code.

[0094] However, after the code is compiled, it will not reflect whether the system use cases that provide services to the target object are also affected. Therefore, although the above method can determine the changed code that will affect the operation of other codes after modification, it is impossible to determine which system use cases on the front end will be affected by the changed code. As a result, the development object fails to detect the relevant system use cases in time and determine whether there are abnormalities inside them. Once an abnormality occurs in the system use case during online operation, the application software will not be able to provide services to the outside world, affecting the normal use of the software and causing serious online accidents.

[0095] In view of this, the present application proposes a method, device, equipment and storage medium for analyzing the scope of impact of code changes. The method includes:

[0096] When it is detected that there is a changed code file obtained by a modification operation in the system, the changed code file and the original code file corresponding to the changed code file are obtained; based on the comparison result between the original code file and the changed code file, the changed code with changed business logic is obtained, and the original code corresponding to the changed code is obtained from the original code file; from each historical call record, at least one target call record associated with the original code is obtained, and the original system use case in the at least one target call record is determined as the target system use case affected in this modification; wherein each historical call record is generated based on a first call record containing a first mapping relationship between a corresponding original system use case and an associated call interface, and call data of the call interface to at least one original code, and the original code originates from an original code file associated with an original system use case.

[0097] Based on the mapping relationship between the original system use case and the calling interface, as well as the calling data of the calling interface to at least one original code, a mapping relationship between the original system use case and the corresponding original code is constructed. Furthermore, by comparing the code files before and after the modification, the changed code and the original code with changed business logic are obtained. Then, based on the mapping relationship between the original system use case and the corresponding original code recorded in each historical call record, the target system use case affected by this modification is quickly and accurately determined, which solves the problem in the existing analysis scheme that only the changed code that will affect the operation of other codes after the modification can be determined, but it is impossible to determine which system use cases on the front end will be affected by the changed code.

[0098] Moreover, developers can also conduct key inspections on the affected call interfaces, system use cases, and other links before releasing the business development system and after the system goes online to determine whether it can operate normally, uncover potential operational problems as early as possible, and reduce the probability of online accidents in the system.

[0099] The preferred embodiments of the present application are described below in conjunction with the drawings in the specification. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application, and are not used to limit the present application. In addition, the embodiments and features in the embodiments of the present application may be combined with each other if there is no conflict.

[0100] The embodiments of the present application can be applied to various scenarios such as cloud technology, artificial intelligence, smart transportation, and assisted driving, to perform an analysis method for the impact scope of code changes, determine the impact scope of code changes, and focus on detecting affected system use cases and codes to reduce the probability of online accidents.

[0101] Figure 1A One application scenario is shown, including two terminal devices 110 and a server 130, and a communication connection is established between the terminal devices 110 and the server 130 via a wired network or a wireless network.

[0102] Among them, the terminal device 110 includes but is not limited to: mobile phones, computers (such as tablets, laptops, desktop computers, etc.), smart home appliances, smart voice interaction devices (such as smart watches, smart speakers, etc.), vehicle-mounted terminals, aircraft, etc.

[0103] The server 130 of the embodiment of the present application can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms. This application does not make any restrictions here.

[0104] An analysis system for determining the impact scope of the code change is deployed on the server 130, such as Figure 1B As shown, the system includes the following functional modules: a mapping module, a generation module for generating historical call records, and an analysis module for analyzing the impact scope.

[0105] In response to the modification operation of the development object, the terminal device 110 modifies the original code file in the business development system and obtains the corresponding change code file. The analysis module periodically detects the original code file in the business development system, and when it detects that there is a change code file obtained by the modification operation in the system, it obtains the change code file and the original code file corresponding to the change code file. Based on the comparison result between the original code file and the change code file, the change code with the changed business logic is obtained in the change code file, and the original code corresponding to the change code is obtained from the original code file; at least one target call record associated with the original code is obtained from each historical call record, and the original system use case in the at least one target call record is determined as the target system use case affected in this modification.

[0106] Before analyzing the impact of the changed code through the analysis module, each historical call record needs to be generated through the mapping module and the generation module. Specifically, the mapping module is used to generate the target use case information of the original system use case associated with each call interface; the generation module obtains the call log of each call interface and the target use case information of the original system use case associated with each call interface, and generates at least one historical call record based on the call log of each call interface and the use case information of the associated original system use case.

[0107] Next, if Figure 2A-2B As shown, the process of executing the analysis method provided in the embodiment of the present application to determine the impact scope of the changed code is as follows:

[0108] S201: When it is detected that a changed code file obtained through a modification operation exists in the system, the changed code file is obtained, and an original code file corresponding to the changed code file is obtained.

[0109] The analysis system periodically detects the original code files in the business development system through the analysis module, and obtains the changed code files when detecting that there are changed code files obtained through modification operations in the business development system.

[0110] Obtain file modification information of the changed code file, which records the file identifier and file storage address before and after the file modification; based on the file identifier and file storage address of the original code file in the file modification information, obtain the previously stored unmodified original code file in the business development system.

[0111] S202: Compare the original code file and the changed code file, obtain the changed code with the changed business logic based on the comparison result, and obtain the original code corresponding to the changed code from the original code file.

[0112] like Figure 2CAs shown, the following method is used to compare the code files before and after modification:

[0113] S2021: Obtain at least one initial function declaration in the change code file respectively, and obtain the initial function implementation of each of the at least one initial function declaration.

[0114] A function declaration is a statement that declares the type of the function's return value, as well as the number, type, and order of parameters that the function expects to accept, in order to inform the business development system of the type of function being called in this function. Therefore, the function declaration can omit the parameter name, but the header of the function definition must list all parameter names and give the corresponding data types. Based on this, the embodiment of the present application pre-constructs a set extraction rule for extracting the initial function declaration according to the structural characteristics of the function declaration.

[0115] Function implementation is a program code written in a programming language. By compiling and executing the function implementation, the business development system can be controlled to provide corresponding functional services. Figure 2D A function with one parameter is shown, the function includes a function declaration and a function implementation, the function declaration includes a function name, all parameter names and corresponding data types, and the function implementation is located below the function declaration, including at least one set of aligned curly braces, and a function body located between each set of curly braces, each function body is a program code written in a programming language. Based on this, the embodiment of the present application pre-constructs a set extraction rule for extracting the initial function implementation according to the structural characteristics of the function implementation.

[0116] The extraction rules include but are not limited to regular expressions and code analysis, which are not limited in this application. After constructing the extraction rules, scan the lines of code in the changed code file in turn. Each time a line is scanned, match the line of code with the extraction rules. When the match is consistent, the line of code is determined as the initial function declaration or initial function implementation. For example, based on the pre-set regular expressions, extract the code files before and after the change respectively. The extraction results of each code file are as follows: Figure 2E shown.

[0117] S2022: Delete the code content that has no impact on the business logic in at least one initial function implementation, obtain the corresponding target function implementation, and determine the initial function declaration associated with at least one target function implementation as the target function declaration.

[0118] Currently, GIT DIFF will mark modifications such as code comments and code formatting that do not affect business logic as changed code, expanding the test scope and increasing the test workload. In order to solve this problem, this application performs denoising on at least one initial function implementation and deletes the code content in the corresponding initial function implementation that has no impact on business logic. The specific denoising process is as follows:

[0119] Formatting at least one initial function implementation to obtain a corresponding candidate function implementation; then deleting code content that has no impact on the business logic in at least one candidate function implementation to obtain a corresponding target function implementation; wherein the code content that has no impact on the business logic includes at least one of the following: code comments, code content without programming syntax, and code content without business implementation.

[0120] Code comments are explanations and descriptions of a statement, program segment, function, and other code contents by the programmer. Code comments are not executed by the program. Their purpose is to help people understand the code more easily and improve the readability of the program code. Therefore, if the modification operation is to add, modify, or delete code comments in the original code file, since the code comments themselves are not executed by the program, various modification operations on them will not affect the business logic of the corresponding initial function implementation. Therefore, in order to reduce the interference of redundant content, the code comments in the corresponding initial function implementation should be deleted.

[0121] The code is written in a programming language supported by the development tool and consists of characters, symbols or signal code elements. Therefore, changing the code formatting, non-strings, spaces, line breaks and other code contents that are not related to the programming syntax in the code file will not affect the business logic implemented by the corresponding initial function. The above code contents can be deleted during the denoising process. For example, Figure 2F A new code comment "Return the result of a+b" is added to the changed code file, which does not affect the business logic implemented by the initial function. Therefore, this code comment is deleted in the denoising stage to obtain the denoised changed code file.

[0122] When running network equipment, systems and service programs, an event record called log is generated, also known as a log file. Each line of the log in the file records the descriptive information of related operations such as the running date, running time, user and execution action. By analyzing the log file, the running status of each functional module of the system can be analyzed. Therefore, in the initial function implementation that requires log collection and reporting, code content related to log collection and log reporting will also be written, but these contents belong to the backend log business and do not affect the business logic of the corresponding initial function implementation. In the denoising stage, the above code content can also be deleted.

[0123] S2023: Compare at least one objective function declaration and a corresponding objective function implementation with the original code file to obtain corresponding comparison results.

[0124] Comparing at least one objective function declaration and the corresponding objective function implementation with at least one reference function declaration and the corresponding reference function implementation in the original code file, the following comparison results can be obtained:

[0125] a) The comparison result is that no matching target function declaration and target function implementation are retrieved;

[0126] b) The comparison result is that no matching reference function declaration and reference function implementation are retrieved;

[0127] c) The comparison result is that the declarations are the same and the function implementations are the same;

[0128] d) The comparison result is that the declarations are the same, but the function implementations are different.

[0129] When there are target function declarations and target reference function declarations that are identical, the target reference function implementation corresponding to the target reference function declaration is compared with the target function implementation corresponding to the target function declaration to obtain a corresponding comparison result. For example, the reference function implementation and the target reference function implementation are encrypted with md5 to obtain their respective md5 values. If the two md5 values ​​are the same, the function implementations are determined to be the same; if the two md5 values ​​are different, the function implementations are determined to be different.

[0130] When the comparison result is that the declarations are the same and the function implementations are the same, it means that the development object has not modified the reference function implementation, or, when executing step 222, the code content that does not affect the business logic in the corresponding initial function implementation has been deleted, and the comparison result can be ignored and no processing is performed;

[0131] When the comparison result is that no matching reference function declaration and reference function implementation are retrieved, it means that the target function declaration and target function implementation are newly added functions in the changed code file, and the mapping relationship between the function and the system use case has not been recorded. The system use case affected by the function cannot be determined, and the newly added function is related to the business requirements proposed this time, which is itself the focus of detection of the development object. There is no need to repeatedly remind the developers to detect the function and related links. Therefore, in this case, the comparison result can be ignored and no processing is performed.

[0132] When the comparison result is that no matching target function declaration and target function implementation are retrieved, it means that the initial function declaration and initial function implementation corresponding to the reference function declaration have been deleted in the change code file, which may affect the functional services originally provided by the business development system. Therefore, in this case, the reference function declaration and corresponding reference function implementation that failed to match are regarded as the change code of the business logic change;

[0133] When the comparison result is that the declaration is the same but the function implementation is different, it means that the development object has modified the business logic in the reference function implementation. The corresponding function declaration and target function implementation in the change code file are used as the change code with the changed business logic, and the original code in the original code file with the same declaration but different function implementation is used as the code corresponding to the change code.

[0134] S203: Obtain at least one target call record associated with the original code from each historical call record, and determine the original system use case in the at least one target call record as the target system use case affected in this modification; wherein each historical call record is based on a first call record containing a first mapping relationship between the corresponding original system use case and the associated call interface, and is generated from the call data of the call interface to at least one original code, and the original code originates from an original code file associated with an original system use case.

[0135] Each historical call record contains a mapping relationship between an original system use case and the corresponding original code. Therefore, after obtaining the changed code and the original code for the business logic changes, the target system use case affected by this modification can be quickly and accurately determined based on the mapping relationship recorded in each historical call record. This solves the problem that the existing analysis solution can only determine the changed code that will affect the operation of other codes after modification, but cannot determine which system use cases on the front end will be affected by the changed code.

[0136] Moreover, developers can also conduct key inspections on the affected call interfaces, system use cases, and other links before releasing the business development system and after the system goes online to determine whether it can operate normally, uncover potential operational problems as early as possible, and reduce the probability of online accidents in the system.

[0137] Before executing step 203, Figure 2G~2H As shown, the following method is required to generate each historical call record:

[0138] S2031: Obtain a first call record including a first mapping relationship between a call interface and an associated original system use case, and call data of the call interface to at least one original code, where the original code originates from an original code file associated with an original system use case.

[0139] An information template is set at the access layer, and the template includes at least the following parameters: an interface identifier of the calling interface, a service name of the service to which the original system use case belongs, and a use case identifier and use case steps of the original system use case.

[0140] like Fig.2I As shown, in response to a use case service request for an original system use case, when an associated calling interface is called, the mapping module parses the use case service request and obtains the use case information carried in the request, the information including at least: the service name of the service to which the original system use case belongs, the use case identifier and the use case steps of the original system use case; then obtains the information template set by the access layer, takes the interface identifier and the use case information of the original system use case as parameter values, fills them into the information template set by the access layer, and obtains a first calling record containing a first mapping relationship between the calling interface and an original system use case.

[0141] Since the framework cookie has the advantage of information transparency, when executing the downstream sub-service of the service, the mapping module can directly obtain the use case information in the upstream service, and then generate the corresponding first call record based on the use case information and the interface identifier of the calling interface associated with the corresponding use case service.

[0142] Since the log module in the business development system integrates the reporting logic, each time the log module detects a call to a calling interface, it reports the first call record that records the first mapping relationship between the calling interface and an original system use case, and the call data of the calling interface to at least one original code to the generation module to generate the corresponding historical call record, wherein each original code originates from an original code file associated with an original system use case.

[0143] S2032: Based on the first call record and at least one call data, obtain a second mapping relationship between an original system use case and a corresponding original code, and record the obtained at least one second mapping relationship in the corresponding historical call record.

[0144] As shown in Table 1, the call log of the calling interface records the call data of at least one original code, and each call data includes but is not limited to: running date, running time, user, function name of the called function, file name of the called function and other information.

[0145] Table 1

[0146] Operation Date Run time user Function Name file name 2022 / 09 / 01 09:10 User Service-Interface a GetUser User.cpp 2022 / 09 / 01 09:28 User Service-Interface a GetApply Apply.cpp …… …… …… …… ……

[0147] The first call record is spliced ​​with at least one call data respectively to obtain at least one second call record, each second call record contains a second mapping relationship between an original system use case and an original code; based on the second mapping relationship contained in the at least one second call record, a corresponding historical call record is generated.

[0148] For example, Table 2 shows a second call record. Since the present application is to construct a second mapping relationship between the original system use case and the original code, data processing is performed on the second call record, parameter values ​​related to the original system use case and the original code are retained, and the above parameter values ​​are recorded to obtain the historical call record shown in Table 3.

[0149] Table 2

[0150]

[0151] Table 3

[0152] Use Case Name Use Case Steps Function Name file name User-Open xx Confirm service activation GetUser User.cpp

[0153] When the business development system is running, an original system use case may trigger the call interface multiple times, execute function call operations on the same original code, and obtain multiple identical second call records. In order to save system storage space and reduce the occupation of system resources, it is also possible to perform data cleaning on at least one of the obtained second call records before generating the corresponding historical call records, delete duplicate second call records, and it is also beneficial to improve the processing speed of generating historical call records.

[0154] Based on the same inventive concept as the above method embodiment, the embodiment of the present application further provides a method for analyzing the impact range of a change code, which is applied in a payment business scenario and includes:

[0155] When detecting that a changed code file obtained through a modification operation exists in the payment service system, obtaining the changed code file and obtaining an original code file corresponding to the changed code file;

[0156] Compare the original code file and the changed code file, determine the palm-swipe payment class code whose business logic has changed in the changed code file based on the comparison result, and obtain the original code corresponding to the palm-swipe payment class code from the original business code file;

[0157] From each historical call record, obtain at least one target call record associated with the original code, and determine the original system use case in the at least one target call record as the target system use case affected in this modification; wherein each historical call record is based on a first call record containing a first mapping relationship between the corresponding original system use case and the associated call interface, and is generated from the call data of the call interface to at least one original code, and the original code originates from an original code file associated with an original system use case.

[0158] For ease of understanding, we take the modification of palm-swipe payment related functions as an example to identify the target system use cases affected by this modification. Figure 3A-3B As shown in the accompanying drawings, the process of analyzing the changed code is as follows:

[0159] S301: upon detecting that a modified code file generated by a modification operation exists in the system, obtaining the modified code file and the original code file before modification;

[0160] S302: extracting at least one initial function declaration and a corresponding initial function implementation in the changed code file, and extracting at least one reference function declaration and a corresponding reference function implementation in the original code file;

[0161] S303: Compare at least one target function declaration and a corresponding target function implementation with at least one reference function declaration and a corresponding reference function implementation in an original code file to obtain a corresponding comparison result;

[0162] S304: based on the comparison result, obtain the palm payment class code with the changed business logic, and obtain the palm payment class code before the modification from the original code file;

[0163] S305: Obtain at least one target call record associated with the palm payment class code, and use the palm payment activation use case, payment use case, balance query use case, and palm payment shutdown use case recorded in at least one target call record as the target system use cases affected by this modification.

[0164] Based on the same inventive concept as the above method embodiment, the present application embodiment also provides an analysis device for changing the impact range of a code. Figure 4 As shown, the analysis device 400 for the scope of influence of the change code may include:

[0165] The detection unit 401 is used to obtain the changed code file and the original code file corresponding to the changed code file when detecting that there is a changed code file obtained by the modification operation in the system;

[0166] An analysis unit 402 is used to compare the original code file and the modified code file, obtain the modified code with the changed business logic based on the comparison result, and obtain the original code corresponding to the modified code from the original code file;

[0167] From each historical call record, obtain at least one target call record associated with the original code, and determine the original system use case in the at least one target call record as the target system use case affected in this modification; wherein each historical call record is based on a first call record containing a first mapping relationship between the corresponding original system use case and the associated call interface, and is generated from the call data of the call interface to at least one original code, and the original code originates from an original code file associated with an original system use case.

[0168] Optionally, the analysis device 400 for the scope of influence of the changed code further includes a generating unit 403, and the generating unit 403 generates each historical call record in the following manner:

[0169] Acquire a first call record including a first mapping relationship between a call interface and an associated original system use case, and call data of a call interface to at least one original code;

[0170] Based on the first call record and at least one call data, a second mapping relationship between an original system use case and a corresponding original code is obtained respectively, and the obtained at least one second mapping relationship is recorded in the corresponding historical call record.

[0171] Optionally, the generating unit 403 is used for:

[0172] The first call record is spliced ​​with at least one call data respectively to obtain at least one second call record, wherein the second call record includes a second mapping relationship between an original system use case and an original code;

[0173] Based on the second mapping relationship included in the at least one second call record, a corresponding historical call record is generated.

[0174] Optionally, the analysis device 400 for changing the code impact range further includes a mapping unit 404. The mapping unit 404 obtains the first call record in the following manner:

[0175] In response to a use case service request for an original system use case, when calling an associated call interface, the use case service request is parsed to obtain use case information carried by the use case service request;

[0176] The interface identifier of the calling interface and the use case information of an original system use case are filled into a preset information template to obtain a first calling record including a mapping relationship between the calling interface and the original system use case.

[0177] Optionally, the analysis unit 402 is used for:

[0178] Respectively obtaining at least one initial function declaration in the changed code file, and obtaining an initial function implementation of each of the at least one initial function declaration;

[0179] Deleting code content that has no impact on the business logic in at least one initial function implementation respectively to obtain a corresponding target function implementation, and determining the initial function declaration associated with at least one target function implementation as the target function declaration;

[0180] At least one objective function declaration and a corresponding objective function implementation are respectively compared with the original code file to obtain corresponding comparison results.

[0181] Optionally, the analysis unit 402 is used for:

[0182] Comparing at least one objective function declaration and a corresponding objective function implementation with at least one reference function declaration and a corresponding reference function implementation in an original code file, respectively;

[0183] When there are an objective function declaration and an objective reference function declaration that have the same declaration, the objective reference function implementation corresponding to the objective reference function declaration is compared with the objective function implementation corresponding to the objective function declaration to obtain a corresponding comparison result.

[0184] Optionally, the analysis unit 402 is used for:

[0185] When the comparison result is that no matching target function declaration and target function implementation are retrieved, the reference function declaration and corresponding reference function implementation that failed to match are used as the change code for the change in business logic;

[0186] When the comparison result is that the declarations are the same but the function implementations are different, the corresponding target function declaration and target function implementation in the change code file are used as the change code for the changed business logic.

[0187] Optionally, the analysis unit 402 is used for:

[0188] Scan each line of code in the change code file in turn, wherein each time a line is scanned, the line of code content is matched with the set extraction rule, and when the match is consistent, the line of code content is determined as an initial function declaration or an initial function implementation.

[0189] Optionally, the analysis unit 402 is used for:

[0190] Formatting at least one initial function implementation to obtain a corresponding candidate function implementation;

[0191] Delete the code content that has no impact on the business logic in at least one candidate function implementation respectively to obtain the corresponding target function implementation; wherein the code content that has no impact on the business logic includes at least one of the following: code comments, code content without programming syntax, and code content without business implementation.

[0192] Based on the same inventive concept as the above method embodiment, the present application embodiment also provides a device for analyzing the impact range of a change code, which is applied in a payment business scenario. Figure 5 As shown, the analysis device 500 for the scope of influence of the change code may include:

[0193] The detection unit 501 is used to obtain the changed code file and the original code file corresponding to the changed code file when detecting that there is a changed code file obtained by the modification operation in the payment service system;

[0194] An analysis unit 502 is used to compare the original code file and the changed code file, determine the palm payment class code whose business logic has changed in the changed code file based on the comparison result, and obtain the original code corresponding to the palm payment class code from the original business code file;

[0195] From each historical call record, obtain at least one target call record associated with the original code, and determine the original system use case in the at least one target call record as the target system use case affected in this modification; wherein each historical call record is based on a first call record containing a first mapping relationship between the corresponding original system use case and the associated call interface, and is generated from the call data of the call interface to at least one original code, and the original code originates from an original code file associated with an original system use case.

[0196] For the convenience of description, the above parts are divided into modules (or units) according to their functions and described separately. Of course, when implementing this application, the functions of each module (or unit) can be implemented in the same or multiple software or hardware.

[0197] After introducing the method and apparatus for analyzing the impact range of a changed code according to an exemplary embodiment of the present application, next, a computer device according to another exemplary embodiment of the present application is introduced.

[0198] Those skilled in the art will appreciate that various aspects of the present application may be implemented as a system, method or program product. Therefore, various aspects of the present application may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to as "circuit", "module" or "system" herein.

[0199] Based on the same inventive concept as the above method embodiment, the present application embodiment also provides a computer device. In one embodiment, the computer device may be a server, such as Figure 1A In this embodiment, the structure of the computer device is as follows: Figure 6 As shown, it may include at least a memory 601 , a communication module 603 , and at least one processor 602 .

[0200] The memory 601 is used to store computer programs executed by the processor 602. The memory 601 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and programs required for running the instant messaging function, etc.; the data storage area may store various instant messaging information and operation instruction sets, etc.

[0201] The memory 601 may be a volatile memory, such as a random-access memory (RAM); the memory 601 may also be a non-volatile memory, such as a read-only memory, a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); or the memory 601 may be any other medium that can be used to carry or store a desired computer program in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 601 may be a combination of the above memories.

[0202] The processor 602 may include one or more central processing units (CPU) or a digital processing unit, etc. The processor 602 is used to implement the above-mentioned analysis method of the impact range of the code change when calling the computer program stored in the memory 601 .

[0203] The communication module 603 is used to communicate with terminal devices and other servers.

[0204] The specific connection medium between the memory 601, the communication module 603 and the processor 602 is not limited in the embodiment of the present application. Figure 6 In the embodiment, the memory 601 and the processor 602 are connected via a bus 604. The bus 604 is connected to the processor 602 via a bus 604. Figure 6 The connections between the other components are only for illustration and are not intended to be limiting. The bus 604 can be divided into an address bus, a data bus, a control bus, etc. For ease of description, Figure 6 The diagram shows that only one thick line is used, but this does not mean that there is only one bus or only one type of bus.

[0205] The memory 601 stores a computer storage medium, and the computer storage medium stores computer executable instructions, and the computer executable instructions are used to implement the analysis method of the change code impact range of the embodiment of the present application. The processor 602 is used to execute the above-mentioned analysis method of the change code impact range, such as Figure 2A shown.

[0206] In another embodiment, the computer device may also be other computer devices, such as the terminal device 110 shown in FIG. 1. In this embodiment, the structure of the computer device may be as follows: Figure 7 As shown, it includes: a communication component 710, a memory 720, a display unit 730, a camera 740, a sensor 750, an audio circuit 770, a Bluetooth module 770, a processor 780 and other components.

[0207] The communication component 710 is used to communicate with the server. In some embodiments, a wireless fidelity (WiFi) module may be included. The WiFi module belongs to a short-range wireless transmission technology. The electronic device can help the object to send and receive information through the WiFi module.

[0208] The memory 720 can be used to store software programs and data. The processor 780 executes various functions and data processing of the terminal device 110 by running the software programs or data stored in the memory 720. The memory 720 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device. The memory 720 stores an operating system that enables the terminal device 110 to run. In the present application, the memory 720 can store an operating system and various application programs, and can also store a computer program that executes the analysis method of the scope of influence of the code change embodiment of the present application.

[0209] The display unit 730 can also be used to display information input by the object or information provided to the object and a graphical user interface (GUI) of various menus of the terminal device 110. Specifically, the display unit 730 may include a display screen 732 disposed on the front of the terminal device 110. The display screen 732 may be configured in the form of a liquid crystal display, a light emitting diode, etc. The display unit 730 may be used to display an editing interface, a detection interface, etc. of the business development system in the embodiment of the present application.

[0210] The display unit 730 can also be used to receive input digital or character information and generate signal input related to the object setting and function control of the physical terminal device 210. Specifically, the display unit 730 may include a touch screen 731 set on the front of the terminal device 110, which can collect touch operations of objects on or near it, such as clicking a button, dragging a scroll box, etc.

[0211] The touch screen 731 can be covered on the display screen 732, or the touch screen 731 and the display screen 732 can be integrated to realize the input and output functions of the physical terminal device 210, and the integrated display screen can be referred to as a touch display screen. In this application, the display unit 730 can display the application and the corresponding operation steps.

[0212] The camera 740 can be used to capture static images, and the object can publish the image taken by the camera 740 through the application. The camera 740 can be one or more. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the processor 780 to convert it into a digital image signal.

[0213] The physical terminal device may also include at least one sensor 750, such as an acceleration sensor 751, a distance sensor 752, a fingerprint sensor 753, and a temperature sensor 754. The terminal device may also be equipped with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, a light sensor, and a motion sensor.

[0214] The audio circuit 770, the speaker 771, and the microphone 772 can provide an audio interface between the object and the terminal device 110. The audio circuit 770 can transmit the electrical signal converted from the received audio data to the speaker 771, which is converted into a sound signal for output. The physical terminal device 210 can also be configured with a volume button for adjusting the volume of the sound signal. On the other hand, the microphone 772 converts the collected sound signal into an electrical signal, which is received by the audio circuit 770 and converted into audio data, and then the audio data is output to the communication component 710 to be sent to, for example, another terminal device 110, or the audio data is output to the memory 720 for further processing.

[0215] The Bluetooth module 770 is used to exchange information with other Bluetooth devices having Bluetooth modules through the Bluetooth protocol. For example, the physical terminal device can establish a Bluetooth connection with a wearable electronic device (such as a smart watch) that also has a Bluetooth module through the Bluetooth module 770 to exchange data.

[0216] The processor 780 is the control center of the physical terminal device. It uses various interfaces and lines to connect various parts of the entire terminal. It executes various functions of the terminal device and processes data by running or executing software programs stored in the memory 720 and calling data stored in the memory 720. In some embodiments, the processor 780 may include one or more processing units; the processor 780 may also integrate an application processor and a baseband processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the baseband processor mainly processes wireless communications. It is understandable that the above-mentioned baseband processor may not be integrated into the processor 780. In the present application, the processor 780 can run the operating system, application programs, user interface display and touch response, as well as the analysis method of the scope of influence of the change code in the embodiment of the present application. In addition, the processor 780 is coupled to the display unit 730.

[0217] In some possible implementations, various aspects of the method for analyzing the scope of impact of a code change provided in the present application may also be implemented in the form of a program product, which includes a computer program. When the program product is run on a computer device, the computer program is used to enable the computer device to execute the steps of the method for analyzing the scope of impact of a code change according to various exemplary implementations of the present application described above in this specification. For example, the computer device may execute the following steps: Figure 2A Follow the steps shown in .

[0218] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable 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 above.

[0219] The program product of the embodiment of the present application may adopt a portable compact disk read-only memory (CD-ROM) and include a computer program, and can be run on an electronic device. However, the program product of the present application is not limited thereto, and in this document, a readable storage medium may be any tangible medium containing or storing a program, which can be used by or in combination with a command execution system, apparatus, or device.

[0220] A readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, wherein a readable computer program is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A readable signal medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with a command execution system, apparatus, or device.

[0221] The computer program embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0222] The computer program for performing the operations of the present application may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The computer program may be executed entirely on the user's computer device, partially on the user's computer device, as a separate software package, partially on the user's computer device and partially on a remote computer device, or entirely on the remote computer device. In the case of a remote computer device, the remote computer device may be connected to the user's computer device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer device (e.g., via the Internet using an Internet service provider).

[0223] It should be noted that, although several units or subunits of the device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided into multiple units to be embodied.

[0224] In addition, although the operations of the method of the present application are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.

[0225] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain a computer-usable computer program.

[0226] The present application is described with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, and the combination of the process and / or box in the flowchart and / or block diagram can be realized by computer program commands. These computer program commands can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the command executed by the processor of the computer or other programmable data processing device produces a device for realizing the function specified in one process or multiple processes in the flowchart and / or one box or multiple boxes in the block diagram.

[0227] These computer program commands may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the commands stored in the computer-readable memory produce a manufactured product including a command device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0228] These computer program commands can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the commands executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0229] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.

[0230] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A method for analyzing the impact range of a code change, characterized in that: include: When detecting that a changed code file obtained by a modification operation exists in the system, obtaining the changed code file, and obtaining an original code file corresponding to the changed code file; Comparing the original code file with the changed code file, obtaining the changed code with changed business logic based on the comparison result, and obtaining the original code corresponding to the changed code from the original code file; From each historical call record, obtain at least one target call record associated with the original code, and determine the original system use case in the at least one target call record as the target system use case affected in this modification; wherein each of the historical call records is based on a first call record containing a first mapping relationship between the corresponding original system use case and the associated call interface, and is generated by the call data of the call interface to at least one original code, and the original code originates from an original code file associated with the one original system use case.

2. The method according to claim 1, characterized in that Each of the historical call records is generated in the following manner: Acquire a first call record including a first mapping relationship between a call interface and an associated original system use case, and call data of the call interface to at least one original code; Based on the first call record and at least one call data, a second mapping relationship between the original system use case and the corresponding original code is obtained respectively, and the obtained at least one second mapping relationship is recorded in the corresponding historical call record.

3. The method according to claim 2, characterized in that The obtaining, based on the first call record and the at least one call data, a second mapping relationship between the one original system use case and the corresponding original code, and recording the obtained at least one second mapping relationship in the corresponding historical call record, comprises: The first call record and the at least one call data are respectively spliced ​​to obtain at least one second call record, wherein the second call record contains a second mapping relationship between the original system use case and the original code; Based on the second mapping relationship included in the at least one second call record, a corresponding historical call record is generated.

4. The method according to claim 2, characterized in that The first call record is obtained in the following manner: In response to a use case service request for the one original system use case, when calling the one associated call interface, parsing the use case service request to obtain the use case information carried by the use case service request; The interface identifier of the calling interface and the use case information of the original system use case are filled into a preset information template to obtain a first calling record including a mapping relationship between the calling interface and the original system use case.

5. The method according to any one of claims 1 to 4, characterized in that: The comparing the original code file and the changed code file comprises: Respectively obtaining at least one initial function declaration in the changed code file, and obtaining an initial function implementation of each of the at least one initial function declaration; Deleting the code contents that have no impact on the business logic in the at least one initial function implementation respectively to obtain the corresponding target function implementation, and determining the initial function declaration associated with the at least one target function implementation as the target function declaration; At least one objective function declaration and a corresponding objective function implementation are respectively compared with the original code file to obtain corresponding comparison results.

6. The method according to claim 5, characterized in that The step of comparing at least one objective function declaration and a corresponding objective function implementation with the original code file to obtain corresponding comparison results includes: Comparing the at least one objective function declaration and the corresponding objective function implementation with at least one reference function declaration and the corresponding reference function implementation in the original code file, respectively; When there are an objective function declaration and an objective reference function declaration that declare the same, the objective reference function implementation corresponding to the objective reference function declaration is compared with the objective function implementation corresponding to the objective function declaration to obtain a corresponding comparison result.

7. The method according to claim 6, characterized in that The step of obtaining the change code of the business logic change based on the comparison result includes: When the comparison result is that no matching target function declaration and target function implementation are retrieved, the reference function declaration and corresponding reference function implementation that failed to match are used as the change code for the change in business logic; When the comparison result is that the declarations are the same but the function implementations are different, the corresponding target function declaration and target function implementation in the change code file are used as the change code with the change in business logic.

8. The method according to claim 5, characterized in that The obtaining of at least one initial function declaration in the changed code respectively, and obtaining an initial function implementation of each of the at least one initial function declaration, comprises: Scan each line of code content in the change code file in turn, wherein each time a line is scanned, the line of code content is matched with the set extraction rule, and when the match is consistent, the line of code content is determined as an initial function declaration or an initial function implementation.

9. The method according to claim 5, characterized in that The deleting the code contents having no influence on the business logic in the at least one initial function implementation respectively to obtain the corresponding target function implementation respectively comprises: Formatting the at least one initial function implementation to obtain a corresponding candidate function implementation; Delete the code content that has no impact on the business logic in at least one candidate function implementation respectively to obtain the corresponding target function implementation; wherein the code content that has no impact on the business logic includes at least one of the following: code comments, code content without programming syntax, and code content without business implementation.

10. A method for analyzing the impact range of a code change, characterized in that: The method is applied in a payment business scenario, including: When detecting that a changed code file obtained through a modification operation exists in the payment service system, obtaining the changed code file, and obtaining an original code file corresponding to the changed code file; Compare the original code file and the changed code file, determine the palm-swipe payment class code whose business logic has changed in the changed code file based on the comparison result, and obtain the original code corresponding to the palm-swipe payment class code from the original business code file; From each historical call record, obtain at least one target call record associated with the original code, and determine the original system use case in the at least one target call record as the target system use case affected in this modification; wherein each of the historical call records is based on a first call record containing a first mapping relationship between the corresponding original system use case and the associated call interface, and is generated by the call data of the call interface to at least one original code, and the original code originates from an original code file associated with the one original system use case.

11. A device for analyzing the scope of influence of a change code, characterized in that: include: A detection unit, configured to obtain the changed code file and the original code file corresponding to the changed code file when detecting that a changed code file obtained by a modification operation exists in the system; An analyzing unit, configured to compare the original code file with the changed code file, obtain the changed code with the changed business logic based on the comparison result, and obtain the original code corresponding to the changed code from the original code file; From each historical call record, obtain at least one target call record associated with the original code, and determine the original system use case in the at least one target call record as the target system use case affected in this modification; wherein each of the historical call records is based on a first call record containing a first mapping relationship between the corresponding original system use case and the associated call interface, and is generated by the call data of the call interface to at least one original code, and the original code originates from an original code file associated with the one original system use case.

12. A device for analyzing the scope of influence of a code change, characterized in that: The device is applied in a payment service scenario, including: A detection unit, configured to obtain the changed code file and the original code file corresponding to the changed code file when detecting that a changed code file obtained by a modification operation exists in the payment service system; An analysis unit is used to compare the original code file with the changed code file, determine the palm-swipe payment class code whose business logic has changed in the changed code file based on the comparison result, and obtain the original code corresponding to the palm-swipe payment class code from the original business code file; From each historical call record, obtain at least one target call record associated with the original code, and determine the original system use case in the at least one target call record as the target system use case affected in this modification; wherein each of the historical call records is based on a first call record containing a first mapping relationship between the corresponding original system use case and the associated call interface, and is generated by the call data of the call interface to at least one original code, and the original code originates from an original code file associated with the one original system use case.

13. A computer device, characterized in that: It includes a processor and a memory, wherein the memory stores program code, and when the program code is executed by the processor, the processor executes the steps of the method described in any one of claims 1 to 9, or executes the steps of the method described in claim 10.

14. A computer-readable storage medium, characterized in that: It includes program code, and when the program code is run on a computer device, the program code is used to enable the computer device to execute the steps of the method described in any one of claims 1 to 9, or execute the steps of the method described in claim 10.

15. A computer program product, characterized in that The method comprises computer instructions, which, when executed by a processor, implement the steps of the method described in any one of claims 1 to 9, or execute the steps of the method described in claim 10.