CN111200560B - Microservice registration method, microservice registration device, microservice registration equipment and storage medium - Google Patents

Microservice registration method, microservice registration device, microservice registration equipment and storage medium Download PDF

Info

Publication number
CN111200560B
CN111200560B CN201911365923.6A CN201911365923A CN111200560B CN 111200560 B CN111200560 B CN 111200560B CN 201911365923 A CN201911365923 A CN 201911365923A CN 111200560 B CN111200560 B CN 111200560B
Authority
CN
China
Prior art keywords
registration
address
request information
center
micro
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911365923.6A
Other languages
Chinese (zh)
Other versions
CN111200560A (en
Inventor
翟岳辉
刘亚猛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Life Insurance Company of China Ltd
Original Assignee
Ping An Life Insurance Company of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Life Insurance Company of China Ltd filed Critical Ping An Life Insurance Company of China Ltd
Priority to CN201911365923.6A priority Critical patent/CN111200560B/en
Publication of CN111200560A publication Critical patent/CN111200560A/en
Application granted granted Critical
Publication of CN111200560B publication Critical patent/CN111200560B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/083Network architectures or network communication protocols for network security for authentication of entities using passwords
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/51Discovery or management thereof, e.g. service location protocol [SLP] or web services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • H04L67/63Routing a service request depending on the request content or context

Abstract

The invention relates to the technical field of cloud, and discloses a micro-service registration method, a device, equipment and a storage medium, wherein a shuffling algorithm is used for disorganizing a registration address of a registration center, and the registration of micro-service is carried out after the registration address of the registration center is stored in a local database, so that the use efficiency of the registration center is improved, and the method comprises the following steps: acquiring a registration address of a registration center, and scrambling the registration address through a shuffling algorithm to obtain a scrambled registration address; receiving registration request information sent by the micro-service by using the scrambled registration address; if the registration request information is successfully received, adding the registration request information into a routing table carried by a registration center; if the registration request information is not successfully received, the registration address is added to a preset unavailable list carried by the micro-service, and the registration request information is received in other registration centers except the local registration center until the registration request information is successfully received in the other registration centers.

Description

Microservice registration method, microservice registration device, microservice registration equipment and storage medium
Technical Field
The invention relates to the technical field of cloud, in particular to a micro-service registration method, a device, equipment and a storage medium.
Background
The microservice architecture is a specific mode for designing a software application program into an independently deployable service suite, and is a method for developing a single application program as a set of small services, wherein each application program runs in a process of the microservice architecture and communicates with a lightweight mechanism, and microservices are constructed around business functions and can be independently deployed through a full-automatic deployment mechanism.
At present, the industry mostly adopts a centralized distributed service architecture, a service provider registers a micro service in a registration center of a server, and a service consumer acquires an address list of the micro service from a routing table carried by the registration center, so that the mode of acquiring the address of the micro service is centralized and rapid.
However, when all the microservices are registered in one registry, the pressures shared by the registries are large, a large amount of network resources are consumed, and the whole system is paralyzed, so that the microservices cannot complete the registration of addresses, and meanwhile, the microservices addresses in the whole registry cannot be adopted.
Disclosure of Invention
The invention provides a micro-service registration method, a micro-service registration device, a micro-service registration equipment and a storage medium, which are used for solving the problem that a registration center of a server fails when a micro-service registers an address, and improving the use efficiency of the registration center.
A first aspect of an embodiment of the present invention provides a method for registering a microservice, including: acquiring a registration address of a registration center, and scrambling the registration address through a shuffling algorithm to obtain a scrambled registration address; receiving registration request information sent by the micro-service by using the scrambled registration address, wherein the registration request information comprises a key to be verified; if the registration request information is successfully received, adding the registration request information into a routing table carried by the registration center; and if the registration request information is not successfully received, adding the registration address into a preset unavailable list carried by the microservice, and receiving the registration request information in other registration centers except the local registration center until the registration request information is successfully received in the other registration centers.
Optionally, in a first implementation manner of the first aspect of the embodiment of the present invention, a first arranged registration address in the scrambled registration addresses is obtained, and an address of a micro service is added in a routing table carried by a first registration center, where the first arranged registration address is an address corresponding to the first registration center; sending a detection data packet to the micro-service through the first registration center within a preset time length; and receiving a detection response data packet fed back by the micro-service according to the detection data packet, and acquiring registration request information sent by the micro-service in the first registration center, wherein the registration request information comprises a key to be verified.
Optionally, in a second implementation manner of the first aspect of the embodiment of the present invention, a first arranged registration address in the scrambled registration addresses is obtained, where the first arranged registration address is an address corresponding to a first registration center; judging whether the first arranged registration address is in a local database; if the first arranged registration address is not in the local database, storing a routing table carried by the first registration center in the local database, and adding a micro-service address in the routing table carried by the first registration center; and if the first arranged registration address is in the local database, adding the address of the micro service in a routing table carried by the first registration center.
Optionally, in a third implementation manner of the first aspect of the embodiment of the present invention, if the micro service receives the probe data packet, the probe response data packet fed back by the micro service is received, and registration request information sent by the micro service is obtained in the first registration center, where the registration request information includes a key to be verified; and if the micro service does not receive the detection data packet, deleting the address of the micro service in a routing table carried by the first registration center.
Optionally, in a fourth implementation manner of the first aspect of the embodiment of the present invention, in the first registration center, it is determined whether a key to be verified is the same as a preset key; and if the key to be verified is the same as the preset key, successfully receiving the registration request information, and adding the registration request information into a routing table carried by the first registration center.
Optionally, in a fifth implementation manner of the first aspect of the embodiment of the present invention, if the key to be verified is different from the preset key, the registration request information is not successfully received, and the first arranged registration address is added to a preset unavailable list carried by the microservice; acquiring a second arranged registration address in the disordered registration addresses, wherein the second arranged registration address is an address corresponding to a second registration center; in the second registration center, receiving the registration request information sent by the microservice, and if the second registration center successfully receives the registration request information, adding the registration request information to a routing table carried by the second registration center; if the second registration center does not successfully receive the registration request information, adding the registration address of the second registration center into a preset unavailable list carried by the micro service, and receiving the registration request information in a third registration address arranged in the disturbed registration address until the registration request information is successfully received in the registration center.
Optionally, in a sixth implementation manner of the first aspect of the embodiment of the present invention, registration addresses of n registration centers are obtained in sequence, where n is a natural number; generating a random number x, acquiring a registration address of a bit column xth, and interchanging the registration address of the bit column xth and the registration address of the bit column nth as a registration address with the first last permutation, wherein the value range of x is [0, n-1]; generating a random number y, acquiring a registration address of a bit column y, and interchanging the registration address of the bit column y and a registration address of a bit column n-1 as a registration address with the second to last permutation, wherein the value range of y is [0, n-2]; and obtaining the disordered registration addresses until outputting the registration addresses of the n registration centers.
A second aspect of the embodiments of the present invention provides a microservice registration apparatus, including: the system comprises a scrambling unit, a registration center and a sending unit, wherein the scrambling unit is used for acquiring a registration address of the registration center and scrambling the registration address through a shuffling algorithm to obtain a scrambled registration address; a receiving unit, configured to receive, by using the scrambled registration address, registration request information sent by the micro service, where the registration request information includes a key to be authenticated; a first adding unit, configured to add the registration request information to a routing table carried by the registration center if the registration request information is successfully received; and the second adding unit is used for adding the registration address to a preset unavailable list carried by the microservice if the registration request information is not successfully received, and receiving the registration request information in other registration centers except the local registration center until the registration request information is successfully received in the other registration centers.
Optionally, in a first implementation manner of the second aspect of the embodiment of the present invention, the receiving unit includes: an obtaining module, configured to obtain a first arranged registration address in the scrambled registration addresses, and add an address of a micro service in a routing table carried by a first registration center, where the first arranged registration address is an address corresponding to the first registration center; the sending module is used for sending a detection data packet to the micro-service through the first registration center within a preset time length; and the receiving module is used for receiving a detection response data packet fed back by the micro service according to the detection data packet and acquiring registration request information sent by the micro service in the first registration center, wherein the registration request information comprises a key to be verified.
Optionally, in a second implementation manner of the second aspect of the embodiment of the present invention, the obtaining module is specifically configured to: acquiring a first arranged registration address in the disordered registration addresses, wherein the first arranged registration address is an address corresponding to a first registration center; judging whether the first arranged registration address is in a local database or not; if the first arranged registration address is not in the local database, storing a routing table carried by the first registration center in the local database, and adding a micro-service address in the routing table carried by the first registration center; and if the first arranged registration address is in the local database, adding the address of the micro service in a routing table carried by the first registration center.
Optionally, in a third implementation manner of the second aspect of the embodiment of the present invention, the receiving module is specifically configured to: if the micro service receives the detection data packet, receiving a detection response data packet fed back by the micro service, and acquiring registration request information sent by the micro service in the first registration center, wherein the registration request information comprises a key to be verified; and if the micro service does not receive the detection data packet, deleting the address of the micro service in a routing table carried by the first registration center.
Optionally, in a fourth implementation manner of the second aspect of the embodiment of the present invention, the first adding unit is specifically configured to: in the first registration center, judging whether a key to be verified is the same as a preset key; and if the key to be verified is the same as the preset key, successfully receiving the registration request information, and adding the registration request information into a routing table carried by the first registration center.
Optionally, in a fifth implementation manner of the second aspect of the embodiment of the present invention, the second adding unit is specifically configured to: if the key to be verified is different from the preset key, the registration request information is not successfully received, and the first arranged registration address is added into a preset unavailable list carried by the microservice; acquiring a second arranged registration address in the disordered registration addresses, wherein the second arranged registration address is an address corresponding to a second registration center; in the second registration center, receiving the registration request information sent by the microservice, and if the second registration center successfully receives the registration request information, adding the registration request information to a routing table carried by the second registration center; if the second registration center does not successfully receive the registration request information, adding the registration address of the second registration center into a preset unavailable list carried by the micro service, and receiving the registration request information in a third registration address arranged in the disturbed registration address until the registration request information is successfully received in the registration center.
Optionally, in a sixth implementation manner of the second aspect of the embodiment of the present invention, the scrambling unit is specifically configured to: acquiring registration addresses of n registration centers in sequence, wherein n is a natural number; generating a random number x, acquiring a registration address of a bit column xth, and exchanging the registration address of the bit column xth with a registration address of the bit column nth to be used as a registration address with the first permutation reciprocal, wherein the value range of x is [0, n-1]; generating a random number y, acquiring a registration address of a bit column y, and interchanging the registration address of the bit column y and a registration address of a bit column n-1 as a registration address with the second to last permutation, wherein the value range of y is [0, n-2]; and obtaining the disordered registration addresses until outputting n registration addresses of the registration centers.
A third aspect of the embodiments of the present invention provides a micro-service registration apparatus, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the micro-service registration method according to any one of the foregoing embodiments when executing the computer program.
A fourth aspect of embodiments of the present invention provides a computer-readable storage medium having stored therein instructions, which, when run on a computer, cause the computer to perform the method of the first aspect described above.
According to the technical scheme, the embodiment of the invention has the following advantages:
in the embodiment of the invention, the registration addresses of the registration centers are disordered by using a shuffling algorithm, so that the micro-service selects the corresponding registration centers to register according to the sequence of the arrangement of the registration addresses, and the registration addresses of the registration centers are stored in the local database, thereby improving the use efficiency of the registration centers.
Drawings
FIG. 1 is a schematic diagram of an embodiment of a microservice registration method of the present invention;
FIG. 2 is a diagram of another embodiment of a method for microservice registration in the present invention;
FIG. 3 is a schematic diagram of an embodiment of a microservice registration apparatus of the present invention;
FIG. 4 is a schematic diagram of another embodiment of a microservice registration apparatus of the present invention;
FIG. 5 is a diagram of an embodiment of a microservice registration apparatus of the present invention.
Detailed Description
The invention provides a micro-service registration method, which is used for solving the problem that a registration center of a server is invalid when a micro-service registers an address, and improving the use efficiency of the registration center.
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be implemented in other sequences than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," or "having," and any variations thereof, are intended to cover non-exclusive inclusions, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Referring to fig. 1, an embodiment of a microservice registration method according to an embodiment of the present invention includes:
101. and acquiring the registration address of the registration center, and scrambling the registration address through a shuffling algorithm to obtain the scrambled registration address.
The server acquires the registration address of the registration center, and scrambles the registration address through a shuffling algorithm to obtain the scrambled registration address.
It should be explained that, the server uses shuffling algorithm to disorder the registration addresses of the registration centers, and then performs registration of the addresses of the micro-services, if the registration addresses of the registration centers are not scrambled, the registration addresses of the micro-services are all registered in the same registration center, so that the pressure of the registration centers is too high, normal access operation cannot be performed, and after the registration addresses of the registration centers are scrambled, the micro-services can be uniformly registered in the registration centers, and the situation that only one registration center is registered is not caused, so that the registration centers are invalid. The principle of the shuffling algorithm is to randomly take a number from the unprocessed data each time, and then place the data corresponding to the number at the end of the array, i.e. the data stored at the end of the array is the processed data.
102. And receiving registration request information sent by the micro service by using the disturbed registration address, wherein the registration request information comprises a key to be verified.
And the server receives registration request information sent by the micro-service by using the scrambled registration address, wherein the registration request information comprises a key to be verified.
When the micro service is started, the micro service is registered in a registration center of the server, that is, basic information of the micro service is reported in the registration center, wherein the basic information comprises an IP address of the micro service, an interface list of the micro service and the like. Because the routing table carried by the registry is stored in the memory of the server, the memory is also called an internal memory and is used for temporarily storing the operation data in the CPU and the data exchanged with external memories such as a hard disk and the like, as long as the computer is in operation, the CPU transfers the data needing to be operated into the memory for operation, after the operation is completed, the CPU transmits the result, the operation of the memory also determines the stable operation of the computer, that is, when the computer is powered off, the data in the memory is lost, therefore, the routing table carried by the registry is stored in a local database, that is, on a disk, the disk is a memory for storing data by using a magnetic recording technology, the disk is a main storage medium of the computer, a large amount of binary data can be stored, and the data can be kept from being lost even after the computer is powered off, so that the routing table carried by the registry is not lost. In addition, the registration request information includes a key to be verified in order to ensure the security of information transmission, when the micro service is registered, the key to be verified is used for matching with a preset key in the registration center to verify whether the micro service is a safe user, and the design ensures the security of micro service information transmission.
103. And if the registration request information is successfully received, adding the registration request information into a routing table carried by the registration center.
If the registration request information is successfully received, the server adds the registration request information to a routing table carried by a registration center. Specifically, in the first registration center, the server determines whether the key to be verified is the same as the preset key; and if the key to be verified is the same as the preset key, the server successfully receives the registration request information and adds the registration request information into a routing table carried by the first registration center.
It can be understood that, when the server determines whether the registration center successfully receives the registration request information sent by the micro service, the determination is made according to whether the key to be verified in the registration request information is the same as the preset key in the configuration center, and if the preset key is the same as the key to be verified, it indicates that the micro service address passes through the security detection of the configuration center, and the registration center can receive the registration request information sent by the micro service; if the preset key is different from the key to be verified, it indicates that the microservice address cannot pass the security detection of the configuration center, so that the registration center cannot receive the registration request information sent by the microservice. The preset key is obtained by a server through key derivation by acquiring an address of the micro service and an authentication key carried in a configuration center, the key to be verified is obtained by key derivation of the address of the micro service and a security key carried by the micro service, the security key is a key carried by the micro service, the server judges whether the preset key is the same as the key to be verified, namely judges whether the security key of the micro service end is the same as the authentication key, if the security key carried by the micro service end is the same as the authentication key of the registration center, the micro service passes the security monitoring of the configuration center, and the registration center can receive registration request information sent by the micro service.
It should be noted that a key derivation algorithm is utilized herein, and the key derivation algorithm is also called a key distribution algorithm, and is a deterministic algorithm for deriving a key from some secret values, for example: a double-length (one length key is 8 bytes) master key is arranged in the server, and the master key is used for performing decentralized processing on data to be encrypted to derive a double-length encryption key. The server uses the same key in both encryption and decryption, so that the two keys can simply be keys derived from each other.
104. If the registration request information is not successfully received, the registration address is added to a preset unavailable list carried by the micro-service, and the registration request information is received in other registration centers except the local registration center until the registration request information is successfully received in the other registration centers.
If the registration request information is not successfully received, the server adds the registration address to a preset unavailable list carried by the microservice, and receives the registration request information in other registration centers except the local registration center until the registration request information is successfully received in the other registration centers.
The preset unavailable list is set in the micro service in advance, when the micro service cannot be communicated with the first registration center, the first registration center is indicated to be unavailable, and the registration address corresponding to the first registration center is added into the preset unavailable list; then the server obtains a second registration address arranged in the disordered registration addresses, tries to communicate with a second registration center opposite to the second registration address arranged, and launches registration request information to the second registration center, wherein the process of receiving the registration request information by the second registration center is the same as the process of receiving the request information by the first registration center, and if the second registration center successfully receives the registration request information, the registration request information is added into a routing table carried by the second registration center to complete the registration of the micro-service; if the second registration center does not successfully receive the registration request information, the server firstly adds the second arranged registration address to a preset unavailable list carried by the micro service, then obtains a third arranged registration address in the disturbed registration address, and repeats the steps until the registration of the micro service information is completed.
It should be noted that the micro-service cannot communicate with the first registry, which means that the communication between the first registry and the micro-service is cut off, but the first registry may also communicate with micro-services other than the micro-service itself, and does not represent that the first registry cannot communicate with any micro-service.
In the embodiment of the invention, the registration addresses of the registration centers are disordered by using a shuffling algorithm, so that the micro-service selects the corresponding registration centers to register according to the sequence of the arrangement of the registration addresses, and the registration addresses of the registration centers are stored in the local database, thereby improving the use efficiency of the registration centers.
Referring to fig. 2, another embodiment of the method for registering a microservice according to the embodiment of the present invention includes:
201. and acquiring a registration address of the registration center, and scrambling the registration address through a shuffling algorithm to obtain a scrambled registration address.
The server acquires the registration address of the registration center, and scrambles the registration address through a shuffling algorithm to obtain the scrambled registration address. Specifically, the server sequentially acquires registration addresses of n registration centers, wherein n is a natural number; the server generates a random number x, acquires a registration address of the xth bit column, and exchanges the registration address of the xth bit column with the registration address of the nth bit column to be used as a registration address with the first last permutation, wherein the value range of x is [0, n-1]; the server generates a random number y, acquires a registration address of a bitcolumn yth, and exchanges the registration address of the bitcolumn yth with a registration address of a bitcolumn n-1 to be used as a registration address with the second to last permutation, wherein the value range of y is [0, n-2]; the server obtains the disordered registration addresses until outputting the registration addresses of the n registration centers.
It should be explained that, the server uses shuffling algorithm to disorder the registration addresses of the registration centers, and then performs registration of the addresses of the micro-services, if the registration addresses of the registration centers are not scrambled, the registration addresses of the micro-services are all registered in the same registration center, so that the pressure of the registration centers is too high, normal access operation cannot be performed, and after the registration addresses of the registration centers are scrambled, the micro-services can be uniformly registered in the registration centers, and the situation that only one registration center is registered is not caused, so that the registration centers are invalid. The principle of the shuffling algorithm is to randomly take a number from the unprocessed data each time, and then place the data corresponding to the number at the end of the array, i.e. the data stored at the end of the array is the processed data.
For example, the server sequentially obtains registration addresses of n registration centers, wherein n is a natural number; the server generates a random number x, wherein the value range of x is [0, n-1], acquires the registration address of the xth bit column, and exchanges the registration address with the registration address of the nth bit column to be used as the registration address with the first last permutation; the server generates a random number y, wherein the value range of y is [0, n-2], acquires the registration address of the bit column y, and exchanges the registration address with the registration address of the bit column n-1 to be used as the registration address with the second to last permutation; and circulating the steps until the registration addresses of the n registration centers are output, so that the scrambled registration addresses are obtained. For n registration addresses, the probability of the registration address arranged at the nth position after the first exchange is 1/n, and the probability of the registration address arranged at the n-1 th position after the second exchange is: [ (n-1)/n ] × [ 1/(n-1) ] =1/n, and after the k-th exchange, the probability of the registered address arranged at the n-k + 1-th position is: the probability of the registration addresses arranged at each position is the same [ (n-1)/n ] × [ (n-2)/(n-1) ] × 8230 [ (n-k + 1)/(n-k + 2) ] × [ 1/(n-k + 1) ] =1/n, and the uniform distribution of the arrangement of the registration addresses is ensured.
202. And acquiring a first arranged registration address in the disturbed registration addresses, and adding a micro-service address in a routing table carried by a first registration center, wherein the first arranged registration address is an address corresponding to the first registration center.
The server obtains a first arranged registration address in the disturbed registration addresses, and adds an address of the micro service in a routing table carried by the first registration center, wherein the first arranged registration address is an address corresponding to the first registration center. Specifically, the server obtains a first arranged registration address in the disordered registration addresses, wherein the first arranged registration address is an address corresponding to a first registration center; the server judges whether the first arranged registration address is in a local database; if the first arranged registration address is not in the local database, the server stores the routing table carried by the first registration center in the local database, and adds the address of the micro-service in the routing table carried by the first registration center; if the first registration address is arranged in the local database, the server adds the address of the micro service in a routing table carried by the first registration center.
When the micro service is started, the micro service is registered in the registration center of the server, that is, the registration center reports basic information of the micro service, where the basic information includes an IP address of the micro service, an interface list of the micro service, and the like, and when other micro services request the registration center to access the micro service, the registration center returns an access request to the micro service according to the micro service address carried in the routing table, and the micro service performs related services according to the access request. Because the routing table carried by the registry is stored in the memory of the server, the memory is also called an internal memory and is used for temporarily storing the operation data in the CPU and the data exchanged with external memories such as a hard disk and the like, as long as the computer is in operation, the CPU transfers the data required to be operated into the memory for operation, after the operation is completed, the CPU transmits the result out, the operation of the memory also determines the stable operation of the computer, namely, the data in the memory is lost when the computer is powered off, therefore, the routing table carried by the registry is stored in a local database, namely on a magnetic disk, the magnetic disk is a memory for storing the data by using a magnetic recording technology, the magnetic disk is a main storage medium of the computer, can store a large amount of binary data, and can keep the data from being lost even if the computer is powered off, thereby ensuring that the routing table carried by the registry cannot be lost.
After the server acquires the first registered address arranged in the disordered registered addresses, whether the first registered address is arranged in the local database needs to be judged, only the registered address of the registration center is stored in the local database, and the routing table carried by the registration center cannot be lost when the computer is powered off, so that the server needs to judge the position of the address of the registration center, the registered address is not in the local database, the registered address needs to be stored in the local database firstly, and then the next operation is carried out.
203. And sending a detection data packet to the microservice through the first registration center within a preset time length.
And within the preset duration, the server sends a detection data packet to the microservice through the first registration center.
It can be understood that when the registration center sends the registration request information to the microservice, it is necessary to determine whether the microservice is working normally, here, a heartbeat mechanism is used to detect whether the microservice is in a normal working state, the heartbeat mechanism sends a detection data packet to the microservice at a fixed time interval like a heartbeat, and the microservice returns a detection response data packet after receiving the detection data packet, so as to prove that the microservice is in a normal working state. The heartbeat mechanism is that the registration center actively sends a detection data packet to judge the state of the micro-service, then waits for the micro-service to update the current state of the micro-service, namely feeds back a detection response data packet regularly, and if the micro-service does not update the state within a specified time, the micro-service is considered to be down or the state of the micro-service is abnormal.
204. And receiving a detection response data packet fed back by the micro-service according to the detection data packet, and acquiring registration request information sent by the micro-service in the first registration center, wherein the registration request information comprises a key to be verified.
The server receives a detection response data packet fed back by the micro-service according to the detection data packet, and acquires registration request information sent by the micro-service in the first registration center, wherein the registration request information comprises a key to be verified. Specifically, if the micro service receives the detection data packet, the server receives a detection response data packet fed back by the micro service, and acquires registration request information sent by the micro service in the first registration center, wherein the registration request information comprises a key to be verified; and if the micro service does not receive the detection data packet, the server deletes the address of the micro service in a routing table carried by the first registration center.
It is understood that the server does not make a special specification for the detection packet, and generally is a very small packet or a null packet only including a packet header, the registration center sends a null packet to the microserver for a preset time period by using a timer, and then the microserver feeds back the same null packet, and if the server does not receive the feedback packet sent by the microserver for a certain time period, the microserver is not in a normal operating state. After the server knows the disconnection of the micro-service, the logic layer of the server deletes the micro-service address recorded in the routing table carried by the registration center and stops receiving the registration request information sent by the micro-service. In general, the heartbeat mechanism is mainly used for keeping alive and disconnection processing of long connection. In general, the preset duration is set to 5 minutes, and the preset duration can be set according to actual conditions, and the length of the preset duration is not set here.
205. And if the registration request information is successfully received, adding the registration request information into a routing table carried by a registration center.
And if the registration request information is successfully received, the server adds the registration request information to a routing table carried by the registration center. Specifically, in the first registration center, the server determines whether the key to be verified is the same as the preset key; and if the key to be verified is the same as the preset key, the server successfully receives the registration request information and adds the registration request information into a routing table carried by the first registration center.
It can be understood that, when the server determines whether the registration center successfully receives the registration request information sent by the micro service, the server determines whether the key to be verified in the registration request information is the same as the preset key in the configuration center, if the preset key is the same as the key to be verified, it indicates that the micro service address passes through the security detection of the configuration center, and the registration center can receive the registration request information sent by the micro service; if the preset key is different from the key to be verified, it indicates that the microservice address cannot pass the security detection of the configuration center, so that the registration center cannot receive the registration request information sent by the microservice. The preset key is obtained by the server through key derivation by acquiring an address of the micro service and an authentication key carried in the configuration center, the key to be verified is obtained by key derivation of the address of the micro service and a security key carried by the micro service, the security key is a key carried by the micro service, whether the preset key of the server is the same as the key to be verified is judged, namely whether the security key of the micro service end is the same as the authentication key is judged, if the security key carried by the micro service end is the same as the authentication key of the registration center, the micro service is proved to pass through security monitoring of the configuration center, and the registration center can receive registration request information sent by the micro service.
It should be noted that a key derivation algorithm is utilized herein, and the key derivation algorithm is also called a key distribution algorithm, and is a deterministic algorithm for deriving a key from some secret values, for example: a double-length (one length key is 8 bytes) master key is arranged in the server, and the master key is used for performing decentralized processing on data to be encrypted to derive a double-length encryption key. The server uses the same key in both encryption and decryption, so that the two keys can simply be derived keys from each other.
206. If the registration request information is not successfully received, the registration address is added to a preset unavailable list carried by the micro-service, and the registration request information is received in other registration centers except the local registration center until the registration request information is successfully received in the other registration centers.
If the registration request information is not successfully received, the server adds the registration address to a preset unavailable list carried by the microservice, and receives the registration request information in other registration centers except the local registration center until the registration request information is successfully received in the other registration centers. Specifically, if the key to be verified is different from the preset key, the server does not successfully receive registration request information, and adds the first arranged registration address to a preset unavailable list carried by the microservice; the server acquires a second arranged registration address in the disordered registration addresses, wherein the second arranged registration address is an address corresponding to a second registration center; in a second registration center, a server receives registration request information sent by the micro-service, and if the second registration center successfully receives the registration request information, the registration request information is added into a routing table carried by the second registration center; if the second registration center does not successfully receive the registration request information, the server adds the registration address of the second registration center to a preset unavailable list carried by the microservice, and receives the registration request information in a third registration address arranged in the disturbed registration address until the registration request information is successfully received in the registration center.
The preset unavailable list is set in the micro service in advance, when the micro service cannot be communicated with the first registration center, the first registration center is indicated to be unavailable, and the registration address corresponding to the first registration center is added into the preset unavailable list; then the server obtains a second registration address arranged in the disordered registration addresses, tries to communicate with a second registration center opposite to the second registration address arranged, and launches registration request information to the second registration center, wherein the process of receiving the registration request information by the second registration center is the same as the process of receiving the request information by the first registration center, and if the second registration center successfully receives the registration request information, the server adds the registration request information to a routing table carried by the second registration center to complete the registration of the micro-service; if the second registration center does not successfully receive the registration request information, the server firstly adds the second arranged registration address to a preset unavailable list carried by the micro service, then obtains a third arranged registration address in the disturbed registration address, and repeats the steps until the registration of the micro service information is completed.
It should be noted that the micro-service cannot communicate with the first registry, which means that the communication between the first registry and the micro-service is cut off, but the first registry may also communicate with micro-services other than the micro-service itself, and does not represent that the first registry cannot communicate with any micro-service.
In the embodiment of the invention, the registration addresses of the registration centers are disordered by using a shuffling algorithm, so that the micro-service selects the corresponding registration centers to register according to the sequence of the arrangement of the registration addresses, and the registration addresses of the registration centers are stored in the local database, thereby improving the use efficiency of the registration centers.
In the above description of the microservice registration method in the embodiment of the present invention, the microservice registration apparatus in the embodiment of the present invention is described below with reference to fig. 3, and an embodiment of the microservice registration apparatus in the embodiment of the present invention includes:
a scrambling unit 301, configured to obtain a registration address of a registration center, and scramble the registration address through a shuffling algorithm to obtain a scrambled registration address;
a receiving unit 302, configured to receive, by using the scrambled registration address, registration request information sent by the micro service, where the registration request information includes a key to be authenticated;
a first adding unit 303, configured to add the registration request information to a routing table carried by the registration center if the registration request information is successfully received;
the second adding unit 304, if the registration request information is not successfully received, is configured to add the registration address to a preset unavailable list carried by the microservice, and receive the registration request information in a registry other than the local registry until the registration request information is successfully received in the other registry.
In the embodiment of the present invention, the scrambling unit 301 is configured to obtain a registration address of a registration center, and scramble the registration address through a shuffling algorithm to obtain a scrambled registration address; a receiving unit 302, configured to receive, by using the scrambled registration address, registration request information sent by the micro service, where the registration request information includes a key to be authenticated; a first adding unit 303, configured to add the registration request information to a routing table carried by the registration center if the registration request information is successfully received; the second adding unit 304, if the registration request information is not successfully received, is configured to add the registration address to a preset unavailable list carried by the microservice, and receive the registration request information in a registration center other than the local registration center until the registration request information is successfully received in the other registration center.
The embodiment of the invention uses shuffling algorithm to disorder the registration addresses of the registration centers, enables the microservice to select corresponding registration centers to register according to the sequence of the arrangement of the registration addresses, and stores the registration addresses of the registration centers in the local database, thereby improving the use efficiency of the registration centers.
Referring to fig. 4, another embodiment of the microservice registration apparatus in the embodiment of the present invention includes:
a scrambling unit 301, configured to obtain a registration address of a registration center, and scramble the registration address through a shuffling algorithm to obtain a scrambled registration address;
a receiving unit 302, configured to receive, by using the scrambled registration address, registration request information sent by the micro service, where the registration request information includes a key to be authenticated;
a first adding unit 303, configured to add the registration request information to a routing table carried by the registration center if the registration request information is successfully received;
the second adding unit 304, if the registration request information is not successfully received, is configured to add the registration address to a preset unavailable list carried by the microservice, and receive the registration request information in a registry other than the local registry until the registration request information is successfully received in the other registry.
Optionally, the receiving unit 302 includes:
an obtaining module 3021, configured to obtain a first arranged registration address in the scrambled registration addresses, and add an address of a microservice in a routing table carried by a first registration center, where the first arranged registration address is an address corresponding to the first registration center;
a sending module 3022, configured to send a probe packet to the microservice through the first registration center within a preset duration;
a receiving module 3023, configured to receive a probe response packet fed back by the micro service according to the probe packet, and obtain, in the first registration center, registration request information sent by the micro service, where the registration request information includes a key to be verified.
Optionally, the obtaining module 3021 is specifically configured to:
acquiring a first arranged registration address in the disordered registration addresses, wherein the first arranged registration address is an address corresponding to a first registration center;
judging whether the first arranged registration address is in a local database;
if the first arranged registration address is not in the local database, storing the routing table carried by the first registration center in the local database, and adding the address of the micro service in the routing table carried by the first registration center;
if the first registration address is arranged in the local database, the address of the micro service is added in a routing table carried by the first registration center.
Optionally, the receiving module 3023 is specifically configured to:
if the micro service receives the detection data packet, receiving a detection response data packet fed back by the micro service, and acquiring registration request information sent by the micro service in a first registration center, wherein the registration request information comprises a key to be verified;
and if the micro service does not receive the detection data packet, deleting the address of the micro service in a routing table carried by the first registration center.
Optionally, the first adding unit 303 is specifically configured to:
in a first registration center, judging whether a key to be verified is the same as a preset key or not;
and if the key to be verified is the same as the preset key, successfully receiving the registration request information, and adding the registration request information into a routing table carried by the first registration center.
Optionally, the second adding unit 304 is specifically configured to:
if the key to be verified is different from the preset key, the registration request information is not successfully received, and the first arranged registration address is added into a preset unavailable list carried by the micro service;
acquiring a second arranged registration address in the disordered registration addresses, wherein the second arranged registration address is an address corresponding to a second registration center;
in the second registration center, receiving registration request information sent by the micro-service, and if the second registration center successfully receives the registration request information, adding the registration request information into a routing table carried by the second registration center;
and if the second registration center does not successfully receive the registration request information, adding the registration address of the second registration center into a preset unavailable list carried by the microservice, and receiving the registration request information in a third registration address arranged in the disturbed registration address until the registration request information is successfully received in the registration center.
Optionally, the scrambling unit 301 is specifically configured to:
acquiring registration addresses of n registration centers in sequence, wherein n is a natural number;
generating a random number x, acquiring a registration address of the xth bit column, and interchanging the registration address of the xth bit column and the registration address of the nth bit column to be used as a registration address with the first last permutation, wherein the value range of x is [0, n-1];
generating a random number y, acquiring a registration address of a bit column y, and interchanging the registration address of the bit column y and a registration address of a bit column n-1 as a registration address with the second to last permutation, wherein the value range of y is [0, n-2];
and obtaining the disordered registration addresses until the registration addresses of the n registration centers are output.
In the embodiment of the present invention, the scrambling unit 301 is configured to obtain a registration address of a registration center, and scramble the registration address through a shuffling algorithm to obtain a scrambled registration address; a receiving unit 302, configured to receive, by using the scrambled registration address, registration request information sent by the micro service, where the registration request information includes a key to be authenticated, specifically: an obtaining module 3021, configured to obtain a first arranged registration address in the scrambled registration addresses, and add an address of a microservice in a routing table carried by a first registration center, where the first arranged registration address is an address corresponding to the first registration center; a sending module 3022, configured to send a probe packet to the microservice through the first registration center within a preset duration; a receiving module 3023, configured to receive a probe response packet fed back by the microservice according to the probe packet, and obtain, in the first registration center, registration request information sent by the microservice, where the registration request information includes a key to be verified; a first adding unit 303, configured to add the registration request information to a routing table carried by the registration center if the registration request information is successfully received; the second adding unit 304, if the registration request information is not successfully received, is configured to add the registration address to a preset unavailable list carried by the microservice, and receive the registration request information in a registry other than the local registry until the registration request information is successfully received in the other registry.
In the embodiment of the invention, the registration addresses of the registration centers are disordered by using a shuffling algorithm, so that the micro-service selects the corresponding registration centers to register according to the sequence of the arrangement of the registration addresses, and the registration addresses of the registration centers are stored in the local database, thereby improving the use efficiency of the registration centers.
Fig. 3 to fig. 4 describe the micro-service registration apparatus in the embodiment of the present invention in detail from the perspective of the modular functional entity, and the micro-service registration apparatus in the embodiment of the present invention is described in detail from the perspective of hardware processing.
The following specifically describes each component of the microservice registration apparatus with reference to fig. 5:
fig. 5 is a schematic structural diagram of a micro service registration apparatus 500 according to an embodiment of the present invention, where the micro service registration apparatus 500 may have a relatively large difference due to different configurations or performances, and may include one or more processors (CPUs) 501 (e.g., one or more processors) and a memory 509, and one or more storage media 508 (e.g., one or more mass storage devices) for storing applications 507 or data 506. Memory 509 and storage medium 508 may be, among other things, transient storage or persistent storage. The program stored on the storage medium 508 may include one or more modules (not shown), each of which may include a series of instruction operations for a check-in management device. Still further, processor 501 may be configured to communicate with storage medium 508 to execute a series of instruction operations in storage medium 508 on microservice registration device 500.
The microservice registration apparatus 500 may also include one or more power supplies 502, one or more wired or wireless network interfaces 503, one or more input-output interfaces 504, and/or one or more operating systems 505, such as Windows Server, mac OS X, unix, linux, freeBSD, etc. Those skilled in the art will appreciate that the configuration of the microservice registration apparatus shown in figure 5 does not constitute a limitation of the microservice registration apparatus and may include more or less components than those shown, or some components may be combined, or a different arrangement of components.
The following specifically describes each component of the microservice registration apparatus with reference to fig. 5:
the processor 501 is a control center of the micro service registration apparatus, and may perform processing according to a micro service registration method. The processor 501 connects various parts of the entire microservice registration apparatus using various interfaces and lines, and increases the efficiency of the registry by running or executing software programs and/or modules stored in the memory 509, and calling data stored in the memory 509, scrambling the registration addresses of the registry using a shuffle algorithm, and storing the registration addresses of the registry in a local database. The storage medium 508 and the memory 509 are carriers for storing data, in the embodiment of the present invention, the storage medium 508 may be an internal memory with a small storage capacity but a high speed, and the memory 509 may be an external memory with a large storage capacity but a low storage speed.
The memory 509 may be used to store software programs and modules, and the processor 501 executes various functional applications and data processing of the micro-service registration apparatus 500 by operating the software programs and modules stored in the memory 509. The memory 509 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to the use of the micro-service registration apparatus, and the like. Further, the memory 509 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device. The microservice registration procedure provided in embodiments of the present invention and the received data stream are stored in memory and, when needed for use, the processor 501 calls from the memory 509.
The procedures or functions according to the embodiments of the invention are brought about in whole or in part when the computer program instructions are loaded and executed on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored on a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, optical fiber, twisted pair) or wirelessly (e.g., infrared, wireless, microwave, etc.). Computer-readable storage media can be any available media that a computer can store or a data storage device, such as a server, data center, etc., that includes one or more available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., compact disk), or a semiconductor medium (e.g., solid State Disk (SSD)), among others.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments provided in the present invention, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a unit is only a logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention, which is substantially or partly contributed by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; although the present invention has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (9)

