CN117956036A - Service access method, device, electronic equipment and storage medium - Google Patents

Service access method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN117956036A
CN117956036A CN202311462328.0A CN202311462328A CN117956036A CN 117956036 A CN117956036 A CN 117956036A CN 202311462328 A CN202311462328 A CN 202311462328A CN 117956036 A CN117956036 A CN 117956036A
Authority
CN
China
Prior art keywords
access
target
access information
service
domain name
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
Application number
CN202311462328.0A
Other languages
Chinese (zh)
Inventor
徐强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Mashang Xiaofei Finance Co Ltd
Original Assignee
Mashang Xiaofei Finance Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Mashang Xiaofei Finance Co Ltd filed Critical Mashang Xiaofei Finance Co Ltd
Priority to CN202311462328.0A priority Critical patent/CN117956036A/en
Publication of CN117956036A publication Critical patent/CN117956036A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application provides a service access method, a device, electronic equipment and a storage medium; the method comprises the following steps: receiving an access request of a target service, wherein the access request carries a target access domain name of the target service; if the history access information stored by the management node does not exist, acquiring target access information of target service; and sending target access information to each functional node in the functional node cluster. The application can effectively improve the service access efficiency.

Description

Service access method, device, electronic equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a service access method, a service access device, an electronic device, and a storage medium.
Background
The cluster technology is a technology which is recently developed along with the development of the Internet, and a group of mutually independent computers are connected through a high-speed network to form a cluster system capable of uniformly managing and scheduling and used for processing services in various big data scenes, so that the expandability and the reliability of the services are improved. In order to ensure that the service in the big data scene can normally run, a cluster system generally stores massive data so as to support various services in the big data scene.
Disclosure of Invention
The embodiment of the application provides a service access method, a device, electronic equipment, a computer readable storage medium and a computer program product, which can effectively improve service access efficiency.
The technical scheme of the embodiment of the application is realized as follows:
The embodiment of the application provides a service access method, which comprises the following steps:
receiving an access request of a target service, wherein the access request carries a target access domain name of the target service;
if the history access information stored by the management node does not contain the history access information including the target access domain name, acquiring target access information of the target service;
and sending the target access information to each functional node in the functional node cluster.
The embodiment of the application provides a service access device, which comprises:
The receiving module is used for receiving an access request of a target service, wherein the access request carries a target access domain name of the target service;
the acquisition module is used for acquiring the target access information of the target service if the history access information comprising the target access domain name does not exist in the history access information stored by the management node;
And the sending module is used for sending the target access information to each functional node in the functional node cluster.
In the above scheme, the receiving module is further configured to obtain a history access information set stored by the management node, where the history access information set includes a plurality of pieces of history access information, and the history access information includes a mapping relationship between a history access domain name of a history access service and an internet protocol address of the history access service; comparing each history access information with the target access domain name to obtain a comparison result corresponding to each history access information; and determining indication information of the management node based on the comparison result, wherein the indication information is used for indicating whether historical access information comprising the target access domain name exists in the historical access information stored by the management node.
In the above solution, the receiving module is further configured to parse the access request to obtain a parsing result, and if the parsing result indicates that the access request does not carry the internet protocol address of the target service, obtain the historical access information set stored by the management node.
In the above solution, the receiving module is further configured to send the access request to the target service based on an internet protocol address of the target service in the target access information; and receiving an access result returned by the target service aiming at the access request, and sending the access result to the target function node.
In the above solution, the receiving module is further configured to send the access request to the target service based on the internet protocol address if the analysis result indicates that the access request carries the internet protocol address of the target service; and receiving an access result returned by the target service aiming at the access request, and sending the access result to the target function node.
In the above aspect, the receiving module is further configured to send, if the indication information indicates that the history access information including the target access domain name exists in the history access information stored in the management node, the access request to the target service based on an internet protocol address in the history access information including the target access domain name; and receiving an access result returned by the target service aiming at the access request, and sending the access result to the target function node.
In the above aspect, the receiving module is further configured to determine the storage information of the management node as the first storage information if each comparison result indicates that the history access domain name of the history access information is different from the target access domain name; if the comparison result indicating that the historical access domain name of the historical access information is the same as the target access domain name exists, determining the storage information of the management node as second storage information; the first storage information is used for indicating that the history access information including the target access domain name does not exist in the history access information stored by the management node, and the second storage information is used for indicating that the history access information including the target access domain name exists in the history access information stored by the management node.
In the above aspect, the sending module is further configured to determine, as the reference access information, the history access information including the target access domain name if the history access information including the target access domain name exists in the history access information stored in the management node; and sending the reference access information to the target function node, wherein the reference access information is used for the target function node to send the access request to the target service based on the Internet protocol address in the reference access information and receive an access result returned by the target service for the access request.
In the above scheme, the service access device further includes: and the updating module is used for adding the target access information to the historical access information set stored by the management node to obtain an updated access information set, and replacing the historical access information set stored in the management node with the updated access information set.
The embodiment of the application provides a service access device, which is applied to a functional node and comprises: the query module is used for receiving target access information of target service, and querying the target access information from the history access information stored by the functional node to obtain a first query result of the target access information; the information updating module is used for updating the target access information into the history access information if the first query result indicates that the target access information does not exist in the history access information; and the access module is used for accessing the target service based on the target access information.
In the above scheme, the service access device further includes: the domain name receiving module is used for receiving a target access domain name of a target service; and the generation module is used for generating an access request aiming at the target service according to the second query result and the target access domain name, wherein the second query result is used for indicating whether the history access information comprising the target access domain name exists in the history access information.
In the above scheme, the query module is further configured to query the target access domain name from the history access information stored in the functional node, to obtain a second query result of the target access domain name.
In the above solution, the generating module is further configured to determine, if the second query result indicates that the functional node stores history access information including the target access domain name, the history access information including the target access domain name as target access information of the target service; generating a first access request based on the target access information, wherein the first access request carries the target access domain name and the Internet protocol address; and if the query result indicates that the function node does not store the history access information comprising the target access domain name, generating a second access request carrying the target access domain name based on the target access domain name.
In the above scheme, the service access device further includes: a sending module, configured to send the first access request to the target service; sending the second access request to the management node
In the above solution, the domain name receiving module is further configured to generate, if the storage information indicates that the history access information is not stored in the functional node, the access request carrying the target access domain name based on the target access domain name; and sending the access request to the management node.
The embodiment of the application provides a service access device, and the distributed storage system comprises: a management node and a functional node cluster comprising a plurality of functional nodes, comprising: the receiving module is used for receiving an access request of the target service by the management node, wherein the access request carries a target access domain name of the target service; the acquisition module is used for acquiring the target access information of the target service if the history access information comprising the target access domain name does not exist in the history access information stored by the management node; the sending module is used for sending the target access information to each functional node of the functional node cluster by the management node; the query module is used for receiving the target access information by the functional node, and querying the target access information in the history access information stored by the functional node to obtain a query result of the target access information; the information updating module is used for updating the target access information into the history access information by the functional node if the query result indicates that the history access information does not contain the target access information; and the access module is used for the functional node to access the target service based on the target access information.
An embodiment of the present application provides an electronic device, including:
a memory for storing computer executable instructions or computer programs;
and the processor is used for realizing the service access method provided by the embodiment of the application when executing the computer executable instructions or the computer programs stored in the memory.
The embodiment of the application provides a computer readable storage medium, which stores computer executable instructions for realizing the service access method provided by the embodiment of the application when being executed by a processor.
Embodiments of the present application provide a computer program product comprising a computer program or computer-executable instructions stored in a computer-readable storage medium. The processor of the electronic device reads the computer executable instructions from the computer readable storage medium, and the processor executes the computer executable instructions, so that the electronic device executes the service access method according to the embodiment of the present application.
The embodiment of the application has the following beneficial effects:
and receiving an access request of the target service through the management node, if the history access information stored by the management node does not contain the history access information including the target access domain name, acquiring the target access information of the target service, and transmitting the target access information to each function node in the function node cluster, so that each function node in the function node cluster does not need to carry out configuration of the target access information when accessing the target service next time, and realizing efficient access of the target service, thereby effectively improving service access efficiency.
Drawings
Fig. 1 is a schematic architecture diagram of a service access system according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of an electronic device for service access according to an embodiment of the present application;
Fig. 3 is a schematic structural diagram II of an electronic device for service access according to an embodiment of the present application;
fig. 4 is a schematic flow chart of a service access method according to an embodiment of the present application;
fig. 5 is a second flow chart of a service access method according to an embodiment of the present application;
fig. 6 is a flow chart diagram III of a service access method according to an embodiment of the present application;
fig. 7 is a flow chart diagram of a service access method according to an embodiment of the present application;
fig. 8 is a flow chart diagram of a service access method according to an embodiment of the present application;
fig. 9 is a flowchart of a service access method according to an embodiment of the present application;
fig. 10 is a flow chart of a service access method according to an embodiment of the present application;
fig. 11 is a schematic diagram of a service access method according to an embodiment of the present application;
fig. 12 is a schematic diagram II of a service access method according to an embodiment of the present application;
Fig. 13 is a schematic diagram III of a service access method according to an embodiment of the present application;
Fig. 14 is a schematic diagram of a service access method according to an embodiment of the present application.
Detailed Description
The present application will be further described in detail with reference to the accompanying drawings, for the purpose of making the objects, technical solutions and advantages of the present application more apparent, and the described embodiments should not be construed as limiting the present application, and all other embodiments obtained by those skilled in the art without making any inventive effort are within the scope of the present application.
In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is to be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments and can be combined with one another without conflict.
In the following description, the terms "first", "second", "third" and the like are merely used to distinguish similar objects and do not represent a specific ordering of the objects, it being understood that the "first", "second", "third" may be interchanged with a specific order or sequence, as permitted, to enable embodiments of the application described herein to be practiced otherwise than as illustrated or described herein.
Unless defined otherwise, all 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. The terminology used herein is for the purpose of describing embodiments of the application only and is not intended to be limiting of the application.
Before describing embodiments of the present application in further detail, the terms and terminology involved in the embodiments of the present application will be described, and the terms and terminology involved in the embodiments of the present application will be used in the following explanation.
1) Distributed file system (Hadoop Distributed FILE SYSTEM, HDFS): refers to a Distributed file system (Distributed FILE SYSTEM) designed to operate on generic hardware (commodity hardware). It has much in common with existing distributed file systems, but at the same time, it is also clearly distinguishable from other distributed file systems. HDFS is a highly fault tolerant system suitable for deployment on inexpensive machines, and provides high throughput data access, well suited for applications on large data sets. HDFS relaxes a portion of the POSIX constraints to achieve the purpose of streaming file system data. HDFS is characterized by high fault tolerance (fault-tolerant) and is designed to be deployed on inexpensive (low-cost) hardware. And it provides high throughput (high throughput) access to data of applications suitable for those applications having an oversized data set (LARGE DATA SET). HDFS relaxes the requirements (requirements) of (relax) POSIX so that data in the file system can be accessed (STREAMING ACCESS) in a stream.
2) Data warehouse tool (Hive): is a data warehouse tool based on Hadoop and is used for extracting, converting and loading data, and is a mechanism capable of storing, inquiring and analyzing large-scale data stored in the Hadoop. The Hive data warehouse tool can map a structured data file into a database table, provide SQL query functions, and convert SQL sentences into MapReduce tasks for execution. Hive has the advantages that learning cost is low, rapid MapReduce statistics can be realized through SQL-like sentences, mapReduce is simpler, and a special MapReduce application program does not need to be developed. hive is well suited for statistical analysis of data warehouses.
3) Client side: applications running in the terminal for providing various services, such as a video play client, a game client, etc.
4) In response to: for representing a condition or state upon which an operation is performed, one or more operations performed may be in real-time or with a set delay when the condition or state upon which the operation is dependent is satisfied; without being specifically described, there is no limitation in the execution sequence of the plurality of operations performed.
5) Cloud Technology (Cloud Technology): cloud technology refers to a hosting technology for unifying serial resources such as hardware, software, network and the like in a wide area network or a local area network to realize calculation, storage, processing and sharing of data. The cloud technology is based on the general names of network technology, information technology, integration technology, management platform technology, application technology and the like applied by the cloud computing business mode, can form a resource pool, and is flexible and convenient as required. Cloud computing technology will become an important support. Background services of technical networking systems require a large amount of computing, storage resources, such as video websites, picture-like websites, and more portals. Along with the high development and application of the internet industry, each article possibly has an own identification mark in the future, the identification mark needs to be transmitted to a background system for logic processing, data with different levels can be processed separately, and various industry data needs strong system rear shield support and can be realized only through cloud computing.
6) Service data: the data used by the service application running can be understood as a direct object of the service application running for making database calls (such as adding and deleting and modifying). The service data includes, but is not limited to, various service resource data required by the service application to respond to the service request, user service data collected and stored by the service application, and the like. In particular, the service data may include text data, image data, file data, and the like. In the embodiment of the present application, data stored in the cluster system except for metadata may be referred to as service data. The business data is typically accessed in the present system in the form of database tables.
7) The cluster system, which may be referred to as a computer cluster, connects a group of loosely integrated computer software and/or hardware together through a high-speed network, and performs computation in a close cooperation manner, which is equivalent to performing work to be executed by a computer through a combination of multiple computers. In a clustered system, a single computer may be considered as a computing node, so as to complete a part of computing tasks, and multiple computers cooperate to complete the whole computing task. In particular, the cluster system may comprise a server cluster and/or a database cluster.
8) Internet protocol address (Internet Protocol Address): refers to an internet protocol address, which is translated into an internet protocol address. The IP address is a unified address format provided by the IP protocol, which allocates a logical address to each network and each host on the internet, so as to mask the difference of physical addresses. There is also a very important content in the IP protocol, namely that each computer and other devices on the internet are given a unique address called "IP address". With such unique addresses, it is ensured that a user can efficiently and conveniently select his or her own desired objects from millions of computers while operating on the networked computers. The IP address is just like our home address, and if you want to write a letter to a person, you want to know his (her) address so that the carrier can send the letter to. The computer sends the information as if it were a carrier, it must know the unique "home address" in order not to send the message to the wrong person. Only our address is shown literally, the address of the computer is shown as a binary number. The IP address is used to give a number to a computer on the Internet. What is seen daily is that each networked PC requires an IP address to communicate properly.
9) A Domain Name, also called a network Domain, is a Name of a certain target service on the internet, which is composed of a series of names separated by dots, and is used for locating and identifying a computer (sometimes also referred to as a geographic location) during data transmission. Because the IP addresses are inconvenient to memorize and cannot display the names and properties of the address organization, the Domain name is designed, and the Domain name and the IP address are mapped to each other through a Domain name system (DNS NAME SYSTEM), so that people can access the internet more conveniently without memorizing the number strings of the IP addresses which can be directly read by a machine.
In the implementation of the embodiments of the present application, the applicant found that the related art has the following problems:
In the related art, for accessing a service, when any functional node in a cluster needs to access a target service, when the functional node does not locally store an internet protocol address of the target service, the functional node is often required to configure the internet protocol address of the target service in the functional node, and then the functional node can only access the target service, which results in that different functional nodes need to be repeatedly configured when accessing the same target service, and thus the service access efficiency is low.
The embodiment of the application provides a service access method, a device, electronic equipment, a computer readable storage medium and a computer program product, which can effectively improve service access efficiency, and the following describes an exemplary application of a service access system provided by the embodiment of the application.
Referring to fig. 1, fig. 1 is a schematic architecture diagram of a service access system 100 according to an embodiment of the present application, where a terminal (a terminal 400 is shown in an exemplary manner) is connected to a server 200 through a network 300, and the network 300 may be a wide area network or a local area network, or a combination of the two.
The terminal 400 is configured to display a target service on a graphical interface 410-1 (the graphical interface 410-1 is shown as an example) using a client 410 for a user. The terminal 400 and the server 200 are connected to each other through a wired or wireless network.
In some embodiments, the server 200 may be a stand-alone physical server, a server cluster or a distributed system formed by a plurality of physical servers, or may be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, a content delivery network (Content Delivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms. The terminal 400 may be, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart television, a smart watch, a car terminal, etc. The electronic device provided by the embodiment of the application can be implemented as a terminal or a server. The terminal and the server may be directly or indirectly connected through wired or wireless communication, which is not limited in the embodiment of the present application.
In some embodiments, the management node running on the server 200 receives an access request of a target service sent by the terminal 400, where the access request carries a target access domain name of the target service; if the history access information stored by the management node does not exist, acquiring target access information of target service; the target access information is transmitted to each of the functional nodes in the functional node cluster operating in the terminal 400.
In other embodiments, the management node of the distributed storage system running on the terminal 400 receives an access request of the target service sent by the server 200, where the access request carries a target access domain name of the target service; if the history access information stored by the management node does not exist, acquiring target access information of target service; the target access information is transmitted to each of the functional nodes in the functional node cluster running in the server 200.
In other embodiments, the embodiments of the present application may be implemented by means of Cloud Technology (Cloud Technology), which refers to a hosting Technology that unifies serial resources such as hardware, software, networks, etc. in a wide area network or a local area network, so as to implement calculation, storage, processing, and sharing of data.
The cloud technology is a generic term of network technology, information technology, integration technology, management platform technology, application technology and the like based on cloud computing business model application, can form a resource pool, and is flexible and convenient as required. Cloud computing technology will become an important support. Background services of technical network systems require a large amount of computing and storage resources.
Referring to fig. 2, fig. 2 is a schematic structural diagram of an electronic device 500 for service access according to an embodiment of the present application, where the electronic device 500 shown in fig. 2 may be the server 200 or the terminal 400 in fig. 1, and the electronic device 500 shown in fig. 2 includes: at least one processor 430, a memory 450, at least one network interface 420. The various components in electronic device 500 are coupled together by bus system 440. It is understood that the bus system 440 is used to enable connected communication between these components. The bus system 440 includes a power bus, a control bus, and a status signal bus in addition to the data bus. But for clarity of illustration the various buses are labeled in fig. 2 as bus system 440.
The Processor 430 may be an integrated circuit chip with signal processing capabilities such as a general purpose Processor, such as a microprocessor or any conventional Processor, a digital signal Processor (DSP, digital Signal Processor), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like.
Memory 450 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid state memory, hard drives, optical drives, and the like. Memory 450 optionally includes one or more storage devices physically remote from processor 430.
Memory 450 includes volatile memory or nonvolatile memory, and may also include both volatile and nonvolatile memory. The non-volatile Memory may be a Read Only Memory (ROM) and the volatile Memory may be a random access Memory (RAM, random Access Memory). The memory 450 described in embodiments of the present application is intended to comprise any suitable type of memory.
In some embodiments, memory 450 is capable of storing data to support various operations, examples of which include programs, modules and data structures, or subsets or supersets thereof, as exemplified below.
An operating system 451 including system programs, e.g., framework layer, core library layer, driver layer, etc., for handling various basic system services and performing hardware-related tasks, for implementing various basic services and handling hardware-based tasks;
A network communication module 452 for accessing other electronic devices via one or more (wired or wireless) network interfaces 420, the exemplary network interface 420 comprising: bluetooth, wireless compatibility authentication (WiFi, wireless Fidelity), and universal serial bus (USB, universal Serial Bus), etc.
In some embodiments, the service access apparatus provided in the embodiments of the present application may be implemented in software, and fig. 2 shows the service access apparatus 455 stored in the memory 450, which may be software in the form of a program and a plug-in, and includes the following software modules: the receiving module 4551, the acquiring module 4552, and the transmitting module 4553 are logical, and thus may be arbitrarily combined or further split according to the implemented functions. The functions of the respective modules will be described hereinafter.
Referring to fig. 3, fig. 3 is a schematic structural diagram of an electronic device 600 for service access according to an embodiment of the present application, where the electronic device 600 shown in fig. 3 may be the server 200 or the terminal 400 in fig. 1, and the electronic device 600 shown in fig. 3 includes: at least one processor 530, memory 550, at least one network interface 520. The various components in the electronic device 600 are coupled together by a bus system 540. It is appreciated that the bus system 540 is used to enable connected communications between these components. The bus system 540 includes a power bus, a control bus, and a status signal bus in addition to the data bus. The various buses are labeled as bus system 540 in fig. 3 for clarity of illustration.
Processor 530 may be an integrated circuit chip having signal processing capabilities such as a general purpose Processor, such as a microprocessor or any conventional Processor, a digital signal Processor (DSP, digital Signal Processor), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like.
The memory 550 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid state memory, hard drives, optical drives, and the like. Memory 550 may optionally include one or more storage devices physically located remote from processor 530.
Memory 550 includes volatile memory or nonvolatile memory, and may also include both volatile and nonvolatile memory. The non-volatile Memory may be a Read Only Memory (ROM) and the volatile Memory may be a random access Memory (RAM, random Access Memory). The memory 550 described in embodiments of the present application is intended to comprise any suitable type of memory.
In some embodiments, memory 550 is capable of storing data to support various operations, examples of which include programs, modules and data structures, or subsets or supersets thereof, as exemplified below.
An operating system 551 including system programs for handling various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and handling hardware-based tasks;
Network communication module 552 is used to reach other electronic devices via one or more (wired or wireless) network interfaces 520, exemplary network interfaces 520 include: bluetooth, wireless compatibility authentication (WiFi, wireless Fidelity), and universal serial bus (USB, universal Serial Bus), etc.
In some embodiments, the service access apparatus provided in the embodiments of the present application may be implemented in software, and fig. 3 shows a service access apparatus 555 stored in a memory 550, which may be software in the form of a program, a plug-in, or the like, including the following software modules: the query module 5551, the information update module 5552, the access module 5553 are logical, and thus may be arbitrarily combined or further split depending on the functions implemented. The functions of the respective modules will be described hereinafter.
In other embodiments, the service accessing apparatus provided in the embodiments of the present application may be implemented in hardware, and as an example, the service accessing apparatus provided in the embodiments of the present application may be a processor in the form of a hardware decoding processor, which is programmed to perform the service accessing method provided in the embodiments of the present application, for example, the processor in the form of a hardware decoding processor may use one or more Application specific integrated circuits (ASICs, applications SPECIFIC INTEGRATED circuits), DSPs, programmable logic devices (PLDs, programmable Logic Device), complex Programmable logic devices (CPLDs, complex Programmable Logic Device), field Programmable gate arrays (FPGAs, field Programmable GATE ARRAY), or other electronic components.
In some embodiments, the terminal or the server may implement the service access method provided by the embodiments of the present application by running a computer program or computer executable instructions. For example, the computer program may be a native program (e.g., a dedicated business access program) or a software module in an operating system, e.g., a business access module that may be embedded in any program (e.g., an instant messaging client, an album program, an electronic map client, a navigation client); for example, a Native Application (APP) may be used, i.e. a program that needs to be installed in an operating system to be run. In general, the computer programs described above may be any form of application, module or plug-in.
The service access method provided by the embodiment of the application will be described in conjunction with the exemplary application and implementation of the server or the terminal provided by the embodiment of the application.
The service access method provided by the embodiment of the application can be applied to a distributed storage system, the distributed storage system provided by the embodiment of the application comprises a management node and a functional node cluster comprising a plurality of functional nodes, and the service access method provided by the embodiment of the application is respectively described below from the angles of the management node applied to the distributed storage system, the functional node applied to the distributed storage system and the distributed storage system.
Referring to fig. 4, fig. 4 is a schematic flow chart of a service access method provided in an embodiment of the present application, which will be described with reference to steps 101 to 103 shown in fig. 4, and the service access method provided in the embodiment of the present application may be implemented by a server or a terminal alone or by a server and a terminal cooperatively, and will be described below by taking a server alone as an example.
In step 101, an access request of a target service is received, where the access request carries a target access domain name of the target service.
In some embodiments, the functional node cluster includes a plurality of target functional nodes, which are also called Domain names (domains), which are names of a certain target service on the internet, and are formed by a series of names separated by dots, and are used for locating and identifying a computer (sometimes referred to as a geographic location) during data transmission. Because the IP addresses are inconvenient to memorize and cannot display the names and properties of the address organization, the Domain name is designed, and the Domain name and the IP address are mapped to each other through a Domain name system (DNS NAME SYSTEM), so that people can access the internet more conveniently without memorizing the number strings of the IP addresses which can be directly read by a machine.
In some embodiments, the access request received by the management node may be an access request sent by the management node to the access direction of the target service, and then the management node may be capable of establishing a communication connection with the target service and accessing the target service.
In other embodiments, the access request received by the management node may be that the target function node sends an access request for the target service to the management node, or when the internet protocol address of the target service is not stored in the local area of the target function node, the access request for the target service is sent to the management node, so that after the management node obtains the internet protocol address of the target service, the internet protocol address is sent to the target function node, and the target function node can establish a communication connection with the target service and access the target service. In this case, the access request received by the management node must not carry the internet protocol address, since the target functional node will send the access request to the management node only if the internet protocol address is not stored locally. At this time, the management node in the distributed storage system is configured to obtain an internet protocol address of the target service, and the target function node in the distributed storage system is configured to access the target service.
In other embodiments, the target function node sends the access request for the target service to the management node, which may be whether the internet protocol address of the target service is stored locally or not, and then the access request for the target service may or may not be carried in the access request received by the management node, where the management node in the distributed storage system is configured to obtain the internet protocol address of the target service and access the target service, and return the access result to the target function node, and the target function node in the distributed storage system is configured to generate the access request and receive the access result sent by the management node.
In some embodiments, referring to fig. 5, fig. 5 is a schematic flow chart of a service access method according to an embodiment of the present application, and after step 101 shown in fig. 4, steps 104 to 106 shown in fig. 5 may be further performed.
In step 104, a set of historical access information stored by the management node is obtained.
In some embodiments, the set of historical access information includes a plurality of pieces of historical access information, the historical access information including a mapping relationship between a historical access domain name of the historical access service and an internet protocol address of the historical access service.
In some embodiments, the history access service refers to a history service that each functional node in the functional node cluster in the distributed storage system has accessed, and the history access information refers to an index entry of the history access service in a Domain name system (DNS, domain NAME SYSTEM).
In some embodiments, before performing step 104 described above, the following processing may also be performed: and analyzing the access request to obtain an analysis result.
In some embodiments, the parsing result is used to indicate whether the access request carries an internet protocol address of the target service.
In some embodiments, the target function node sends the access request for the target service to the management node, which may be whether the internet protocol address of the target service is stored locally or not, and then the access request received by the management node may or may not carry the internet protocol address, and at this time, the access request may be parsed to obtain a parsing result, so as to determine whether the internet protocol address is carried in the access request received by the management node.
In some embodiments, after parsing the access request to obtain the parsing result, the access result may be obtained by: if the analysis result indicates that the access request carries the Internet protocol address of the target service, sending the access request to the target service based on the Internet protocol address; and receiving an access result returned by the target service aiming at the access request, and sending the access result to the target function node.
In some embodiments, if the analysis result indicates that the access request carries the internet protocol address of the target service, because the management node in the distributed storage system is configured to obtain the internet protocol address of the target service and access the target service at this time, and return the access result to the target function node, the management node may directly send the access request to the target service based on the internet protocol address carried in the access request without locally querying the management node for the internet protocol address of the target service, and receive the access result returned by the target service for the access request, and send the access result to the target function node.
In this way, the analysis result indicates that the internet protocol address of the target service is carried in the access request, the access request is sent to the target service directly based on the internet protocol address carried in the access request, the access result returned by the target service aiming at the access request is received, and the access result is sent to the target function node, so that the management node does not need to locally query the internet protocol address of the target service, the access time is effectively saved, and the service access efficiency is effectively improved.
In some embodiments, referring to fig. 6, fig. 6 is a schematic flow chart of a service access method according to an embodiment of the present application, and step 104 shown in fig. 5 may be implemented by executing step 1041 shown in fig. 6.
In step 1041, if the analysis result indicates that the access request does not carry the internet protocol address of the target service, a historical access information set stored by the management node is obtained.
In some embodiments, if the analysis result indicates that the access request does not carry the internet protocol address of the target service, it is required to query from the management node locally whether there is historical access information including the internet protocol address of the target service, at which point the historical access information set stored in the management node may be passed.
In step 105, each history access information is compared with the target access domain name, and a comparison result corresponding to each history access information is obtained.
In some embodiments, the step 105 may be implemented as follows: and comparing the historical domain name in the historical access information with the target access domain name aiming at each target access domain name to obtain a comparison result of the target access domain name.
In step 106, based on the comparison result, indication information of the management node is determined.
In some embodiments, the indication information is used for indicating whether the history access information including the target access domain name exists in the history access information stored by the management node.
In some embodiments, referring to fig. 7, fig. 7 is a schematic flow chart of a service access method according to an embodiment of the present application, and step 106 shown in fig. 5 may be implemented by performing steps 1061 to 1062 shown in fig. 7.
In step 1061, in a case where each comparison result indicates that the history access domain name of the history access information is different from the target access domain name, the storage information of the management node is determined as the first storage information.
In some embodiments, the first stored information is used to indicate that there is no history access information including the target access domain name in the history access information stored by the management node.
As an example, if each comparison result indicates that the history access domain name in the history access information is different from the target access domain name, it is indicated that the target access domain name does not exist in the set of history access information stored in the management node, the storage information of the management node may be determined as first storage information for indicating that the history access information including the target access domain name does not exist in the history access information stored in the management node.
In step 1062, in the case where there is a comparison result indicating that the history access domain name is the same as the target access domain name in the history access information, the storage information of the management node is determined as the second storage information.
In some embodiments, the second stored information indicates that there is historical access information including the target access domain name in the historical access information stored by the management node.
As an example, if there is a comparison result indicating that the history access domain name in the history access information is the same as the target access domain name, it is explained that the history access information stored in the management node is concentrated to the target access domain name, the storage information of the management node may be determined as storage information indicating that the history access information including the target access domain name exists in the history access information stored in the management node.
In some embodiments, after determining the indication information of the management node based on the comparison result, the access result may be obtained by: if the indication information indicates that the history access information stored by the management node exists, sending an access request to a target service based on an Internet protocol address in the history access information comprising the target access domain name; and receiving an access result returned by the target service aiming at the access request, and sending the access result to the target function node.
In some embodiments, the target function node sends an access request for the target service to the management node, whether the access request for the target service is stored locally or not may be determined, if no internet protocol address is stored locally in the access request received by the management node, the access request is forwarded to the target service by the management node to achieve access to the target service, then the access request received by the management node may or may not carry the internet protocol address, at this time, the access request may be parsed to obtain a parsing result, so as to determine whether the access request received by the management node carries the internet protocol address, and when the internet protocol address is not carried in the access request received by the management node and the internet protocol address is stored in the history access information set stored in the management node, then the access request may be sent to the target service based on the internet protocol address in the history access information including the target access domain name, and the access result returned by the target service for the access request is received, and the access result is sent to the target function node.
In this way, the access request received by the management node may or may not carry the internet protocol address, at this time, the access request may be parsed to obtain a parsing result, so as to determine whether the access request received by the management node carries the internet protocol address, when the access request received by the management node does not carry the internet protocol address, and the historical access information stored by the management node is centrally stored with the internet protocol address, the access request may be sent to the target service based on the internet protocol address in the historical access information including the target access domain name, and the access result returned by the target service for the access request may be received, and the access result may be sent to the target function node, so that the management node may directly use the locally stored internet protocol address to realize access of the target service without re-creating the internet protocol address of the target service, thereby effectively improving service access efficiency.
In some embodiments, after receiving an access request for a target service sent by a target functional node in the functional node cluster, the access result may be received by: if the history access information stored by the management node contains the history access information comprising the target access domain name, determining the history access information comprising the target access domain name as reference access information; and sending the reference access information to the target function node.
In some embodiments, the reference access information is used for the target function node to send an access request to the target service based on the internet protocol address in the reference access information, and receive an access result returned by the target service for the access request.
In some embodiments, the target function node sends the access request for the target service to the management node, by sending the access request for the target service to the management node when the internet protocol address of the target service is not stored locally in the target function node, so that after the management node obtains the internet protocol address of the target service, the internet protocol address is sent to the target function node, and the target function node can establish a communication connection with the target service and access the target service. In this case, the access request received by the management node does not necessarily carry an internet protocol address, so that whether the management node stores the internet protocol address or not can be queried from the history access information stored in the management node, and if the history access information stored in the management node includes the history access information including the target access domain name, the history access information including the target access domain name is determined as the reference access information; and sending reference access information to the target function node, so that the target function node sends an access request to the target service based on the Internet protocol address in the reference access information, and receives an access result returned by the target service for the access request. At this time, the management node in the distributed storage system is configured to obtain an internet protocol address of the target service, and the target function node in the distributed storage system is configured to access the target service.
In this way, the target function node sends the access request for the target service to the management node, when the target function node does not have the internet protocol address of the target service stored locally, the access request for the target service is sent to the management node, so that the management node obtains the internet protocol address of the target service, and then sends the internet protocol address to the target function node, so that the target function node can establish communication connection with the target service and access the target service, and if the history access information stored by the management node includes the history access information of the target access domain name, the reference access information is sent to the target function node, so that the target function node can access the target service based on the internet protocol address, thereby realizing efficient access of the target service.
In step 102, if there is no history access information including the target access domain name in the history access information stored in the management node, the target access information of the target service is obtained.
In some embodiments, if there is no history access information including the target access domain name in the history access information stored by the management node, the target access information of the target service may be configured by the management node.
In some embodiments, the above-mentioned obtaining the target access information of the target service may be implemented as follows: and configuring target access information of the target service in response to the configuration operation for the target service.
In some embodiments, after obtaining the target access information of the target service, the historical access information set may be updated as follows: and adding the target access information to the historical access information set stored by the management node to obtain an updated access information set, and replacing the historical access information set stored by the management node with the updated access information set.
In this way, after the target access information is obtained, the target access information is added to the historical access information set to obtain the updated access information set, and the historical access information set stored in the management node is replaced by the updated access information set, so that when the subsequent access request applies for accessing the target service, the target access information can be directly obtained from the updated access information set of the management node, and the target access information does not need to be configured again, thereby effectively improving the service access efficiency.
In step 103, the target access information is sent to each of the functional nodes in the cluster of functional nodes.
In some embodiments, the target access information includes a mapping relationship between the target access domain name and an internet protocol address of the target service, the mapping relationship being used by the target function node to access the target service based on the mapping relationship.
In some embodiments, after sending the target access information to each functional node in the cluster of functional nodes, the access result may be obtained by: sending an access request to a target service based on an internet protocol address of the target service in the target access information; and receiving an access result returned by the target service aiming at the access request, and sending the access result to the target function node.
In some embodiments, the target function node sends an access request for the target service to the management node, whether the internet protocol address of the target service is stored locally or not, and the access request for the target service is sent to the management node, so that the internet protocol address may be carried in the access request received by the management node or may not be carried in the access request received by the management node, at this time, the management node in the distributed storage system is configured to obtain the internet protocol address of the target service and access the target service, and after the management node obtains the internet protocol address of the target service, send the access request to the target service based on the internet protocol address of the target service in the target access information; and receiving an access result returned by the target service aiming at the access request, and sending the access result to the target function node.
Referring to fig. 8, fig. 8 is a schematic flow chart of a service access method provided in an embodiment of the present application, which will be described with reference to steps 201 to 203 shown in fig. 8, and the service access method provided in the embodiment of the present application may be implemented by a server or a terminal alone or by a server and a terminal cooperatively, and will be described below by taking a server alone as an example.
In step 201, target access information of a target service is received, and the target access information is queried from history access information stored in a functional node, so as to obtain a first query result of the target access information.
In some embodiments, referring to fig. 9, fig. 9 is a flowchart of a service access method according to an embodiment of the present application, and before receiving target access information of a target service in step 201 shown in fig. 8, an access request for the target service may also be generated through steps 301 to 303 shown in fig. 9.
In step 301, a target access domain name for a target service is received.
In some embodiments, a destination access Domain Name (Domain Name), also known as a web Domain, is a Name of a destination service on the Internet consisting of a string of names separated by points, used to locate an identifier (sometimes referred to as a geographic location) of a computer during data transfer. Because the IP addresses are inconvenient to memorize and cannot display the names and properties of the address organization, the Domain name is designed, and the Domain name and the IP address are mapped to each other through a Domain name system (DNS NAME SYSTEM), so that people can access the internet more conveniently without memorizing the number strings of the IP addresses which can be directly read by a machine.
In some embodiments, after receiving the target access domain name of the target service, an access request may also be generated and sent by: acquiring storage information of the functional node, and if the storage information indicates that the functional node does not store history access information, generating an access request carrying a target access domain name based on the target access domain name; and sending an access request to the management node.
In some embodiments, if the stored information indicates that the function node does not store the historical access information, generating an access request carrying the target access domain name based on the target access domain name, and sending the access request to the management node, so that the management node obtains the internet protocol address of the target service, and then sends the internet protocol address to the target function node, or sends the access request to the target service based on the internet protocol address, and after receiving the access result, sends the access result to the target function node.
In step 302, the target access domain name is queried from the historical access information stored in the functional node, and a second query result of the target access domain name is obtained.
In some embodiments, the second query result is used to indicate whether historical access information including the target access domain name is stored in the functional node.
In step 303, an access request for the target service is generated according to the second query result and the target access domain name.
In some embodiments, the step 303 may be implemented as follows: if the second query result indicates that the historical access information comprising the target access domain name is stored in the functional node, determining the historical access information comprising the target access domain name as target access information of the target service; generating a first access request based on the target access information; and if the query result indicates that the function node does not store the historical access information comprising the target access domain name, generating a second access request carrying the target access domain name based on the target access domain name.
In some embodiments, when the internet protocol address of the target service is stored in the target function node, an access request carrying the target access domain name and the internet protocol address included in the target access information is generated, and when the internet protocol address of the target service is not stored in the target function node, an access request carrying the target access domain name is generated.
When the internet protocol address of the target service is stored in the target function node, an access request carrying the target access domain name and the internet protocol address included in the target access information is generated, and the generated access request carries the internet protocol address and is sent to the management node, so that the management node can directly access the target service without configuring the internet protocol address, and can also send the access request to the target service, thereby directly accessing the target service.
In some embodiments, after performing step 303 above, the access result may be received by: sending the first access request to the target service; and sending the second access request to the management node.
In some embodiments, if the access request carries the target access domain name and the internet protocol address, the first access request is sent to the target service, and no matter the access is performed through the management node or the target function node directly accesses the target service, the internet protocol address is not required to be reconfigured, so that the access duration is effectively saved, and the service access efficiency is effectively improved.
In step 202, if the first query result indicates that the historical access information does not have the target access information, the target access information is updated to the historical access information.
In step 203, a target service is accessed based on the target access information.
Referring to fig. 10, fig. 10 is a flow chart of a service access method provided by an embodiment of the present application, where the service access method provided by the embodiment of the present application may be applied to a distributed storage system, where the distributed storage system includes: the management node and the functional node cluster including a plurality of functional nodes will be described in connection with steps 401 to 406 shown in fig. 10, and the service access method provided by the embodiment of the present application may be implemented by a server or a terminal alone or by a server and a terminal cooperatively, and will be described in the following by using a server alone embodiment as an example.
In step 401, the management node receives an access request of a target service, where the access request carries a target access domain name of the target service.
In step 402, if there is no history access information including the target access domain name in the history access information stored in the management node, the management node acquires the target access information of the target service.
In step 403, the management node sends the target access information to each of the functional nodes of the functional node cluster.
In step 404, the function node receives the target access information, and queries the target access information in the history access information stored in the function node, to obtain a query result of the target access information.
In step 405, if the query result indicates that the history access information does not have the target access information, the function node updates the target access information to the history access information.
In step 406, the functional node accesses the target service based on the target access information.
In this way, the management node receives the access request for the target service sent by the target function node in the function node cluster, if the history access information stored by the management node does not contain the history access information including the target access domain name, the target access information of the target service is obtained, and the target access information is sent to each function node in the function node cluster, so that each function node in the function node cluster does not need to carry out configuration of the target access information when accessing the target service next time, efficient access of the target service is realized, and service access efficiency is effectively improved.
In the following, an exemplary application of an embodiment of the present application in an application scenario of a practical distributed storage system will be described.
With the development of k8s technology, more and more services are applied to k8s clusters, more and more service scenes are used, and under certain scenes, services to be docked of internal pod services come from the inside of the clusters, and more services come from the outside, such as connection of an external cloud database, cloud middleware, cloud storage and the like.
When interfacing with external or third party services, domain names are basically used to access the corresponding services for some fixed and easy identification reasons. For example podA needs to connect to a cloud database, the address is mysql.huawei.com:5433, at this time, when the podA inner container needs to resolve the domain name when connecting to the cloud database, the real connection can be established after the service ip is taken, and by default, dns addresses of k8s clusters are used for domain name resolution in the pod, so that addresses of various services in the clusters can be resolved, but it is obvious that external addresses such as mysql.huawei.com need to be resolved by corresponding dns services. At this point it is desirable to provide the capability within the pod to resolve access to the domain name.
Still another scenario is that the host needs to use an external DNS address for resolving an external service domain name to achieve docking of services. Taking NFS service as an example, podA mounts external NFS storage, when the node host where the pod is located also needs to use an external DNS address to access the external NFS, and after the external NFS is mounted on the node, the external NFS can be provided for podA for use. In the case where both the pod and the node need to configure external DNS domain names, a unified global DNS address configuration management system (in the pod and host) becomes necessary for efficient configuration and unified management. In the process of actually configuring the DNS address, how to efficiently and gracefully configure the external DNS address in the distributed storage system and uniformly manage the DNS are the problems to be mainly solved by the embodiment of the application for the scale of k8s cluster nodes and the uninterruptability of certain services.
The technical scheme of the embodiment of the application is that a configuration file (configMap in a cluster, the bottom layer is etcd storage) of DNS is used as a global DNS storage of the cluster, coreDNS is used in the cluster to realize DNS domain name resolution in global pod service, and the configuration of the domain name on a node is configured by monitoring the configuration of the DNS by a deployment service DNS agent service. And ensuring that the DNS resolution addresses of the external domain names of the nodes in the cluster and the pod are consistent. By default, DNS addresses in the pod are coreDNS addresses to services of the internal service to resolve the internal domain name, domain name query can be extended by using a forward plug-in of coreDns, and after the external DNS address is configured, the pod can resolve the external domain name under the condition of keeping resolving the internal domain name. In the embodiment of the application, the dns management module is used for unifying the adding, deleting and checking operations of dns, the dns-agent module is used for configuring the dns on the node, and the coreDNS module is a k8s cluster self-contained module, wherein the dns management module is deployed in a deployment mode, and the dns agent module is deployed in a daemonset service mode.
In some embodiments, referring to fig. 11, fig. 11 is a schematic diagram of a service access method provided by an embodiment of the present application, where a DNS service within k8s, that is, coreDNS service, is configured in node 1 (the above-described management node), and a cluster DNS management service (management hub), node DNSAgent, agent is of a deamonset type, each node starts up, node DNSAgent is configured in node 2 (the above-described function node), and node DNSAgent is configured in node 3 (the above-described function node).
In some embodiments, referring to fig. 12, fig. 12 is a schematic diagram of a service access method provided by the embodiment of the present application, where DNS configuration is modified (DNS domain name adding and deleting) by providing an API interface through DNS management service, and external DNS domain name configuration (DNS configuration) is added or deleted, and is stored in etcd. And coreDns after the service monitors the DNS configuration change, internally synchronizing the new configuration into the service to take effect (managing the k8 internal DNS service), and after the service takes effect, the pod can internally analyze the external domain name. After the DNS configuration of each node is monitored to change by the DNS agent service, the DNS configuration of the node where the agent is located is synchronously updated according to the content in the DNS configuration file (the DNS configuration is written into the node/etc/resolv.conf). After the operation is finished, the dns in the pod and on the node can use the same dns configuration to analyze the external domain name, so that unified management of dns service addresses in the cluster (dns on the management node) is achieved.
Thus, when the interface is called to configure the DNS address, the global DNS in the cluster, including the node and the pod, can use the DNS address to resolve the external domain name, so that the problem that in the existing scheme I, the DNS address needs to be manually configured for each controller or pod and configured on each node is solved.
In some embodiments, referring to fig. 13, fig. 13 is a schematic diagram of a service access method provided by an embodiment of the present application, where a user accesses a front end interface of DNS configuration to initiate an operation of adding a DNS address (DNS domain name adding, deleting and checking). After receiving the request for adding the DNS address, the DNS management service module performs some necessary checks, and configures the added DNS address into DNS comfigMap configuration files (adding the DNS address to the configuration files of coreDNS). CoreDNS the service reloads the configuration into the service after monitoring the change of the configuration file (monitoring the configuration change applies the new configuration), at which point the pod interior can resolve to external domain names through coreDNS. And analyzing external services at the node side, after the DNS agent service modules of all the nodes monitor coreDNS configuration changes, configuring files/etc/resolv.conf (synchronously modifying the nodes/etc/resolv.conf) on the nodes, and after the completion, analyzing external domain names at all the nodes. At this time, the nodes in the cluster and pod all unify the dns configuration.
Thus, after adding the nodes in the cluster, the DNS agent deployment mode is daemonset, i.e., an instance is started on each node. After the new node is added, a DNS agent is automatically started at the new node, the agent automatically monitors the configuration of the synchronization coreDNS after starting, the DNS configured in the cluster can be automatically configured to the new node, and the configuration is not required to be manually added to the new node.
In some embodiments, referring to fig. 14, fig. 14 is a schematic diagram of a service access method provided by an embodiment of the present application, where a user adds a node into a cluster. Since the dns agent is daemonset deployed, the dns agent service is also started on the new node. After the Dns agent service is started, it listens for and synchronizes coreDNS the external Dns address in the configuration to the node. After completion, the newly added node can resolve the external domain name without manual intervention. The cluster DNS management service in node 1 (the management node described above) modifies etcd storage, and node DNSAgent in node 1 listens for the modification; node DNSAgent in node 2 (the management node described above) listens for modifications; nodes DNSAgent and coreDNS in node 3 (the management node described above) service listening for modifications; the node DNSAgent in the newly added node 1 listens for modifications and automatically deploys services.
In this way, the DNS management module for performing the adding, deleting and modifying operations of the unified DNS and the DNS-agent module for configuring the DNS on the node are added in the node of the distributed service system, so that the external DNS address is configured in the cluster, and unified management of DNS is realized.
In this way, the management node receives the access request for the target service sent by the target function node in the function node cluster, if the history access information stored by the management node does not contain the history access information including the target access domain name, the target access information of the target service is obtained, and the target access information is sent to each function node in the function node cluster, so that each function node in the function node cluster does not need to carry out configuration of the target access information when accessing the target service next time, efficient access of the target service is realized, and service access efficiency is effectively improved.
It will be appreciated that in embodiments of the present application, related data such as access domain names are involved, and when embodiments of the present application are applied to specific products or technologies, user permissions or consents need to be obtained, and the collection, use and processing of related data is required to comply with relevant laws and regulations and standards of the relevant countries and regions.
Continuing with the description below of an exemplary architecture of the service access apparatus 455 implemented as a software module provided by embodiments of the present application, in some embodiments, as shown in fig. 2, the software module stored in the service access apparatus 455 of the memory 450 may include: a receiving module 4551, configured to receive an access request of a target service, where the access request carries a target access domain name of the target service; the obtaining module 4552 is configured to obtain, if there is no history access information including the target access domain name in the history access information stored in the management node, target access information of the target service; and a sending module 4553, configured to send the target access information to each of the functional nodes in the functional node cluster.
In some embodiments, the receiving module is further configured to obtain a set of history access information stored by the management node, where the set of history access information includes a plurality of pieces of history access information, and the history access information includes a mapping relationship between a history access domain name of a history access service and an internet protocol address of the history access service; comparing each history access information with the target access domain name to obtain a comparison result corresponding to each history access information; and determining indication information of the management node based on the comparison result, wherein the indication information is used for indicating whether historical access information comprising the target access domain name exists in the historical access information stored by the management node.
In some embodiments, the receiving module is further configured to parse the access request to obtain a parsing result, and if the parsing result indicates that the access request does not carry the internet protocol address of the target service, obtain the historical access information set stored by the management node.
In some embodiments, the receiving module is further configured to send the access request to the target service based on an internet protocol address of the target service in the target access information; and receiving an access result returned by the target service aiming at the access request, and sending the access result to the target function node.
In some embodiments, the receiving module is further configured to send the access request to the target service based on the internet protocol address if the analysis result indicates that the access request carries the internet protocol address of the target service; and receiving an access result returned by the target service aiming at the access request, and sending the access result to the target function node.
In some embodiments, the receiving module is further configured to send, if the indication information indicates that the historical access information including the target access domain name exists in the historical access information stored in the management node, the access request to the target service based on an internet protocol address in the historical access information including the target access domain name; and receiving an access result returned by the target service aiming at the access request, and sending the access result to the target function node.
In some embodiments, the receiving module is further configured to determine the storage information of the management node as the first storage information if each of the comparison results indicates that the history access domain name of the history access information is different from the target access domain name; if the comparison result indicating that the historical access domain name of the historical access information is the same as the target access domain name exists, determining the storage information of the management node as second storage information; the first storage information is used for indicating that the history access information including the target access domain name does not exist in the history access information stored by the management node, and the second storage information is used for indicating that the history access information including the target access domain name exists in the history access information stored by the management node.
In some embodiments, the sending module is further configured to determine, as the reference access information, the historical access information including the target access domain name if there is the historical access information including the target access domain name in the historical access information stored in the management node; and sending the reference access information to the target function node, wherein the reference access information is used for the target function node to send the access request to the target service based on the Internet protocol address in the reference access information and receive an access result returned by the target service for the access request.
In some embodiments, the service access apparatus further includes: and the updating module is used for adding the target access information to the historical access information set stored by the management node to obtain an updated access information set, and replacing the historical access information set stored in the management node with the updated access information set.
The embodiment of the application provides a service access device, which is applied to a functional node and comprises: the query module is used for receiving target access information of target service, and querying the target access information from the history access information stored by the functional node to obtain a first query result of the target access information; the information updating module is used for updating the target access information into the history access information if the first query result indicates that the target access information does not exist in the history access information; and the access module is used for accessing the target service based on the target access information.
In some embodiments, the service access apparatus further includes: the domain name receiving module is used for receiving a target access domain name of a target service; and the generation module is used for generating an access request aiming at the target service according to the second query result and the target access domain name, wherein the second query result is used for indicating whether the history access information comprising the target access domain name exists in the history access information.
In some embodiments, the above query module is further configured to query the target access domain name from the historical access information stored in the functional node, to obtain a second query result of the target access domain name.
In some embodiments, the generating module is further configured to determine, if the second query result indicates that the functional node stores history access information including the target access domain name, the history access information including the target access domain name as target access information of the target service; generating a first access request based on the target access information, wherein the first access request carries the target access domain name and the Internet protocol address; and if the query result indicates that the function node does not store the history access information comprising the target access domain name, generating a second access request carrying the target access domain name based on the target access domain name.
In some embodiments, the service access apparatus further includes: a sending module, configured to send the first access request to the target service; sending the second access request to the management node
In some embodiments, the domain name receiving module is further configured to generate, based on the target access domain name, the access request carrying the target access domain name if the stored information indicates that the history access information is not stored in the functional node; and sending the access request to the management node.
The embodiment of the application provides a service access device, and the distributed storage system comprises: a management node and a functional node cluster comprising a plurality of functional nodes, comprising: the receiving module is used for receiving an access request of the target service by the management node, wherein the access request carries a target access domain name of the target service; the acquisition module is used for acquiring the target access information of the target service if the history access information comprising the target access domain name does not exist in the history access information stored by the management node; the sending module is used for sending the target access information to each functional node of the functional node cluster by the management node; the query module is used for receiving the target access information by the functional node, and querying the target access information in the history access information stored by the functional node to obtain a query result of the target access information; the information updating module is used for updating the target access information into the history access information by the functional node if the query result indicates that the history access information does not contain the target access information; and the access module is used for the functional node to access the target service based on the target access information.
Continuing with the description below of an exemplary architecture of the service access apparatus 555 implemented as a software module provided by an embodiment of the present application, in some embodiments, as shown in fig. 3, the software module stored in the service access apparatus 555 of the memory 550 may include: the query module 5551 is configured to receive target access information of a target service, and query the target access information from the history access information stored in the functional node, so as to obtain a first query result of the target access information; an information updating module 5552, configured to update the target access information to the history access information if the first query result indicates that the history access information does not have the target access information; an access module 5553, configured to access the target service based on the target access information.
In some embodiments, the service access apparatus further includes: the domain name receiving module is used for receiving a target access domain name of a target service; and the generation module is used for generating an access request aiming at the target service according to the second query result and the target access domain name, wherein the second query result is used for indicating whether the history access information comprising the target access domain name exists in the history access information.
In some embodiments, the above query module is further configured to query the target access domain name from the historical access information stored in the functional node, to obtain a second query result of the target access domain name.
In some embodiments, the generating module is further configured to determine, if the second query result indicates that the functional node stores history access information including the target access domain name, the history access information including the target access domain name as target access information of the target service; generating a first access request based on the target access information, wherein the first access request carries the target access domain name and the Internet protocol address; and if the query result indicates that the function node does not store the history access information comprising the target access domain name, generating a second access request carrying the target access domain name based on the target access domain name.
In some embodiments, the service access apparatus further includes: a sending module, configured to send the first access request to the target service; sending the second access request to the management node
In some embodiments, the domain name receiving module is further configured to generate, based on the target access domain name, the access request carrying the target access domain name if the stored information indicates that the history access information is not stored in the functional node; and sending the access request to the management node.
The embodiment of the application provides a service access device, and the distributed storage system comprises: a management node and a functional node cluster comprising a plurality of functional nodes, comprising: the receiving module is used for receiving an access request of the target service by the management node, wherein the access request carries a target access domain name of the target service; the acquisition module is used for acquiring the target access information of the target service if the history access information comprising the target access domain name does not exist in the history access information stored by the management node; the sending module is used for sending the target access information to each functional node of the functional node cluster by the management node; the query module is used for receiving the target access information by the functional node, and querying the target access information in the history access information stored by the functional node to obtain a query result of the target access information; the information updating module is used for updating the target access information into the history access information by the functional node if the query result indicates that the history access information does not contain the target access information; and the access module is used for the functional node to access the target service based on the target access information.
Embodiments of the present application provide a computer program product comprising a computer program or computer-executable instructions stored in a computer-readable storage medium. The processor of the electronic device reads the computer executable instructions from the computer readable storage medium, and the processor executes the computer executable instructions, so that the electronic device executes the service access method according to the embodiment of the present application.
Embodiments of the present application provide a computer-readable storage medium having stored therein computer-executable instructions which, when executed by a processor, cause the processor to perform a service access method provided by embodiments of the present application, for example, a service access method as shown in fig. 4.
In some embodiments, the computer readable storage medium may be FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; but may be a variety of electronic devices including one or any combination of the above-described memories.
In some embodiments, computer-executable instructions may be written in any form of programming language, including compiled or interpreted languages, or declarative or procedural languages, in the form of programs, software modules, scripts, or code, and they may be deployed in any form, including as stand-alone programs or as modules, components, subroutines, or other units suitable for use in a computing environment.
As an example, computer-executable instructions may, but need not, correspond to files in a file system, may be stored in a portion of a file that holds other programs or data, such as in one or more scripts in a hypertext markup language (HTML, hyper Text Markup Language) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files that store one or more modules, sub-programs, or portions of code).
As an example, computer-executable instructions may be deployed to be executed on one electronic device or on multiple electronic devices located at one site or distributed across multiple sites and interconnected by a communication network.
In summary, the embodiment of the application has the following beneficial effects:
(1) The management node receives an access request for the target service sent by a target function node in the function node cluster, if the history access information stored by the management node does not contain the history access information including the target access domain name, the target access information of the target service is obtained, and the target access information is sent to each function node in the function node cluster, so that each function node in the function node cluster does not need to carry out configuration of the target access information when accessing the target service next time, efficient access of the target service is realized, and service access efficiency is effectively improved.
(2) The analysis result indicates that the Internet protocol address of the target service is carried in the access request, the access request is sent to the target service directly based on the Internet protocol address carried in the access request, the access result returned by the target service aiming at the access request is received, and the access result is sent to the target function node, so that the Internet protocol address of the target service does not need to be locally inquired at the management node, the access time is effectively saved, and the service access efficiency is effectively improved.
(3) The access request received by the management node may or may not carry the internet protocol address, at this time, the access request may be parsed to obtain a parsing result, so as to determine whether the access request received by the management node carries the internet protocol address, when the access request received by the management node does not carry the internet protocol address, and the historical access information stored by the management node is centrally stored with the internet protocol address, the access request may be sent to the target service based on the internet protocol address in the historical access information including the target access domain name, and the access result returned by the target service for the access request may be received, and the access result may be sent to the target function node, so that the management node may directly use the locally stored internet protocol address to realize access of the target service without re-creating the internet protocol address of the target service, thereby effectively improving service access efficiency.
(4) The target function node sends an access request for the target service to the management node, namely when the target function node does not have the internet protocol address of the target service stored locally, the access request for the target service is sent to the management node, so that the management node can send the internet protocol address to the target function node after obtaining the internet protocol address of the target service, the target function node can establish communication connection with the target service and access the target service, and if historical access information comprising the target access domain name exists in the historical access information stored by the management node, reference access information is sent to the target function node, so that the target function node can access the target service based on the internet protocol address, and high-efficiency access of the target service is realized.
(5) After the target access information is acquired, the target access information is added to the historical access information set to obtain an updated access information set, and the historical access information set stored in the management node is replaced by the updated access information set, so that when the subsequent access request applies for accessing the target service, the target access information can be directly acquired from the updated access information set of the management node, and the target access information does not need to be configured again, thereby effectively improving the service access efficiency.
(6) When the internet protocol address of the target service is stored in the target function node, an access request carrying the target access domain name and the internet protocol address included in the target access information is generated, and the generated access request carries the internet protocol address and is sent to the management node, so that the management node can directly access the target service without configuring the internet protocol address, and can also send the access request to the target service, thereby directly accessing the target service.
The foregoing is merely exemplary embodiments of the present application and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and scope of the present application are included in the protection scope of the present application.

