Data recommendation method, device, computer storage medium, and electronic device

Through feature extraction and relationship map construction of the target behavior link, the inaccuracy problem of the impact analysis after code changes/iteration is solved, and a comprehensive and accurate analysis of the impact of code changes is achieved.

CN114860310BActive Publication Date: 2025-08-29ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210315787.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-28
Publication Date
2025-08-29
Estimated Expiration
2042-03-28

AI Technical Summary

Technical Problem

The prior art has little accuracy in impact analysis after code changes/iteration.

Method used

By extracting the source data of the target behavior link, establishing a code feature library, determining the scene code link based on online traffic data, building a relationship map, and determining the target link and scenarios related to changing code features.

Benefits of technology

A comprehensive and accurate analysis of the impact of code changes/iteration is achieved, clearly reflecting the relationship between offline traffic data and online data links, and improving the accuracy of the analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114860310B_ABST
    Figure CN114860310B_ABST
Patent Text Reader

Abstract

The embodiments of this specification provide a data recommendation method, a data recommendation device, a computer-readable storage medium, a computer program product, and an electronic device. The method is suitable for recommending scenarios and / or links that may be affected after the code of the target behavior link is modified / iterated. Specifically, the source data of the target behavior link is firstly subjected to feature extraction to obtain a code feature library containing multiple code scenario features; then, based on the online traffic data and the above-mentioned code feature library, multiple scenario code links are determined to obtain a link library; further, the paths corresponding to the offline traffic data and the scenario code links in the above-mentioned link library are associated with each other to obtain a relationship map. The relationship map comprehensively reflects the relationship between the links formed by the offline traffic data and the above-mentioned online traffic data, and the affected scenarios and / or links can be determined based on the changed code features and the above-mentioned relationship map.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of data processing technology, and in particular to a data recommendation method, a data recommendation device, a computer-readable storage medium, a computer program product, and an electronic device. Background Art

[0002] The scenarios that may be affected by code changes / iterations are a key aspect of analysis required for code changes / iterations. However, relevant technologies for evaluating and analyzing the impact of code changes / iterations are not very accurate.

[0003] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of this specification, and therefore may include information that does not constitute prior art known to ordinary technicians in this field. Summary of the Invention

[0004] The purpose of this specification is to provide a data recommendation method, a data recommendation device, a computer-readable storage medium, a computer program product, and an electronic device, which can improve the accuracy of analysis of data affected by code changes / iterations, at least to a certain extent.

[0005] Other features and advantages of the present specification will become apparent from the following detailed description, or may be learned in part from the practice of the present specification.

[0006] According to one aspect of the present specification, a data recommendation method is provided, which includes: extracting features from source data about a target behavior link to obtain a code feature library containing multiple code scenario features; determining multiple scenario code links based on online traffic data and the above-mentioned code feature library to obtain a link library; associating the paths corresponding to the offline traffic data with the above-mentioned scenario code links in the above-mentioned link library to obtain a relationship graph; and obtaining the changed code features about the above-mentioned target behavior link, and determining the target link and / or target scenario related to the above-mentioned changed code features from the above-mentioned relationship graph, wherein the above-mentioned target link and / or the above-mentioned target scenario are recommended data related to the above-mentioned changed code features.

[0007] According to another aspect of the present specification, a data recommendation device is provided, which includes: a code feature library determination module, a link library determination module, a graph determination module, and a recommendation module.

[0008] Among them, the above-mentioned code feature library determination module is used to extract features of the source data about the target behavior link to obtain a code feature library containing multiple code scenario features; the above-mentioned link library determination module is used to determine multiple scenario code links based on the online traffic data and the above-mentioned code feature library to obtain a link library; the above-mentioned relationship library determination module is used to associate the paths corresponding to the offline traffic data with the above-mentioned scenario code links in the above-mentioned link library to obtain a relationship graph; and the above-mentioned recommendation module is used to obtain the change code features about the above-mentioned target behavior link, and determine the target link and / or target scenario related to the above-mentioned change code features from the above-mentioned relationship graph, wherein the above-mentioned target link and / or the above-mentioned target scene are determined as recommended data related to the above-mentioned change code features.

[0009] According to another aspect of the present specification, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the data recommendation method as described in the above embodiment when executing the computer program.

[0010] According to one aspect of the present specification, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores instructions. When the instructions are executed on a computer or a processor, the computer or processor executes the data recommendation method as described in the above aspect of the specification.

[0011] According to another aspect of the present specification, a computer program product comprising instructions is provided. When the computer program product is run on a computer or a processor, the computer or the processor executes the data recommendation method as described in the above aspect of the specification.

[0012] The data recommendation method and apparatus, computer-readable storage medium, computer program product, and electronic device provided in the embodiments of this specification have the following technical effects:

[0013] The solution provided by the exemplary embodiments of this specification is applicable to the recommendation of scenarios and / or links that may be affected after the code of the target behavior link is modified / iterated. Specifically, the source data of the target behavior link is firstly subjected to feature extraction to obtain a code feature library containing multiple code scenario features; then, based on the online traffic data and the above-mentioned code feature library, multiple scenario code links are determined to obtain a link library; further, the paths corresponding to the offline traffic data and the scenario code links in the above-mentioned link library are associated with each other to obtain a relationship map. The relationship map can clearly, conveniently and comprehensively reflect the relationship between the links formed by the offline traffic data and the above-mentioned online traffic data. The relationship map is conducive to comprehensively and accurately determining the scenarios affected by the code changes, and / or related links with behavioral semantics.

[0014] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The accompanying drawings are incorporated into and constitute a part of this specification, illustrate embodiments consistent with this specification, and together with the specification, are used to explain the principles of this specification. Obviously, the drawings described below are only some embodiments of this specification, and those skilled in the art can derive other drawings based on these drawings without inventive effort.

[0016] Figure 1 This is a flowchart of a data recommendation method provided in one embodiment of this specification.

[0017] Figure 2 A flowchart of a recommended method for processing data provided in another embodiment of this specification.

[0018] Figure 3 This is a flowchart of a feature extraction method provided in one embodiment of this specification.

[0019] Figure 4 This is a schematic diagram of feature extraction provided in one embodiment of this specification.

[0020] Figure 5 A flowchart of a feature extraction method provided in another embodiment of this specification.

[0021] Figure 6 This is a feature extraction schematic diagram provided for another embodiment of this specification.

[0022] Figure 7 This is a schematic diagram of a code feature library provided in one embodiment of this specification.

