A service registration method and device between network services

By using tokens and atomic transactions to implement service registration between network services, it solves the problems of flexibility and authority management complexity in existing technologies, provides flexible service registration and access control logic, and ensures trust relationships between services. establishment and data consistency.

CN116112224BActive Publication Date: 2024-08-27SHANGHAI YUANZUN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211696629.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-28
Publication Date
2024-08-27
Estimated Expiration
2042-12-28

AI Technical Summary

Technical Problem

In the existing technology, the service registration scheme requires manual writing of configuration files, which is difficult to control, and the microservice registration center is difficult to customize and expand and integrate complex service permission management, resulting in complex trust relationships and access control logic between network services.

Method used

By using tokens for registration and synchronization operations between trusted nodes and service nodes, token production, token consumption and synchronization interfaces are used to implement service registration, and atomic transactions are used to ensure the atomicity and consistency of registration operations.

Benefits of technology

It realizes service registration and access control without specific technology implementation dependencies, allows administrators to dynamically control, ensures that service nodes and trusted nodes complete registration and meta-information storage at the same time, and improves the flexibility and security of establishing and managing trust relationships between services. .

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116112224B
    Figure CN116112224B
Patent Text Reader

Abstract

The purpose of the present application is to provide a service registration method and device between network services. The present application realizes that a trusted network service is used as a registration center or authentication service for a series of service nodes to provide request authorization, access control, service discovery and other services, and is not dependent on specific technical implementations. Any service registration and access control logic can be written in the trusted node, and can be provided to administrator users for dynamic regulation; at the same time, the use of atomic transaction functions provides a guarantee for the atomicity of the registration operation of the service registration, ensuring that the trusted node and the service node simultaneously complete the service registration and the storage of each other's metadata.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a service registration method and device between network services. Background Art

[0002] In the prior art, most authentication scenarios require network services to trust another network service responsible for authentication or registration. For example, network services are only allowed to execute requests authorized by trusted service nodes, or use service discovery provided by trusted service nodes to access other service interfaces. The operation of establishing a trust relationship between services by holding meta-information such as interface addresses is often called service registration. Existing service registration solutions include manually written configuration files and microservice registration. Among them, manually written configuration files require a fixed configuration of a series of nodes. For example, writing an nginx configuration file is actually registering the intranet service to the nginx load balancing. The disadvantage is that the configuration file needs to be maintained manually and is difficult to regulate. In microservice registration, microservices are registered using microservice registration centers such as Eureka and Consul. However, traditional registration centers are often deployed as components in the intranet, and it is difficult to customize and expand, or integrate more complex or cross-network service authority management and access control logic. Therefore, exploring a service registration solution between network services has become a major research topic in the industry. Summary of the invention

[0003] One purpose of the present application is to provide a service registration method and device between network services, which can enable a trusted network service to serve as a registration center or authentication service for a series of service nodes, provide request authorization, access control, service discovery and other services, and is not dependent on specific technical implementations. Any service registration and access control logic can be written in the trusted node, and can be provided to administrator users for dynamic regulation.

[0004] According to one aspect of the present application, a service registration method between network services is provided, which is applied to a service node, wherein the method includes:

[0005] The registration interface receives a registration request initiated by a requesting end or a trusted node carrying a token and an interface address of the trusted node; wherein the token is received by the trusted node through a token production interface after the requesting end carries the identity identifier of the visitor and the first request initiated by the registration interface of the service node to be registered, and verifies whether the visitor has the authority to register for the service, and if so, generates a node identifier for the service node to be registered, and stores the identifier of the service node corresponding to the token and the identifier, key and authority of the administrator who has the authority to register for the service to be registered;

[0006] Initiate a second request to the interface address of the trusted node by carrying the token through the registration interface, so that the trusted node verifies whether the token is valid, and if so, retrieves the stored identifier and administrator data of the service node corresponding to the token and returns them;

[0007] receiving the identifier of the service node and the administrator data returned by the trusted node, and storing them together with the interface address of the trusted node in a function using atomic transactions;

[0008] Initiate a synchronization request to the synchronization interface of the trusted node with the token and the meta-information of the service node, so that the trusted node verifies whether the token is valid. If so, retrieve the stored identifier of the service node and the identifier of the trusted node corresponding to the token, and store the identifier and meta-information of the service node in the function using the atomic transaction;

[0009] receiving response information returned by the trusted node indicating successful registration, and submitting a transaction storing the identifier of the service node and the identifier of the trusted node in a function using an atomic transaction;

[0010] Returning the response information indicating successful registration to the requesting end, or returning it to the trusted node so that the trusted node forwards the response information indicating successful registration to the requesting end;

[0011] Wherein, the method further comprises:

[0012] receiving response information returned by the trusted node indicating registration failure, and performing a transaction rollback or compensation operation on a transaction storing the identifier of the service node and the identifier of the trusted node in a function using an atomic transaction;

[0013] The response information indicating the registration failure is returned to the requesting end, or returned to the trusted node so that the trusted node forwards the response information indicating the registration failure to the requesting end.

[0014] According to another aspect of the present application, a service registration method between network services is also provided, which is applied to a trusted node, wherein the method includes:

[0015] Receiving, through a token production interface, a first request initiated by a requester carrying an identity identifier of a visitor and a registration interface of a service node to be registered;

[0016] Verify whether the visitor has the authority to register for the service. If so, generate a token, generate an identifier for the service node to be registered, and store the identifier of the service node corresponding to the token, the node administrator's identity, authority, and the interface address of the trusted node;

[0017] Sending the token and the interface address of the trusted node to the requesting end, so that the requesting end carries the token and the interface address of the trusted node to initiate a registration request to the acquired registration interface of the service node to be registered, wherein the service node initiates a second request to the interface address of the trusted node through the registration interface carrying the token;

[0018] Receiving, through the token consumption interface, a second request initiated by the service node carrying the token, and verifying whether the token is valid; if so, taking out the stored identifier of the service node corresponding to the token and returning it to the service node, so that the service node stores the identifier of the service node and the identifier of the trusted node in the function using the atomic transaction, and carrying the token and the meta-information of the service node to initiate a synchronization request to the synchronization interface of the trusted node;

[0019] Receiving, through the synchronization interface, a synchronization request initiated by the service node carrying the token and the meta-information of the service node, and verifying whether the token is valid, and if so, retrieving the stored identifier of the service node and the identifier of the trusted node corresponding to the token, and storing the identifier of the trusted node, the identifier of the service node and the meta-information in a function using an atomic transaction;

[0020] If the registration synchronization of the service node succeeds, return response information indicating the registration success to the service node, so that the service node submits the transaction storing the identifier of the service node and the identifier of the trusted node in the function using the atomic transaction;

[0021] After the transaction is successfully submitted, the response information indicating successful registration is returned to the requesting end.

[0022] According to another aspect of the present application, a service registration method between network services is also provided, which is applied to a requesting end, wherein the method includes:

[0023] Initiate a first request to the trusted node with the visitor's identity and the registration interface of the service node to be registered, so that the trusted node verifies whether the visitor has the right to register the service through the token production interface. If so, generate a token to generate identity authority for the service node to be registered, store the service node identifier and the trusted node identifier corresponding to the token, and send the token and the interface address of the trusted node to the requesting end;

[0024] Receiving the token returned by the trusted node and the interface address of the trusted node;

