Server access control method and device and electronic equipment
By automatically generating access configuration files and dynamic path selection, the problem of inconsistent interfaces caused by different protocols of different storage servers is solved, and efficient server access control is achieved.
Patent Information
- Application Number
- CN202510676716.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-23
- Publication Date
- 2025-08-12
AI Technical Summary
The protocol differences between different types of storage servers lead to inconsistent access interfaces, increasing user operation complexity and operation and maintenance costs.
By obtaining preset multi-path configuration data, including configuration templates and access path information corresponding to different types of protocols, the access configuration files are automatically generated, and the server access operations are performed based on the target access path.
It reduces the complexity of configuration operations and operation and maintenance costs, improves server access efficiency, and supports unified access and load balancing of multiple storage protocols.
Smart Images

Figure CN120474905A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a server access control method, device, and electronic device. Background Art
[0002] As businesses diversify, they often need to use multiple types of storage servers, such as file storage servers, block storage servers, and object storage servers. In related technologies, protocol differences between these different types of servers lead to inconsistent access interfaces, forcing users to manually write configuration files for each type of storage server, increasing operational complexity and maintenance costs. Summary of the Invention
[0003] The present application provides a server access control method, device and electronic device to at least solve the problem in the related art that protocol differences between different types of servers lead to inconsistent access interfaces, requiring users to manually write corresponding configuration files for different types of storage servers when using them, increasing operational complexity and operation and maintenance costs.
[0004] The present application provides a server access control method, which is applied to a server access control system, wherein the server access control system includes multiple types of servers, and each type of server is configured with multiple access paths; the method includes: when a server access request is received, obtaining preset multi-path configuration data, the preset multi-path configuration data including configuration templates corresponding to different types of protocols, access path information corresponding to different types of servers, and priority information corresponding to the access paths; determining a target access path from multiple access paths corresponding to the server to be accessed based on the address information of the server to be accessed contained in the server access request and the access path priority information contained in the preset multi-path configuration data; obtaining a configuration template for the corresponding protocol from the preset multi-path configuration data based on the protocol type corresponding to the target access path and generating an access configuration file based on configuration parameters input by a user; and performing an access operation on the server to be accessed from the target access path based on the access configuration file and the driver corresponding to the protocol version type of the target access path.
[0005] The present application also provides a server access control device, which is applied to a server access control system, wherein the server access control system includes multiple types of servers, and each type of server is configured with multiple access paths; the device includes: a first acquisition module, which is used to obtain preset multi-path configuration data when a server access request is received, and the preset multi-path configuration data includes configuration templates corresponding to different types of protocols, access path information corresponding to different types of servers, and priority information corresponding to the access paths; a first determination module, which is used to determine the target access path among the multiple access paths corresponding to the server to be accessed based on the address information of the server to be accessed contained in the server access request and the access path priority information contained in the preset multi-path configuration data; a generation module, which is used to obtain the configuration template of the corresponding protocol from the preset multi-path configuration data according to the protocol type corresponding to the target access path and generate an access configuration file according to the configuration parameters input by the user; an access module, which is used to access the server to be accessed from the target access path according to the access configuration file and the driver corresponding to the protocol version type of the target access path.
[0006] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any of the above-mentioned server access control methods when executing the computer program.
[0007] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned server access control methods are implemented.
[0008] The present application also provides a computer program product, including a computer program, which implements the steps of any of the above-mentioned server access control methods when executed by a processor.
[0009] The server access control method provided in this application, upon receiving a request for access to any type of server, retrieves multipath configuration data containing configuration templates for different types of protocols to obtain a configuration template corresponding to the current protocol type and generates an access profile based on the configuration parameters entered by the user. Access operations to the server to be accessed are executed based on the automatically generated access profile and the determined target access path. Compared to a purely manually written configuration file approach, this reduces the complexity of configuration operations and operational costs, while further improving server access efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0011] Figure 1 A flow chart of a server access control method provided in an embodiment of the present application;
[0012] Figure 2 A structural block diagram of a server access control device provided in an embodiment of the present application;
[0013] Figure 3 This is a structural block diagram of the electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0014] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0015] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.
[0016] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0017] With the development of enterprise business diversity, it is usually necessary to use multiple types of storage servers, such as file storage servers, such as NFS (Network File System), SMB (Server Message Block), block storage servers, such as iSCSI (Internet Small Computer System Interface), object storage servers, such as S3 (Simple Storage Service), etc. The protocol differences between different types of servers lead to inconsistent access interfaces, requiring users to manually configure and manage different storage servers, increasing operational complexity and operation and maintenance costs.
[0018] The embodiment of the present application provides a server access control method, which is applied to a server access control system. The server access control system includes multiple types of servers, and each type of server is configured with multiple access paths. The server access control system architecture of the embodiment of the present application may include a client, a multi-path configuration module, a storage access module, and multiple storage servers, wherein the client can be used to initiate a server access request, the multi-path configuration module can be used to generate multi-path configuration data according to the type and configuration information of the storage server, the storage access module can select a suitable path to access the storage server according to the multi-path configuration data, and the multiple storage servers are used to provide different types of storage resources. Figure 1 As shown, the method includes the following steps:
[0019] Step S101: upon receiving a server access request, obtaining preset multipath configuration data, the preset multipath configuration data including configuration templates corresponding to different types of protocols, access path information corresponding to different types of servers, and priority information corresponding to the access paths;
[0020] For example, the configuration templates corresponding to different types of protocols contain different types of parameters. By pre-storing the configuration templates corresponding to different types of protocols, users can input the corresponding configuration parameters in a targeted manner, such as adding specific authentication information, connection parameters, and configuration requirements for different protocols. For example, for the S3 protocol, it is necessary to configure identity authentication parameters (such as access_key and secret_key), region information (region) parameters, service endpoint (endpoint) parameters, and function configuration parameters such as version control, lifecycle management, and encryption; for the NFS protocol, it is necessary to configure the server IP and export path (path) and mount options (mount_options), etc. The lack of corresponding configuration parameters will make it impossible to determine how to connect to the server or how to verify the identity, so that the corresponding cloud service may reject the corresponding service request. The physical storage paths corresponding to different types of servers are dynamically associated with the protocol type to support mixed protocol path pools.
[0021] The priorities of access paths corresponding to different types of servers are pre-configured so that when an access request to any type of server is received, the access path with the highest priority can be selected as the corresponding target access path based on the priority information. The priority information corresponding to the access path can be the priority of each path determined in real time based on the path performance indicators (such as throughput, response time, etc.) of the access paths corresponding to different servers. In actual use, the determined path with the highest priority can be directly used as the optimal target access path; the priority information corresponding to the access path can also be priority setting rules or policy information, such as which rules or policies are used to determine the priorities of different access paths, such as determining according to throughput or according to response time, or setting different weights for path performance indicators. In actual use, the access path with the highest priority is directly determined in real time through the adopted rules or policies.
[0022] Step S102 : determining a target access path among multiple access paths corresponding to the server to be accessed according to the address information of the server to be accessed contained in the server access request and the access path priority information contained in the preset multi-path configuration data.
[0023] For example, based on the server address information, it can be determined that the server access request corresponds to the server to be accessed and the corresponding multiple access paths. According to the priority information corresponding to the access path of the server to be accessed contained in the preset multi-path configuration data, the access path with the highest priority can be selected from the multiple access paths corresponding to the server to be accessed according to the priority determination method in the previous step as the target access path.
[0024] Step S103 : According to the protocol type corresponding to the target access path, a configuration template corresponding to the protocol is obtained from the preset multi-path configuration data, and an access configuration file is generated according to the configuration parameters input by the user.
[0025] Exemplarily, the preset multi-path configuration data includes configuration templates corresponding to different types of protocols. The protocol type corresponding to the selected target access path can be matched to the corresponding configuration template from the preset multi-path configuration data. According to the configuration requirements of the configuration template, the user can enter the corresponding configuration parameters to generate an access profile for the server to be accessed. Specifically, when the protocol type is sniffed, the corresponding JSON / YAML configuration can be loaded from the pre-stored configuration template (such as an AWS S3 template containing bucket name, region, and authentication fields). Based on the fields in the configuration template, the user can be prompted with the specific information to be filled in, or the configuration template can be filled in by automatically obtaining the metadata of the corresponding fields to generate an access profile.
[0026] Step S104 : Accessing the server to be accessed from the target access path according to the access configuration file and the driver corresponding to the protocol version type of the target access path.
[0027] For example, the protocol version type of the server to be accessed can be obtained by sniffing the protocol sniffing module, and a corresponding protocol driver is matched according to the protocol version type of the server to be accessed (such as NFSv3 / v4, SMB2.0 / 3.0, etc.). According to the access configuration file and the driver corresponding to the protocol version type of the target access path, the server to be accessed is accessed from the target access path.
[0028] The server access control method provided in an embodiment of the present application, upon receiving a request for access to any type of server, obtains multipath configuration data containing configuration templates corresponding to different types of protocols to obtain a configuration template corresponding to the current protocol type, and then generates an access configuration file based on the configuration parameters entered by the user. Based on the automatically generated access configuration file and the determined target access path, access operations to the server to be accessed are executed. Compared to a purely manually written configuration file approach, this reduces the complexity of configuration operations and operational costs, and further improves server access efficiency.
[0029] As an optional implementation of the embodiment of the present application, the preset multi-path configuration data also includes: a load balancing strategy corresponding to the cluster where the server is located. In the embodiment of the present application, the cluster where the server is located can share a server address, such as a single entrance through a virtual IP or domain name resolution, and the storage operation on the data to be stored is implemented through the load balancing strategy. The load balancing strategy may include the selection operation of the server performing the storage operation in the cluster under different usage conditions to meet the storage demand. The method also includes: when the target performance index of the server to be accessed corresponding to the server access request does not meet the requirements, the server access request is transferred to other servers in the cluster where the server to be accessed is located, whose target performance index meets the requirements. Exemplarily, in the embodiment of the present application, the target performance index may include response time, etc., and the target performance index of the storage server may be collected regularly, and the load balancing strategy in the multi-path configuration data may be adjusted according to the target performance index. For example, when the response time of a storage server exceeds the preset time, the access request may be automatically transferred to other servers with faster response.
[0030] As an optional implementation of the embodiment of the present application, the access path corresponding to each type of server includes at least two types of protocol access paths, such as including both the NFS protocol and the SMB protocol, or including both the NFS protocol, the SMB protocol, and the S3 protocol. For incompatible protocols, a protocol conversion module can be configured to enable communication and transmission of data of different protocols. The method further includes:
[0031] When a target access path under any type of protocol fails, the access path corresponding to the other type of protocol is switched to, and the current access path is used as the target access path and marked as a degraded access state.
[0032] Exemplarily, the target access path under any type of protocol may include one or more. For a protocol that only contains one target access path, when the target access path fails (such as a network interface disconnection or a service process crash), it can be directly switched to the access path corresponding to the other type of protocol and used as the new target access path; if the current type of protocol corresponds to multiple target access paths, then when one of the access paths fails, it can first switch to the other target access paths under the current protocol. When all target access paths fail, switch to the access path corresponding to the other type of protocol and use it as the new target access path. The target access path selected according to the path priority has the best network performance among all the candidate paths. When the target access path fails and switches to other access paths, it indicates that the access path used by the current access request is in a degraded state. By marking the current access path as a degraded access state, it can be used to prompt technical personnel to monitor or adjust the current access request.
[0033] As an optional implementation of the present application, for multiple access paths corresponding to the current type of protocol, when one of them is selected as the target access path based on information such as the path priority, when the target access path fails, the other remaining access paths under the current protocol and the access paths under other protocols can be secondary selected according to the priority information, such as performing performance comparison operations such as response time. If there is a path with a shorter response time among the other remaining access paths under the current protocol, then the path under the current protocol is used as the new target access path. If the response time of all other access paths under the current protocol is less than the response time of the access path under other protocols, then a new target access path is selected from the access paths under other protocols; further, for multiple access paths corresponding to other protocols, the path with the lowest load can be further selected as the new target access path based on their load. For servers that correspond to at least two types of protocol access paths, when the service request is a storage request, the access path corresponding to the protocol under the corresponding type can be determined based on the type of data to be stored. For a server that includes access paths for NFS protocol, SMB protocol, and S3 protocol, if the current access request is for file storage, the target access path can be selected from the access paths corresponding to the NFS protocol and SMB protocol according to the priority information; if the current access request is for video object storage, the target access path can be selected from the access path corresponding to the S3 protocol according to the priority information.
[0034] As an optional implementation of the embodiment of the present application, the method also includes: when all access paths corresponding to the server to be accessed do not meet the usage conditions, responding to the query operation on the data copy; when the data copy is queried, determining the location of the data copy; performing a consistency check on the data in the data copy location; when the consistency check result meets the requirements, updating the routing table and switching the server access request corresponding to the server to be accessed to the access path where the data copy location is located.
[0035] Exemplarily, all paths corresponding to the server to be accessed include all access paths under different protocols. When all access paths do not meet the usage conditions, including all access path I / O timeouts (such as no response for more than 3 seconds), the query operation on the data copy is responded to. The data copy can represent the mirror data stored under other server nodes. The specific query method can be to look up the routing table, which records key information such as data location, path mapping, and copy relationship. By querying the metadata routing table, it can be determined whether there is a data copy and the corresponding data copy location; further, the data in the data copy location is checked for consistency to ensure the integrity of the data in the data copy to be accessed. When the consistency check result meets the requirements, the path mapping and other information in the routing table are updated and the access request to the corresponding server of the server to be accessed is switched to the access path where the data copy location is located. By updating the routing table, the next time the same data is accessed, the system can give priority to the new copy path as the access path according to the updated routing table.
[0036] As an optional implementation of the present application, the method further includes: responding to an abnormality alarm when no data replica is found. For example, when no data replica is available, an alarm is triggered, and a management staff member can be notified via an IM message or other means to conduct manual fault inspection and intervention. Once the original server is repaired and data is synchronized, the routing table can be readjusted, reverting to the original access path.
[0037] As an optional embodiment of the present application, determining a target access path among multiple access paths corresponding to the server to be accessed based on the address information of the server to be accessed contained in the server access request and the access path priority information contained in the preset multi-path configuration data includes:
[0038] Step a1: determining a corresponding access path according to the address information of the server to be accessed contained in the server access request; the access path corresponding to the server to be accessed may be obtained from preset multi-path configuration data.
[0039] Step a2: determining the throughput and operation status information of each access path corresponding to the server to be accessed; illustratively, the operation status information of each access path may include the round trip time (RTT) of each access path.
[0040] Step a3: determining a target access path according to the throughput and operation status information of each access path and the path priority information.
[0041] Exemplarily, in combination with pre-configured path priority information, such as the low-latency path having the highest priority, the path with the lowest latency can be selected from multiple access paths as the target access path. Specifically, the path priority information of different resources to be stored may be different. For example, when the resource to be stored is a large-volume video object, the corresponding path priority information may be that the path with the highest bandwidth has the highest priority to set weight scores for paths with different bandwidths; and for other small-volume files, the corresponding path priority information may be that the low-latency path has the highest priority to set weight scores for paths with different latency. The target access path is selected by obtaining the attribute information of each path and the weight score determined by the path priority configuration policy information; or the throughput and operating status information of each access path of the current server to be accessed can be input into the AI model according to a pre-trained AI model, so that the AI model gives a path selection strategy based on the current parameters, such as giving priority to local storage paths (NVMe, Non-Volatile Memory Express) and alternative NFS paths.
[0042] As an optional implementation of the present application, the method further includes: collecting preset indicator data of the access path corresponding to each server according to the target interval duration; and adjusting the path priority information of multiple access paths corresponding to each server based on the collection results.
[0043] Exemplarily, the access path priority information contained in the preset multi-path configuration data may include not only the priority configuration policy information of the paths under different protocols (such as the path with the highest bandwidth has the highest priority or the path with the lowest latency has the highest priority), so that the access path with the highest priority can be determined in real time according to the priority configuration policy information, but also the path priority information may include the priority information of multiple paths under each configured protocol. Specifically, the preset indicator data (such as throughput, response time, etc.) of the access path corresponding to each server can be collected according to the target interval duration, and the corresponding priority can be set for each path according to the priority configuration policy information based on the collection results. When an access request is received, the path with the highest priority can be directly selected from the preset multi-path configuration data according to the pre-configured path priority; when the amount of data to be stored is large, the access path to be used can be selected in order from high to low priority to ensure the timeliness of data storage. By continuously collecting preset indicator data according to the target interval duration, the accuracy of the configured path priority result can be guaranteed. The embodiment of the present application does not limit the target interval duration, and those skilled in the art can determine it according to the changes in the path attribute information.
[0044] As a specific implementation of the present application, when a storage access request initiated by a user is received, the optimal access path is selected based on the dynamic path access strategy (such as the priority determined by indicators such as maximum throughput and minimum latency), and the I / O operation is performed; if the I / O operation is successful, the result is returned to the user, and if it times out or fails, fault detection can be triggered; when other protocol access paths exist for the same server, the access path switching operation is performed and the current access path is marked as a degraded access state (that is, it can be characterized as the current path being non-optimal), and the access path corresponding to the current server recorded in the routing table in the preset multi-path configuration data is updated. When there are no other protocol access paths for the same server, the routing table is used to check whether there is a data copy. If so, and the data consistency of the data copy meets the requirements, the path where the data copy is located is used to execute the current storage access request operation and update the routing table; if there is no data copy, an alarm operation is triggered; at the same time, the performance of the original path is monitored, and when the performance of the original path meets the standard, the weight score of the original path is optimized, and the original path is used the next time a request for the same storage access is received.
[0045] The server access control method provided in the embodiments of the present application achieves unified access to heterogeneous storage servers through multi-path file configuration, creates a protocol-independent virtual file interface layer, provides a transparent access interface to upper-layer applications, and shields underlying protocol differences. Through dynamic protocol adaptation, multi-path load balancing, and a cross-protocol failover mechanism, it addresses the issues of interface fragmentation, complex configuration, and low availability in hybrid storage environments. Multi-path policies can be updated without restarting the service, making it suitable for elastically scalable cloud computing, distributed storage, and edge computing scenarios, enabling flexible access to hybrid storage resources. It supports multiple mainstream storage protocols, reducing configuration workload by 80%. Through dynamic path selection, IOPS is increased by 30%-50% compared to static multi-path solutions, and cross-protocol path redundancy brings system reliability to 99.95%.
[0046] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.
[0047] The embodiment of the present application further provides a server access control device, which is applied to a server access control system. The server access control system includes multiple types of servers, and each type of server is configured with multiple access paths; Figure 2 As shown, the device includes:
[0048] The first acquisition module 201 is configured to, upon receiving a server access request, acquire preset multipath configuration data. The preset multipath configuration data includes configuration templates corresponding to different types of protocols, access path information corresponding to different types of servers, and priority information corresponding to the access paths. For details, please refer to the description of the corresponding steps in the above method embodiment and will not be repeated here.
[0049] The first determination module 202 is configured to determine a target access path from among the multiple access paths corresponding to the server to be accessed based on the address information of the server to be accessed contained in the server access request and the access path priority information contained in the preset multi-path configuration data. For details, please refer to the description of the corresponding steps in the above method embodiment and will not be repeated here.
[0050] The generation module 203 is configured to obtain a configuration template corresponding to the protocol type of the target access path from the preset multipath configuration data and generate an access configuration file based on the configuration parameters input by the user. For details, please refer to the description of the corresponding steps in the above method embodiment, which will not be repeated here.
[0051] The access module 204 is configured to access the server to be accessed from the target access path according to the access configuration file and the driver corresponding to the protocol version type of the target access path.
[0052] The server access control device provided in an embodiment of the present application, upon receiving a request for access to any type of server, obtains multipath configuration data containing configuration templates corresponding to different types of protocols, obtains a configuration template corresponding to the current protocol type, and generates an access configuration file based on the configuration parameters entered by the user. Based on the automatically generated access configuration file and the determined target access path, access operations to the server to be accessed are executed. Compared to a purely manually written configuration file approach, this reduces the complexity of configuration operations and operational costs, while further improving server access efficiency.
[0053] As an optional implementation method of the embodiment of the present application, the preset multi-path configuration data also includes: a load balancing policy corresponding to the cluster where the server is located; the device also includes: a transfer module, which is used to transfer the server access request to other servers in the cluster where the server to be accessed is located, whose target performance indicators meet the requirements when the target performance indicators of the server to be accessed corresponding to the server access request do not meet the requirements.
[0054] As an optional implementation of an embodiment of the present application, the access path corresponding to each type of server includes at least two types of protocol types of access paths; the device also includes: a switching module, which is used to switch to the access path corresponding to other types of protocols when the target access path under any type of protocol fails, and use the current access path as the target access path and mark it as a degraded access state.
[0055] As an optional implementation of the embodiment of the present application, the device also includes: a query module, which is used to respond to the query operation on the data copy when all access paths corresponding to the server to be accessed do not meet the usage conditions; a second determination module, which is used to determine the location of the data copy when the data copy is queried; a verification module, which is used to perform consistency verification on the data in the data copy location; and an update module, which is used to update the routing table and switch the server access request corresponding to the server to be accessed to the access path where the data copy is located when the consistency verification result meets the requirements.
[0056] As an optional implementation of the embodiment of the present application, the device also includes: an alarm module, which is used to respond to an abnormal alarm operation when no data copy is found.
[0057] As an optional implementation of the embodiment of the present application, the first determination module includes: a first determination sub-module, used to determine the corresponding access path based on the address information of the server to be accessed contained in the server access request; a second determination sub-module, used to determine the throughput and operating status information of each access path corresponding to the server to be accessed; and a third determination sub-module, used to determine the target access path based on the throughput and operating status information of each access path and the path priority information.
[0058] As an optional implementation of the embodiment of the present application, the device also includes: a collection module for collecting preset indicator data of the access path corresponding to each server according to the target interval duration; an adjustment module for adjusting the path priority information of multiple access paths corresponding to each server based on the collection results.
[0059] For the description of the features in the embodiment corresponding to the server access control device, please refer to the relevant description of the embodiment corresponding to the server access control method, which will not be repeated here.
[0060] The embodiment of the present application also provides an electronic device, such as Figure 3 As shown, it includes a memory 10 and a processor 20. The memory 10 stores a computer program, and the processor 20 is configured to run the computer program to execute the steps in any of the above server access control method embodiments.
[0061] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps of any of the above-mentioned server access control method embodiments when running.
[0062] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0063] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of any of the above-mentioned server access control method embodiments are implemented.
[0064] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any of the above-mentioned server access control method embodiments are implemented.
[0065] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0066] The above describes in detail a server access control method, device, and electronic device provided by the present application. This article uses specific examples to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only intended to help understand the method and core concept of the present application. It should be noted that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
Claims
1. A server access control method, characterized in that: Applied to a server access control system, the server access control system includes multiple types of servers, each type of server is configured with multiple access paths; the method includes: When receiving a server access request, obtaining preset multi-path configuration data, the preset multi-path configuration data including configuration templates corresponding to different types of protocols, access path information corresponding to different types of servers, and priority information corresponding to the access paths; Determining a target access path among multiple access paths corresponding to the server to be accessed according to the address information of the server to be accessed contained in the server access request and the access path priority information contained in the preset multi-path configuration data; According to the protocol type corresponding to the target access path, a configuration template corresponding to the protocol is obtained from the preset multipath configuration data, and an access configuration file is generated according to the configuration parameters input by the user; An access operation is performed on the server to be accessed from the target access path according to the access configuration file and the driver corresponding to the protocol version type of the target access path.
2. The server access control method according to claim 1, wherein: The preset multipath configuration data also includes: a load balancing strategy corresponding to the cluster where the server is located; the method also includes: When the target performance index of the server to be accessed corresponding to the server access request does not meet the requirement, the server access request is transferred to another server in the cluster where the server to be accessed is located and whose target performance index meets the requirement.
3. The server access control method according to claim 1, wherein: The access path corresponding to each type of server includes at least two types of protocol access paths; the method further includes: When a target access path under any type of protocol fails, the access path corresponding to the other type of protocol is switched to, and the current access path is used as the target access path and marked as a degraded access state.
4. The server access control method according to claim 3, wherein: The method further comprises: When all access paths corresponding to the server to be accessed do not meet the usage conditions, respond to the query operation on the data copy; When a data copy is found, the location of the data copy is determined; Performing consistency check on the data in the data copy location; When the consistency check result meets the requirements, the routing table is updated and the access request to the server corresponding to the to-be-accessed server is switched to the access path where the data copy is located.
5. The server access control method according to claim 4, characterized in that: The method further includes: responding to an abnormal alarm operation when the data copy is not found.
6. The server access control method according to claim 1 or 3, characterized in that: The determining, based on the address information of the server to be accessed contained in the server access request and the access path priority information contained in the preset multi-path configuration data, a target access path among the multiple access paths corresponding to the server to be accessed, includes: Determining a corresponding access path according to the address information of the server to be accessed contained in the server access request; Determine the throughput and operating status information of each access path corresponding to the server to be accessed; The target access path is determined according to the throughput and operation status information of each access path and the path priority information.
7. The server access control method according to claim 1, wherein: The method further comprises: Collect preset indicator data of the access path corresponding to each server according to the target interval; The path priority information of the multiple access paths corresponding to each server is adjusted according to the collected results.
8. A server access control device, characterized in that: Applied to a server access control system, the server access control system includes multiple types of servers, each type of server is configured with multiple access paths; the device includes: A first acquisition module is configured to, upon receiving a server access request, acquire preset multipath configuration data, wherein the preset multipath configuration data includes configuration templates corresponding to different types of protocols, access path information corresponding to different types of servers, and priority information corresponding to the access paths; a first determining module, configured to determine a target access path among multiple access paths corresponding to the server to be accessed based on the address information of the server to be accessed contained in the server access request and the access path priority information contained in the preset multi-path configuration data; A generating module, configured to obtain a configuration template of a corresponding protocol from the preset multipath configuration data according to the protocol type corresponding to the target access path and generate an access configuration file according to the configuration parameters input by the user; The access module is used to perform an access operation on the server to be accessed from the target access path according to the access configuration file and the driver corresponding to the protocol version type of the target access path.
9. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the server access control method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the server access control method according to any one of claims 1 to 7 are implemented.