Method for determining interface calling link, medium and electronic equipment

By analyzing project source code to generate syntax trees and determine interface call link data, the complexity of front-end and back-end relationships is managed, enhancing development efficiency and system reliability.

CN119179515APending Publication Date: 2024-12-24KE COM (BEIJING) TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411245466.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-05
Publication Date
2024-12-24

AI Technical Summary

Technical Problem

The complexity of the calling relationship between front-end pages and back-end interfaces in large software projects makes it difficult for developers to understand and manage, increasing development and maintenance challenges.

Method used

A method involving syntax analysis of project source code to generate syntax trees, determine page association and business module call data, and create interface call link data files, which are then visually displayed to manage these relationships.

Benefits of technology

Enables efficient management of interface call relationships, ensuring system stability and reliability by providing clear visualizations of the calling links.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119179515A_ABST
    Figure CN119179515A_ABST
Patent Text Reader

Abstract

Disclosed are a method for determining an interface call link, a medium and an electronic device, at least one syntax tree is obtained by performing grammar analysis on each code file in a project source code of a target project, the code file comprising a plurality of entry files; determining page associated information of at least one page based on each syntax tree in the at least one syntax tree; determining service module calling data of the at least one page based on the page associated information of the at least one page and syntax trees corresponding to the plurality of entry files; and determining the interface calling link data of the target project based on the page association relationship of the at least one page and the business module calling data, thereby automatically obtaining the interface calling link data in the project through the project source code, and helping developers to efficiently manage the interface calling relationship in the project.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a method, medium and electronic device for determining an interface call link. Background Art

[0002] In large software projects, the calling relationship between the front-end page and the back-end interface is relatively complex. For example, a front-end page usually calls multiple back-end interfaces, and a back-end interface may also be called by multiple front-end pages. This makes it impossible for project developers to fully understand the calling relationship between the front-end page and the back-end interface, which not only increases the difficulty of project development, but also increases the difficulty of testing and maintenance of software projects.

[0003] Therefore, how to accurately obtain the calling relationship between the front-end page and the back-end interface has become a technical problem that needs to be solved urgently. Summary of the invention

[0004] In order to solve the above technical problems, embodiments of the present disclosure provide a method, a medium and an electronic device for determining an interface call link.

[0005] According to a first aspect of an embodiment of the present disclosure, a method for determining an interface call link is provided, including:

[0006] Performing syntax analysis on each code file in the project source code of the target project to obtain at least one syntax tree, wherein the code file includes a plurality of entry files;

[0007] Determining page association information of at least one page based on each syntax tree in the at least one syntax tree;

[0008] Determining business module call data of at least one page based on the page association information of the at least one page and the syntax trees corresponding to the multiple entry files;

[0009] Based on the page association relationship of the at least one page and the business module calling data, the interface calling link data of the target project is determined.

[0010] In some embodiments of the present disclosure, after determining the interface call link data of the target project, the method further includes:

[0011] Generate a first interface file and a second interface file based on the interface call link data of the target project, wherein the first interface file records the call relationship between each page and the node layer interface, and the second interface file records the call relationship between the node layer interface and the backend interface;

[0012] In response to monitoring the data query operation, the first interface file and the second interface file are visually displayed.

[0013] In some embodiments of the present disclosure, before parsing each code file in the project source code of the target project, the method further includes:

[0014] Based on the project configuration information, obtain the address of the target project's code repository;

[0015] In response to monitoring a change operation on the code in the code repository, obtaining project source code of the target project.

[0016] In some implementations of the present disclosure, determining page association information of at least one page based on each syntax tree in the at least one syntax tree includes:

[0017] Utilize the node parsing function corresponding to different nodes in each syntax tree to parse each node to obtain page association information of each page, wherein the unique key of the page association information is the page identifier, and the page association information includes at least one of the following: variable declaration relationship, page identifier, page component identifier, component dependency relationship, and page jump routing relationship.

[0018] In some embodiments of the present disclosure, determining the interface call link data of at least one page based on the page association information of the at least one page and the syntax trees corresponding to the plurality of entry files includes:

[0019] The syntax trees corresponding to the multiple entry files are parsed using the setting identifier to obtain multiple interface call data;

[0020] Based on the page association information of each page, the association relationship of multiple interface call data is obtained;

[0021] Based on the association relationship of the multiple interface call data, the business module call data of each page is generated, wherein the unique key of the business module call data is the page identifier.

[0022] In some implementations of the present disclosure, determining the interface call link data of the target project based on the page association relationship of the at least one page and the business module call data includes:

[0023] Based on the page identification, the association relationship between each page and the call data of each business module are matched and parsed to obtain the interface call link data of the target project. The interface call link data of the target project includes at least one of the following: the back-end interface data of the target project, the back-end interface data of each component file in the target project, the correspondence between the node layer service and the back-end interface, and the correspondence between the page routing and the back-end interface.