[0025] Carrying the token and the interface address of the trusted node, a registration request is initiated to the registration interface of the service node to be registered, so that the service node initiates a second request to the interface address of the trusted node through the registration interface with the token; wherein the trusted node verifies whether the token is valid, and if so, retrieves the stored identification and administrator data of the service node corresponding to the token and returns them to the service node; the service node stores the identification of the service node, the interface address and administrator data of the trusted node in a function using atomic transactions, and initiates a synchronization request to the synchronization interface of the trusted node with the token and the meta-information of the service node ; The trusted node verifies whether the token is valid. If so, it takes out the stored identifier of the service node and the identifier of the trusted node corresponding to the token, and stores the identifier of the trusted node, the identifier of the service node and the meta-information in the function using atomic transactions. If the registration synchronization of the service node is successful, response information indicating successful registration is returned to the service node; after the service node receives the response information indicating successful registration returned by the trusted node, it submits the transaction storing the identifier of the service node and the identifier of the trusted node in the function using atomic transactions, and returns the response information indicating successful registration to the requesting end.

[0026] Receive response information returned by the service node indicating successful registration.

[0027] According to another aspect of the present application, a non-volatile storage medium is provided, on which computer-readable instructions are stored. When the computer-readable instructions can be executed by a processor, the processor implements the service registration method between network services as described above.

[0028] According to another aspect of the present application, a service node for service registration between network services is also provided, the service node comprising:

[0029] one or more processors;

[0030] A computer readable medium for storing one or more computer readable instructions,

[0031] When the one or more computer-readable instructions are executed by the one or more processors, the one or more processors implement the service registration method between network services at the service node end as described above.

[0032] According to another aspect of the present application, a trusted node for service registration between network services is also provided, the trusted node comprising:

[0033] one or more processors;

[0034] A computer readable medium for storing one or more computer readable instructions,

[0035] When the one or more computer-readable instructions are executed by the one or more processors, the one or more processors implement the above-mentioned service registration method between trusted node-side network services.

[0036] According to another aspect of the present application, there is also provided a request end for service registration between network services, the request end comprising:

[0037] one or more processors;

[0038] A computer readable medium for storing one or more computer readable instructions,

[0039] When the one or more computer-readable instructions are executed by the one or more processors, the one or more processors implement the service registration method between request-side network services as described above.

[0040] Compared with the prior art, the present application combines the requesting end, the trusted node and the service node, so that the service node receives the registration request initiated by the requesting end or the trusted node carrying the token and the interface address of the trusted node through the registration interface; wherein, after the trusted node receives the first request initiated by the registration interface of the requesting end carrying the identity identifier of the visitor and the service node to be registered through the token production interface, it verifies whether the visitor has the authority to register for the service, and if so, generates, wherein the trusted node also generates a node identifier for the service node to be registered, and stores the identifier of the service node corresponding to the token and the identifier, key and authority of the administrator who has the authority to register for the service to be registered; the service node carries the token through the registration interface to initiate a second request to the interface address of the trusted node, so that the trusted node verifies whether the token is valid, and if so, retrieves the stored identifier and administrator data of the service node corresponding to the token and returns them; The service node receives the identifier of the service node and the administrator data returned by the trusted node, and stores them together with the interface address of the trusted node in a function using atomic transactions; the service node carries the token and the meta-information of the service node to initiate a synchronization request to the synchronization interface of the trusted node, so that the trusted node verifies whether the token is valid, and if so, retrieves the stored identifier of the service node and the identifier of the trusted node corresponding to the token, and stores the identifier and meta-information of the service node in the function using atomic transactions; the service node receives response information returned by the trusted node indicating successful registration, and in the function using atomic transactions, submits the transaction storing the identifier of the service node and the identifier of the trusted node, and returns the response information indicating successful registration to the requesting end, or returns it to the trusted node so that the trusted node forwards the response information indicating successful registration to the requesting end. It realizes the use of a trusted network service as the registration center or authentication service for a series of service nodes, providing request authorization, access control, service discovery and other services, and is not dependent on specific technical implementations. Any service registration and access control logic can be written in the trusted node, and can be provided to administrators for dynamic regulation. At the same time, the use of atomic transaction functions provides a guarantee for the atomicity of the registration operation of the service registration, ensuring that the trusted node and the service node complete the service registration and the metadata storage of each other at the same time. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:

[0042] Figure 1 A flow chart showing a service registration method between network services in an actual application scenario according to one aspect of the present application is shown.

[0043] The same or similar reference numerals in the drawings represent the same or similar components. DETAILED DESCRIPTION

[0044] The present application is described in further detail below in conjunction with the accompanying drawings.

[0045] In a typical configuration of the present application, the terminal, the device of the service network and the trusted party all include one or more processors (CPU), input / output interfaces, network interfaces and memories.

[0046] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0047] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include non-transitory media such as modulated data signals and carrier waves.

[0048] In a service registration method between network services provided in the present application, the trusted node at least provides a token production interface, a token consumption interface and a synchronization interface for synchronization operation of service registration, wherein the token production interface is used to receive the information parameters of the request initiated by the requesting end, and stores and generates a token interface together with the visitor's identity identification; the token consumption interface is used to receive a token, and retrieve the information and identity identification interface corresponding to the token in the storage, etc.; the trusted node needs to provide a synchronization interface for synchronization operation of service registration for all requests that need to register the service. At the same time, the service node also needs a registration interface for implementing service registration to implement the registration of the network service to be registered. These interfaces of the above trusted nodes and service nodes need to be open in the network, and an interface address is given, so that a network request is sent to the interface address when the request corresponding to the interface involved in the embodiment of the present application is requested.

[0049] It should be noted that the trusted node has a standard interface address, and it can be obtained according to one or more agreed interface standards. For example, the base interface address is [M-API], and the specifications can be: token production interface address [M-API] / token, token consumption interface address [M-API] / token / retrieve and service registration data synchronization interface address [M-API] / add_node, so it is only necessary to compile the specifications of different interface addresses in the service node. When transmitting, it is only necessary to carry the base interface address of the trusted node, and the other interface addresses that need to be requested can be generated according to the agreed specifications of different interface addresses. Another way is to carry all the required interface addresses. Since the service node needs the token consumption interface address and the service registration data synchronization interface address when registering the service, it is also possible to carry all the required interface addresses when requesting, which is suitable for situations where there is no preset generation rule between different interfaces or they change dynamically.

[0050] In a service registration method between network services provided in the present application, a requesting end, a trusted node and a service node are included, wherein the trusted node can be a registration center or authentication service of the service node for service registration, and is another network service trusted by the requesting program (such as a network service, etc.). After completing the registration, the service node establishes trust in the trusted node; the service node is a service to be registered, that is, a service node to be registered; a requesting program is installed in the requesting end, and the requesting program is the initiator of the registration operation, which can be a client program, a network service or a request script program, etc., which has the ability to send network requests. The requesting program can be triggered by a user operation to make a network request, or it can initiate a network request according to the program logic. Among them, both the trusted node and the service node need to use a certain storage method to store and query the data required for service registration between network services (such as address and permission data, etc.).