1. A method for registering micro-services, comprising:
acquiring a registration address of a registration center, and scrambling the registration address through a shuffling algorithm to obtain a scrambled registration address;
receiving registration request information sent by the micro-service by using the scrambled registration address, wherein the registration request information comprises a key to be verified;
if the registration request information is successfully received, adding the registration request information into a routing table carried by the registration center;
if the registration request information is not successfully received, adding the registration address into a preset unavailable list carried by the microservice, and receiving the registration request information in other registration centers except the local registration center until the registration request information is successfully received in the other registration centers;
the acquiring of the registration address of the registration center and the scrambling of the registration address through the shuffling algorithm to obtain the scrambled registration address comprises:
acquiring registration addresses of n registration centers in sequence, wherein n is a natural number;
generating a random number x, acquiring a registration address of a bit column xth, and interchanging the registration address of the bit column xth and the registration address of the bit column nth as a registration address with the first last permutation, wherein the value range of x is [0, n-1];
generating a random number y, acquiring a registration address of a bit column y, and interchanging the registration address of the bit column y and a registration address of a bit column n-1 as a registration address with the second to last permutation, wherein the value range of y is [0, n-2];
and obtaining the disordered registration addresses until outputting the registration addresses of the n registration centers.
2. The micro-service registration method according to claim 1, wherein the receiving registration request information sent by the micro-service by using the scrambled registration address, the registration request information including a key to be authenticated includes:
acquiring a first arranged registration address in the disordered registration addresses, and adding a micro-service address in a routing table carried by a first registration center, wherein the first arranged registration address is an address corresponding to the first registration center;
sending a detection data packet to the micro-service through the first registration center within a preset time length;
and receiving a detection response data packet fed back by the micro-service according to the detection data packet, and acquiring registration request information sent by the micro-service in the first registration center, wherein the registration request information comprises a key to be verified.
3. The method according to claim 2, wherein the obtaining a first arranged registration address in the scrambled registration addresses, and adding an address of the micro service in a routing table carried by a first registration center, where the first arranged registration address is an address corresponding to the first registration center includes:
acquiring a first arranged registration address in the disordered registration addresses, wherein the first arranged registration address is an address corresponding to a first registration center;
judging whether the first arranged registration address is in a local database;
if the first arranged registration address is not in the local database, storing a routing table carried by the first registration center in the local database, and adding a micro-service address in the routing table carried by the first registration center;
and if the first arranged registration address is in the local database, adding the address of the micro service in a routing table carried by the first registration center.
4. The method according to claim 2, wherein the receiving the probe response packet fed back by the micro service according to the probe packet and obtaining the registration request information sent by the micro service in the first registry, wherein the registration request information including the key to be authenticated includes:
if the micro service receives the detection data packet, receiving a detection response data packet fed back by the micro service, and acquiring registration request information sent by the micro service in the first registration center, wherein the registration request information comprises a key to be verified;
and if the micro service does not receive the detection data packet, deleting the address of the micro service in a routing table carried by the first registration center.
5. The method of claim 2, wherein the adding the registration request information to a routing table carried by the registry if the registration request information is successfully received comprises:
in the first registration center, judging whether a key to be verified is the same as a preset key;
and if the key to be verified is the same as the preset key, successfully receiving the registration request information, and adding the registration request information into a routing table carried by the first registration center.
6. The method of claim 5, wherein if the registration request message is not successfully received, adding the registration address to a preset unavailable list carried by the microservice, and receiving the registration request message in a registry other than the registry until the registration request message is successfully received in the registry comprises:
if the key to be verified is different from the preset key, the registration request information is not successfully received, and the first arranged registration address is added into a preset unavailable list carried by the microservice;
acquiring a second arranged registration address in the disordered registration addresses, wherein the second arranged registration address is an address corresponding to a second registration center;
in the second registration center, receiving the registration request information sent by the microservice, and if the second registration center successfully receives the registration request information, adding the registration request information to a routing table carried by the second registration center;
if the second registration center does not successfully receive the registration request information, adding the registration address of the second registration center into a preset unavailable list carried by the micro service, and receiving the registration request information in a third registration address arranged in the disturbed registration address until the registration request information is successfully received in the registration center.
7. A microservice registration apparatus, comprising:
the system comprises a scrambling unit, a registration center and a sending unit, wherein the scrambling unit is used for acquiring a registration address of the registration center and scrambling the registration address through a shuffling algorithm to obtain a scrambled registration address;
a receiving unit, configured to receive, by using the scrambled registration address, registration request information sent by the micro service, where the registration request information includes a key to be authenticated;
a first adding unit, configured to add the registration request information to a routing table carried by the registration center if the registration request information is successfully received;
a second adding unit, configured to add the registration address to a preset unavailable list carried by the microservice if the registration request information is not successfully received, and receive the registration request information in a registration center other than the local registration center until the registration request information is successfully received in the other registration center;
the scrambling unit is specifically used for sequentially acquiring registration addresses of n registration centers, wherein n is a natural number; generating a random number x, acquiring a registration address of a bit column xth, and exchanging the registration address of the bit column xth with a registration address of the bit column nth to be used as a registration address with the first permutation reciprocal, wherein the value range of x is [0, n-1]; generating a random number y, acquiring a registration address of a bit column y, and interchanging the registration address of the bit column y and a registration address of a bit column n-1 as a registration address with the second to last permutation, wherein the value range of y is [0, n-2]; and obtaining the disordered registration addresses until outputting the registration addresses of the n registration centers.
8. A microservice registration apparatus, comprising:
a memory having instructions stored therein and at least one processor, the memory and the at least one processor interconnected by a line;
the at least one processor invokes the instructions in the memory to cause the microservice registration apparatus to perform the microservice registration method of any of claims 1-6.
9. A computer-readable storage medium comprising instructions which, when executed on a computer, cause the computer to perform the steps of the microservice registration method of any of claims 1-6.
CN201911365923.6A 2019-12-26 2019-12-26 Microservice registration method, microservice registration device, microservice registration equipment and storage medium Active CN111200560B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911365923.6A CN111200560B (en) 2019-12-26 2019-12-26 Microservice registration method, microservice registration device, microservice registration equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911365923.6A CN111200560B (en) 2019-12-26 2019-12-26 Microservice registration method, microservice registration device, microservice registration equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111200560A CN111200560A (en) 2020-05-26
CN111200560B true CN111200560B (en) 2023-04-07