[0023] Figure 8 This is a schematic diagram of determining a link library based on a code feature library in an embodiment of this specification.

[0024] Figure 9 A flowchart of a method for determining a relationship graph based on a link library is provided in one embodiment of this specification.

[0025] Figure 10 This is a schematic diagram of determining a relationship graph based on a link library in an embodiment of this specification.

[0026] Figure 11 A flowchart of a method for determining associated scenarios and links to be identified based on a relationship graph is provided in one embodiment of this specification.

[0027] Figure 12a and Figure 12b A schematic diagram of two types of relationship diagrams is provided in an embodiment of this specification.

[0028] Figure 13 A flowchart of a method for determining a target scene and a target link based on a relationship graph provided in one embodiment of this specification.

[0029] Figure 14 This is a schematic diagram of determining a target scene and a target link based on a relationship graph provided in an embodiment of this specification.

[0030] Figure 15 This is a schematic diagram of the structure of a data recommendation device provided in one embodiment of this specification.

[0031] Figure 16 This is a schematic structural diagram of a data recommendation device provided in another embodiment of this specification.

[0032] Figure 17 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this specification. DETAILED DESCRIPTION

[0033] In order to make the purpose, technical solutions and advantages of this specification more clear, the embodiments of this specification will be further described in detail below with reference to the accompanying drawings.

[0034] When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this specification. Instead, they are merely examples of devices and methods consistent with certain aspects of this specification, as detailed in the appended claims.

[0035] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this specification will be more comprehensive and complete and will fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, many specific details are provided to provide a full understanding of the embodiments of this specification. However, those skilled in the art will appreciate that the technical solutions of this specification may be practiced while omitting one or more of the specific details, or that other methods, components, devices, steps, etc. may be employed. In other cases, well-known technical solutions are not shown or described in detail to avoid obscuring various aspects of this specification.

[0036] In addition, the accompanying drawings are merely schematic illustrations of this specification and are not necessarily drawn to scale. Identical reference numerals in the figures denote identical or similar parts, and thus repetitive descriptions thereof will be omitted. Some of the blocks shown in the accompanying drawings are functional entities that do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0037] The embodiments of this specification can provide a data recommendation method, a data recommendation device, a computer-readable storage medium, a computer program product, and an electronic device, which at least to some extent improve the accuracy of data analysis affected by code changes / iterations. Figures 1 to 14 The recommended method examples for the data provided in this specification are described in detail:

[0038] For example, Figure 1 This is a flowchart of a method for recommending data provided in one embodiment of this specification. Figure 1 This embodiment introduces the present solution as a whole:

[0039] refer to Figure 1 , obtain multiple code scenario features about the target behavior link, and obtain a code feature library 110. Then, based on the online traffic data, the code scenario features in the above code feature library 110 are connected in series to obtain a link library 120 containing multiple scenario code links. Furthermore, the path corresponding to the offline traffic data is associated with the code scenario features in the above link library 120 to obtain a relationship graph 130 containing the relationship between the link corresponding to the offline traffic data and the scenario code link. Furthermore, based on the changed code features of the target behavior link and the above relationship graph, recommended data related to the changed code features can be determined, including target scenarios and / or target links. Among them, the above-mentioned changed code features can be newly added code features and modified code features.

[0040] This solution first identifies the code scenario characteristics associated with the target behavior link. Based on this, it then correlates the scenario code links of online traffic data with the paths of offline traffic data to generate the aforementioned relationship graph. This relationship graph clearly, conveniently, and comprehensively reflects the relationship between the links formed by offline traffic data and the aforementioned online traffic data. This relationship graph facilitates comprehensive and accurate identification of scenarios affected by code changes and / or related links with behavioral semantics.

[0041] For example, Figure 2 A flowchart of a recommended method for providing data according to another embodiment of this specification. Figure 2 , the method shown in this embodiment includes: S210-S240.

[0042] In S210 , feature extraction is performed on source data related to the target behavior link to obtain a code feature library containing multiple code scenario features.

[0043] The embodiments of this specification are modeled based on code scenario features, and then analyze the scenarios / use cases affected by code changes / iterations, as well as code links, etc. Compared with the related technologies based on database (Data Base, DB) field modeling, interface input and output parameter modeling, or domain model modeling, the scope of use of this solution is wider. For example, for the related technologies based on DB field modeling, if the code changes / iterations do not involve the scenario of database data storage, then the related technologies are not applicable. For another example, for the related technologies based on interface input and output parameter modeling, if the interface does not contain relevant parameters, then the related technologies cannot be used to perform change analysis and evaluation. For the related technologies based on domain modeling, if it does not involve changes to the domain model, then the related technologies cannot be used to perform change analysis and evaluation; in addition, the related technologies based on domain models cover a wide range, and a smaller code change may recommend countless change scenarios, resulting in inaccurate recommended scenarios.

[0044] In an exemplary embodiment, the following is combined Figures 3 to 7 The specific implementation of S210 is introduced in detail. Figure 3 This is a flow chart of a feature extraction method provided in one embodiment of this specification. Figure 3 , the feature extraction method provided in this figure includes: S212-S216.

[0045] In S212 , dynamic link data and static link data are collected to obtain source data of the target behavior link.

[0046] Exemplarily, the target behavior link may be any behavior link that will change / iterate the code.

[0047] For example, Figure 4 This is a feature extraction diagram provided in one embodiment of this specification. Figure 4 The above dynamic link data refers to the data of the link corresponding to the actual behavior. The above static link data does not involve the data of the link corresponding to the actual behavior, but the call relationship in the code. Exemplarily, the above dynamic link data can come from the model in the above related technology.

[0048] For the dynamic and static link data related to the target behavior links mentioned above, we use the Open Data Processing Service (ODPS), also known as MaxComputer, and other available services to collect data. ODPS is a distributed processing service for terabyte / petabyte-level data with low real-time requirements. It can serve the storage and calculation of batch structured data, providing solutions for massive data warehouses and analytical modeling services for big data.

[0049] In S214, the source data is aggregated and a directed graph is constructed for the code call relationship. A code dominator tree is extracted from the complex directed cyclic graph using a target algorithm to obtain the key elements and key code nodes corresponding to the target behavior links.

[0050] This embodiment uses a data collection and processing system to aggregate the source data collected for the target behavior link in the above embodiment, construct a directed graph based on the code call relationships, and use the Tarjan algorithm to extract the code dominator tree from the complex directed cyclic graph, thereby obtaining the key elements and key code nodes corresponding to the target behavior link. The Tarjan algorithm is a linear-time algorithm proposed by Robert Tarjan for solving strongly connected components of a directed graph.

