WO2023029934A1 - 微服务逻辑网络及其构建方法、装置、设备、可读介质 - Google Patents

微服务逻辑网络及其构建方法、装置、设备、可读介质 Download PDF

Info

Publication number
WO2023029934A1
WO2023029934A1 PCT/CN2022/111712 CN2022111712W WO2023029934A1 WO 2023029934 A1 WO2023029934 A1 WO 2023029934A1 CN 2022111712 W CN2022111712 W CN 2022111712W WO 2023029934 A1 WO2023029934 A1 WO 2023029934A1
Authority
WO
WIPO (PCT)
Prior art keywords
nodes
microservice
network
relationship
service
Prior art date
Application number
PCT/CN2022/111712
Other languages
English (en)
French (fr)
Inventor
倪进权
李星
蒲舰舸
徐代刚
李小进
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2023029934A1 publication Critical patent/WO2023029934A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/50Network service management, e.g. ensuring proper service fulfilment according to agreements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/133Protocols for remote procedure calls [RPC]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/51Discovery or management thereof, e.g. service location protocol [SLP] or web services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/40Network security protocols

Definitions

  • This application but not limited to, involves computer technology.
  • microservice architecture is an important cloud-native technology, and the industry is increasingly adopting the microservice architecture, which directly leads to the explosive growth of the microservice architecture and brings management challenges, such as the maintenance efficiency of microservices. Therefore, there is a need to improve the management of the logical network of the microservice architecture.
  • the present application provides a method for constructing a microservice logic network, based on the calling relationship between different nodes in the microservice architecture and the affiliation relationship between the nodes, the microservice logic network of the microservice architecture is established, Moreover, the microservice logic network includes invocation logic networks of nodes at the same level and invocation logic networks of nodes at different levels.
  • the present application provides a microservice logic network construction device, including: a network establishment module configured to establish the The microservice logic network of the microservice architecture, furthermore, the microservice logic network includes invocation logic networks of nodes at the same level and invocation logic networks of nodes at different levels.
  • the present application provides a microservice logic network, which includes multiple nodes, and the nodes include nodes of the same level and nodes of different levels in the microservice architecture; the nodes are connected by a microservice logic network,
  • the microservice logic network is established according to the invocation relationship between different nodes in the microservice architecture and the affiliation relationship between the nodes, and the microservice logic network includes the invocation logic network of nodes at the same level and different The nodes of the hierarchy call the logical network.
  • the present application provides an electronic device, including: one or more processors; a storage device, on which one or more programs are stored, when the one or more programs are When the processor is executed, the one or more processors implement any of the microservice logic network construction methods described herein; one or more I/O interfaces, connected between the processor and the memory, are configured to implement The processor interacts with information of the memory.
  • the present application provides a storage medium on which a computer program is stored, and when the computer program is executed by a processor, any method for constructing a microservice logic network described herein is implemented.
  • FIG. 1 is a schematic structural diagram of a microservice architecture
  • Fig. 2 is a flowchart of a method for constructing a microservice logic network provided by the present application
  • Fig. 3 is a flow chart of the microservice logical network construction method provided by the present application.
  • FIG. 4 is a schematic diagram of a microservice logic network provided by the present application.
  • FIG. 5 is a schematic structural diagram of a microservice logical network construction device provided by the present application.
  • FIG. 6 is a schematic structural diagram of a network establishment module provided by the present application.
  • FIG. 7 is a schematic structural diagram of an electronic device provided by the present application.
  • Embodiments herein may be described with reference to plan views and/or cross-sectional views by way of idealized schematic representations of the application. Accordingly, the example illustrations may be modified according to manufacturing techniques and/or tolerances. Therefore, the embodiments are not limited to those shown in the drawings but include modifications of configurations formed based on manufacturing processes. Accordingly, the regions illustrated in the figures have schematic properties, and the shapes of the regions shown in the figures illustrate the specific shapes of the regions of the elements, but are not intended to be limiting.
  • Microservice has the characteristics of low coupling and high cohesion, which can realize the independent development and deployment of each function and improve the flexibility of application architecture. Therefore, microservices are a widely used technology in cloud native.
  • a microservice architecture includes multiple nodes connected by a service network.
  • a node can be a service or a service instance.
  • Each service can deploy at least one service instance, that is, the microservice architecture divides nodes into two levels, the main level is the service, and the secondary level is the service instance.
  • Each service can implement a function, and each service instance can be a version of the service.
  • FIG. 1 is a schematic structural diagram of a microservice architecture.
  • the microservice architecture includes a first service 11, a second service 12, a third service 13, and a fourth service 14, wherein the first service 11 deploys three service instances, namely service instance A-V1, service Instance A-V2 and service instance A-V3; the second service 12 deploys a service instance, namely service instance B-V1; the third service deploys two service instances, namely service instance C-V1 and service instance C-V2; Four services 14 deploy a service instance, that is, service instance D-V1.
  • the service instance A-V1 of the first service 11 calls the second service 12
  • the service instance A-V2 of the first service 11 calls the second service 12, the third service 13 and The fourth service 14, the service instance A-V3 of the first service 11 calls the second service 12 and the fourth service 14;
  • the service instance B-V1 of the second service 12 calls the third service 13, the service instance C of the third service 13 - V2 invokes the fourth service 14 .
  • the present application provides a method for constructing a microservice logical network.
  • the microservice logical network constructed by the microservice logical network construction method can reduce redundant access control policies and optimize the implementation efficiency of access control policies during runtime.
  • FIG. 2 is a flow chart of a method for constructing a microservice logical network provided by the present application.
  • the method for constructing a microservice logical network may include: step S201, based on the invocation relationship between different nodes in the microservice architecture and the affiliation relationship between nodes, establishing a microservice logical network of the microservice architecture, Moreover, the microservice logic network includes call logic networks of nodes at the same level and call logic networks of nodes at different levels.
  • the call relationship refers to the logical relationship in which a node calls other nodes through the service network.
  • the affiliation relationship refers to the affiliation relationship between nodes at different levels in the microservice architecture, that is, the affiliation relationship between the master node and the slave node.
  • the master node is a service
  • the slave node is a service instance.
  • the microservice logic network is a network that describes the call relationship between nodes in the microservice architecture. Through the microservice logic network, the call logic between nodes can be clearly understood.
  • the microservice architecture includes nodes at multiple levels. Nodes at the same level may have calling relationships, and nodes at different levels may also have calling relationships.
  • the microservice architecture includes two levels of nodes: service and service instance, and the service is the master node, and the service instance is the slave node.
  • the call relationship between the master nodes includes: there is a call relationship between the first service 11 and the second service 12, there is a call relationship between the first service 11 and the third service 13, and there is a call relationship between the second service 12 and the second service 12. There is a calling relationship among the third services 13 .
  • the calling relationship between the master node and the slave node includes: there is a calling relationship between the service instance A-V1 of the first service 11 and the second service 12, the service instance A-V2 of the first service 11 and the second service 12, the second service 12 Both the third service 13 and the fourth service 14 have a call relationship, the service instance A-V3 of the first service 11 has a call relationship with the second service 12 and the fourth service 14, and the service instance B-V1 of the second service 12 has a call relationship with the second service 12.
  • the third service 13 has an invocation relationship
  • the service instance C-V2 of the third service 13 has an invocation relationship with the fourth service 14 .
  • the affiliation relationship between the master node and the slave node includes: there is an affiliation relationship between service instance A-V1, service instance A-V2 and service instance A-V3 and the first service 11, service instance B-V1 and the second service 12 There is an affiliation relationship between the service instance C-V1 and the service instance C-V2 and the third service 13 , and there is an affiliation relationship between the service instance D-V1 and the fourth service 14 .
  • the microservice logic network construction method provided by this application is based on the call relationship between different nodes in the microservice architecture and the affiliation relationship between nodes to establish the logic network of the microservice architecture. Therefore, the call logic network includes nodes of the same level.
  • the invocation logic network of different levels of nodes also includes the invocation logic network of nodes at different levels, that is, there are invocation logics of different granularities in the microservice logic network.
  • the invocation logic network of different granularities can be maintained as needed , it is no longer necessary to separately maintain the call relationship between the nodes shared by each version in the microservice; moreover, it can reduce redundant access control policies, optimize the efficiency of runtime access control policy implementation, and reduce unnecessary access Control policy installation to realize on-demand access control policy update and distribution.
  • FIG. 3 is a flow chart of a method for constructing a microservice logic network provided by the present application. As shown in FIG. 1 and FIG. 3 , the method for constructing a microservice logical network may include steps S301 to S304.
  • step S301 the nodes in the microservice architecture, the affiliation relationship between the nodes, and the calling relationship between the nodes are acquired.
  • step S302 a call logic network between nodes is constructed based on call relationships between nodes.
  • the calling logical network is a logical network between nodes having a calling relationship.
  • the logical network between the first service 11 and the second service 12 is an invocation logical network.
  • step S303 an affiliation logical network between nodes is constructed based on the affiliation relationship between nodes.
  • the subordinate logical network is a logical network between nodes with subordinate relationship.
  • the logical network between the second service 12 and the service instance B-V1 is a subordinate logical network.
  • step S302 and step S303 is not in particular order.
  • step S304 the microservice logical network of the microservice architecture is obtained based on the calling logical network between nodes and the dependent logical network between nodes.
  • step S304 based on the calling logical network and the subordinate logical network, if all slave nodes under the same master node and other nodes in the microservice architecture have calling logical networks, they will be subordinate to the same master node All the slave nodes below are merged into the master node to obtain the microservice logic network of the microservice architecture.
  • FIG. 4 is a schematic diagram of a microservice logical network provided by the present application.
  • the dotted lines between nodes indicate the affiliation relationship
  • the solid lines between the nodes indicate the calling relationship.
  • the service instance A-V1, service instance A-V2 and service instance A-V3 of the first service 11 all have a call relationship with the second service 12, therefore, the service instance A-V1.
  • the invocation relationship between service instance A-V2 and service instance A-V3 and the second service 12 is merged into the invocation relationship r1 between the first service 11 and the second service 12, and the invocation relationship is elevated to the main level (service level) .
  • the version of the first service 11 needs to be updated, instead of updating the service instance A-V1, service instance A-V2 and service instance A-V3 separately as in the prior art, the first service 11 is directly updated That is, the updating efficiency is improved.
  • the service instances that meet the conditions are merged, and the level changes, but the level of the service instances that do not meet the conditions cannot be changed. Since the service instance A-V2 can invoke the service instance C-V1 and the service instance C-V2 in the third service 13, the invocation relationship r3 between the service instance A-V2 and the third service 13 is a service level. Since the service instance A-V2 can call the service instance D-V1 in the fourth service 14, and the fourth service 14 has only one service instance, the invocation relationship r2 between the service instance A-V2 and the fourth service 14 is service tier. Since the service instance A-V3 can invoke the fourth service 14, the invocation relationship r4 between the service instance A-V3 and the fourth service 14 is a service level.
  • the invocation relationship r5 between the service instance B-V1 of the second service 12 and the third service 13 still maintains the service level
  • the invocation relationship r6 between the service instance C-V2 of the third service 13 and the fourth service 14 still maintains the service level hierarchy.
  • microservice logical network of the microservice architecture provided by this embodiment, there are logical networks at the service level and service instance level among the nodes in the microservice architecture, which optimizes the efficiency of access control policy implementation.
  • step S302 constructing the invocation logic network between nodes based on the invocation relationship between nodes, may include, but not limited to the following steps: determine the node corresponding to the invocation relationship based on the invocation relationship; Create a request mapping between them to obtain a call logic network.
  • the call relationship between nodes involves two nodes, and the two nodes corresponding to the call relationship can be determined based on the call relationship, and request mapping is established between the nodes corresponding to the call relationship to obtain a call logic network.
  • a request mapping is established between the service instance A-V1 and the second service 12 to obtain an invocation logic network.
  • a request mapping is established between the service instance A-V1 and the second service 12 to obtain an invocation logic network.
  • a request mapping is established between the service instance A-V3 and the second service 12 and the fourth service 14 to obtain the invocation logic network.
  • a request mapping is established between the service instance B-V1 and the third service 13 to obtain an invocation logic network. If there is an invocation relationship between the service instance C-V2 and the fourth service 14, a request mapping is established between the service instance C-V2 and the fourth service 14 to obtain an invocation logic network.
  • step S303, constructing an affiliation logical network between nodes based on the affiliation relationship between nodes may include, but not limited to the following steps: determining the node corresponding to the affiliation relationship based on the affiliation relationship; Establish a subordinate mapping between them to obtain a subordinate logical network.
  • the affiliation relationship between nodes involves two nodes. Based on the affiliation relationship, the two nodes corresponding to the affiliation relationship can be determined, and the affiliation mapping is established between the nodes corresponding to the affiliation relationship to obtain the affiliation logical network.
  • an affiliation relationship between the first service 11 and the service instance A-V1 there is an affiliation relationship between the first service 11 and the service instance A-V1, and an affiliation mapping is established between the first service 11 and the service instance A-V1 to obtain an affiliation logical network.
  • a subordinate mapping is established between the service instance A-V2, the service instance A-V13 and the first service 11 to obtain a subordinate logical network.
  • an affiliation mapping is established between the second service 12 and the service instance B-V1 to obtain an affiliation logical network.
  • an affiliation mapping is established between the fourth service 14 and the service instance D-V1 to obtain an affiliation logical network.
  • step S304, obtaining the logical network of the microservice architecture based on the calling logical network between nodes and the subordinate logical network between nodes may include, but not limited to the following steps: based on the calling logical network between nodes And the slave logical network, the slave nodes with the same call logic network under the same master node are merged into the master node, and the master node is the common master node of the slave nodes, and the logical network of the microservice architecture is obtained.
  • the service instance A-V1, service instance A-V2 and service instance A-V3 of the first service 11 all have a call relationship with the second service 12, therefore, the service instance A-V1,
  • the invocation relationship between service instance A-V2 and service instance A-V3 and the second service 12 is merged into the invocation relationship r1 between the first service 11 and the second service 12, and the invocation relationship is elevated to the main level (service level) .
  • services are nodes with shared authority in the microservice architecture, for example, service instance A-V1, service instance A-V2, and service instance A-V3 are three different versions of services, that is, the three Service instances are only different in version, but have shared permissions.
  • Service instances are nodes with exclusive permissions in the microservice architecture. For example, service instance A-V1, service instance A-V2, and service instance A-V3 have similar common permissions, but due to different versions, each includes different exclusive authority. Service instance B-V1, service instance C-V1, and service instance D-V1 all have different exclusive rights due to their different functions. Although service instance C-V1 and service instance C-V2 have similar shared permissions, they have different exclusive permissions due to different versions.
  • both the shared authority and the exclusive authority refer to the version authority of the microservice.
  • step S304 after establishing the logical network of the microservice architecture based on the invocation relationship between different nodes in the microservice architecture and the affiliation relationship between nodes, may also include, but is not limited to, the following steps:
  • the microservice logical network of the service architecture generates the authority graph of the microservice architecture.
  • the permission graph is a graph (view) used to visualize the logical network of the microservice, and the user can intuitively understand the logical network of the microservice architecture through the permission graph.
  • the microservice logical network construction method provided by this application is based on the calling relationship between different nodes in the microservice architecture and the affiliation relationship between nodes to establish the logical network of the microservice architecture. Therefore, the calling logic network includes both the same level
  • the call logic network of nodes also includes the call logic network of nodes at different levels, that is, there are call logics of different granularities in the microservice logic network.
  • the call logic network of different granularities can be implemented as needed. Maintenance, it is no longer necessary to maintain the calling relationship between the nodes shared by each version in the microservice; moreover, it can reduce redundant access control strategies, optimize the efficiency of runtime access control strategy implementation, and reduce unnecessary Access control policy installation enables on-demand access control policy update and distribution.
  • the present application provides a device for constructing a microservice logical network.
  • the microservice logical network constructed by the device for constructing a microservice logical network can reduce redundant access control policies and optimize the implementation efficiency of access control policies during runtime.
  • FIG. 5 is a schematic structural diagram of an apparatus for constructing a microservice logic network provided by the present application.
  • the example of this application provides a microservice logic network construction device 500, including: a network establishment module 501 configured to be based on the invocation relationship between different nodes in the microservice architecture and the affiliation relationship between nodes, The microservice logic network of the microservice architecture is established, and the invocation logic network includes the invocation logic network of nodes at the same level and the invocation logic network of nodes at different levels.
  • the call relationship refers to the logical relationship in which a node calls other nodes through the service network.
  • the affiliation relationship refers to the affiliation relationship between nodes at different levels in the microservice architecture, that is, the affiliation relationship between the master node and the slave node.
  • the master node is a service
  • the slave node is a service instance.
  • the microservice logic network is a network that describes the call relationship between nodes in the microservice architecture. Through the microservice logic network, the call logic between nodes can be clearly understood.
  • FIG. 6 is a schematic structural diagram of a network establishment module provided by an example of the present application.
  • the network establishment module 600 includes: an acquisition unit 601 , an invoking logic network construction unit 602 , a slave logic network construction unit 603 , and a network acquisition unit 604 .
  • the acquiring unit 601 is configured to acquire the nodes in the microservice architecture, the affiliation relationship between the nodes, and the calling relationship between the nodes.
  • the microservice architecture includes service nodes and service instance nodes, the service nodes include the first service 11, the second service 12, the third service 13 and the fourth service 14, and the service instance nodes include service instances A-V1, Service instance A-V2, service instance A-V3, service instance B-V1, service instance C-V1, service instance C-V2, service instance D-V1.
  • the affiliation relationship between nodes includes: the affiliation relationship between service instance A-V1, service instance A-V2 and service instance A-V3 and the first service 11, the affiliation relationship between service instance B-V1 and the second service 12, The affiliation of service instance C-V1 and service instance C-V2 with the third service 13 , the affiliation of service instance D-V1 with the fourth service 14 .
  • the calling relationship between nodes includes: the calling relationship r1 between the service instance A-V1 and the second service 12, the calling relationship between the service instance A-V2 and the second service 12, the third service 13 and the fourth service 14, the service instance A - the calling relationship between V3 and the second service 12 and the fourth service 14, the calling relationship between the service instance B-V1 and the third service 13, and the calling relationship between the service instance C-V2 and the fourth service 14.
  • the invocation logic network construction unit 602 is configured to construct an invocation logic network between nodes based on an invocation relationship between nodes.
  • the calling logical network is a logical network between nodes having a calling relationship.
  • the logical network between the first service 11 and the second service 12 is an invocation logical network.
  • the logical network between the service instance A-V1 and the second service 12 is an invocation logical network
  • the logical network between the service instance A-V2 and the second service 12, the third service 13, and the fourth service 14 is an invocation logical network
  • the logical network between the service instance A-V3 and the second service 12 and the fourth service 14 is the calling logical network
  • the logical network between the service instance B-V1 and the third service 13 is the calling logical network
  • the logical network with the fourth service 14 is an invocation logical network.
  • the subordinate logical network construction unit 603 is configured to construct a subordinate logical network between nodes based on the subordinate relationship between the nodes.
  • the subordinate logical network is a logical network between nodes with subordinate relationship.
  • the logical network between service instance A-V1, service instance A-V2 and service instance A-V3 and the first service 11 is a subordinate logical network
  • the logical network between the second service 12 and service instance B-V1 is Slave logical network.
  • the logical network between the service instance C-V1 and the service instance C-V2 and the third service 13 is a subordinate logical network
  • the logical network between the service instance D-V1 and the fourth service 14 is a subordinate logical network.
  • the network obtaining unit 604 is configured to obtain the microservice logic network of the microservice architecture based on the call logic network between nodes and the subordinate logic network between nodes.
  • the nodes of different levels are merged to obtain the microservice logic network of the microservice architecture.
  • the invocation logic network construction unit 602 includes: a first node determination subunit configured to determine the node corresponding to the invocation relationship based on the invocation relationship; a first network acquisition subunit configured to determine the node corresponding to the invocation relationship Establish request mapping between nodes to obtain call logic network between nodes.
  • the call relationship between nodes involves two nodes. Based on the call relationship, the two nodes corresponding to the call relationship can be determined, and request mapping is established between the nodes corresponding to the call relationship to obtain the call logic between nodes. network.
  • the affiliation logic network construction unit 603 includes: a second node determination subunit configured to determine a node corresponding to the affiliation based on the affiliation; a second network acquisition subunit configured to determine the node corresponding to the affiliation Establish a slave request mapping between nodes to obtain a slave logical network between nodes.
  • the affiliation relationship between nodes involves two nodes. Based on the affiliation relationship, the two nodes corresponding to the affiliation relationship can be determined, and the affiliation request mapping is established between the nodes corresponding to the affiliation relationship to obtain the affiliation between nodes. logical network.
  • the requesting edge and the dependent edge are functional edges determined based on the logical relationship between nodes.
  • the nodes can be connected by using the functional edge corresponding to the logical relationship.
  • the network obtaining unit 604 is configured to: based on the calling logical network and the subordinate logical network, all slave nodes subordinate to the same master node and other nodes in the microservice architecture have calling logical networks Next, all the slave nodes under the same master node are merged into the master node to obtain the microservice logic network of the microservice architecture.
  • the service instance A-V1, service instance A-V2 and service instance A-V3 of the first service 11 all have a call relationship with the second service 12, therefore, the service instance A-V1,
  • the invocation relationship between service instance A-V2 and service instance A-V3 and the second service 12 is merged into the invocation relationship r1 between the first service 11 and the second service 12, and the invocation relationship is elevated to the main level (service level) .
  • services are nodes with shared authority in the microservice architecture, for example, service instance A-V1, service instance A-V2, and service instance A-V3 are three different versions of services, that is, the three Service instances are only different in version, but have shared permissions.
  • Service instances are nodes with exclusive permissions in the microservice architecture. For example, although service instance A-V1, service instance A-V2, and service instance A-V3 have similar permissions, they still have different exclusive permissions due to different versions. Have permission. Service instance B-V1, service instance C-V1, and service instance D-V1 all have different exclusive rights due to their different functions. Although service instance C-V1 and service instance C-V2 have similar permissions, they still have different exclusive permissions due to different versions.
  • the microservice logical network construction apparatus 500 further includes: a composition unit configured to generate a permission graph of the microservice architecture based on the logical network of the microservice architecture.
  • the permission graph is used to visualize the logical network graph of microservices, and users can intuitively understand the logical network of the microservice architecture through the permission graph.
  • the method for constructing a microservice logical network provided in the foregoing embodiments is applicable to the device for constructing a microservice logical network provided in this embodiment.
  • the microservice logical network construction device establishes a logical network of a microservice architecture based on the invocation relationship between different nodes in the microservice architecture and the affiliation relationship between nodes. Therefore, the invocation logic network includes both
  • the call logic network of nodes also includes the call logic network of nodes at different levels, that is, there are call logics of different granularities in the microservice logic network.
  • the call logic network of different granularities can be implemented as needed. Maintenance, it is no longer necessary to maintain the calling relationship between the nodes shared by each version in the microservice; moreover, it can reduce redundant access control strategies, optimize the efficiency of runtime access control strategy implementation, and reduce unnecessary Access control policy installation enables on-demand access control policy update and distribution.
  • the present application provides a microservice logic network, which includes multiple nodes, and the nodes include nodes at the same level and nodes at different levels in the microservice architecture; the nodes are connected by a microservice logic network, and the microservice logic network It is established according to the invocation relationship between different nodes and the affiliation relationship between nodes in the microservice architecture, and the microservice logic network includes the invocation logic network of nodes at the same level and the invocation logic network of nodes at different levels.
  • microservice logical network provided in this application is constructed according to the method for constructing the microservice logical network in the above implementation manner, and the specific construction method is not repeated here.
  • the nodes with the request mapping relationship are connected by the request edge, and the nodes with the subordinate mapping relationship are connected by the subordinate edge, so as to obtain the authority graph.
  • the micro-service logical network Compared with the service logical network formed by service granularity, the micro-service logical network provided by this application has a more refined control strategy, which can meet the actual cloud-native application scenarios; compared with the service logical network formed by service instance granularity, In other words, the complexity is reduced, and the access control policy does not need to occupy more resources.
  • the microservice logic network provided by this application includes not only the call logic network of nodes at the same level, but also the call logic network of nodes at different levels.
  • call logic networks of different granularities can be maintained as needed, and it is no longer necessary to separately maintain the call relationship between nodes shared by each version in the microservice; moreover, it can reduce redundant access control strategies and optimize operation Improve the efficiency of access control policy implementation, reduce unnecessary installation of access control policies, and implement on-demand update and distribution of access control policies.
  • the present application provides a microservice access control policy, which sets the access control policy based on the microservice logical network provided in the above implementation manner.
  • the microservice logic network provided by the above implementation is used to set the access control policy, the call logic network of different granularity can be maintained according to the needs, and it is no longer necessary to separately maintain the call relationship between the nodes shared by each version of the microservice ; Moreover, redundant access control policies can be reduced, and the efficiency of access control policy implementation at runtime can be optimized. At the same time, unnecessary installation of access control policies can be reduced, and on-demand access control policy update and distribution can be realized.
  • the present application provides an electronic device, which includes: one or more processors 701; a memory 702, on which one or more programs are stored. When one processor is executed, one or more processors implement any one of the above microservice logic network construction methods; one or more I/O interfaces 703, connected between the processor and the memory, are configured to implement the processor Interact with the information in the memory.
  • the processor 701 is a device with data processing capability, which includes but not limited to a central processing unit (CPU), etc.
  • the memory 702 is a device with data storage capability, which includes but not limited to a random access memory (RAM, more specifically Such as SDRAM, DDR, etc.), read-only memory (ROM), electrified erasable programmable read-only memory (EEPROM), flash memory (FLASH); I/O interface (read-write interface) 703 is connected between processor 701 and memory 702 , can realize information interaction between the processor 701 and the memory 702, which includes but not limited to a data bus (Bus) and the like.
  • RAM random access memory
  • ROM read-only memory
  • EEPROM electrified erasable programmable read-only memory
  • FLASH flash memory
  • I/O interface (read-write interface) 703 is connected between processor 701 and memory 702 , can realize information interaction between the processor 701 and the memory 702, which includes but not limited to a data bus (Bus) and the
  • the processor 701 , the memory 702 and the I/O interface 703 are connected to each other through a bus, and further connected to other components of the computing device.
  • the present application provides a computer-readable medium on which a computer program is stored, and when the computer program is executed by a processor, any one of the above-mentioned microservice logic network construction methods is implemented.
  • microservice logic network construction method, device, microservice logic network, electronic equipment, and computer-readable medium provided by this application are based on the invocation relationship between different nodes in the microservice architecture and the affiliation relationship between nodes. Therefore, the microservice logic network includes both the call logic network of nodes at the same level and the call logic network of nodes at different levels, that is, there are call logics of different granularities in the microservice logic network.
  • 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).
  • computer storage media includes both volatile and nonvolatile media implemented in any method or technology for storage of information, such as computer readable instructions, data structures, program modules, or other data. permanent, removable and non-removable media.
  • Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cartridges, tape, magnetic disk storage or other magnetic storage devices, or can Any other medium used to store desired information and which can be accessed by a computer.
  • communication media typically embodies 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 .
  • Example embodiments have been claimed herein, and while specific terms are employed, they are used and should be construed in a general descriptive sense only and not for purposes of limitation. In some instances, it will be apparent to those skilled in the art that features, characteristics and/or elements described in connection with a particular embodiment may be used alone, or may be described in combination with other embodiments, unless expressly stated otherwise. Combinations of features and/or elements. Accordingly, it will be understood by those of ordinary skill in the art that various changes in form and details may be made without departing from the scope of the present application as set forth in the appended claims.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本申请提供了一种微服务逻辑网络及其构建方法、装置、设备、可读介质,该微服务逻辑网络构建方法包括:基于微服务架构内不同节点之间的调用关系和节点之间的从属关系,建立微服务架构的微服务逻辑网络,而且,微服务逻辑网络包括相同层级的节点的调用逻辑网络和不同层级的节点的调用逻辑网络。

