[go: up one dir, main page]

CN120151324A - Server address changing method, device, electronic device and storage medium - Google Patents

Server address changing method, device, electronic device and storage medium Download PDF

Info

Publication number
CN120151324A
CN120151324A CN202311717801.5A CN202311717801A CN120151324A CN 120151324 A CN120151324 A CN 120151324A CN 202311717801 A CN202311717801 A CN 202311717801A CN 120151324 A CN120151324 A CN 120151324A
Authority
CN
China
Prior art keywords
server
address
browser client
browser
server address
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311717801.5A
Other languages
Chinese (zh)
Inventor
乐勇
杨丽香
吴满
张志磊
郭建强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
360 Digital Security Technology Group Co Ltd
Original Assignee
360 Digital Security Technology Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 360 Digital Security Technology Group Co Ltd filed Critical 360 Digital Security Technology Group Co Ltd
Priority to CN202311717801.5A priority Critical patent/CN120151324A/en
Publication of CN120151324A publication Critical patent/CN120151324A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0823Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5053Lease time; Renewal aspects

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the application provides a server address changing method, a device, electronic equipment and a storage medium, wherein the method comprises the following steps: and responding to the starting operation of the browser client, acquiring browser configuration data, analyzing the browser configuration data to confirm the server address of the browser client, acquiring an address migration task from the first server based on the first server address when the server address is the first server address, wherein the address migration task comprises a second server address, establishing connection between the browser client and the second server based on the second server address, and changing the server address from the first server address to the second server address when the connection between the browser client and the second server is successful. The browser client side automatically switches the server address, so that the operation cost of manually modifying the server address by a user can be reduced, the problem of modification failure caused by manual misoperation can be avoided, and the success rate of server address switching is improved.

Description