[0051] In a service registration method between network services provided in the present application, the trust establishment between network services (i.e., registration of service nodes) is such an operation: the meta information of the service node of the network service is stored on the trusted node, and the main credentials of the trusted node (such as the identity of the trusted node, etc.) are stored on the service node of the network service, so that the service node of the network service can trust and verify the operation authorized by the trusted node. For the service node and the trusted node of the network service, the registration of the service is a process of establishing trust and consensus, so that both parties hold each other's meta information, and generate information such as the identity and key required to access the service, so as to be able to verify and authenticate in subsequent operations. The purpose of service registration (i.e., establishing trust) between network services includes but is not limited to: the service node can authenticate the request authorized by the trusted node, and the service node can register and discover the service provided by the trusted node, so as to access other dependent services, etc. Here, the meta information of the service node represents the basic information required by the trusted node to be provided by the service node when registering, such as name, version, instance information, etc., which is specifically agreed by the trusted node in the standard specification.

[0052] In a service registration method between network services provided in this application, generally speaking, both the visitor (the sender of the network request) and the visitee (the executor of the network request, the holder of the requested resource or the target object of the requested operation, etc.) need to register in the trusted node before they can use the service discovery and authorization authentication services provided by the trusted node later. For the case where the visitor or the visitee is a service, the service registration method between network services provided in this application is used to register the service. For the case where the visitor is a user, the existing graphical interface account password registration method can be used. The purpose is to make both the visitor and the visitee stored by the trusted node, and the trusted node can also store, query and configure the visitor's access rights to the visitee, and use any method to represent the rights of any complexity and granularity. In addition, if the trusted node provides registration of users and services, it not only provides users with authentication and authorization of services, but also provides service access control, and can even provide administrators with management of services.

[0053] The service registration method between network services provided by the embodiment of the present application has two implementation modes in different practical application scenarios, namely, non-proxy mode and proxy mode. First, no matter which implementation mode is adopted, the trusted node needs to provide a secure access protocol (such as HTTPS) to ensure that the requesting program and the service node can safely request it, and the trusted node needs to be able to authenticate the requesting program installed in the requesting end. The situation can be: if the requesting program is a user, the user has logged in at the trusted node, and the credentials of the logged-in user will be carried in the request sent to the trusted node, so that the trusted node can obtain the identity and authority of the requested user; if the requesting program is a service, the key or identifier of the service needs to be carried in the request sent to the trusted node, so that the trusted node can obtain the identity and authority of the requested service. After meeting these two conditions, the key or credentials and other information carried in the request sent by the requesting program to the trusted node will be recognized by the trusted node as a valid visitor, and after the verification and authentication of the request are passed, the service is registered at the service node to initiate the registration synchronization of the service node corresponding to the trusted node. It should be noted that it is not the requesting program that is authenticated, but the visitor who uses the requesting program (for example, through the credential information carried in the request, etc.). In proxy mode, in some communication situations, the requesting end cannot securely access the service node, such as when the service node cannot provide secure protocol access, but the trusted node can access the service node; for example, when the requesting end cannot directly access the service node, the service node is in a local area network but has no public network address, the trusted node is also in the local area network but has a public network address, and the requesting end with the requesting program installed is not connected to the local area network. In these two cases, the trusted node can be used as a request agent for the requesting end with the requesting program installed, thereby ensuring the feasibility and security of the requesting end's request, but the proxy mode needs to satisfy that the trusted node can access the service node. In other cases, non-proxy mode requests are used by default, but proxy mode can also be selected (or configured by the administrator) for requests.

[0054] Taking the non-proxy mode as an example, a service registration method between network services provided by the present application is further explained, including a service node, a trusted node and a requesting end with a requesting program installed, including steps S11 and S14 executed by the requesting end through the requesting program, steps S21 to S26 executed by the trusted node and steps S31 to S36 executed by the service node, specifically including the following steps:

[0055] Step S11 (not shown), the requesting end carries the identity of the visitor and initiates a first request to the token production interface of the trusted node.

[0056] Here, in the non-proxy mode, the user can carry the visitor's identity and the registration interface of the service node to be registered in the first request, or the first request only needs to carry the visitor's identity without carrying the registration interface of the service node to be registered, so that the registration interface is carried by the node data in the service node and submitted to the trusted node.

[0057] It should be noted that in non-proxy mode, the only necessary information that the first request needs to carry is the visitor's identity, but it can also carry the registration interface of the service node, other relevant user input, or auxiliary information such as tags, names and descriptions that the requesting program needs to carry.

[0058] Step S21 (not shown), the trusted node receives, through the registration interface, a first request initiated by the requesting end carrying the identity of the visitor and the registration interface of the service node to be registered.

[0059] Step S22 (not shown), the trusted node verifies whether the visitor has the authority to register for the service. If so, a token is generated to generate identity authority for the service node to be registered, and the identity, authority and interface address of the trusted node of the node administrator of the service node corresponding to the token are stored. Here, the node administrator includes but is not limited to a registered user who can initiate a node registration request and an administrative user who has authority to manage the node.

[0060] It should be noted that the identity authority generated by the service node includes but is not limited to the service node's identifier, key, and the service management authority credentials and keys corresponding to the current user (i.e., the user who registers for the service is the root administrator of the service by default). Further, the generation of identity authority often refers to the trusted node using a certain random character generation algorithm to generate a unique identifier and key for the service node to be registered, as well as the service management authority credentials and keys corresponding to the current user (the user who registers for the service is the root administrator of the service by default). There are no excessive restrictions on which specific permissions need to be generated.

[0061] Step S23 (not shown): the trusted node sends the token and the interface address of the trusted node to the requesting end.

[0062] It should be noted that one way to obtain the interface address of the trusted node is to send the base interface address of the trusted node, that is, to generate other interface addresses that need to be requested according to the preset interface specification. For example, the token consumption interface, token production interface and registration synchronization interface can all be obtained from the interface address of the trusted node; another way is to carry all required interface addresses. Since the service node needs the interface address of the token consumption interface and the interface address for synchronizing the service registration data when registering the service, all required interface addresses can also be carried when requesting. This is suitable for situations where there is no preset fixed generation rule between different interfaces or they change dynamically.

[0063] Step S12 (not shown), the requesting end receives the token returned by the trusted node and the interface address of the trusted node.

[0064] Step S13 (not shown), the requesting end carries the token and the interface address of the trusted node to initiate a registration request to the obtained registration interface of the service node to be registered.

[0065] Step S31 (not shown), the service node receives a registration request initiated by the requesting end carrying a token and an interface address of the trusted node through a registration interface.

[0066] Step S32 (not shown): the service node initiates a second request to the interface address of the trusted node through the registration interface and carries the token.

[0067] In step S24 (not shown), the trusted node receives the second request initiated by the service node carrying the token through the token consumption interface, and verifies whether the token is valid. If so, the stored identification and administrator data of the service node corresponding to the token are retrieved and returned to the service node.

[0068] Step S33 (not shown), the service node receives the service node identifier and the administrator data returned by the trusted node, and stores them together with the interface address of the trusted node in the function using the atomic transaction.

[0069] It should be noted that the function using atomic transactions may be used to represent a series of steps, including but not limited to starting a transaction, committing a transaction, rolling back a transaction, or performing a compensation operation.

[0070] Step S34 (not shown), the service node carries the token and the meta-information of the service node and initiates a synchronization request to the synchronization interface of the trusted node.

[0071] It should be noted that the meta information of the service node includes but is not limited to the standard interface address of the service node and other data that the trusted node needs to know.

[0072] Step S25 (not shown), the trusted node receives a synchronization request initiated by the service node carrying the token and the meta-information of the service node through the synchronization interface, and verifies whether the token is valid. If so, the stored identifier of the service node and the identifier of the trusted node corresponding to the token are retrieved, and the identifier of the trusted node, the identifier of the service node and the meta-information are stored in the function using the atomic transaction.

[0073] Step S26 (not shown), if the registration synchronization of the service node is successful, the trusted node returns a response message to the service node indicating a successful registration; here, the response message indicating a successful registration is used to indicate that both the registration operation of the service node and the synchronous registration operation of the service registration of the trusted node are successful.

[0074] Step S35 (not shown), the service node receives the response information returned by the trusted node indicating successful registration, and submits the transaction storing the identifier of the service node and the identifier of the trusted node in the function using the atomic transaction.

[0075] Step S36 (not shown): the service node returns the response information indicating successful registration to the requesting end.

[0076] Step S14 (not shown), the requesting end receives response information returned by the service node indicating successful registration.

[0077] Through the above-mentioned steps S11 and S14, steps S21 to S26, and steps S31 to S36, in the non-proxy mode, a registration request is initiated to the service node through the requesting end, so that the registration and synchronization of the service node to be registered are completed at both the service node and the trusted node, and a trusted network service is used as a registration center or authentication service for a series of service nodes to provide request authorization, access control, service discovery and other services, and is not dependent on specific technical implementations. Any service registration and access control logic can be written in the trusted node, and can be provided to administrator users for dynamic regulation; at the same time, the use of atomic transaction functions provides a guarantee for the atomicity of the registration operation of the service registration, ensuring that the trusted node and the service node simultaneously complete the service registration and the storage of each other's metadata.

[0078] In this embodiment, after the trusted node performs step S25 (not shown), if the registration synchronization of the service node fails, the trusted node returns response information indicating the registration failure to the service node, so that after receiving the response information indicating the registration failure returned by the trusted node, the service node performs a transaction rollback or compensation operation on the transaction storing the identifier of the service node and the identifier of the trusted node in the function using the atomic transaction, and returns the response information indicating the registration failure to the requesting end. The requesting end receives the response information indicating the registration failure returned by the service node, and when the service registration fails in the non-proxy mode, the service node and the trusted node can be restored to an unchanged state together, further ensuring data consistency and atomicity of changes. The service node directly returns the response information indicating the registration failure to the requesting end, so that the requesting end can understand that the registration operation and synchronization operation of the service node to be registered have failed through the received response information indicating the registration failure, thereby achieving the purpose of notifying the requesting end.

[0079] Taking the proxy mode as an example, a service registration method between network services provided by the present application is further explained, including a service node, a trusted node and a requesting end with a requesting program installed, wherein the trusted node is a proxy node of the requesting end, including steps S101 and S102 executed by the requesting end through the requesting program, steps S201 to S207 executed by the trusted node, and steps S301 to S306 executed by the service node, specifically including the following steps:

[0080] Step S101 (not shown), the requesting end must carry the visitor's identity and the registration interface of the service node to be registered to initiate a first request to the token production interface of the trusted node, so that the trusted node needs to send a request to the registration interface.

[0081] Step S201 (not shown): the trusted node receives, through a token production interface, a first request initiated by a requesting end carrying the identity of the visitor and a registration interface of a service node to be registered.

[0082] Step S202 (not shown), the trusted node verifies whether the visitor has the authority to register for the service. If so, a token is generated to generate identity authority for the service node to be registered, and the identifier of the service node and the trusted node corresponding to the token are stored.

[0083] Step S203 (not shown), the trusted node carries the token and the interface address of the trusted node and initiates a registration request to the acquired registration interface of the service node to be registered.

[0084] Step S301 (not shown): the service node receives, through a registration interface, a registration request initiated by the trusted node carrying the token and the interface address of the trusted node.

[0085] Steps S302 (not shown), step S204 (not shown), step S303 (not shown), step S304 (not shown), step S205 (not shown), step S206 (not shown) and step S305 (not shown) executed in sequence correspond to the above-mentioned steps S32 (not shown), step S24 (not shown), step S33 (not shown), step S34 (not shown), step S25 (not shown), step S26 (not shown) and step S35 (not shown) executed in sequence, respectively. Step S306 (not shown) is not repeated here. The service node returns the response information indicating successful registration to the trusted node again.

[0086] Step S207 (not shown), the trusted node returns the response information indicating successful registration to the requesting end.

[0087] Step S102 (not shown), the requesting end receives response information returned by the trusted node indicating successful registration.

[0088] Through the above steps S101 and S102, steps S201 to S207, and steps S301 to S306, in the proxy mode, when the requesting end wants to register the service node of the network service, the requesting end initiates a registration request to the trusted node, and the trusted node of the proxy forwards it to the service node, so that the registration and synchronization of the service node to be registered can be completed at the service node and the trusted node, and a trusted network service is used as a registration center or authentication service for a series of service nodes to provide request authorization, access control, service discovery and other services, and is not dependent on specific technical implementations. Any service registration and access control logic can be written in the trusted node, and can be provided to administrator users for dynamic regulation; at the same time, the use of atomic transaction functions provides a guarantee for the atomicity of the registration operation of the service registration, ensuring that the trusted node and the service node simultaneously complete the service registration and the metadata storage of each other.

[0089] In this embodiment, after the trusted node executes step S205 (not shown), if the registration synchronization of the service node fails, the trusted node returns response information indicating the registration failure to the service node, so that after receiving the response information indicating the registration failure, the service node performs a transaction rollback or compensation operation on the transaction storing the identifier of the service node and the identifier of the trusted node in the function using the atomic transaction, and returns the response information indicating the registration failure to the trusted node again; after receiving the response information indicating the registration failure returned by the service node, the trusted node The response information indicating the registration failure is returned to the requesting end; the requesting end receives the response information indicating the registration failure returned by the service node, thereby realizing that when the service registration fails in the proxy mode, the service node and the trusted node can be restored to an unchanged state, further ensuring data consistency and the atomicity of the change, and forwarding the response information indicating the registration failure through the trusted node and returning it to the requesting end, so that the requesting end can understand the failure of the registration operation and the synchronization operation of the service node to be registered through the received response information indicating the registration failure, thereby achieving the purpose of notifying the requesting end.

[0090] In a preferred embodiment of the present application, inconsistency recovery (registration failure) is also required. Although the present application ensures data synchronization of registration operations from a mechanism perspective, if an extreme situation occurs (such as the service node crashes before the last step of submitting the transaction), or if the database administrator of the service node S deletes the data by mistake, data in the service node and the trusted node may be out of sync.

[0091] At this time, since the trusted node still saves all the information and credentials of the service node S, restoring registration only requires the administrator to use the standard interface address of the accidentally deleted service node S in the request client installed with the request program C to re-initiate the registration process to restore the registration. The specific process is:

[0092] After receiving the request, the trusted node M detects that the standard interface address provided in the request has been registered as a service node S, and the requesting administrator has the authority to the service node. It will no longer generate a new service node identifier, but instead generate a token to store the identifier of the registered service node S, the key and the credential information of all node administrators in correspondence, and return the token to the requesting program C. The subsequent steps (after step S23) are the same, except that in step S25, when the trusted node M detects that the stored service node identifier has been stored, it will no longer perform the storage operation, but directly return a successful response to the service node S. The principle is to turn the entire synchronization operation into an idempotent operation (multiple executions and one execution will obtain the same state and result), so that in multiple retries (if failures or erroneous operations occur), as long as one retry is successful, the data state will be restored to a consistent state.

[0093] Following the above-mentioned embodiment of the present application, in a service registration method between network services provided in the present application example, whether in non-proxy mode or proxy mode, in order to ensure the security and low intrusion of service registration, the registration request received by the service node from the requesting end or the trusted node also carries: the registration password of the service node provided by the visitor; wherein, before the service node initiates a second request to the interface address of the trusted node through the registration interface carrying the token, the method further comprises:

[0094] The service node needs to compare the registration password of the service node provided by the visitor carried in the registration request with the registration password of the service node stored locally to see whether they are consistent;

[0095] The initiating a second request to the interface address of the trusted node by carrying the token through the registration interface specifically includes:

[0096] Only when the registration password of the service node provided by the visitor and carried in the registration request is consistent with the registration password of the service node stored locally, a second request is initiated to the interface address of the trusted node through the registration interface carrying the token, so that a registration password is automatically set at the service node and stored locally. When registering for the service, the visitor also needs to enter the registration password of the service node correctly (that is, the service node S verifies when it receives the registration request initiated by the request program C or forwarded by the trusted node). Only when it is verified that the registration password of the service node carried in the registration request is consistent with the registration password stored locally at the service node, a request can be initiated to the trusted node through the registration interface, which can prevent the standard interface address of the service node to be registered from being leaked and abused by attackers to perform invalid registration, thereby enhancing the security of service registration.

[0097] Following the above embodiment of the present application, in a service registration method between network services provided in the present application example, whether in non-proxy mode or in proxy mode, in order to enhance the security of service registration, the method further includes:

[0098] The service node, in response to receiving the response information returned by the trusted node indicating successful registration, sets the state of the trusted node corresponding to the identifier of the trusted node stored in the function using the atomic transaction to a disabled state.

[0099] It should be noted that the service node will store the registered trusted node information. To ensure security, after registration is completed, the service node will set the trusted node stored in the service node to an unenabled state (for example, it can be marked using database fields, etc.). Trusted nodes in an unenabled state cannot authorize access to the service node. The maintainer of the service node needs to log in to the server where the service node is located and manually enable the trusted node using system commands, etc. Only then can the trusted node authorize access to the service node, thereby ensuring the security of the service node. Only by having the server or database permissions of the service node can trust in the trusted node be established to avoid being attacked by attackers. At the same time, it also supports the disabling of trusted nodes. When there are security issues with the trusted node or the service node does not want to continue to be authorized by the trusted node to access, the trusted node can be disabled.

[0100] Following the above-mentioned embodiment of the present application, in a service registration method between network services provided in the present application example, whether in non-proxy mode or in proxy mode, the trusted node executes the synchronization request initiated by the service node carrying the token and the metadata of the service node through the synchronization interface, and verifies whether the token is valid. If so, the stored identifier of the service node and the identifier of the trusted node corresponding to the token are retrieved. After that, the method also includes: the trusted node deletes the storage of the token and its corresponding identifier of the service node and the identifier of the trusted node. In all embodiments of the present application, whether in non-proxy mode or proxy mode, in order to prevent the token from being replayed, after the trusted node receives the registration request initiated by the service node and takes out the stored identifier of the service node and the identifier of the trusted node corresponding to the token after the token is verified to be valid, the trusted node will also delete the token and its corresponding stored storage records of the identifier of the service node and the identifier of the trusted node corresponding to the token, that is, the token becomes invalid after being used, so that even if the attacker intercepts the token returned by the trusted node, he will not be able to replay the registration request, thereby effectively preventing request replay attacks and ensuring the security of service registration.

[0101] Following the above embodiment of the present application, in a service registration method between network services provided in the present application example, whether in a non-proxy mode or in a proxy mode, the method further includes:

[0102] When the trusted node generates a token, generates identity authority for the service node to be registered, and stores the identifier of the service node and the identifier of the trusted node corresponding to the token, the method further includes:

[0103] The trusted node configures a validity period for the identifier of the service node and the identifier of the trusted node corresponding to the stored token;

[0104] The trusted node verifies whether the token is valid, including:

[0105] The trusted node verifies whether the token is valid within the validity period.

[0106] Here, after storing the identifier of the service node and the identifier of the trusted node corresponding to the token, the validity period is also configured for the stored information, so that when the trusted node verifies whether the token is valid, it can verify whether the token is valid within the validity period. If it is no longer within the validity period, the token is invalid. If it is within the validity period, it indicates that the token is valid. Among them, the expression of the validity period can include but is not limited to the form of an expiration time, or the form of a maximum number of retrievals, etc. For example, the information corresponding to the stored token can be set with an expiration time. Most cache components (such as Redis, etc.) support directly configuring an expiration time, or use other methods to store and record the storage time, and use background tasks to clean up expired records. The expiration time can be configurable, or it can be adjusted according to factors such as network environment delays, etc.; for example, in addition to setting the expiration time, the information corresponding to the stored token can also be set with a maximum number of retrievals. For example, it can only be retrieved twice during the service registration process, that is, the maximum number of retrievals is preferably twice, which is retrieved when registering the service on the service node and used in the service node. The identifier of the service node and the identifier of the trusted node are stored in the function of the subtransaction, and the identifier of the trusted node, the identifier of the service node and the meta-information are retrieved when the service registration of the service node is synchronized on the trusted node and stored in the function of the atomic transaction on the trusted node. Retrieval operations that exceed the maximum number of retrievals or the expiration time are illegal. In implementation, a remaining number of retrievals can be set in the storage, which is set to the maximum number of retrievals of the record during initial writing, and the remaining number of retrievals is reduced by 1 each time it is read. In the process of service registration between network services of the present application, the initiator of each token retrieval request is basically determined, and the initiator of the retrieval operation can be verified according to the remaining number of retrievals, such as verifying the network service according to the service key, and deleting the corresponding stored record when the remaining number of retrievals is 0.

[0107] In a preferred embodiment of the present application, in non-proxy mode, a schematic diagram of the actual operation flow of a service registration method between network services provided by the present application is as follows: Figure 1 As shown, a requesting program C is installed in the requesting end, the service node of the network service to be registered initiated by the requesting program C is the service node S, and another network service trusted by the requesting program C and the service node S is the trusted node M. The following describes the specific steps of the actual application scenario of the service registration method between network services in the non-proxy mode, centering on a registration operation and a registration synchronization operation that require service registration:

[0108] Step 1: The registration process of the service node S is initiated by the requesting program C, which carries the visitor's identity and the registration interface of the service node to be registered, and requests the token production interface provided by the trusted node M for service registration.

[0109] Step 2: After receiving the request, the trusted node M verifies whether the visitor has the authority to register for the service. If not, the request is rejected and a failure response is returned. If yes, a credential for storing information is generated: a token, and at least the following information is stored:

[0110] Generate identity authority for the service node to be registered, where the identity authority includes but is not limited to the identifier and key of the service node to be registered;

[0111] The identity of the trusted node M;

[0112] The maximum number of retrievals for the stored information is set to 2, and the token of the stored information and the interface address of the trusted node M are returned to the requesting program C.

[0113] Step 3: The requesting program C carries the interface address and token of the trusted node M returned by the trusted node M and requests the registration interface of the service node S.

[0114] Step 4: After receiving the registration request initiated by the requesting program C, the service node S carries the token token and requests the token consumption interface corresponding to the interface address of the trusted node M.

