Positioning method and device in event change, electronic equipment and storage medium
By calculating file dependencies and constructing an undirected graph, a breadth-first search algorithm is used to locate coupled files and calculate their degree of responsibility. This solves the problem of low accuracy and efficiency caused by relying on manual handling of event changes in the financial internet, and enables rapid and accurate location and recovery of the production environment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-26
- Publication Date
- 2026-04-10
AI Technical Summary
In the large-scale collaborative software development process of the financial internet, relying on manual handling of event changes leads to low accuracy and efficiency of changes, and makes it impossible to quickly and accurately locate coupled files and responsible parties, affecting the recovery of the production environment.
By identifying abnormal code files based on abnormal events, obtaining historical change event sets, calculating and clustering file dependencies, constructing an undirected graph of dependency loss, using a breadth-first search algorithm to locate coupled files, calculating responsibility degree, and notifying the target responsible object.
Quickly and accurately locate coupled files and responsible parties, significantly shorten the problem investigation path, improve the efficiency and accuracy of incident changes, and ensure rapid recovery of the production environment.
Smart Images

Figure CN121833013A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of big data or other related technical fields, in particular, to a positioning method in event change, an apparatus thereof, an electronic device and a storage medium. BACKGROUND
[0002] In the large-scale software collaborative development process of modern financial Internet, one-time functional requirements or batch system terminal defect repair (collectively referred to as "event change") often involves the modification of multiple code files, and there are usually complex logical dependencies or data dependency relationships between these files; the change process is relatively complex, and once a batch system interruption problem occurs in the production environment, the impact is wide and the amount involved is large, at which time multiple event changes need to be completed within a specified time window to restore the production environment; therefore, when introducing event change requirements, it is necessary to meet the conditions of rapid and accurate positioning of coupled files and responsible objects to complete the interruption recovery with the least number of changes.
[0003] In related technologies, such changes are handled in a manual manner, and test or operation and maintenance personnel need to manually sort out the submission history of the version control system to determine which file changes belong to the same functional module or have dependency coupling according to the submission information, file path and personal experience, and locate the corresponding responsible personnel to notify the change. This way has low processing efficiency and accuracy and cannot meet the requirements of rapid and accurate positioning of event changes in the financial field.
[0004] To address the above problems, no effective solutions have been proposed so far. SUMMARY
[0005] Embodiments of the present application provide a positioning method in event change, an apparatus thereof, an electronic device and a storage medium to at least solve the technical problem of low change accuracy and change efficiency in related technologies that rely on manual handling of event changes.
[0006] According to an aspect of an embodiment of the present application, a positioning method in event change is provided, including: determining an abnormal code file based on an abnormal event, and obtaining a set of historical change events earlier than the occurrence of the abnormal event; calculating a file dependency amount of a code file based on the set of historical change events, clustering the code file based on the file dependency amount, and constructing a dependency loss undirected graph based on the clustering result; based on the abnormal code file, performing a search in the dependency loss undirected graph using a breadth-first search algorithm to obtain a coupled file list corresponding to the abnormal code file; calculating a responsibility degree of each responsible object for the coupled file list based on historical change information of each coupled file in the coupled file list, and configuring a target responsible object for the abnormal event based on the responsibility degree, and sending an event change notification to the target responsible object.
[0007] According to another aspect of the embodiments of the present application, there is also provided a positioning device in event change, comprising: an acquisition unit configured to determine an abnormal code file based on an abnormal event, and acquire a set of historical change events occurring earlier than the abnormal event; a calculation unit configured to calculate a file dependency amount of the code file based on the set of historical change events, cluster the code file based on the file dependency amount, and construct a dependency loss undirected graph based on a clustering result; a search unit configured to search in the dependency loss undirected graph based on the abnormal code file using a breadth-first search algorithm to obtain a coupled file list corresponding to the abnormal code file; and a configuration unit configured to calculate a responsibility degree of each responsible object to the coupled file list based on historical change information of each coupled file in the coupled file list, configure a target responsible object for the abnormal event based on the responsibility degree, and send an event change notification to the target responsible object.
[0008] According to another aspect of the embodiments of the present application, there is also provided a computer readable storage medium comprising a stored computer program, wherein the computer readable storage medium controls a device in which the computer readable storage medium is located to perform any of the positioning methods in event change when the computer program runs.
[0009] According to another aspect of the embodiments of the present application, there is also provided an electronic device comprising one or more processors and a memory, the memory being configured to store one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement any of the positioning methods in event change.
[0010] According to another aspect of the embodiments of the present application, there is also provided a computer program product comprising a computer program, wherein the computer program, when executed by a processor, implements any of the positioning methods in event change.
[0011] In the present application, by the following steps: determining an abnormal code file based on an abnormal event, and acquiring a set of historical change events occurring earlier than the abnormal event, calculating a file dependency amount of the code file based on the set of historical change events, clustering the code file based on the file dependency amount, and constructing a dependency loss undirected graph based on a clustering result, then searching in the dependency loss undirected graph based on the abnormal code file using a breadth-first search algorithm to obtain a coupled file list corresponding to the abnormal code file, and finally calculating a responsibility degree of each responsible object to the coupled file list based on historical change information of each coupled file in the coupled file list, configuring a target responsible object for the abnormal event based on the responsibility degree, and sending an event change notification to the target responsible object.
[0012] In the present application, for an abnormal event, a historical change event occurring earlier than the abnormal event is invoked, the historical change event is analyzed, the frequency and intensity of the code files appearing together in the event change are reflected by calculating the dependency quantity, the code files are classified and integrated according to the file dependency quantity by using a clustering algorithm, a coupled file cluster is formed, a dependency quantity loss undirected graph is then constructed, and by using a breadth-first search algorithm, the coupled network of the abnormal code file is explored in the constructed dependency quantity loss undirected graph, the files meeting the coupling threshold are screened, a coupled file list is formed, and it is ensured that the change covers all associated files, thereby quickly locating the coupled files, significantly reducing the problem troubleshooting path, shortening the production environment recovery time, improving the event change efficiency and change accuracy, and quickly locating the responsible object by calculating the responsibility degree, quickly and effectively performing the event change, and thus solving the technical problems of low change accuracy and change efficiency in the related art in which the event change is processed by relying on manual processing. BRIEF DESCRIPTION OF DRAWINGS
[0013] The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application. In the drawings:
[0014] Figure 1 A hardware structure block diagram of a computer terminal (or mobile device) for implementing the positioning method in event change is shown;
[0015] Figure 2 is a flowchart of an optional positioning method in event change according to an embodiment of the application;
[0016] Figure 3 is a schematic diagram of an optional positioning flow in event change according to an embodiment of the application;
[0017] Figure 4 is a schematic diagram of an optional file dependency quantity loss undirected graph according to an embodiment of the application;
[0018] Figure 5 is a schematic diagram of an optional positioning device in event change according to an embodiment of the application;
[0019] Figure 6 is a hardware structure block diagram of an electronic device (or mobile device) for implementing the positioning method in event change according to an embodiment of the application. DETAILED DESCRIPTION
[0020] In the following, the technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all the other embodiments obtained by a person of ordinary skill in the art without creative work should belong to the protection scope of the present application.
[0021] It should be noted that the terms "first", "second" and the like in the description and claims of the present application and the above drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but can include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0022] It should be noted that the positioning method and device in the event change in the present application can be used in the field of big data technology for positioning coupled files and responsible objects based on dependency, and can also be used in any field other than the field of big data technology for positioning coupled files and responsible objects based on dependency. The application field of the positioning method and device in the event change in the present application is not limited.
[0023] It should be noted that the information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for display, analyzed data, etc.) involved in the present application are information and data authorized by the user or authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of related data comply with relevant laws, regulations and standards, necessary security measures are taken, do not violate public order and good customs, and provide corresponding operation portal for user to choose authorization or refusal. For example, the system and related users or institutions are provided with an interface to provide the user with a corresponding operation portal for the user to choose to agree or refuse the automatic decision result; if the user chooses to refuse, the expert decision process is entered.
[0024] The following embodiments of the present application can be applied to the positioning system / application / device in various event changes. The present application calculates the frequency and intensity of the files co-occurring in event changes by relying on the dependency, clusters the files based on the dependency, and constructs a dependency loss undirected graph. The breadth-first search algorithm is adopted to start from the abnormal code file in the constructed dependency loss undirected graph, explore the coupling network thereof, screen the files meeting the coupling threshold, form a coupling file list, ensure that all coupling files are covered by the change, calculate the responsibility degree of each developer based on the historical change information of each file in the coupling file list, scientifically and reasonably perform responsibility positioning, thereby quickly and accurately completing the event change, and improving the change accuracy and change efficiency.
[0025] The present application will be described in detail below in conjunction with various embodiments.
[0026] Embodiment one
[0027] According to the embodiments of the present application, an embodiment of a positioning method in event change is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described herein can be executed in a different order.
[0028] The method embodiment provided by the embodiment one of the present application can be executed in a mobile terminal, a computer terminal, or a similar computing device. Figure 1 A hardware structure block diagram of a computer terminal (or mobile device) for implementing the positioning method in event change is shown. As shown in Figure 1 , the computer terminal 10 (or mobile device) can include one or more (in the figure, 102a, 102b, …, 102n are shown) processors 102 (the processor 102 can include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication function. In addition, it can also include a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which can be included as one of the ports in the BUS bus), a network interface, a power supply and / or a camera. Those skilled in the art can understand that Figure 1 The structure shown is only schematic, which does not limit the structure of the above-mentioned electronic device. For example, the computer terminal 10 can also include more or fewer components than those shown in Figure 1 , or have a different configuration than Figure 1 .
[0029] It should be noted that the one or more processors 102 and / or other data processing circuitry described above can be generally referred to herein as "data processing circuitry". The data processing circuitry can be embodied in whole or in part as software, hardware, firmware, or any combination thereof. In addition, the data processing circuitry can be a single standalone processing module or incorporated in whole or in part within any of the other elements of the computer terminal 10 (or mobile device). As referred to in embodiments of the present application, the data processing circuitry functions as a processor to control, for example, the selection of the variable resistance terminal path in connection with the interface.
[0030] The memory 104 can be used to store software programs of application software and modules, such as program instructions / data storage means corresponding to the positioning method in event change in embodiments of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, i.e. implements the positioning method in event change described above. The memory 104 can include a high-speed random access memory and can further include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 can further include a memory disposed remotely with respect to the processor 102, which can be connected to the computer terminal 10 through a network. Examples of the network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0031] The transmission device 106 is used to receive or send data via a network. Specific examples of the network can include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network interface controller (NIC) that can be connected to other network devices through a base station to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module used to communicate with the Internet in a wireless manner.
[0032] The display can be, for example, a touch screen type liquid crystal display (LCD) that enables a user to interact with the user interface of the computer terminal 10 (or mobile device).
[0033] In the above operating environment, the present application provides a positioning method in event change as shown in Figure 2 The embodiment of the present application is a positioning system in event change.
[0034] Figure 2 is a flowchart of an optional positioning method in event change according to an embodiment of the present application, as shown in Figure 2As shown, the method comprises the following steps:
[0035] The existing event change relies on manual positioning, manually screens coupled files and issues change tasks to developers, and has the following core pain points: first, low efficiency, manual analysis is time-consuming and lengthy, which is contrary to the concept of pursuing quick response in the financial field, especially in major changes involving dozens or hundreds of files, which is almost impossible; second, accuracy is difficult to guarantee, relying on personal experience to judge the dependency relationship and data coupling between files and errors and omissions may occur, which may ignore some implicit dependent files with high historical co-occurrence frequency but not modified this time, resulting in incomplete file inspection; third, the responsibility is ambiguous, a file may be modified by multiple people multiple times, how to objectively and quantitatively judge who is the main responsible person for this change, rather than simply issuing tasks, and there is a lack of a fair and scientific basis for responsibility positioning.
[0036] The embodiment of the application aims to systematically solve the above problems and provide an automatic and intelligent solution, the core of which is to solve how to complete the one-time submission of abnormal files and coupled files with data coupling relationship in a time change, and find out the main responsible object, so as to greatly shorten the problem investigation path and improve the team cooperation efficiency.
[0037] Step S201, determining abnormal code files based on abnormal events, and obtaining a set of historical change events earlier than the abnormal events.
[0038] In the above step S201, the abnormal event refers to the batch system interruption or function abnormality observed in the production environment, which needs to be repaired or optimized through event change. The abnormal code file is the specific code file that causes the abnormal event, which can be determined through system monitoring and log analysis. The set of historical change events includes all code file change records before the occurrence of the abnormal event, which can be derived from the version control system, such as the historical submission of Git.
[0039] Once the production environment detects abnormal phenomena such as system performance degradation, function failure, or batch interruption, the abnormal event response process is immediately started. This includes but is not limited to automatic alarm, preliminary troubleshooting, etc. to determine the specific performance and impact range of the abnormality. Through the performance characteristics of the abnormal event and system logs, the code file that triggered the abnormality is accurately identified. This includes but is not limited to analyzing stack traces, error messages, and system state information to determine the direct cause of the abnormality. After determining the abnormal code file, the version control system is turned to and all change records before the abnormal event date are collected. The key to this step is to set appropriate query parameters to ensure that the data captured covers all relevant changes and is not too large, affecting subsequent processing speed. For example, in Git, the git log --since="YYYY-MM-DD" command can be used to extract the change event set before the specified date.
[0040] Through the above step S201, the association between abnormal events and past code changes is established, laying a solid foundation for subsequent dependency calculation and file clustering. By obtaining the historical change event set, the modification history of the abnormal code file and its coupled files can be deeply understood, and the possible fault source and potential impact range can be identified.
[0041] Step S202, calculate the file dependency of the code file based on the historical change event set, cluster the code file based on the file dependency, and construct the dependency loss undirected graph based on the clustering result.
[0042] In step S202, file dependency is used to quantify the association strength between different code files due to their common presence in the historical change event set. For each pair or multiple pairs of code files in the historical change event set, the dependency between them is calculated. This involves counting the frequency of two or more code files participating in change events together, and comparing the amount of change in the change event, so as to obtain a quantitative indicator reflecting the coupling strength between files. Based on the calculated file dependency, a clustering algorithm is used to group all code files. The core goal of clustering is to group highly coupled files together, reduce unnecessary change operations, and ensure the comprehensiveness of changes. According to the clustering result, a dependency loss undirected graph is constructed. In the undirected graph, each code file represents a node, and the dependency loss between files represents the connection strength between nodes. Through the graph structure, it can be clearly seen which groups of files need special attention when changing, and which files' changes may have a chain reaction on the system.
[0043] The introduction of quantitative analysis and graph theory methods realizes the deep understanding and optimized management of the dependency relationship between code files. In the process of handling event changes, the final decision is based on objective data rather than artificial experience, thereby improving the accuracy and efficiency of change operations.
[0044] Further, the step of calculating the file dependency of the code files based on the set of historical change events comprises: extracting the historical change events and the code files involved in each historical change event from the set of historical change events; constructing an event change matrix based on the historical change events and the code files involved in each historical change event; constructing a code file subset for the code files, and calculating the change probability of the historical change events for the code file subset according to the event change matrix to obtain the file dependency of the code files.
[0045] Specifically, all change records in a specific time range are selected from the historical change event set using the history record function of the version control system. Each historical change event is associated with a set of code files that are modified or added or deleted in the change range. According to the information extracted from the historical change event set, an event change matrix is constructed. The rows of the matrix represent the historical change events, the columns represent the code files in the system, and each element in the matrix represents whether the corresponding code file is modified by the change event. In this way, it can be clearly seen which files are affected by each change event.
[0046] For example, the entire system has 4 files (F is the set of system files), and there are five event changes in the history Assume that the files affected by the four event changes are as follows:
[0047] ;
[0048] The corresponding event change matrix EM can be represented as:
[0049] .
[0050] The code files in the set of historical change files are combined to construct a code file subset, and the change probability of the historical change events for each selected code file subset is calculated using the event change matrix. This probability reflects the frequency of change events in the historical change events under the condition of a specific code file combination, thereby obtaining the file dependency of the code files to quantify the dependency relationship between the code files.
[0051] By constructing the event change matrix and calculating the file dependency of the code files, the coupling between the code files can be systematically revealed, and the scientificity and rationality of the change decision can be improved. Not only the probability of system instability caused by changes is reduced, but also the change process is optimized by quantifying the dependency relationship, thereby ensuring the comprehensiveness and effectiveness of the changes.
[0052] Further, the step of constructing a code file subset from the code files and calculating the change probability of the historical change events on the code file subset according to the event change matrix comprises: combining the code files to obtain the code file subset; constructing the event change matrix based on the dependency relationship between the code files and the historical change events, wherein the dependency relationship between the code files and the historical change events is represented in the case that the code files exist change in the historical change events; calculating the file quantity ratio of the code file quantity in the code file subset to the total code file quantity in the historical change event set according to the event change matrix, and calculating the dependency sampling probability of the code file subset based on the file quantity ratio; calculating the event quantity ratio of the historical change event quantity containing the code file subset to the total historical change event quantity in the historical change event set according to the event change matrix, and calculating the dependency submission probability of the historical change event corresponding to the code file subset based on the event quantity ratio; and calculating the change probability of the historical change events on the code file subset based on the dependency sampling probability and the dependency submission probability.
[0053] Specifically, the code files are combined to form a plurality of different code file subsets , for example: ) represents , and a code file subset composed of three code files. Then, the information in the historical change event set is used to construct the event change matrix, each row of the matrix corresponds to a historical change event, and each column represents a code file. The non-zero elements in the matrix represent that the file is modified in the event. For each constructed code file subset, the ratio of the file quantity in the subset to the total file quantity in the system is calculated to quantify the size of the subset and the coverage in the system. Based on the file quantity ratio, the probability of selecting the code file subset from the random sampling of the system is calculated to obtain the dependency sampling probability, which reflects the relative importance and commonality of the subset in the system file set. The number of rows in the event change matrix that intersect with the code file subset, i.e., the number of historical change events involving at least one file in the subset, is counted, and then the ratio of this number to the total number of historical change events is calculated to evaluate the importance of the subset in the historical change. According to the event quantity ratio, the probability that a random event change involves the subset when a given code file subset is calculated to obtain the dependency submission probability, which measures the coupling and dependency of the subset in the historical change. By combining the dependency sampling probability and the dependency submission probability, the change probability of each historical change event on a specific code file subset is calculated using a formula or algorithm, thereby quantifying the dependency relationship and the tendency of common change of the file subset in the historical data.
[0054] More specifically, assuming represents a randomly selected code file subset The dependencies between files in the file system. This represents a subset of files randomly selected from the total system file set. The larger the value, the more the set of files that need to be interdependent and committed, derived from the entire set of historical change events (EM), is biased towards... .
[0055] Therefore, when C contains only one value... There is a maximum value (n). This inevitably leads to the possibility of a single file being committed separately, when C contains all files. Since there is a minimum value (i.e., it's impossible for all files to require dependency commits), the optimization goal of this application is to find as many as possible... Given the number of elements, make It has a local maximum. The dependency is... It can be represented as:
[0056] ;
[0057] This indicates extraction during file dependency sampling. The probability of a file being included, i.e., the probability of dependency sampling, where This indicates retrieving a random subset of files from the system file set (e.g.: During algorithm initialization, assume... for The proportion of files in the middle to the total number of files. k is The number of elements, where n is the total number of files. Represented as:
[0058] ;
[0059] and When making a file dependency commit, once it is determined... Extracting event changes based on a subset of documents The probability of dependency submission is expressed by the following formula:
[0060] ;
[0061] ;
[0062] in Indicates inclusion Event changes corresponding to the file subset The proportion of the total number of event changes, k is... The number of elements, where m is the total number of event changes, and its physical meaning represents the number of events. Sub-event change This may involve a subset of code files. The probability of change.
[0063] Before performing file clustering, the event change matrix EM needs to be converted into an event change probability matrix EPM. Based on the example event change matrix EM above, the change probability matrix EPM can be obtained as follows:
[0064] .
[0065] Furthermore, the steps for clustering code files based on file dependencies include: Step 1, treating each code file as a code file cluster, resulting in N code file clusters; Step 2, combining any two code file clusters to obtain a combined code file cluster, and calculating the dependency loss value of the combined code file cluster based on the file dependencies of the code files in the combined code file cluster; Step 3, selecting the target combined code file cluster with the smallest dependency loss value, merging the code file clusters in the target combined code file cluster, resulting in a new N-1 code file cluster; repeating steps 2 to 3 above until all code file clusters are merged to obtain the clustering result.
[0066] Specifically, during file clustering, each code file in the historical change event set is initialized as a separate code file cluster. Assuming there are N code files in the system, N independent clusters will initially form. From these N initial code file clusters, any two clusters are randomly selected and combined to form a combined code file cluster. The dependency loss value of this combined code file cluster is calculated. This value reflects the overall dependency strength of the merged cluster during the event change compared to the loss of a single file or the original separate clusters, and is a key indicator for evaluating the rationality of the merging behavior. Among all possible combined code file clusters, the cluster with the smallest dependency loss value is selected as the target combined code file cluster. The code file clusters within the target combined code file cluster are merged to form a new set of code file clusters. At this point, the total number of clusters will be reduced to N-1. The above steps of calculating the dependency loss value and merging code file clusters are repeated, continuously merging the remaining code file clusters until all code file clusters are integrated into the same cluster, completing the clustering process.
[0067] More specifically, the goal of document clustering is to find decision variables. To make it have the largest possible value of k, so that the target variable There are local maxima. This leads to clustering results, which include, but are not limited to, subsets of code files and their corresponding dependency loss values.
[0068] Through clustering, the code files are automatically aggregated into clusters with high relevance according to the file dependency amount, reducing the risk of isolated modification and ensuring the coherence and integrity of the change operation. The calculation of the dependency amount loss value enables the merging decision to be based on quantitative analysis rather than subjective judgment, which helps to build a more reasonable and efficient coupled file list.
[0069] Further, the step of constructing the dependency amount loss undirected graph based on the clustering result comprises: taking each code file as a bottom node, and constructing branch nodes from the bottom node to the upper layer based on the code file clusters in the clustering result, to obtain an initial undirected graph; and configuring a connection path for the initial undirected graph according to the dependency amount loss value of the combined code file cluster, wherein the length of the connection path is proportional to the dependency amount loss value.
[0070] Specifically, the dependency relationship of the code files is visually and quantitatively displayed by constructing the dependency amount loss undirected graph. Each code file is taken as a bottom node of the undirected graph to form the cornerstone of the structure graph. This is the first step of constructing the graph, which ensures that each code file has a clear position. The branch nodes are constructed from the bottom node to the upper layer based on the clustering result. This means that according to the merging order of the clustering algorithm, the relevant file clusters are gradually represented as higher-level nodes in the graph.
[0071] In the constructed undirected graph, a path is configured for the connection from the bottom node to the branch node. These paths not only connect the nodes, but also reflect the strength of the dependency relationship between the files through the path length. The path length is proportional to the dependency amount loss value of the combined code file cluster. That is, if the dependency amount loss value is large when two file clusters are merged, the path length connecting the two clusters in the graph will be longer, and vice versa. This design intuitively shows the strength of the dependency relationship between the file clusters.
[0072] By constructing the dependency amount loss undirected graph, the dependency relationship between the code files is presented in a graphical manner, which is easy to understand at a glance. By configuring the path length, the undirected graph intuitively quantifies the loss degree of the file dependency relationship in the clustering process, helping to identify those file clusters that need to be paid close attention to in the event change.
[0073] In step S203, based on the abnormal code file, a breadth-first search algorithm is used to search in the dependency amount loss undirected graph, to obtain a coupled file list corresponding to the abnormal code file.
[0074] In step S203, the identified abnormal code file is taken as the starting point of the breadth-first search algorithm based on the constructed dependency loss undirected graph. This ensures that the algorithm focuses on the real problem area rather than expanding the search globally without discrimination. A queue is set up, and the abnormal code file is enqueued as the starting point of the search. At the same time, a flag array or similar data structure is established to record which nodes in the graph have been visited. The first node (i.e., the abnormal code file) is taken from the queue, and all adjacent nodes connected to it are viewed. The dependency loss value between each adjacent node and the abnormal code file is calculated as the basis for the next expansion. The unvisited adjacent nodes are inserted into the tail of the queue and marked as visited, and the next level of search is continued. During the search process, all nodes that are marked as "visited" and meet the preset dependency loss threshold condition are collected and added to the coupling file list. The breadth-first search algorithm ensures that the search order is prioritized according to the shortest path from the abnormal code file, so that the files in the list are the most highly coupled and most directly affect the abnormal code file.
[0075] Further, based on the abnormal code file, the step of searching in the dependency loss undirected graph using the breadth-first search algorithm to obtain the coupling file list corresponding to the abnormal code file includes: step one, defining a dependency loss threshold; step two, locating the abnormal node corresponding to the abnormal code file in the dependency loss undirected graph, and taking the abnormal node as the search starting point; step three, scanning the neighborhood nodes of the search starting point from the search starting point; step four, constructing a coupling path based on the search starting point and the neighborhood nodes, calculating the path length of the coupling path based on the length of the connection path, and taking the neighborhood nodes as new search nodes; repeating steps three to four to expand the coupling path until the path length of the coupling path is greater than the dependency loss threshold, and stopping the expansion of the coupling path; obtaining the coupling file list corresponding to the abnormal code file based on all coupling paths corresponding to the abnormal code file.
[0076] Specifically, when performing breadth-first search, a dependency loss threshold is preset. This threshold is a standard for determining whether a file is sufficiently coupled and needs to be considered in event changes. The dependency loss threshold can be set based on the experience of architects. For example, if a system in the production environment of the current version has a disruption exception, the developer analyzes that the cause of the exception is a public parent class file . That is, when the public parent class is modified, the coupling file list may include the child class file , ; and if the located abnormal file is a child class file , only needs to be set.
[0077] Subsequently, the node representing the abnormal code file is found in the dependency loss lossless graph, and the abnormal node is taken as the starting node of the search, and a breadth-first search algorithm is started. The algorithm first checks all the adjacent nodes of the starting node, i.e. other file nodes directly related to the abnormal code file. For each adjacent node, the algorithm evaluates its dependency path length (dependency loss value) from the starting node, and decides whether to include it in the coupling file list based on this. If the path length is lower than the preset dependency loss threshold, the algorithm will continue to explore the adjacent nodes corresponding to the current adjacent node from the current adjacent node to build a more complete coupling file network. After completing the breadth-first search from the abnormal code file node, all adjacent nodes with a path length lower than the threshold value will be recorded. These recorded nodes constitute the coupling file list of the abnormal code file, i.e. the set of related code files that need to be considered and modified together in the event change.
[0078] By performing a quick search in the lossless graph through the breadth-first search algorithm, all files coupled with the abnormal code file can be quickly located, avoiding the blind modification of a large number of irrelevant codes, thereby saving time and resources.
[0079] More specifically, the distance between two files and can be represented by the accumulation of the lengths of each segment of the path:
[0080] ;
[0081] By defining a threshold value and giving an abnormal file , the coupling files associated with the abnormal file that meet the threshold value can be retrieved in the lossless graph through the breadth-first search algorithm:
[0082] .
[0083] Step S204, calculate the responsibility degree of each responsible object for the coupling file list based on the historical change information of each coupling file in the coupling file list, and configure the target responsible object for the abnormal event based on the responsibility degree, and send an event change notification to the target responsible object.
[0084] In step S204, after the coupling files directly involved in the current interrupt exception are located, the responsible objects for each code file can be determined based on the obtained coupling file list. The responsible objects can be human or machine (e.g., computer, robot, virtual digital object, etc.). The responsibility degree of each responsible object for the coupling file list is calculated based on the historical change information of each responsible object for each coupling file. The target responsible object is configured for the current exception event based on the responsibility degree, and the event change is notified in real time.
[0085] Further, the step of calculating the responsibility degree of each responsible object for the coupling file list based on the historical change information of each coupling file in the coupling file list and configuring the target responsible object for the exception event based on the responsibility degree includes: obtaining the historical change information involved in each coupling file, wherein the historical change information at least includes: historical change participant, historical change time, historical change record; performing feature extraction on the historical change information, and performing weighted calculation on the extracted features to obtain the responsibility degree of each historical change participant for the coupling file list; and selecting the historical change participant with the maximum responsibility degree value as the target responsible object of the exception event.
[0086] Specifically, the historical change records of all code files in the coupling file list are extracted from the version control system, including but not limited to historical change participant, historical change time, historical change record, etc. Based on the collected historical change information, a calculation model is constructed to quantify the contribution degree of each responsible object to the coupling file list. The calculation of the responsibility degree may consider multiple dimensions such as time proximity and modification size, for example, the latest modification time and larger line number change will make the responsibility degree higher. According to the calculated responsibility degree, those persons or machines mainly responsible for the change of the files in the coupling file list are identified as the target responsible object. The target responsible object is sent an event change notification to inform the system interruption and the coupling file list that needs to be changed. The notification may include specific change guidelines, priority suggestions and expected change time window, so that the target responsible object can timely perform event change, thereby speeding up the recovery of the system and reducing the interruption time.
[0087] More specifically, assuming that in the current exception event, the historical change information involved in the code files in the coupling file list is as follows: Wherein, author represents the historical change participant, timestamp represents the historical change time, added represents the added line number at the historical change time, and deleted represents the deleted line number at the historical change time.
[0088] To assign responsibility to specific individuals, all information is weighted, with increasing the number of lines significantly impacting accountability. Later submissions impose stricter testing time requirements, thus increasing accountability. Therefore, for files related to event changes... Give Responsibility function:
[0089] ;
[0090] ;
[0091] in represent The change time is at the minimum timestamp of the current month. and maximum timestamp (t = current version month) represents the proportion of time. Documents representing event changes middle Increase the number of rows, Documents representing event changes middle The number of rows deleted. Record the responsibility level of each responsible party in a table, select the responsible parties with higher scores as the target responsible parties for this event change, and notify them of the event change via email.
[0092] Through the above steps, the abnormal code file is identified based on the abnormal event, and a set of historical change events that occurred earlier than the abnormal event is obtained. The file dependencies of the code file are calculated based on the set of historical change events. The code files are clustered based on the file dependencies, and an undirected graph of dependency loss is constructed based on the clustering results. Then, based on the abnormal code file, a breadth-first search algorithm is used to search the undirected graph of dependency loss to obtain a list of coupled files corresponding to the abnormal code file. Finally, the responsibility degree of each responsible object to the coupled file list is calculated based on the historical change information of each coupled file in the coupled file list. Based on the responsibility degree, a target responsible object is configured for the abnormal event, and an event change notification is sent to the target responsible object.
[0093] In this embodiment, for an abnormal event, historical change events occurring earlier than the abnormal event are invoked, the historical change events are analyzed, the frequency and intensity of the code files appearing together in the event change are reflected by calculating the dependency quantity, the code files are classified and integrated according to the file dependency quantity by using a clustering algorithm, a coupled file cluster is formed, a dependency quantity loss undirected graph is then constructed, and by using a breadth-first search algorithm, the coupled network of the abnormal code file is explored in the constructed dependency quantity loss undirected graph, the files meeting the coupling threshold are screened, and a coupled file list is formed, so that the change covers all associated files, thereby quickly locating the coupled files, significantly reducing the problem troubleshooting path, shortening the production environment recovery time, improving the event change efficiency and change accuracy, and quickly locating the responsible object by calculating the responsibility degree, quickly and effectively performing the event change, and thus solving the technical problems of low change accuracy and low change efficiency in the related art.
[0094] Another optional specific embodiment will be described in detail below.
[0095] Figure 3 is a schematic diagram of an optional positioning process in event change according to an embodiment of the application, as shown in Figure 3 The positioning process in event change includes:
[0096] Step 1, access the original data source and obtain data;
[0097] Once the production environment detects abnormal phenomena such as system performance degradation, function failure or batch interruption, the abnormal event response process is immediately started. It includes but is not limited to automatic alarm, preliminary fault diagnosis, etc. to determine the specific performance and impact range of the abnormality. Through the performance characteristics of the abnormal event and the system log, the code file causing the abnormality is accurately identified. It includes but is not limited to analyzing the stack trace, error message and system state information to determine the direct cause of the abnormality. After determining the abnormal code file, the version control system is turned to and all change records earlier than the occurrence date of the abnormal event are collected. The key of this step is to set appropriate query parameters to ensure that the data captured covers all related changes and is not too large, affecting the subsequent processing speed. For example, in Git, the git log --since="YYYY-MM-DD" command can be used to extract the change event set before the specified date.
[0098] Step 2, data preprocessing;
[0099] The code files are cleaned and noise files such as mirror deployment files, log files, build files and part of configuration files are removed. The event change caused by a single event after data cleaning can be represented by a vector E:
[0100] ;
[0101] where n is the total number of files in the whole system, when =1, it means that the code change affects the file , if not, it takes 0.
[0102] The event change set is a set from a certain time to the latest event change, which can be represented by matrix EM:
[0103] ;
[0104] For example, the whole system has 4 files (F is the set of system files), and there are five event changes in history , assuming that the 4 event changes affect the files as follows:
[0105] ;
[0106] The corresponding event change matrix EM can be represented as:
[0107] .
[0108] Step three, calculate the file dependency amount;
[0109] Assume represents the dependency between files in the randomly selected code file subset , and represents the subset composed of randomly selected files from the total file set of the system, when is larger, it means that the file set that needs to be submitted with mutual dependency deduced from the event change set EM is more biased towards .
[0110] Therefore, when C contains only one value, has a maximum value (n necessarily deduces the possibility of a single file submission), when C contains all the files, has a minimum value (i.e. it is impossible for all files to be submitted with dependency), so the optimization goal of the present application is to find as many element numbers as possible under the premise of making have a local maximum. The dependency amount can be represented as:
[0111] ;
[0112] When sampling file dependency, the number of files in the subset The probability of a file being selected, i.e. the dependency sampling probability, is denoted by , where is the set of all files in the system. At the initialization of the algorithm, let be the total number of files in the system, and be the number of files in , k be the number of elements in , and n be the total number of files, is denoted by
[0113]
[0114] The probability of a file being selected, i.e. the dependency sampling probability, is denoted by
[0115]
[0116]
[0117]
[0118] The event change matrix EM is then converted into the event change probability matrix EPM before the file clustering is performed. According to the event change matrix EM in the above example, the event change probability matrix EPM can be obtained as
[0119]
[0120] Step 4: File clustering
[0121] The goal of the file clustering is to find the decision variable with the largest possible k value, so that the objective variable has a local maximum. The clustering process includes:
[0122] First, each code file is separately coded into a cluster , forming n code file clusters (n is the total number of files, k is the number of files in , here ), so that each has a maximum value;
[0123] Second, two random of the first step (here, we use and to represent, ), are merged into a new (here, we use to represent, );
[0124] Repeat the second step, with the merging of , each merged dependent amount will gradually lose, which can be seen as the uncertainty of the merged prediction file dependency, the amount of lost dependency each time the merger is represented as:
[0125] ;
[0126] The new code file cluster formed by the merger of and constitutes the new event change probability distribution, and in the subsequent merging iteration, we use to represent the weighted probability distribution of and , which is represented as:
[0127] ;
[0128] Bring into to get the code file cluster and loss of dependent amount after merging:
[0129] ;
[0130] where,
[0131] ;
[0132] ;
[0133] The principle of file dependency clustering is to merge all code file clusters and two by two, and then find the smallest , which shows that the merging of file sets and can get the smallest loss of dependent amount, that is, the file sets and It's highly likely that the file will depend on the commit during event changes; then, repeat the above iterative steps until a threshold is reached; after several rounds of iterative file dependency clustering, find several sets of files that may depend on the commit. Applying the above file dependency clustering, we can obtain... The matrix is shown below (Note: The matrix contains the merged files. and The amount of dependency lost later ):
[0134] ;
[0135] As shown in the diagram above, elements on the diagonal are disregarded because merging elements within the same file is meaningless; clearly, merging... and Dependency loss in the first iteration At least, because in the event change set EM, and The number of dependent commits is the highest among all pairwise commits. Therefore, merging is chosen in the first iteration. and Thus, the merged event change probability matrix EPM can be obtained:
[0136] ;
[0137] The above The third line represents the period before the merger. Weighted probability distribution after merging the first and third rows of the matrix The merged The matrix is as follows:
[0138] ;
[0139] From the above The matrix shows that the next file to be merged is... and and will and Merged, because two places appeared. Therefore, It is split off as a new subset to form a new cluster.
[0140] This yields clustering results, which include, but are not limited to, subsets of code files and the corresponding dependency loss values for those subsets.
[0141] Step 5: Construct an undirected graph;
[0142] Using the file dependency clustering algorithm described above, a list of coupled files for abnormal files can be obtained, and an undirected graph of file dependency loss can be constructed from this list. Figure 4 This is an optional schematic diagram according to an embodiment of the present invention, such as... Figure 4 As shown, the nodes at the bottom level of the undirected graph represent all the system's code files. Figure 4 China and Israel , , , (For illustration purposes only), from bottom to top, represents the subset of code files obtained from the clustering results. Figure 4 China and Israel , , (For illustration purposes) Bottom-level nodes are connected to upper-level nodes via edges. The dependency loss value represents the path length between nodes; the longer the path, the lower the coupling between the two nodes.
[0143] Step six, define the threshold;
[0144] When performing a breadth-first search, a dependency loss threshold should be pre-defined. This threshold is a standard for determining whether files are sufficiently coupled and needs to be considered in event changes. The dependency loss threshold can be set based on the architect's experience. For example, if the system experiences an interruption exception in the current production environment, and the developers analyze that the cause of the exception belongs to a common parent class file... When that happens, you need to set... That is, when the common parent class is modified, the coupled file list may include the subclass files. , If the exception file being located is a subclass file... You only need to set .
[0145] Step 7: Search the undirected graph for a list of coupled files that meet the threshold.
[0146] Define two files and The distance between them can be represented by the sum of the lengths of each path segment:
[0147] ;
[0148] By defining a custom threshold and providing an exception file Then, a breadth-first search algorithm can be used to search for samples that meet the threshold in an undirected graph. Exceptional files Associated coupling files:
[0149] ;
[0150] The breadth-first search algorithm can take a starting file node in an undirected graph as input; and output the shortest distance from the starting node to all reachable destination nodes, the breadth-first search code can be expressed as:
[0151] Initialize:
[0152] Create an empty queue Q to store neighbor nodes;
[0153] Create an array visited to record neighbor nodes and mark all elements as false;
[0154] Create an array distance to record the distance from to each node;
[0155] Start from the starting node :
[0156] visited[ ]=true;
[0157] distance[ ]=0;
[0158] (add to the queue Q);
[0159] Start traversing the path:
[0160] While(Q!=null);
[0161] Take a node from Q;
[0162] for ;
[0163] ;
[0164] ;
[0165] ;
[0166] (add to the queue Q);
[0167] Return .
[0168] Step eight, locate the responsible object.
[0169] Suppose the historical change information involved in the code file in the coupling file list in the current abnormal event is as follows: Where, author represents the participants in the historical change, timestamp represents the time of the historical change, added represents the number of rows added during the historical change, and deleted represents the number of rows deleted during the historical change.
[0170] To assign responsibility to specific individuals, all information is weighted, with increasing the number of lines significantly impacting accountability. Later submissions impose stricter testing time requirements, thus increasing responsibility. Therefore, for files related to event changes... Give Responsibility function:
[0171] ;
[0172] ;
[0173] in represent The change time is at the minimum timestamp of the current month. and maximum timestamp (t = current version month) represents the proportion of time. Documents representing event changes middle Increase the number of rows, Documents representing event changes middle The number of rows deleted. Record the responsibility level of each responsible party in a table, select the responsible parties with higher scores as the target responsible parties for this event change, and notify them of the event change via email.
[0174] This invention calculates the frequency and intensity of files co-occurring during event changes through dependency calculation. Based on these dependencies, files are clustered and an undirected dependency loss graph is constructed. A breadth-first search algorithm is used to explore the coupling network of the constructed dependency loss graph, starting with the abnormal code file. Files that meet the coupling threshold are selected to form a list of coupled files, ensuring that changes cover all coupled files. Based on the historical change information of each file in the coupled file list, the responsibility of each developer is calculated through a responsibility function, enabling scientific and reasonable responsibility allocation. This allows for the rapid and accurate completion of event changes, improving the accuracy and efficiency of changes.
[0175] The following is a detailed description with reference to another embodiment.
[0176] Example 2
[0177] The positioning device for event changes provided in this embodiment includes multiple implementation units, each of which corresponds to a specific implementation step in the above embodiment one. The specific implementation method and beneficial effects can be referred to the foregoing method embodiment, and will not be repeated here.
[0178] Figure 5 is a schematic diagram of an optional event change positioning device according to an embodiment of the application, as shown, the event change positioning device can comprise: an acquisition unit 51, a calculation unit 52, a search unit 53, a configuration unit 54, wherein, Figure 5
[0179] The acquisition unit 51 is configured to determine an abnormal code file based on an abnormal event, and acquire a historical change event set occurring earlier than the abnormal event;
[0180] The calculation unit 52 is configured to calculate a file dependency amount of the code file based on the historical change event set, cluster the code file based on the file dependency amount, and construct a dependency loss undirected graph based on the clustering result;
[0181] The search unit 53 is configured to search in the dependency loss undirected graph based on the abnormal code file using a breadth-first search algorithm to obtain a coupling file list corresponding to the abnormal code file;
[0182] The configuration unit 54 is configured to calculate a responsibility degree of each responsible object to the coupling file list based on historical change information of each coupling file in the coupling file list, configure a target responsible object for the abnormal event based on the responsibility degree, and send an event change notification to the target responsible object.
[0183] The above-mentioned event change positioning device, through the acquisition unit 51, determines an abnormal code file based on an abnormal event, and acquires a historical change event set occurring earlier than the abnormal event; through the calculation unit 52, calculates a file dependency amount of the code file based on the historical change event set, clusters the code file based on the file dependency amount, and constructs a dependency loss undirected graph based on the clustering result; through the search unit 53, searches in the dependency loss undirected graph based on the abnormal code file using a breadth-first search algorithm to obtain a coupling file list corresponding to the abnormal code file; through the configuration unit 54, calculates a responsibility degree of each responsible object to the coupling file list based on historical change information of each coupling file in the coupling file list, configures a target responsible object for the abnormal event based on the responsibility degree, and sends an event change notification to the target responsible object.
[0184] In the embodiment, for an abnormal event, historical change events occurring before the abnormal event are invoked, the historical change events are analyzed, the frequency and intensity of the code files appearing together in the event change are reflected by calculating the dependency quantity, the code files are classified and integrated according to the file dependency quantity by using a clustering algorithm, a coupled file cluster is formed, a dependency quantity loss undirected graph is then constructed, and the coupled network of the abnormal code file is explored in the constructed dependency quantity loss undirected graph by using a breadth-first search algorithm, the files meeting the coupling threshold are screened, a coupled file list is formed, and it is ensured that the change covers all associated files, thereby quickly locating the coupled files, significantly reducing the problem troubleshooting path, shortening the production environment recovery time, improving the event change efficiency and change accuracy, quickly locating the responsible object by calculating the responsibility degree, and quickly and effectively performing the event change, thereby solving the technical problems of low change accuracy and change efficiency in the related art in which the event change is processed by relying on manual processing.
[0185] Further, the computing unit comprises: a first extraction module configured to extract historical change events and code files involved in each historical change event from the historical change event set; a first construction module configured to construct an event change matrix based on the historical change events and the code files involved in each historical change event; and a first calculation module configured to construct a code file subset for the code files and calculate a change probability of the historical change events for the code file subset according to the event change matrix, to obtain file dependency quantities of the code files.
[0186] Further, the first calculation module comprises: a first combination submodule configured to combine the code files to obtain the code file subset; a first construction submodule configured to construct the event change matrix based on the dependency relationship between the code files and the historical change events, wherein the dependency relationship exists between the code file and the historical change event in the case that the code file has a change in the historical change event; a first calculation submodule configured to calculate a file quantity ratio of the number of code files in the code file subset to the total number of code files in the historical change event set according to the event change matrix, and calculate a dependency sampling probability of the code file subset based on the file quantity ratio; a second calculation submodule configured to calculate an event quantity ratio of the number of historical change events containing the code file subset to the total number of historical change events in the historical change event set according to the event change matrix, and calculate a dependency submission probability of the historical change events corresponding to the code file subset based on the event quantity ratio; and a third calculation submodule configured to calculate the change probability of the historical change events for the code file subset based on the dependency sampling probability and the dependency submission probability.
[0187] Further, the computing unit further comprises: a first module for step one, for taking each code file as a code file cluster to obtain N code file clusters; a second combination module for step two, for combining any two code file clusters to obtain a combined code file cluster, and calculating a dependency loss value of the combined code file cluster according to the file dependency amount of the code files in the combined code file cluster; a first merging module for step three, for selecting a target combined code file cluster with the minimum dependency loss value, and merging the code file clusters in the target combined code file cluster to obtain new N-1 code file clusters; and a first repetition module for repeating the above steps two to three until all code file clusters are merged to obtain a clustering result.
[0188] Further, the computing unit further comprises: a second construction module for taking each code file as a bottom layer node, and constructing a branch node from the bottom layer node upwards layer by layer with the code file clusters in the clustering result to obtain an initial undirected graph; and a first configuration module for configuring a connection path for the initial undirected graph according to the dependency loss value of the combined code file cluster, wherein the length of the connection path is proportional to the dependency loss value.
[0189] Further, the configuration unit comprises: a first definition module for step one, for defining a dependency loss threshold; a first positioning module for step two, for positioning an abnormal node corresponding to an abnormal code file in the dependency loss undirected graph, and taking the abnormal node as a search starting point; a first scanning module for step three, for scanning the neighborhood nodes of the search starting point from the search starting point; a second calculation module for step four, for constructing a coupling path based on the search starting point and the neighborhood nodes, calculating a path length of the coupling path based on the length of the connection path, and taking the neighborhood nodes as new search nodes; a first expansion module for repeating steps three to four, for expanding the coupling path until the path length of the coupling path is greater than the dependency loss threshold, and stopping the expansion of the coupling path; and a first acquisition module for acquiring a coupling file list corresponding to the abnormal code file based on all coupling paths corresponding to the abnormal code file.
[0190] Further, the configuration unit comprises: a second acquisition module for acquiring historical change information involved by each coupling file, wherein the historical change information at least comprises: a historical change participant, a historical change time, and a historical change record; a third calculation module for performing feature extraction on the historical change information, and performing weighted calculation on the extracted features to obtain a responsibility degree of each historical change participant to the coupling file list; and a first selection module for selecting a historical change participant with the maximum responsibility degree value as a target responsible object of an abnormal event.
[0191] It should be noted that the above obtaining unit 51, the calculating unit 52, the searching unit 53, and the configuring unit 54 correspond to steps S201 to S204 in Embodiment One, and have the same instances and application scenarios as the corresponding steps, but are not limited to the content disclosed in Embodiment One. It should be noted that the above modules or units can be hardware components or software components stored in a memory (for example, the memory 104) and processed by one or more processors (for example, the processors 102a, 102b, …, 102n), or can be a part of the apparatus and can run in the computer terminal 10 provided in Embodiment One.
[0192] The application will be described in detail below in combination with another alternative embodiment.
[0193] Embodiment Three
[0194] The embodiments of the application can also provide an electronic device, Figure 6 is a hardware structure block diagram of an electronic device (or a mobile device) according to an alternative execution event change positioning method according to the embodiments of the application, as Figure 6 shown, the electronic device can include one or more (only one is shown in the figure) processors 602, a memory 604, a storage controller, and a peripheral interface, wherein the peripheral interface is connected with a radio frequency module, an audio module, and a display. Figure 6
[0195] The memory can be used to store software programs and modules, such as program instructions / modules corresponding to the methods and apparatus in the embodiments of the application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, implements the above method. The memory can include a high-speed random access memory, and can also include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some examples, the memory can further include a memory remotely arranged with respect to the processor, which can be connected to the terminal through a network. Examples of the above network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0196] The processor can call information and application programs stored in the memory through the transmission device to perform the following steps: determining an abnormal code file based on an abnormal event, and obtaining a set of historical change events occurring earlier than the abnormal event; calculating a file dependency amount of the code file based on the set of historical change events, clustering the code file based on the file dependency amount, and constructing a dependency loss undirected graph based on a clustering result; searching in the dependency loss undirected graph based on the abnormal code file by using a breadth-first search algorithm to obtain a coupled file list corresponding to the abnormal code file; calculating a responsibility degree of each responsible object for the coupled file list based on historical change information of each coupled file in the coupled file list, and configuring a target responsible object for the abnormal event based on the responsibility degree, and sending an event change notification to the target responsible object.
[0197] By adopting the embodiment of the present application, a positioning scheme in event change is provided. For an abnormal event, historical change events occurring earlier than the abnormal event are called, the historical change events are analyzed, dependency amounts are calculated to reflect the frequency and intensity of the common occurrence of code files in event change, a clustering algorithm is used to classify and integrate the code files according to the file dependency amounts to form coupled file clusters, a dependency loss undirected graph is then constructed, and a breadth-first search algorithm is used to explore the coupled network of the abnormal code file as a starting point in the constructed dependency loss undirected graph, to screen files meeting a coupling threshold to form a coupled file list, to ensure that all associated files are covered by the change, to quickly locate the coupled files, to significantly reduce the problem troubleshooting path, to shorten the production environment recovery time, to improve the event change efficiency and change accuracy, to quickly locate the responsible object by calculating the responsibility degree, to quickly and effectively perform event change, and to solve the technical problems of low change accuracy and change efficiency in the prior art in which event change is processed manually.
[0198] Those skilled in the art can understand that Figure 6 The structure shown is only schematic, and the electronic device can also be a terminal device such as a smart phone, a tablet computer, a palm computer, a Mobile Internet Device (MID), a PAD, and the like. Figure 6 It does not limit the structure of the electronic device. For example, the electronic device can further include more or fewer components (such as a network interface, a display device, and the like) than those shown in the figure, or have a different configuration from that shown in the figure. Figure 6 It does not limit the structure of the electronic device. For example, the electronic device can further include more or fewer components (such as a network interface, a display device, and the like) than those shown in the figure, or have a different configuration from that shown in the figure. Figure 6 It does not limit the structure of the electronic device. For example, the electronic device can further include more or fewer components (such as a network interface, a display device, and the like) than those shown in the figure, or have a different configuration from that shown in the figure.
[0199] Those skilled in the art can understand that all or part of the steps of various methods in the above embodiments can be completed by instructing the terminal device related hardware through a program, and the program can be stored in a computer readable storage medium, which can include a flash disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0200] The application will be described in detail below in combination with another alternative embodiment.
[0201] Embodiment four
[0202] The embodiments of the application further provide a computer readable storage medium. Optionally, in the embodiments of the application, the computer readable storage medium can be used to save the program code executed by the positioning method in the event change provided in the embodiment one.
[0203] Optionally, in the embodiments of the application, the storage medium can be located in any one of the computer terminals in the computer terminal group in the computer network, or in any one of the mobile terminals in the mobile terminal group.
[0204] The embodiments of the application further provide a computer program product, when executed on a data processing device, is adapted to execute the steps of the positioning method in the event change: determining an abnormal code file based on an abnormal event, and obtaining a set of historical change events occurring earlier than the abnormal event; calculating a file dependency amount of the code file based on the set of historical change events, clustering the code file based on the file dependency amount, and constructing a dependency loss undirected graph based on the clustering result; searching in the dependency loss undirected graph based on the abnormal code file by using a breadth-first search algorithm, to obtain a coupled file list corresponding to the abnormal code file; calculating a responsibility degree of each responsible object to the coupled file list based on historical change information of each coupled file in the coupled file list, and configuring a target responsible object for the abnormal event based on the responsibility degree, and sending an event change notification to the target responsible object.
[0205] The above embodiment numbers of the application are only for description, and do not represent the advantages and disadvantages of the embodiments.
[0206] In the above embodiments of the application, the description of each embodiment has its own emphasis, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.
[0207] In several embodiments provided in the present application, it should be understood that the disclosed technology can be implemented by other ways. Among them, the above-described device embodiments are only schematic, for example, the division of the units can be a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed units can be indirect coupling or communication connection through some interfaces, units or modules, and can be electrical or other forms.
[0208] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e., they can be located in one place or distributed to multiple units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
[0209] In addition, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically, or two or more units can be integrated into one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0210] The integrated unit, if realized in the form of a software functional unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a plurality of instructions for causing a computer device (which can be a personal computer, a server or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The foregoing storage medium includes: a U disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store program codes.
[0211] The above is only the preferred embodiment of the present application, and it should be pointed out that for ordinary skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, and these improvements and refinements should be considered as the protection scope of the present application.
Claims
1. A positioning method in event change, characterized by, The method comprises the following steps: determining an abnormal code file based on an abnormal event, and obtaining a set of historical change events occurring before the abnormal event; calculating a file dependency of a code file based on the set of historical change events, clustering the code file based on the file dependency, and constructing a dependency loss undirected graph based on a clustering result; based on the abnormal code file, performing a search in the dependency loss undirected graph by using a breadth-first search algorithm to obtain a coupling file list corresponding to the abnormal code file; calculating a responsibility degree of each responsible object for the coupling file list based on historical change information of each coupling file in the coupling file list, configuring a target responsible object for the abnormal event based on the responsibility degree, and sending an event change notification to the target responsible object.
2. The method of claim 1, wherein, The step of calculating a file dependency of a code file based on the set of historical change events comprises the following steps: extracting a historical change event and a code file involved in each historical change event from the set of historical change events; constructing an event change matrix based on the historical change event and the code file involved in each historical change event; constructing a code file subset for the code file, and calculating a change probability of the historical change event for the code file subset based on the event change matrix to obtain the file dependency of the code file.
3. The method of claim 2, wherein, The step of constructing a code file subset for the code file and calculating a change probability of the historical change event for the code file subset based on the event change matrix comprises the following steps: combining the code files to obtain a code file subset; constructing the event change matrix based on a dependency relationship between the code file and the historical change event, wherein the code file and the historical change event have a dependency relationship when the code file has a change in the historical change event; calculating a file quantity ratio of a code file quantity in the code file subset to a total quantity of code files in the set of historical change events based on the event change matrix, and calculating a dependency sampling probability of the code file subset based on the file quantity ratio; calculating an event quantity ratio of a historical change event quantity containing the code file subset to a total quantity of historical change events in the set of historical change events based on the event change matrix, and calculating a dependency submission probability of the historical change event corresponding to the code file subset based on the event quantity ratio; calculating the change probability of the historical change event for the code file subset based on the dependency sampling probability and the dependency submission probability.
4. The method of claim 1, wherein, The step of clustering the code file based on the file dependency comprises the following steps: Step 1: taking each code file as a code file cluster to obtain N code file clusters; Step 2: combining any two code file clusters to obtain a combined code file cluster, and calculating a dependency loss value of the combined code file cluster based on the file dependency of the code files in the combined code file cluster; Step three, selecting the target combination code file cluster with the minimum dependency loss value, merging the code file clusters in the target combination code file cluster, and obtaining new N-1 code file clusters; Repeat steps two to three until all code file clusters are merged to obtain the clustering result.
5. The method of claim 4, wherein, The step of constructing a dependency loss undirected graph based on the clustering result includes: Taking each code file as a bottom node, and constructing branch nodes from the bottom node to the upper layer based on the code file clusters in the clustering result to obtain an initial undirected graph; According to the dependency loss value of the combined code file cluster, configure a connection path for the initial undirected graph, wherein the length of the connection path is proportional to the dependency loss value.
6. The method of claim 5, wherein, Based on the abnormal code file, the step of searching in the dependency loss undirected graph using a breadth-first search algorithm to obtain a coupling file list corresponding to the abnormal code file includes: Step one, define a dependency loss threshold value; Step two, locate the abnormal node corresponding to the abnormal code file in the dependency loss undirected graph, and take the abnormal node as a search starting point; Step three, scan the neighborhood nodes of the search starting point from the search starting point; Step four, based on the search starting point and the neighborhood nodes, construct a coupling path, calculate the path length of the coupling path based on the length of the connection path, and take the neighborhood nodes as new search nodes; Repeat steps three to four to expand the coupling path until the path length of the coupling path is greater than the dependency loss threshold value, and stop expanding the coupling path; Based on all the coupling paths corresponding to the abnormal code file, obtain the coupling file list corresponding to the abnormal code file.
7. The method of claim 1, wherein, The step of calculating the responsibility degree of each responsible object for the coupling file list based on the historical change information of each coupling file in the coupling file list and configuring a target responsible object for the abnormal event based on the responsibility degree includes: Obtain the historical change information involved in each coupling file, wherein the historical change information at least includes: historical change participant, historical change time, historical change record; Feature extraction is performed on the historical change information, and the extracted features are weighted and calculated to obtain the responsibility degree of each historical change participant for the coupling file list; Select the historical change participant with the maximum responsibility degree value as the target responsible object of the abnormal event.
8. A positioning device in event of change, characterized by It includes: An acquisition unit is configured to determine an abnormal code file based on an abnormal event, and acquire a set of historical change events occurring earlier than the abnormal event; A calculation unit is configured to calculate the file dependency of a code file based on the set of historical change events, cluster the code files based on the file dependency, and construct a dependency loss undirected graph based on the clustering result; A search unit is configured to search in the dependency loss undirected graph using a breadth-first search algorithm based on the abnormal code file to obtain a coupling file list corresponding to the abnormal code file. The configuration unit is configured to calculate a responsibility degree of each responsible object for the coupling file list based on historical change information of each coupling file in the coupling file list, configure a target responsible object for the abnormal event based on the responsibility degree, and send an event change notification to the target responsible object.
9. A computer-readable storage medium, characterized in that, The computer readable storage medium comprises a stored computer program, wherein the computer readable storage medium controls a device in which the computer readable storage medium is located to perform the positioning method in the event change of any one of claims 1 to 7 when the computer program is running.
10. An electronic device, comprising: The computer readable storage medium comprises a stored computer program, wherein the computer readable storage medium controls a device in which the computer readable storage medium is located to perform the positioning method in the event change of any one of claims 1 to 7 when the computer program is running.
11. A computer program product, characterised in that, The computer program product comprises a computer program, wherein the computer program is executed by a processor to implement the positioning method in the event change of any one of claims 1 to 7.