Description

微服务逻辑网络及其构建方法、装置、设备、可读介质
相关申请的交叉引用
本申请要求2021年9月1日提交给中国专利局的第202111020127.6号专利申请的优先权,其全部内容通过引用合并于此。
技术领域
本申请但不限于涉及计算机技术。
背景技术
微服务架构是云原生的重要技术,而且业界越来越多地采用微服务架构,直接导致微服务架构的规模呈爆发式增长,同时带来了管理上的挑战,如微服务的维护效率。因此,需要对微服务架构的逻辑网络的管理进行改进。
发明内容
第一方面,本申请提供一种微服务逻辑网络构建方法,基于微服务架构内不同节点之间的调用关系和所述节点之间的从属关系,建立所述微服务架构的微服务逻辑网络,而且,所述微服务逻辑网络包括相同层级的节点的调用逻辑网络和不同层级的节点的调用逻辑网络。
第二方面,本申请提供一种微服务逻辑网络构建装置,包括:网络建立模块,被配置为基于微服务架构内不同节点之间的调用关系和所述节点之间的从属关系,建立所述微服务架构的微服务逻辑网络,而且,所述微服务逻辑网络包括相同层级的节点的调用逻辑网络和不同层级的节点的调用逻辑网络。
第三方面,本申请提供一种微服务逻辑网络,包括多个节点,所述节点包括在微服务架构内相同层级的节点和不同层级的节点;所述节点之间由微服务逻辑网络连接,所述微服务逻辑网络依据所述微服 务架构内不同节点之间的调用关系和所述节点之间的从属关系建立,而且,所述微服务逻辑网络包括相同层级的节点的调用逻辑网络和不同层级的节点的调用逻辑网络。
第四方面,本申请提供了一种电子设备,包括:一个或多个处理器;存储装置,其上存储有一个或多个程序,当所述一个或多个程序被所述一个或多个处理器执行时,使得所述一个或多个处理器实现本文描述的任一微服务逻辑网络构建方法;一个或多个I/O接口,连接在所述处理器与存储器之间,配置为实现所述处理器与存储器的信息交互。
第五方面,本申请提供了一种存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现本文描述的任一微服务逻辑网络构建方法。
附图说明
图1为一种微服务架构的结构示意图;
图2为本申请提供的一种微服务逻辑网络构建方法的流程图;
图3为本申请提供的微服务逻辑网络构建方法的流程图;
图4为本申请提供的微服务逻辑网络的示意图;
图5为本申请提供一种微服务逻辑网络构建装置的结构示意图;
图6为本申请提供一种网络建立模块的结构示意图;
图7为本申请提供一种电子设备的结构示意图。
具体实施方式
为使本领域的技术人员更好地理解本申请的技术方案,下面结合附图对本申请提供的服务器进行详细描述。
在下文中将参考附图更充分地描述示例实施方式,但是所述示例实施方式可以以不同形式来体现且不应当被解释为限于本文阐述的实施方式。反之,提供这些实施方式的目的在于使本申请透彻和完整,并将使本领域技术人员充分理解本申请的范围。
如本文所使用的,术语“和/或”包括一个或多个相关列举条目 的任何和所有组合。
本文所使用的术语仅用于描述特定实施方式,且不意欲限制本申请。如本文所使用的,单数形式“一个”和“该”也意欲包括复数形式,除非上下文另外清楚指出。还将理解的是,当本说明书中使用术语“包括”和/或“由……制成”时,指定存在特征、整体、步骤、操作、元件和/或组件,但不排除存在或添加一个或多个其它特征、整体、步骤、操作、元件、组件和/或其群组。
本文实施方式可借助本申请的理想示意图而参考平面图和/或截面图进行描述。因此,可根据制造技术和/或容限来修改示例图示。因此,实施方式不限于附图中所示的实施方式,而是包括基于制造工艺而形成的配置的修改。因此,附图中例示的区具有示意性属性,并且图中所示区的形状例示了元件的区的具体形状,但并不旨在是限制性的。
除非另外限定,否则本文所用的所有术语(包括技术和科学术语)的含义与本领域普通技术人员通常理解的含义相同。还将理解,诸如那些在常用字典中限定的那些术语应当被解释为具有与其在相关技术以及本申请的背景下的含义一致的含义,且将不解释为具有理想化或过度形式上的含义,除非本文明确如此限定。
微服务具有低耦合和高内聚的特点,能够实现各个功能的独立开发与部署、提升应用架构的灵活性。因此,微服务是云原生中应用较广的技术。通常,微服务架构包括多个节点,节点通过服务网络连接。节点可以是服务,也可以是服务实例。每个服务可以部署至少一个服务实例,即微服务架构将节点分为两个层级,主层级为服务,从层级为服务实例。每个服务可以实现一个功能,每个服务实例可以是服务的版本。
图1为一种微服务架构的结构示意图。如图1所示,微服务架构包括第一服务11、第二服务12、第三服务13和第四服务14,其中,第一服务11部署三个服务实例,即服务实例A-V1、服务实例A-V2和服务实例A-V3;第二服务12部署一个服务实例,即服务实例B-V1;第三服务部署两个服务实例,即服务实例C-V1和服务实例C- V2;第四服务14部署一个服务实例,即服务实例D-V1。
在服务与服务实例之间存在调用关系,例如,第一服务11的服务实例A-V1调用第二服务12,第一服务11的服务实例A-V2调用第二服务12、第三服务13和第四服务14,第一服务11的服务实例A-V3调用第二服务12和第四服务14;第二服务12的服务实例B-V1调用第三服务13,第三服务13的服务实例C-V2调用第四服务14。
当第二服务12的服务实例B-V1进行升级时,不仅需要对第三服务13的访问控制策略进行更新,还需要对与服务实例B-V1存在调用关系的服务实例A-V1、服务实例A-V2和服务实例A-V3的访问控制策略分别进行更新,显然存在冗余的访问控制策略,更新效率低。
第一方面,本申请提供一种微服务逻辑网络构建方法,通过该微服务逻辑网络构建方法构建的微服务逻辑网络可以减少冗余的访问控制策略,优化运行时访问控制策略的实施效率。
图2为本申请提供的一种微服务逻辑网络构建方法的流程图。如图2所示,所述微服务逻辑网络构建方法可以包括:步骤S201,基于微服务架构内不同节点之间的调用关系和节点之间的从属关系,建立微服务架构的微服务逻辑网络,而且,微服务逻辑网络包括相同层级的节点的调用逻辑网络和不同层级的节点的调用逻辑网络。
其中,调用关系是指节点通过服务网络调用其他节点的逻辑关系。从属关系是指微服务架构内不同层级的节点之间的从属关系,即主节点和从节点之间的从属关系。例如,在主节点为服务,从节点为服务实例。微服务逻辑网络是描述微服务架构内各节点之间的调用关系的网络,通过该微服务逻辑网络可以清楚地了解各节点之间的调用逻辑。
在一些实施方式中,微服务架构包括多个层级的节点,相同层级的节点可以存在调用关系,不同层级的节点也可以存在调用关系。例如,微服务架构包括服务和服务实例两个层级的节点,而且,服务为主节点,服务实例为从节点。
如图1所示,主节点之间的调用关系包括:第一服务11和第二服务12之间存在调用关系,第一服务11与第三服务13之间存在调用关系,第二服务12与第三服务13之间存在调用关系。
主节点与从节点之间的调用关系包括:第一服务11的服务实例A-V1与第二服务12之间存在调用关系,第一服务11的服务实例A-V2与第二服务12、第三服务13和第四服务14均存在调用关系,第一服务11的服务实例A-V3与第二服务12和第四服务14均存在调用关系,第二服务12的服务实例B-V1与第三服务13存在调用关系,第三服务13的服务实例C-V2与第四服务14存在调用关系。
主节点与从节点之间的从属关系包括:服务实例A-V1、服务实例A-V2和服务实例A-V3与第一服务11之间存在从属关系,服务实例B-V1与第二服务12之间存在从属关系,服务实例C-V1和服务实例C-V2与第三服务13之间存在从属关系,服务实例D-V1与第四服务14之间存在从属关系。
本申请提供的微服务逻辑网络构建方法,基于微服务架构内不同节点之间的调用关系和节点之间的从属关系,建立微服务架构的逻辑网络,因此,调用逻辑网络既包括相同层级的节点的调用逻辑网络,又包括不同层级的节点的调用逻辑网络,即微服务逻辑网络内存在不同粒度的调用逻辑,在对微服务架构进行维护时,可以根据需要对不同粒度的调用逻辑网络进行维护,不再需要分别维护微服务中各个版本所共享的节点之间的调用关系;而且,可以减少冗余的访问控制策略,以及优化运行时访问控制策略实施的效率,同时可以减少不必要的访问控制策略安装,实现按需的访问控制策略更新和分发。
图3为本申请提供的微服务逻辑网络构建方法的流程图。如图1和图3所示,微服务逻辑网络构建方法可以包括步骤S301至S304。
在步骤S301,获取微服务架构内的节点、节点之间的从属关系以及节点之间的调用关系。
在步骤S302,基于节点之间的调用关系构建节点之间的调用逻辑网络。
其中,调用逻辑网络是存在调用关系的节点之间的逻辑网络。例 如,第一服务11和第二服务12之间的逻辑网络为调用逻辑网络。
在步骤S303,基于节点之间的从属关系构建节点之间的从属逻辑网络。
其中,从属逻辑网络是存在从属关系的节点之间的逻辑网络。例如,第二服务12与服务实例B-V1之间的逻辑网络为从属逻辑网络。
需要说明的是,步骤S302和步骤S303的顺序不分先后顺序。
在步骤S304,基于节点之间的调用逻辑网络和节点之间的从属逻辑网络获得微服务架构的微服务逻辑网络。
在在步骤S304中,基于调用逻辑网络和从属逻辑网络,在从属于同一主节点下的所有从节点与所述微服务架构内其它节点均具有调用逻辑网络的情况下,将从属于同一主节点下的所有从节点合并为主节点,获得微服务架构的微服务逻辑网络。
图4为本申请提供的微服务逻辑网络的示意图。在图4中,节点之间的虚线表示从属关系,节点之间的实线表示调用关系。如图1和图4所示,第一服务11的服务实例A-V1、服务实例A-V2和服务实例A-V3均与第二服务12存在调用关系,因此,将服务实例A-V1、服务实例A-V2和服务实例A-V3与第二服务12之间的调用关系合并为第一服务11和第二服务12之间的调用关系r1,将调用关系上升为主层级(服务层级)。当需要对第一服务11的版本进行更新时,不再像现有技术那样分别对服务实例A-V1、服务实例A-V2和服务实例A-V3进行更新,直接对第一服务11进行更新即可,提高了更新效率。
在本实施方式中,将符合条件的服务实例进行合并,层级发生变化,但不符合条件的服务实例层级不能发生变化。由于服务实例A-V2可以调用第三服务13中的服务实例C-V1和服务实例C-V2,因此,服务实例A-V2与第三服务13的调用关系r3为服务层级。由于服务实例A-V2可调用第四服务14中的服务实例D-V1,而第四服务14仅有一个服务实例,因此,服务实例A-V2与第四服务14之间的调用关系r2为服务层级。由于服务实例A-V3可调用第四服务14,因此,服务实例A-V3与第四服务14之间的调用关系r4为服务层级。
第二服务12的服务实例B-V1与第三服务13之间的调用关系r5仍然保持服务层级,第三服务13的服务实例C-V2与第四服务14之间的调用关系r6仍然保持服务层级。
本实施方式提供的微服务架构的微服务逻辑网络中,微服务架构内各个节点之间存在服务层级和服务实例层级的逻辑网络,优化了访问控制策略实施的效率。
在一些实施方式中,步骤S302,基于节点之间的调用关系构建节点之间的调用逻辑网络,可以包括,但不限于以下步骤:基于调用关系确定调用关系对应的节点;在调用关系对应的节点之间建立请求映射,获得调用逻辑网络。
在本实施方式中,节点之间的调用关系涉及两个节点,基于调用关系可以确定该调用关系对应的两个节点,在调用关系对应的节点之间建立请求映射,获得调用逻辑网络。
如图1所示,服务实例A-V1与第二服务12之间存在调用关系r1,则在服务实例A-V1与第二服务12之间建立请求映射,获得调用逻辑网络。服务实例A-V2与第二服务12、第三服务13和第四服务14之间存在调用关系,则在服务实例A-V2与第二服务12、第三服务13和第四服务14之间建立请求映射,获得调用逻辑网络。服务实例A-V3与第二服务12、第四服务14之间存在调用关系,则在服务实例A-V3与第二服务12、第四服务14之间建立请求映射,获得调用逻辑网络。服务实例B-V1与第三服务13之间存在调用关系,则在服务实例B-V1与第三服务13之间建立请求映射,获得调用逻辑网络。服务实例C-V2与第四服务14之间存在调用关系,则在服务实例C-V2与第四服务14之间建立请求映射,获得调用逻辑网络。
在一些实施方式中,步骤S303,基于节点之间的从属关系构建节点之间的从属逻辑网络,可以包括,但不限于以下步骤:基于从属关系确定从属关系对应的节点;在从属关系对应的节点之间建立从属映射,获得从属逻辑网络。
在本实施方式中,节点之间的从属关系涉及两个节点,基于从属关系可以确定该从属关系对应的两个节点,在从属关系对应的节点之 间建立从属映射,获得从属逻辑网络。
如图1所示,第一服务11与服务实例A-V1之间存在从属关系,则在第一服务11与服务实例A-V1之间建立从属映射,获得从属逻辑网络。服务实例A-V2、服务实例A-V13与第一服务11之间建立从属映射,获得从属逻辑网络。第二服务12与服务实例B-V1之间存在从属关系,则在第二服务12与服务实例B-V1之间建立从属映射,获得从属逻辑网络。服务实例C-V1、服务实例C-V2与第三服务13之间存在从属关系,则在第三服务13与服务实例C-V1、服务实例C-V2之间建立从属映射,获得从属逻辑网络。第四服务14与服务实例D-V1之间存在从属关系,则在第四服务14与服务实例D-V1之间建立从属映射,获得从属逻辑网络。
在一些实施方式中,步骤S304,基于节点之间的调用逻辑网络和节点之间的从属逻辑网络获得微服务架构的逻辑网络,可以包括,但不限于以下步骤:基于节点之间的调用逻辑网络和从属逻辑网络,将同一主节点下具有相同调用逻辑网络的从节点合并为主节点,该主节点为从节点共同的主节点,获得微服务架构的逻辑网络。
如图1和图4所示,第一服务11的服务实例A-V1、服务实例A-V2和服务实例A-V3均与第二服务12存在调用关系,因此,将服务实例A-V1、服务实例A-V2和服务实例A-V3与第二服务12之间的调用关系合并为第一服务11和第二服务12之间的调用关系r1,将调用关系上升为主层级(服务层级)。
在一些实施方式中,服务是微服务架构中具有共有权限的节点,例如,服务实例A-V1、服务实例A-V2和服务实例A-V3是服务的三个不同的版本,即这三个服务实例仅是版本不同,但存在共有的权限。
服务实例是微服务架构中具有专有权限的节点,例如,服务实例A-V1、服务实例A-V2和服务实例A-V3虽然具有类似的共有权限,但由于版本不同,各自还包括有不同的专有权限。服务实例B-V1、服务实例C-V1和服务实例D-V1由于实现的功能不同,因此,均具有不同的专有权限。服务实例C-V1和服务实例C-V2虽然具有类似的共有权限,但由于版本不同,各自有不同的专有权限。
在一些实施方式中,共有权限和专有权限均是指微服务的版本权限。
在一些实施方式中,步骤S304,基于微服务架构内不同节点之间的调用关系和节点之间的从属关系,建立微服务架构的逻辑网络之后,还可以包括,但不限于以下步骤:基于微服务架构的微服务逻辑网络生成微服务架构的权限图。
其中,权限图是用于可视化微服务逻辑网络的图形(视图),用户可以通过权限图直观地了解微服务架构的逻辑网络。
本申请提供的微服务逻辑网络构建方法,由于基于微服务架构内不同节点之间的调用关系和节点之间的从属关系,建立微服务架构的逻辑网络,因此,调用逻辑网络既包括相同层级的节点的调用逻辑网络,又包括不同层级的节点的调用逻辑网络,即微服务逻辑网络内存在不同粒度的调用逻辑,在对微服务架构进行维护时,可以根据需要对不同粒度的调用逻辑网络进行维护,不再需要分别维护微服务中各个版本所共享的节点之间的调用关系;而且,可以减少冗余的访问控制策略,以及优化运行时访问控制策略实施的效率,同时可以减少不必要的访问控制策略安装,实现按需的访问控制策略更新和分发。
第二方面,本申请提供一种微服务逻辑网络构建装置,通过该微服务逻辑网络构建装置构建的微服务逻辑网络可以减少冗余的访问控制策略,优化运行时访问控制策略的实施效率。
图5为本申请提供一种微服务逻辑网络构建装置的结构示意图。如图5所示,本申请实例提供一种微服务逻辑网络构建装置500,包括:网络建立模块501,被配置为基于微服务架构内不同节点之间的调用关系和节点之间的从属关系,建立微服务架构的微服务逻辑网络,而且,调用逻辑网络包括相同层级的节点的调用逻辑网络和不同层级的节点的调用逻辑网络。
其中,调用关系是指节点通过服务网络调用其他节点的逻辑关系。从属关系是指微服务架构内不同层级的节点之间的从属关系,即主节点和从节点之间的从属关系。例如,在主节点为服务,从节点为服务实例。微服务逻辑网络是描述微服务架构内各节点之间的调用关 系的网络,通过该微服务逻辑网络可以清楚地了解各节点之间的调用逻辑。
图6为本申请实例提供一种网络建立模块的结构示意图。如图1和图6所示,在一些实施方式中,网络建立模块600,包括:获取单元601、调用逻辑网络构建单元602、从属逻辑网络构建单元603、以及网络获得单元604。
获取单元601,被配置为获取微服务架构内的节点、节点之间的从属关系以及节点之间的调用关系。
如图1所示,微服务架构包括服务节点和服务实例节点,服务节点包括第一服务11、第二服务12、第三服务13和第四服务14,服务实例节点包括服务实例A-V1、服务实例A-V2、服务实例A-V3、服务实例B-V1、服务实例C-V1、服务实例C-V2、服务实例D-V1。其中,节点之间从从属关系包括:服务实例A-V1、服务实例A-V2和服务实例A-V3与第一服务11的从属关系,服务实例B-V1与第二服务12的从属关系,服务实例C-V1和服务实例C-V2与第三服务13的从属关系,服务实例D-V1与第四服务14的从属关系。节点之间的调用关系包括:服务实例A-V1与第二服务12的调用关系r1,服务实例A-V2与第二服务12、第三服务13和第四服务14的调用关系,服务实例A-V3与第二服务12、第四服务14的调用关系,服务实例B-V1与第三服务13的调用关系,服务实例C-V2与第四服务14的调用关系。
调用逻辑网络构建单元602,被配置为基于节点之间的调用关系构建节点之间的调用逻辑网络。
其中,调用逻辑网络是存在调用关系的节点之间的逻辑网络。例如,第一服务11和第二服务12之间的逻辑网络为调用逻辑网络。服务实例A-V1与第二服务12之间的逻辑网络为调用逻辑网络,服务实例A-V2与第二服务12、第三服务13和第四服务14之间的逻辑网络为调用逻辑网络,服务实例A-V3与第二服务12、第四服务14之间的逻辑网络为调用逻辑网络,服务实例B-V1与第三服务13之间的逻辑网络为调用逻辑网络,服务实例C-V2与第四服务14之间 的逻辑网络为调用逻辑网络。
从属逻辑网络构建单元603,被配置为基于节点之间的从属关系构建节点之间的从属逻辑网络。
其中,从属逻辑网络是存在从属关系的节点之间的逻辑网络。例如,服务实例A-V1、服务实例A-V2和服务实例A-V3与第一服务11之间的逻辑网络为从属逻辑网络,第二服务12与服务实例B-V1之间的逻辑网络为从属逻辑网络。服务实例C-V1和服务实例C-V2与第三服务13之间的逻辑网络为从属逻辑网络,服务实例D-V1与第四服务14之间的逻辑网络为从属逻辑网络。
网络获得单元604,被配置为基于节点之间的调用逻辑网络和节点之间的从属逻辑网络获得微服务架构的微服务逻辑网络。
基于调用逻辑网络和从属逻辑网络将不同层级的节点合并,获得微服务架构的微服务逻辑网络。
在一些实施方式中,调用逻辑网络构建单元602包括:第一节点确定子单元,被配置为基于调用关系确定调用关系对应的节点;第一网络获得子单元,被配置为在调用关系对应的节点之间建立请求映射,获得节点之间的调用逻辑网络。
在本实施方式中,节点之间的调用关系涉及两个节点,基于调用关系可以确定该调用关系对应的两个节点,在调用关系对应的节点之间建立请求映射,获得节点之间的调用逻辑网络。
在一些实施方式中,从属逻辑网络构建单元603包括:第二节点确定子单元,被配置为基于从属关系确定从属关系对应的节点;第二网络获得子单元,被配置为在从属关系对应的节点之间建立从属请求映射,获得节点之间的从属逻辑网络。
在本实施方式中,节点之间的从属关系涉及两个节点,基于从属关系可以确定该从属关系对应的两个节点,在从属关系对应的节点之间建立从属请求映射,获得节点之间的从属逻辑网络。
需要说明的是,请求边和从属边是基于节点之间的逻辑关系确定的功能边,当节点之间存在其他逻辑关系时,可以利用与该逻辑关系对应的功能边将节点连接。
在一些实施方式中,网络获得单元604被配置为:基于调用逻辑网络和从属逻辑网络,在从属于同一主节点下的所有从节点与所述微服务架构内其它节点均具有调用逻辑网络的情况下,将从属于同一主节点下的所有从节点合并为主节点,获得微服务架构的微服务逻辑网络。
如图1和图4所示,第一服务11的服务实例A-V1、服务实例A-V2和服务实例A-V3均与第二服务12存在调用关系,因此,将服务实例A-V1、服务实例A-V2和服务实例A-V3与第二服务12之间的调用关系合并为第一服务11和第二服务12之间的调用关系r1,将调用关系上升为主层级(服务层级)。
在一些实施方式中,服务是微服务架构中具有共有权限的节点,例如,服务实例A-V1、服务实例A-V2和服务实例A-V3是服务的三个不同的版本,即这三个服务实例仅是版本不同,但存在共有的权限。
服务实例是微服务架构中具有专有权限的节点,例如,服务实例A-V1、服务实例A-V2和服务实例A-V3虽然具有类似的权限,但由于版本不同,各自仍然有不同的专有权限。服务实例B-V1、服务实例C-V1和服务实例D-V1由于实现的功能不同,因此,均具有不同的专有权限。服务实例C-V1和服务实例C-V2虽然具有类似的权限,但由于版本不同,各自仍然有不同的专有权限。
在一些实施方式中,微服务逻辑网络构建装置500还包括:构图单元,被配置为基于微服务架构的逻辑网络生成微服务架构的权限图。
其中,权限图是用于可视化微服务逻辑网络图形,用户可以通过权限图直观地了解微服务架构的逻辑网络。
需要说明的是,上述实施方式提供的微服务逻辑网络构建方法适用于本实施方式提供的微服务逻辑网络构建装置。
本申请提供的微服务逻辑网络构建装置,由于基于微服务架构内不同节点之间的调用关系和节点之间的从属关系,建立微服务架构的逻辑网络,因此,调用逻辑网络既包括相同层级的节点的调用逻辑网络,又包括不同层级的节点的调用逻辑网络,即微服务逻辑网络内 存在不同粒度的调用逻辑,在对微服务架构进行维护时,可以根据需要对不同粒度的调用逻辑网络进行维护,不再需要分别维护微服务中各个版本所共享的节点之间的调用关系;而且,可以减少冗余的访问控制策略,以及优化运行时访问控制策略实施的效率,同时可以减少不必要的访问控制策略安装,实现按需的访问控制策略更新和分发。
第三方面,本申请提供一种微服务逻辑网络,包括多个节点,节点包括在微服务架构内相同层级的节点和不同层级的节点;节点之间由微服务逻辑网络连接,微服务逻辑网络依据微服务架构内不同节点之间的调用关系和节点之间的从属关系建立,而且,微服务逻辑网络包括相同层级的节点的调用逻辑网络和不同层级的节点的调用逻辑网络。
需要说明的是,本申请提供的微服务逻辑网络是根据上述实施方式中微服务逻辑网络构建方法构建的网络,具体构建方式在此不再赘述。
在微服务逻辑网络中,利用请求边将存在请求映射关系的节点连接,利用从属边将存在从属映射关系的节点连接,从而获得权限图。
本申请提供的微服务逻辑网络相对于全部由服务粒度形成的服务逻辑网络而言,控制策略更加精细,能够满足实际的云原生的应用场景;相对于全部由服务实例粒度形成的服务逻辑网络而言,降低了复杂度,访问控制策略无需占用更多的资源。
本申请提供的微服务逻辑网络,既包括相同层级的节点的调用逻辑网络,又包括不同层级的节点的调用逻辑网络,即微服务逻辑网络内存在不同粒度的调用逻辑,在对微服务架构进行维护时,可以根据需要对不同粒度的调用逻辑网络进行维护,不再需要分别维护微服务中各个版本所共享的节点之间的调用关系;而且,可以减少冗余的访问控制策略,以及优化运行时访问控制策略实施的效率,同时可以减少不必要的访问控制策略安装,实现按需的访问控制策略更新和分发。
第四方面,本申请提供一种微服务访问控制策略,其基于上述实施方式提供的微服务逻辑网络进行访问控制策略的设置。
由于采用上述实施方式提供的微服务逻辑网络进行访问控制策略的设置,可以根据需要对不同粒度的调用逻辑网络进行维护,不再需要分别维护微服务中各个版本所共享的节点之间的调用关系;而且,可以减少冗余的访问控制策略,以及优化运行时访问控制策略实施的效率,同时可以减少不必要的访问控制策略安装,实现按需的访问控制策略更新和分发。
第五方面,参照图7,本申请提供一种电子设备,其包括:一个或多个处理器701;存储器702,其上存储有一个或多个程序,当一个或多个程序被一个或多个处理器执行时,使得一个或多个处理器实现上述任意一项的微服务逻辑网络构建方法;一个或多个I/O接口703,连接在处理器与存储器之间,配置为实现处理器与存储器的信息交互。
其中,处理器701为具有数据处理能力的器件,其包括但不限于中央处理器(CPU)等;存储器702为具有数据存储能力的器件,其包括但不限于随机存取存储器(RAM,更具体如SDRAM、DDR等)、只读存储器(ROM)、带电可擦可编程只读存储器(EEPROM)、闪存(FLASH);I/O接口(读写接口)703连接在处理器701与存储器702间,能实现处理器701与存储器702的信息交互,其包括但不限于数据总线(Bus)等。
在一些实施方式中,处理器701、存储器702和I/O接口703通过总线相互连接,进而与计算设备的其它组件连接。
第六方面,本申请提供一种计算机可读介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述任意一种微服务逻辑网络构建方法。
本申请提供的微服务逻辑网络构建方法、装置、微服务逻辑网络、电子设备及计算机可读介质,由于基于微服务架构内不同节点之间的调用关系和节点之间的从属关系,建立微服务架构的微服务逻辑网络,因此,微服务逻辑网络既包括相同层级的节点的调用逻辑网络,又包括不同层级的节点的调用逻辑网络,即微服务逻辑网络内存在不同粒度的调用逻辑,在对微服务架构进行维护时,可以根据需要对不 同粒度的调用逻辑网络进行维护,不再需要分别维护微服务中各个版本所共享的节点之间的调用关系;而且,可以减少冗余的访问控制策略,以及优化运行时访问控制策略实施的效率,同时可以减少不必要的访问控制策略安装,实现按需的访问控制策略更新和分发,从而提高维护效率。
本领域普通技术人员可以理解,上文中所申请方法中的全部或某些步骤、系统、装置中的功能模块/单元可以被实施为软件、固件、硬件及其适当的组合。在硬件实施方式中,在以上描述中提及的功能模块/单元之间的划分不一定对应于物理组件的划分;例如,一个物理组件可以具有多个功能,或者一个功能或步骤可以由若干物理组件合作执行。某些物理组件或所有物理组件可以被实施为由处理器,如中央处理器、数字信号处理器或微处理器执行的软件,或者被实施为硬件,或者被实施为集成电路,如专用集成电路。这样的软件可以分布在计算机可读介质上,计算机可读介质可以包括计算机存储介质(或非暂时性介质)和通信介质(或暂时性介质)。如本领域普通技术人员公知的,术语计算机存储介质包括在用于存储信息(诸如计算机可读指令、数据结构、程序模块或其它数据)的任何方法或技术中实施的易失性和非易失性、可移除和不可移除介质。计算机存储介质包括但不限于RAM、ROM、EEPROM、闪存或其它存储器技术、CD-ROM、数字多功能盘(DVD)或其它光盘存储、磁盒、磁带、磁盘存储或其它磁存储装置、或者可以用于存储期望的信息并且可以被计算机访问的任何其它的介质。此外,本领域普通技术人员公知的是,通信介质通常包含计算机可读指令、数据结构、程序模块或者诸如载波或其它传输机制之类的调制数据信号中的其它数据,并且可包括任何信息递送介质。
本文已经申请了示例实施方式,并且虽然采用了具体术语,但它们仅用于并仅应当被解释为一般说明性含义,并且不用于限制的目的。在一些实例中,对本领域技术人员显而易见的是,除非另外明确指出,否则可单独使用与特定实施方式相结合描述的特征、特性和/或元素,或可与其它实施方式相结合描述的特征、特性和/或元件组合使用。 因此,本领域技术人员将理解,在不脱离由所附的权利要求阐明的本申请的范围的情况下,可进行各种形式和细节上的改变。