Server address changing method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of internet technologies, and in particular, to a method and an apparatus for changing a server address, an electronic device, and a storage medium.
Background
There is often a need for server address migration, i.e., a need to switch from an a-server to a B-server, within an enterprise due to the complexity of the network environment. Enterprise browsers, which are commonly used in conjunction with a server (also called a management background) for distributing user information, configuration, synchronization data, etc., are also often faced with this problem as an indispensable office portal for the enterprise.
The common server switching scheme is to enable users to manually switch, but the complexity and efficiency of using the method are low due to uneven cognition of different groups of people in an enterprise on computer software, huge number of users, poor user experience and the like. Another common switching scheme is that the original server address is not changed, and the original server address is redirected to the new interface through the HTTP status code 302 (redirection status code), but this way needs to maintain the old server and the new server simultaneously, and the operation and maintenance costs and the hardware costs are high.
Therefore, it is needed to propose a server switching method capable of reducing the operation cost of manually modifying the server address.
Disclosure of Invention
The application mainly aims to provide a server switching method, a device, electronic equipment and a storage medium, and aims to reduce the operation cost of manually modifying a server address by a user and improve the success rate of address switching. The technical scheme is as follows:
In a first aspect, an embodiment of the present application provides a server switching method, including:
Responding to the starting operation of the browser client, and acquiring browser configuration data;
Analyzing the browser configuration data to confirm the server address of the browser client;
When the server address is a first server address, acquiring an address migration task from a first server based on the first server address, wherein the address migration task comprises a second server address of a second server;
establishing a connection between the browser client and a second server based on the second server address;
and when the browser client is successfully connected with the second server, changing the server address from the first server address to the second server address.
In a second aspect, an embodiment of the present application provides a large language model training method, including:
Acquiring a second server address of a second server, and generating an address migration task corresponding to the second server based on the second server address;
and transmitting the address migration task to a browser client so that the browser client establishes connection between the browser client and a second server based on the second server address in the address migration task.
In a third aspect, an embodiment of the present application provides a server address changing apparatus, including:
the configuration acquisition module is used for responding to the starting operation of the browser client and acquiring browser configuration data;
the analyzing module is used for analyzing the browser configuration data to confirm the server address of the browser;
The request module is used for acquiring an address migration task from a first server based on the first server address when the server address is the first server address, wherein the address migration task comprises a second server address of a second server;
The connection switching module is used for establishing connection between the browser client and the second server based on the second server address;
And the address modification module is used for modifying the server address from the first server address to the second server address when the browser client is successfully connected with the second server.
In a fourth aspect, an embodiment of the present application provides a server address changing apparatus, including:
the address acquisition module is used for acquiring a second server address of a second server and generating an address migration task corresponding to the second server based on the second server address;
and the task sending module is used for sending the address migration task to the browser client so that the browser client can establish connection between the browser client and the second server based on the second server address in the address migration task.
In a fifth aspect, an embodiment of the present application provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the computer program implementing the steps of the method as described above when executed by the processor.
In a sixth aspect, embodiments of the present application provide a storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method as described above.
In the embodiment of the application, browser configuration data is acquired through response of a browser client to starting operation of the browser client, the browser configuration data is analyzed to confirm a server address of the browser client, when the server address is a first server address, an address migration task is acquired from the first server based on the first server address, the address migration task comprises a second server address of a second server, connection between the browser client and the second server is established based on the second server address, and when the browser client and the second server are successfully connected, the server address is changed from the first server address to the second server address. The browser client side is used for automatically switching the server address, so that the operation cost of manually modifying the server address by a user can be reduced, and meanwhile, the problem of modification failure caused by manual misoperation can be avoided by adopting an automatic switching mode, so that the success rate of server address switching is improved.
Drawings
In order to more clearly illustrate the embodiments of the application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present description, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a system architecture diagram of a server address changing method according to an embodiment of the present application;
fig. 2is a flowchart of a method for changing a server address according to an embodiment of the present application;
FIG. 3 is a flowchart illustrating a method for changing a server address according to an embodiment of the present application;
fig. 4 is a flowchart of a method for changing a server address according to an embodiment of the present application;
FIG. 5 is a general flow chart of a method for changing a server address according to an embodiment of the present application;
FIG. 6 is a flowchart illustrating a method for changing a server address according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a server address changing device according to an embodiment of the present application;
Fig. 8 is a schematic structural diagram of a server address changing device according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are intended to be within the scope of the present disclosure.
In the description of the present specification, it should be understood that the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. In the description of the present specification, it should be noted that, unless expressly specified and limited otherwise, "comprise" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed steps or elements but may include other steps or elements not listed or inherent to such process, method, article, or apparatus. The specific meaning of the terms in this specification will be understood by those of ordinary skill in the art in the light of the specific circumstances. In addition, in the description of the present specification, unless otherwise indicated, "a plurality" means two or more. "and/or" describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate that there are three cases of a alone, a and B together, and B alone. The character "/" generally indicates that the context-dependent object is an "or" relationship.
The server address changing device can be a terminal device such as a mobile phone, a computer, a tablet computer, a smart watch or vehicle-mounted equipment, and the like, and can also be a module used for realizing a server address changing method in the terminal device, the server address changing device can obtain browser configuration data by responding to starting operation of a browser client, analyze the browser configuration data to confirm a server address of the browser client, obtain an address migration task to a first server based on the first server address when the server address is the first server address, establish connection between the browser client and a second server based on the second server address, and change the server address from the first server address to the second server address when the browser client and the second server are successfully connected.
Optionally, the server address changing device may further obtain a second server address of the second server, generate an address migration task corresponding to the second server based on the second server address, and send the address migration task to the browser client, so that the browser client establishes connection between the browser client and the second server based on the second server address in the address migration task.
Referring to fig. 1, a system architecture diagram of a server address modification method is provided in an embodiment of the present application. As shown in fig. 1, the system architecture diagram includes a browser client 101, a first server 102, and a second server 103, after the browser client 101 is started, browser configuration data is obtained, a server currently connected to the browser client 101 is confirmed to be the first server 102 according to a server address in the browser configuration data, an address migration task is obtained from the first server 102 based on the first server address, the browser client 101 establishes a connection with the second server 103 based on a second server address in the address migration task, when the browser client 101 can be successfully connected with the second server 103, the browser configuration data in the browser client 101 is changed, and when the browser client 101 responds to a starting operation, the browser client 101 can be connected with the second server 103 according to the updated browser configuration data.
The server address changing method provided in the present specification is described in detail below with reference to specific embodiments.
Referring to fig. 2, a flowchart of a method for changing a server address is provided in an embodiment of the present application. As shown in fig. 2, the specific flow of the server address changing method is set forth together from the browser client side and the first server side in the embodiment of the present application, and the method may include the following steps S101 to S108.
S101, a browser client responds to starting operation of the browser client to acquire browser configuration data;
In one embodiment, a browser client obtains browser configuration data of the browser client in response to a start operation of the browser client. The browser configuration data may include home page information of the browser, personalized settings of the user, plug-in and extension information, history, bookmarks, cookies, and the like. The starting operation is an operation of starting the browser client, for example, by double-clicking an icon corresponding to the browser client in the terminal device, so that the browser client program can be started.
S102, a browser client analyzes the browser configuration data to confirm the server address of the browser client;
in one embodiment, a website may be configured as a home page by default in a setting option of the browser, when a user starts the browser, the browser loads the designated home page, parses the URL of the home page, extracts a hostname from the URL, and sends the hostname to a Domain Name System (DNS) server for parsing to obtain an IP address corresponding to the home page, and establishes a network connection with the server where the home page is located through a TCP/IP protocol using the obtained IP address. Therefore, the server address corresponding to the browser client can be confirmed according to the browser configuration data.
S103, the first server acquires a second server address of a second server, and generates an address migration task corresponding to the second server based on the second server address;
in an embodiment, the first server is a server that needs to be swapped, and it can be understood that the currently used browser clients are all connected to the first server, and the second server is a target swapped server, that is, the browser clients all need to be connected to the second server afterwards. The first server may obtain a second server address of the second server, and configure the second server address of the second server on a background of the first server to generate an address migration task. The address migration task is used for indicating the browser client to migrate the server address to the second server, and the address migration task at least comprises the second server address of the second server. In addition, the first server may synchronize data stored in the first server to the second server.
S104, when the server address is a first server address, the browser client acquires an address migration task from a first server based on the first server address, wherein the address migration task comprises a second server address of a second server;
In an embodiment, when the server address is the first server address, the current browser client is a client that needs to migrate the server address, and may establish a connection with the first server based on the first server address, and obtain an address migration task from the first server. The address migration task is an address migration task preset by the first server, the address migration task may include a second server address of the second server, and the address migration task may include an instruction for the browser client, where the instruction is used to instruct the browser client to establish a connection with the second server according to the second server address.
It can be appreciated that when the current server address of the browser client is the second server address, it is indicated that the browser client has migrated to the second server, and the address migration task does not need to be performed.
S105, the first server issues the address migration task to a browser client so that the browser client establishes connection between the browser client and a second server based on the second server address in the address migration task;
In an embodiment, the first server may send the address migration task to the browser client, so that the browser client establishes a connection with the second server based on the second server address in the address migration task. For example, the address migration task is issued when the browser client establishes a connection with the first server. It should be noted that, the first server may issue the address migration task to all the browser clients that establish a connection with the first server, so as to ensure that all the browser clients that are originally connected to the first server are migrated to the second server. Alternatively, a target browser client list may be maintained in the first server, for recording all the browser clients connected to the first server, for example, the IP addresses of the browser clients may be recorded.
S106, the browser client establishes connection between the browser client and a second server based on the second server address;
In one embodiment, for a given second server address, the browser client attempts to establish a connection with the second server. Specifically, using the acquired IP address of the second server, the browser establishes a network connection with the second server through a TCP/IP protocol.
S108, when the browser client is successfully connected with the second server, the browser client changes the server address from the first server address to the second server address.
In an embodiment, when the browser client can be connected to the second server, the server address in the browser client can be changed to the second server address, and the browser client can be refreshed, so that the current browser client is connected to the second server according to the updated second server address, and the replacement of the server is completed.
It may be understood that when the server address is the first server address, the address migration task is obtained from the first server based on the first server address, the address migration task includes a second server address of the second server, a connection between the browser client and the second server is established based on the second server address, and when the browser client and the second server are successfully connected, the step of changing the server address from the first server address to the second server address may be implemented by adding an interface to the browser client, that is, the interface is used to obtain the address migration task and execute the address migration task.
In the embodiment of the application, browser configuration data are acquired through response of a browser client to starting operation of the browser client, the browser configuration data are analyzed to confirm a server address of the browser client, meanwhile, a first server can acquire a second server address of a second server, an address migration task corresponding to the second server is generated based on the second server address, the address migration task is issued to the browser client, when the server address is the first server address, the address migration task is acquired to the first server based on the first server address, the address migration task comprises the second server address of the second server, connection between the browser client and the second server is established based on the second server address, and when the browser client and the second server are successfully connected, the server address is changed from the first server address to the second server address. The browser client side is used for automatically switching the server address, so that the operation cost of manually modifying the server address by a user can be reduced, and meanwhile, the problem of modification failure caused by manual misoperation can be avoided by adopting an automatic switching mode, so that the success rate of server address switching is improved.
Fig. 3 is a flowchart of a method for changing a server address according to an embodiment of the present application. As shown in fig. 3, the specific flow of the server address changing method is set forth from the browser client side in the embodiment of the present application, and the method may include the following steps S201 to S205.
S201, responding to the starting operation of a browser client, and acquiring browser configuration data;
In an embodiment, the browser client side may be provided with an interface for executing the server address changing method, and the browser client side may be capable of acquiring the browser configuration data in response to a start operation of the browser client. The browser configuration data may include home page information of the browser, personalized settings of the user, plug-in and extension information, history, bookmarks, cookies, and the like.
S202, analyzing the browser configuration data to confirm the server address of the browser client;
In an embodiment, after the browser configuration data is obtained, the browser configuration data is parsed, so that a server address corresponding to the browser client is confirmed, and the browser client is connected with a corresponding server.
S203, when the server address is a first server address, the browser client acquires an address migration task from a first server based on the first server address, wherein the address migration task comprises a second server address of a second server;
In an embodiment, the first server is a server that is historically connected to the browser client, and when the server address is the first server address, the current browser client is a client that needs to migrate the server address, and may establish a connection with the first server based on the first server address, and obtain an address migration task from the first server. The address migration task is an address migration task preset by the first server, the address migration task may include a second server address of the second server, and may include an instruction for a browser client, and the browser client may be capable of performing an action of establishing a connection with the second server based on the second server address according to the address migration task.
It can be appreciated that when the current server address of the browser client is the second server address, it is indicated that the browser client has migrated to the second server, and the address migration task does not need to be performed.
S204, the browser client establishes connection between the browser client and a second server based on the second server address;
In one embodiment, for a given second server address, the browser client attempts to establish a connection with the second server. Specifically, using the acquired IP address of the second server, the browser establishes a network connection with the second server through a TCP/IP protocol.
S205, when the browser client is successfully connected with the second server, the browser client changes the server address from the first server address to the second server address.
In an embodiment, when the browser client can be connected to the second server, the server address in the browser client can be changed to the second server address, and the browser client can be refreshed, so that the current browser client is connected to the second server according to the updated second server address, and the replacement of the server is completed.
In the embodiment of the application, browser configuration data is acquired through response of a browser client to starting operation of the browser client, the browser configuration data is analyzed to confirm a server address of the browser client, when the server address is a first server address, an address migration task is acquired from the first server based on the first server address, the address migration task comprises a second server address of a second server, connection between the browser client and the second server is established based on the second server address, and when the browser client and the second server are successfully connected, the server address is changed from the first server address to the second server address. The browser client can automatically switch the server address, and the address switching is not felt by a user, so that the user experience is improved, the operation cost of manually modifying the server address by the user can be reduced, the problem of modification failure caused by manual misoperation is avoided, and the success rate of the server address switching is improved.
Fig. 4 is a flowchart of a method for changing a server address according to an embodiment of the present application. As shown in fig. 4, the specific flow of the server address changing method is set forth from the browser client side in the embodiment of the present application, and the method may include the following steps S301 to S307.
S301, responding to the starting operation of a browser client, and acquiring local cache data of the browser client;
In one embodiment, when the browser client is started, the local cache data of the browser client is first obtained, and whether the local cache data contains an address migration task is confirmed. It may be appreciated that, after the second server address of the second server is configured in the first server, when the browser client connects to the first server, the address migration task is acquired, and if the address migration task is not completed, for example, because the network problem fails to switch the server address, the incomplete address migration task may be saved to the local cache data.
S302, when an address migration task exists in the local cache data, executing a step of establishing connection between the browser client and a second server based on the second server address;
in one embodiment, when the address migration task is obtained from the local cache data, the address migration task is executed, that is, the connection between the browser client and the second server is established based on the address of the second server.
S303, executing the step of acquiring browser configuration data when the address migration task does not exist in the local cache data;
In an embodiment, when the address migration task does not exist in the local cache data, the steps of obtaining the browser configuration data, and subsequently analyzing the browser configuration data to obtain the address migration task are executed. In particular, reference may be made to steps S101 to S106 in the embodiment of the present application, which are not described herein.
S304, sending a connection request to the second server;
In one embodiment, after establishing a connection between the browser client and the second server based on the second server address is performed, a connection request is sent to the second server. For example, a simple GET request is sent as a connection request to the server. It will be appreciated that in the HTTP protocol, the browser establishes a connection with the server via the TCP/IP protocol before being able to send requests and receive responses. Before establishing a TCP connection, the browser needs to first resolve the URL address and obtain the IP address of the server. If the domain name cannot be resolved or the IP address of the server is not available, the browser cannot establish a connection with the server. At this time, the request sent by the browser may fail and prompt for a connection error.
S305, when response data returned by the second server based on the connection request is received, confirming that the browser client is successfully connected with the second server;
In an embodiment, if response data returned by the second server based on the connection request is received, it may be confirmed that the browser client and the second server are communicable. Illustratively, the response data may be a returned HTTP response status code (e.g., 200 indicates success).
Optionally, in an embodiment, when receiving response data returned by the second server based on the connection request, confirming that the connection between the browser and the second server is successful may include the following steps S3051-S3054:
S3051, when response data returned by the second server based on the connection request is received, interface verification data in the response data are obtained;
Specifically, the second server may return the interface verification data simultaneously when the response data is returned, where the interface verification data is preset in the second server, and the interface verification data is used for verifying and verifying the request and the response data. The interface verification data may include indication information, where the indication information is used to instruct the browser client to send appointment request data of the specified content.
S3052, transmitting a contract data request to the second server based on the interface verification data;
Specifically, a provisioning data request is sent to a second server based on the interface verification data. For example, the provisioning data request is generated based on the indication information in the interface verification data. The browser can use version information, equipment information, IP address and the like of the current client side to generate a contract data request, and if the browser logs in with an account, the browser can also generate the contract data request together with the user identity of the current account and send the contract data request to the second server, so that first contract data returned by the second server is obtained.
S3053, receiving first contract data returned by the second server based on the contract data request;
specifically, after receiving the provisioning data request, the second server may return first provisioning data corresponding to the provisioning data request, where the browser client receives the first provisioning data.
S3054, when the first agreement data is matched with the second agreement data indicated by the interface verification data, confirming that the browser client is successfully connected with the second server;
Specifically, if the returned first contract data is matched with the second contract data indicated by the interface verification data, the browser client is successfully connected with the second server, and if the first contract data is not matched with the second contract data, the connection between the browser client and the second server is failed.
Illustratively, the authentication is performed using a Base64 encoded username and password in the request header of the provisioning data request based on the interface verification data, i.e. "authentication: basic [ Base64 encoded username and password ]". The second server decodes and verifies the correctness of the user name and the password after receiving the request, and if the verification is successful, the second server may return some authorization information for identifying the identity and the authority of the client. This may be an access token, session ID or other authentication credential. Meanwhile, the interface verification data can comprise second contract data, and the second contract data is used for indicating that the browser client-side is successfully connected with the second server when the browser client-side receives the authorization information.
S306, reporting a connection success message to the first server based on the identifier of the browser client so that the first server can record the identifier;
In an embodiment, when the connection between the browser client and the second server is successful, the browser client may report a connection success message to the first server according to the identifier of the browser client, and the first server records the connection success message according to the identifier. The identifier of the browser client may be an IP address, an account identifier, or the like, which is not specifically limited.
S307, when the connection between the browser client and the second server fails, the address migration task is stored in the local cache data of the browser.
In an embodiment, when the connection between the browser client and the second server fails, it is indicated that the current address migration task fails to be executed, and the address migration task may be saved in the local cache data, so that when the browser client is restarted, the address migration task is obtained from the local cache data again and executed. In this way, it is not necessary to re-request the address migration service from the first server every time, and the address migration service that has been acquired can be saved locally and attempted to be re-executed at the time of restart.
Referring to fig. 5, fig. 5 is a general flowchart of a server address changing method according to an embodiment of the present application, first a browser is started, it is possible to confirm whether there is an incomplete address migration task in the local cache data, and if so, to execute the address migration task, on the other hand, browser configuration data may be obtained, parsed to identify the currently connected target server, and confirms whether there is an address migration task from the currently connected target server, it is understood that, in the step of parsing the browser configuration data, when the obtained server address is the first server address, an address migration task may be obtained from the first server, which, when resolved to a server address that is not the first server address, it may also be determined whether an address migration task is received, that is, when the browser client may determine whether to execute the address migration task by determining whether the address migration task can be received from the connected server; if there is an address migration task, the address migration task is executed to confirm whether the connection with the second server is successful, if so, the method comprises the steps that a server address can be migrated from a first server address to a second server address, a connection success message is reported to the first server, the server address is switched to the second server address, and a browser client-side re-pulls browser configuration data to connect a browser to the second server; when the connection with the second server fails, the method comprises the steps that connection failure information can be reported to a first server, an address migration task is cached to local cache data, and a user can normally use a current browser; alternatively, the reporting of the connection failure message may not be performed at present.
In the embodiment of the application, the local cache data of the browser client is obtained by responding to the starting operation of the browser client, when the address migration task exists in the local cache data, the step of establishing the connection between the browser client and the second server based on the second server address is executed, and when the address migration task does not exist in the local cache data, the step of obtaining the browser configuration data is executed. Sending a connection request to a second server, and when response data returned by the second server based on the connection request is received, confirming that the browser client and the second server are successfully connected, and reporting a connection success message to a first server based on an identifier of the browser client so as to enable the first server to record the identifier; and when the connection between the browser client and the second server fails, storing the address migration task into the local cache data of the browser. Whether the incomplete address migration task exists or not is confirmed in the local cache data of the browser client, if yes, the address migration task is directly executed, resource waste caused by repeated acquisition is avoided, if no address migration task exists, the address migration task is acquired from the first server, the second server is connected with the address migration task according to the address of the second server, a connection request is sent to the second server, whether connection with the second server is successfully established or not is confirmed according to whether response data of the second server are received or not, and therefore a connection result is confirmed rapidly. In addition, when the connection is successful, the connection success message can be fed back to the first server according to the identification of the browser client, so that the first server can be shut down in time when all the browser clients are migrated to the second server based on the connection success message, the cost for maintaining the first server is reduced, and the server hardware is saved.
Fig. 5 is a flowchart of a method for changing a server address according to an embodiment of the present application. As shown in fig. 5, the embodiment of the present application sets forth a specific flow of a server address modification method from the first server side, and the method may include the following steps S401 to S402.
S401, receiving a successful connection message sent by the browser client, and recording the successful connection message based on the identification of the browser client in the successful connection message;
In an embodiment, the first server may receive a successful connection message sent by the browser client, record the successful connection message according to the identifier in the successful connection message, that is, may maintain a target identifier list in the first server, where all identifiers of the browser client connected to the first server may be stored in the target identifier list, and the successful connection message includes the identifiers, so that the successful connection message may be correspondingly stored and recorded.
And S402, when each identifier in the target identifier set corresponds to a connection success message, the first server is shut down, and the target identifier set is an identifier set of a browser client connected with the first server.
In an embodiment, if each identifier in the target identifier set corresponds to a connection success message, the first server is turned off, that is, after the first server confirms that all the browser clients connected to the first server are connected to the second server, the first server may be turned off, and the second server is used instead.
In the embodiment of the application, the first server receives the successful connection message sent by the browser client and records according to the identifiers, and confirms whether each identifier in the target identifier set has the successful connection message, and when all the browser clients are migrated to the second server, the server can be shut down, and the second server is used instead, so that a plurality of servers do not need to be maintained all the time, and the maintenance cost of the server is reduced.
The server address changing device according to the embodiment of the present application will be described in detail with reference to fig. 6 to 7. It should be noted that, the server address changing device in fig. 6-7 is used to execute the method of the embodiment shown in fig. 2-5 of the present specification, for convenience of explanation, only the portion relevant to the embodiment of the present application is shown, and specific technical details are not disclosed, please refer to the embodiment shown in fig. 2-5 of the present specification.
Referring to fig. 6, a schematic structural diagram of a server address changing device according to an exemplary embodiment of the present application is shown. The server address changing means may be implemented as all or part of the device by software, hardware or a combination of both. The device 1 comprises a configuration acquisition module 11, a parsing module 12, a requesting module 13, a connection switching module 14 and an address modification module 15.
A configuration obtaining module 11, configured to obtain browser configuration data in response to a start operation of a browser client;
a parsing module 12, configured to parse the browser configuration data to confirm a server address of the browser;
A request module 13, configured to obtain, when the server address is a first server address, an address migration task from a first server based on the first server address, where the address migration task includes a second server address of a second server;
a connection switching module 14, configured to establish a connection between the browser client and a second server based on the second server address;
and the address modification module 15 is configured to modify the server address from the first server address to the second server address when the browser client is successfully connected to the second server.
Optionally, the configuration obtaining module 11 is further configured to obtain local cache data of the browser client;
When an address migration task exists in the local cache data, executing a step of establishing connection between the browser client and a second server based on the second server address;
and executing the step of acquiring the browser configuration data when the address migration task does not exist in the local cache data.
Optionally, the address modification module 15 is further configured to send a connection request to the second server;
and when response data returned by the second server based on the connection request is received, confirming that the browser client is successfully connected with the second server.
Optionally, the address modification module 15 is specifically configured to, when receiving response data returned by the second server based on the connection request, obtain interface verification data in the response data;
Transmitting a provisioning data request to the second server based on the interface verification data;
Receiving first contract data returned by the second server based on the contract data request;
And when the first appointment data is matched with the second appointment data indicated by the interface verification data, confirming that the browser client is successfully connected with the second server.
Optionally, the connection switching module 14 is further configured to store the address migration task in the locally cached data of the browser when the connection between the browser client and the second server fails.
Optionally, the address modification module 15 is further configured to report a connection success message to the first server based on the identifier of the browser client, so that the first server records the identifier.
Further, the server address changing apparatus shown with reference to fig. 7 may be implemented as all or a part of the apparatus by software, hardware, or a combination of both. The device 2 comprises an address acquisition module 21 and a task sending module 22.
An address obtaining module 21, configured to obtain a second server address of a second server, and generate an address migration task corresponding to the second server based on the second server address;
And the task sending module 22 is configured to send the address migration task to a browser client, so that the browser client establishes a connection between the browser client and a second server based on a second server address in the address migration task.
Optionally, the task sending module 22 is further configured to receive a successful connection message sent by the browser client, and record the successful connection message based on an identifier of the browser client in the successful connection message;
and when each identifier in the target identifier set corresponds to a connection success message, shutting down the first server, wherein the target identifier set is an identifier set of a browser client connected with the first server.
It should be noted that, when the server address changing device provided in the foregoing embodiment performs the server address changing method, only the division of the foregoing functional modules is used as an example, in practical application, the foregoing functional allocation may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the server address changing device and the server address changing method provided in the foregoing embodiments belong to the same concept, which embody the detailed implementation process in the method embodiment, and are not described herein again.
The foregoing embodiment numbers of the present application are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
The embodiment of the present application further provides a storage medium, where a computer program is stored, where the computer program when executed by a processor implements the method of the embodiment shown in fig. 2 to 5, and the specific execution process may refer to the specific description of the embodiment shown in fig. 2 to 5, which is not repeated herein.
Referring to fig. 8, a schematic structural diagram of an electronic device according to an exemplary embodiment of the present disclosure is shown. An electronic device in this specification may include one or more of a processor 110, a memory 120, an input device 130, an output device 140, and a bus 150. The processor 110, the memory 120, the input device 130, and the output device 140 may be connected by a bus 150.
Processor 110 may include one or more processing cores. The processor 110 connects various parts within the overall electronic device using various interfaces and lines, performs various functions of the terminal 100 and processes data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 120, and invoking data stored in the memory 120. Alternatively, the processor 110 may be implemented in at least one hardware form of digital signal Processing (DIGITAL SIGNAL Processing, DSP), field-Programmable gate array (Field-Programmable GATE ARRAY, FPGA), programmable logic array (Programmable Logic Array, PLA). The processor 110 may integrate one or a combination of several of a central processing unit (Central Processing Unit, CPU), an image processor (Graphics Processing Unit, GPU), a modem, etc. The CPU mainly processes an operating system, a user page, an application program and the like, the GPU is used for rendering and drawing display contents, and the modem is used for processing wireless communication. It will be appreciated that the modem may not be integrated into the processor 110 and may be implemented solely by a single communication chip.
The memory 120 may include a random access memory (Random Access Memory, RAM) or a Read-only memory (ROM). Optionally, the memory 120 includes a Non-transitory computer readable medium (Non-Transitory Computer-Readable Storage Medium). Memory 120 may be used to store instructions, programs, code, sets of codes, or sets of instructions. The memory 120 may include a stored program area and a stored data area, where the stored program area may store instructions for implementing an operating system, which may be an Android (Android) system, including an Android system-based deep development system, an IOS system developed by apple corporation, including an IOS system-based deep development system, or other systems, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing the various method embodiments described above, and so forth.
Memory 120 may be divided into an operating system space in which the operating system runs and a user space in which native and third party applications run. In order to ensure that different third party application programs can achieve better operation effects, the operating system allocates corresponding system resources for the different third party application programs. However, the requirements of different application scenes in the same third party application program on system resources are different, for example, the third party application program has higher requirements on disk reading speed in a local resource loading scene, and the third party application program has higher requirements on GPU performance in an animation rendering scene. The operating system and the third party application program are mutually independent, and the operating system often cannot timely sense the current application scene of the third party application program, so that the operating system cannot perform targeted system resource adaptation according to the specific application scene of the third party application program.
In order to enable the operating system to distinguish specific application scenes of the third-party application program, data communication between the third-party application program and the operating system needs to be communicated, so that the operating system can acquire current scene information of the third-party application program at any time, and targeted system resource adaptation is performed based on the current scene.
The input device 130 is configured to receive input instructions or data, and the input device 130 includes, but is not limited to, a keyboard, a mouse, a camera, a microphone, or a touch device. The output device 140 is used to output instructions or data, and the output device 140 includes, but is not limited to, a display device, a speaker, and the like. In one example, the input device 130 and the output device 140 may be combined, and the input device 130 and the output device 140 are touch display screens.
The touch display screen may be designed as a full screen, a curved screen, or a contoured screen. The touch display screen may also be designed as a combination of a full screen and a curved screen, and the combination of a special-shaped screen and a curved screen, which is not limited in the embodiment of the present application.
In addition, those skilled in the art will appreciate that the configuration of the electronic device shown in the above-described figures does not constitute a limitation of the electronic device, and the electronic device may include more or less components than illustrated, or may combine certain components, or may have a different arrangement of components. For example, the electronic device further includes components such as a radio frequency circuit, an input unit, a sensor, an audio circuit, a WiFi module, a power supply, and a bluetooth module, which are not described herein.
In the electronic device shown in fig. 8, the processor 110 may be configured to invoke a computer application program stored in the memory 120 and specifically perform the following operations:
Responding to the starting operation of the browser client, and acquiring browser configuration data;
Analyzing the browser configuration data to confirm the server address of the browser client;
When the server address is a first server address, acquiring an address migration task from a first server based on the first server address, wherein the address migration task comprises a second server address of a second server;
establishing a connection between the browser client and a second server based on the second server address;
and when the browser client is successfully connected with the second server, changing the server address from the first server address to the second server address.
In one embodiment, the processor 110, prior to executing the obtaining browser configuration data, further performs the following:
Acquiring local cache data of the browser client;
When an address migration task exists in the local cache data, executing a step of establishing connection between the browser client and a second server based on the second server address;
and executing the step of acquiring the browser configuration data when the address migration task does not exist in the local cache data.
In one embodiment, the processor 110, when executing when the browser client is successfully connected to the second server, further performs the following operations:
sending a connection request to the second server;
and when response data returned by the second server based on the connection request is received, confirming that the browser client is successfully connected with the second server.
In one embodiment, the processor 110, when receiving the response data returned by the second server based on the connection request, confirms that the connection between the browser and the second server is successful, specifically performs the following operations:
when receiving response data returned by the second server based on the connection request, acquiring interface verification data in the response data;
Transmitting a provisioning data request to the second server based on the interface verification data;
Receiving first contract data returned by the second server based on the contract data request;
And when the first appointment data is matched with the second appointment data indicated by the interface verification data, confirming that the browser client is successfully connected with the second server.
In one embodiment, the processor 110, after performing the establishing the connection of the browser client to the second server based on the second server address, further performs the following operations:
and when the connection between the browser client and the second server fails, storing the address migration task into the local cache data of the browser.
In one embodiment, the processor 110 further performs the following operations after performing when the browser client is successfully connected to the second server:
and reporting a connection success message to the first server based on the identifier of the browser client so that the first server can record the identifier.
In one embodiment, the processor 110 may be configured to invoke a computer application stored in the memory 120 and specifically:
Acquiring a second server address of a second server, and generating an address migration task corresponding to the second server based on the second server address;
and transmitting the address migration task to a browser client so that the browser client establishes connection between the browser client and a second server based on the second server address in the address migration task.
In one embodiment, the processor 110 may also perform the following operations:
receiving a successful connection message sent by the browser client, and recording the successful connection message based on the identification of the browser client in the successful connection message;
and when each identifier in the target identifier set corresponds to a connection success message, shutting down the first server, wherein the target identifier set is an identifier set of a browser client connected with the first server.
In the embodiment of the application, browser configuration data is acquired through response of a browser client to starting operation of the browser client, the browser configuration data is analyzed to confirm a server address of the browser client, when the server address is a first server address, an address migration task is acquired from the first server based on the first server address, the address migration task comprises a second server address of a second server, connection between the browser client and the second server is established based on the second server address, and when the browser client and the second server are successfully connected, the server address is changed from the first server address to the second server address. The browser client side is used for automatically switching the server address, so that the operation cost of manually modifying the server address by a user can be reduced, and meanwhile, the problem of modification failure caused by manual misoperation can be avoided by adopting an automatic switching mode, so that the success rate of server address switching is improved.
Further, by responding to the starting operation of the browser client, the local cache data of the browser client is obtained, when the address migration task exists in the local cache data, the step of establishing connection between the browser client and the second server based on the second server address is executed, and when the address migration task does not exist in the local cache data, the step of obtaining the browser configuration data is executed. Sending a connection request to a second server, and when response data returned by the second server based on the connection request is received, confirming that the browser client and the second server are successfully connected, and reporting a connection success message to a first server based on an identifier of the browser client so as to enable the first server to record the identifier; and when the connection between the browser client and the second server fails, storing the address migration task into the local cache data of the browser. Whether the incomplete address migration task exists or not is confirmed in the local cache data of the browser client, if yes, the address migration task is directly executed, resource waste caused by repeated acquisition is avoided, if no address migration task exists, the address migration task is acquired from the first server, the second server is connected with the address migration task according to the address of the second server, a connection request is sent to the second server, whether connection with the second server is successfully established or not is confirmed according to whether response data of the second server are received or not, and therefore a connection result is confirmed rapidly. In addition, when the connection is successful, the connection success message can be fed back to the first server according to the identification of the browser client, so that the first server can be shut down in time when all the browser clients are migrated to the second server based on the connection success message, the cost for maintaining the first server is reduced, and the server hardware is saved.
Further, the first server receives the successful connection message sent by the browser client, records according to the identifiers, and confirms whether each identifier in the target identifier set has the connection success message, when all the browser clients are migrated to the second server, the server can be shut down, the second server is used instead, a plurality of servers do not need to be maintained all the time, and the maintenance cost of the server is reduced.
Those skilled in the art will appreciate that implementing all or part of the above-described methods in accordance with the embodiments may be accomplished by way of a computer program stored on a computer readable storage medium, which when executed may comprise the steps of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a random-access Memory (Random Access Memory, RAM), or the like.
The foregoing disclosure is only illustrative of the preferred embodiments of the present invention and is not to be construed as limiting the scope of the claims, which follow the meaning of the claims of the present invention.

Claims (10)

1. A server address changing method, applied to a browser client, comprising:
Responding to the starting operation of the browser client, and acquiring browser configuration data;
Analyzing the browser configuration data to confirm the server address of the browser client;
When the server address is a first server address, acquiring an address migration task from a first server based on the first server address, wherein the address migration task comprises a second server address of a second server;
establishing a connection between the browser client and a second server based on the second server address;
and when the browser client is successfully connected with the second server, changing the server address from the first server address to the second server address.
2. The method of claim 1, wherein prior to obtaining the browser configuration data, further comprising:
Acquiring local cache data of the browser client;
When an address migration task exists in the local cache data, executing a step of establishing connection between the browser client and a second server based on the second server address;
and executing the step of acquiring the browser configuration data when the address migration task does not exist in the local cache data.
3. The method of claim 1, wherein when the browser client is successfully connected to the second server, further comprising:
sending a connection request to the second server;
and when response data returned by the second server based on the connection request is received, confirming that the browser client is successfully connected with the second server.
4. The method of claim 1, wherein after the browser client is successfully connected to the second server, further comprising:
and reporting a connection success message to the first server based on the identifier of the browser client so that the first server can record the identifier.
5. A server address changing method, applied to a first server, comprising:
Acquiring a second server address of a second server, and generating an address migration task corresponding to the second server based on the second server address;
and transmitting the address migration task to a browser client so that the browser client establishes connection between the browser client and a second server based on the second server address in the address migration task.
6. The method of claim 5, wherein the method further comprises:
receiving a successful connection message sent by the browser client, and recording the successful connection message based on the identification of the browser client in the successful connection message;
and when each identifier in the target identifier set corresponds to a connection success message, shutting down the first server, wherein the target identifier set is an identifier set of a browser client connected with the first server.
7. A server address changing apparatus, the apparatus comprising:
the configuration acquisition module is used for responding to the starting operation of the browser client and acquiring browser configuration data;
the analyzing module is used for analyzing the browser configuration data to confirm the server address of the browser;
The request module is used for acquiring an address migration task from a first server based on the first server address when the server address is the first server address, wherein the address migration task comprises a second server address of a second server;
The connection switching module is used for establishing connection between the browser client and the second server based on the second server address;
And the address modification module is used for modifying the server address from the first server address to the second server address when the browser client is successfully connected with the second server.
8. A server address changing apparatus, the apparatus comprising:
the address acquisition module is used for acquiring a second server address of a second server and generating an address migration task corresponding to the second server based on the second server address;
and the task sending module is used for sending the address migration task to the browser client so that the browser client can establish connection between the browser client and the second server based on the second server address in the address migration task.
9. An electronic device comprising a processor and a memory, wherein the memory stores a computer program adapted to be loaded by the processor and to perform the steps of the method according to any of claims 1 to 6.
10. A storage medium storing a computer program, which when executed by a processor performs the steps of the method according to any one of claims 1 to 6.
CN202311717801.5A 2023-12-13 2023-12-13 Server address changing method, device, electronic device and storage medium Pending CN120151324A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311717801.5A CN120151324A (en) 2023-12-13 2023-12-13 Server address changing method, device, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311717801.5A CN120151324A (en) 2023-12-13 2023-12-13 Server address changing method, device, electronic device and storage medium