[0115] Step 5. After receiving the request initiated by the service node, the trusted node M checks whether the token carried in the request is valid. If it is invalid, the request is rejected and a failure response is returned. If it is valid, the remaining number of retrievals corresponding to the stored information is reduced by 1, and the corresponding stored information is retrieved: the service node to be registered generates the identity authority and the identifier of the trusted node M, and returns it to the service node S.

[0116] Step 6: After the service node S receives the response content returned by the trusted node, if the response is successful, the service node identifier and the trusted node identifier M in the response content are processed and stored in the function using the atomic transaction, and the following steps are performed:

[0117] Step 7: The service node S carries the token token and the meta information of the service node S (including but not limited to the interface address, name and standard interface address of the service node, etc.), and requests the synchronous interface for the service node registration operation corresponding to the interface address of the trusted node M.

[0118] Step 8. After receiving the request from the service node, the trusted node M checks whether the token carried in the request is valid. If it is invalid, the request is rejected and a failure response is returned. If it is valid, the corresponding storage information is retrieved and deleted: the ID of the service node and the ID of the trusted node M. In the function using atomic transactions, the ID of the service node and the ID of the trusted node M are persistently stored together with the meta-information sent by the service node S, and the result of whether the trusted node has successfully synchronized the service registration is returned to the service node S as the response status.

[0119] Step 9. After the service node S receives the response returned by the trusted node M, if the response is successful, the service registration transaction of the service node identifier and the trusted node M identifier stored in step 6 is committed; otherwise, the service registration transaction is rolled back or compensated, and the result of whether the trusted node has successfully synchronized the service registration is returned to the requesting program C as the response status.

[0120] In the actual application scenario under the proxy mode, the trusted node M does not return the token token of the stored information and the interface address of the token consumption interface of the trusted node M to the requesting program C in step 2, but directly performs the behavior of the requesting program in the non-proxy mode in step 3, that is, carries the token token and the interface address of the token consumption interface of the trusted node M to the service node S; the service node S returns the result of whether the trusted node has successfully synchronized the service registration to the trusted node M as a response status in step 9, and the trusted node M returns it to the requesting program C as a response to the request of the requesting program C in step 1, thereby realizing the service registration and service registration synchronization operation in the normal mode.

[0121] Following the above-mentioned embodiment of the present application, the service node can also register itself. In general, the registration operation is initiated by the user in the request program C, but a method for the service node to complete the registration by itself can also be provided. For example, the premise of the service self-registration is to configure the interface address of a trusted node M by using command line input, configuration file, etc., so that the service node S can send a request to the trusted node M. Among them, the difference between the process of the self-registration of the service node and the service registration method between network services in non-proxy mode is that the service node S also acts as the process role of the request program C to initiate the registration request, and step 3 is omitted, because the request program is the service node S, and there is no need to send a request. The service node S can directly execute the logic of step 4, which is more convenient and simple, and also enables the service registration to be initiated by the request program of the request end (that is, it can be initiated by the administrator in the service registration management interface, etc.), or by the service node itself, further improving the ease of use and convenience of service registration.

[0122] In a preferred embodiment of the present application, in non-proxy mode, a schematic diagram of the actual operation flow of a service registration method between network services provided by an embodiment of the present application is as follows: Figure 1 As shown, a requesting program C is installed in the requesting end, the service node of the network service to be registered is the service node S2, and the network service trusted by the requesting program C is the trusted node M. The actual application scenario of the service registration method between network services in the non-proxy mode is described in detail below:

[0123] The example is a process in which the client corresponding to the user registers a new service node as a request program C. Assume that the registration interface of the service node to be registered is https: / / new-service.com / api / ops. This path needs to be entered by the user into the registration management platform, that is, the client's request program C, during registration, so as to initiate a registration request in step 3.

[0124] First, the requesting program C carries the visitor's identity and the registration interface of the service node to be registered and sends a request to the trusted node M, indicating that a registration request is required. The necessary information of the request can be expressed as the following code:

[0125] url="https: / / manage.com / api / action / token / init"

[0126] method="POST"

[0127] The trusted node M will verify whether the requesting user has the authority to register a new service node. If so, a token will be generated, and identity permissions (such as identification and key) will be generated for the node to be registered. The pseudo code example used by the trusted node is as follows:

[0128]

[0129]

[0130] The requester C carries the token and initiates a registration request to the registration interface of the new service node. It needs to carry the interface address of the token consumption interface of the trusted node and the returned token (assuming it is XYZ). The specific implementation code is as follows:

[0131] ur1="https: / / new-service.com / api / ops / register"

[0132] method="POST"

[0133] data = {

[0134] "manage_api":"https: / / manage.com / api / action"

[0135] }

[0136] headers={

[0137] "X-Operations-Token":"XYZ"

[0138] }

[0139] After receiving the request, the service node S sends a request to retrieve the data to the trusted node M with the token and the registration password of the service node. The specific implementation code is as follows:

[0140] ur1="https: / / manage.com / api / action / token / retrieve"

[0141] method="POST"

[0142] headers={

[0143] "X-Operations-Token":"XYZ"

[0144] }

[0145] The information used to register the service will be retrieved, such as the identity authority generated for the service node to be registered and the identifier of the trusted node. An example is as follows:

[0146] {

[0147] "node_id":"s2",

[0148] "node_secret":"S2_SECRET_KEY"

[0149] "admin_1ist":[{

[0150] "id":"A2",

[0151] "access_key":"A2_ACCESS_KEY",

[0152] "secret_key":"A2_SECRET_KEY",

[0153] }]

[0154] }

[0155] Among them, the initiating user A2 has registered in the trusted node M and is the administrator of the service node S2 to be registered. S2 is the identity identifier in the identity authority generated by the trusted node for the service node S. Generally, a random string can be used as the identity identifier of the service node. The random string can not only be used to identify the service node in the trusted node, but also for the service node, this random string can also be used as an identifier of the trusted node. Other methods can also be used, as long as the trusted node identifies the service node and the service node identifies the trusted node.

[0156] The service node S will perform information storage and synchronization with the trusted node in the function using atomic transactions: the identity authority generated by the service node to be registered and the identity of the trusted node, which can be expressed in pseudo code as follows:

[0157] def register_node(data,manage_api,token):

[0158] try:

[0159] start transaction #Start database transaction

[0160] do_register(data) #Register using the retrieved data

[0161] resp = sync_to_manage_node (manage_api, token) #Synchronize to the trusted node

[0162] if not resp.success:#If the trusted node operation fails, an error is thrown and the transaction is rolled back

[0163] raise

[0164] commit_transaction()#Commit database transaction

[0165] except Exception:

[0166] ro11back_transaction()#Rollback database transaction

[0167] After the registration operation is successful, a synchronization request for this operation is sent to the trusted node M. Assuming that the subpath of the synchronization operation of the registration service node is add_node, the synchronization request will send the standard interface address and instance of the new service node. The sample code is as follows:

[0168] ur1="https: / / manage.com / api / action / add_node"

[0169] method="POST"

[0170] data = {

[0171] "api":"https: / / new-service.com / api / ops",

[0172] "instances":[{

[0173] "id":1,

[0174] "connected":true

[0175] }, {

[0176] "id":2,

[0177] "connected":false

[0178] }]

[0179] }

[0180] headers={

[0181] "X-Service-Node-Secret":"SECRET_KEY",

[0182] "X-Operations-Token":"XYZ"

[0183] }