Claims (16)

1. A service access method, applied to a management node, the method comprising:
receiving an access request of a target service, wherein the access request carries a target access domain name of the target service;
if the history access information stored by the management node does not contain the history access information including the target access domain name, acquiring target access information of the target service;
And sending the target access information to each functional node in the functional node cluster.
2. The method of claim 1, wherein after receiving the access request for the target service, the method further comprises:
acquiring a history access information set stored by the management node, wherein the history access information set comprises a plurality of pieces of history access information, and the history access information comprises a mapping relation between a history access domain name of a history access service and an Internet protocol address of the history access service;
Comparing each history access information with the target access domain name to obtain a comparison result corresponding to each history access information;
and determining indication information of the management node based on the comparison result, wherein the indication information is used for indicating whether historical access information comprising the target access domain name exists in the historical access information stored by the management node.
3. The method of claim 2, wherein prior to the obtaining the set of historical access information stored by the management node, the method further comprises:
Analyzing the access request to obtain an analysis result, wherein the analysis result is used for indicating whether the access request carries the Internet protocol address of the target service;
The obtaining the historical access information set stored by the management node comprises the following steps:
And if the analysis result indicates that the access request does not carry the Internet protocol address of the target service, acquiring a historical access information set stored by the management node.
4. A method according to claim 3, wherein after parsing the access request to obtain a result of the parsing, the method further comprises:
If the analysis result indicates that the access request carries the Internet protocol address of the target service, sending the access request to the target service based on the Internet protocol address;
And receiving an access result returned by the target service aiming at the access request, and sending the access result to the target function node.
5. A method according to claim 3, wherein after determining the indication information of the management node based on the comparison result, the method further comprises:
If the indication information indicates that the history access information comprising the target access domain name exists in the history access information stored by the management node, sending the access request to the target service based on an internet protocol address in the history access information comprising the target access domain name;
And receiving an access result returned by the target service aiming at the access request, and sending the access result to the target function node.
6. The method according to claim 2, wherein the determining the indication information of the management node based on the comparison result includes:
Determining the storage information of the management node as first storage information under the condition that each comparison result indicates that the history access domain name of the history access information is different from the target access domain name;
In the case where there is a comparison result indicating that the history access domain name of the history access information is the same as the target access domain name, the stored information of the management node is determined as second stored information.
7. The method of claim 1, wherein after receiving the access request for the target service, the method further comprises:
If the history access information stored by the management node contains the history access information comprising the target access domain name, determining the history access information comprising the target access domain name as reference access information;
And sending the reference access information to the target function node.
8. The method of claim 1, wherein after the obtaining the target access information of the target service, the method further comprises:
And adding the target access information to the historical access information set stored by the management node to obtain an updated access information set, and replacing the historical access information set stored by the management node with the updated access information set.
9. A service access method, applied to a functional node, the method comprising:
receiving target access information of a target service, and inquiring the target access information from history access information stored by the functional node to obtain a first inquiring result of the target access information;
If the first query result indicates that the historical access information does not contain the target access information, the target access information is updated into the historical access information;
And accessing the target service based on the target access information.
10. The method of claim 9, wherein prior to receiving the target access information for the target service, the method further comprises:
Receiving a target access domain name of a target service, and inquiring the target access domain name from the history access information stored by the functional node to obtain a second inquiry result of the target access domain name;
and generating an access request aiming at the target service according to the second query result and the target access domain name, wherein the second query result is used for indicating whether historical access information comprising the target access domain name exists in the historical access information.
11. The method of claim 10, wherein generating an access request for the target service based on the second query result and the target access domain name comprises:
If the second query result indicates that the function node stores the history access information comprising the target access domain name, determining the history access information comprising the target access domain name as the target access information of the target service;
Generating a first access request based on the target access information, wherein the first access request carries the target access domain name and the Internet protocol address;
And if the query result indicates that the function node does not store the history access information comprising the target access domain name, generating a second access request carrying the target access domain name based on the target access domain name.
12. The method of claim 11, wherein after the generating the access request for the target service by combining the query result and the target access domain name, the method further comprises:
Sending the first access request to the target service;
and sending the second access request to the management node.
13. The method of claim 10, wherein after receiving the target access domain name for the target service, the method further comprises:
If the stored information indicates that the historical access information is not stored in the functional node, generating the access request carrying the target access domain name based on the target access domain name;
and sending the access request to the management node.
14. A method for service access, applied to a distributed storage system, the distributed storage system comprising: a management node and a functional node cluster comprising a plurality of functional nodes, the method comprising:
the management node receives an access request of the target service, wherein the access request carries a target access domain name of the target service;
If the history access information stored by the management node does not exist, the management node acquires the target access information of the target service;
The management node sends the target access information to each functional node of the functional node cluster;
The functional node receives the target access information, and queries the target access information in the history access information stored by the functional node to obtain a query result of the target access information; if the query result indicates that the historical access information does not contain the target access information, the functional node updates the target access information into the historical access information;
the functional node accesses the target service based on the target access information.
15. An electronic device, the electronic device comprising:
a memory for storing computer executable instructions or computer programs;
a processor for implementing the service access method of any one of claims 1 to 14 when executing computer-executable instructions or computer programs stored in the memory.
16. A computer readable storage medium storing computer executable instructions which when executed by a processor implement the service access method of any one of claims 1 to 14.
CN202311462328.0A 2023-11-03 2023-11-03 Service access method, device, electronic equipment and storage medium Pending CN117956036A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311462328.0A CN117956036A (en) 2023-11-03 2023-11-03 Service access method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311462328.0A CN117956036A (en) 2023-11-03 2023-11-03 Service access method, device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117956036A true CN117956036A (en) 2024-04-30