[0051] Exemplarily, the data after the above-mentioned aggregation processing includes one or more of the following: data about the system call model (specifically including application, interface, method, parameter, path trace), data about the code line model (specifically including version, line number, line content, line logic, branch), data about the database data model (specifically including library, table, field, library-table-field association relationship) and data about the feature model (specifically including data, scenario), etc.

[0052] In S216 , based on the key elements and the key code nodes, the plurality of code scenario features are determined to obtain the code feature library.

[0053] For example, Figure 6 This is a feature extraction diagram provided by another embodiment of this specification. Figure 6 Taking scene A, scene B and scene C as examples of the above target scenarios, based on the embodiments corresponding to S212 and S214, the key elements (types include element 1 and element 2) and key code nodes (types include node 1, node 2 and node 3) corresponding to the above three scenarios can be determined.

[0054] In an exemplary embodiment, Figure 5This is a flow chart of a feature extraction method provided in another embodiment of this specification, specifically in combination with Figure 6 The specific implementation of S216 is introduced in detail. Figure 5 , the method shown in this embodiment includes: S2162-S2168.

[0055] In S2162, multiple necessary nodes and selection nodes corresponding to the target behavior links are identified from the key code nodes corresponding to the target behavior links, wherein the necessary nodes are nodes that the target behavior links all pass through.

[0056] Exemplary, reference Figure 6 , "Node 2" is Figure 3 The nodes that all scenes pass through can be regarded as necessary nodes, and "node 1" and "node 3" are not Figure 3 The nodes that all scenes pass through can be used as selection nodes.

[0057] Exemplarily, the selection nodes include one or more of: a selection node affecting interface input and output parameters, a selection node affecting external calls, a selection node affecting data storage, and a selection node affecting link bifurcation.

[0058] In S2164, the code link branch line corresponding to each of the above-mentioned selection nodes is determined; and in S2166, the code call relationship related to the above-mentioned code link branch lines is analyzed through static code analysis to obtain a full amount of process control elements.

[0059] refer to Figure 6 Based on the data of the code line model (specifically including version, line number, line content, line logic, and branches), the code chain branch lines are determined according to the above selection nodes. The generation of code chain branch lines must come from the control flow, and the control flow corresponds to the control flow elements. Therefore, through static code analysis, the code call relationships related to the above code chain branch lines are analyzed to obtain the full set of process control elements.

[0060] Continue to refer Figure 5 In S2168, the above-mentioned full amount of process control elements are screened according to the key code nodes corresponding to the multiple target behavior links to obtain the process control elements of the above-mentioned key code nodes.

[0061] refer to Figure 6Based on the above key elements, the interface input and output parameters, as well as the information flow elements (elements other than the control flow elements and the interface input and output parameters) can be determined. Furthermore, in this embodiment, the above-mentioned necessary nodes, the process control elements of the above-mentioned key code nodes, the information flow elements in the above-mentioned key elements, and the interface input and output parameters are determined as code scenario features for the above-mentioned multiple target behavior links, and the obtained above-mentioned scenario code features (types include nodes and elements) constitute the code feature library for the above-mentioned multiple target behavior links.

[0062] Figure 7 This is a schematic diagram of a code feature library provided in an embodiment of this specification, refer to Figure 7 , the nodes are represented by circles 72, that is, the scene code features schematically shown in the figure include node A, node B, node C and node D; the elements are represented by diamonds 74, that is, the scene code features schematically shown in the figure include element E, element F and element G.

[0063] The above passed Figures 3 to 7 The corresponding embodiment completes the detailed introduction of the specific implementation of S210, obtains the source data about the target behavior link, and performs feature extraction to obtain a code feature library containing multiple code scenario features. Further, based on the above code feature library, the following embodiments are executed:

[0064] Continue to refer Figure 2 In S220, based on the online traffic data and the above-mentioned code feature library, multiple scenario code links are determined to obtain a link library.

[0065] For example, the online traffic data refers to the actual traffic data related to the target behavior link, for example, the traffic data corresponding to the user's online repayment. Figure 8 This is a schematic diagram of determining a link library based on a code feature library in an embodiment of this specification. Figure 8 In this embodiment, traffic data on multiple lines is obtained as input to the code feature library, and the code scene features in the above code feature library are connected according to the flow direction of the online traffic data, so that the code scene features scattered in the code feature library can be connected into multiple scene code links, and the link library is obtained as follows: Figure 8 Each scenario code link in the link library is: the online traffic data is represented by the code scenario features of the target behavior link.

[0066] Continue to refer Figure 2 In S230, the path corresponding to the offline traffic data is associated with the above-mentioned scenario code link in the above-mentioned link library to obtain a relationship graph.

[0067] In an exemplary embodiment, Figure 9This is a flow chart of a method for determining a relationship graph based on a link library in an embodiment of this specification. Specifically, the embodiment shown in this figure can be used as a specific implementation of S230. Figure 9 , the embodiment shown in this figure includes: S232-S234.

[0068] In S232, the node identical to the node in the path corresponding to the offline traffic data is determined in the link library to obtain an associated node, and / or the element identical to the element in the path corresponding to the offline traffic data is determined in the link library to obtain an associated element.

[0069] Illustratively, the offline traffic data may be a path trace corresponding to a process / test case generated by the test. Figure 10 This is a schematic diagram of determining a relationship map based on a link library in an embodiment of this specification. Figure 10 If the path corresponding to the traffic data S under a line is: element X-node B-node C, then based on the above link library, it can be determined that the same nodes (associated nodes) between the offline traffic data S and the above link library are: node B and node C; based on the above link library, it can be determined that there are no same elements (associated elements) between the two.

[0070] In S234, the above-mentioned associated nodes and / or the above-mentioned associated elements are used as intersections, and the paths corresponding to the above-mentioned offline traffic data are added to the above-mentioned link library to obtain the above-mentioned relationship graph reflecting the association relationship between the above-mentioned scene code links and the paths corresponding to the above-mentioned offline traffic data.

[0071] For example, still refer to the above Figure 10 , taking the above-mentioned associated nodes: node B and node C as the intersection of the path S corresponding to the offline traffic data and the above-mentioned link library, the path S corresponding to the offline traffic data is added to the above-mentioned link library.

[0072] By analogy, after adding the paths corresponding to multiple test cases to the above-mentioned link library, the above-mentioned relationship graph reflecting the association relationship between the above-mentioned scenario code link and the path corresponding to the above-mentioned offline traffic data can be obtained.

[0073] In the relationship graph determination scheme provided in the embodiment of this specification, by associating offline traffic data with the above-mentioned link library, an association can be established between offline traffic data (corresponding to multiple scenarios set by the tester) and the above-mentioned link library (links reflecting the flow direction of online traffic data). Specifically, the following Figure 11 and Figure 12a as well as Figure 12b Let’s introduce the above relationship in detail.

[0074] in, Figure 11 This is a flow chart of a method for determining associated scenarios and links to be identified based on a relationship graph in an embodiment of this specification. Figure 11 The illustrated embodiment is executed when the path corresponding to the offline traffic data is a path corresponding to multiple use cases.

[0075] refer to Figure 11 In S236, a node identical to a node in the path corresponding to the above-mentioned multiple use cases is determined in the above-mentioned link library to obtain a first associated node, and / or an element identical to an element in the path corresponding to the above-mentioned multiple use cases is determined in the above-mentioned link library to obtain a first associated element.

[0076] Exemplarily, the method for determining the first associated node and the first associated element is the same as Figure 9 The corresponding embodiment of S232 is the same and will not be repeated here.

[0077] In S238, the target use case including the first association node and / or the first association element is determined as the association scenario in the relationship graph.

[0078] refer to Figure 12b , the target use case (i.e., use case 1) containing the first associated nodes (i.e., node A, node B, and node C) and the first associated element (i.e., element E) is determined as associated scenario 1 in the above relationship graph; and the target use case (i.e., use case 2) containing the first associated nodes (i.e., node B, node C, and node D) and the first associated element (i.e., element F) is determined as associated scenario 2 in the above relationship graph.

[0079] In S238', the scenario code link that does not include the first associated node and the first associated element between the paths of the multiple use cases is determined as a link to be identified that is not associated with the scenario.

[0080] refer to Figure 12b For the scenario code links in the relationship graph that are not related to the use case path, that is, the links do not contain the above-mentioned first associated node or the above-mentioned first associated element path, these links are determined as links to be identified that are not associated with the scenario / use case.

[0081] go through Figure 11 After the corresponding processing, you can Figure 12a The relationship diagram shown is processed as follows Figure 12b As shown in the example, it contains multiple related scenes and multiple unrelated scenes to be identified. Figure 12b The relationship graph showing the style makes it easier to determine the target scene and / or target link to be recommended.

[0082] Continue to refer Figure 2 In S240, the change code features of the target behavior link are obtained, and the target link and / or target scenario related to the change code features are determined from the relationship graph.

[0083] In an exemplary embodiment, Figure 13 This is a flow chart of a method for determining a target scene and a target link based on a relationship graph provided in an embodiment of this specification. Specifically, the embodiment shown in this figure can be used as a specific implementation of S240. Figure 13 , the embodiment shown in this figure includes: S242-S246.

[0084] In S242, a node with the same characteristics as the above-mentioned parallel code is determined in the path corresponding to the above-mentioned associated scene to obtain a second associated node, and / or an element with the same characteristics as the above-mentioned parallel code is determined in the path corresponding to the above-mentioned associated scene to obtain a second associated element, wherein the associated scene having the above-mentioned second associated node and / or the above-mentioned second associated element is the above-mentioned target scene, and the link to be identified having the above-mentioned second associated node and / or the above-mentioned second associated element is the above-mentioned target link.

[0085] For example, static code analysis can be used to obtain changed code features of a target behavior link, where the types of changes include updated features and newly added features. Figure 14 This is a schematic diagram of determining the target scene and target link based on the relationship graph provided in an embodiment of this specification. Figure 14 ,The changed code features include: updated element X, node D; and ,the newly added node H.

[0086] Exemplary, reference Figure 14 Based on the above relationship graph, it can be determined that the node (second associated node) that is the same between the change code feature and the above link library is: node D; based on the relationship graph, it can be determined that the element (second associated element) that is the same between the change code feature and the above link library is: element X.

[0087] Thus, the associated scenario 2 with the above-mentioned second associated node (i.e., node D) is determined as the target scenario (i.e., node B-node C-node D / element F). The link / use case 3 to be identified with the above-mentioned second associated element (i.e., element X) is determined as the target link (i.e., element X-node C-node B). Among them, since the offline traffic data corresponds to multiple scenarios set by the tester, the above-mentioned target scenario does not need to be semantically analyzed, and the relevant personnel can also clarify the meaning of the relevant scenario. As for the above-mentioned target link (such as element X-node C-node B) determined by the link to be identified containing the above-mentioned second associated element / second associated node, the code comments corresponding to the link can be further analyzed to obtain the corresponding behavioral semantics, so that the above-mentioned target link has stronger semantic information, which is convenient for the relevant personnel to understand and apply the recommended link.

[0088] In S244, the code calling relationship between the code feature library and the newly added code features is analyzed by static code analysis, and the intermediate link is determined based on the code calling relationship.

[0089] Among them, the above-mentioned newly added code feature is one of the above-mentioned changed code features. In this embodiment, in order to explore the possible relationship between the link to be identified and the newly added code feature in the changed code feature, for the above-mentioned code feature library, the code call relationship between it and each newly added code feature is analyzed by static code analysis. And the code scenario feature with the code call relationship is determined as the intermediate link. For example, reference Figure 14 After static code analysis, it is found that there is a code calling relationship between node A, the newly added code node H and node m, and the intermediate link can be obtained: node A-node H-node m.

[0090] In S246 , the code comments corresponding to the intermediate link are analyzed to obtain the intermediate link containing behavioral semantics, and the intermediate link containing behavioral semantics is determined as the target link.

[0091] As mentioned above, since the intermediate links are determined by the static code analysis code feature library and newly added code features, semantic analysis of the intermediate links is required to ensure that relevant personnel can also clearly understand the meaning of the relevant behaviors. This means further analyzing the code annotations corresponding to the link (e.g., node A-node H-node m) to obtain the corresponding behavioral semantics. This ensures that the recommended target link has strong semantic information, facilitating relevant personnel's understanding and application of the recommended link.