Claims (17)

  1. 一种微服务逻辑网络构建方法,包括:
    基于微服务架构内不同节点之间的调用关系和所述节点之间的从属关系,建立所述微服务架构的微服务逻辑网络,而且,所述微服务逻辑网络包括相同层级的节点的调用逻辑网络和不同层级的节点的调用逻辑网络。
  2. 根据权利要求1所述的方法,其中,所述基于微服务架构内不同节点之间的调用关系和所述节点之间的从属关系,建立所述微服务架构的微服务逻辑网络,包括:
    获取所述微服务架构内的所述节点、所述节点之间的从属关系以及所述节点之间的调用关系;
    基于所述节点之间的调用关系构建所述节点之间的调用逻辑网络;
    基于所述节点之间的从属关系构建所述节点之间的从属逻辑网络;
    基于所述节点之间的调用逻辑网络和所述节点之间的从属逻辑网络获得所述微服务架构的微服务逻辑网络。
  3. 根据权利要求2所述的方法,其中,所述基于所述节点之间的调用关系构建所述节点之间的调用逻辑网络,包括:
    基于所述调用关系确定所述调用关系对应的所述节点;
    在所述调用关系对应的所述节点之间建立请求映射,获得所述节点之间的调用逻辑网络。
  4. 根据权利要求2所述的方法,其中,所述基于所述节点之间的从属关系构建所述节点之间的从属逻辑网络,包括:
    基于所述从属关系确定所述从属关系对应的所述节点;
    在所述从属关系对应的所述节点之间建立从属映射,获得所述节点之间的从属逻辑网络。
  5. 根据权利要求2所述的方法,其中,所述基于所述节点之间的调用逻辑网络和所述节点之间的从属逻辑网络获得所述微服务架构 的微服务逻辑网络,包括:
    基于所述节点之间的调用逻辑网络和所述节点之间的从属逻辑网络,在从属于同一主节点下的从节点与所述微服务架构内其它节点均具有调用逻辑网络的情况下,将从属于同一主节点下的从节点合并为对应的主节点,获得所述微服务逻辑网络。
  6. 根据权利要求2-5任意一项所述的方法,其中,所述节点包括服务和服务实例,且所述服务实例的层级低于所述服务。
  7. 根据权利要求6所述的方法,其中,所述服务是所述微服务架构中具有共有权限的节点,所述服务实例是所述微服务架构中具有专有权限的节点。
  8. 根据权利要求1-5任意一项所述的方法,其中,所述基于微服务架构内不同节点之间的调用关系和所述节点之间的从属关系,建立所述微服务架构的微服务逻辑网络之后,所述方法还包括:
    基于所述微服务架构的微服务逻辑网络生成所述微服务架构的权限图。
  9. 一种微服务逻辑网络构建装置,其中,包括:
    网络建立模块,被配置为基于微服务架构内不同节点之间的调用关系和所述节点之间的从属关系,建立所述微服务架构的微服务逻辑网络,而且,所述微服务逻辑网络包括相同层级的节点的调用逻辑网络和不同层级的节点的调用逻辑网络。
  10. 根据权利要求9所述的装置,其中,所述网络建立模块,包括:
    获取单元,被配置为获取所述微服务架构内的所述节点、所述节点之间的从属关系以及所述节点之间的调用关系;
    调用逻辑网络构建单元,被配置为基于所述节点之间的调用关系构建所述节点之间的调用逻辑网络;
    从属逻辑网络构建单元,被配置为基于所述节点之间的从属关系构建所述节点之间的从属逻辑网络;
    网络获得单元,被配置为基于所述节点之间的调用逻辑网络和所述节点之间的从属逻辑网络获得所述微服务架构的微服务逻辑网 络。
  11. 根据权利要求10所述的装置,其中,所述调用逻辑网络构建单元,包括:
    第一节点确定子单元,被配置为基于所述调用关系确定所述调用关系对应的所述节点;
    第一网络获得子单元,被配置为在所述调用关系对应的所述节点之间建立请求映射,获得所述节点之间的调用逻辑网络。
  12. 根据权利要求10所述的装置,其中,所述从属逻辑网络构建单元,包括:
    第二节点确定子单元,被配置为基于所述从属关系确定所述从属关系对应的所述节点;
    第二网络获得子单元,被配置为在所述从属关系对应的所述节点之间建立从属映射,获得所述节点之间的从属逻辑网络。
  13. 根据权利要求10所述的装置,其中,所述网络获得单元被配置为:
    基于所述调用逻辑网络和所述从属逻辑网络,在从属于同一主节点下的所有从节点与所述微服务架构内其它节点均具有调用逻辑网络的情况下,将从属于同一主节点下的所有从节点合并为对应的主节点,获得所述微服务逻辑网络。
  14. 根据权利要求9-13任意一项所述的装置,还包括:
    构图单元,被配置为基于所述微服务架构的微服务逻辑网络生成所述微服务架构的权限图。
  15. 一种微服务逻辑网络,包括多个节点,所述节点包括在微服务架构内相同层级的节点和不同层级的节点;所述节点之间由微服务逻辑网络连接,所述微服务逻辑网络依据所述微服务架构内不同节点之间的调用关系和所述节点之间的从属关系建立,而且,所述微服务逻辑网络包括相同层级的节点的调用逻辑网络和不同层级的节点的调用逻辑网络。
  16. 一种电子设备,包括:
    一个或多个处理器;
    存储装置,其上存储有一个或多个程序,当所述一个或多个程序被所述一个或多个处理器执行时,使得所述一个或多个处理器实现根据权利要求1-8任意一项所述的方法;
    一个或多个I/O接口,连接在所述处理器与存储器之间,配置为实现所述处理器与存储器的信息交互。
  17. 一种计算机可读介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现根据权利要求1-8任意一项所述的方法。
PCT/CN2022/111712 2021-09-01 2022-08-11 微服务逻辑网络及其构建方法、装置、设备、可读介质 WO2023029934A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111020127.6A CN115766838A (zh) 2021-09-01 2021-09-01 微服务逻辑网络及其构建方法、装置、设备、可读介质
CN202111020127.6 2021-09-01

Publications (1)

Publication Number Publication Date
WO2023029934A1 true WO2023029934A1 (zh) 2023-03-09

Family

ID=85332160

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/111712 WO2023029934A1 (zh) 2021-09-01 2022-08-11 微服务逻辑网络及其构建方法、装置、设备、可读介质

Country Status (2)

Country Link
CN (1) CN115766838A (zh)
WO (1) WO2023029934A1 (zh)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106603583A (zh) * 2017-02-23 2017-04-26 北京工业大学 一种微服务网络构建方法
CN108322351A (zh) * 2018-03-05 2018-07-24 北京奇艺世纪科技有限公司 生成拓扑图的方法和装置、故障确定方法和装置
CN113037571A (zh) * 2021-05-20 2021-06-25 睿至科技集团有限公司 一种大规模微服务架构及其管理方法

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106603583A (zh) * 2017-02-23 2017-04-26 北京工业大学 一种微服务网络构建方法
CN108322351A (zh) * 2018-03-05 2018-07-24 北京奇艺世纪科技有限公司 生成拓扑图的方法和装置、故障确定方法和装置
CN113037571A (zh) * 2021-05-20 2021-06-25 睿至科技集团有限公司 一种大规模微服务架构及其管理方法

