Method and apparatus for determining inter-service dependency relationships, electronic device, and computer-readable storage medium
By performing semantic recognition on microservice code files to extract target parameters and determine inter-service dependencies, the method addresses the incompleteness of existing dependency determination methods, ensuring accurate and efficient access right management in cloud-native systems.
Patent Information
- Application Number
- JP2024513463
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2021-08-30
- Filing Date
- 2022-08-05
- Publication Date
- 2024-10-08
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing methods for determining inter-service dependencies in microservices are incomplete, leading to inefficiencies in security management as access rights are not accurately set, compromising the security of cloud-native systems.
Perform semantic recognition on microservice code files to identify object code segments characterizing inter-service call requests, extract target parameters, and determine inter-service dependencies using a code segment determination module, parameter extraction module, and dependency determination module.
Ensures accurate and efficient determination of inter-service dependencies, enhancing the completeness and integrity of access rights management, thereby improving the security of cloud-native systems.
Smart Images

Figure 2024536709000001_ABST
Abstract
Description
[Technical field]
[0001] [CROSS REFERENCE TO RELATED APPLICATIONS] This application claims priority to Chinese Patent Application No. 202111005086.3 filed on August 30, 2021, and incorporates by reference the entire contents of said Chinese patent application.
[0002] [Technical field] The present application relates to communication technologies, and in particular to a method and apparatus for determining inter-service dependencies, an electronic device, and a computer-readable storage medium. [Background technology]
[0003] To solve the pain points of monolithic applications, microservices have already become an important definition of cloud-native systems, and their scale is also exploding. With the microservice architecture and the expansion of the application scale, security issues also arise. For example, a cloud-native system has three services, A, B, and C, and A depends on B and C for its business, and B depends on C for its business. The access rights corresponding to the three services should be set as follows: A cannot be accessed from any service, B can only be accessed from A, and C can be accessed from A and B.
[0004] In the related art, dependencies between microservices are usually determined by obtaining microservice code files of multiple microservices, recognizing initialization information for each microservice among the multiple microservices from the microservice code files, and extracting dependencies of a target service from the initialization information. The initialization information may include dependent packages executed by the service and microservices related to the service initialization. However, the completeness of the ultimately obtained dependencies between services is not high. Summary of the Invention
[0005] According to a first aspect, an embodiment of the present application comprises: performing semantic recognition on the microservices code files to determine object code segments that are comprised of code statements that characterize service-to-service invocation requests; extracting target parameters from the code statements that characterize the service-to-service invocation request; determining inter-service dependencies based on said target parameters.
[0006] According to a second aspect, an embodiment of the present application comprises: a code segment determination module configured to perform semantic recognition on the microservice code files to determine object code segments comprising code statements that characterize inter-service invocation requests; a parameter extraction module arranged to extract target parameters from the code statements characterizing the service-to-service invocation request; and a dependency determination module arranged to determine inter-service dependencies based on said target parameters.
[0007] According to a third aspect, an embodiment of the present application comprises: one or more processors; a storage device storing one or more computer programs, the one or more computer programs being configured to, when executed by the one or more processors, cause the one or more processors to implement the method for determining inter-service dependencies according to the first aspect; and one or more I / O interfaces connected between the processor and the memory, the I / O interfaces being arranged to provide information interaction between the processor and the memory.
[0008] According to a fourth aspect, an embodiment of the present application provides a computer readable storage medium having a computer program stored thereon, the computer program being operable, when executed by a processor, to implement the method for determining inter-service dependencies as set forth in the first aspect. [Brief description of the drawings]
[0009] [Figure 1] FIG. 1 is a flowchart illustrating a method for determining inter-service dependencies provided by an embodiment of the present application. [Diagram 2] FIG. 2 is a flowchart illustrating a method for determining inter-service dependencies provided by an embodiment of the present application. [Diagram 3] FIG. 3 is a flowchart illustrating a method for determining inter-service dependencies provided by an embodiment of the present application. [Figure 4] FIG. 4 is a diagram showing the configuration of a device for determining inter-service dependency relationships provided by the embodiment of the present application. [Diagram 5] FIG. 5 is a diagram showing the configuration of an electronic device provided according to an embodiment of the present application. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0010] In order to make the technical solution of the present application more understandable to those skilled in the art, the server provided by the present application is described in detail below in combination with drawings.
[0011] Hereinafter, exemplary embodiments will be described in detail with reference to the drawings, but the exemplary embodiments may be embodied in different forms, and the present disclosure should not be construed as being limited to the embodiments described herein. Rather, the present embodiments are provided for the purpose of making the present application thorough and complete, and allowing those skilled in the art to fully understand the scope of the present application.
[0012] As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items.
[0013] The terms used in this specification are merely for the purpose of describing particular embodiments and are not intended to limit the present application. As used in this specification, the singular forms "a," "an," and "the" are also intended to include the plural, unless otherwise clear from the context. It will be further understood that the terms "comprising" and / or "comprising" used in this specification specify the presence of certain features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or possible addition of one or more other features, wholes, steps, operations, elements, components, and / or groups thereof.
[0014] The embodiments described herein can be described with reference to plan views and / or cross-sectional views with the aid of idealized schematic diagrams of the present application. Thus, the examples may be changed based on manufacturing techniques and / or tolerances. Thus, the embodiments are not limited to those illustrated in the drawings, but include modifications of configurations formed based on manufacturing processes. Thus, the zones illustrated in the drawings have exemplary attributes, and the shapes of the zones shown in the drawings are illustrative but not limiting of the specific shapes of the zones of the elements.
[0015] All terms used herein (including technical and scientific terms) shall have the same meaning as commonly understood by those skilled in the art unless otherwise specified. It will be further understood that those terms defined in the common dictionary shall have a meaning consistent with the meaning in the context of the relevant technical proposal and this application, and shall not be interpreted as having an ideal or overly formal meaning unless expressly defined herein.
[0016] 1 is a flowchart of a method for determining inter-service dependency provided by an embodiment of the present application, and the execution body of the method is an apparatus for determining inter-service dependency provided by an embodiment of the present application, which can be integrated into a terminal device (e.g., a mobile terminal, a tablet, or a desktop computer) or a server. As shown in FIG. 1, the method for determining inter-service dependency includes the following steps S101 to S103.
[0017] Step S101: Perform semantic recognition on the microservice code file to determine object code segments that are composed of code statements that characterize inter-service invocation requests.
[0018] In some embodiments, the microservice code files can be obtained in a non-intrusive, non-message intercepting manner when the source code and initialization files are output in the project, and the inter-service dependencies can be fully obtained by the microservice code files. The code files of the microservice application can be in various formats, such as source code, byte code, binary code, etc. The format of the microservice code files in this embodiment is related to the execution process of the programming language adopted in the microservice application. Different programming languages have code files with inconsistent formats, and accordingly, different programming languages have different code file formats that are most suitable for semantic awareness analysis.
[0019] For example, Table 1 below shows which code file formats in different programming languages are most suitable for semantic analysis.
[0020] [Table 1]
[0021] For example, for the Java language, there are currently many mature static analysis tools that operate at the bytecode level, and to facilitate analysis, the bytecode file can be used as the code file in this embodiment. For example, for the Go language, source code and binary code can be used as the code file in this embodiment. In addition to source code, there are also external files (e.g., .proto files and service deployment files) that contain important information related to service-to-service invocation requests, so they can also be analyzed and processed as code files.
[0022] Since the amount of code corresponding to a microservice application is huge, scanning and analyzing all of the corresponding code would take a lot of time and resources. Therefore, in this embodiment, in order to reduce the search scope and optimize the analysis, code statements useful for determining inter-service dependencies can be recognized from the microservice code file, i.e., these code statements can characterize inter-service call requests, and since the calls between services in one microservice application are finite, i.e., small in number, the code statements characterizing the inter-service call requests are also finite, and further, the inter-service dependencies can be quickly and accurately determined by these small code statements.
[0023] Step S102: Extract target parameters characterizing the inter-service invocation request from the code statements.
[0024] A code statement is a code expression that characterizes a service invocation request, and the code expression includes target parameters that characterize the service invocation relationship. Different types of service invocation requests have different corresponding target parameters. For example, the target parameters corresponding to different service invocation requests are shown in Table 2 below.
[0025] [Table 2]
[0026] Step S103: Determine inter-service dependencies based on the target parameters. The target parameters include the call relationships between services. For example, the target parameter Path of an HTTP call and a gRPC call is a call path that characterizes the call relationship between services, so that the inter-service dependency can be determined based on the target parameter Path. For example, the target parameter Port of a TCP call is a call port that characterizes the call relationship between services, so that the inter-service dependency can be determined based on the target parameter Port.
[0027] Consider the following object code segment: 1 reviews = { 2 "name" : "http: / / reviews:9080", 3 "endpoint" : "reviews" 4} 5 @app.route(' / api / v1 / products / <product_id> / reviews') 6 url = reviews['name'] + " / " + reviews['endpoint'] + " / " + str(product_id) 7 res = requests.get(url, headers=headers, timeout=3.0).
[0028] The following target parameters can be extracted based on the above object code segments:
[0029] { "type": "HTTP", "url": "http: / / reviews:9080 / reviews / *", "path": " / reviews / *", "method": "GET" }.
[0030] Based on the target parameter, the path of the service of the call invocation can be determined to be http: / / reviews:9080 / reviews / *, and the service of the call is further determined based on the service path.
[0031] When there are many inter-service dependencies to be determined, a unified extraction may be performed based on the determined multiple object code segments to generate a manifest file (e.g., a JSON manifest file) describing the inter-service dependencies. To improve processing efficiency, each object code segment may be scanned by taint propagation, and target parameters may be determined based on the scanning results.
[0032] In this embodiment, on the one hand, when determining inter-service dependencies, a microservice code file is used, and the calling relationships between all services are contained in the microservice code file, so that the completeness of the inter-service dependencies can be ensured based on the microservice code file. On the other hand, the object code segments that characterize the inter-service calling requests can be determined by performing semantic recognition on the microservice code file, so that the valid code segments can be accurately identified, the search space is reduced, the analysis is optimized, and the processing efficiency is further improved.
[0033] In some embodiments, step S101 includes step A and step B, as shown in FIG.
[0034] Step A: Recognize network call statements in microservice code files to initiate service-to-service invocation requests by adopting a semantic model.
[0035] When a service issues an inter-service call request, there is generally a corresponding code statement in the microservice code file, which is a network call statement. In this embodiment, a pre-created semantic model is adopted to perform semantic recognition on the microservice code file to determine the network call statement that issues the inter-service call request. The semantic model can be created based on the inter-service communication mode within the microservice application, as the creation process is specifically described in the following embodiment.
[0036] The process of determining the network invocation statement is described below with an example. Below is a part of source code including the code statements import requests and res=requests.get(url, headers=headers, timeout=3.0). By adopting the semantic model, it can be recognized that the above code statement is used to make an inter-service invocation request, and the network invocation statement is further determined as res=requests.get(url, headers=headers,timeout=3.0).
[0037] An example of source code is shown below. 1. Import requests 2 from flask import request, session … 3 reviews = { 4 "name" : "http: / / reviews:9080", 5. "endpoint" : "reviews" 6} … 7 @app.route(' / api / v1 / products / <product_id> / reviews') 8 def reviewsRoute(product_id): 9 headers = getForwardHeaders(request) 10 user = session.get('user', ") 11 status, reviews = getProductReviews(product_id, headers) … 12 def getProductReviews(product_id, headers): 13 try: 14 url = reviews['name'] + " / " + reviews['endpoint'] + " / " + str(product_id) 15 res = requests.get(url, headers=headers, timeout=3.0).
[0038] Step B: A code statement characterizing an inter-service invocation request is obtained based on the network invocation statement, and an object code segment is constructed from the code statement.
[0039] In some embodiments, after the network call statement is determined, the called code statement can be determined based on the network call statement, and the code statement characterizing the service-to-service call request is obtained based on the called code statement. Taking the above source code as an example, in the network call statement, res=requests.get(url,headers=headers,timeout=3.0), the parameters url and headers are included, and the corresponding call statement url=requests['name'] + " / " + reviews['endpoint'] + " / " + str(product_id) is determined based on the parameter url, and the corresponding call statement headers=getForwardHeaders(request) is determined based on the parameter headers. The parameter in the call statement headers=getForwardHeaders(request) is the input parameter request, so the call statement lookup process is terminated. The parameter reviews in url=reviews['name'] + " / " + reviews['endpoint'] + " / " + str(product_id) is a method parameter, so the corresponding call statement is further determined as follows:
[0040] 3 reviews = { 4 "name" : "http: / / reviews:9080", 5. "endpoint" : "reviews" 6}.
[0041] Since the parameters name and endpoint in the method parameter reviews are both constants, the lookup process for the invocation statement is completed. From the above example, the code statements characterizing the inter-service invocation request can be determined based on the above lookup process as follows:
[0042] 1 reviews = { 2 "name" : "http: / / reviews:9080", 3 "endpoint" : "reviews" 4} 5 @app.route(' / api / v1 / products / <product_id> / reviews') 6 url = reviews['name'] + " / " + reviews['endpoint'] + " / " + str(product_id) 7 res = requests.get(url, headers=headers, timeout=3.0).
[0043] In some embodiments, to further improve the recognition efficiency, step S101 further includes step S104.
[0044] Step S104: In the microservice code file, a first parameter that characterizes the invocation type of the inter-service invocation request and a second parameter that should be focused on to obtain the code statement are recognized by adopting a semantic model.
[0045] In some embodiments, after a semantic model is created, the semantic model is extended based on semantic information, which describes a type of a service-to-service invocation request and subsequently instructs to obtain a key parameter (i.e., a second parameter) in a code statement that is of interest. For example, the semantic model may be a method class, and based on the above source code example, the following method class can be set as the semantic model, in which the semantic model includes a first parameter (i.e., the type of the service-to-service invocation request is HTTP), and second parameters Method and url:
[0046] An example of a semantic model (i.e., a method class) is as follows: Library: requests Method: get(url, params=None, **kwargs) Semantics: HTTP-GET Key parameters: url (Semantics: HTTP-URL).
[0047] Accordingly, step B may specifically include obtaining a code statement characterizing the inter-service invocation request based on the network invocation statement and the second parameter.
[0048] Based on the source code and semantic model of the above example, it can be considered that the parameter url in the network call statement res=requests.get(url, headers=headers, timeout=3.0) is a second parameter, and the corresponding call statement can be further determined based only on the parameter url. Compared with the implementation process of step B above, it is not necessary to look up the call process of the parameter headers again, thereby reducing the call process of unnecessary parameters and further improving the processing efficiency.
[0049] In some embodiments, in order to further improve the efficiency and speed of recognizing the object code segment, the code statements constituting the object code segment can be determined using a taint propagation method, and as shown in FIG. 3, step B includes steps B1 to B3.
[0050] Step B1: Starting from a network call statement, the second parameter included in the network call statement is set as a taint.
[0051] Based on the source code and semantic model of the above example, the network call statement in the above example can be determined as res=requests.get(url,headers= headers,timeout=3.0), and the corresponding second parameter can be determined as url. Starting from the network call statement res=requests.get(url,headers= headers,timeout=3.0), taint propagation is performed with the second parameter url as the taint.
[0052] Step B2: Perform taint propagation according to a control flow based on the second parameter, recognize a third parameter related to the second parameter, and take the third parameter as a taint. Continue to execute the taint propagation process based on the third parameter until a preset condition is reached.
[0053] Whether the taint propagation is performed along the backward or forward direction of the control flow is determined by whether the network call statement is a calling statement or a called statement. If the network call statement is a calling statement, the taint propagation is performed along the backward direction of the control flow, and if the network call statement is a called statement, the taint propagation is performed along the forward direction of the control flow. Based on the source code of the above example, the taint propagation is performed along the backward direction of the control flow. The taint is passed from the parameter url (i.e., the second parameter) in the network call statement to the method parameter reviews (i.e., the third parameter) in the statement url = reviews['name'] + " / " + reviews['endpoint'] + " / " + str(product_id) along the backward direction of the control flow, and is further passed to the related parameters name and endpoint in the method parameter reviews, terminating the taint propagation process. The preset conditions for terminating the taint propagation are that the parameter is assigned with a constant or is from an input parameter.
[0054] In some embodiments, the taint propagation process varies depending on the code statement, and there are three main cases:
[0055] In the first case, the taint propagation process includes, based on an assignment statement in the microservice code file, passing a taint from a tainted parameter in the left-hand side expression of the assignment statement to a parameter in the right-hand side expression.
[0056] In the second case, the taint propagation process includes passing the taint from the tainted method parameter to a parameter in the call statement that invokes a method that corresponds to the method parameter based on an invocation statement in the microservice code file.
[0057] In the third case, based on a return value in the microservice code file, if the return value is tainted, the taint propagation process includes a step of performing taint propagation within the method body of the corresponding method, starting from the return statement of the corresponding method of the return value.
[0058] Step B3: Extract code expressions of tainted parameters in the taint propagation process as code statements characterizing inter-service invocation requests.
[0059] Based on the above example source code and the semantic model, the final object code segments can be determined as follows:
[0060] 1 reviews = { 2 "name" : "http: / / reviews:9080", 3 "endpoint" : "reviews" 4} 5 @app.route(' / api / v1 / products / <product_id> / reviews') 6 url = reviews['name'] + " / " + reviews['endpoint'] + " / " + str(product_id) 7 res = requests.get(url, headers=headers, timeout=3.0).
[0061] In some embodiments, the method for determining inter-service dependencies further includes a process for creating a semantic model, the process including obtaining a service-to-service invocation library based on an inter-service communication method within the microservice application, and creating a semantic model based on the service-to-service invocation library.
[0062] Because the inter-service communication methods within the same microservice application are relatively uniform, the number of inter-service call libraries introduced is also finite. Therefore, the workload can be reduced by modeling targeted semantic models based on these inter-service call libraries. For example, the application program interface called by a gRPC request is defined in the corresponding .proto file, and the corresponding semantic model can be obtained by automating modeling through the analysis of the file to help recognize which statement actually issues a gRPC request.
[0063] 4 is a diagram showing the configuration of an apparatus for determining inter-service dependency provided by an embodiment of the present application, which can be implemented in software or hardware and can be integrated into a terminal device or a server. As shown in FIG. 4, the apparatus for determining inter-service dependency includes a code segment determination module 201, a parameter extraction module 202, and a dependency determination module 203.
[0064] The code segment determination module 201 is arranged to perform semantic recognition on the microservice code files and determine object code segments that are comprised of code statements that characterize inter-service invocation requests.
[0065] The parameter extraction module 202 is arranged to extract target parameters from the code statements that characterize the service-to-service invocation request.
[0066] The dependency determination module 203 is configured to determine inter-service dependencies based on the target parameters.
[0067] In some embodiments, the code segment determination module 201 includes a network call statement recognition unit 2011 and a code segment determination unit 2012 .
[0068] The network invocation statement recognition unit 2011 is arranged to recognize a network invocation statement for issuing an inter-service invocation request in a microservice code file by employing a semantic model.
[0069] The code segment determining unit 2012 obtains code statements characterizing the inter-service invocation request based on the network invocation statement, and arranges the code statements to constitute an object code segment.
[0070] In some embodiments, the code segment determination module 201 further comprises a parameter recognition unit 2013 .
[0071] The parameter recognition unit 2013 is configured to recognize, in the microservice code file, a first parameter characterizing an invocation type of the inter-service invocation request and a second parameter to be focused on to obtain a code statement by employing a semantic model.
[0072] The code segment determining unit 2012 is specifically configured to obtain a code statement characterizing an inter-service invocation request based on the network invocation statement and the second parameter.
[0073] In some embodiments, the code segment determination unit 2012 is configured to: start from a network call statement, take a second parameter included in the network call statement as a taint, perform taint propagation according to a control flow based on the second parameter, recognize a third parameter related to the second parameter, and also take the third parameter as a taint, continue to execute the taint propagation process based on the third parameter until a preset condition is reached, and extract a code expression of the tainted parameter in the taint propagation process as a code statement characterizing the service-to-service call request.
[0074] In some embodiments, the code segment determination unit 2012 is specifically configured to pass a taint from a tainted parameter in the left-hand side expression of the assignment statement to a parameter in the right-hand side expression based on an assignment statement in the microservice code file.
[0075] In some embodiments, the code segment determination unit 2012 is specifically configured to pass a taint from a tainted method parameter to a parameter in a call statement that invokes a method that corresponds to the method parameter based on a call statement in the microservice code file.
[0076] In some embodiments, the code segment determination unit 2012 is specifically configured to, based on a return value in a microservice code file, if the return value is tainted, perform taint propagation within the method body of the corresponding method, starting from the return statement of the corresponding method of the return value.
[0077] In some embodiments, the apparatus for determining inter-service dependencies further comprises a semantic model creation module 204.
[0078] The semantic model creation module 204 is configured to obtain an inter-service invocation library based on an inter-service communication mode within the microservice application, and create a semantic model based on the inter-service invocation library.
[0079] The specific configuration and operation principle of each of the above modules can be referred to the corresponding description in the method embodiments, so they will not be repeated here.
[0080] An embodiment of the present application provides an electronic device, which, referring to FIG. One or more processors 301; a memory 302 storing one or more computer programs, the one or more computer programs being configured to, when executed by the one or more processors 301, cause the one or more processors 301 to implement the method for determining inter-service dependencies; and one or more I / O interfaces 303 connected between the processor 301 and the memory 302, arranged to realize information interaction between the processor 301 and the memory 302.
[0081] Here, the processor 301 is a device having a data processing capability, including, but not limited to, a central processing unit (CPU). The memory 302 is a device having a data storage capability, including, but not limited to, a random access memory (RAM, more specifically, SDRAM, DDR, etc.), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), and a flash memory (FLASH). The I / O interface (read / write interface) 303 is connected between the processor 301 and the memory 302, and realizes information interaction between the processor 301 and the memory 302, including, but not limited to, a data bus (Bus).
[0082] In some embodiments, the processor 301, memory 302 and I / O interface 303 are coupled to each other and to other components of the computing device via a bus.
[0083] An embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, the computer program implementing the above method for determining inter-service dependencies when executed by a processor.
[0084] Those skilled in the art will understand that all or some of the functional modules / units of the steps, systems, and devices in the above application may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware embodiments, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components. For example, one physical component may have multiple functions, and one function or step may be performed by the cooperation of several physical components. Some or all of the physical components may be implemented as software executed by a processor such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or even as an integrated circuit such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). As is well known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information, such as computer readable instructions, data structures, program modules, or other data. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic memory, or any other medium that can be used to store the desired information and that can be accessed by a computer. Additionally, those skilled in the art will know that communication media typically include computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0085] Although examples of embodiments have been disclosed herein and specific terms have been used, they are used and should be interpreted as being generally descriptive only and not limiting. In some instances, it will be apparent to those skilled in the art that features, characteristics and / or elements described in combination with a particular embodiment may be used alone or in combination with features, characteristics and / or elements described in other examples, unless expressly indicated otherwise. Thus, those skilled in the art will appreciate that various changes in form and detail may be made without departing from the scope of the present application as defined by the appended claims.
Claims
1. performing semantic recognition on the microservices code files to determine object code segments that are comprised of code statements that characterize service-to-service invocation requests; extracting target parameters from the code statements that characterize the service-to-service invocation request; determining inter-service dependencies based on said target parameters.
2. The step of performing semantic recognition on the microservice code file to determine object code segments includes: Recognizing a network invocation statement in the microservice code file for initiating the service-to-service invocation request by adopting a semantic model; and obtaining the code statements characterizing the service-to-service invocation request based on the network invocation statement, the code statements constituting the object code segment.
3. The method further includes employing a semantic model to recognize a first parameter that characterizes an invocation type of the inter-service invocation request and a second parameter that should be focused on to obtain the code statement in the microservice code file; The step of obtaining the code statements characterizing the service-to-service invocation request based on the network invocation statement comprises: The method of claim 2 , further comprising obtaining the code statement characterizing the service-to-service invocation request based on the network invocation statement and the second parameter.
4. obtaining the code statement characterizing the service-to-service invocation request based on the network invocation statement and the second parameter, Starting from the network call statement, tainting the second parameter included in the network call statement; performing taint propagation according to a control flow based on the second parameter, recognizing a third parameter related to the second parameter, and defining the third parameter as a taint; and continuing to perform the taint propagation process based on the third parameter until a preset condition is reached; and extracting code expressions of tainted parameters during a taint propagation process as code statements characterizing the inter-service invocation request.
5. The taint propagation process includes:
5. The method of claim 4, comprising: based on an assignment statement in the microservice code file, passing a taint from a tainted parameter in a left-hand side expression of the assignment statement to a parameter in a right-hand side expression of the assignment statement.
6. The taint propagation process includes:
5. The method of claim 4, further comprising passing a taint from a tainted method parameter to a parameter in a call statement that invokes a method that corresponds to the method parameter based on a call statement in the microservice code file.
7. The taint propagation process includes: The method of claim 4 , further comprising: if the return value is tainted based on a return value in the microservice code file, performing taint propagation within a method body of the corresponding method, starting from a return statement of the corresponding method of the return value.
8. Obtaining an inter-service invocation library based on an inter-service communication method within a microservice application; The method according to any one of claims 1 to 7, further comprising the step of: creating a semantic model based on a service-to-service invocation library.
9. a code segment determination module configured to perform semantic recognition on the microservice code files to determine object code segments comprising code statements that characterize inter-service invocation requests; a parameter extraction module arranged to extract target parameters from the code statements characterizing the service-to-service invocation request; and a dependency determination module arranged to determine inter-service dependencies based on said target parameters.
10. At least one processor; a storage device having stored therein at least one computer program, the at least one computer program being configured to cause the at least one processor to implement the method for determining inter-service dependencies according to any one of claims 1 to 8 when executed by the at least one processor; and at least one I / O interface connected between said processor and said memory, said I / O interface being arranged to effect information interaction between said processor and said memory.
11. A computer-readable storage medium having a computer program stored thereon, the computer program being capable of implementing the method for determining inter-service dependencies according to any one of claims 1 to 8 when executed by a processor.
Citation Information
Patent Citations
Compiler, compiling device, and compiling method
JP2016177537A
Node and information processing system processing nodes
JP2017219972A
