CN118200220A - Environment access method, device, gateway and storage medium - Google Patents
Environment access method, device, gateway and storage medium Download PDFInfo
- Publication number
- CN118200220A CN118200220A CN202410305535.3A CN202410305535A CN118200220A CN 118200220 A CN118200220 A CN 118200220A CN 202410305535 A CN202410305535 A CN 202410305535A CN 118200220 A CN118200220 A CN 118200220A
- Authority
- CN
- China
- Prior art keywords
- gateway
- information
- service interface
- address
- environment
- 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
- 238000000034 method Methods 0.000 title claims abstract description 58
- 210000001503 joint Anatomy 0.000 claims abstract description 6
- 238000004519 manufacturing process Methods 0.000 claims description 20
- 238000004458 analytical method Methods 0.000 claims description 17
- 238000004590 computer program Methods 0.000 claims description 16
- 230000007613 environmental effect Effects 0.000 claims description 9
- 238000011144 upstream manufacturing Methods 0.000 description 44
- 238000004891 communication Methods 0.000 description 9
- 238000010586 diagram Methods 0.000 description 8
- 238000012545 processing Methods 0.000 description 8
- 230000008569 process Effects 0.000 description 7
- 230000008901 benefit Effects 0.000 description 6
- 230000008859 change Effects 0.000 description 6
- 230000006870 function Effects 0.000 description 6
- 230000003993 interaction Effects 0.000 description 4
- 238000013507 mapping Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 235000008694 Humulus lupulus Nutrition 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012544 monitoring process Methods 0.000 description 2
- 238000012546 transfer Methods 0.000 description 2
- 238000013459 approach Methods 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 238000013473 artificial intelligence Methods 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
- 230000007547 defect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 239000011521 glass Substances 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 230000009191 jumping Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000001953 sensory effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention discloses an environment access method, an environment access device, a gateway and a storage medium, and relates to the technical field of computers. The method is applied to the gateway, and the gateway is in butt joint with the target service interface; the method comprises the following steps: receiving route update information of a target service interface sent by a gateway configuration center, and receiving an environment access request sent by a client; determining a target address according to the route update information and the environment access request; and sending the target address to the target service interface so that the target service interface accesses the environment corresponding to the target address through the target address. According to the technical scheme, when the route information is updated, the route update information can be received, and the target address is dynamically and flexibly determined through the environment access request and the route update information sent by the client, so that the target service interface is accessed to the environment corresponding to the target address through the target address, the environment access of the target service interface is realized, and the accuracy of the environment access is ensured.
Description
Technical Field
The present invention relates to the field of computer technologies, and in particular, to an environment access method, an environment access device, a gateway, and a storage medium.
Background
With the development of internet technology, especially the rapid development of mobile internet applications, the importance of gateways is more and more prominent. The gateway may provide unified management of upstream services, access control, routing and load balancing, logging, monitoring of inter-service calls, and the like. Upstream services refer to a generic term for services on which gateway hops or calls depend.
In the prior art, when the routing information is updated, the version of the upstream service is also changed. At this time, the upstream service needs to replace the production version in the production environment according to the updated routing information. However, this approach may risk update failure or call failure, and once failed, a rollback to the original production version is required, thereby affecting the user experience.
Disclosure of Invention
The invention provides an environment access method, an environment access device, a gateway and a storage medium, which can receive route update information when the route information is updated, and further dynamically and flexibly determine a target address through an environment access request sent by a client and the determined route update information, so that a target service interface accesses an environment corresponding to the target address through the target address, and the environment access of the target service interface is realized.
According to one aspect of the invention, the invention provides an environment access method which is applied to a gateway, wherein the gateway is in butt joint with a target service interface; the method comprises the following steps:
Receiving route update information of a target service interface sent by a gateway configuration center, and receiving an environment access request sent by a client;
determining a target address according to the route update information and the environment access request;
and sending the target address to the target service interface so that the target service interface accesses the environment corresponding to the target address through the target address.
Optionally, the environment access request includes a preset field; determining a target address according to the route update information and the environment access request, including: determining route configuration information according to the route update information; the route configuration information at least comprises a keyword and a first address; determining whether a preset field is matched with the keyword; if the preset field is matched with the keyword, the first address is used as a target address; if the preset field is not matched with the keyword, determining a second address, and taking the second address as a target address.
Optionally, determining route configuration information according to the route update information includes: analyzing the route update information based on an analysis reload algorithm; and determining route configuration information according to the analyzed route updating information.
Optionally, the environment corresponding to the first address is a gray environment; the environment corresponding to the second address is a production environment.
Optionally, before receiving the route update information of the target service interface sent by the gateway configuration center, the method further includes: receiving notification information sent by a gateway configuration center; the notification information is used for indicating that the version of at least one service interface is changed; according to the notification information, an update request is sent to a gateway configuration center; the update request includes identification information of the target service interface, so that the gateway configuration center determines whether the version of the target service interface changes according to the identification information, and sends route update information of the target service interface to the gateway when the version of the target service interface changes.
Optionally, before receiving the notification information sent by the gateway configuration center, the method further includes: sending the instance information of the gateway to a gateway configuration center so that the gateway configuration center registers the gateway according to the instance information; wherein the instance information includes a gateway name; receiving feedback information sent by a gateway configuration center; the feedback information is used for indicating a registration result of the gateway configuration center to the gateway.
Optionally, after sending the target address to the target service interface, the method further includes: receiving access completion information sent by a target service interface, and forwarding the access completion information to a client; the access completion information is used for feeding back the environment access condition of the target service interface.
According to another aspect of the present invention, the present invention further provides an environmental access device, which is applied to a gateway, where the gateway interfaces with a target service interface; the device comprises:
The receiving module is used for receiving the route update information of the target service interface sent by the gateway configuration center and receiving an environment access request sent by the client;
the determining module is used for determining a target address according to the route updating information and the environment access request;
and the sending module is used for sending the target address to the target service interface so that the target service interface accesses the environment corresponding to the target address through the target address.
According to another aspect of the present invention, there is also provided a gateway, including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the method of environmental access of any one of the embodiments of the present invention.
According to another aspect of the present invention, there is also provided a computer readable storage medium storing computer instructions for causing a processor to execute the environment accessing method according to any of the embodiments of the present invention.
The technical scheme of the invention is applied to the gateway, and the gateway is in butt joint with the target service interface; receiving the route update information of the target service interface sent by the gateway configuration center and receiving an environment access request sent by the client; determining a target address according to the route update information and the environment access request; and sending the target address to the target service interface so that the target service interface accesses the environment corresponding to the target address through the target address. According to the technical scheme, when the route information is updated, the route update information can be received, and the target address is dynamically and flexibly determined through the environment access request and the route update information sent by the client, so that the target service interface is accessed to the environment corresponding to the target address through the target address, the environment access of the target service interface is realized, and the accuracy of the environment access is ensured.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the present invention, the drawings that are needed in the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of an environmental access method provided by the present invention;
FIG. 2 is an interactive timing diagram of an environmental access method provided by the present invention;
fig. 3 is a schematic structural diagram of an environment access device according to the present invention;
fig. 4 is a schematic structural diagram of a gateway according to the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a more complete description of the same will be rendered by reference to the appended drawings, wherein it is to be understood that the illustrated embodiments are merely exemplary of some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Fig. 1 is a flowchart of an environment access method provided in the present invention, where the present embodiment is applicable to an environment access situation of a target interface service of an upstream service, and the method may be performed by an environment access device, where the environment access device may be implemented in a form of hardware and/or software, and in a specific embodiment, the environment access device may be configured in a gateway, where the gateway interfaces with the target service interface. As shown in fig. 1, the method of this embodiment specifically includes the following steps:
S101, receiving route update information of a target service interface sent by a gateway configuration center, and receiving an environment access request sent by a client.
The gateway is a service gateway capable of providing high-performance hypertext transfer protocol (Hypertext Transfer Protocol, HTTP) forwarding, multi-tenant management, upstream service interface access right control and other capabilities. It may provide unified management of upstream services, access control, routing and load balancing, logging, monitoring of inter-service calls, etc. Upstream services may also be referred to as servers, and refer to a generic term for services on which gateway hops or calls depend, where these services may be separate interfaces or a set of interfaces. The target service interface is an interface of an upstream service interfacing with the gateway, and generally refers to an interface designed to implement new functions or improve old functions, and these interfaces are used for communication and data transmission between different modules or components, so as to ensure overall coordination and normal operation of software. The gateway configuration center is a system for uniformly managing all configurations in the gateway. The client, also called user or application, is a program corresponding to the target service interface to provide local services for the user. Routing information refers to various information required in the network to determine the best path to reach a destination. The route update information is information indicating that various information required to determine the optimal path to reach the destination changes in update. The environment access request is request information sent by the client and is used for determining whether the target service interface meets the requirement of the existing production environment.
Specifically, when the route of the target service interface is updated, the gateway configuration center determines updated route update information and sends the route update information to the gateway, so that the gateway determines the route update condition of the target service interface based on the route update information. After determining that the route update information of the target service interface sent by the gateway configuration center is received, the gateway continues to receive the environment access request sent by the client, and determines whether the target service interface meets the existing production environment requirements according to the environment access request and the route update information of the target service interface.
In a specific embodiment, optionally, before receiving the notification information sent by the gateway configuration center, the method further includes: sending the instance information of the gateway to a gateway configuration center so that the gateway configuration center registers the gateway according to the instance information; wherein the instance information includes a gateway name; receiving feedback information sent by a gateway configuration center; the feedback information is used for indicating a registration result of the gateway configuration center to the gateway.
The instance information refers to gateway identification information, and the instance information includes a gateway name, and may also be an internet protocol address (Internet Protocol Address, IP) of the gateway, which is not limited in this embodiment. The feedback information is used for indicating the registration result of the gateway configuration center to the gateway.
Specifically, before receiving the notification information sent by the gateway configuration center, the gateway also sends instance information to the gateway configuration center, that is, registers the gateway in the gateway configuration center based on the instance information, and meanwhile, the gateway receives feedback information sent by the gateway configuration center, determines, based on the feedback information, whether the gateway is registered in the gateway configuration center based on the registration result of the gateway instance information to the gateway by the gateway configuration center.
The advantage of this is that the gateway configuration center registers the gateway based on the instance information of the gateway before receiving the notification information sent by the gateway configuration center, and when sending the notification information, the gateway configuration center can send the notification information based on the registered gateway.
In a specific embodiment, optionally, before receiving the route update information of the target service interface sent by the gateway configuration center, the method further includes: receiving notification information sent by a gateway configuration center; the notification information is used for indicating that the version of at least one service interface is changed; according to the notification information, an update request is sent to a gateway configuration center; the update request includes identification information of the target service interface, so that the gateway configuration center determines whether the version of the target service interface changes according to the identification information, and sends route update information of the target service interface to the gateway when the version of the target service interface changes.
The notification information is used for indicating that the version of at least one service interface is changed, and the notification information can be directly obtained by the gateway configuration center or obtained from the gateway console by the gateway configuration center. When the version of at least one service interface changes, the gateway control console is notified, then the gateway control console sends the version to the gateway configuration center, and finally the gateway configuration center sends the version to the gateway; the update request includes identification information of the target service interface, where the identification information is a symbol used for identifying the target service interface, and may be, for example, a code, a name, a request time, etc. of the target service interface, which is not limited in this embodiment.
Specifically, before receiving the route update information of the target service interface sent by the gateway configuration center, the gateway also needs to receive notification information sent by the gateway configuration center, inform the gateway of the change of the version of at least one service interface based on the notification information, then send an update request to the gateway configuration center based on the change of the version of at least one service interface and own demand, inform the gateway configuration center of the route update information needed to be sent based on the update request, and when sending the update request to the gateway configuration center, the update request also contains identification information of the target service interface, and is used for locking the route update information acquired based on the update request to correspond to the target service interface, so that the gateway configuration center determines whether the version of the target service interface is changed according to the identification information, and sends the route update information of the target service interface to the gateway when the version of the target service interface is changed.
The advantage of this arrangement is that when the route information changes, the gateway configuration center notifies the gateway of the notification information of the route update condition when the route update condition exists; after receiving the notification, the gateway decides whether to pull the needed route update information according to the need; and if necessary, pulling the corresponding route update information from the gateway configuration center according to the notification information, thereby realizing the dynamic update of the route update information and improving the safety and reliability of the route update information acquisition process.
S102, determining a target address according to the route update information and the environment access request.
The destination address is a destination jump address of a destination service interface of the upstream service according to the route update information and the environment access request, and the destination address meets different jump requirements.
Specifically, after receiving the route update information and the environment access request, determining whether the route update information and the environment access request meet preset conditions, and if the route update information and the environment access request meet the preset conditions, determining the first address as a target address; if the route update information and the environment access request are determined not to meet the preset conditions, determining a second address, and taking the second address as a target address. The preset condition is a preset condition for determining a target address according to the route update information and the environment access request, the first address is an address contained in the route configuration information, and the second address is an address determined according to the route update information and the environment access request.
In a specific embodiment, optionally, the environment access request includes a preset field; determining a target address according to the route update information and the environment access request, including: determining route configuration information according to the route update information; the route configuration information at least comprises a keyword and a first address; determining whether a preset field is matched with the keyword; if the preset field is matched with the keyword, the first address is used as a target address; if the preset field is not matched with the keyword, determining a second address, and taking the second address as a target address.
The preset field is a preset field for determining the target address, for example, may be x-isg-keys, which is not limited in this embodiment. The routing configuration information includes at least a keyword and a first address, and the keyword may be, for example, keyword1, keyword2, and the like. The environment corresponding to the first address is a gray environment, which is not limited in this embodiment.
The gray environment is the gray environment of the upstream service, the gray environment can also be called as a pre-release environment, the gray environment is released before the online, and the online is performed after the verification is passed; the environment corresponding to the second address is a production environment, which is not limited in this embodiment.
The production environment is the production environment of the upstream service, the production environment is the environment for actually running the software system, and the configuration of the production environment is definite and cannot be changed at will. In a production environment, a software system needs to run continuously for 24 hours, and the system needs to be maintained and upgraded regularly.
Specifically, route configuration information is determined according to the route update information; the route configuration information at least comprises a keyword and a first address; determining whether a preset field is matched with a keyword contained in the route configuration information, and if the preset field is determined to be matched with the keyword contained in the route configuration information, determining a first address contained in the route configuration information as a target address; if the preset field is not matched with the keywords contained in the route configuration information, the gateway directly determines a second address and takes the second address as a target address.
For example, the preset field is determined to be "x-isg-keys", a key value pair is determined according to the routing configuration information, the key value pair includes a key and a value corresponding to the key, and the key value pair can be, for example, a key: value, where the key is "APIGRAYRELEASED", the value is an object, and the key value pair is also included in the value. Such as: "APIGRAYRELEASED": { "enable": true,// true is enabled, false is off "keys": "keyword1|keyword2",// judging whether the request head contains an "x-isg-keywords" value, and if the value is not contained in "keyword1|keyword2", if yes, jumping to a second address which is determined to be set, and taking the second address as a target address; otherwise, the first address is not jumped to the set address, and the first address is continued to be used as the target address. Wherein, keyword1|keyword2 is a sample, "|" is a separator, and keyword1 and keyword2 are updated to actual conditions. The target address may be, for example, "10.1.2.3:8080", and may be replaced with the actual IP and port in the actual application process. Further, when determining that "APIGRAYRELEASED" exists in the routing configuration information, further determining whether "enable" in "APIGRAYRELEASED" is true, if determining that "enable" in "APIGRAYRELEASED" is enabled, determining whether a preset field "x-isg-keywords" is included in "keywords" of "APIGRAYRELEASED", and if determining that the preset field "x-isg-keywords" is included in "keywords" of "APIGRAYRELEASED", determining a set second address, and taking the second address as a target address; if it is determined that "enable" in "APIGRAYRELEASED" is off, or if it is determined that the preset field "x-isg-keywords" is not included in "keywords" of "APIGRAYRELEASED", the first address is taken as the target address.
The advantage of this arrangement is that the specific target address is determined according to the preset field and the routing configuration information in the environment access request, and the access address of the target service interface is accurately determined.
In a specific embodiment, optionally, determining route configuration information according to route update information includes: analyzing the route update information based on an analysis reload algorithm; and determining route configuration information according to the analyzed route updating information.
The analysis override algorithm is used for analyzing the route update information, and comprises manual analysis, third party library analysis, automatic mapping, analyzer analysis and converter analysis. And (3) manual analysis: if the JavaScript object notation (JavaScript Object Notation, JSON) data structure is simple, the required data can be parsed and extracted directly using a character string processing function or a regular expression. Third party library resolution: many programming languages have third party libraries or modules available for parsing and converting JSON data, which libraries typically provide more powerful and flexible functionality capable of handling more complex JSON structures and data types. Automatic mapping: some programming languages provide automatic mapping functions that can automatically convert JSON data into corresponding objects or data structures, which can simplify code, but may require some configuration and conventions. The parser parses: the parser may be, for example, a JSON parser, which is a method of converting JSON data into tree structures or node objects so that individual properties and values may be easily traversed and accessed, which typically provides an easy-to-use application programming interface (Application Programming Interface, API) to manipulate the parsed data. The converter parses: some tools and libraries can convert JSON data into objects in a particular programming language for easier use and processing of the data. This embodiment is not limited thereto.
Specifically, an analysis reloading algorithm suitable for the route updating information is determined, the route updating information is analyzed based on the analysis reloading algorithm, and the route configuration information is determined according to the analyzed route updating information.
The method has the advantages that the route update information is analyzed and reloaded through the analysis reloading algorithm, so that the route update information is easier to use and process, and the accuracy and the high efficiency of routing configuration information are improved.
S103, sending the target address to the target service interface so that the target service interface accesses the environment corresponding to the target address through the target address.
Specifically, after the target address is determined, the target address is sent to the target service interface of the upstream service, so that the target service interface of the upstream service accesses the environment corresponding to the target address through the target address.
Illustratively, when the first address is the target address, the target service interface of the upstream service is caused to jump based on the first address and to the production environment; and when the second address is determined to be the target address, the target service interface of the upstream service jumps based on the second address and jumps to the gray environment.
The advantage of this arrangement is that the destination address is determined based on the preset field and the route configuration information, and the switching process of the gray scale environment and the production environment of the destination service interface of the upstream service is realized based on the destination address, so that the different environment jump switching requirements are satisfied.
In a specific embodiment, optionally, after sending the target address to the target service interface, the method further includes: receiving access completion information sent by a target service interface, and forwarding the access completion information to a client; the access completion information is used for feeding back the environment access condition of the target service interface.
The access completion information is used for feeding back the environment access condition of the target service interface.
Specifically, after the target address is sent to the target service interface of the upstream service, the gateway also needs to receive the access completion information sent by the target service interface of the upstream service, determine the environment access condition of the target service interface of the upstream service according to the access completion information, and feed back the received environment access condition of the target service interface to the client, so that the client can master the environment access condition of the target service interface.
The setting has the advantages that the client side can master the environment access condition of the target service interface of the upstream service, and the use experience of the user is improved.
The technical scheme of the embodiment is applied to the gateway, and the gateway is in butt joint with the target service interface; receiving the route update information of the target service interface sent by the gateway configuration center and receiving an environment access request sent by the client; determining a target address according to the route update information and the environment access request; and sending the target address to the target service interface so that the target service interface accesses the environment corresponding to the target address through the target address. On the basis of the embodiment, when the routing information is updated, the routing update information is received, and the target address is dynamically and flexibly determined through the environment access request and the routing update information sent by the client, so that the target service interface accesses the environment corresponding to the target address through the target address, thereby realizing the environment access of the target service interface and ensuring the accuracy of the environment access.
Fig. 2 is an interaction timing diagram of an environment access method provided in the present invention, where the present embodiment is applicable to an environment access situation of a target service interface of an upstream service, and the method may be performed by an environment access device, where the environment access device may be implemented in a form of hardware and/or software, and in a specific embodiment, as shown in fig. 2, the interaction timing diagram specifically includes a client, a gateway console, a gateway configuration center, a gateway, and an upstream service. The gateway interfaces with the target service interface, interacts with the client and the gateway configuration center, and interacts with the gateway console. The client refers to a user end, corresponds to the upstream service, and is a program for providing local service for the user; the gateway console is a platform for controlling information of the gateway; the gateway configuration center is a center for configuring the routing information of the gateway; gateways, also known as gateway or protocol converters, implement network interconnections above the network layer. The upstream service refers to a service end for generating content, and is usually a targeted service program, the upstream service is used for serving a client, and the target service interface is a service interface of the upstream service. Specifically, the environmental access procedure is as shown in fig. 2:
s201, sending instance information.
The instance information refers to gateway identification information, and the instance information includes a gateway name, and may also be an internet protocol address (Internet Protocol Address, IP) of the gateway, which is not limited in this embodiment.
Specifically, the gateway sends the instance information of the gateway to the gateway configuration center, and the instance information includes a gateway name, so that the gateway configuration center registers the gateway according to the instance information.
S202, feedback information is sent.
The feedback information is used for indicating a registration result of the gateway configuration center to the gateway.
Specifically, when the gateway configuration center registers the gateway based on the instance information, feedback information is sent to the gateway, and the gateway can determine the registration result of the gateway according to the feedback information fed back by the gateway configuration center, and determine whether the gateway is registered in the gateway configuration center based on the registration result.
S203, sending notification information to the gateway configuration center.
The notification information is used for indicating that the version of at least one service interface is changed.
Specifically, after the gateway configuration center sends feedback information to the gateway, the gateway console sends notification information to the gateway configuration center, so that the gateway configuration center receives the notification information sent by the gateway console, and the notification information is used for determining that the version of at least one service interface is changed.
S204, sending notification feedback information.
The notification feedback information is information that the gateway configuration center is used for feeding back to the gateway console that the version where at least one service interface exists has been received and changed.
Specifically, after the gateway configuration center receives the version change information of the at least one service interface sent by the gateway console, the gateway configuration center sends notification feedback information to the gateway console, so as to notify the gateway console that the gateway console has received the relevant information of the version change of the at least one service interface.
S205, sending notification information to the gateway.
Specifically, after the gateway configuration center sends notification feedback information to the gateway console, the gateway configuration center continues to send the received notification information to the gateway, so that the gateway determines that the version of at least one service interface is changed based on the notification information.
S206, sending an update request.
Specifically, after receiving the notification information sent by the gateway configuration center, the gateway determines that the version of at least one service interface is changed according to the notification information, and sends an update request to the gateway configuration center according to the situation that the version of at least one service interface is changed, wherein the update request comprises the identification information of the target service interface of the upstream service, so that the gateway configuration center determines whether the version of the target service interface of the upstream service is changed according to the identification information.
S207, route update information is sent.
When the version of the target service interface changes, the target service interface of the upstream service can send the route update information to the gateway console for storage, and the gateway console sends the route update information to the gateway configuration center, and then the gateway configuration center sends the route update information to the gateway; the user may input the route update information into the gateway configuration center, and the gateway configuration center may send the route update information to the gateway.
Specifically, after the route update information is obtained, route update information corresponding to the target service interface of the upstream service is sent to the gateway based on the identification information of the target service interface of the upstream service in the update request.
S208, determining route configuration information according to the route update information.
The routing configuration information at least comprises a keyword and a first address.
Specifically, an analysis reloading algorithm suitable for the route updating information is determined, the gateway analyzes the route updating information based on the analysis reloading algorithm, and route configuration information is determined according to the analyzed route updating information.
S209, sending an environment access request.
The environment access request is request information sent by the client and is used for determining whether a target service interface of the upstream service meets the requirement of the existing production environment. The environment access request includes a preset field.
Specifically, after determining the routing configuration information, the client sends an environment access request to the gateway, and the gateway determines whether a target service interface of the upstream service meets the requirement of the existing production environment based on a preset field in the received environment access request.
S210, determining a target address according to the route update information and the environment access request.
Specifically, whether a preset field of the route configuration information is matched with a keyword contained in the route configuration information is determined, and if the preset field is determined to be matched with the keyword contained in the route configuration information, a first address contained in the route configuration information is determined to be a target address; if the preset field is not matched with the keywords contained in the route configuration information, the gateway directly determines a second address and takes the second address as a target address.
S211, sending the target address.
Specifically, after the target address is determined, the target address is sent to the target service interface of the upstream service, so that the target service interface of the upstream service accesses the environment corresponding to the target address through the target address.
Illustratively, when the first address is used as the target address, the target service interface of the upstream service is caused to jump according to the first address and jump to the production environment; and when the second address is determined to be the target address, the target service interface of the upstream service jumps according to the second address and jumps to the gray environment.
S212, sending access completion information to the gateway.
The access completion information is used for feeding back the environment access condition of the target service interface.
Specifically, after the target address is sent to the target service interface of the upstream service, the upstream service sends access completion information to the gateway, so that the gateway grasps the environment access condition of the target service interface of the upstream service according to the access completion information.
S213, sending the access completion information to the client.
Specifically, after receiving the access completion information sent by the target service interface of the upstream service, the gateway feeds back the environment access condition of the target service interface of the upstream service to the client, so that the client can master the environment access condition of the target service interface of the upstream service.
According to the technical scheme of the embodiment, the gateway configuration center registers the gateway according to the instance information by sending the instance information of the gateway to the gateway configuration center; when the gateway configuration center registers the gateway based on the instance information, feedback information is sent to the gateway, the gateway can determine the registration result of the gateway according to the feedback information fed back by the gateway configuration center, and whether the gateway is registered in the gateway configuration center is determined based on the registration result; after the gateway configuration center sends feedback information to the gateway, the gateway configuration center receives reminding information sent by a gateway console and is used for determining that the version of at least one service interface is changed; after the gateway configuration center receives the version change information of at least one service interface sent by the gateway console, the gateway configuration center sends notification feedback information to the gateway console, wherein the notification feedback information is used for notifying the gateway console that the gateway console has received the related information of the version change of at least one service interface; the gateway configuration center sends the notification feedback information to the gateway console and then sends the received notification information to the gateway; after receiving the notification information sent by the gateway configuration center, the gateway sends an update request to the gateway configuration center according to the notification information, wherein the update request comprises the identification information of the target service interface, so that the gateway configuration center determines whether the version of the target service interface changes according to the identification information; when the version of the target service interface changes, the gateway configuration center sends route update information of the target service interface to the gateway based on the identification information of the target service interface; determining an analysis reloading algorithm suitable for the route updating information, analyzing the route updating information based on the analysis reloading algorithm, and determining route configuration information according to the analyzed route updating information; after the route configuration information is determined, an environment access request sent by a client to a gateway is received, and whether a target service interface meets the requirement of the existing production environment is determined; determining a target address according to the route update information and the environment access request; sending a target address to a target service interface; specifically, after determining the target address, the gateway also needs to receive the access completion information sent by the target service interface after sending the target address to the target service interface, determine the environment access condition of the target service interface according to the access completion information, and feed back the environment access condition of the target service interface to the client, so that the client can master the environment access condition of the target service interface. On the basis of the embodiment, when the routing information is updated, the routing update information is received, and the target address is dynamically and flexibly determined through the environment access request and the routing update information sent by the client, so that the target service interface accesses the environment corresponding to the target address through the target address, thereby realizing the environment access of the target service interface and ensuring the accuracy of the environment access.
Fig. 3 is a schematic structural diagram of an environment access device provided in the present invention, where the device includes: a receiving module 301, a determining module 302 and a transmitting module 303. Wherein,
The receiving module 301 is configured to receive route update information of a target service interface sent by a gateway configuration center, and receive an environment access request sent by a client.
A determining module 302, configured to determine a destination address according to the route update information and the environment access request.
And the sending module 303 is configured to send the target address to the target service interface, so that the target service interface accesses the environment corresponding to the target address through the target address.
Optionally, the context access request includes a preset field.
Optionally, the determining module 302 is specifically configured to: determining route configuration information according to the route update information; the route configuration information at least comprises a keyword and a first address; determining whether a preset field is matched with the keyword; if the preset field is matched with the keyword, the first address is used as a target address; if the preset field is not matched with the keyword, determining a second address, and taking the second address as a target address.
Optionally, the determining module 302 is configured to determine route configuration information according to the route update information, specifically configured to: analyzing the route update information based on an analysis reload algorithm; and determining route configuration information according to the analyzed route updating information.
Optionally, the environment corresponding to the first address is a gray environment; the environment corresponding to the second address is a production environment.
Optionally, the apparatus further comprises: the request sending module is used for receiving notification information sent by the gateway configuration center before receiving the route update information of the target service interface sent by the gateway configuration center; the notification information is used for indicating that the version of at least one service interface is changed; according to the notification information, an update request is sent to a gateway configuration center; the update request includes identification information of the target service interface, so that the gateway configuration center determines whether the version of the target service interface changes according to the identification information, and sends route update information of the target service interface to the gateway when the version of the target service interface changes.
Optionally, the apparatus further comprises: the information sending module is used for sending the instance information of the gateway to the gateway configuration center before receiving the notification information sent by the gateway configuration center, so that the gateway configuration center registers the gateway according to the instance information; wherein the instance information includes a gateway name; receiving feedback information sent by a gateway configuration center; the feedback information is used for indicating a registration result of the gateway configuration center to the gateway.
Optionally, the apparatus further comprises: the information feedback module is used for receiving the access completion information sent by the target service interface after sending the target address to the target service interface and forwarding the access completion information to the client; the access completion information is used for feeding back the environment access condition of the target service interface.
The environment access device provided by the embodiment can execute the environment access method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Fig. 4 is a schematic diagram of the architecture of a gateway provided in the present invention, the gateway being intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other suitable computers. The gateway may also represent various forms of mobile devices such as personal digital processing, cellular telephones, smart phones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 4, the gateway 10 includes at least one processor 11, and a Memory communicatively connected to the at least one processor 11, such as a Read Only Memory (ROM) 12, a random access Memory (also referred to as "random access Memory", random Access Memory, RAM) 13, etc., in which the Memory stores a computer program executable by the at least one processor, and the processor 11 may perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the gateway 10 may also be stored. The processor 11, the ROM 12 and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
The various components in gateway 10 are connected to I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, etc.; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the gateway 10 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as the environment access method.
In some embodiments, the environmental access method may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto gateway 10 via ROM 12 and/or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the above-described method of environmental access may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the environment access method in any other suitable way (e.g. by means of firmware).
Various implementations of the systems and techniques described here above can be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a gateway having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or a trackball) through which a user can provide input to the gateway. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.
Claims (10)
1. An environment access method is characterized by being applied to a gateway, wherein the gateway is in butt joint with a target service interface; the method comprises the following steps:
Receiving the route update information of the target service interface sent by a gateway configuration center, and receiving an environment access request sent by a client;
determining a target address according to the route update information and the environment access request;
And sending the target address to the target service interface so that the target service interface accesses the environment corresponding to the target address through the target address.
2. The method of claim 1, wherein the environment access request includes a preset field;
the determining a target address according to the route update information and the environment access request comprises:
Determining route configuration information according to the route update information; the routing configuration information at least comprises a keyword and a first address;
Determining whether the preset field is matched with the keyword;
If the preset field is matched with the keyword, the first address is used as the target address;
and if the preset field is not matched with the keyword, determining a second address, and taking the second address as the target address.
3. The method according to claim 2, wherein determining route configuration information according to the route update information comprises:
analyzing the route updating information based on an analysis reload algorithm;
And determining route configuration information according to the analyzed route updating information.
4. The environment accessing method according to claim 2, wherein the environment corresponding to the first address is a gray environment; the environment corresponding to the second address is a production environment.
5. The method according to claim 1, further comprising, before receiving the route update information of the target service interface sent by the gateway configuration center:
Receiving notification information sent by the gateway configuration center; the notification information is used for indicating that the version of at least one service interface is changed;
Sending an update request to the gateway configuration center according to the notification information; the update request comprises identification information of the target service interface, so that the gateway configuration center determines whether the version of the target service interface changes according to the identification information, and when the version of the target service interface changes, the gateway transmits route update information of the target service interface.
6. The method according to claim 5, further comprising, before receiving the notification information sent by the gateway configuration center:
transmitting the instance information of the gateway to the gateway configuration center so that the gateway configuration center registers the gateway according to the instance information; wherein the instance information includes a gateway name;
receiving feedback information sent by the gateway configuration center; the feedback information is used for indicating a registration result of the gateway configuration center to the gateway.
7. The method of claim 1, further comprising, after sending the destination address to the destination service interface:
Receiving access completion information sent by the target service interface, and forwarding the access completion information to the client; the access completion information is used for feeding back the environment access condition of the target service interface.
8. An environment access device is characterized by being applied to a gateway, wherein the gateway is in butt joint with a target service interface; the device comprises:
The receiving module is used for receiving the route update information of the target service interface sent by the gateway configuration center and receiving an environment access request sent by the client;
the determining module is used for determining a target address according to the route updating information and the environment access request;
And the sending module is used for sending the target address to the target service interface so that the target service interface accesses the environment corresponding to the target address through the target address.
9. A gateway, the gateway comprising:
at least one processor; and a memory communicatively coupled to the at least one processor; wherein,
The memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the method of environmental access of any one of claims 1-7.
10. A computer readable storage medium storing computer instructions for causing a processor to implement the method of environmental access of any one of claims 1-7 when executed.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410305535.3A CN118200220A (en) | 2024-03-18 | 2024-03-18 | Environment access method, device, gateway and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410305535.3A CN118200220A (en) | 2024-03-18 | 2024-03-18 | Environment access method, device, gateway and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN118200220A true CN118200220A (en) | 2024-06-14 |
Family
ID=91409468
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410305535.3A Pending CN118200220A (en) | 2024-03-18 | 2024-03-18 | Environment access method, device, gateway and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118200220A (en) |
-
2024
- 2024-03-18 CN CN202410305535.3A patent/CN118200220A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111427701A (en) | Workflow engine system and business processing method | |
CN114328132A (en) | Method, device, equipment and medium for monitoring state of external data source | |
CN115509522A (en) | Interface arranging method and system for low-code scene and electronic equipment | |
CN113778644B (en) | Task processing method, device, equipment and storage medium | |
CN114389969A (en) | Client test method and device, electronic equipment and storage medium | |
CN116737928B (en) | Text mining method and system for platform user requirements and cloud platform | |
CN117520195A (en) | Method, apparatus, device, storage medium and program product for testing interface | |
CN116860751A (en) | Data processing method and device, electronic equipment and storage medium | |
CN112052152A (en) | Simulation test method and device | |
CN118200220A (en) | Environment access method, device, gateway and storage medium | |
CN114218313A (en) | Data management method, device, electronic equipment, storage medium and product | |
CN113779018A (en) | Data processing method and device | |
US11682014B2 (en) | Method and apparatus for operating blockchain system, device and storage medium | |
CN116301869B (en) | Front-end page configuration management and control system, method, equipment and medium | |
CN115563183B (en) | Query method, query device and program product | |
CN113835893B (en) | Data processing method, device, equipment, storage medium and program product | |
CN112560462B (en) | Event extraction service generation method, device, server and medium | |
CN113360258B (en) | Data processing method, device, electronic equipment and storage medium | |
CN115220722A (en) | Method, device, equipment and medium for back-end internationalization | |
CN113849170A (en) | Code sharing method and device, electronic equipment and storage medium | |
CN117931506A (en) | Document verification method, device, equipment and storage medium | |
CN116483607A (en) | Abnormal function maintenance method, device, equipment and storage medium | |
CN116974940A (en) | Interface testing method, device, equipment and storage medium | |
CN117992417A (en) | Log calling method, device and system | |
CN115269055A (en) | Nginx request data acquisition method, device, equipment and storage medium |
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 |