CN117749893A - Calling method, device, computer and storage medium for service among service clusters - Google Patents
Calling method, device, computer and storage medium for service among service clusters Download PDFInfo
- Publication number
- CN117749893A CN117749893A CN202311567974.3A CN202311567974A CN117749893A CN 117749893 A CN117749893 A CN 117749893A CN 202311567974 A CN202311567974 A CN 202311567974A CN 117749893 A CN117749893 A CN 117749893A
- Authority
- CN
- China
- Prior art keywords
- service
- cluster
- domain name
- information
- address information
- 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.)
- Pending
Links
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The application discloses a method, a device, a computer device and a storage medium for calling service among service clusters, comprising the following steps: acquiring service and address information in a first service cluster and a second service cluster; registering the service in association with address information to an independent domain name server; in response to receiving a service call instruction from a first service cluster, analyzing domain name suffix information and service query information contained in the service call instruction; when the domain name suffix information meets a first condition, acquiring corresponding target service in the first service cluster according to the acquired target service; when the domain name suffix information meets a second condition, acquiring corresponding target service based on the independent domain name server, and calling the target service in a first service cluster; wherein the target service is located in a second service cluster. Through dynamic service registration and access mechanism, continuous interconnection and interworking among the service clusters are ensured, and service calling efficiency among the service clusters is improved.
Description
Technical Field
The present invention relates to the field of service configuration among service clusters, and in particular, to a method and apparatus for calling a service among service clusters, a computer device, and a computer storage medium.
Background
Service discovery is a problem to be overcome between service clusters and cross-service clusters, at present, most of services used by service calling among the service clusters are fixed and static, and for dynamic services of static services different from physical or virtual host IP, calling logic of the static services cannot effectively access and call dynamic services registered in another service cluster in one service cluster in a cross-cluster manner, so that the problem of low calling efficiency of the cross-cluster service among the service clusters at present occurs, and discovery, access and calling of the cross-cluster service among the service clusters cannot be efficiently performed.
Disclosure of Invention
The invention aims to provide a method and a device for calling service among service clusters, computer equipment and a computer storage medium, so as to at least solve the problem of low calling efficiency of cross-cluster service among different service clusters at present.
In order to solve the above technical problems, the present invention provides a method for calling service between service clusters, including:
Acquiring services in a first service cluster and a second service cluster and address information of each service;
registering the service in association with address information to an independent domain name server;
in response to receiving a service call instruction from a first service cluster, analyzing domain name suffix information and service query information contained in the service call instruction;
when the domain name suffix information meets a first condition, acquiring a corresponding target service from a domain name server of the first service cluster according to the service inquiry information, and calling the target service according to the address information of the target service;
when the domain name suffix information meets a second condition, acquiring corresponding target service based on the independent domain name server, and calling the target service in a first service cluster; wherein the target service is located in a second service cluster.
Optionally, the obtaining, based on the independent domain name server, the corresponding target service according to the service query information includes:
acquiring corresponding target service according to the service inquiry information in the service registration information of the independent domain name server; and/or the number of the groups of groups,
and determining a second service cluster based on the independent domain name server according to the service query information, forwarding the service query information to the second service cluster, and acquiring target service acquired by the second service cluster according to the service query information.
Optionally, the obtaining the services in the first service cluster and the second service cluster and the address information of each service includes:
acquiring a root domain name of a service cluster; the service clusters comprise a first service cluster and a second service cluster;
recursively inquiring the services in the service cluster according to the root domain name, and acquiring address information of each service; wherein the address information includes real-time, dynamic IP address information.
Optionally, after the registering the service and the address information in association with the independent domain name server, the method further includes:
monitoring for changes to services within the service cluster;
when the address information of the service is updated, acquiring the latest address information of the service;
and sending the latest address information of the service to an independent domain name server so as to update the address information of the corresponding service in the independent domain name server.
Optionally, the registering the service in association with the address information to a separate domain name server includes:
acquiring call authorization information of the service;
and when the call authorization information meets the preset condition, registering the service and the address information in association with an independent domain name server.
Optionally, when the domain name suffix information meets a second condition, acquiring a corresponding target service based on the independent domain name server according to the service query information, and returning address information of the target service to the first service cluster, and further including:
acquiring access calling authority of a first service cluster;
verifying whether the first service cluster has access rights to the services of the second service cluster according to the access calling rights;
if yes, accessing the target service according to the address information;
and after the target service is successfully accessed, establishing connection between the first service cluster and the target service so as to call the target service.
Optionally, after the target service is successfully accessed, establishing a connection between the first service cluster and the target service to invoke the target service, the method further includes:
determining the term of access call according to the access call authority;
and when the deadline is reached, disconnecting the first service cluster from the target service so as to suspend the first service cluster from calling the target service.
In order to solve the above technical problem, an embodiment of the present invention further provides a device for calling a service between service clusters, including:
The service acquisition module is used for acquiring the services in the first service cluster and the second service cluster and the address information of each service;
a service registration module for registering the service and address information in association with an independent domain name server;
the instruction receiving module is used for responding to a service calling instruction received from the first service cluster and analyzing domain name suffix information and service inquiry information contained in the service calling instruction;
the intra-cluster calling module is used for acquiring corresponding target service from the domain name server of the first service cluster according to the service inquiry information when the domain name suffix information meets a first condition, and calling the target service according to the address information of the target service;
the cross-cluster calling module is used for acquiring corresponding target service according to the service query information based on the independent domain name server when the domain name suffix information meets a second condition, and returning the address information of the target service to the first service cluster so as to call the target service in the first service cluster; wherein the target service is located in a second service cluster.
Optionally, the cross-cluster call module is further configured to:
Acquiring corresponding target service according to the service inquiry information in the service registration information of the independent domain name server; and/or the number of the groups of groups,
and determining a second service cluster based on the independent domain name server according to the service query information, forwarding the service query information to the second service cluster, and acquiring target service acquired by the second service cluster according to the service query information.
Optionally, the service acquisition module is further configured to:
acquiring a root domain name of a service cluster; the service clusters comprise a first service cluster and a second service cluster;
recursively inquiring the services in the service cluster according to the root domain name, and acquiring address information of each service; wherein the address information includes real-time, dynamic IP address information.
Optionally, the service registration module is further configured to:
monitoring for changes to services within the service cluster;
when the address information of the service is updated, acquiring the latest address information of the service;
and sending the latest address information of the service to an independent domain name server so as to update the address information of the corresponding service in the independent domain name server.
Optionally, the service registration module is further configured to;
Acquiring call authorization information of the service;
and when the call authorization information meets the preset condition, registering the service and the address information in association with an independent domain name server.
Optionally, the cross-cluster call module is further configured to;
acquiring access calling authority of a first service cluster;
verifying whether the first service cluster has access rights to the services of the second service cluster according to the access calling rights;
if yes, accessing the target service according to the address information;
and after the target service is successfully accessed, establishing connection between the first service cluster and the target service so as to call the target service.
Optionally, the method further comprises a call deadline module for:
determining the term of access call according to the access call authority;
and when the deadline is reached, disconnecting the first service cluster from the target service so as to suspend the first service cluster from calling the target service.
In order to solve the above technical problem, an embodiment of the present invention further provides a computer device, including a memory and a processor, where the memory stores computer readable instructions, and when the computer readable instructions are executed by the processor, the processor is caused to execute the steps of the method for calling the service between service clusters.
To solve the above technical problem, an embodiment of the present invention further provides a storage medium storing computer readable instructions, where the computer readable instructions when executed by one or more processors cause the one or more processors to execute the steps of the method for calling the service between service clusters.
The beneficial effects of the invention are: the method comprises the steps of obtaining services in a first service cluster and a second service cluster and address information of each service; registering the service in association with address information to an independent domain name server; in response to receiving a service call instruction from a first service cluster, analyzing domain name suffix information and service query information contained in the service call instruction; when the domain name suffix information meets a first condition, acquiring a corresponding target service from a domain name server of the first service cluster according to the service inquiry information, and calling the target service according to the address information of the target service; when the domain name suffix information meets a second condition, acquiring corresponding target service based on the independent domain name server, and calling the target service in a first service cluster; the target service is located in the second service cluster, registered services of different service clusters are stored through deploying independent domain name servers, and the target service is used as a medium for accessing and calling services among the cross-service clusters, service information of other service clusters is not required to be stored in each service cluster in a redundant mode, service access and calling among the cross-service clusters can be completed only by inquiring according to requirements, maintenance cost is low, calling efficiency of dynamic services among the cross-service clusters can be effectively improved, and interconnection and intercommunication among the services are guaranteed.
Drawings
The foregoing and/or additional aspects and advantages of the present application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings, in which:
FIG. 1 is a basic flow diagram of a method for calling service among service clusters according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a basic structure of a service calling device between service clusters according to an embodiment of the present application;
fig. 3 is a basic structural block diagram of a computer device according to an embodiment of the present application.
Detailed Description
Embodiments of the present application are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals refer to the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the drawings are exemplary only for the purpose of illustrating the present application and are not to be construed as limiting the present application.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless expressly stated otherwise, as understood by those skilled in the art. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It will be understood by those skilled in the art that all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs unless defined otherwise. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
As will be appreciated by those skilled in the art, a "terminal" as used herein includes both devices of a wireless signal receiver that have only wireless signal receivers without transmitting capabilities and devices of receiving and transmitting hardware that have devices capable of performing two-way communications over a two-way communications link. Such a device may include: a cellular or other communication device having a single-line display or a multi-line display or a cellular or other communication device without a multi-line display; a PCS (Personal Communications Service, personal communication system) that may combine voice, data processing, facsimile and/or data communication capabilities; a PDA (Personal Digital Assistant ) that can include a radio frequency receiver, pager, internet/intranet access, web browser, notepad, calendar and/or GPS (Global Positioning System ) receiver; a conventional laptop and/or palmtop computer or other appliance that has and/or includes a radio frequency receiver. As used herein, a "terminal" may be portable, transportable, installed in a vehicle (aeronautical, maritime, and/or land-based), or adapted and/or configured to operate locally and/or in a distributed fashion, to operate at any other location(s) on earth and/or in space. The "terminal" used herein may also be a communication terminal, a network access terminal, a music/video playing terminal, for example, a PDA, a MID (Mobile Internet Device ) and/or a mobile phone with music/video playing function, and may also be a smart tv, a set-top box, etc.
The hardware referred to by the names "server", "client", "service node" and the like in the present application is essentially an electronic device having the performance of a personal computer, and is a hardware device having necessary components disclosed by von neumann's principle, such as a central processing unit (including an arithmetic unit and a controller), a memory, an input device, and an output device, and a computer program is stored in the memory, and the central processing unit calls the program stored in the external memory to run in the memory, executes instructions in the program, and interacts with the input/output device, thereby completing a specific function.
It should be noted that the concept of "server" as referred to in this application is equally applicable to the case of a server farm. The servers should be logically partitioned, physically separate from each other but interface-callable, or integrated into a physical computer or group of computers, according to network deployment principles understood by those skilled in the art. Those skilled in the art will appreciate this variation and should not be construed as limiting the implementation of the network deployment approach of the present application.
One or several technical features of the present application, unless specified in the plain text, may be deployed either on a server to implement access by remotely invoking an online service interface provided by the acquisition server by a client, or directly deployed and run on the client to implement access.
The neural network model cited or possibly cited in the application can be deployed on a remote server and used for implementing remote call on a client, or can be deployed on a client with sufficient equipment capability for direct call unless specified in a clear text, and in some embodiments, when the neural network model runs on the client, the corresponding intelligence can be obtained through migration learning so as to reduce the requirement on the running resources of the hardware of the client and avoid excessively occupying the running resources of the hardware of the client.
The various data referred to in the present application, unless specified in the plain text, may be stored either remotely in a server or in a local terminal device, as long as it is suitable for being invoked by the technical solution of the present application.
Those skilled in the art will appreciate that: although the various methods of the present application are described based on the same concepts so as to be common to each other, the methods may be performed independently, unless otherwise indicated. Similarly, for each of the embodiments disclosed herein, the concepts presented are based on the same inventive concept, and thus, the concepts presented for the same description, and concepts that are merely convenient and appropriately altered although they are different, should be equally understood.
The various embodiments to be disclosed herein, unless the plain text indicates a mutually exclusive relationship with each other, the technical features related to the various embodiments may be cross-combined to flexibly construct a new embodiment, so long as such combination does not depart from the inventive spirit of the present application and can satisfy the needs in the art or solve the deficiencies in the prior art. This variant will be known to the person skilled in the art.
Referring to fig. 1, fig. 1 is a basic flow chart of a method for calling services between service clusters according to the present embodiment.
As shown in fig. 1, includes:
s1100, acquiring services in a first service cluster and a second service cluster, and address information of each service;
the embodiment is applied to a scenario of service call among cross clusters in a distributed service cluster system and a micro service architecture, service discovery (service discovery) is a basic stone for interconnection and interworking between the distributed system and the micro service architecture, and services in the service clusters are different from static services of a physical or virtual host computer IP, but are dynamic services of a dynamic IP which are automatically generated in a container based on dynamic deployment of a Kubernetes cluster, namely, the services are continuously changed, updated, dynamically expanded and destroyed. In order to discover and call services in different clusters, based on this, the present embodiment proposes and designs a method for calling services between service clusters, firstly, obtaining services in a first service cluster and a second service cluster, and address information of each service, where the first service cluster and the second service cluster refer to different sub-service clusters in the service clusters, and are not specific two sub-service clusters, and may be understood that the first service cluster and the second service cluster characterize all sub-service clusters in a service inlet cluster, and then, by maintaining a service discovery and registration plug-in, obtain services in the first service cluster and the second service cluster, and further, in order to implement call of services, address information corresponding to each service needs to be obtained.
It should be noted that the service discovery and registration plugin of this embodiment may be configured to be associated with each sub-service group, that is, associated with the first service cluster and the second service cluster, and then discover the registrable service from the first service cluster and the second service cluster, and obtain address information corresponding to the service from the first service cluster and the second service cluster.
It should be noted that, since the services in the service clusters are dynamic, a preset time interval may be set, and after every preset time interval, the services in the first service cluster and the second service cluster and the address information of each service are obtained; or, obtaining the change information of the service in the first service cluster and the second service cluster, so as to maintain the timeliness of the service.
It should be noted that the naming or the form of different services in different service clusters is different, and after the services in the first service cluster and the second service cluster are acquired, the services are converted into the service reading form with the specified format, so that the services are convenient to manage.
It should be noted that the naming or form of the different services can be identified by AI and then converted into a service reading form in a specified format.
S1200, registering the service and the address information in association with an independent domain name server;
after obtaining the services in the first service cluster and the second service cluster and the address information of each service, the service and the address information are associated and registered to an independent domain name server, and the embodiment maintains an independent domain name server which can intensively cache different services or can be used as the medium of service inquiry crossing the clusters.
It should be noted that when registering the service and the address information in association with an independent domain name server, the service may be classified according to the cluster source of the service and then sequentially registered in the independent domain name server; the service types may be classified, and then the classified service is registered in the independent domain name server, or classified according to service usage frequency.
It should be noted that in the independent domain name server, a specific number of services may be registered, and when the registered services reach an upper limit, a part of the services are filtered according to a preset rule and deleted from the registered service list to manage storage resources of the independent server.
S1300, responding to a service calling instruction received from a first service cluster, and analyzing domain name suffix information and service inquiry information contained in the service calling instruction;
after obtaining services in a first service cluster and a second service cluster and address information of each service, registering the services and the address information in association with an independent domain name server, responding to a service calling instruction received from the first service cluster, and analyzing domain name suffix information and service query information contained in the service calling instruction. When a service call instruction from one sub-service cluster is received, the sub-service cluster may be any one of the service clusters, and the first service cluster is described in this embodiment, but the first service cluster is not a specific sub-service cluster in the protected service cluster. When a service calling instruction from a first service cluster is received, the service calling instruction is analyzed at the moment when the service calling instruction is required to be called, and domain name suffix information and service query information contained in the service calling instruction are obtained, wherein the domain name suffix information can be used for locating the service cluster corresponding to the service to be called, and the service query information can be used for obtaining the information of the service to be called and establishing connection with the information of the service to be called.
It should be noted that, in one scenario, the response to receiving the service call instruction from the first service cluster may be that, in an application program, services corresponding to functions of different modules are stored in different sub-service clusters, and when one module needs to call a function of another module, that is, the service corresponding to the function of another module needs to be called, at this time, the service call instruction is generated.
S1400, when the domain name suffix information meets a first condition, acquiring a corresponding target service from a domain name server of the first service cluster according to the service inquiry information, and calling the target service according to the address information of the target service;
after the domain name suffix information and the service query information contained in the service call instruction are resolved, in this embodiment, different domain name suffixes are used when the service names in different service clusters are used, so that when the domain name suffix information in the domain name suffix information is determined that the service to be accessed and called is located in a first service cluster or a second service cluster, when the domain name suffix information meets a first condition, a corresponding target service is obtained in a domain name server of the first service cluster according to the service query information, and the target service is called according to the address information of the target service.
S1500, when the domain name suffix information meets a second condition, acquiring a corresponding target service based on the independent domain name server, and calling the target service in a first service cluster; wherein the target service is located in a second service cluster.
After the domain name suffix information and the service query information contained in the service calling instruction are analyzed, when the domain name suffix information meets a second condition, acquiring a corresponding target service based on the independent domain name server, and calling the target service in a first service cluster; in this embodiment, if the domain name information is a short domain name, the short domain name may also be understood as a no-suffix domain name, or the domain name information is another suffix domain name, that is, there is a suffix domain name but the suffix domain name is not matched with the suffix domain name of the first service cluster, when it is determined that the suffix information of the domain name included in the service calling instruction sent from the first service cluster meets the second condition, at this time, a corresponding target service is obtained based on the independent domain name server, and then the target service is called in the first service cluster; the target service is located in the second service cluster, so that the call of the target service existing in the second service cluster in the first service cluster is completed, registered services of different service clusters are stored through deploying independent domain name servers, service information of other clusters is not required to be stored in each cluster in a redundancy mode, service access and call among clusters can be completed only by inquiring according to requirements, maintenance cost is reduced, the call of dynamic service among clusters can be effectively improved, and interconnection and intercommunication among the services are guaranteed.
In the above embodiment, the service in the first service cluster and the second service cluster and the address information of each service are obtained; registering the service in association with address information to an independent domain name server; in response to receiving a service call instruction from a first service cluster, analyzing domain name suffix information and service query information contained in the service call instruction; when the domain name suffix information meets a first condition, acquiring a corresponding target service from a domain name server of the first service cluster according to the service inquiry information, and calling the target service according to the address information of the target service; when the domain name suffix information meets a second condition, acquiring corresponding target service based on the independent domain name server, and calling the target service in a first service cluster; the target service is located in the second service cluster, registered services of different service clusters are stored through deploying independent domain name servers, and the target service is used as a medium for accessing and calling services among the cross-service clusters, service information of other service clusters is not required to be stored in each service cluster in a redundant mode, service access and calling among the cross-service clusters can be completed only by inquiring according to requirements, maintenance cost is low, calling efficiency of dynamic services among the cross-service clusters can be effectively improved, and interconnection and intercommunication among the services are guaranteed.
In some embodiments, the obtaining, in S1500, the corresponding target service according to the service query information based on the independent domain name server includes:
s1511, acquiring corresponding target service according to the service inquiry information in the service registration information of the independent domain name server; and/or;
in one embodiment, the obtaining the corresponding target service based on the independent domain name server according to the service query information, specifically, in the service registration information of the independent domain name server, obtaining the corresponding target service according to the service query information, because the independent domain name server can store the service registered by the service cluster, the independent domain name server can quickly obtain the corresponding target service according to the service query information, in addition, the independent domain name server can also cache the query result of the service, after a service to be invoked by a first service cluster is obtained by the independent domain name server, the independent domain name server stores the relationship between the service query information and the corresponding target service, and when the service to be invoked by the next first service cluster is the same, the corresponding target service can be quickly obtained from the cached service.
S1512, determining a second service cluster based on the independent domain name server according to the service query information, forwarding the service query information to the second service cluster, and acquiring target service acquired by the second service cluster according to the service query information.
In one embodiment, the obtaining the corresponding target service based on the independent domain name server according to the service query information, specifically, determining a second service cluster based on the independent domain name server according to the service query information, forwarding the service query information to the second service cluster, obtaining the target service obtained by the second service cluster according to the service query information, that is, the independent domain name server serves as a medium of service query, determining the corresponding second service cluster according to the domain name suffix information, forwarding the service query information to the second service cluster, obtaining the target service in the second service cluster, returning the information of the target service to the independent domain name server by the second service cluster, and forwarding the information of the target service to the first service cluster by the independent domain name server to complete the first service cluster to obtain the target service in the second service cluster.
It may be noted that the independent domain name server may be used alone to store registered services, may be used alone as a medium for service query, or may be used as a medium for service query to obtain a target service from the second service cluster when the target service cannot be found in the stored registered services, so as to complete service call among the service clusters.
According to the embodiment, the independent domain name server is deployed to store registered services of different service clusters, the registered services are used as media for cross-service inter-cluster service access and call, service information of other service clusters is not required to be stored in each service cluster in a redundant mode, the cross-cluster service access and call can be completed only by inquiring according to needs, the maintenance cost is low, the call efficiency of the cross-cluster dynamic service can be effectively improved, and interconnection and intercommunication among the services are ensured.
In some embodiments, obtaining the services in the first service cluster and the second service cluster and the address information of each service in S1100 includes:
s1111, obtaining a root domain name of a service cluster; the service clusters comprise a first service cluster and a second service cluster;
in one embodiment, a process of acquiring services in a first service cluster and a second service cluster and address information of each service includes firstly acquiring a root domain name of the service cluster; the service clusters comprise a first service cluster and a second service cluster, namely, in the whole service clusters, root domain names of all the service clusters are obtained, the root domain names of all the service clusters, namely, root domain names of all the sub-service clusters in the service clusters, comprise the first service cluster and the second service clusters, the root domain names of the service clusters are used for distinguishing different service clusters, and in the same service clusters, other services except for the service with short domain names comprise the information of the root domain names of the responsive service clusters, and each service in the service clusters can be conveniently managed through the root domain names.
S1112, recursively inquiring the services in the service cluster according to the root domain name, and acquiring the address information of each service; wherein the address information includes real-time, dynamic IP address information.
Acquiring a root domain name of a service cluster; after the service clusters comprise a first service cluster and a second service cluster, recursively inquiring the services in the service clusters according to the root domain name, traversing the services which can be accessed in the service clusters in a recursion inquiry mode, wherein the recursion inquiry has a certain authority, and a scene that one service in the service clusters can not be called by other service clusters exists, so that the services in the service clusters can traverse the services which can be accessed and called by other service clusters in the service clusters according to the root domain name recursion inquiry, and acquiring the address information of each service while acquiring each service; the address information comprises real-time and dynamic IP address information, namely the address information of the service is the IP address information of the service, and the address information can be changed in real time and dynamically.
According to the embodiment, the service in the service cluster is recursively inquired through the root domain name, and the address information of each service is acquired, so that the dynamic tracking of the address information of the service is maintained, and the timeliness of service access and calling is improved.
In some embodiments, after S1100 registers the service and address information in association with a separate domain name server, the method further includes:
s1211, monitoring for changes to services within the service cluster;
after registering the service and the address information in association with the independent domain name server, monitoring the change of the service in the service cluster, and monitoring the change of the service in the service cluster by configuring a monitoring mechanism, including the new addition of the service, the update of the service information and the destruction of the existing service, wherein the monitoring mechanism can monitor the change of the service in the service cluster by monitoring the log file of the service cluster.
S1212, when the address information of the service is updated, acquiring the latest address information of the service;
after monitoring the change of the service in the service cluster, when the address information of the service is updated, acquiring the latest address information of the service, wherein when the service is newly added, the address information of the newly added service is acquired; when the address information of the original service is updated, the latest address information of the service is acquired; when the original service is destroyed, the latest address information of the service is set to be empty.
And S1213, transmitting the latest address information of the service to an independent domain name server so as to update the address information of the corresponding service in the independent domain name server.
After the latest address information of the service is obtained, the latest address information of the service is sent to the independent domain name server to update the address information of the corresponding service in the independent domain name server, so that the latest address information of the service is maintained in the independent domain name server to ensure timeliness of service access and calling, and the service in the service cluster is monitored based on the incremental change of the access information, so that the resource consumption of service update can be saved to the greatest extent.
According to the embodiment, through monitoring the change of the service in the service cluster, when the address information of the service is updated, the latest address information of the service is obtained, and the latest address information of the service is sent to the independent domain name server to update the address information of the corresponding service in the independent domain name server, so that the latest address information of the service is maintained in the independent domain name server, the timeliness of service access and calling is ensured, and the service in the service cluster is monitored based on the increment change of the access information, so that the resource consumption of service update can be saved to the greatest extent.
In some embodiments, S1200 the registering the service in association with the address information to the independent domain name server includes:
S1221, acquiring call authorization information of the service.
In the process of registering the service and the address information in an associated manner to the independent domain name server, as the service calling authorities among different service clusters are different, namely the service cluster A has the authority of calling the service in the service cluster B, but does not have the authority of calling the service in the service cluster C, and the calling authority information of the service is obtained when registering the service and the address information in an associated manner to the independent domain name server.
S1222, when the call authorization information meets the preset condition, the service and the address information are associated and registered to the independent domain name server.
Acquiring call authorization information of the service, and when the call authorization information meets a preset condition, registering the service and address information in association with an independent domain name server, further, if the service does not meet the preset condition, registering the service in the independent domain name server, wherein other service clusters cannot call the corresponding service through the independent domain name server; and when other service clusters want to call the service, verifying the call authorization information again, and calling the corresponding service through the independent domain name server only if the corresponding call authority is met.
According to the method, the call authorization information of the service is obtained, when the call authorization information meets the preset condition, the service and the address information are registered in association with the independent domain name server, the service is registered in the independent domain name server through the call authorization information to filter, the resource utilization rate of the independent domain name server is improved, the call of the cross-cluster service can be determined through the call authorization information, and the legality of service call is guaranteed.
In some embodiments, when the domain name suffix information satisfies the second condition, S1500 further includes, after obtaining, based on the independent domain name server, a corresponding target service according to the service query information, and returning address information of the target service to the first service cluster:
s1521, obtaining access calling authority of a first service cluster;
when the domain name suffix information meets a second condition, a corresponding target service is acquired based on the independent domain name server according to the service query information, address information of the target service is returned to the first service cluster, access calling authority of the first service cluster is acquired, and when the first service cluster wants to call the target service of the second service cluster, the first service cluster is required to have the authority of calling the target service of the second service cluster, so that the access calling authority of the first service cluster is acquired first.
S1522, verifying whether the first service cluster has access rights for accessing services of a second service cluster according to the access calling rights;
after the access calling authority of the first service cluster is obtained, verifying whether the first service cluster has the access authority for accessing the service of the second service cluster according to the access calling authority, and comparing and verifying the access calling authority with the accessed calling authority information according to the access calling authority, so as to determine whether the first service cluster has the authority for accessing and calling the target service of the second service cluster.
S1523, if yes, accessing the target service according to the address information.
After determining that the first service cluster has the authority to access and call the target service of the second service cluster, the first service cluster can access the target service according to the address information.
S1524, after the target service is successfully accessed, establishing connection between the first service cluster and the target service so as to call the target service.
And after the first service cluster successfully accesses the target service in the second service cluster according to the address information, establishing connection between the first service cluster and the target service through a preset communication protocol so as to call the target service.
According to the method, whether the first service cluster has access authority for accessing the service of the second service cluster is verified according to the access authority by acquiring the access authority of the first service cluster, after the first service cluster is determined to have the authority for accessing and calling the target service of the second service cluster, the first service cluster accesses the target service according to the address information, and after the first service cluster successfully accesses the target service in the second service cluster according to the address information, connection between the first service cluster and the target service is established through a preset communication protocol so as to call the target service, thereby guaranteeing validity of service call, and improving efficiency of service call by establishing connection.
In some embodiments, after the step S1524 of successfully accessing the target service, establishing a connection between the first service cluster and the target service to invoke the target service, the method further includes:
s1525, determining the term of access call according to the access call authority;
after the first service cluster successfully accesses the target service, establishing connection between the first service cluster and the target service, so that after the target service is called, the same service may be called by a plurality of other service clusters at the same time, and the number of calls of one service by the plurality of other service clusters may be limited at the same time.
And S1526, disconnecting the first service cluster from the target service when the deadline is reached, so as to suspend the first service cluster from calling the target service.
After the term of access call is determined according to the access call authority, when the term is reached, the connection between the first service cluster and the target service is disconnected, so that the first service cluster is suspended to call the target service, the resource consumption of the target service to be called can be released, meanwhile, the target service is prevented from being illegally called, the utilization rate of resources is improved, and the safety of service call is improved.
According to the method, the device and the system, the access calling deadline is determined according to the access calling authority, when the deadline is reached, the connection between the first service cluster and the target service is disconnected, so that the first service cluster is suspended from calling the target service, the resource consumption of the target service, which is called, is released, the target service is prevented from being illegally called, the utilization rate of the resource is improved, and the safety of service calling is improved.
Referring to fig. 2 specifically, fig. 2 is a schematic basic structure diagram of a calling device for service among service clusters according to the present embodiment.
As shown in fig. 2, a service calling device between service clusters includes: a service acquisition module 1100, configured to acquire services in the first service cluster and the second service cluster, and address information of each service; a service registration module 1200, configured to register the service and address information in association with an independent domain name server; the instruction receiving module 1300 is configured to, in response to receiving a service call instruction from a first service cluster, parse domain name suffix information and service query information included in the service call instruction; the intra-cluster calling module 1400 is configured to obtain, when the domain name suffix information satisfies a first condition, a corresponding target service from a domain name server of the first service cluster according to the service query information, and call the target service according to address information of the target service; the cross-cluster calling module 1500 is configured to obtain, based on the independent domain name server, a corresponding target service according to the service query information when the domain name suffix information meets a second condition, and return address information of the target service to a first service cluster, so as to call the target service in the first service cluster; wherein the target service is located in a second service cluster.
The calling device of the service between the service clusters obtains the service in the first service cluster and the second service cluster and the address information of each service; registering the service in association with address information to an independent domain name server; in response to receiving a service call instruction from a first service cluster, analyzing domain name suffix information and service query information contained in the service call instruction; when the domain name suffix information meets a first condition, acquiring a corresponding target service from a domain name server of the first service cluster according to the service inquiry information, and calling the target service according to the address information of the target service; when the domain name suffix information meets a second condition, acquiring corresponding target service based on the independent domain name server, and calling the target service in a first service cluster; the target service is located in the second service cluster, registered services of different service clusters are stored through deploying independent domain name servers, and the target service is used as a medium for accessing and calling services among the cross-service clusters, service information of other service clusters is not required to be stored in each service cluster in a redundant mode, service access and calling among the cross-service clusters can be completed only by inquiring according to requirements, maintenance cost is low, calling efficiency of dynamic services among the cross-service clusters can be effectively improved, and interconnection and intercommunication among the services are guaranteed.
Optionally, the cross-cluster call module is further configured to:
acquiring corresponding target service according to the service inquiry information in the service registration information of the independent domain name server; and/or the number of the groups of groups,
and determining a second service cluster based on the independent domain name server according to the service query information, forwarding the service query information to the second service cluster, and acquiring target service acquired by the second service cluster according to the service query information.
Optionally, the service acquisition module is further configured to:
acquiring a root domain name of a service cluster; the service clusters comprise a first service cluster and a second service cluster;
recursively inquiring the services in the service cluster according to the root domain name, and acquiring address information of each service; wherein the address information includes real-time, dynamic IP address information.
Optionally, the service registration module is further configured to:
monitoring for changes to services within the service cluster;
when the address information of the service is updated, acquiring the latest address information of the service;
and sending the latest address information of the service to an independent domain name server so as to update the address information of the corresponding service in the independent domain name server.
Optionally, the service registration module is further configured to;
acquiring call authorization information of the service;
and when the call authorization information meets the preset condition, registering the service and the address information in association with an independent domain name server.
Optionally, the cross-cluster call module is further configured to;
acquiring access calling authority of a first service cluster;
verifying whether the first service cluster has access rights to the services of the second service cluster according to the access calling rights;
if yes, accessing the target service according to the address information;
and after the target service is successfully accessed, establishing connection between the first service cluster and the target service so as to call the target service.
Optionally, the method further comprises a call deadline module for:
determining the term of access call according to the access call authority;
and when the deadline is reached, disconnecting the first service cluster from the target service so as to suspend the first service cluster from calling the target service.
In order to solve the technical problems, the embodiment of the application also provides computer equipment. Referring specifically to fig. 3, fig. 3 is a basic structural block diagram of a computer device according to the present embodiment.
As shown in fig. 3, the internal structure of the computer device is schematically shown. The computer device includes a processor, a non-volatile storage medium, a memory, and a network interface connected by a system bus. The nonvolatile storage medium of the computer device stores an operating system, a database and computer readable instructions, the database can store a control information sequence, and the computer readable instructions can enable the processor to realize a transaction certificate chaining method when the computer readable instructions are executed by the processor. The processor of the computer device is used to provide computing and control capabilities, supporting the operation of the entire computer device. The memory of the computer device may have stored therein computer readable instructions that, when executed by the processor, cause the processor to perform a method of invoking a service between service clusters. The network interface of the computer device is for communicating with a terminal connection. It will be appreciated by those skilled in the art that the structure shown in fig. 3 is merely a block diagram of some of the structures associated with the present application and is not limiting of the computer device to which the present application may be applied, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
The processor in this embodiment is configured to execute specific functions of the service acquisition module 1100, the service registration module 1200, the instruction receiving module 1300, the intra-cluster call module 1400 and the inter-cluster call module 1500 in fig. 2, and the memory stores program codes and various types of data required for executing the foregoing modules. The network interface is used for data transmission between the user terminal or the server. The memory in this embodiment stores program codes and data required for executing all the sub-modules in the calling device serving inter-service-cluster, and the server can call the program codes and data of the server to execute the functions of all the sub-modules.
The computer equipment obtains the services in the first service cluster and the second service cluster and the address information of each service; registering the service in association with address information to an independent domain name server; in response to receiving a service call instruction from a first service cluster, analyzing domain name suffix information and service query information contained in the service call instruction; when the domain name suffix information meets a first condition, acquiring a corresponding target service from a domain name server of the first service cluster according to the service inquiry information, and calling the target service according to the address information of the target service; when the domain name suffix information meets a second condition, acquiring corresponding target service based on the independent domain name server, and calling the target service in a first service cluster; the target service is located in the second service cluster, registered services of different service clusters are stored through deploying independent domain name servers, and the target service is used as a medium for accessing and calling services among the cross-service clusters, service information of other service clusters is not required to be stored in each service cluster in a redundant mode, service access and calling among the cross-service clusters can be completed only by inquiring according to requirements, maintenance cost is low, calling efficiency of dynamic services among the cross-service clusters can be effectively improved, and interconnection and intercommunication among the services are guaranteed.
The present application also provides a storage medium storing computer readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of a method for invoking a service between service clusters of any of the embodiments described above.
Those skilled in the art will appreciate that implementing all or part of the above-described methods in accordance with the embodiments may be accomplished by way of a computer program stored in a computer-readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. The storage medium may be a nonvolatile storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a random access Memory (Random Access Memory, RAM).
Those of skill in the art will appreciate that the various operations, methods, steps in the flow, actions, schemes, and alternatives discussed in the present application may be alternated, altered, combined, or eliminated. Further, other steps, means, or steps in a process having various operations, methods, or procedures discussed in this application may be alternated, altered, rearranged, split, combined, or eliminated. Further, steps, measures, schemes in the prior art with various operations, methods, flows disclosed in the present application may also be alternated, altered, rearranged, decomposed, combined, or deleted.
The foregoing is only a partial embodiment of the present application, and it should be noted that, for a person skilled in the art, several improvements and modifications can be made without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.
Claims (10)
1. A method for invoking a service between service clusters, comprising:
acquiring services in a first service cluster and a second service cluster and address information of each service;
registering the service in association with address information to an independent domain name server;
in response to receiving a service call instruction from a first service cluster, analyzing domain name suffix information and service query information contained in the service call instruction;
when the domain name suffix information meets a first condition, acquiring a corresponding target service from a domain name server of the first service cluster according to the service inquiry information, and calling the target service according to the address information of the target service;
when the domain name suffix information meets a second condition, acquiring corresponding target service based on the independent domain name server, and calling the target service in a first service cluster; wherein the target service is located in a second service cluster.
2. The method for invoking the service between service clusters according to claim 1, wherein the obtaining the corresponding target service based on the independent domain name server according to the service query information comprises:
acquiring corresponding target service according to the service inquiry information in the service registration information of the independent domain name server; and/or the number of the groups of groups,
and determining a second service cluster based on the independent domain name server according to the service query information, forwarding the service query information to the second service cluster, and acquiring target service acquired by the second service cluster according to the service query information.
3. The method for calling service among service clusters according to claim 1, wherein the obtaining the service in the first service cluster and the second service cluster and the address information of each service includes:
acquiring a root domain name of a service cluster; the service clusters comprise a first service cluster and a second service cluster;
recursively inquiring the services in the service cluster according to the root domain name, and acquiring address information of each service; wherein the address information includes real-time, dynamic IP address information.
4. The method for calling service among service clusters according to claim 1, wherein after said registering said service in association with address information to an independent domain name server, further comprising:
monitoring for changes to services within the service cluster;
when the address information of the service is updated, acquiring the latest address information of the service;
and sending the latest address information of the service to an independent domain name server so as to update the address information of the corresponding service in the independent domain name server.
5. The method for calling a service between service clusters according to claim 1, wherein said registering the service in association with address information to an independent domain name server comprises:
acquiring call authorization information of the service;
and when the call authorization information meets the preset condition, registering the service and the address information in association with an independent domain name server.
6. The method for calling service between service clusters according to claim 1, wherein when the domain name suffix information satisfies a second condition, after obtaining a corresponding target service according to the service query information based on the independent domain name server and returning address information of the target service to the first service cluster, further comprising:
Acquiring access calling authority of a first service cluster;
verifying whether the first service cluster has access rights to the services of the second service cluster according to the access calling rights;
if yes, accessing the target service according to the address information;
and after the target service is successfully accessed, establishing connection between the first service cluster and the target service so as to call the target service.
7. The method for calling service among service clusters according to claim 1, wherein after the target service is successfully accessed, establishing a connection between the first service cluster and the target service to call the target service, further comprises:
determining the term of access call according to the access call authority;
and when the deadline is reached, disconnecting the first service cluster from the target service so as to suspend the first service cluster from calling the target service.
8. A service call device between service clusters, comprising:
the service acquisition module is used for acquiring the services in the first service cluster and the second service cluster and the address information of each service;
a service registration module for registering the service and address information in association with an independent domain name server;
The instruction receiving module is used for responding to a service calling instruction received from the first service cluster and analyzing domain name suffix information and service inquiry information contained in the service calling instruction;
the intra-cluster calling module is used for acquiring corresponding target service from the domain name server of the first service cluster according to the service inquiry information when the domain name suffix information meets a first condition, and calling the target service according to the address information of the target service;
the cross-cluster calling module is used for acquiring corresponding target service according to the service query information based on the independent domain name server when the domain name suffix information meets a second condition, and returning the address information of the target service to the first service cluster so as to call the target service in the first service cluster; wherein the target service is located in a second service cluster.
9. A computer device comprising a memory and a processor, the memory having stored therein computer readable instructions which, when executed by the processor, cause the processor to perform the steps of the method of invoking a service between service clusters according to any of claims 1 to 7.
10. A storage medium storing computer readable instructions which, when executed by one or more processors, cause the one or more processors to perform the steps of a method of invoking a service between service clusters according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311567974.3A CN117749893A (en) | 2023-11-21 | 2023-11-21 | Calling method, device, computer and storage medium for service among service clusters |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311567974.3A CN117749893A (en) | 2023-11-21 | 2023-11-21 | Calling method, device, computer and storage medium for service among service clusters |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117749893A true CN117749893A (en) | 2024-03-22 |
Family
ID=90282146
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311567974.3A Pending CN117749893A (en) | 2023-11-21 | 2023-11-21 | Calling method, device, computer and storage medium for service among service clusters |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117749893A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN119030987A (en) * | 2024-08-05 | 2024-11-26 | 广州三七极梦网络技术有限公司 | A business execution method, device, equipment and readable storage medium |
-
2023
- 2023-11-21 CN CN202311567974.3A patent/CN117749893A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN119030987A (en) * | 2024-08-05 | 2024-11-26 | 广州三七极梦网络技术有限公司 | A business execution method, device, equipment and readable storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10565372B1 (en) | Subscription-based multi-tenant threat intelligence service | |
CN111913818A (en) | Method for determining dependency relationship between services and related device | |
CN101365119B (en) | Video recording balance equalizing method used for network video monitoring system | |
US20190266276A1 (en) | Instance data replication | |
CN105610987A (en) | Method, application and system for managing server cluster | |
US20020184348A1 (en) | Object oriented framework architecture for sensing and/or control environments | |
CN101360129B (en) | Mobile phone short message sending method for network video monitoring system | |
CN114615073B (en) | Access flow control method and device, equipment and medium thereof | |
CN113204427A (en) | Resource management method, resource management device, computer equipment and storage medium | |
CN115695139A (en) | Method for enhancing micro-service system architecture based on distributed robust | |
US12430352B2 (en) | Methods and system for detecting unmanaged resources in cloud-based data warehousing system | |
US20060259523A1 (en) | System and method of synchronization of internal data cache with wireless device application data repositories | |
CN109451014A (en) | A kind of WebService agency plant and its transparent proxy method | |
CN111371809A (en) | Server based on reverse proxy architecture and GIS service access control method | |
CN117749893A (en) | Calling method, device, computer and storage medium for service among service clusters | |
US20120173615A1 (en) | Data broker method, apparatus and system | |
US12189645B2 (en) | Methods and systems for generating recommendations in cloud-based data warehousing system | |
US6931427B2 (en) | Method and apparatus for discovering data services in a distributed computer system | |
CN112416980A (en) | Data service processing method, device and equipment | |
CN110913018A (en) | Distributed regulation and control service system | |
CN117938863B (en) | Cluster-based joint simulation implementation method, system, equipment and storage medium | |
CN112565340B (en) | Service scheduling method, device, computer system and medium for distributed application | |
CN111970162B (en) | Heterogeneous GIS platform service central control system under super-integration framework | |
CN116405509B (en) | Distributed monitoring method, computer equipment and storage medium thereof | |
US11663058B1 (en) | Preemptive filtering of events of an event bus with a deterministic filter |
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 |