Method for accessing client to server, computer equipment and storage medium
Through the broadcast and registration mechanism, the client automatically discovers and accesses the server, solving the problems of high cost of client access to the server and difficulty in dynamic management in the existing technology, realizing automatic connection and reducing maintenance costs.
Patent Information
- Application Number
- CN202310762072.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-26
- Publication Date
- 2025-01-03
AI Technical Summary
In the prior art, the client access server method has the problem of high maintenance costs, inability to dynamically manage and automatically adapt, especially when the number of clients is large or frequently changed.
Through broadcast and registration, the client automatically discovers and accesses to the server, and sends broadcast information using preset cycles, including authentication information. After the client receives and authenticates, the registration information is sent, and the target server verifies and parses it to achieve Access simplifies the process of client accessing server.
It realizes automatic connection and adjustment of clients and servers under dynamic migration, reduces maintenance costs, and improves the efficiency and flexibility of client access.
Smart Images

Figure CN119254449A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a method for a client to access a server, a computer device, and a storage medium. Background Art
[0002] In actual business applications, it is usually necessary to connect the client to the server to achieve the corresponding business needs. There are several methods for connecting the client to the server in the prior art: one is that the client actively connects to the server, that is, the client maintains the server address and actively initiates a link establishment request to the server address. However, the above method has the following disadvantages: the client must preset the server address and cannot achieve "out of the box", that is, if there is a change in the server, the client must make corresponding modifications, so the maintenance cost of the client is relatively high. Second, the server actively connects to the client, that is, the server maintains the client address and actively initiates a connection to the client to obtain data. However, the above method has the following disadvantages: the server needs to preset the client information. When the number of clients is large, the cost of maintaining the client information is very high, and the client cannot be dynamically managed. If the number of clients increases or decreases, it cannot be automatically adapted.
[0003] Furthermore, there is also a method of manually connecting the server to the client to achieve the connection between the two. However, this method has a high cost for client access and requires manual maintenance, so it is not suitable for large-scale client access management. Summary of the invention
[0004] The main purpose of the embodiments of the present application is to provide a method, computer device and storage medium for client access to a server, aiming to realize automatic discovery and access of the client to the server through broadcasting and registration. Since the step of manually configuring the link is eliminated, the two can automatically adjust and connect to each other in the case of dynamic migration, thereby reducing the maintenance cost of the two.
[0005] In a first aspect, an embodiment of the present application provides a method for a client to access a server, which is applied to a target server, and the method includes:
[0006] Sending broadcast information according to a preset period so that the client receives the broadcast information, wherein the broadcast information includes the first authentication information;
[0007] receiving registration information sent by the client and verifying the validity of the registration information, wherein the registration information is generated after the client authenticates the first authentication information, and the registration information includes client information;
[0008] When the registration information is valid, the client information is parsed, and the client is accessed according to the parsed client information.
[0009] In a second aspect, an embodiment of the present application provides a method for a client to access a server, which is applied to a client, and the method includes:
[0010] Receiving broadcast information; wherein the broadcast information includes first authentication information of a server at the service end;
[0011] Authenticating the first authentication information, and generating registration information after the authentication is passed; wherein the registration information includes client information;
[0012] The registration information is sent to the target server, so that the target server parses the client information and accesses the client using the parsed client information.
[0013] In a third aspect, the present application provides a computer device, the computer device comprising:
[0014] A processor, a memory, a computer program stored in the memory and executable by the processor, and a data bus for realizing connection and communication between the processor and the memory, wherein when the computer program is executed by the processor, the steps of the method for client accessing the server as described in any one of the embodiments of the present application are realized.
[0015] In a fourth aspect, the present application provides a storage medium for computer-readable storage, characterized in that the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the method for client accessing the server as described in any one of the embodiments of the present application.
[0016] The embodiments of the present application provide a method, a computer device, and a storage medium for a client to access a server, which can be applied to a target server. Specifically, broadcast information can be sent according to a preset period so that the client receives the broadcast information including the first authentication information. After the client authenticates the first authentication information, registration information including the client information is sent to the target server, so that the target server can verify the validity of the registration information. Furthermore, when the registration information is valid, the target server can also parse the client information, so that the client can be accessed based on the parsed client information. The embodiments of the present application implement the connection between the client and the target server by sending broadcast information in a preset period and providing an authentication and registration mechanism, thereby simplifying the process of the client accessing the server. That is, the client only needs to send and process information according to the specified method without complicated manual operations or additional steps. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0018] Figure 1 A flowchart of a method for a client to access a server provided in an embodiment of the present application;
[0019] Figure 2 A schematic diagram of a scenario for parsing client information provided in an embodiment of the present application;
[0020] Figure 3 A schematic diagram of a process for sending broadcast information provided in an embodiment of the present application;
[0021] Figure 4 A schematic diagram of a scenario for sending broadcast information provided in an embodiment of the present application;
[0022] Figure 5 A flowchart of another method for a client to access a server provided in an embodiment of the present application;
[0023] Figure 6 A schematic diagram of a process for generating registration information provided in an embodiment of the present application;
[0024] Figure 7 A schematic diagram of a scenario for generating registration information provided in an embodiment of the present application;
[0025] Figure 8 A schematic diagram of a scenario of a first method of client accessing a server provided in an embodiment of the present application;
[0026] Fig. 9 A schematic diagram of a scenario of a second method for a client to access a server provided in an embodiment of the present application;
[0027] Fig.10 A schematic diagram of a scenario of a third method of client accessing a server provided in an embodiment of the present application;
[0028] Fig.11 A schematic diagram of a scenario of a fourth method of client accessing a server provided in an embodiment of the present application;
[0029] Fig.12 A schematic block diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0030] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0031] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.
[0032] It should be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0033] See also Figure 1 , Figure 1 A schematic flow chart of a method for client accessing a server provided in an embodiment of the present application. The method for client accessing a server can be applied in a target server, thereby enabling the client to access the target server.
[0034] like Figure 1 As shown, the method for the client to access the server includes steps S11 to S13.
[0035] Step S11: Send broadcast information according to a preset period, so that the client can receive the broadcast information.
[0036] The broadcast information includes first authentication information, which includes one or more of token information, key information, and identity information, which is not limited in this application.
[0037] Further, the present application does not limit the preset period, for example, the preset period is every ten minutes, every twenty minutes, etc. It can be flexibly adjusted according to the needs to meet the implementation requirements in different scenarios.
[0038] In addition, the broadcast duration of sending broadcast information can also be limited, for example, the broadcast duration is 1 hour, 2 hours, etc. This application does not limit this, and takes the preset period of every ten minutes and the broadcast duration of 2 hours as an example for explanation.
[0039] Specifically, the target server can send 2 hours of broadcast information at a frequency of once every ten minutes, that is, it will send 60*2 / 10=12 broadcast information. It can be understood that if the broadcast duration is not limited, the target server will always send broadcast information at a frequency of once every ten minutes, so that the client can receive the broadcast information in time, ensuring the real-time nature of the broadcast information, and then realizing the real-time connection between the two.
[0040] In addition, the target server sends information in the form of broadcast, and can also transmit the broadcast information to multiple clients, thereby improving the efficiency and coverage of information transmission.
[0041] In an embodiment of the present application, the target server may send broadcast information to the client according to a preset period, so that the client receives the broadcast information, thereby realizing a real-time connection between the two.
[0042] Step S12: Receive the registration information sent by the client and verify the validity of the registration information.
[0043] The registration information is generated after the client authenticates the first authentication information, and the registration information includes the client information.
[0044] Specifically, the client can authenticate the first authentication information to determine whether the identity of the target server is legitimate. Further, after the authentication is passed, the client can send registration information to the target server. In this way, the target server can receive the registration information sent by the client and verify the validity of the registration information to verify the identity of the client, thereby improving the security of data transmission between the two.
[0045] Optionally, the registration information includes token information, key information, and identity information. The above-mentioned receiving the registration information sent by the client and verifying the validity of the registration information includes: receiving at least one of the token information, key information and identity information sent by the client, and verifying the validity of at least one of the information.
[0046] Specifically, the target server may receive at least one of the token information, key information and identity information sent by the client, and then verify it to confirm the identity of the client, thereby achieving secure transmission of data between the two.
[0047] For the token information sent by the client, the target server can use a preset static token or dynamic token for authentication to confirm the identity of the client; for the key information sent by the client, the client can encrypt it in advance using a preset private key, and then the target server can decrypt it with a public key after receiving it to authenticate and confirm the identity of the client; for the identity information sent by the client, the target server can directly perform authentication operations on it to confirm the identity of the client.
[0048] Optionally, the above authentication methods can be combined to determine the identity of the client, which is not limited in this application.
[0049] In an embodiment of the present application, the target server may receive the registration information sent by the client, and verify the validity of the registration information, thereby implementing subsequent management or business processing of the client.
[0050] Step S13: When the registration information is valid, the client information is parsed, and the client is accessed according to the parsed client information.
[0051] Specifically, when the registration information is valid, it means that the identity of the client is legitimate. Then the target server can parse the client information to obtain the parsed client information. In this way, the target server can better understand the characteristics, needs or other relevant information of the client, so as to better access the client and provide services, and can realize server access to the client according to the parsed client information.
[0052] See also Figure 2 , Figure 2 A schematic diagram of a scenario for parsing client information provided in an embodiment of the present application, such as Figure 2 As shown. The target server can start the registration monitoring mechanism to receive the registration information sent by the client. And authenticate the registration information to confirm the validity of the registration information. If the registration information is valid, it means that the identity of the client is illegal, that is, the connection between the two cannot be achieved. At this time, the target server can discard this registration information.
[0053] When the registration information is valid, the target server can further parse the client information and access the client according to the parsed client information. In addition, the client information maintained in the server system can be updated, and the subsequent client access can be directly realized, that is, the subsequent connection efficiency of the two can be improved.
[0054] In an embodiment of the present application, when the registration information is valid, the target server may parse the client information, and then access the client according to the parsed client information, that is, realize the connection between the target server and the client.
[0055] The embodiment of the present application provides a method for a client to access a server, which can be applied to a target server. Specifically, broadcast information can be sent according to a preset period so that the client receives the broadcast information including the first authentication information. After the client authenticates the first authentication information, registration information including the client information is sent to the target server, so that the target server can verify the validity of the registration information. Furthermore, when the registration information is valid, the target server can also parse the client information, so that the client can be accessed based on the parsed client information. The embodiment of the present application realizes the connection between the client and the target server by sending broadcast information in a preset period and providing an authentication and registration mechanism, thereby simplifying the process of the client accessing the server. That is, the client only needs to send and process information according to the specified method without complicated manual operations or additional steps.
[0056] See also Figure 3 , Figure 3 A schematic diagram of a process for sending broadcast information provided in an embodiment of the present application, such as Figure 3 As shown, sending broadcast information can also be achieved through steps S111 to S114.
[0057] Step S111: Acquire network configuration information, and determine whether there is a configuration management range in the network configuration information.
[0058] Step S112: When there is a configuration management scope in the network configuration information, a broadcast scope is generated based on the configuration management scope.
[0059] Among them, the network configuration information at least includes IP address, configuration management range, subnet mask, etc., which is not limited in this application.
[0060] Specifically, the target server can obtain the network configuration information and determine whether there is a configuration management range in the network configuration information, that is, whether there is an IP address range for network management. Further, when there is a configuration management range in the network configuration information, the target server can generate a broadcast range based on the configuration management range. Thus, the target server can send broadcast information to any client within the broadcast range.
[0061] In an embodiment of the present application, the target server may generate a broadcast range based on the configuration management range to send broadcast information to clients within the broadcast range, thereby achieving a connection between the two.
[0062] Step S113: when the network configuration information does not have a configuration management scope, determine a target server from a plurality of servers, obtain the internetworking protocol and mask information of the target server, and generate a broadcast scope based on the internetworking protocol and mask information of the target server.
[0063] Specifically, when the network configuration information does not have a configuration management scope, a target server can be determined from a number of servers. The target server is a server that can access the client. Further, the Internet protocol and mask information of the target server can be obtained, and then the broadcast scope can be generated by performing logical AND operations, logical NOT operations, etc. on the Internet protocol and mask information of the target server.
[0064] Optionally, determining the target server from a plurality of servers includes: judging whether there is a target Internet interconnection protocol for designated monitoring among the plurality of servers; if there is a target Internet interconnection protocol for designated monitoring, taking the server corresponding to the target Internet interconnection protocol as the target server; if there is no target Internet interconnection protocol for designated monitoring, taking all of the plurality of servers as the target servers.
[0065] In the embodiment of the present application, a target server that can access the client can be determined, and then a broadcast range is generated based on the Internet interconnection protocol and mask information of the target server to implement the sending of broadcast information.
[0066] Step S114: Send broadcast information within the broadcast range according to a preset period.
[0067] Specifically, the target server may start a timer, and then send broadcast information to each client within the broadcast range based on a preset period, so that each client within the broadcast range can receive the broadcast information.
[0068] The preset period may be every five minutes, every ten minutes, etc., which is not limited in this application.
[0069] In an embodiment of the present application, the target server can obtain network configuration information and then determine the corresponding configuration management scope. A broadcast scope is generated based on the configuration management scope. In this way, broadcast information can be sent to the client within the broadcast scope based on a preset period, so that each client within the broadcast scope can receive the broadcast information. The above realizes data interaction with the client based on the broadcast mechanism, which simplifies the process of the client accessing the server.
[0070] See also Figure 4 , Figure 4 A schematic diagram of a scenario for sending broadcast information provided by an embodiment of the present application. Figure 4 Specifically, the target server can obtain network configuration information and determine whether there is a configuration management scope in the network configuration information. When there is a configuration management scope in the network configuration information, the target server can directly generate a broadcast scope based on the configuration management scope and start a timer to send broadcast information to any client within the broadcast scope according to a preset period.
[0071] When there is no configuration management scope in the network configuration information, it can be determined whether there is a designated listening target Internet interconnection protocol among several servers; if there is a designated listening target Internet interconnection protocol, the server corresponding to the target Internet interconnection protocol is used as the target server; if there is no designated listening target Internet interconnection protocol, all of the several servers are used as the target servers. A broadcast scope is generated based on the Internet interconnection protocol and mask information of the target server, and then a timer is started to send broadcast information to any client within the broadcast scope according to a preset period.
[0072] See also Figure 5 , Figure 5 A flowchart of another method for a client to access a server provided in an embodiment of the present application. Figure 5 As shown, the method is applied to the client, and the client can access the server through steps S21 to S23.
[0073] S21: Receive broadcast information; wherein the broadcast information includes first authentication information of a target server of the service end.
[0074] Specifically, the client can receive the broadcast information sent by the target server, thereby ensuring the real-time nature of the broadcast information and also being able to achieve a real-time connection between the two.
[0075] S22: Authenticate the first authentication information, and generate registration information after the authentication is passed; wherein the registration information includes client information.
[0076] Specifically, the client can authenticate the first authentication information to determine whether the identity of the target server is legitimate. Further, after the authentication is passed, the client can send registration information to the target server so that the target server receives the registration information sent by the client.
[0077] Optionally, the first authentication information includes token information, key information, and identity information. The first authentication information is authenticated, and registration information is generated after the authentication is passed, including: authenticating at least one of the token information, key information, and identity information sent by the target server, and generating registration information after the authentication is passed.
[0078] Specifically, the client may receive at least one of the token information, key information and identity information sent by the target server, and then verify it to confirm the identity of the target server, thereby achieving secure transmission of data between the two.
[0079] For the token information sent by the target server, the client can use a preset static token or dynamic token for authentication to confirm the identity of the target server; for the key information sent by the target server, the target server can encrypt it in advance using a preset private key, and then the client can decrypt it with a public key after receiving it to achieve authentication to confirm the identity of the target server; for the identity information sent by the target server, the client can directly perform authentication operations on it to confirm the identity of the target server.
[0080] Optionally, authentication methods may be combined to determine the identity of the target server, which is not limited in this application.
[0081] In an embodiment of the present application, the client can authenticate the first authentication information sent by the target server, thereby verifying the identity of the target server, and generate registration information after the authentication is passed.
[0082] S23: Send the registration information to the target server, so that the target server parses the client information and uses the parsed client information to access the client.
[0083] Specifically, the client can send the registration information to the target server, so that the target server can receive the registration information and parse the client information included in the registration information, such as parsing the JSON data, user name and password corresponding to the client, and access the client based on this information.
[0084] In an embodiment of the present application, the client may send registration information to the target server so that the target server parses the client information and then accesses the client according to the parsed client information, thereby realizing the connection between the target server and the client.
[0085] See also Figure 6 , Figure 6 A schematic diagram of a process for generating registration information provided in an embodiment of the present application. Figure 6 As shown, the registration information can be generated after the authentication is passed through steps S221 and S225.
[0086] Step S221: Determine the amount of first authentication information in the broadcast information.
[0087] Step S222: When the number is 1, the first authentication information is authenticated, and registration information is generated after the authentication passes.
[0088] Specifically, the client can determine the number of first authentication information in the broadcast information. When the number of first authentication information is 1, it means that there is a corresponding target server at this time, so the client can directly authenticate the first authentication information of the target server and generate registration information after the authentication is passed.
[0089] It should be noted that for the specific description of authentication, please refer to the specific implementation steps of the above step S22. In order to avoid repetition, it will not be described here.
[0090] Optionally, the first authentication information also includes server information; after authenticating the first authentication information, it also includes: determining whether the server information already exists; if the server information already exists, discarding the server information; if the server information does not exist, recording the server information.
[0091] Specifically, the client can authenticate the broadcast information to obtain an authentication result. If the authentication result is authentication failure, the client directly discards the broadcast information; if the authentication result is authentication success, the client can further determine whether the server information exists for further processing.
[0092] If the server information already exists, it means that the client has already performed corresponding processing on it, and the client can discard the server information at this time; if the server information does not exist, the client can record the server information for subsequent processing.
[0093] In the embodiment of the present application, the client can determine the number of first authentication information in the broadcast information, and then directly perform authentication based on the first authentication information when the number of first authentication information is 1, and generate registration information after the authentication is passed.
[0094] Step S223: When the number is greater than 1, determine whether it is a single server mode.
[0095] Step S224: If yes, determine the target first authentication information from the multiple first authentication information, authenticate the target first authentication information, and generate registration information after the authentication passes.
[0096] Step S225: If not, authenticate each first authentication information, and generate corresponding registration information after the authentication passes.
[0097] Specifically, when the number of first authentication information is greater than 1, it means that multiple target servers send broadcast information to the client. Therefore, the client can determine whether the mode of the server is a single server mode, and implement the authentication operation based on the mode of the server, and then generate registration information after the authentication is passed.
[0098] It should be noted that the single-server mode refers to deploying the entire application or system on a single server. This deployment method is suitable for small applications or websites with low traffic. A single server usually has limited computing resources and bandwidth. Therefore, it has the advantages of simplicity, low cost and easy management, but it is easy to become a performance bottleneck and does not have high availability and scalability.
[0099] Multi-server mode refers to deploying applications or systems on multiple servers. This deployment method can distribute requests to different servers through load balancing technology to improve performance and reliability. Multi-server mode allows applications to scale dynamically when needed, and can provide better fault tolerance and the ability to handle a large number of concurrent requests.
[0100] Therefore, when it is determined that the mode of the server is a single server mode, the target first authentication information can be directly determined from the first authentication information corresponding to multiple target servers, and the target first authentication information is authenticated, and registration information is generated after the authentication is passed.
[0101] When it is determined that the mode of the server is not a single-server mode, that is, when the mode of the server is a multi-server mode, the first authentication information corresponding to each target server can be authenticated, and corresponding registration information can be generated after the authentication is passed.
[0102] It should be noted that for a specific description of the authentication operation, please refer to the specific implementation steps of the above step S22, and in order to avoid repetition, it will not be described here.
[0103] In an embodiment of the present application, when the client can determine that the number of first authentication information in the broadcast information is greater than 1, it can further determine whether the mode of the server is a single server mode, and authenticate the first authentication information of the server based on different server modes, and generate registration information after the authentication is passed, thereby improving the security of the client's access to the server.
[0104] See also Figure 7 , Figure 7 A schematic diagram of a scenario for generating registration information provided in an embodiment of the present application. Figure 7 As shown, the client can start the timer and read the server information based on the preset period to determine the number of first authentication information in the broadcast information. When the number of first authentication information is 1, the client directly authenticates the first authentication information and generates registration information after the authentication is passed, thereby sending the registration information to the target server corresponding to the first authentication information.
[0105] When the number of first authentication information is greater than 1, the client can determine whether the mode of the server is a single-server mode. When determining that the mode of the server is a single-server mode, the client can directly determine the target first authentication information from the first authentication information corresponding to multiple target servers, authenticate the target first authentication information, and generate registration information after the authentication is passed, thereby sending the registration information to the target server corresponding to the first authentication information. When determining that the mode of the server is not a single-server mode, that is, when the mode of the server is a multi-server mode, the client can authenticate the first authentication information corresponding to each target server, and generate the corresponding registration information after the authentication is passed, thereby sending the registration information to the target server corresponding to the first authentication information.
[0106] Please continue reading Figures 8 to 11 , Figure 8 A schematic diagram of a scenario of a first method of client accessing a server provided in an embodiment of the present application; Fig. 9 A schematic diagram of a scenario of a second method of client accessing a server provided in an embodiment of the present application; Fig.10 A schematic diagram of a scenario of a third method of client accessing a server provided in an embodiment of the present application; Fig.11 The fourth method of client accessing the server provided in the present application is a schematic diagram of a scenario. The above method can be applied to the server node or the client node for management, and is specifically applied to Figures 8 to 11 scene.
[0107] like Figure 8 As shown, a server node can be planned in the internal network, and the server node and the fixed client node are in the same internal network. The server node can realize message communication with the client node through the internal network based on the method of client access to the server proposed in this application.
[0108] like Fig. 9 As shown, client nodes can be planned in a scalable network. Among them, the client node can be expanded or reduced according to the demand of business volume, and the server node remains unchanged. The server node can realize message communication with the client node through the scalable network based on the method of client access to the server proposed in this application.
[0109] like Fig.10 As shown, when the server node is unavailable due to some reasons, a new server node can be planned. Through the method of client accessing the server proposed in this application, the client nodes in the same network can automatically access the new server node.
[0110] like Fig.11As shown, when the internal network expands and exceeds the maximum load of the server node, another server node can be added to the internal network. The client node can perform specific operations based on its own IP and match one of the server nodes to send a registration message based on the method of client access to the server proposed in this application, thereby achieving the effect of load sharing.
[0111] The method of the present application can be used in many general or special computing system environments or configurations, such as personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer computer devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc.
[0112] See also Fig.12 , Fig.12 A schematic block diagram of the structure of a computer device provided in an embodiment of the present application.
[0113] like Fig.12 As shown, the computer device 400 may include a processor 401 and a memory 402 , and the processor 401 and the memory 402 are connected via a bus, such as an I2C (Inter-integrated Circuit) bus.
[0114] In an exemplary embodiment, the processor 401 can be used to provide computing and control capabilities to support the operation of the entire computer device. The processor 401 can be a central processing unit (CPU), and the processor 401 can also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.
[0115] Specifically, the memory 402 may be a Flash chip, a read-only memory (ROM) disk, an optical disk, a USB flash drive, or a mobile hard disk.
[0116] Those skilled in the art will understand that Fig.12The structure shown in the figure is only a block diagram of a partial structure related to the embodiment of the present application, and does not constitute a limitation on the computer device to which the embodiment of the present application is applied. The specific server may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0117] The processor 401 is used to run a computer program stored in the memory, and implement any one of the methods for client accessing a server provided in the embodiments of the present application when executing the computer program.
[0118] In one embodiment, the processor 401 is used to run a computer program stored in a memory, and implement the following steps when executing the computer program: sending broadcast information according to a preset period so that the client receives the broadcast information, wherein the broadcast information includes first authentication information; receiving registration information sent by the client, and verifying the validity of the registration information, wherein the registration information is generated after the client authenticates the first authentication information, and the registration information includes client information; when the registration information is valid, parsing the client information, and accessing the client based on the parsed client information.
[0119] In one embodiment, before implementing sending broadcast information according to a preset period, the processor 401 is used to implement: obtaining network configuration information, and determining whether there is a configuration management scope in the network configuration information; when the configuration management scope exists in the network configuration information, generating a broadcast scope based on the configuration management scope; when the configuration management scope does not exist in the network configuration information, determining the target server from a number of servers, and obtaining the Internet interconnection protocol and mask information of the target server, and generating the broadcast range based on the Internet interconnection protocol and mask information of the target server; sending the broadcast information according to the preset period includes: sending the broadcast information within the broadcast range according to the preset period.
[0120] In one embodiment, when the processor 401 determines the target server from a plurality of servers, it is used to implement: judging whether there is a target Internet interconnection protocol for designated monitoring among the plurality of servers; if there is a target Internet interconnection protocol for designated monitoring, taking the server corresponding to the target Internet interconnection protocol as the target server; if there is no target Internet interconnection protocol for designated monitoring, taking all of the plurality of servers as the target servers.
[0121] In one embodiment, when the processor 401 receives the registration information sent by the client and verifies the validity of the registration information, it is used to implement: receiving at least one of the token information, key information and identity information sent by the client, and verifying the validity of the at least one information.
[0122] In one embodiment, the processor 401 is used to run a computer program stored in a memory, and also implements the following steps when executing the computer program: receiving broadcast information; wherein the broadcast information includes first authentication information of a target server of the server; authenticating the first authentication information, and generating registration information after the authentication is passed; wherein the registration information includes client information; sending the registration information to the target server so that the target server parses the client information and uses the parsed client information to access the client.
[0123] In one embodiment, when the processor 401 authenticates the first authentication information and generates registration information after the authentication is passed, it is used to implement: determining the number of first authentication information in the broadcast information; when the number is 1, authenticating the first authentication information and generating registration information after the authentication is passed; when the number is greater than 1, determining whether it is a single server mode; if so, determining the target first authentication information from multiple first authentication information, authenticating the target first authentication information, and generating registration information after the authentication is passed; if not, authenticating each first authentication information and obtaining the corresponding registration information after the authentication is passed.
[0124] In one embodiment, when the processor 401 authenticates the first authentication information and generates registration information after the authentication is successful, it is used to: authenticate at least one of the token information, key information and identity information sent by the target server, and obtain the registration information after the authentication is successful.
[0125] In one embodiment, after authenticating the first authentication information, the processor 401 is used to: determine whether the server information already exists; if the server information already exists, discard the server information; if the server information does not exist, record the server information.
[0126] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the computer device described above can refer to the corresponding process in the aforementioned terminal capability reporting method embodiment, and will not be repeated here.
[0127] An embodiment of the present application also provides a storage medium for computer-readable storage, wherein the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of any method of client accessing a server provided in the specification of the embodiment of the present application.
[0128] The storage medium may be an internal storage unit of the computer device described in the above embodiment, such as a hard disk or memory of the computer device. The storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the computer device.
[0129] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In a hardware embodiment, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0130] It should be understood that the term "and / or" used in the present specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, including these combinations. It should be noted that, in this article, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "including a..." does not exclude the presence of other identical elements in the process, method, article or system including the element.
[0131] The serial numbers of the embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments. The above are only specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A method for a client to access a server, characterized in that: Applied to a target server, the method comprises: Sending broadcast information according to a preset period so that the client receives the broadcast information, wherein the broadcast information includes the first authentication information; receiving registration information sent by the client and verifying the validity of the registration information, wherein the registration information is generated after the client authenticates the first authentication information, and the registration information includes client information; When the registration information is valid, the client information is parsed, and the client is accessed according to the parsed client information.
2. The method according to claim 1, characterized in that Before sending the broadcast information according to the preset period, the method further includes: Obtaining network configuration information, and determining whether there is a configuration management scope in the network configuration information; When the configuration management scope exists in the network configuration information, generating a broadcast scope based on the configuration management scope; When the network configuration information does not exist in the configuration management scope, determining the target server from a plurality of servers, acquiring the internet interconnection protocol and mask information of the target server, and generating the broadcast scope based on the internet interconnection protocol and mask information of the target server; The sending of the broadcast information according to a preset period includes: sending the broadcast information within the broadcast range according to a preset period.
3. The method according to claim 2, characterized in that Determining the target server from a plurality of servers includes: Determine whether a target Internet protocol for designated monitoring exists in the plurality of servers; If there is a target Internet protocol for monitoring, taking a server corresponding to the target Internet protocol as the target server; If there is no designated listening target Internet protocol, all of the servers are used as the target servers.
4. The method according to claim 1, characterized in that: The registration information includes token information, key information, and identity information. The receiving the registration information sent by the client and verifying the validity of the registration information includes: Receive at least one of the token information, key information and identity information sent by the client, and verify the validity of the at least one information.
5. A method for a client to access a server, characterized in that: Applied to a client, the method comprises: Receiving broadcast information; wherein the broadcast information includes first authentication information of a target server of the service end; Authenticating the first authentication information, and generating registration information after the authentication is passed; wherein the registration information includes client information; The registration information is sent to the target server, so that the target server parses the client information and accesses the client using the parsed client information.
6. The method according to claim 5, characterized in that The authenticating the first authentication information and generating registration information after the authentication is passed includes: Determining the amount of first authentication information in the broadcast information; When the number is 1, the first authentication information is authenticated, and registration information is generated after the authentication passes; When the number is greater than 1, determine whether it is a single server mode; If yes, determine the target first authentication information from the plurality of first authentication information, authenticate the target first authentication information, and generate registration information after the authentication passes; If not, each of the first authentication information is authenticated, and corresponding registration information is generated after the authentication is passed.
7. The method according to claim 5, characterized in that The first authentication information includes token information, key information, and identity information. The step of authenticating the first authentication information and generating registration information after the authentication is passed includes: Authenticate at least one of the token information, key information and identity information sent by the target server, and generate the registration information after the authentication is passed.
8. The method according to claim 5, characterized in that The first authentication information also includes server information; after authenticating the first authentication information, the method further includes: Determine whether the server information already exists; If the server information already exists, discard the server information; If the server information does not exist, record the server information.
9. A computer device, characterized in that: The computer device comprises: A processor, a memory, a computer program stored in the memory and executable by the processor, and a data bus for realizing connection communication between the processor and the memory, wherein when the computer program is executed by the processor, the steps of the method for client accessing a server as described in any one of claims 1 to 8 are realized.
10. A storage medium for computer-readable storage, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the method for client accessing the server as described in any one of claims 1 to 8.