[0092] The solution provided in the embodiments of this specification determines a code feature library based on the code scenario features of the target behavior link (including the necessary nodes of the key code nodes, the control flow elements of the key code nodes, and the information flow elements, etc.); determines the link corresponding to the online traffic data based on the above code feature library, and determines the link library for the multiple scene code links obtained; further, associates the offline traffic data with the above link library to determine a relationship graph reflecting the relationship between the link corresponding to the offline traffic data and the scene code link. Among them, the relationship graph can clearly, conveniently and comprehensively reflect the relationship between the offline traffic data and the link formed by the above online traffic data, which is conducive to accelerating the testing process, and is also conducive to comprehensively and accurately determining the scenarios affected by the code changes, and / or related links with behavioral semantics.

[0093] The specific recommendations include not only the original effective use cases and the code links of the original unrelated scenarios (with behavioral semantics), but also the new code links containing behavioral semantics (obtained through static code analysis of the code feature library and newly added code features), thereby enabling pre-recommendations with high efficiency.

[0094] It should be noted that the above figures are merely illustrative of the processes included in the methods according to exemplary embodiments of this specification and are not intended to be limiting. It should be understood that the processes illustrated in the above figures do not indicate or limit the temporal order of these processes. Furthermore, it should be understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.

[0095] The following are device embodiments of this specification, which can be used to implement the method embodiments of this specification. For details not disclosed in the device embodiments of this specification, please refer to the method embodiments of this specification.

[0096] in, Figure 15 The structure diagram of the recommended device that can apply the data of an embodiment of this specification is shown. Figure 15 The data recommendation device shown in the figure can be implemented as all or part of an electronic device through software, hardware, or a combination of both. It can also be integrated into a server as an independent module, or integrated into an electronic device as an independent module.

[0097] The data recommendation device 1500 in the embodiment of this specification includes: a code feature library determination module 1510 , a link library determination module 1520 , a graph determination module 1530 , and a recommendation module 1540 .

[0098] Among them, the above-mentioned code feature library determination module 1510 is used to extract features of the source data about the target behavior link to obtain a code feature library containing multiple code scenario features; the above-mentioned link library determination module 1520 is used to determine multiple scenario code links based on the online traffic data and the above-mentioned code feature library to obtain a link library; the above-mentioned relationship library determination module 1530 is used to associate the path corresponding to the offline traffic data with the above-mentioned scenario code link in the above-mentioned link library to obtain a relationship graph; and the above-mentioned recommendation module 1540 is used to obtain the change code feature about the above-mentioned target behavior link, and determine the target link and / or target scenario related to the above-mentioned change code feature from the above-mentioned relationship graph, wherein the above-mentioned target link and / or the above-mentioned target scene are determined as recommended data related to the above-mentioned change code feature.

[0099] In an exemplary embodiment, Figure 16 Schematically shows the structure of a data recommendation device according to another exemplary embodiment of this specification. Figure 16 :

[0100] In an exemplary embodiment, based on the above solution, the code feature library determination module 1510 includes: a data acquisition unit 15101 , an aggregation processing unit 15102 , and a code feature library determination unit 15103 .

[0101] Among them, the above-mentioned data collection unit 15101 is used to: collect dynamic link data and static link data to obtain the source data of the above-mentioned target behavior link; the above-mentioned aggregation processing unit 15102 is used to: perform aggregation processing on the source data, and construct a directed graph for the code call relationship, and use the target algorithm to extract the code dominance tree from the complex directed cyclic graph to obtain the key elements and key code nodes corresponding to the target behavior link; and the above-mentioned code feature library determination unit 15103 is used to: determine the above-mentioned multiple code scenario features based on the above-mentioned key elements and the above-mentioned key code nodes to obtain the above-mentioned code feature library.

[0102] In an exemplary embodiment, based on the above scheme, the data after the above aggregation processing includes: data on a system call model, data on a code line model, data on a database data model, and data on a feature model or more.

[0103] In an exemplary embodiment, based on the above scheme, the number of the above target behavior links is multiple; the above code feature library determination unit includes: an identification subunit, a screening subunit, and a feature determination subunit.

[0104] Among them, the above-mentioned identification sub-unit is used to: identify the necessary nodes and selection nodes corresponding to the multiple target behavior links from the key code nodes corresponding to the multiple target behavior links, wherein the above-mentioned necessary nodes are nodes passed by the multiple target behavior links; the above-mentioned screening sub-unit is used to: screen out the control flow elements of the above-mentioned key code nodes based on the above-mentioned selection nodes; and the above-mentioned feature determination sub-unit is used to: determine the above-mentioned necessary nodes, the process control elements of the above-mentioned key code nodes, the information flow elements in the above-mentioned key elements and the interface input and output parameters as the above-mentioned code scenario features.

[0105] In an exemplary embodiment, based on the above scheme, the above screening sub-unit is specifically used to: determine the code link branch line corresponding to each of the above selection nodes; analyze the code call relationship related to the above code link branch line through static code analysis to obtain a full amount of process control elements; and, based on the key code nodes corresponding to multiple above target behavior links, screen the above full amount of process control elements to obtain the process control elements of the above key code nodes.

[0106] In an exemplary embodiment, based on the above scheme, the above selection nodes include: one or more of a selection node affecting interface input and output parameters, a selection node affecting external calls, a selection node affecting data storage, and a selection node affecting link bifurcation.

[0107] In an exemplary embodiment, based on the above scheme, the above-mentioned graph determination module 1530 includes: an associated feature determination unit 15301 and an adding unit 15302.

[0108] Among them, the above-mentioned association feature determination unit 15301 is used to: determine the node in the above-mentioned link library that is the same as the node in the path corresponding to the above-mentioned offline traffic data, and obtain the associated node, and / or determine the element in the above-mentioned link library that is the same as the element in the path corresponding to the above-mentioned offline traffic data, and obtain the associated element; and the above-mentioned adding unit 15302 is used to: use the above-mentioned associated node and / or the above-mentioned associated element as the intersection, and add the path corresponding to the above-mentioned offline traffic data to the above-mentioned link library to obtain the above-mentioned relationship graph reflecting the association relationship between the above-mentioned scene code link and the path corresponding to the above-mentioned offline traffic data.

[0109] In an exemplary embodiment, based on the above scheme, the path corresponding to the above offline traffic data is the path corresponding to multiple use cases; the above graph determination module 1530 also includes: an associated scenario determination unit 15303 and a link to be identified determination unit 15304.