[0184] After receiving the request, the trusted node uses the token to retrieve the synchronous registration data of the operation from the storage: the identity authority generated by the service node to be registered and the identifier of the trusted node, and performs the corresponding registration synchronization operation in the function using the atomic transaction, that is, using the synchronous data to register the new service node, which is consistent with the data of the service node.

[0185] In the embodiment of the present application, when the requesting end is the service node to be registered itself, that is, the service node to be registered assumes the two roles of the requesting end and the service node in the process of the present application, in order to verify the validity of the interface address provided by the service node, the trusted node will force the request to be processed as a proxy mode request (regardless of whether it meets the general proxy request conditions), that is, after the token is produced, it carries the token to request the registration interface provided by the service node, and completes the subsequent process, so that if the interface address provided by the service node is invalid, or is the address of other services, then it cannot complete its own registration. In addition, when the requesting end is another registered service node or a gateway of a cluster service, the service of the requesting end stores (or can access) the information of the service node to be registered. The effect to be achieved is that when one of the service nodes in the cluster that uses the same storage (cluster internal registration center / shared configuration) is registered with the trusted node, other unregistered service nodes can be quickly and conveniently registered with the trusted node.

[0186] After the registered service node responds to the administrator's operation (such as executing a command on the command line), it initiates registration for other unregistered service nodes. Take registering one of the service nodes as an example:

[0187] Registered Node C

[0188] Node to be registered S

[0189] Trusted Node M

[0190] The registered node C acts as the requesting end in the process of this application and initiates the corresponding registration request. It needs to carry the standard interface address of the node S to be registered that can be accessed by the trusted node. The trusted node will force the request to be processed as a proxy mode request. When the process of this application is successfully executed, the registration status of the service node S to be registered for the target trusted node M in the shared storage in the cluster will be changed to registered, and the whole process is atomic (at the same time, because C and S use the same storage, C can determine whether the registration is successful through the registration status of S).

[0191] In an actual implementation of a microservice cluster, the business storage of each service is often independent, but the cluster can be configured with the same standard storage to store the metadata required for service management such as the registration status of the service, so that services using the same storage can share this information, and using the same storage often means that services can trust each other, so some security measures can be appropriately reduced, such as registration without a service password, and if the registered service node enables the trusted node, the service node to be registered will also directly enable the trusted node after registration, which can reduce repeated operations. This process is the same for all unregistered nodes and can be executed in parallel. Failed registration requests can also be retried multiple times, because the trusted node provides idempotence protection for the registration operation, and the standard interface address of the registered node can be used as an identifier to distinguish them.

[0192] According to another aspect of the present application, a non-volatile storage medium is provided, on which computer-readable instructions are stored. When the computer-readable instructions can be executed by a processor, the processor implements the service registration method between network services as described above.

[0193] According to another aspect of the present application, a service node for service registration between network services is also provided, the service node comprising:

[0194] one or more processors;

[0195] A computer readable medium for storing one or more computer readable instructions,

[0196] When the one or more computer-readable instructions are executed by the one or more processors, the one or more processors implement the service registration method between network services at the service node end as described above.

[0197] Here, for the detailed contents of each embodiment of the service node for service registration between network services, please refer to the corresponding part of the embodiment of the service registration method between network services at the service node end, which will not be described in detail here.

[0198] According to another aspect of the present application, a trusted node for service registration between network services is also provided, the trusted node comprising:

[0199] one or more processors;

[0200] A computer readable medium for storing one or more computer readable instructions,

[0201] When the one or more computer-readable instructions are executed by the one or more processors, the one or more processors implement the above-mentioned service registration method between trusted node-side network services.

[0202] Here, for the detailed contents of each embodiment of the trusted node for service registration between network services, please refer to the corresponding part of the embodiment of the service registration method between network services at the trusted node end, which will not be described in detail here.

[0203] According to another aspect of the present application, there is also provided a request end for service registration between network services, the request end comprising:

[0204] one or more processors;

[0205] A computer readable medium for storing one or more computer readable instructions,

[0206] When the one or more computer-readable instructions are executed by the one or more processors, the one or more processors implement the service registration method between request-side network services as described above.

[0207] Here, for the detailed contents of each embodiment of the requesting end of the service registration between network services, please refer to the corresponding part of the embodiment of the service registration method between network services on the requesting end, which will not be repeated here.

[0208] In summary, the present application combines the requesting end, the trusted node and the service node, so that the service node receives the registration request initiated by the requesting end or the trusted node carrying the token and the interface address of the trusted node through the registration interface; wherein, the token is received by the trusted node through the token production interface after the requesting end carries the identity identifier of the visitor and the first request initiated by the registration interface of the service node to be registered, and verifies whether the visitor has the authority to register for the service. If so, it generates, wherein the trusted node also generates identity authority for the service node to be registered, and stores the identifier of the service node and the identifier of the trusted node corresponding to the token; the service node carries the token through the registration interface to initiate a second request to the interface address of the trusted node, so that the trusted node verifies whether the token is valid. If so, it retrieves the stored identifier of the service node and the identifier of the trusted node corresponding to the token and returns them; the service node receives the identifier returned by the trusted node The service node carries the token and the meta-information of the service node to initiate a synchronization request to the synchronization interface of the trusted node, so that the trusted node verifies whether the token is valid. If so, the stored identifier of the service node and the identifier of the trusted node corresponding to the token are retrieved, and the identifier of the trusted node, the identifier of the service node and the meta-information are stored in the function using atomic transactions. The service node receives the response information returned by the trusted node indicating a successful registration, and in the function using atomic transactions, submits the transaction storing the identifier of the service node and the identifier of the trusted node, and returns the response information indicating a successful registration to the requesting end, or returns it to the trusted node so that the trusted node forwards the response information indicating a successful registration to the requesting end. It realizes the use of a trusted network service as the registration center or authentication service for a series of service nodes, providing request authorization, access control, service discovery and other services, and is not dependent on specific technical implementations. Any service registration and access control logic can be written in the trusted node, and can be provided to administrators for dynamic regulation. At the same time, the use of atomic transaction functions provides a guarantee for the atomicity of the registration operation of the service registration, ensuring that the trusted node and the service node complete the service registration and the metadata storage of each other at the same time.

[0209] It should be noted that the present application can be implemented in software and / or a combination of software and hardware, for example, can be implemented using an application specific integrated circuit (ASIC), a general purpose computer or any other similar hardware device. In one embodiment, the software program of the present application can be executed by a processor to implement the steps or functions described above. Similarly, the software program of the present application (including relevant data structures) can be stored in a computer-readable recording medium, for example, a RAM memory, a magnetic or optical drive or a floppy disk and similar devices. In addition, some steps or functions of the present application can be implemented using hardware, for example, as a circuit that cooperates with a processor to perform each step or function.

[0210] In addition, a part of the present application may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present application through the operation of the computer. The program instruction for calling the method of the present application may be stored in a fixed or removable recording medium, and / or transmitted through a data stream in a broadcast or other signal-bearing medium, and / or stored in a working memory of a computer device that runs according to the program instruction. Here, according to an embodiment of the present application, a device is included, the device including a memory for storing computer program instructions and a processor for executing program instructions, wherein, when the computer program instruction is executed by the processor, the device is triggered to run the method and / or technical solution based on the aforementioned multiple embodiments according to the present application.