Family

ID=70746448

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911365923.6A Active CN111200560B (en) 2019-12-26 2019-12-26 Microservice registration method, microservice registration device, microservice registration equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111200560B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115904361B (en) * 2022-09-28 2023-09-22 建信金融科技有限责任公司 Data processing method, device, equipment and medium applied to micro-service

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109412853A (en) * 2018-10-31 2019-03-01 中国建设银行股份有限公司 Distributed Services register storage method, system, device and storage medium
CN110048879A (en) * 2019-03-12 2019-07-23 平安医疗健康管理股份有限公司 Micro services register method, device, electronic equipment and computer readable storage medium
CN110224855A (en) * 2019-05-13 2019-09-10 平安科技(深圳)有限公司 Register method, device, computer equipment and the storage medium of micro services example
EP3543853A1 (en) * 2018-03-20 2019-09-25 Siemens Healthcare GmbH Providing microservice information
CN110365750A (en) * 2019-06-25 2019-10-22 苏宁云计算有限公司 Service registration system and method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018004602A1 (en) * 2016-06-30 2018-01-04 Intel Corporation Data management microservice in a microservice domain

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3543853A1 (en) * 2018-03-20 2019-09-25 Siemens Healthcare GmbH Providing microservice information
CN109412853A (en) * 2018-10-31 2019-03-01 中国建设银行股份有限公司 Distributed Services register storage method, system, device and storage medium
CN110048879A (en) * 2019-03-12 2019-07-23 平安医疗健康管理股份有限公司 Micro services register method, device, electronic equipment and computer readable storage medium
CN110224855A (en) * 2019-05-13 2019-09-10 平安科技(深圳)有限公司 Register method, device, computer equipment and the storage medium of micro services example
CN110365750A (en) * 2019-06-25 2019-10-22 苏宁云计算有限公司 Service registration system and method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于微服务架构的统一应用开发平台;李春阳等;《计算机系统应用》;20170415(第04期);全文 *