[0110] Among them, the above-mentioned associated feature determination unit 15301 is also used to: determine the node in the above-mentioned link library that is identical to the node in the path corresponding to the above-mentioned multiple use cases to obtain a first associated node, and / or determine the element in the above-mentioned link library that is identical to the element in the path corresponding to the above-mentioned multiple use cases to obtain a first associated element; the above-mentioned associated scenario determination unit 15303 is used to: determine the target use case containing the above-mentioned first associated node and / or the first above-mentioned associated element as an associated scenario in the above-mentioned relationship graph, and determine the path corresponding to the above-mentioned associated scenario as a part of the above-mentioned relationship graph; and the above-mentioned to-be-identified link determination unit 15304 is used to: determine the link between the paths of the above-mentioned multiple use cases that does not contain the above-mentioned first associated node and the above-mentioned first associated element as a to-be-identified link of an unassociated scenario, and use the above-mentioned to-be-identified link as a part of the above-mentioned relationship graph.

[0111] In an exemplary embodiment, based on the above scheme, the above recommendation module 1540 is specifically used to: determine the node identical to the above-mentioned changed code feature in the path corresponding to the above-mentioned associated scenario to obtain a second associated node, and / or determine the element identical to the above-mentioned changed code feature in the path corresponding to the above-mentioned associated scenario to obtain a second associated element, and determine the associated scenario in which the above-mentioned second associated node and / or the above-mentioned second associated element exist as the above-mentioned target scenario, and the link to be identified in which the above-mentioned second associated node and / or the above-mentioned second associated element exist is the above-mentioned target link; and, through static code analysis, analyze the code call relationship between the above-mentioned code feature library and the newly added code feature, and determine the above-mentioned target link based on the above-mentioned code call relationship.

[0112] In an exemplary embodiment, based on the above scheme, the above recommendation module 1540 is further specifically used to: determine the intermediate link based on the above code call relationship; and analyze the code comments corresponding to the above intermediate link to obtain the intermediate link containing behavioral semantics, and determine the above intermediate link containing behavioral semantics as the above target link.

[0113] It should be noted that, when the data recommendation device provided in the above embodiment executes the data recommendation method, the division of the above functional modules is only used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0114] In addition, the data recommendation device and data recommendation method embodiments provided in the above embodiments belong to the same concept. Therefore, for details not disclosed in the device embodiments of this specification, please refer to the data recommendation method embodiments mentioned above in this specification, and no further details will be given here.

[0115] The serial numbers of the embodiments in this specification are for description only and do not represent the advantages or disadvantages of the embodiments.

[0116] The embodiments of this specification also provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps of any of the above-mentioned methods are implemented.

[0117] Figure 17 Schematically shows the structure of an electronic device according to an exemplary embodiment of this specification. Figure 17 As shown, the electronic device 1700 includes: a processor 1701 and a memory 1702 .

[0118] In the embodiments of this specification, the processor 1701 is the control center of the computer system, which can be the processor of a physical machine or the processor of a virtual machine. The processor 1701 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1701 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 1701 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state; the coprocessor is a low-power processor for processing data in the standby state.

[0119] In the embodiment of this specification, the processor 1701 is specifically configured to:

[0120] Perform feature extraction on the source data about the target behavior link to obtain a code feature library containing multiple code scenario features; based on the online traffic data and the above code feature library, determine multiple scenario code links to obtain a link library; associate the paths corresponding to the offline traffic data with the above scenario code links in the above link library to obtain a relationship graph; and obtain the change code features about the above target behavior link, and determine the target link and / or target scenario related to the above change code features from the above relationship graph, wherein the above target link and / or the above target scenario are recommended data related to the above change code features.

[0121] Furthermore, the above-mentioned feature extraction is performed on the source data about the target behavior link to obtain a code feature library containing multiple code scenario features, including:

[0122] Collect dynamic link data and static link data to obtain the source data of the above-mentioned target behavior link; and, aggregate the above-mentioned source data, and construct a directed graph for the code call relationship, and use the target algorithm to extract the code dominance tree from the complex directed cyclic graph to obtain the key elements and key code nodes corresponding to the above-mentioned target behavior link; and, based on the above-mentioned key elements and the above-mentioned key code nodes, determine the above-mentioned multiple code scenario features to obtain the above-mentioned code feature library.

[0123] Furthermore, the data after the above aggregation processing includes: one or more of data on a system call model, data on a code line model, data on a database data model, and data on a feature model.

[0124] Furthermore, there are multiple target behavior links. Based on the key elements and key code nodes, the multiple code scenario features are determined, including:

[0125] Identify multiple necessary nodes and selection nodes corresponding to the target behavior links from the key code nodes corresponding to the target behavior links, wherein the necessary nodes are nodes passed by the target behavior links; based on the selection nodes, filter out the control flow elements of the key code nodes; and determine the necessary nodes, process control elements of the key code nodes, information flow elements in the key elements, and interface input and output parameters as the code scenario features.

[0126] Furthermore, the control flow elements of the key code nodes are screened out based on the selection nodes, including:

[0127] Determine the code link branch line corresponding to each of the above-mentioned selection nodes; analyze the code call relationship related to the above-mentioned code link branch lines through static code analysis to obtain a full set of process control elements; and, based on the key code nodes corresponding to multiple above-mentioned target behavior links, screen the above-mentioned full set of process control elements to obtain the process control elements of the above-mentioned key code nodes.

[0128] Furthermore, the above-mentioned selection node includes one or more of: a selection node affecting interface input and output parameters, a selection node affecting external calls, a selection node affecting data storage, and a selection node affecting link bifurcation.

[0129] Furthermore, the path corresponding to the offline traffic data is associated with the scenario code link in the link library to obtain a relationship graph, including:

[0130] Determine in the above-mentioned link library the nodes that are identical to the nodes in the path corresponding to the above-mentioned offline traffic data to obtain associated nodes, and / or determine in the above-mentioned link library the elements that are identical to the elements in the path corresponding to the above-mentioned offline traffic data to obtain associated elements; and, with the above-mentioned associated nodes and / or the above-mentioned associated elements as the intersection, add the path corresponding to the above-mentioned offline traffic data to the above-mentioned link library to obtain the above-mentioned relationship graph reflecting the association relationship between the above-mentioned scene code link and the path corresponding to the above-mentioned offline traffic data.

[0131] Furthermore, the paths corresponding to the offline traffic data are paths corresponding to multiple use cases;

[0132] The above-mentioned path corresponding to the offline traffic data is associated with the above-mentioned scenario code link in the above-mentioned link library to obtain a relationship graph, including:

[0133] Determine in the link library the node that is identical to the node in the path corresponding to the above-mentioned multiple use cases to obtain a first associated node, and / or determine in the link library the element that is identical to the element in the path corresponding to the above-mentioned multiple use cases to obtain a first associated element; determine the target use case containing the above-mentioned first associated node and / or the first above-mentioned associated element as an associated scenario in the above-mentioned relationship graph, and determine the path corresponding to the above-mentioned associated scenario as a part of the above-mentioned relationship graph; and determine the link between the paths of the above-mentioned multiple use cases that does not contain the above-mentioned first associated node and the above-mentioned first associated element as a link to be identified that is not an associated scenario, and use the above-mentioned link to be identified as a part of the above-mentioned relationship graph.

[0134] Furthermore, the above-mentioned determination of the target link and / or target scenario related to the above-mentioned changed code feature from the above-mentioned relationship map includes:

[0135] Determine the node identical to the above-mentioned changed code feature in the path corresponding to the above-mentioned associated scenario to obtain a second associated node, and / or determine the element identical to the above-mentioned changed code feature in the path corresponding to the above-mentioned associated scenario to obtain a second associated element, and determine the associated scenario in which the above-mentioned second associated node and / or the above-mentioned second associated element exist as the above-mentioned target scenario, and the link to be identified in which the above-mentioned second associated node and / or the above-mentioned second associated element exist as the above-mentioned target link; and, through static code analysis, analyze the code calling relationship between the above-mentioned code feature library and the newly added code feature, and determine the above-mentioned target link based on the above-mentioned code calling relationship.

[0136] Furthermore, determining the target link according to the code calling relationship includes:

[0137] Determine an intermediate link based on the code call relationship; and analyze the code comments corresponding to the intermediate link to obtain an intermediate link containing behavioral semantics, and determine the intermediate link containing behavioral semantics as the target link.

[0138] Memory 1702 may include one or more computer-readable storage media, which may be non-transitory. Memory 1702 may also include high-speed random access memory and non-volatile memory, such as one or more magnetic disk storage devices and flash memory storage devices. In some embodiments of this specification, the non-transitory computer-readable storage medium in memory 1702 is used to store at least one instruction, which is executed by processor 1701 to implement the method of the embodiments of this specification.

[0139] In some embodiments, electronic device 1700 further includes a peripheral device interface 1703 and at least one peripheral device. Processor 1701, memory 1702, and peripheral device interface 1703 may be connected via a bus or signal lines. Each peripheral device may be connected to peripheral device interface 1703 via a bus, signal lines, or circuit boards. Specifically, the peripheral device includes at least one of a display screen 1704, a camera 1705, and an audio circuit 1706.

[0140] The peripheral device interface 1703 can be used to connect at least one input / output (I / O)-related peripheral device to the processor 1701 and the memory 1702. In some embodiments of this specification, the processor 1701, the memory 1702, and the peripheral device interface 1703 are integrated on the same chip or circuit board; in some other embodiments of this specification, any one or two of the processor 1701, the memory 1702, and the peripheral device interface 1703 can be implemented on separate chips or circuit boards. This embodiment of this specification is not specifically limited to this.

[0141] The display screen 1704 is used to display a user interface (UI). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 1704 is a touch screen display, the display screen 1704 also has the ability to collect touch signals on the surface or above the surface of the display screen 1704. The touch signal can be input as a control signal to the processor 1701 for processing. At this time, the display screen 1704 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments of this specification, the display screen 1704 can be one, set on the front panel of the electronic device 1700; in other embodiments of this specification, the display screen 1704 can be at least two, respectively set on different surfaces of the electronic device 1700 or in a folding design; in still other embodiments of this specification, the display screen 1704 can be a flexible display screen, set on the curved surface or folding surface of the electronic device 1700. Even more, the display screen 1704 can be set as a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 1704 can be made of materials such as liquid crystal display (LCD) and organic light-emitting diode (OLED).

[0142] Camera 1705 is used to capture images or videos. Optionally, camera 1705 includes a front camera and a rear camera. Typically, the front camera is arranged on the front panel of the electronic device, and the rear camera is arranged on the back of the electronic device. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize panoramic shooting and virtual reality (VR) shooting function or other fusion shooting functions. In some embodiments of the present specification, camera 1705 may also include a flash. The flash can be a monochrome temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.

[0143] Audio circuit 1706 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, convert the sound waves into electrical signals, and input them into processor 1701 for processing. For the purpose of stereo sound collection or noise reduction, multiple microphones may be provided, respectively, at different locations within electronic device 1700. The microphone may also be an array microphone or an omnidirectional microphone.

[0144] Power supply 1707 is used to power the various components of electronic device 1700. Power supply 1707 can be AC ​​power, DC power, a disposable battery, or a rechargeable battery. When power supply 1707 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery that is charged via a wired line, while a wireless rechargeable battery is a battery that is charged via a wireless coil. The rechargeable battery can also be used to support fast charging technology.

[0145] The electronic device structure block diagram shown in the embodiment of this specification does not constitute a limitation on the electronic device 1700. The electronic device 1700 may include more or fewer components than shown in the figure, or combine certain components, or adopt a different component arrangement.

[0146] The embodiments of this specification also provide a computer-readable storage medium storing instructions that, when executed on a computer or processor, cause the computer or processor to perform one or more steps of the aforementioned embodiments. If the components of the aforementioned data recommendation device are implemented as software functional units and sold or used as independent products, they may be stored in the aforementioned computer-readable storage medium.

[0147] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The above-mentioned computer program product includes one or more computer instructions. When the above-mentioned computer program instructions are loaded and executed on a computer, the above-mentioned process or function according to the embodiment of this specification is generated in whole or in part. The above-mentioned computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The above-mentioned computer instructions can be stored in a computer-readable storage medium or transmitted by the above-mentioned computer-readable storage medium. The above-mentioned computer instructions can be transmitted from a website, computer, server or data center to another website, computer, server or data center by wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.). The above-mentioned computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The above-mentioned available media can be magnetic media (for example, floppy disks, hard disks, tapes), optical media (for example, digital versatile discs (DVDs)), or semiconductor media (for example, solid state disks (SSDs)).

[0148] In the description of this specification, it should be understood that the terms "first", "second", etc. are used for descriptive purposes only and cannot be understood as indicating or implying relative importance. For those skilled in the art, the specific meanings of the above terms in this specification can be understood according to specific circumstances. In addition, in the description of this specification, unless otherwise specified, "multiple" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship.

[0149] It should be noted that the foregoing description of this specification is based on specific embodiments. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or the sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0150] The above description is merely a specific embodiment of this specification, but the scope of protection of this specification is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this specification should be covered by the scope of protection of this specification. Therefore, equivalent variations made according to the claims of this specification are still within the scope of protection of this specification.

Claims

1. A data recommendation method, wherein: The method comprises: Extract features from source data related to the target behavior link to obtain a code feature library containing multiple code scenario features; Based on the online traffic data and the code feature library, multiple scenario code links are determined to obtain a link library; Associating the path corresponding to the offline traffic data with the scenario code link in the link library to obtain a relationship graph; Obtaining a change code feature of the target behavior link, and determining a target link and / or a target scenario related to the change code feature from the relationship graph, wherein the target link and / or the target scenario are recommended data related to the change code feature; Based on the online traffic data and the code feature library, multiple scenario code links are determined to obtain a link library, including: obtaining multiple online traffic data as input to the code feature library, and concatenating the code scenario features in the code feature library into multiple scenario code links according to the flow direction of the online traffic data to obtain a link library.

2. The method according to claim 1, wherein The feature extraction of the source data about the target behavior link is performed to obtain a code feature library containing multiple code scenario features, including: Collect dynamic link data and static link data to obtain source data of the target behavior link; Aggregate the source data, construct a directed graph based on the code call relationship, and use the target algorithm to extract the code dominator tree from the complex directed cyclic graph to obtain the key elements and key code nodes corresponding to the target behavior link; Based on the key elements and the key code nodes, the multiple code scenario features are determined to obtain the code feature library.

3. The method according to claim 2, wherein: The data after the aggregation processing includes one or more of: data on a system call model, data on a code line model, data on a database data model, and data on a feature model.

4. The method according to claim 2, wherein: There are multiple target behavior links; The determining the plurality of code scenario features based on the key elements and the key code nodes includes: Identifying, from the key code nodes corresponding to the plurality of target behavior links, a plurality of necessary nodes and selection nodes corresponding to the target behavior links, wherein the necessary nodes are nodes that the plurality of target behavior links pass through; Based on the selection node, filter out the control flow elements of the key code node; The necessary nodes, the process control elements of the key code nodes, the information flow elements in the key elements, and the interface input and output parameters are determined as the code scenario features.

5. The method according to claim 4, wherein The step of screening out the control flow elements of the key code nodes based on the selection node includes: Determine the code link branch row corresponding to each selection node; By means of static code analysis, the code call relationships related to the branch lines of the code chain are analyzed to obtain the full set of process control elements; According to the key code nodes corresponding to the multiple target behavior links, the full amount of process control elements are screened to obtain the process control elements of the key code nodes.

6. The method according to claim 4, wherein: The selection node includes one or more of a selection node that affects interface input and output parameters, a selection node that affects external calls, a selection node that affects data storage, and a selection node that affects link bifurcation.

7. The method according to any one of claims 1 to 6, wherein: The process of associating the path corresponding to the offline traffic data with the scenario code link in the link library to obtain a relationship graph includes: Determining in the link library a node identical to a node in a path corresponding to the offline traffic data to obtain an associated node, and / or determining in the link library an element identical to an element in a path corresponding to the offline traffic data to obtain an associated element; Taking the associated nodes and / or associated elements as the intersection, the path corresponding to the offline traffic data is added to the link library to obtain the relationship graph reflecting the association relationship between the scene code link and the path corresponding to the offline traffic data.

8. The method according to any one of claims 1 to 6, wherein: The paths corresponding to the offline traffic data are paths corresponding to multiple use cases; The process of associating the path corresponding to the offline traffic data with the scenario code link in the link library to obtain a relationship graph includes: Determine in the link library a node identical to a node in the paths corresponding to the multiple use cases to obtain a first associated node, and / or determine in the link library an element identical to an element in the paths corresponding to the multiple use cases to obtain a first associated element; Determine the target use case including the first association node and / or the first association element as an association scenario in the relationship graph, and determine the path corresponding to the association scenario as a part of the relationship graph; The links between the paths of the multiple use cases that do not contain the first associated node and the first associated element are determined as links to be identified that are not associated with the scenario, and the links to be identified are used as part of the relationship graph.

9. The method according to claim 8, wherein Determining a target link and / or target scenario related to the changed code feature from the relationship graph includes: Determine a node identical to the change code feature in the path corresponding to the associated scenario to obtain a second associated node, and / or determine an element identical to the change code feature in the path corresponding to the associated scenario to obtain a second associated element, and determine the associated scenario containing the second associated node and / or the second associated element as the target scenario, and determine the link to be identified containing the second associated node and / or the second associated element as the target link; The code calling relationship between the code feature library and the newly added code features is analyzed by means of static code analysis, and the target link is determined according to the code calling relationship.

10. The method according to claim 9, wherein: Determining the target link according to the code calling relationship includes: Determine the intermediate link according to the code calling relationship; The code comments corresponding to the intermediate link are analyzed to obtain an intermediate link containing behavioral semantics, and the intermediate link containing behavioral semantics is determined as the target link.

11. A data recommendation device, wherein: The device comprises: A code feature library determination module is used to extract features from source data related to a target behavior link to obtain a code feature library containing multiple code scenario features; A link library determination module is used to determine multiple scenario code links based on online traffic data and the code feature library to obtain a link library; A relationship library determination module is used to associate the path corresponding to the offline traffic data with the scenario code link in the link library to obtain a relationship map; a recommendation module, configured to obtain a change code feature of the target behavior link, and determine a target link and / or a target scenario related to the change code feature from the relationship graph, wherein the target link and / or the target scenario are determined as recommended data related to the change code feature; The link library determination module is specifically used to obtain traffic data on multiple lines as input to the code feature library, and to concatenate the code scene features in the code feature library into multiple scene code links according to the flow direction of the traffic data on the lines to obtain a link library.

12. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the data recommendation method according to any one of claims 1 to 10 is implemented.

13. A computer-readable storage medium storing instructions, wherein when the instructions are executed on a computer or a processor, the computer or the processor executes the data recommendation method according to any one of claims 1 to 10.

14. A computer program product comprising instructions, which, when run on a computer or a processor, causes the computer or the processor to execute the data recommendation method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Test case generation method and device, server and storage medium

    CN111309635A

  • Automatic test case determination method and device, equipment and storage medium

    CN111382073A