Family

ID=90797313

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311462328.0A Pending CN117956036A (en) 2023-11-03 2023-11-03 Service access method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117956036A (en)

Similar Documents

Publication Publication Date Title
US20200183932A1 (en) Optimizing write operations in object schema-based application programming interfaces (apis)
US20200089666A1 (en) Secure data isolation in a multi-tenant historization system
US10990629B2 (en) Storing and identifying metadata through extended properties in a historization system
CN111177161B (en) Data processing method, device, computing equipment and storage medium
CN112434059B (en) Data processing method, data processing device, computer equipment and storage medium
CN103645951A (en) Cross-platform mobile data management system and method
CN111143382B (en) Data processing method, system and computer readable storage medium
US20150363484A1 (en) Storing and identifying metadata through extended properties in a historization system
CN110413845B (en) Resource storage method and device based on Internet of things operating system
CN112286628B (en) System for unifying nanotube Kubernetes heterogeneous applications and operation method
CN114090388A (en) Information acquisition method, server cluster, server and equipment
CN113886485A (en) Data processing method, device, electronic equipment, system and storage medium
CN117271460B (en) Scientific research digital networking service method and system based on scientific research digital object language relation
US10713014B2 (en) Multi-platform interface framework
CN117956036A (en) Service access method, device, electronic equipment and storage medium
US11727022B2 (en) Generating a global delta in distributed databases
CN112783842B (en) Log collection method and device
CN109117152B (en) Service generation system and method
CN116594848B (en) Task monitoring method, device, equipment, terminal equipment and storage medium
US20230247111A1 (en) Runtime module conversion
CN111782428B (en) Data calling system and method
CN117743470B (en) Processing system for heterogeneous big data
CN117596303B (en) Service access method, device, electronic equipment and storage medium
CN113127549B (en) Incremental data synchronization method, device, computer equipment and storage medium
CN117331981A (en) Data flow sensing method and related device

Legal Events

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