Also Published As

Publication number Publication date
CN111200560A (en) 2020-05-26

Similar Documents

Publication Publication Date Title
CN107888562B (en) Data verification and transceiving method, node and system for parallel link access to interconnection chain
CN111209334B (en) Power terminal data security management method based on block chain
CN104520873A (en) Systems and methods for securing and restoring virtual machines
CN109474606A (en) Document transmission method, device, computer equipment and storage medium
CN106209739A (en) Cloud storage method and system
US20170149748A1 (en) Secure Group Messaging and Data Steaming
CN110891062B (en) Password changing method, server and storage medium
CN102404326B (en) Method, system and device for validating safety of messages
CN111740966A (en) Data processing method based on block chain network and related equipment
CN111614670A (en) Method and device for sending encrypted file and storage medium
EP3306855B1 (en) Authentication device, authentication system, authentication method, and program
CN111200560B (en) Microservice registration method, microservice registration device, microservice registration equipment and storage medium
CN114938312A (en) Data transmission method and device
CN110620776B (en) Data transfer information transmission method and device
Kilgallin et al. Factoring RSA keys in the IoT era
CN109120641B (en) Report automatic uploading method and device, computer equipment and storage medium
CN110109769A (en) Method for safety monitoring, device, equipment and the storage medium of application crash
CN116226940B (en) PCIE-based data security processing method and data security processing system
CN109450849B (en) Cloud server networking method based on block chain
CN108347330A (en) A kind of method and apparatus of secure communication
CN113660645B (en) Device configuration method and device, electronic device and storage medium
CN113014545B (en) Data processing method and device, computer equipment and storage medium
CN111490880B (en) File receiving method and device
CN110502915B (en) Data processing method, device and system
CN111447057B (en) Safe storage method and device based on threshold secret sharing technology

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant