CN114979280B - Registration center access method and device - Google Patents
Registration center access method and device Download PDFInfo
- Publication number
- CN114979280B CN114979280B CN202210585899.2A CN202210585899A CN114979280B CN 114979280 B CN114979280 B CN 114979280B CN 202210585899 A CN202210585899 A CN 202210585899A CN 114979280 B CN114979280 B CN 114979280B
- Authority
- CN
- China
- Prior art keywords
- level
- service
- information
- registry
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 58
- 238000004590 computer program Methods 0.000 claims description 23
- 238000012545 processing Methods 0.000 claims description 22
- 238000005516 engineering process Methods 0.000 claims description 11
- 238000004364 calculation method Methods 0.000 claims description 4
- 238000002955 isolation Methods 0.000 abstract description 7
- 238000004891 communication Methods 0.000 description 17
- 238000010586 diagram Methods 0.000 description 15
- 230000006870 function Effects 0.000 description 14
- 239000000872 buffer Substances 0.000 description 4
- 238000004519 manufacturing process Methods 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 238000006467 substitution reaction Methods 0.000 description 2
- 238000012546 transfer Methods 0.000 description 2
- 241000224489 Amoeba Species 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 230000009977 dual effect Effects 0.000 description 1
- 238000012905 input function Methods 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
- Computer And Data Communications (AREA)
Abstract
The invention provides a method and a device for accessing a registry, which relate to the technical field of automatic programming, and the method comprises the following steps: acquiring service name information, and judging the level information of the micro service according to the service name information; if the level information is the calling level in the product, the registration information is sent to a second-level registration center through the providing direction of the micro service, and subscription information is acquired from the second-level registration center through the consumer of the micro service; if the level information is the cross-product calling level, the registration information is sent to the first-level registration center through the providing direction of the micro-service, and the subscription information is acquired from the first-level registration center through the consumer of the micro-service. After the level information of the micro service is determined, the first-level registry and the second-level registry are accessed in a classified manner, so that the access pressure of the registries is relieved; the method realizes the isolation of global and local services through the two-stage registries, and avoids the influence of failure of any one stage of registries on the service of another stage of registries.
Description
Technical Field
The invention relates to the technical field of automatic programming, in particular to a registry access method and device.
Background
This section is intended to provide a background or context to the embodiments of the invention that are recited in the claims. The description herein is not admitted to be prior art by inclusion in this section.
Currently, the system architecture of banks gradually changes from a traditional centralized architecture to a distributed architecture and a serviced architecture, wherein a registry is a basic requirement for enabling mutual call between micro services. Large banks may have hundreds of systems, the scale of the entire service may reach millions if the registration granularity of the service is as fine as the interface level, the scale of clients accessing the registration center may reach tens of thousands, and the production security of the bank is extremely high, the system may be deployed in different places with multiple machine rooms, so that the service also has cross-regional and cross-data center access. The existing schemes are all primary registries, so that the scale of the registries is too large, no isolation exists between local areas, and the failure of the registries affects all services. If a large bank production environment registry carries millions of registration scales, it may result in very slow business online.
Disclosure of Invention
The invention provides a method and a device for accessing a registry, which can relieve the access pressure of the registry; the method realizes the isolation of global and local services through the two-stage registries, and avoids the influence of failure of any one stage of registries on the service of another stage of registries.
In a first aspect, an embodiment of the present invention provides a method for accessing a registry, where the method includes:
Acquiring service name information, and judging the level information of the micro service according to the service name information; the level information comprises an intra-product calling level and a cross-product calling level;
If the level information is a calling level in the product, transmitting registration information to a second-level registry through the provision direction of the micro service, and acquiring subscription information from the second-level registry through a consumer of the micro service;
And if the level information is the cross-product calling level, transmitting registration information to a first-level registry through the provision direction of the micro service, and acquiring subscription information from the first-level registry through the consumer of the micro service.
In a second aspect, an embodiment of the present invention further provides a registry access device, including:
the level determining module is used for acquiring service name information and judging the level information of the micro service according to the service name information; the level information comprises an intra-product calling level and a cross-product calling level;
The first access module is used for sending registration information to a second-level registration center through the provision of the micro service if the level information is a calling level in the product, and acquiring subscription information from the second-level registration center through a consumer of the micro service;
and the second access module is used for sending registration information to the first-level registration center through the provision of the micro service if the level information is the cross-product calling level, and acquiring subscription information from the first-level registration center through the consumer of the micro service.
In a third aspect, an embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, where the processor implements the above-mentioned registry access method when executing the computer program.
In a fourth aspect, embodiments of the present invention also provide a computer-readable storage medium storing a computer program for executing the above-described registry access method.
In a fifth aspect, embodiments of the present invention also provide a computer program product comprising a computer program which, when executed by a processor, implements the above-described registry access method.
The embodiment of the invention has the following beneficial effects: the embodiment of the invention provides a method and a device for accessing a registry, wherein the method comprises the following steps: acquiring service name information, and judging the level information of the micro service according to the service name information; the level information comprises intra-product calling levels and inter-product calling levels; if the level information is the calling level in the product, the registration information is sent to a second-level registration center through the providing direction of the micro service, and subscription information is acquired from the second-level registration center through the consumer of the micro service; if the level information is the cross-product calling level, the registration information is sent to the first-level registration center through the providing direction of the micro-service, and the subscription information is acquired from the first-level registration center through the consumer of the micro-service. After the level information of the micro service is determined, the first-level registry and the second-level registry are accessed in a classified manner, so that the access pressure of the registries is relieved; in addition, the method realizes the isolation of global and local services through the two-stage registries, and avoids the influence of failure of any one stage of registries on the service of another stage of registries.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
In order to make the above objects, features and advantages of the present invention more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are needed in the description of the embodiments or the prior art will be briefly described, and it is obvious that the drawings in the description below are some embodiments of the present invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art. In the drawings:
FIG. 1 is a flowchart of a method for accessing a registry according to an embodiment of the present invention;
FIG. 2 is a block diagram of a registry access device according to an embodiment of the present invention;
FIG. 3 is a block diagram of another registry access device according to an embodiment of the present invention;
FIG. 4 is a block diagram of a service unit module according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a registry access method implementation architecture according to an embodiment of the present invention;
Fig. 6 is a schematic diagram of a system composition structure of a computer device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The existing registry access scheme, such as a large bank, is realized by the whole production environment about a registry cluster based on a Zookeeper (which is software for providing consistency service for distributed application, and the provided functions include configuration maintenance, domain name service, distributed synchronization, group service and the like).
Based on the above, the embodiment of the invention provides a method and a device for accessing a registry, wherein the method comprises two levels of registries, can realize double registration and double subscription mechanisms, and can support double technical stacks (Dubbo and SpringCloud).
For the sake of understanding the present embodiment, a detailed description will be given of a method for accessing a registry disclosed in the present embodiment.
First, the terms involved will be described.
The registry: under the micro-service architecture, a center for providing the publishing and subscribing of the service address, a Provider of the service (Provider) can register with the registry, a Consumer of the service (Consumer) subscribes to the registry, and when the service has a change, the subscription mode can be perceived.
Enterprise-level registries: registration and discovery of the entire enterprise application service is resolved with respect to the application/product level.
A global registry: service registration and discovery across products is supported.
Local registry: service registration and discovery within a product.
Double registration: services can be registered with both local and global registries.
Double subscription: services can subscribe to both local and global registry services.
The embodiment of the invention provides a registry access method, referring to a registry access method flow chart shown in fig. 1, comprising the following steps:
Step S102, service name information is obtained, and the level information of the micro service is judged according to the service name information.
In an embodiment of the invention, the service name information is issued by the provider of the micro-service. The service name information includes information of the micro service provider and the consumer. The service name information also includes an identification code, which can be used to determine the level information of the micro service. The level information includes intra-product call levels and inter-product call levels.
For example, if the service name information includes a preset first field, the micro-service is determined to be the intra-product calling level, and if the service name information includes a preset second field, the micro-service is determined to be the inter-product calling level.
Step S104, if the level information is the calling level in the product, the registration information is sent to the second-level registration center through the providing direction of the micro service, and the subscription information is obtained from the second-level registration center through the consumer of the micro service.
In an embodiment of the present invention, the second level registry may be a local registry. For intra-product calls, registration and subscription may be made with the second level registry.
Step S106, if the level information is cross-product calling level, the registration information is sent to the first-level registry through the providing direction of the micro-service, and the subscription information is obtained from the first-level registry through the consumer of the micro-service.
In an embodiment of the present invention, the first level registry may be a global registry. For cross-product calls, registration and subscription may be made with a first level registry.
Registration and discovery of the entire enterprise application service may be resolved based on the first level registry and the second level registry.
The embodiment of the invention provides a registration center access method, which comprises the following steps: acquiring service name information, and judging the level information of the micro service according to the service name information; the level information comprises intra-product calling levels and inter-product calling levels; if the level information is the calling level in the product, the registration information is sent to a second-level registration center through the providing direction of the micro service, and subscription information is acquired from the second-level registration center through the consumer of the micro service; if the level information is the cross-product calling level, the registration information is sent to the first-level registration center through the providing direction of the micro-service, and the subscription information is acquired from the first-level registration center through the consumer of the micro-service. After the level information of the micro service is determined, the first-level registry and the second-level registry are accessed in a classified manner, so that the access pressure of the registries is relieved; in addition, the method realizes the isolation of global and local services through the two-stage registries, and avoids the influence of failure of any one stage of registries on the service of another stage of registries.
In one embodiment, before determining the level information to which the micro service belongs according to the service name information, the following steps may be further performed:
A plurality of service units is determined based on the target customer information.
In the embodiment of the present invention, the target client information may be selected according to actual requirements, which is not specifically limited in the embodiment of the present invention. The target customer information may be used to identify different customers, and thus set different service units for the different customers. Each service unit includes a service gateway and a plurality of application nodes. The service gateway may be used to access a first level registry. The application node may then be used to execute the micro-service.
It should be noted that, the service unit includes a plurality of application nodes, and the call between the application nodes and the call across the units belong to the call level in the product. Wherein, the call between the application nodes can be, for example, that the client A owns the account 1 and the account 2, and the transfer operation between the account 1 and the account 2; the call across units may be, for example, a transfer operation occurring between the accounts of customer a and customer B.
In one embodiment, the method may further perform the steps of:
and if the level information is the cross-product calling level, transmitting registration information to the first registry through the service gateway, and acquiring subscription information from the first level registry through the consumer of the micro service.
In the embodiment of the invention, under the condition of possessing a service gateway, the service is exposed through the gateway service when the service is provided to the outside, and the service is registered in a first-level registration center.
It should be noted that, without a service gateway, the micro-service of the application needs to be registered to both the local registry and the global registry.
In one embodiment, the target customer information is customer number data; determining a plurality of service units based on the target customer information may be performed as follows:
Performing hash modulo operation on a target data segment of the client number data to obtain a processing result; a plurality of service units is determined based on the processing result.
In the embodiment of the invention, the target data segment can be the tail number of the client number, hash modulo calculation is performed on the tail number, the client is classified according to the calculation result, and a service unit is determined for each classification result.
In one embodiment, the communication connection between the provider and the consumer is based on SpringCloud technology stacks.
In an embodiment of the present invention, spring Cloud is an ordered collection of a series of frames. Referring to the schematic architecture of the implementation of the registry access method shown in fig. 5, taking SpringCloud technology stack as an example, a general application includes a plurality of micro service nodes and a gateway for providing services to the outside. The internal micro-service is registered in a local registration center, is exposed through gateway service when the external service is provided, and is registered in a global registration center. When calling between micro services, the service in the product is called, and the service of the local registration center is subscribed. Service call among products and subscription to the service of the global registry. A service that requires SpringCloud can subscribe to both local and global registry services. (this is a dual subscription).
The above SpringCloud application is a gateway case, and if some special applications do not have gateway services, the micro services of the application need to be registered to the local registry and the global registry at the same time. (this is double registration).
In one embodiment, the communication connection between the provider and the consumer is based on Dubbo technology stacks.
In the embodiment of the invention, the method can also be realized based on Dubbo technology stacks.
It should be noted that Dubbo is a service framework with excellent high performance, which is an open source of the amoeba company, so that the application can realize the output and input functions of the service through the high-performance RPC, and can be seamlessly integrated with the Spring framework.
The invention provides a method and a device for accessing a registry, which provide a global+local two-stage double-registration and double-subscription enterprise-level registry, wherein the global registry is used for service call among products, the local registry is only used for service call in the product, and the two-stage registries reduce the registration scale of the global registry, so that a large number of service calls in the product only access the local registry, and the service call in the product is not influenced by the global registry.
The embodiment of the invention also provides a registry access device, as described in the following embodiment. Because the principle of the device for solving the problem is similar to that of the registry access method, the implementation of the device can refer to the implementation of the registry access method, and the repetition is omitted. Referring to the block diagram of the registry access device shown in fig. 2, the device comprises:
A level determining module 21, configured to obtain service name information, and determine level information to which the micro service belongs according to the service name information; the level information comprises intra-product calling levels and inter-product calling levels; the first access module 22 is configured to send registration information to the second-level registry through the provider of the micro service if the level information is a call level in the product, and obtain subscription information from the second-level registry through the consumer of the micro service; the second access module 23 is configured to send registration information to the first-level registry through the provider of the micro service if the level information is a cross-product call level, and obtain subscription information from the first-level registry through the consumer of the micro service.
In one embodiment, referring to another structural block diagram of a registry access device shown in fig. 3, the device further includes a service element module 24 for: determining a plurality of service units based on the target customer information; each service unit includes a service gateway and a plurality of application nodes.
In one embodiment, the second access module is further configured to: and if the level information is the cross-product calling level, transmitting registration information to the first registry through the service gateway, and acquiring subscription information from the first level registry through the consumer of the micro service.
In one embodiment, the target customer information is customer number data; referring to the block diagram of the service unit module shown in fig. 4, the service unit module includes: a hash unit 41, configured to perform a hash modulo operation on a target data segment of the client number data, to obtain a processing result; and a result unit 42 for determining a plurality of service units based on the processing result.
In one embodiment, the communication connection between the provider and the consumer is based on SpringCloud technology stacks.
In one embodiment, the communication connection between the provider and the consumer is based on Dubbo technology stacks.
Based on the same inventive concept, the embodiment of the invention also provides a computer device embodiment for realizing all or part of the content in the above-mentioned registry access method. The computer equipment specifically comprises the following contents:
A processor (processor), a memory (memory), a communication interface (Communications Interface), and a bus; the processor, the memory and the communication interface complete communication with each other through the bus; the communication interface is used for realizing information transmission between related devices; the computer device may be a desktop computer, a tablet computer, a mobile terminal, or the like, and the embodiment is not limited thereto. In this embodiment, the computer device may be implemented with reference to the embodiment for implementing the above-mentioned registry access method and the embodiment for implementing the above-mentioned registry access device, and the contents thereof are incorporated herein, and the repetition is omitted.
Fig. 6 is a schematic diagram of a system composition structure of a computer device according to an embodiment of the present invention. As shown in fig. 6, the computer device 70 may include a processor 701 and a memory 702; a memory 702 is coupled to the processor 701. Notably, this fig. 6 is exemplary; other types of structures may also be used in addition to or in place of the structures to implement telecommunications functions or other functions.
In one embodiment, the functionality implemented by the registry access method may be integrated into the processor 701. Wherein the processor 701 may be configured to control:
Acquiring service name information, and judging the level information of the micro service according to the service name information; if the level information is the calling level in the product, the registration information is sent to a second-level registration center through the providing direction of the micro service, and subscription information is acquired from the second-level registration center through the consumer of the micro service; if the level information is the cross-product calling level, the registration information is sent to the first-level registration center through the providing direction of the micro-service, and the subscription information is acquired from the first-level registration center through the consumer of the micro-service.
As can be seen from the above, after determining the level information of the micro service, the computer device provided in the embodiment of the present invention accesses the first-level registry and the second-level registry in a classified manner, thereby alleviating the access pressure of the registries; the method realizes the isolation of global and local services through the two-stage registries, and avoids the influence of failure of any one stage of registries on the service of another stage of registries.
In another embodiment, the registry access device may be configured separately from the processor 701, for example, the registry access device may be configured as a chip connected to the processor 701, and the functions of the registry access method are implemented by the control of the processor.
As shown in fig. 6, the computer device 70 may further include: a communication module 703, an input unit 704, an audio processing unit 705, a display 706, a power supply 707. It is noted that the computer device 70 need not include all of the components shown in FIG. 6; in addition, the computer device 70 may further include components not shown in fig. 6, to which reference is made to the prior art.
As shown in fig. 6, the processor 701, sometimes also referred to as a controller or operational control, may include a microprocessor or other processor device and/or logic device, with the processor 701 receiving inputs and controlling the operation of the various components of the computer device 70.
The memory 702 may be, for example, one or more of a buffer, a flash memory, a hard drive, a removable media, a volatile memory, a non-volatile memory, or other suitable device. The information about failure may be stored, and a program for executing the information may be stored. And the processor 701 can execute the program stored in the memory 702 to realize information storage or processing, and the like.
The input unit 704 provides input to the processor 701. The input unit 704 is, for example, a key or a touch input device. The power supply 707 is used to provide power to the computer device 70. The display 706 is used for displaying display objects such as images and characters. The display may be, for example, but not limited to, an LCD display.
The memory 702 may be a solid state memory such as Read Only Memory (ROM), random Access Memory (RAM), SIM card, and the like. But also a memory which holds information even when powered down, can be selectively erased and provided with further data, an example of which is sometimes referred to as EPROM or the like. The memory 702 may also be some other type of device. The memory 702 includes a buffer memory 7021 (sometimes referred to as a buffer). The memory 702 may include an application/function storage 7022, the application/function storage 7022 storing application programs and function programs or a flow for executing operations of the computer device 70 by the processor 701.
The memory 702 may also include a data store 7023, the data store 7023 for storing data, such as contacts, digital data, pictures, sounds, and/or any other data used by a computer device. The driver storage 7024 of the memory 702 may include various drivers for the computer device for communication functions and/or for performing other functions of the computer device (e.g., messaging applications, address book applications, etc.).
The communication module 703 is a transmitter/receiver that transmits and receives signals via the antenna 708. A communication module (transmitter/receiver) 703 is coupled to the processor 701 to provide input signals and to receive output signals, as may be the case with conventional mobile communication terminals.
Based on different communication technologies, a plurality of communication modules 703, such as a cellular network module, a bluetooth module, and/or a wireless local area network module, etc., may be provided in the same computer device. The communication module (transmitter/receiver) 703 is further coupled to a speaker 709 and a microphone 710 via an audio processing unit 705 to provide an audio output via the speaker 709 and to receive an audio input from the microphone 710, thereby implementing usual telecommunication functions. The audio processing unit 705 can include any suitable buffers, decoders, amplifiers and so forth. In addition, an audio processing unit 705 is also coupled to the processor 701 so that sound can be recorded locally through a microphone 710 and so that sound stored locally can be played through a speaker 709.
An embodiment of the present invention further provides a computer readable storage medium for implementing all the steps of the registry accessing method in the above embodiment, where the computer readable storage medium stores a computer program, and when the computer program is executed by a processor, the computer program implements all the steps of the registry accessing method in the above embodiment, for example, the processor implements the following steps when executing the computer program:
Acquiring service name information, and judging the level information of the micro service according to the service name information; if the level information is the calling level in the product, the registration information is sent to a second-level registration center through the providing direction of the micro service, and subscription information is acquired from the second-level registration center through the consumer of the micro service; if the level information is the cross-product calling level, the registration information is sent to the first-level registration center through the providing direction of the micro-service, and the subscription information is acquired from the first-level registration center through the consumer of the micro-service.
As can be seen from the above, the computer readable storage medium provided in the embodiments of the present invention, after determining the level information of the micro service, accesses the first level registry and the second level registry in a hierarchical manner, thereby relieving the access pressure of the registries; the method realizes the isolation of global and local services through the two-stage registries, and avoids the influence of failure of any one stage of registries on the service of another stage of registries.
Embodiments of the present invention also provide a computer program product comprising a computer program which, when executed by a processor, implements the above-described registry access method.
It should be noted that, in the technical scheme of the application, the acquisition, storage, use, processing and the like of the data all conform to the relevant regulations of national laws and regulations.
Although the invention provides method operational steps as described in the examples or flowcharts, more or fewer operational steps may be included based on conventional or non-inventive labor. The order of steps recited in the embodiments is merely one way of performing the order of steps and does not represent a unique order of execution. When implemented by an actual device or client product, the instructions may be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment) as shown in the embodiments or figures.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, as relevant to see a section of the description of method embodiments.
In this document, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. The orientation or positional relationship indicated by the terms "upper", "lower", etc. are based on the orientation or positional relationship shown in the drawings, are merely for convenience of description and to simplify the description, and are not indicative or implying that the apparatus or elements in question must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be construed as limiting the present invention.
Unless specifically stated or limited otherwise, the terms "mounted," "connected," and "coupled" are to be construed broadly, and may be, for example, fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; can be directly connected or indirectly connected through an intermediate medium, and can be communication between two elements. The specific meaning of the above terms in the present invention can be understood by those of ordinary skill in the art according to the specific circumstances.
It should be noted that, without conflict, the embodiments of the present invention and features of the embodiments may be combined with each other. The present invention is not limited to any single aspect, nor to any single embodiment, nor to any combination and/or permutation of these aspects and/or embodiments. Each aspect and/or embodiment of the invention may be used alone or in combination with one or more other aspects and/or embodiments.
Finally, it should be noted that: the above examples are only specific embodiments of the present invention, and are not intended to limit the scope of the present invention, but it should be understood by those skilled in the art that the present invention is not limited thereto, and that the present invention is described in detail with reference to the foregoing examples: any person skilled in the art may modify or easily conceive of the technical solution described in the foregoing embodiments, or perform equivalent substitution of some of the technical features, while remaining within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention, and are intended to be included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (11)
1. A method for registry access, comprising:
Acquiring service name information, and judging the level information of the micro service according to the service name information; the level information comprises an intra-product calling level and a cross-product calling level; if the service name information comprises a preset first field, determining that the micro service is of an intra-product calling level, and if the service name information comprises a preset second field, determining that the micro service is of an inter-product calling level;
if the level information is a calling level in the product, transmitting registration information to a second-level registry through the provision direction of the micro service, and acquiring subscription information from the second-level registry through a consumer of the micro service; the second level registry is a local registry;
If the level information is a cross-product calling level, transmitting registration information to a first-level registry through the provision direction of the micro service, and acquiring subscription information from the first-level registry through a consumer of the micro service; the first level registry is a global registry;
before judging the level information of the micro service according to the service name information, the method further comprises the following steps:
Determining a plurality of service units based on the target customer information; each service unit comprises a service gateway and a plurality of application nodes; the target client information is used for identifying different clients and setting different service units for the different clients; the service gateway is used for accessing the first-level registration center, and the application node is used for executing micro-service;
the target client information is client number data;
Determining a plurality of service units based on the target customer information, comprising:
performing hash modulo operation on a target data segment of the client number data to obtain a processing result, and determining a plurality of service units based on the processing result; the target data segment is the tail number of the client number;
performing hash modulo operation on the target data segment of the client number data to obtain a processing result, and determining a plurality of service units based on the processing result, wherein the hash modulo operation comprises the following steps:
Carrying out hash modulo calculation on the tail number, classifying clients according to calculation results, and determining a service unit for each classification result.
2. The method as recited in claim 1, further comprising:
And if the level information is the cross-product calling level, sending registration information to a first registry through the service gateway, and acquiring subscription information from the first level registry through the consumer of the micro service.
3. The method of claim 2, wherein the provider and consumer are communicatively coupled based on SpringCloud technology stacks.
4. The method of claim 1, wherein the provider and consumer are communicatively coupled based on Dubbo technology stacks.
5. A registry access device, comprising:
The level determining module is used for acquiring service name information and judging the level information of the micro service according to the service name information; the level information comprises an intra-product calling level and a cross-product calling level; if the service name information comprises a preset first field, determining that the micro service is of an intra-product calling level, and if the service name information comprises a preset second field, determining that the micro service is of an inter-product calling level;
The first access module is used for sending registration information to a second-level registration center through the provision of the micro service if the level information is a calling level in the product, and acquiring subscription information from the second-level registration center through a consumer of the micro service; the second level registry is a local registry;
The second access module is used for sending registration information to a first-level registration center through the provision direction of the micro service and acquiring subscription information from the first-level registration center through the consumer of the micro service if the level information is a cross-product calling level; the first level registry is a global registry;
the apparatus further comprises a service unit module for:
Determining a plurality of service units based on the target customer information; each service unit comprises a service gateway and a plurality of application nodes; the target client information is used for identifying different clients and setting different service units for the different clients; the service gateway is used for accessing the first-level registration center, and the application node is used for executing micro-service;
the target client information is client number data; the service unit module includes:
the hash unit is used for carrying out hash modulo operation on the target data segment of the client number data to obtain a processing result, and determining a plurality of service units based on the processing result; the target data segment is the tail number of the client number;
a result unit configured to determine a plurality of service units based on the processing result;
Hash unit, still be used for:
carrying out hash modular computation on the tail number, and classifying clients according to the computation result;
A result unit for:
A service unit is determined for each classification result.
6. The apparatus of claim 5, wherein the second access module is further configured to:
And if the level information is the cross-product calling level, sending registration information to a first registry through the service gateway, and acquiring subscription information from the first level registry through the consumer of the micro service.
7. The apparatus of claim 6, wherein the provider and consumer are communicatively coupled based on SpringCloud technology stacks.
8. The apparatus of claim 5, wherein the provider and consumer are communicatively coupled based on Dubbo technology stacks.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the registry access method of any of claims 1 to 4 when the computer program is executed.
10. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program which, when executed by a processor, implements the registry access method of any of claims 1 to 4.
11. A computer program product, characterized in that it comprises a computer program which, when executed by a processor, implements the method of access to a registry of any of claims 1 to 4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210585899.2A CN114979280B (en) | 2022-05-27 | 2022-05-27 | Registration center access method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210585899.2A CN114979280B (en) | 2022-05-27 | 2022-05-27 | Registration center access method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114979280A CN114979280A (en) | 2022-08-30 |
CN114979280B true CN114979280B (en) | 2024-04-19 |
Family
ID=82955382
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210585899.2A Active CN114979280B (en) | 2022-05-27 | 2022-05-27 | Registration center access method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114979280B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117155994B (en) * | 2023-10-27 | 2024-02-02 | 广州市千钧网络科技有限公司 | Service registration management method, device, equipment and readable storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111147588A (en) * | 2019-12-27 | 2020-05-12 | 上海浦东发展银行股份有限公司 | Method and system for realizing cross-domain and cross-center communication in enterprise-level micro service platform |
CN111866140A (en) * | 2020-07-21 | 2020-10-30 | 腾讯科技(深圳)有限公司 | Fusion management apparatus, management system, service calling method, and medium |
CN114172966A (en) * | 2021-12-07 | 2022-03-11 | 中国工商银行股份有限公司 | Service calling method and device and service processing method and device under unitized architecture |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9560055B2 (en) * | 2014-04-30 | 2017-01-31 | Microsoft Technology Licensing, Llc | Client-side integration framework of services |
CN109618005B (en) * | 2019-01-18 | 2020-12-08 | 华为终端有限公司 | Method for calling server and proxy server |
-
2022
- 2022-05-27 CN CN202210585899.2A patent/CN114979280B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111147588A (en) * | 2019-12-27 | 2020-05-12 | 上海浦东发展银行股份有限公司 | Method and system for realizing cross-domain and cross-center communication in enterprise-level micro service platform |
CN111866140A (en) * | 2020-07-21 | 2020-10-30 | 腾讯科技(深圳)有限公司 | Fusion management apparatus, management system, service calling method, and medium |
CN114172966A (en) * | 2021-12-07 | 2022-03-11 | 中国工商银行股份有限公司 | Service calling method and device and service processing method and device under unitized architecture |
Non-Patent Citations (1)
Title |
---|
一种基于微服务的应用框架;张晶;黄小锋;;计算机系统应用;20160915(第09期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN114979280A (en) | 2022-08-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111031058A (en) | Websocket-based distributed server cluster interaction method and device | |
CN110764881A (en) | Distributed system background retry method and device | |
CN109586929B (en) | Conference content transmission method and device, electronic equipment and storage medium | |
CN114979280B (en) | Registration center access method and device | |
CN103380634A (en) | Methods and apparatus for transmitting data | |
CN111367988A (en) | Data import method and device | |
CN113435989A (en) | Financial data processing method and device | |
CN111371695B (en) | Service flow limiting method and device | |
CN113612825B (en) | Internet of things message middleware server cluster expansion method and system | |
CN112328413B (en) | Application service calling method, device and system | |
CN110324167B (en) | Configuration method, device and system of service governance rules and electronic equipment | |
CN111782260A (en) | Gray scale distribution method and gray scale distribution device | |
CN101840405A (en) | Digital photo frame, digital player system and file sharing method | |
CN106161431A (en) | Call method for building up and system | |
CN116647552A (en) | Service processing method and system in heterogeneous micro-service cluster, terminal and storage medium | |
CN115412610A (en) | Flow scheduling method and device under fault scene | |
CN113159752A (en) | Method and device for generating account transfer transaction certificate | |
CN114697339A (en) | Load balancing method and device under centralized architecture | |
CN112616143B (en) | Method and device for distributing communication numbers, electronic equipment and storage medium | |
CN110324425B (en) | Hybrid cloud transaction route processing method and device | |
CN113312190A (en) | Cooperative processing method and device for government affair service business | |
CN111859041A (en) | Data transmission method and device | |
CN116069855A (en) | Distributed service routing method and device | |
CN110336847B (en) | Payment message transmission system and method | |
CN112968954B (en) | Flow control method, server and system for service migration |
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 |