Also Published As

Publication number Publication date
CN115766838A (zh) 2023-03-07

Similar Documents

Publication Publication Date Title
CN107959582B (zh) 一种切片实例的管理方法及装置
US11769150B2 (en) Transaction scheduling for block space on a blockchain
US20110010339A1 (en) Techniques for cloud control and management
US20110289499A1 (en) Techniques to automatically update software applications
US10873512B2 (en) Methods for managing self-healing cloud infrastructure and applications
US20210097476A1 (en) Container Management Method, Apparatus, and Device
US20110238795A1 (en) Semantic Matching of Federation Intents and Services Capabilities in a Planning System for Automatic Service Federation
EP2998862A1 (en) Method, device, and system for memory management
WO2017118330A1 (zh) 一种应用程序数据访问隔离方法及装置
US20230261950A1 (en) Method of container cluster management and system thereof
WO2017012383A1 (zh) 一种服务注册方法、使用方法及相关装置
CN114363162B (zh) 区块链日志的生成方法及装置、电子设备、存储介质
WO2017211161A1 (zh) 基于软件定义网络的资源管理方法及装置
WO2017041650A1 (zh) 用于扩展分布式一致性服务的方法和设备
US8812678B2 (en) Integration of an application server and data grid
WO2023029934A1 (zh) 微服务逻辑网络及其构建方法、装置、设备、可读介质
CN115794396A (zh) 资源分配的方法、系统和电子设备
WO2023185043A1 (zh) 一种可调用资源的分配方法和装置
CN114051029B (zh) 授权方法、授权装置、电子设备和存储介质
CN114157573A (zh) 部署虚拟化网络功能的方法和装置
WO2022133827A1 (zh) 一种任务处理请求的处理方法、装置以及区块链节点设备
US8271798B2 (en) Limiting access to publicly exposed object-oriented interfaces via password arguments
CN113093995A (zh) 一种云盘数据的迁移方法和系统
US11853560B2 (en) Conditional role decision based on source environments
CN114363349B (zh) 区块链子网的启动方法及装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22863074

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2022863074

Country of ref document: EP

Effective date: 20240305

NENP Non-entry into the national phase

Ref country code: DE