[0024] According to a second aspect of an embodiment of the present disclosure, there is provided a device for determining an interface call link, including:

[0025] A parsing module, used for performing syntax parsing on each code file in the project source code of the target project to obtain at least one syntax tree, wherein the code file includes a plurality of entry files;

[0026] A first determination module, configured to determine page association information of at least one page based on each syntax tree in the at least one syntax tree;

[0027] A second determination module, configured to determine the business module call data of the at least one page based on the page association information of the at least one page and the syntax trees corresponding to the plurality of entry files;

[0028] The third determination module is used to determine the interface call link data of the target project based on the page association relationship of the at least one page and the business module call data.

[0029] In some embodiments of the present disclosure, the device further comprises:

[0030] A generation module, configured to generate a first interface file and a second interface file based on the interface call link data of the target project, wherein the first interface file records the call relationship between each page and the node layer interface, and the second interface file records the call relationship between the node layer interface and the backend interface;

[0031] A display module is used to visually display the first interface file and the second interface file in response to monitoring a data query operation.

[0032] In some embodiments of the present disclosure, the device further comprises:

[0033] The first acquisition module is used to acquire the address of the code repository of the target project based on the project configuration information;

[0034] The second acquisition module is used to acquire the project source code of the target project in response to monitoring the change operation on the code in the code repository.

[0035] In some embodiments of the present disclosure, the first determination module is used to parse each node using a node parsing function corresponding to different nodes in each syntax tree to obtain page association information of each page, wherein the unique key of the page association information is a page identifier, and the page association information includes at least one of the following: a variable declaration relationship, a page identifier, a page component identifier, a component dependency relationship, and a routing relationship of a page jump.

[0036] In some embodiments of the present disclosure, the third determination module includes:

[0037] The parsing submodule is used to parse the syntax trees corresponding to the multiple entry files using the set identifiers to obtain multiple interface call data;

[0038] The acquisition submodule is used to acquire the association relationship of multiple interface call data based on the page association information of each page;

[0039] A generating submodule is used to generate business module calling data of each page based on the association relationship of the plurality of interface calling data, wherein the unique key of the business module calling data is the page identifier.

[0040] In some embodiments of the present disclosure, the third determination module is used to match and parse the association relationships of each page and the call data of each business module based on the page identification to obtain the interface call link data of the target project, and the interface call link data of the target project includes at least one of the following: the back-end interface data of the target project, the back-end interface data of each component file in the target project, the correspondence between the node layer service and the back-end interface, and the correspondence between the page routing and the back-end interface.

[0041] According to a third aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, wherein the storage medium stores computer program instructions, and when the computer program instructions are executed, the above-mentioned method for determining an interface call link is implemented.

[0042] According to a fourth aspect of an embodiment of the present disclosure, an electronic device is provided, the electronic device comprising:

[0043] A memory for storing a computer program product;

[0044] The processor is used to execute the computer program product stored in the memory, and when the computer program product is executed, the method for determining the interface call link is implemented.

[0045] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, comprising computer program instructions, which implement the above-mentioned method for determining an interface call link when the computer program instructions are executed by a processor.

[0046] Based on the method, medium and electronic device for determining the interface call link provided by the above-mentioned embodiment of the present disclosure, multiple syntax trees are obtained by performing syntax parsing on each code file of the project source code of the target project, and then the nodes in each syntax tree can be parsed to obtain the interface call link data of the target project. Therefore, the technical solution of the present disclosure can obtain the interface call link data in the project by parsing the project source code, which helps developers to efficiently manage the interface call relationship in the project, thereby ensuring the stability and reliability of the system.

[0047] The technical solution of the present disclosure is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] By describing the embodiments of the present disclosure in more detail in conjunction with the accompanying drawings, the above and other purposes, features and advantages of the present disclosure will become more apparent. The accompanying drawings are used to provide a further understanding of the embodiments of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the present disclosure and do not constitute a limitation of the present disclosure. In the drawings, the same reference numerals generally represent the same components or steps.

[0049] Figure 1 A system structure diagram for determining an interface call link in the present disclosure;

[0050] Figure 2 A flowchart of an embodiment of a method for determining an interface call link disclosed in the present invention;

[0051] Figure 3 A flowchart of another embodiment of the method for determining an interface call link disclosed in the present invention;

[0052] Figure 4 A topological diagram of link data called by the interface disclosed in the present invention;

[0053] Figure 5 A flowchart of another embodiment of the method for determining an interface call link disclosed in the present invention;

[0054] Figure 6 A schematic diagram of the structure of an embodiment of a device for determining an interface call link disclosed in the present invention;

[0055] Figure 7 A structural diagram of another embodiment of the apparatus for determining an interface call link disclosed in the present invention;

[0056] Figure 8 It is a structural diagram of an electronic device provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0057] The exemplary embodiments according to the present disclosure will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all the embodiments of the present disclosure, and it should be understood that the present disclosure is not limited to the exemplary embodiments described here.

[0058] It should be noted that the relative arrangement of components and steps, the numerical expressions and numerical values ​​set forth in these embodiments do not limit the scope of the present disclosure unless specifically stated otherwise.

[0059] Those skilled in the art can understand that the terms "first" and "second" in the embodiments of the present disclosure are only used to distinguish different steps, devices or modules, etc., and neither represent any specific technical meaning nor indicate the necessary logical order between them.

[0060] It should also be understood that in the embodiments of the present disclosure, “plurality” may refer to two or more than two, and “at least one” may refer to one, two, or more than two.

[0061] It should also be understood that any component, data or structure mentioned in the embodiments of the present disclosure can generally be understood as one or more, unless explicitly limited or otherwise indicated in the context.

[0062] In addition, the term "and / or" in this disclosure is only a description of the association relationship of associated objects, indicating that there may be three relationships, such as A and / or B, which can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this disclosure generally indicates that the associated objects before and after are in an "or" relationship.

[0063] It should also be understood that the description of the various embodiments in the present disclosure focuses on the differences between the various embodiments, and the same or similar aspects thereof can be referenced to each other, and for the sake of brevity, they will not be described one by one.

[0064] At the same time, it should be understood that for the convenience of description, the sizes of the various parts shown in the drawings are not drawn according to the actual proportional relationship.

[0065] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present disclosure, its application, or uses.

[0066] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered part of the specification.

[0067] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.

[0068] The embodiments of the present disclosure can be applied to electronic devices such as terminal devices, computer systems, servers, etc., which can operate with many other general or special computing system environments or configurations. Examples of well-known terminal devices, computing systems, environments and / or configurations suitable for use with electronic devices such as terminal devices, computer systems or servers include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network personal computers, small computer systems, large computer systems, and distributed cloud computing technology environments including any of the above systems, etc.

[0069] Electronic devices such as terminal devices, computer systems, servers, etc. can be described in the general context of computer system executable instructions (such as program modules) executed by computer systems. Generally, program modules can include routines, programs, target programs, components, logic, data structures, etc., which perform specific tasks or implement specific abstract data types. Computer systems / servers can be implemented in a distributed cloud computing environment. In a distributed cloud computing environment, tasks can be performed by remote processing devices linked through a communication network. In a distributed cloud computing environment, program modules can be located on local or remote computing system storage media including storage devices.

[0070] Application Overview

[0071] In the process of implementing the present disclosure, the inventors discovered that in the development of large-scale projects, the calling relationship between the front-end page and the back-end interface is very complicated. For example, a front-end page usually calls multiple back-end interfaces, and a back-end interface may also be called by multiple front-end pages. This makes it impossible for project developers to fully understand the calling relationship between the front-end page and the back-end interface.

[0072] In the method for determining the interface call link provided by the present invention, each code file in the project source code of the target project can be parsed to obtain at least one syntax tree; based on each syntax tree in the at least one syntax tree, the page association information of at least one page can be determined; based on the page association information of at least one page and the syntax trees corresponding to multiple entry files, the business module call data of at least one page can be determined; finally, based on the page association relationship of at least one page and the business module call data, the interface call link data of the target project can be determined, thereby obtaining the interface call link data in the project, which helps developers to efficiently manage the interface call relationship in the project, thereby ensuring the stability and reliability of the system.

[0073] Exemplary Systems

[0074] Figure 1This is a system structure diagram for determining an interface call link in the present disclosure, such as Figure 1 As shown, the system may include an infrastructure, a project configuration module, a task monitoring module, a scheduled task module, a task processing module, a data storage module, and a content display module.

[0075] The infrastructure may include node (node ​​layer), backend framework (such as koa framework), and process management tool (ProcessManager2, referred to as PM2). The node layer refers to the node service layer, which is the bridge between the front-end page and the back-end interface call. The node layer can define various interface functions, and the front-end page can call various interface functions defined by the node layer. The node layer then calls the back-end interface accordingly, thereby realizing the role of the node layer as a bridge between the front-end page and the back-end interface. Koa framework is a web framework based on Node.js, which is used to provide a simpler and more flexible way to build web applications. PM2 is an open source tool for managing and monitoring the operation of Node.js applications.

[0076] The project configuration module is used to configure key information of the project, including the warehouse name, Git warehouse address, warehouse description, and code module entry (such as routing entry, backend interface module entry), etc. The project configuration module can be used to implement personalized configuration for different projects, which helps to achieve compatibility with different systems. In addition, this module also provides necessary configuration information support for subsequent task monitoring modules and task processing modules.

[0077] The task monitoring module includes the EventEmitter module and the Kafka message configuration module. The EventEmitter module is used to handle event triggering and monitoring. The Kafka message configuration module is used to generate Kafka messages when monitoring changes in the warehouse code. The task monitoring module obtains and parses the code warehouse information through the project configuration module, monitors the code change operations in the current warehouse, and if there are code changes, the current warehouse can be marked as "pending update" so that the scheduled task module can perform task processing on the code later. This process ensures real-time tracking and effective processing of code updates, improving the project's collaboration efficiency and code management quality.

[0078] The scheduled task module includes a node scheduling (Node Schedule) module. The Node Schedule module is a scheduling library of Node.js based on time scheduling tasks. The task scheduling operation is performed through the Node Schedule module, and the code repository information of the current business changes is obtained. Since it may take a long time to perform code parsing operations in the technical solution disclosed in the present invention, the scheduled task module can execute tasks on a scheduled basis. For example, the generation process of the interface call link of the project is executed during a non-busy time period every day (such as 1 a.m.). On the premise of ensuring timely updates to the interface call link, it can also reduce the performance consumption caused by frequent data updates, while improving work efficiency.

[0079] The task processing module includes a code parser, which is used for code repository parsing and interface call link data generation.

[0080] The data storage module includes a database, which is responsible for storing the interface call link data generated by the task processing module so that the content display module can query and display it. Through effective data storage management, data can be quickly retrieved and accurately presented, providing strong data support for team decision-making and project progress.

[0081] The content display module is used to generate a topology map based on the generated interface call link data, and supports querying pages through interfaces and querying data interfaces through pages, such as Figure 4 As shown, the interface call link data that can be displayed on the page is illustrated.

[0082] Exemplary Methods

[0083] Figure 2 FIG. 1 is a flow chart of an embodiment of a method for determining an interface call link disclosed in the present invention. Figure 2 The method shown includes step 201 to step 204. Each step is described below.

[0084] In step 201, syntax parsing is performed on each code file in the project source code of the target project to obtain at least one syntax tree, and the code file includes multiple entry files.

[0085] Among them, the project source code refers to the source code of the project, which can include the code of each page, component, and business logic, and can be divided into business component module files and entry files. Business component module files are code files of each component in the front-end page, and entry files can be files corresponding to each uniform resource locator (URL) link, which can be understood as routing files and back-end interface files. In specific implementation, you can obtain each version of the project source code from the code repository according to the project configuration file.

[0086] In some optional implementations, each code file of the project source code can be traversed. During the traversal process, the codes of different files are converted into a unified format, which can be a format that can be parsed by a code parser (such as Babel). For example, the TypeScript format can be converted into the JavaScript format, and the React DOM is converted as necessary to ensure that all files are JavaScript codes of the same format for subsequent Babel parsing.

[0087] The code tree may be an Abstract Syntax Tree (AST for short), which contains node information of each node in each code file and dependency relationships between nodes.

[0088] After the code is formatted, a code parser, such as the Babel tool, can be used to parse the code and generate a code tree. Each file is converted into a JSON object of an AST (abstract syntax tree).

[0089] In step 202, page association information of at least one page is determined based on each syntax tree in at least one syntax tree.

[0090] The unique key of the page association information is the page identifier, and the page association information includes at least one of the following: variable declaration relationship, page identifier, page component identifier, component dependency relationship, and page jump routing relationship. The variable declaration relationship refers to declaring a variable so that the variable can be called in the project; the page identifier refers to the information used to identify a page, such as the URL link of the page; the page component identifier is used to indicate the identification information of the components contained in the page, such as the identification information of the button component and the text box component in the page; the component dependency relationship usually refers to the relationship in which one component depends on another component; the page jump routing relationship is used to indicate the relationship connecting each front-end page.

[0091] In some optional implementations, the AST syntax tree has a fixed type definition and parsing method for each node. Therefore, each node can be parsed using the node parsing function corresponding to different nodes in each syntax tree to obtain page association information for each page. For example, the VariableDeclarator method can be used to parse variable declarations.

[0092] Through the parsing method, you can extract component dependencies, variable declaration relationships, page identifiers, component identifiers, and page jump routing relationships in each code file, organize the page-related information into a JSON object, and store it with the page identifier as the unique key.

[0093] In step 203, based on the page association information of the at least one page and the syntax trees corresponding to the multiple entry files, the business module calling data of the at least one page is determined.

[0094] The business module call data is used to indicate the interface call data used in the page, including the correspondence between each component in the page and the backend interface call.

[0095] In some optional implementations, the syntax trees corresponding to multiple entry files can be parsed by setting an identifier (such as "request" in the node name) to obtain multiple interface call data. Then, based on the component dependencies in the page association information, these interface information can be stored as a JSON object using the page identifier as the unique key.

[0096] In step 204, based on the page association relationship of at least one page and the business module calling data, the interface calling link data of the target project is determined.

[0097] The interface call link data may include the backend interface data called in the target project, multiple component relationships corresponding to the page route, and the backend interface corresponding to the component, etc. The interface call link data of the target project includes at least one of the following: the backend interface data of the target project, the backend interface data of each component file in the target project, the correspondence between the node layer service and the backend interface, and the correspondence between the page route and the backend interface.

[0098] Among them, the back-end interface data called by the project may include the back-end interface path, interface request, interface name, etc.; the back-end interface data of each component file may include the path of the component file, the back-end interface called by the component file, the file title, the file git submission information, etc.; the correspondence between the node layer service and the back-end interface may include the correspondence between each node layer service and the back-end interface, including the URL path corresponding to the node layer, the page path corresponding to the node layer interface, and the back-end interface corresponding to the node layer interface, etc.; the correspondence between the page route and the back-end interface may include the page URL, the entry file of the URL, the entry component corresponding to the URL page, the back-end interface corresponding to the URL, etc.

[0099] Through the above steps 201 to 204, by performing syntax parsing on each code file of the project source code of the target project, multiple syntax trees are obtained, and then the interface call link data of the target project can be obtained based on the nodes in each syntax tree. Therefore, the technical solution disclosed in the present invention can obtain the interface call link data in the project by parsing the project source code, which helps developers to efficiently manage the interface call relationship in the project, thereby ensuring the stability and reliability of the system.

[0100] Figure 3FIG. 1 is a flow chart of another embodiment of the method for determining an interface call link disclosed in the present invention. Figure 3 The method shown includes step 301 to step 308. Each step is described below.

[0101] In step 301, based on the project configuration information, the address of the code repository of the target project is obtained.

[0102] The project configuration information may record key information of the project, such as the project name, project version number, the name of the repository corresponding to the project, the address of the code repository, the repository description, the code module entry, etc. The address of the code repository refers to the repository address used to store the source code files of each version of the project.

[0103] In step 302, in response to monitoring a change operation on the code in the code repository, the project source code of the target project is obtained.

[0104] The change operation is used to indicate the code update operation. Based on the address of the code repository, you can monitor whether the code is updated in real time or at a scheduled time, and obtain the updated project source code of the target project when the code is updated and submitted.

[0105] In step 303, syntax parsing is performed on each code file in the project source code of the target project to obtain at least one syntax tree, and the code file includes multiple entry files.

[0106] In step 304, page association information of at least one page is determined based on each syntax tree in the at least one syntax tree.

[0107] In step 305, based on the page association information of the at least one page and the syntax trees corresponding to the multiple entry files, the business module calling data of the at least one page is determined.

[0108] In step 306, based on the page association relationship of at least one page and the business module calling data, the interface calling link data of the target project is determined.

[0109] The specific implementation of steps 303 to 306 can be found in Figure 2 The description of steps 201 to 204 of the illustrated embodiment will not be described in detail here.

[0110] In step 307, based on the interface call link data of the target project, a first interface file and a second interface file are generated, wherein the first interface file records the calling relationship between each page and the node layer interface, and the second interface file records the calling relationship between the node layer interface and the backend interface.

[0111] In some optional implementations, a second interface file may be generated based on the backend interface data called by the project in the interface call link data and the correspondence between the node layer service and the backend interface, and the second interface file records the call relationship between each node layer service and the backend interface. The exemplary code of the backend interface data called by the project is as follows:

[0112] {

[0113] / / api prefix path

[0114] "apiPath":" / test-team / api",

[0115] / / Backend API path

[0116] "url":" / test / getdata",

[0117] / / proxy proxy prefix

[0118] "prefixApi":"default-proxy",

[0119] / / Interface call name

[0120] "name":"getdata",

[0121] / / Interface request method

[0122] "methed":"get",

[0123] / / The file path where the interface is located

[0124] "path":"src / apis / test.js",

[0125] / / File name

[0126] "fileName":"test"

[0127] } ]

[0129] The example code of the correspondence between the node layer service and the backend interface is as follows: [

[0131] {

[0132] / / node url path

[0133] "url":" / node / api / test",

[0134] / / Node api file path

[0135] "path":" / mycode / src / actions / test.js",

[0136] "filePath":null,

[0137] / / The backend API interface corresponding to the node interface

[0138] "apiList":[

[0139] {

[0140]

[0141] Exemplarily, by parsing the backend interface data called by the above project and the correspondence between the node layer service and the backend interface, the calling relationship between each node layer service and the backend interface can be obtained, as shown below:

[0142]

[0143]

[0144] In some other optional implementations, the first interface file may be generated based on the backend interface data of each component file in the interface call link data and the correspondence between the page route and the backend interface.

[0145] Exemplarily, the backend interface data code of each component file is shown as follows:

[0146]

[0147] The corresponding relationship between page routing and backend interface is shown as follows:

[0148]

[0149] By parsing the backend interface data of the above-mentioned component files and the corresponding relationship between the page routing and the backend interface, the calling relationship between each page and the node layer interface can be obtained.

[0150] In this embodiment, after the first interface file and the second interface file are generated, they may be stored in a database, such as a MySQL database.

[0151] In step 308, in response to monitoring the data query operation, the first interface file and the second interface file are visually displayed.

[0152] The data query operation can be understood as an operation of querying data, such as an operation of querying relevant data in a database through a structured query statement SQL statement.

[0153] In this embodiment, after receiving the data query operation, the query result can be obtained in the database and displayed visually, such as Figure 4 As shown, a topological interface diagram of the query result is shown.

[0154] Through the above steps 301 to 308, a process is disclosed in which each code file of the project source code of the target project is automatically parsed for syntax when a code change occurs by monitoring the code repository, and the interface call link data of the project is generated. Thus, the disclosed technical solution realizes real-time tracking and effective processing of code updates, which helps to improve the reliability of the project; in addition, by storing data in a database, rapid retrieval and display of data can be realized, which helps to provide reliable data support for project developers.

[0155] Figure 5 FIG. 1 is a flow chart of another embodiment of the method for determining an interface call link disclosed in the present invention. Figure 3 As shown, step 203 includes step 231 to step 233. Each step is described below.

[0156] In step 231, the syntax trees corresponding to the multiple entry files are parsed using the setting identifier to obtain multiple interface call data.

[0157] The interface call data is used to indicate the correspondence between the code component and the backend interface call, and may include page identifiers, component identifiers, and interface data. The setting identifier is used to indicate the identifier used when making an interface call in the code. For example, the code usually uses the requests library to call the Hypertext Transfer Protocol (HTTP) interface, so the HTTP interface call data in the code can be parsed from the syntax tree through the requests identifier.

[0158] In step 232, based on the page association information of each page, the association relationship of multiple interface call data is obtained.

[0159] The page association information may be the dependency of components in the page. Through the component dependency and the correspondence between the components and the backend interface calls obtained in step 231, the dependency (association) between different interface call data may be obtained.

[0160] In step 233, based on the association relationship of the plurality of interface call data, the business module call data of each page is generated, wherein the unique key of the business module call data is the page identifier.

[0161] The business module call data may be the backend interface data of each page in the project.

[0162] In some optional implementations, since both the page association information and the interface call data contain page identifiers (such as page names), the page identifiers can be used for matching to extract the backend interface data of each page in the project, that is, to obtain the business module call data of each page.

[0163] Through the above steps 231-233, the process of generating business module call data according to the page association information and the correspondence between the component and the back-end interface is disclosed. Subsequently, the interface call link data of the project can be determined according to the business module call data and the page association relationship. Therefore, the technical solution disclosed in the present invention can obtain the business module call data of the project by parsing the project source code, which helps developers to efficiently manage the interface call relationship in the project, thereby ensuring the stability and reliability of the system.

[0164] Exemplary Devices

[0165] Figure 6 FIG. 1 is a schematic diagram of a structure of an embodiment of a device for determining an interface call link according to the present disclosure. Figure 6 As shown, the device comprises:

[0166] A parsing module 61 is used to perform syntax analysis on each code file in the project source code of the target project to obtain at least one syntax tree, wherein the code file includes multiple entry files;

[0167] A first determination module 62, configured to determine page association information of at least one page based on each syntax tree in at least one syntax tree;

[0168] A second determination module 63, configured to determine the business module call data of at least one page based on the page association information of the at least one page and the syntax trees corresponding to the multiple entry files;

[0169] The third determination module 64 is used to determine the interface call link data of the target project based on the page association relationship of at least one page and the business module call data.

[0170] Figure 7 A schematic diagram of the structure of another embodiment of the apparatus for determining an interface call link disclosed in the present invention. Figure 7 As shown, in Figure 6 Based on the illustrated embodiment, in some optional implementations, the device further includes:

[0171] A generating module 65, for generating a first interface file and a second interface file based on the interface call link data of the target project, wherein the first interface file records the call relationship between each page and the node layer interface, and the second interface file records the call relationship between each node layer interface and the backend interface;

[0172] The display module 66 is used to visually display the first interface file and the second interface file in response to monitoring the data query operation.

[0173] In some optional embodiments, the device further comprises:

[0174] A first acquisition module 67 is used to acquire the address of the code repository of the target project based on the project configuration information;

[0175] The second acquisition module 68 is used to acquire the project source code of the target project in response to monitoring the change operation on the code in the code repository.

[0176] In some optional embodiments, the first determination module 62 is used to parse each node using the node parsing function corresponding to different nodes in each syntax tree to obtain page association information of each page, wherein the unique key of the page association information is the page identifier, and the page association information includes at least one of the following: variable declaration relationship, page identifier, page component identifier, component dependency relationship, and page jump routing relationship.

[0177] In some optional implementations, the third determining module 64 includes:

[0178] The parsing submodule 641 is used to parse the syntax trees corresponding to the multiple entry files using the set identifiers to obtain multiple interface call data;

[0179] The acquisition submodule 642 is used to acquire the association relationship of multiple interface call data based on the page association information of each page;

[0180] The generating submodule 643 is used to generate the business module calling data of each page based on the association relationship of the multiple interface calling data, wherein the unique key of the business module calling data is the page identifier.

[0181] In some optional embodiments, the third determination module 64 is used to match and parse the association relationships of each page and the call data of each business module based on the page identifier to obtain the interface call link data of the target project. The interface call link data of the target project includes at least one of the following: the back-end interface data of the target project, the back-end interface data of each component file in the target project, the correspondence between the node layer service and the back-end interface, and the correspondence between the page route and the back-end interface.

[0182] The exemplary embodiment of the device corresponds to the exemplary method part, and the relevant contents can be referenced and quoted to each other. The beneficial technical effects corresponding to the exemplary embodiment of the device can refer to the corresponding beneficial technical effects of the exemplary method part, which will not be repeated here.

[0183] Exemplary electronic devices, computer program products, and computer-readable storage media

[0184] An embodiment of the present disclosure further provides an electronic device, comprising: a memory for storing a computer program; a processor for executing the computer program stored in the memory, and when the computer program is executed, the method for determining an interface call link of any of the above embodiments of the present disclosure is implemented.

[0185] Below, reference Figure 8 An electronic device according to an embodiment of the present disclosure is described, in which a device for implementing the method according to an embodiment of the present disclosure may be integrated. Figure 8 A structural diagram of an electronic device provided in an exemplary embodiment of the present disclosure, such as Figure 8 As shown, the electronic device includes one or more processors 81, one or more computer-readable storage media memory 82, and a computer program stored in the memory and executable on the processor. When executing the program in the memory 82, the above method for determining the interface call link can be implemented.

[0186] Specifically, in practical applications, the electronic device may further include components such as an input device 83 and an output device 84, and these components are interconnected via a bus system and / or other forms of connection mechanisms (not shown). Those skilled in the art will appreciate that Figure 8 The structure of the electronic device shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or certain components, or different component arrangements.

[0187] The processor 81 can be a central processing unit (CPU) or other forms of processing units with the ability to determine an interface call link and / or instruction execution capability. It performs various functions and processes data by running or executing software programs and / or modules stored in the memory 82, and calling data stored in the memory 82, thereby monitoring the electronic device as a whole.

[0188] The memory 82 may store one or more computer program products, and the memory may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The above-mentioned volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. The above-mentioned non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program products may be stored on a computer-readable storage medium, and the processor 81 may run the computer program products to implement the above-mentioned methods for determining an interface call link and / or other desired functions of the various embodiments of the present disclosure.

[0189] The input device 83 can be used to receive input digital or character information. The input device 83 can include a keyboard, a mouse, a joystick, etc. related to user settings and function control.

[0190] The output device 84 can output various information to the outside, including the determined distance information, direction information, etc. The output device 84 can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, and the like.

[0191] The electronic device may also include a power supply for supplying power to various components, which may be logically connected to the processor 81 through a power management system, so as to manage charging, discharging, power consumption and other functions through the power management system. The power supply may also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators and other arbitrary components.

[0192] Of course, to simplify, Figure 8 Only some of the components related to the present disclosure in the electronic device are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, according to specific application situations, the electronic device may further include any other appropriate components.

[0193] In addition to the above-mentioned methods and devices, an embodiment of the present disclosure may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps in the method for determining an interface call link according to various embodiments of the present disclosure described in the above-mentioned "Exemplary Method" section of this specification.

[0194] The computer program product may be written in any combination of one or more programming languages ​​to write program code for performing the operations of the disclosed embodiments, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0195] In addition, an embodiment of the present disclosure may also be a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the processor executes the steps in the method for determining an interface call link according to various embodiments of the present disclosure described in the above "Exemplary Method" section of this specification.

[0196] Computer readable storage media can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0197] The basic principles of the present disclosure are described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, effects, etc. mentioned in the present disclosure are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. are required by each embodiment of the present disclosure. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, and are not limitations. The above details do not limit the present disclosure to the necessity of adopting the above specific details to be implemented.

[0198] Each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system embodiment, since it basically corresponds to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0199] A person of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk, etc., various media that can store program codes.

[0200] The method and apparatus of the present disclosure may be implemented in many ways. For example, the method and apparatus of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above order of steps for the method is for illustration only, and the steps of the method of the present disclosure are not limited to the order specifically described above, unless otherwise specifically stated. In addition, in some embodiments, the present disclosure may also be implemented as a program recorded in a recording medium, which includes machine-readable instructions for implementing the method according to the present disclosure. Therefore, the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.

[0201] The description of the present disclosure is given for the purpose of illustration and description, and is not intended to be exhaustive or to limit the present disclosure to the disclosed form. Many modifications and variations will be apparent to those of ordinary skill in the art. The embodiments are selected and described in order to better illustrate the principles and practical applications of the present disclosure, and to enable those of ordinary skill in the art to understand the present disclosure and thereby design various embodiments with various modifications suitable for specific uses.

Claims

1. A method for determining an interface call link, characterized in that: include: Performing syntax analysis on each code file in the project source code of the target project to obtain at least one syntax tree, wherein the code file includes a plurality of entry files; Determining page association information of at least one page based on each syntax tree in the at least one syntax tree; Determining business module call data of at least one page based on the page association information of the at least one page and the syntax trees corresponding to the multiple entry files; Based on the page association relationship of the at least one page and the business module calling data, the interface calling link data of the target project is determined.

2. The method according to claim 1, characterized in that After determining the interface call link data of the target project, the method further includes: Generate a first interface file and a second interface file based on the interface call link data of the target project, wherein the first interface file records the call relationship between each page and the node layer interface, and the second interface file records the call relationship between the node layer interface and the backend interface; In response to monitoring the data query operation, the first interface file and the second interface file are visually displayed.

3. The method according to any one of claims 1-2, characterized in that: Before parsing the syntax of each code file in the project source code of the target project, the method further includes: Based on the project configuration information, obtain the address of the target project's code repository; In response to monitoring a change operation on the code in the code repository, obtaining project source code of the target project.

4. The method according to any one of claims 1 to 3, characterized in that: The determining, based on each syntax tree in the at least one syntax tree, page association information of at least one page includes: Utilize the node parsing function corresponding to different nodes in each syntax tree to parse each node to obtain page association information of each page, wherein the unique key of the page association information is the page identifier, and the page association information includes at least one of the following: variable declaration relationship, page identifier, page component identifier, component dependency relationship, and page jump routing relationship.

5. The method according to claim 4, characterized in that The determining the interface call link data of at least one page based on the page association information of the at least one page and the syntax trees corresponding to the multiple entry files includes: The syntax trees corresponding to the multiple entry files are parsed using the setting identifier to obtain multiple interface call data; Based on the page association information of each page, the association relationship of multiple interface call data is obtained; Based on the association relationship of the multiple interface call data, the business module call data of each page is generated, wherein the unique key of the business module call data is the page identifier.

6. The method according to claim 5, characterized in that The determining the interface call link data of the target project based on the page association relationship of the at least one page and the business module call data includes: Based on the page identification, the association relationship between each page and the call data of each business module are matched and parsed to obtain the interface call link data of the target project. The interface call link data of the target project includes at least one of the following: the back-end interface data of the target project, the back-end interface data of each component file in the target project, the correspondence between the node layer service and the back-end interface, and the correspondence between the page routing and the back-end interface.

7. A device for determining an interface call link, characterized in that: include: A parsing module, used for performing syntax parsing on each code file in the project source code of the target project to obtain at least one syntax tree, wherein the code file includes a plurality of entry files; A first determination module, configured to determine page association information of at least one page based on each syntax tree in the at least one syntax tree; A second determination module, configured to determine the business module call data of the at least one page based on the page association information of the at least one page and the syntax trees corresponding to the plurality of entry files; The third determination module is used to determine the interface call link data of the target project based on the page association relationship of the at least one page and the business module call data.

8. A computer-readable storage medium, wherein the storage medium stores computer program instructions, and when the computer program instructions are executed, the method according to any one of claims 1 to 6 is implemented.

9. An electronic device, comprising: a memory for storing a computer program product; A processor is used to execute the computer program product stored in the memory, and when the computer program product is executed, it implements the method described in any one of claims 1 to 6.

10. A computer program product comprising computer program instructions, characterized in that When the computer program instructions are executed by a processor, the method described in any one of claims 1 to 6 is implemented.