[0211] It is obvious to those skilled in the art that the present application is not limited to the details of the above exemplary embodiments, and that the present application can be implemented in other specific forms without departing from the spirit or basic features of the present application. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-restrictive, and the scope of the present application is limited by the attached claims rather than the above description, so it is intended to include all changes that fall within the meaning and scope of the equivalent elements of the claims in the present application. Any figure mark in the claims should not be regarded as limiting the claims involved. In addition, it is obvious that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the device claim can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.

Claims

1. A service registration method between network services, applied to a service node, wherein: The method comprises: The registration interface receives a registration request initiated by a requesting end or a trusted node carrying a token and an interface address of the trusted node; wherein the token is received by the trusted node through a token production interface after the requesting end carries the identity identifier of the visitor and the first request initiated by the registration interface of the service node to be registered, and verifies whether the visitor has the authority to register for the service, and if so, generates a node identifier for the service node to be registered, and stores the identifier of the service node corresponding to the token and the identifier, key and authority of the administrator who has the authority to register for the service to be registered; Initiate a second request to the interface address of the trusted node by carrying the token through the registration interface, so that the trusted node verifies whether the token is valid, and if so, retrieves the stored identifier and administrator data of the service node corresponding to the token and returns them; receiving the identification of the service node and administrator data returned by the trusted node, and storing them together with the interface address of the trusted node in a function using atomic transactions; Initiate a synchronization request to the synchronization interface of the trusted node with the token and the meta-information of the service node, so that the trusted node verifies whether the token is valid. If so, retrieve the stored identifier of the service node and the identifier of the trusted node corresponding to the token, and store the identifier and meta-information of the service node in the function using the atomic transaction; receiving response information returned by the trusted node indicating successful registration, and submitting a transaction storing the identifier of the service node and the identifier of the trusted node in a function using an atomic transaction; Returning the response information indicating successful registration to the requesting end, or returning it to the trusted node so that the trusted node forwards the response information indicating successful registration to the requesting end; Wherein, the method further comprises: receiving response information returned by the trusted node indicating registration failure, and performing a transaction rollback or compensation operation on a transaction storing the identifier of the service node and the identifier of the trusted node in a function using an atomic transaction; The response information indicating the registration failure is returned to the requesting end, or returned to the trusted node so that the trusted node forwards the response information indicating the registration failure to the requesting end.

2. The method according to claim 1, wherein: The registration request also carries the registration password of the service node provided by the visitor; Before initiating a second request to the interface address of the trusted node by carrying the token through the registration interface, the method further includes: comparing the registration password of the service node provided by the visitor and carried in the registration request with the registration password of the service node stored locally to see whether they are consistent; The initiating a second request to the interface address of the trusted node by carrying the token through the registration interface includes: When the registration password of the service node provided by the visitor and carried in the registration request is consistent with the registration password of the service node stored locally, a second request is initiated to the interface address of the trusted node through the registration interface carrying the token.

3. The method according to claim 1 or 2, wherein: The method further comprises: In response to receiving response information returned by the trusted node indicating successful registration, the state of the trusted node corresponding to the identifier of the trusted node stored in the function using the atomic transaction is set to a disabled state.

4. A service registration method between network services, applied to a trusted node, wherein: The method comprises: Receiving, through a token production interface, a first request initiated by a requester carrying an identity identifier of a visitor and a registration interface of a service node to be registered; Verify whether the visitor has the authority to register for the service. If so, generate a token, generate an identifier for the service node to be registered, and store the identifier of the service node corresponding to the token, the node administrator's identity, authority, and the interface address of the trusted node; Sending the token and the interface address of the trusted node to the requesting end, so that the requesting end carries the token and the interface address of the trusted node to initiate a registration request to the acquired registration interface of the service node to be registered, wherein the service node initiates a second request to the interface address of the trusted node through the registration interface carrying the token; Receiving, through the token consumption interface, a second request initiated by the service node carrying the token, and verifying whether the token is valid; if so, taking out the stored identifier of the service node corresponding to the token and returning it to the service node, so that the service node stores the identifier of the service node and the identifier of the trusted node in the function using the atomic transaction, and carrying the token and the meta-information of the service node to initiate a synchronization request to the synchronization interface of the trusted node; Receiving, through the synchronization interface, a synchronization request initiated by the service node carrying the token and the meta-information of the service node, and verifying whether the token is valid, and if so, retrieving the stored identifier of the service node and the identifier of the trusted node corresponding to the token, and storing the identifier of the trusted node, the identifier of the service node and the meta-information in a function using an atomic transaction; If the registration synchronization of the service node is successful, return response information indicating successful registration to the service node, so that the service node submits the transaction storing the identifier of the service node and the identifier of the trusted node in the function using the atomic transaction; after the transaction is successfully submitted, return the response information indicating successful registration to the requesting end; If the registration synchronization of the service node fails, response information indicating the registration failure is returned to the service node, so that the service node, in the function using the atomic transaction, performs a transaction rollback or compensation operation on the transaction storing the identity authority of the service node and the identifier of the trusted node, and returns the response information indicating the registration failure to the requesting end.

5. A service registration method between network services, applied to a requesting end, wherein: The method comprises: Initiate a first request to the trusted node with the visitor's identity and the registration interface of the service node to be registered, so that the trusted node verifies whether the visitor has the right to register the service through the token production interface. If so, generate a token to generate identity authority for the service node to be registered, store the service node identifier and the trusted node identifier corresponding to the token, and send the token and the interface address of the trusted node to the requesting end; Receiving the token returned by the trusted node and the interface address of the trusted node; Carrying the token and the interface address of the trusted node, a registration request is initiated to the registration interface of the service node to be registered, so that the service node initiates a second request to the interface address of the trusted node through the registration interface with the token; wherein the trusted node verifies whether the token is valid, and if so, retrieves the stored identification and administrator data of the service node corresponding to the token and returns them to the service node; the service node stores the identification of the service node, the interface address and administrator information of the trusted node in a function using atomic transactions, and initiates a synchronization request to the synchronization interface of the trusted node with the token and the meta-information of the service node; The trusted node verifies whether the token is valid. If so, the stored identifier of the service node and the identifier of the trusted node corresponding to the token are retrieved, and the identifier of the trusted node, the identifier of the service node and the meta-information are stored in the function using the atomic transaction. If the registration synchronization of the service node is successful, response information indicating successful registration is returned to the service node. After receiving the response information indicating successful registration returned by the trusted node, the service node submits the transaction storing the identifier of the service node and the identifier of the trusted node in the function using the atomic transaction, and returns the response information indicating successful registration to the requesting end. Receive response information returned by the service node indicating successful registration.

6. A non-volatile storage medium having computer-readable instructions stored thereon, wherein when the computer-readable instructions are executable by a processor, the processor is enabled to implement the method according to any one of claims 1 to 5.

7. A service node for service registration between network services, the service node comprising: one or more processors; A computer readable medium for storing one or more computer readable instructions, When the one or more computer-readable instructions are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 3.

8. A trusted node for service registration between network services, the trusted node comprising: one or more processors; A computer readable medium for storing one or more computer readable instructions, When the one or more computer-readable instructions are executed by the one or more processors, the one or more processors implement the method as claimed in claim 4.

9. A request end for service registration between network services, the request end comprising: one or more processors; A computer readable medium for storing one or more computer readable instructions, When the one or more computer-readable instructions are executed by the one or more processors, the one or more processors implement the method as claimed in claim 5.