Publications (1)

Publication Number Publication Date
CN120151324A true CN120151324A (en) 2025-06-13

Family

ID=95953226

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311717801.5A Pending CN120151324A (en) 2023-12-13 2023-12-13 Server address changing method, device, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN120151324A (en)

Similar Documents

Publication Publication Date Title
US10764430B2 (en) Calling an unready terminal
US8909705B2 (en) Method and system for use in providing network services interchange
EP2589179B1 (en) Apparatus and method for controlling access to multiple services
US20020124100A1 (en) Method and apparatus for access to, and delivery of, multimedia information
CN111143207B (en) Method for checking model training notice and training log at mobile terminal
CN110231965B (en) Cloud device, application processing method and electronic device
CN113347242A (en) Cross-device resource access method, device, storage medium and electronic device
WO2020206660A1 (en) Network resource request method and apparatus, electronic device and storage medium
CN104536890A (en) Testing system, method and device
CN109302437B (en) Method and device for redirecting website
US20140019957A1 (en) Method, apparatus, and system for sharing software among terminals
CN113572862A (en) Cluster deployment method and device, electronic equipment and storage medium
US20230419067A1 (en) ENHANCED QUICK RESPONSE (qr) CODE SCAN SECURITY
CN106911666B (en) Wearable intelligent device and message processing method and system thereof
US9838464B2 (en) Remote access to content from a thin client
CN109327530A (en) A kind of information processing method, device, electronic equipment and storage medium
CN113949631B (en) Client disaster recovery processing method, system and electronic equipment
CN115080265A (en) Application relay method, device, system, electronic equipment, computer readable storage medium and computer program product
CN104104701A (en) Online service configuration updating method and system
RU2596588C2 (en) System and method for activation of mobile device for communication initiating
CN113626789A (en) User operation request processing method and device and electronic equipment
WO2015003570A1 (en) Data downloading method,device and system thereof
CN110673970B (en) Cross-process calling system and method based on web application
CN107979655A (en) Access control method, access control apparatus and access device
CN120151324A (en) Server address changing method, device, electronic device and storage medium

Legal Events

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