Method and device for upgrading server
By comparing new and old version files on the service management side, determining the difference files as update files, and sending update files according to the server load to deploy new version services, the problem of low efficiency of server upgrades in the existing technology is solved, and rapid Economical service-side upgrade.
Patent Information
- Application Number
- CN202311037362.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-16
- Publication Date
- 2025-02-21
AI Technical Summary
In the prior art, server-side upgrades require clients to deploy and upgrade themselves, resulting in long time periods, low efficiency, and low user viscosity.
By obtaining the update file of the new version of the service on the service management side and comparing it with the old version file, determining the difference file as an update file, sending a version update message to the registered server, generating a file to obtain a request based on the load, and sending an update Files to deploy new version of the service and provide services through path switching.
It realizes rapid upgrade of the server, avoids the cumbersome upgrade process of the client, improves the upgrade efficiency, reduces the amount of data transmission, reduces the cost, and achieves the second-level upgrade.
Smart Images

Figure CN119496704A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a server-side upgrade method and device. Background Art
[0002] With the rapid development of computer technology, various services emerge in an endless stream. In order to improve the quality of services, it is necessary to continuously iterate and update services. In the prior art, new versions of services are generally provided to customers for iteration, that is, the services, deployment scripts and documents are packaged and sent to the client, allowing the client to deploy and upgrade by itself.
[0003] However, providing new versions of services to customers for iteration requires the client to receive the service and update it, which takes a long time. In addition, the service is usually updated only when the user uses it, which results in low efficiency and low user stickiness. Therefore, an effective solution is urgently needed to solve the above problems. Summary of the invention
[0004] In view of the problems existing in the prior art, an embodiment of the present invention provides a method and device for upgrading a server.
[0005] The present invention provides a server upgrade method, which is applied to a service management end and includes:
[0006] When a new version of the service is obtained, a version update message is sent to each registered server;
[0007] receiving a first file acquisition request sent by a first server, where the first file acquisition request is generated based on the version update message and the load of the first server, and the first server is any server;
[0008] The update file corresponding to the new version service is sent to the first server, so that the first server deploys the new version service and provides the new version service to the client corresponding to the first server through path switching.
[0009] According to a server upgrade method provided by the present invention, before sending the update file corresponding to the new version service to the first server, the method further includes:
[0010] Obtain a new version file of the new version service;
[0011] Compare the new version file with the old version file to determine the difference file between the new version file and the old version file;
[0012] An update file corresponding to the new version service is determined according to the difference file.
[0013] According to a server upgrade method provided by the present invention, the step of comparing the new version file with the old version file to determine a difference file between the new version file and the old version file includes:
[0014] Performing hash processing on the new version file and the old version file respectively to obtain a first hash value of the new version file and a second hash value of the old version file;
[0015] The first Hash value and the second Hash value are compared to determine a difference file between the new version file and the old version file.
[0016] According to a server upgrade method provided by the present invention, before sending the update file corresponding to the new version service to the first server, the method further includes:
[0017] Acquire first location information of the first server;
[0018] Determining, according to the first location information, whether there is a second server among other servers that have received the update file;
[0019] Accordingly, sending the update file corresponding to the new version service to the first server includes:
[0020] If not, sending the update file corresponding to the new version service to the first server;
[0021] After determining, according to the first location information, whether there is a second server among other servers that have received the update file, the method further includes:
[0022] If so, the first identifier of the second server is sent to the first server, so that the first server obtains the update file from the second server according to the first identifier.
[0023] According to a server upgrade method provided by the present invention, the determining, based on the first location information, whether there is a second server among other servers that have received the update file includes:
[0024] Determine the service area of the first server according to the first location information;
[0025] It is determined whether there is a second server in the service area that has received the update file.
[0026] A server upgrade method provided by the present invention is applied to a first server, comprising:
[0027] Receiving a version update message sent by a service management terminal, wherein the version update message is generated based on a new version service;
[0028] In response to the version update message, monitor the current load, and when the load reaches a set load condition, send a first file acquisition request to the service management end;
[0029] Receive an update file corresponding to the new version service, where the update file is obtained by the service management end in response to the first file acquisition request;
[0030] The new version service is deployed according to the update file, and the new version service is provided to the client corresponding to the first server through path switching.
[0031] According to a server upgrade method provided by the present invention, after deploying the new version service according to the update file and providing the new version service to the client corresponding to the first server through path switching, the method further includes:
[0032] In response to the version switching request sent by the client, the path of the new version service is switched to the path of the old version service, and the old version service is provided to the client.
[0033] According to a server upgrade method provided by the present invention, the receiving of an update file corresponding to the new version service includes:
[0034] Receive a first identifier of a second server sent by the service management end, where the second server is another server that has received the update file and is determined by the service management end based on first location information of the first server, where the first location information is determined by the service management end based on the first file acquisition request;
[0035] According to the first identifier of the second server, a second file acquisition request is sent to the second server, and an update file corresponding to the new version service fed back by the second server based on the second file acquisition request is received.
[0036] A server upgrade method provided by the present invention further includes:
[0037] Receive a third file acquisition request sent by a third server, the third file acquisition request is sent based on the second identifier of the first server, the first server is determined by the service management end based on the second location information of the third server, the second location information is determined by the service management end based on a fourth file acquisition request sent by the third server, the fourth file acquisition request is generated based on the version update message and the load of the third server;
[0038] The update file is sent to the third server.
[0039] The present invention also provides a server upgrade device, which is applied to a service management terminal and includes:
[0040] A first sending module is configured to send a version update message to each registered server when a new version service is obtained;
[0041] A first receiving module is configured to receive a first file acquisition request sent by a first server, wherein the first file acquisition request is generated based on the version update message and the load of the first server, and the first server is any server;
[0042] The second sending module is configured to send the update file corresponding to the new version service to the first server, so that the first server deploys the new version service and provides the new version service to the client corresponding to the first server through path switching.
[0043] According to a server-side upgrade device provided in the present invention, it also includes a first determination module, which is configured to obtain a new version file of the new version service; compare the new version file with the old version file to determine a difference file between the new version file and the old version file; and determine an update file corresponding to the new version service based on the difference file.
[0044] According to a server-side upgrade device provided by the present invention, the first determination module is further configured to perform hash processing on the new version file and the old version file respectively to obtain a first hash value of the new version file and a second hash value of the old version file; compare the first hash value and the second hash value to determine the difference file between the new version file and the old version file.
[0045] According to the present invention, a server upgrade device further includes a judgment module configured to obtain first location information of the first server; and judge whether there is a second server among other servers that have received the update file according to the first location information;
[0046] Accordingly, the second sending module is further configured to, if not, send the update file corresponding to the new version service to the first server;
[0047] The upgrade device of the server side also includes a third sending module, which is configured to send the first identifier of the second server side to the first server side, so that the first server side obtains the update file from the second server side according to the first identifier.
[0048] According to a server upgrade device provided by the present invention, the judgment module is further configured to determine the service area where the first server is located according to the first location information; and judge whether there is a second server that has received the update file in the service area.
[0049] The present invention also provides a server upgrade device, which is applied to a first server, and includes:
[0050] A second receiving module is configured to receive a version update message sent by the service management terminal, wherein the version update message is generated based on the new version service;
[0051] A monitoring module, configured to monitor a current load in response to the version update message, and send a first file acquisition request to the service management end when the load reaches a set load condition;
[0052] A third receiving module is configured to receive an update file corresponding to the new version service, where the update file is obtained by the service management end in response to the first file acquisition request;
[0053] The deployment module is configured to deploy the new version service according to the update file and provide the new version service to the client corresponding to the first server through path switching.
[0054] A server upgrade device provided according to the present invention also includes a switching module, which is configured to switch the path of the new version service to the path of the old version service in response to a version switching request sent by the client, and provide the old version service to the client.
[0055] According to an upgrade device of a server provided by the present invention, the third receiving module is further configured to receive a first identifier of a second server sent by the service management end, the second server being another server that has received the update file and determined by the service management end based on the first location information of the first server, the first location information being determined by the service management end based on the first file acquisition request; according to the first identifier of the second server, a second file acquisition request is sent to the second server, and the update file corresponding to the new version of the service that is fed back by the second server based on the second file acquisition request is received.
[0056] According to an upgrade device of a server provided by the present invention, it also includes a fourth receiving module, which is configured to receive a third file acquisition request sent by a third server, the third file acquisition request is sent based on the second identifier of the first server, the first server is determined by the service management end based on the second location information of the third server, the second location information is determined by the service management end based on a fourth file acquisition request sent by the third server, the fourth file acquisition request is generated based on the version update message and the load of the third server; and the update file is sent to the third server.
[0057] The present invention also provides a server upgrade system, comprising:
[0058] A service management terminal and at least one server terminal;
[0059] The service management end is used to send version update messages to all registered servers when a new version of the service is obtained;
[0060] A first server end is used to receive a version update message sent by a service management end; in response to the version update message, monitor the current load, and when the load reaches a set load condition, send a first file acquisition request to the service management end, wherein the first server end is any server end;
[0061] The service management end is further used to receive a first file acquisition request sent by the first server end; and send an update file corresponding to the new version service to the first server end;
[0062] The first server is further configured to receive an update file corresponding to the new version service, deploy the new version service according to the update file, and provide the new version service to a client corresponding to the first server through path switching.
[0063] According to a server upgrade system provided by the present invention, the service management end is further used to obtain a new version file of the new version service; compare the new version file with the old version file to determine a difference file between the new version file and the old version file; and determine an update file corresponding to the new version service based on the difference file.
[0064] According to a server upgrade system provided by the present invention, the service management end is further used to perform hash processing on the new version file and the old version file respectively to obtain a first hash value of the new version file and a second hash value of the old version file; compare the first hash value and the second hash value to determine the difference file between the new version file and the old version file.
[0065] According to a server upgrade system provided by the present invention, the service management end is further used to obtain first location information of the first server; based on the first location information, determine whether there is a second server among other servers that have received the update file; if not, send the update file corresponding to the new version of the service to the first server.
[0066] According to a server upgrade system provided by the present invention, the service management end is further used to send the first identifier of the second server to the first server if:
[0067] The first server is further used to receive the first identifier of the second server sent by the service management end; send a second file acquisition request to the second server according to the first identifier of the second server, and receive the update file corresponding to the new version of the service fed back by the second server based on the second file acquisition request.
[0068] According to a server upgrade system provided by the present invention, the service management end is further used to determine the service area where the first server is located according to the first location information; and determine whether there is a second server that has received the update file in the service area.
[0069] According to a server upgrade system provided by the present invention, the first server is further used to switch the path of the new version service to the path of the old version service in response to a version switching request sent by the client, and provide the old version service to the client.
[0070] According to a server upgrade system provided by the present invention, the first server is further used to receive a third file acquisition request sent by a third server, the third file acquisition request is sent based on the second identifier of the first server, the first server is determined by the service management end based on the second location information of the third server, the second location information is determined by the service management end based on a fourth file acquisition request sent by the third server, the fourth file acquisition request is generated based on the version update message and the load of the third server; and the update file is sent to the third server.
[0071] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, an upgrade method for the server as described above is implemented.
[0072] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the server upgrade method described in any one of the above methods is implemented.
[0073] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above-mentioned server upgrade methods.
[0074] The upgrade method of the server provided by the present invention sends a version update message to each registered server when a new version of the service is obtained; receives a first file acquisition request sent by a first server, the first file acquisition request is generated based on the version update message and the load of the first server, and the first server is any server; sends the update file corresponding to the new version of the service to the first server, so that the first server deploys the new version of the service and provides the new version of the service to the client corresponding to the first server through path switching. The present invention pushes the update file of the new version of the service to the server in idle time by preloading, that is, the server generates a first file acquisition request based on the load to pull the update file. When the customer has a version upgrade demand, it only needs to switch the traffic to the new version and use it directly, avoiding the delivery of service upgrades to customer upgrades, freeing users from tedious and complicated operations, improving upgrade efficiency, reducing data transmission for version upgrades, reducing the cost of version upgrades, and achieving upgrades in seconds. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0076] Figure 1 This is one of the flow charts of the upgrade method of the server provided by the present invention;
[0077] Figure 2 This is the second flow chart of the upgrade method of the server provided by the present invention;
[0078] Figure 3 This is the third flow chart of the upgrade method of the server provided by the present invention;
[0079] Figure 4 This is the fourth flow chart of the upgrade method of the server provided by the present invention;
[0080] Figure 5 This is one of the structural schematic diagrams of the upgrade device of the server provided by the present invention;
[0081] Figure 6This is the second structural diagram of the upgrade device of the server provided by the present invention;
[0082] Figure 7 It is a structural diagram of the upgrade system of the server provided by the present invention;
[0083] Figure 8 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0084] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0085] Combine the following Figure 1-Figure 4 The upgrade method of the server of the present invention is described.
[0086] Figure 1 This is one of the flow charts of the upgrade method of the server provided by the present invention, see Figure 1 As shown, it is applied to the service management end, including steps 101 to 103, wherein:
[0087] Step 101: When a new version of a service is obtained, a version update message is sent to each registered server.
[0088] First of all, it should be explained that the execution subject of the present invention can be a service management terminal, and the service management terminal can be an electronic device, for example, it can be any one of a smart phone, a smart watch, a desktop computer, a laptop computer, etc.
[0089] Specifically, the new version service is the service after iterative update. The service management end refers to the management platform that provides services. The server end refers to the server end that provides services to the client, which can be a server or a server cluster. In order to ensure the stability of the server end, avoid server crashes, and provide users with higher service quality, preferably, the server end adopts the form of a server cluster. The version update message refers to a message indicating that the version of the service has been updated or needs to be updated.
[0090] In actual applications, maintenance personnel who develop or update services update or iterate the service version, and then publish the new version of the service on the service management end, or upload the new version file of the new version of the service to the service management end. Accordingly, the service management end obtains the new version of the service or the new version file of the new version of the service. At this time, the service management end retrieves the registration data of the management backend, determines all registered servers, and then broadcasts the service version update message to each registered server.
[0091] It should be noted that before sending version update messages to registered servers, the service management end will receive a registration request from any server, which carries the server's ID and qualifications. The service management end will review the server's qualifications: if the qualifications meet the registration requirements, the server's ID will be saved to the management backend, and a registration success message will be fed back to the server; if the qualifications do not meet the registration requirements, the server's ID will be discarded, and a registration failure message will be fed back to the server.
[0092] In addition, the registration request may also include at least one of the application time, application time limit, and validity period. If the qualifications meet the registration conditions, the service management end saves at least one of the application time, application time limit, and validity period, and returns the application time limit and / or validity period to the server together with the registration success message. Alternatively, if the qualifications are reviewed and approved, the service management end determines the validity period of the server registration based on the qualifications of the server, and returns the validity period to the server together with the registration success message.
[0093] Furthermore, in the case of exceeding the validity period, that is, the registration expires, the service management end can delete the identification of the server from the management background, and feedback the registration invalidation information to the server, so that the server can re-register. Alternatively, at a set time before the validity period, such as one week before the validity period, the service management end sends a deadline reminder message to the server, so that the server can apply for an extension of the validity period.
[0094] Step 102: Receive a first file acquisition request sent by a first server, where the first file acquisition request is generated based on the version update message and the load of the first server, and the first server is any server.
[0095] Specifically, a file acquisition request refers to a request for acquiring a new version of a service. Load capacity refers to the capacity of a service provided by a server to a client.
[0096] In actual applications, any of the registered servers, namely the first server, monitors the load of the server, that is, the amount of service provided to the client, after receiving the version update message. When the load reaches the set condition, a first file acquisition request is generated based on the version update message: for example, the version update message carries the version number of the new version, and the first server generates a first file acquisition request carrying the version number of the new version. Then, the first server sends the first file acquisition request to the service management end. Accordingly, the service management end receives the first file acquisition request sent by the first server.
[0097] It should be noted that the first server can generate a first file acquisition request when the load is lower than a set threshold; it can generate a first file acquisition request when the load is lower than the set threshold for a period longer than a set period; it can also generate a first file acquisition request in a non-working period, such as from midnight to 5 a.m., when the load is lower.
[0098] Step 103: Send the update file corresponding to the new version service to the first server, so that the first server deploys the new version service and provides the new version service to the client corresponding to the first server through path switching.
[0099] Specifically, the update file refers to a file used to update the version of the service, that is, a file used to deploy a new version of the service. Path switching refers to switching the access address.
[0100] In actual applications, based on receiving the first file acquisition request sent by the first server, the service management end responds to the first file acquisition request, organizes the new version file of the new version service, obtains the update file corresponding to the new version service, and feeds back the update file corresponding to the new version service to the first server. After receiving the update file corresponding to the new version service, the first server deploys the new version service on the first server according to the update file corresponding to the new version service, and provides the new version service to the client while providing services to the client corresponding to the first server. The client corresponding to the first server is a client registered with the first server or a client associated with the first server for service.
[0101] Specifically, when the client corresponding to the first server accesses the first server through a browser, the first server switches the path associated with the service URL to the path of the new version of the service. Accordingly, the first server can provide the client with the new version of the service. That is, the first server provides the client with the new version of the service by switching the path of the old version of the service associated with the service URL to the path of the new version of the service.
[0102] Optionally, the first file acquisition request may also include an identifier of the first service end, so that the service management end can identify whether the first file acquisition request is a valid request: the identifier carried in the first file acquisition request is matched with the identifier stored in the management backend. If the match is successful, the first file acquisition request is determined to be a valid request, and a response to the first file acquisition request is required; if the match fails, whether the first file acquisition request is a valid request, there is no need to respond to the first file acquisition request. In this way, by carrying an identifier in the first file acquisition request, the validity of the first file acquisition request can be judged, and then whether to send the update file corresponding to the new version service can be confirmed based on the judgment result, which greatly avoids the leakage of the update file corresponding to the new version service and improves the security of the new version service.
[0103] In addition, the identifier of the first server carried in the first file acquisition request can also be used by the service management end to determine the server that needs to feedback the update file, which can improve the efficiency of updating the file feedback or sending, thereby improving the upgrade efficiency.
[0104] The upgrade method of the server provided by the present invention sends a version update message to each registered server when a new version of the service is obtained; receives a first file acquisition request sent by a first server, the first file acquisition request is generated based on the version update message and the load of the first server, and the first server is any server; sends the update file corresponding to the new version of the service to the first server, so that the first server deploys the new version of the service and provides the new version of the service to the client corresponding to the first server through path switching. The present invention pushes the update file of the new version of the service to the server in idle time by preloading, that is, the server generates a first file acquisition request based on the load to pull the update file. When the customer has a version upgrade demand, it only needs to switch the traffic to the new version and use it directly, avoiding the delivery of service upgrades to customer upgrades, freeing users from tedious and complicated operations, improving upgrade efficiency, reducing data transmission for version upgrades, reducing the cost of version upgrades, and achieving upgrades in seconds.
[0105] In one or more optional embodiments of the present invention, the new version file of the new version service can also be sent to the first server as an update file. In this way, the first server can determine the update file corresponding to the new version service without performing additional operations, which reduces the data processing amount of the first server to a certain extent.
[0106] In one or more optional embodiments of the present invention, in order to reduce the amount of data transmission and thus improve the efficiency of service upgrade, before sending the update file corresponding to the new version service to the first server, the method further includes:
[0107] Obtain a new version file of the new version service;
[0108] Compare the new version file with the old version file to determine the difference file between the new version file and the old version file;
[0109] An update file corresponding to the new version service is determined according to the difference file.
[0110] Specifically, the new version file refers to the file consisting of all scripts and documents of the new version service. The old version file refers to the file consisting of all scripts and documents of the old version service, where the old version service refers to the service before the upgrade or update, or the service of the previous version of the new version service. The difference file refers to the file that is different between the new version file and the old version file, including the files of the newly added part and the files of the modified part.
[0111] In actual applications, the service management end first obtains the new version file of the new version service, such as reading the new version file of the new version service from the file storage area of the service management end, and obtains the old version file. Then the new version file is compared with the old version file to identify the difference file between the new version file and the old version file. The part of the difference file that belongs to the new version file is determined as the update file corresponding to the new version service.
[0112] In this way, by comparing the new version file with the old version file, determining the difference file, and then filtering the update file corresponding to the new version service from the difference file, the data volume of the update file is reduced to a certain extent, which can speed up the transmission of the update file, thereby improving the transmission efficiency and speeding up the upgrade of the first server.
[0113] In an optional embodiment of the present specification, the new version file is compared with the old version file to determine the difference file between the new version file and the old version file. The specific implementation process may be as follows:
[0114] The subfiles in the new version file are compared with the subfiles in the old version file to determine target subfiles that are different between the new version file and the old version file, and the difference file is composed of the target subfiles.
[0115] In practical applications, each sub-file in the new version file can be compared with each sub-file in the old version file, and the same sub-files in the new version file and the old version file can be determined, and the other sub-files can be used as different target sub-files to obtain the difference file. In this way, by comparing the contents of the new version file with the old version file, the difference file can be accurately determined, thereby improving the accuracy of the updated file and improving the upgrade efficiency.
[0116] For example, the new version file is abcdefg, and the old version file is abxdefy. By comparing the new version file with the old version file, it can be seen that the same sub-files are a, b, d, e and f, and the different target sub-files include c, x, g and y. Then c, x, g and y constitute the difference file, among which c and g belong to the new version file, and c and g constitute the update file.
[0117] In another optional embodiment of the present specification, the new version file is compared with the old version file to determine the difference file between the new version file and the old version file. The specific implementation process may be as follows:
[0118] Performing hash processing on the new version file and the old version file respectively to obtain a first hash value of the new version file and a second hash value of the old version file;
[0119] The first Hash value and the second Hash value are compared to determine a difference file between the new version file and the old version file.
[0120] Specifically, hashing refers to the process of creating a small digital fingerprint from any file, that is, mapping a binary plaintext of any length into a shorter binary string. The hash value refers to the string or digital fingerprint obtained by hashing, and different plaintexts are difficult to map to the same hash value.
[0121] In practical applications, the new version file and the old version file are hashed respectively to obtain a first hash value of the new version file and a second hash value of the old version file. The first hash value is then compared with the second hash value to determine the difference between the new version file and the old version file, that is, to determine the difference position between the new version file and the old version file, and then determine the subfiles in the new version file and the old version file according to the difference position, and the subfiles corresponding to the difference position constitute the difference file. In this way, when the new version file and the old version file are larger, the new version file is avoided from being compared with the old version file, which reduces the amount of data processing, effectively improves the efficiency of determining the difference file, and further improves the upgrade efficiency.
[0122] Exemplarily, the new version file is abcdefg, and the old version file is abxdefy. A differential algorithm based on hash values is used to calculate the difference between the new version file and the old version file (difference file): the new version file and the old version file are hashed separately to obtain the hash value of the new version file - d6b7b46a, and the hash value of the old version file - a8c7d5bc. Comparing the two hash values, two difference positions can be obtained: the difference position of the first different character is 3, and the difference position of the second different character is 6. According to the first difference position, a different character - c is found in the new version file, and a different character - x is found in the old version file; according to the second difference position, a different character - g is found in the new version file, and a different character - y is found in the old version file, then c, x, g and y constitute a difference file, where c and g constitute an update file.
[0123] It should be noted that the update file includes a new part and a modified part, such as the new part of the update file: x and y, and the modified part of the update file: c->x, g->y.
[0124] In one or more optional embodiments of the present specification, before sending the update file corresponding to the new version service to the first server, the method further includes:
[0125] Acquire first location information of the first server;
[0126] Determining, according to the first location information, whether there is a second server among other servers that have received the update file;
[0127] Accordingly, sending the update file corresponding to the new version service to the first server includes:
[0128] If not, the update file corresponding to the new version service is sent to the first server.
[0129] Specifically, the location information may be the location of the server, the longitude and latitude of the server, or other information representing the location. The first location information refers to the location information of the first server.
[0130] In actual applications, when registering, the first server submits the first location information, and the service management end saves the first location information, thereby obtaining the first location information of the first server from the storage area. Alternatively, the first file acquisition request carries the first location information of the first server. Alternatively, after receiving the first file acquisition request, the service management end sends a location information acquisition request to the first server, and accordingly, the first server feeds back the first location information to the service management end.
[0131] Furthermore, based on the first location information, it is checked whether there is a second server associated with the first location information and has received the update file. If not, the service management end sends the update file corresponding to the new version service to the first server. In this way, it is determined whether there is a second server through the first location information of the first server, and then it is determined whether the service management end sends the update file, which improves the efficiency and diversity of sending the update file.
[0132] Optionally, after determining, according to the first location information, whether there is a second server among other servers that have received the update file, the method further includes:
[0133] If so, the first identifier of the second server is sent to the first server, so that the first server obtains the update file from the second server according to the first identifier.
[0134] Specifically, the identifier refers to the name, address, number, etc. of the server.
[0135] In actual application, based on the first location information, check whether there is a second server associated with the first location information and has received the update file. If so, the service management end sends the first identifier of the second server to the first server. The first server requests the second server to update the file based on the first identifier: that is, the first server determines the second server based on the first identifier, and then sends a second file acquisition request to the second server, and the second server feeds back the update file to the first server based on the second file acquisition request.
[0136] In this way, the first location information of the first server is used to determine whether the second server exists, and then determine whether the update file is sent by the service management end, thereby improving the efficiency and diversity of sending the update file. In addition, by feeding back the update file from the second server, since the second server is determined based on the first location information of the first server, the second server is closer to the first server, and the update file is pulled from the second server, shortening the path, which can increase the rate of pulling the update file, thereby improving the upgrade efficiency. In addition, it can also reduce the data processing volume of the service management end to a certain extent, reduce the data processing pressure of the service management end, and avoid the crash of the service management end.
[0137] In an optional embodiment of the present specification, the process of determining whether there is a second server among other servers that have received the update file according to the first location information may be specifically implemented as follows:
[0138] Determine the service area of the first server according to the first location information;
[0139] It is determined whether there is a second server in the service area that has received the update file.
[0140] In practical applications, the service area where the first location information is located, that is, the service area where the first server is located, can be determined based on the first location information and the area range of each service area. Then, it is determined whether there is a second server that has received the update file in the service area where the first server is located. In this way, the second server is limited to the service area where the first server is located. When the second server exists, the update file transmission in the same service area can be realized, which is conducive to improving the efficiency of pulling update files.
[0141] In another optional embodiment of the present specification, the process of determining whether there is a second server among other servers that have received the update file according to the first location information may be specifically implemented as follows:
[0142] Acquire third location information of each of the other servers that have received the update file;
[0143] Calculating the distance between the first server and each of the other servers according to the first location information and each of the third location information;
[0144] It is determined whether there is a target distance in each of the distances, the target distance being a distance less than a distance threshold, and the other server corresponding to the target distance being a second server.
[0145] Specifically, the distance threshold may be a preset distance, such as the distance between the first server and the service management terminal, such as the average value of the distances between each server and the service management terminal.
[0146] In actual applications, the third location information of each other server that has received the update file can be obtained, and then the distance between the first location information and each third location information, that is, the distance between the first server and each other server, is calculated. Each distance is then compared with the distance threshold to determine whether there is a target distance less than the distance threshold in each distance. In this way, the distance between the second server and the first server is limited to be less than the distance threshold. In the presence of the second server, short-distance update file transmission can be achieved, which is conducive to improving the efficiency of pulling update files.
[0147] Combine the following Figure 2 and Figure 3 , the server upgrade method provided by the present invention is further explained.
[0148] See also Figure 2 , Figure 2This is the second flow diagram of the upgrade method of the server provided by the present invention: the client-server cluster or client-server, that is, the server registers with the management background of the service management end. When there is a new delivery version, that is, the service management end obtains the new version service and pushes it in idle time, that is, the update file corresponding to the new version file is pushed to the server in advance, and the server deploys the new version service according to the update file, that is, the new version. When the client has a demand or the server has an upgrade demand, it only needs to switch the traffic (switch the customer traffic entrance from 100% traffic), that is, path switching, to complete the upgrade in seconds, that is, provide the client with a new version service. Exemplarily, the user accesses the old version of >http: / / docs.xxx.cn> through the browser; the user accesses the new version of >http: / / docs.xxx.cn> (path switching) through the browser, that is, the user uses the online document and wants to experience the new function, then the online document needs to be upgraded at this time, and the path behind http: / / docs.xxx.cn needs to be switched to the new version, and the user can directly experience the effect of the new version. If the customer feels that the new version is not easy to use and wants to use the old version again, at this time, they only need to switch the path behind http: / / docs.xxx.cn to the old version, and the user can directly experience the effect of the old version. The above operations can experience the effect of the new and old versions in seconds, and can be used as needed.
[0149] The pre-push process of the service management end uses DHT (an open distributed network technology) to speed up file transfer. The more clients download, the faster the service resources are downloaded. Figure 3 , Figure 3 This is the third flow chart of the upgrade method of the server provided by the present invention: the server 1 and the server 2 in the first (service) area pull the update file through the service image warehouse of the service management end, then when the server 3 needs to pull the update file, it can go to the nearest server 1 or server 2 to pull the update file; the server 4 in the second (service) area pulls the update file through the service image warehouse of the service management end, then when the server 5 needs to pull the update file, it can go to the nearest server 4 to pull the update file. Compared with directly pulling from the server image warehouse, the path is much reduced and the path is shorter. In this way, as long as there are more servers, the update file of the new version of the service can be pulled faster.
[0150] In addition, the incremental (updated file) download between the new version file and the old version file is realized by the differential algorithm. Assume that there are two files A (old version file) and B (new version file), and their contents are: file A: abcdefg; file B: abxdefy.
[0151] Compare file A with the file and find the differences:
[0152] Position of the first different character: 3;
[0153] The first different character A: c;
[0154] The first different character B: x;
[0155] Position of the second different character: 6;
[0156] The second different character A: g;
[0157] The second different character B: y;
[0158] Generate an update file based on the differences. The update file includes the new part and the modified part: the new part of the difference file: x, y; the modified part of the difference file: c->x, g->y. After receiving the update file, the server applies the update file to file A to obtain file B: abxdefy.
[0159] In this way, data transmission for version upgrades is reduced, the cost of version upgrades is lowered, and online editing services can be upgraded in seconds.
[0160] Figure 4 This is a fourth flow chart of the upgrade method of the server provided by the present invention, see Figure 4 As shown, it is applied to the first server, including steps 401 to 404, wherein:
[0161] Step 401: Receive a version update message sent by a service management terminal, where the version update message is generated based on a new version service.
[0162] In actual applications, maintenance personnel who develop or update services update or iterate the service version, and then publish the new version of the service on the service management end, or upload the new version file of the new version of the service to the service management end. Accordingly, the service management end obtains the new version of the service or the new version file of the new version of the service. At this time, the service management end retrieves the registration data of the management backend, determines all registered servers, and then broadcasts the service version update message to each registered server. That is, the first server receives the version update message.
[0163] Step 402: In response to the version update message, monitor the current load, and when the load reaches a set load condition, send a first file acquisition request to the service management end.
[0164] In actual applications, after receiving the version update message, the first server monitors the load of the server, that is, the service volume provided by the client. When the load reaches the set condition, a first file acquisition request is generated based on the version update message. Then, the first server sends the first file acquisition request to the service management end. Accordingly, the service management end receives the first file acquisition request sent by the first server.
[0165] Step 403: receiving an update file corresponding to the new version service, wherein the update file is obtained by the service management end in response to the first file acquisition request.
[0166] In actual applications, upon receiving the first file acquisition request sent by the first server, the service management terminal responds to the first file acquisition request, organizes the new version file of the new version service, obtains the update file corresponding to the new version service, and feeds back the update file corresponding to the new version service to the first server. Accordingly, the first server receives the update file corresponding to the new version service.
[0167] Step 404: deploy the new version service according to the update file, and provide the new version service to the client corresponding to the first server through path switching.
[0168] In actual applications, after receiving the update file corresponding to the new version of the service, the first server deploys the new version of the service according to the update file corresponding to the new version of the service on the first server, and provides the new version of the service to the client while providing services to the client.
[0169] Optionally, after deploying the new version service according to the update file and providing the new version service to the client through the path switching corresponding to the first server, the method further includes:
[0170] In response to the version switching request sent by the client, the path of the new version service is switched to the path of the old version service, and the old version service is provided to the client.
[0171] Specifically, a version switching request refers to a request to switch from a new version service to an old version service.
[0172] In actual applications, if a user wants to use an old version of a service, the client sends a version switching request. Accordingly, the first server receives the version switching request and switches the path of the new version of the service to the path of the old version of the service, so that the user can use the old version of the service on the client. In this way, the switch between the new and old versions can be achieved through path switching, which is more user-friendly and fast, thereby improving user stickiness.
[0173] Optionally, the receiving an update file corresponding to the new version service includes:
[0174] Receive a first identifier of a second server sent by the service management end, where the second server is another server that has received the update file and is determined by the service management end based on first location information of the first server, where the first location information is determined by the service management end based on the first file acquisition request;
[0175] According to the first identifier of the second server, a second file acquisition request is sent to the second server, and an update file corresponding to the new version service fed back by the second server based on the second file acquisition request is received.
[0176] In actual applications, when registering, the first server submits the first location information, and the service management end saves the first location information, thereby obtaining the first location information of the first server from the storage area. Alternatively, the first file acquisition request carries the first location information of the first server. Alternatively, after receiving the first file acquisition request, the service management end sends a location information acquisition request to the first server, and accordingly, the first server feeds back the first location information to the service management end.
[0177] Further, based on the first location information, check whether there is a second server associated with the first location information and has received the update file. If not, the service management end sends the update file corresponding to the new version of the service to the first server. If it exists, the service management end sends the first identifier of the second server to the first server. The first server requests the second server to update the file based on the first identifier: that is, the first server determines the second server based on the first identifier, and then sends a second file acquisition request to the second server, and the second server feeds back the update file to the first server based on the second file acquisition request.
[0178] Optionally, after deploying the new version service according to the update file and providing the new version service to the client through the path switching corresponding to the first server, the method further includes:
[0179] Receive a third file acquisition request sent by a third server, the third file acquisition request is sent based on the second identifier of the first server, the first server is determined by the service management end based on the second location information of the third server, the second location information is determined by the service management end based on a fourth file acquisition request sent by the third server, the fourth file acquisition request is generated based on the version update message and the load of the third server;
[0180] The update file is sent to the third server.
[0181] In actual applications, when the third server requests the first server to update a file, the first server needs to feed back the updated file to the third server.
[0182] It should be noted that when the service management end sends the second identifier of the first server to the third server, it also sends the third identifier of the third server to the first server to inform the first server that it can safely feed back the update file to the third server.
[0183] The service management end provided by the present invention is described below. The service management end described below and the upgrade method of the service end described above can be referred to each other.
[0184] Figure 5 This is one of the structural diagrams of the upgrade device of the server provided by the present invention, such as Figure 5 As shown, the server upgrade device 500 is applied to the service management end, including: a first sending module 501, a first receiving module 502 and a second sending module 503, wherein:
[0185] The first sending module 501 is configured to send a version update message to each registered server when a new version service is obtained;
[0186] A first receiving module 502 is configured to receive a first file acquisition request sent by a first server, where the first file acquisition request is generated based on the version update message and the load of the first server, and the first server is any server;
[0187] The second sending module 503 is configured to send the update file corresponding to the new version service to the first server, so that the first server deploys the new version service and provides the new version service to the client corresponding to the first server through path switching.
[0188] The upgrade device of the server provided by the present invention sends a version update message to each registered server when a new version of the service is obtained; receives a first file acquisition request sent by a first server, the first file acquisition request is generated based on the version update message and the load of the first server, and the first server is any server; sends the update file corresponding to the new version of the service to the first server, so that the first server deploys the new version of the service and provides the new version of the service to the client corresponding to the first server through path switching. The present invention pushes the update file of the new version of the service to the server in idle time by preloading, that is, the server generates a first file acquisition request based on the load to pull the update file. When the customer has a version upgrade demand, it only needs to switch the traffic to the new version and use it directly, avoiding the delivery of service upgrades to customer upgrades, freeing users from tedious and complicated operations, improving upgrade efficiency, reducing data transmission for version upgrades, reducing the cost of version upgrades, and achieving upgrades in seconds.
[0189] In one or more optional embodiments of the present specification, the server-side upgrade device 500 also includes a first determination module, which is configured to obtain a new version file of the new version service; compare the new version file with the old version file to determine a difference file between the new version file and the old version file; and determine an update file corresponding to the new version service based on the difference file.
[0190] In one or more optional embodiments of the present specification, the first determination module is further configured to perform hash processing on the new version file and the old version file respectively to obtain a first hash value of the new version file and a second hash value of the old version file; compare the first hash value and the second hash value to determine a difference file between the new version file and the old version file.
[0191] In one or more optional embodiments of the present specification, the server-side upgrade device 500 further includes a determination module configured to obtain first location information of the first server; and determine, based on the first location information, whether there is a second server among other servers that have received the update file;
[0192] Accordingly, the second sending module 503 is further configured to send the update file corresponding to the new version service to the first server if no;
[0193] The server-side upgrade device 500 further includes a third sending module configured to send the first identifier of the second server to the first server, so that the first server obtains the update file from the second server according to the first identifier.
[0194] In one or more optional embodiments of the present specification, the judgment module of the server-side upgrade device 500 is further configured to determine the service area where the first server is located based on the first location information; and determine whether there is a second server in the service area that has received the update file.
[0195] The first server provided by the present invention is described below. The first server described below and the upgrade method of the server described above can be referenced to each other.
[0196] Figure 6 This is the second structural diagram of the upgrade device of the server provided by the present invention, such as Figure 6 As shown, the server upgrade device 600 is applied to the first server, including: a second receiving module 601, a monitoring module 602, a third receiving module 603 and a deployment module 604, wherein:
[0197] The second receiving module 601 is configured to receive a version update message sent by the service management terminal, wherein the version update message is generated based on the new version service;
[0198] The monitoring module 602 is configured to monitor the current load in response to the version update message, and send a first file acquisition request to the service management terminal when the load reaches a set load condition;
[0199] A third receiving module 603 is configured to receive an update file corresponding to the new version service, where the update file is obtained by the service management end in response to the first file acquisition request;
[0200] The deployment module 604 is configured to deploy the new version service according to the update file, and provide the new version service to the client corresponding to the first server through path switching.
[0201] The server-side upgrade device provided by the present invention pushes the update file of the new version service to the server in idle time by preloading, that is, the server generates a first file acquisition request based on the load to pull the update file. When the customer has a version upgrade demand, it only needs to switch the traffic to the new version and can use it directly, avoiding the delivery of service upgrades to customer upgrades, freeing users from tedious and complicated operations, improving upgrade efficiency, reducing data transmission for version upgrades, reducing the cost of version upgrades, and achieving upgrades in seconds.
[0202] In one or more optional embodiments of the present specification, the server-side upgrade device 600 also includes a switching module, which is configured to switch the path of the new version service to the path of the old version service in response to a version switching request sent by the client, and provide the old version service to the client.
[0203] In one or more optional embodiments of the present specification, the third receiving module 603 is further configured to receive a first identifier of a second server sent by the service management end, where the second server is another server that has received the update file and is determined by the service management end based on the first location information of the first server, where the first location information is determined by the service management end based on the first file acquisition request; according to the first identifier of the second server, a second file acquisition request is sent to the second server, and the update file corresponding to the new version of the service is received, which is fed back by the second server based on the second file acquisition request.
[0204] In one or more optional embodiments of the present specification, the upgrade device 600 of the server side also includes a fourth receiving module, which is configured to receive a third file acquisition request sent by a third server side, the third file acquisition request is sent based on the second identifier of the first server side, the first server side is determined by the service management side based on the second location information of the third server side, the second location information is determined by the service management side based on the fourth file acquisition request sent by the third server side, the fourth file acquisition request is generated based on the version update message and the load of the third server side; and the update file is sent to the third server side.
[0205] The upgrade system of the server provided by the present invention is described below. The upgrade system of the server described below and the upgrade method of the server described above can be referred to each other.
[0206] Figure 7 Schematic diagram of the upgrade system of the server provided by the present invention. Figure 7 As shown, the server upgrade system 700 includes: a service management terminal 701 and at least one server 702, wherein:
[0207] The service management terminal 701 is used to send a version update message to each registered server 702 when a new version of the service is obtained;
[0208] The first server 702 is used to receive a version update message sent by the service management terminal 701; in response to the version update message, monitor the current load, and send a first file acquisition request to the service management terminal 701 when the load reaches a set load condition. The first server 702 is any server 702;
[0209] The service management end 701 is further configured to receive a first file acquisition request sent by the first server end 702; and send an update file corresponding to the new version service to the first server end 702;
[0210] The first server 702 is further configured to receive an update file corresponding to the new version service, deploy the new version service according to the update file, and provide the new version service to the client corresponding to the first server through path switching.
[0211] The server upgrade system provided by the present invention sends a version update message to each registered server when a new version of the service is obtained; receives a first file acquisition request sent by a first server, the first file acquisition request is generated based on the version update message and the load of the first server, and the first server is any server; sends the update file corresponding to the new version of the service to the first server, so that the first server deploys the new version of the service and provides the new version of the service to the client corresponding to the first server through path switching. The present invention pushes the update file of the new version of the service to the server in idle time by preloading, that is, the server generates a first file acquisition request based on the load to pull the update file. When the customer has a version upgrade demand, it only needs to switch the traffic to the new version to use it directly, avoiding the delivery of service upgrades to customer upgrades, freeing users from tedious and complicated operations, improving upgrade efficiency, reducing data transmission for version upgrades, reducing the cost of version upgrades, and achieving upgrades in seconds.
[0212] In one or more optional embodiments of the present specification, the service management terminal 701 is further used to obtain a new version file of the new version service; compare the new version file with the old version file to determine a difference file between the new version file and the old version file; and determine an update file corresponding to the new version service based on the difference file.
[0213] In one or more optional embodiments of the present specification, the service management end 701 is further used to perform hash processing on the new version file and the old version file respectively to obtain a first hash value of the new version file and a second hash value of the old version file; compare the first hash value and the second hash value to determine a difference file between the new version file and the old version file.
[0214] In one or more optional embodiments of the present specification, the service management end 701 is further used to obtain first location information of the first server end 702; according to the first location information, determine whether there is a second server end 702 among other servers 702 that have received the update file; if not, send the update file corresponding to the new version service to the first server end 702; if so, send the first identifier of the second server end 702 to the first server end 702;
[0215] The first server 702 is further used to receive the first identifier of the second server 702 sent by the service management end 701; send a second file acquisition request to the second server 702 according to the first identifier of the second server 702, and receive the update file corresponding to the new version of the service fed back by the second server 702 based on the second file acquisition request.
[0216] In one or more optional embodiments of the present specification, the service management end 701 is further used to determine the service area where the first server 702 is located based on the first location information; and determine whether there is a second server 702 in the service area that has received the update file.
[0217] In one or more optional embodiments of the present specification, the first server 702 is further configured to, in response to a version switching request sent by the client, switch the path of the new version service to the path of the old version service, and provide the old version service to the client.
[0218] In one or more optional embodiments of the present specification, the first server 702 is further used to receive a third file acquisition request sent by the third server 702, the third file acquisition request is sent based on the second identifier of the first server 702, the first server 702 is determined by the service management end 701 based on the second location information of the third server 702, the second location information is determined by the service management end 701 based on a fourth file acquisition request sent by the third server 702, the fourth file acquisition request is generated based on the version update message and the load of the third server 702; and the update file is sent to the third server 702.
[0219] Figure 8 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 8As shown, the electronic device may include: a processor 810, a communication interface 820, a memory 830 and a communication bus 840, wherein the processor 810, the communication interface 820 and the memory 830 communicate with each other through the communication bus 840. The processor 810 may call the logic instructions in the memory 830 to execute the upgrade method of the server, the method comprising: in the case of obtaining a new version of the service, sending a version update message to each registered server; receiving a first file acquisition request sent by a first server, the first file acquisition request being generated based on the version update message and the load of the first server, the first server being any server; sending the update file corresponding to the new version of the service to the first server, so that the first server deploys the new version of the service and provides the new version of the service to the client corresponding to the first server through path switching;
[0220] Alternatively, a version update message is received from a service management end, wherein the version update message is generated based on a new version of the service; in response to the version update message, a current load is monitored, and when the load reaches a set load condition, a first file acquisition request is sent to the service management end; an update file corresponding to the new version of the service is received, wherein the update file is obtained by the service management end in response to the first file acquisition request, the new version of the service is deployed according to the update file, and the new version of the service is provided to the client corresponding to the first server through path switching.
[0221] In addition, the logic instructions in the above-mentioned memory 830 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0222] On the other hand, the present invention further provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the server upgrade method provided by the above methods, the method including: in the case of obtaining a new version of the service, sending a version update message to each registered server; receiving a first file acquisition request sent by a first server, the first file acquisition request is generated based on the version update message and the load of the first server, and the first server is any server; sending the update file corresponding to the new version of the service to the first server, so that the first server deploys the new version of the service and provides the new version of the service to the client corresponding to the first server through path switching;
[0223] Alternatively, a version update message is received from a service management end, wherein the version update message is generated based on a new version of the service; in response to the version update message, a current load is monitored, and when the load reaches a set load condition, a first file acquisition request is sent to the service management end; an update file corresponding to the new version of the service is received, wherein the update file is obtained by the service management end in response to the first file acquisition request; the new version of the service is deployed according to the update file, and the new version of the service is provided to the client corresponding to the first server end through path switching.
[0224] On the other hand, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the processor executes the server upgrade method provided by the above methods, the method comprising: in the case of obtaining a new version of the service, sending a version update message to each registered server; receiving a first file acquisition request sent by a first server, the first file acquisition request being generated based on the version update message and the load of the first server, the first server being any server; sending an update file corresponding to the new version of the service to the first server, so that the first server deploys the new version of the service and provides the new version of the service to the client corresponding to the first server through path switching;
[0225] Alternatively, a version update message is received from a service management end, wherein the version update message is generated based on a new version of the service; in response to the version update message, a current load is monitored, and when the load reaches a set load condition, a first file acquisition request is sent to the service management end; an update file corresponding to the new version of the service is received, wherein the update file is obtained by the service management end in response to the first file acquisition request; the new version of the service is deployed according to the update file, and the new version of the service is provided to the client corresponding to the first server end through path switching.
[0226] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative work.
[0227] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0228] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A server upgrade method, characterized in that: Applied to the service management end, including: When a new version of the service is obtained, a version update message is sent to each registered server; receiving a first file acquisition request sent by a first server, where the first file acquisition request is generated based on the version update message and the load of the first server, and the first server is any server; The update file corresponding to the new version service is sent to the first server, so that the first server deploys the new version service and provides the new version service to the client corresponding to the first server through path switching.
2. The server upgrade method according to claim 1, characterized in that: Before sending the update file corresponding to the new version service to the first server, the method further includes: Obtain a new version file of the new version service; Compare the new version file with the old version file to determine the difference file between the new version file and the old version file; An update file corresponding to the new version service is determined according to the difference file.
3. The server upgrade method according to claim 2, characterized in that: The step of comparing the new version file with the old version file to determine a difference file between the new version file and the old version file includes: Performing hash processing on the new version file and the old version file respectively to obtain a first hash value of the new version file and a second hash value of the old version file; The first Hash value and the second Hash value are compared to determine a difference file between the new version file and the old version file.
4. The server upgrade method according to claim 1, characterized in that: Before sending the update file corresponding to the new version service to the first server, the method further includes: Acquire first location information of the first server; Determining, according to the first location information, whether there is a second server among other servers that have received the update file; Accordingly, sending the update file corresponding to the new version service to the first server includes: If not, sending the update file corresponding to the new version service to the first server; After determining, according to the first location information, whether there is a second server among other servers that have received the update file, the method further includes: If so, the first identifier of the second server is sent to the first server, so that the first server obtains the update file from the second server according to the first identifier.
5. The method for upgrading the server according to claim 4, characterized in that: The determining, according to the first location information, whether there is a second server among other servers that have received the update file includes: Determine the service area of the first server according to the first location information; It is determined whether there is a second server in the service area that has received the update file.
6. A server upgrade method, characterized in that: Applied to the first server, including: Receiving a version update message sent by a service management terminal, wherein the version update message is generated based on a new version service; In response to the version update message, monitor the current load, and when the load reaches a set load condition, send a first file acquisition request to the service management end; Receive an update file corresponding to the new version service, where the update file is obtained by the service management end in response to the first file acquisition request; The new version service is deployed according to the update file, and the new version service is provided to the client corresponding to the first server through path switching.
7. The method for upgrading the server according to claim 6, characterized in that: After deploying the new version service according to the update file and providing the new version service to the client corresponding to the first server through path switching, the method further includes: In response to the version switching request sent by the client, the path of the new version service is switched to the path of the old version service, and the old version service is provided to the client.
8. The method for upgrading the server according to claim 6, characterized in that: The receiving an update file corresponding to the new version service includes: Receive a first identifier of a second server sent by the service management end, where the second server is another server that has received the update file and is determined by the service management end based on first location information of the first server, where the first location information is determined by the service management end based on the first file acquisition request; According to the first identifier of the second server, a second file acquisition request is sent to the second server, and an update file corresponding to the new version service fed back by the second server based on the second file acquisition request is received.
9. The method for upgrading the server according to claim 6, characterized in that: After deploying the new version service according to the update file and providing the new version service to the client corresponding to the first server through path switching, the method further includes: Receive a third file acquisition request sent by a third server, the third file acquisition request is sent based on the second identifier of the first server, the first server is determined by the service management end based on the second location information of the third server, the second location information is determined by the service management end based on a fourth file acquisition request sent by the third server, the fourth file acquisition request is generated based on the version update message and the load of the third server; The update file is sent to the third server.
10. A server upgrade device, characterized in that: Applied to the service management end, including: A first sending module is configured to send a version update message to each registered server when a new version service is obtained; A first receiving module is configured to receive a first file acquisition request sent by a first server, wherein the first file acquisition request is generated based on the version update message and the load of the first server, and the first server is any server; The second sending module is configured to send the update file corresponding to the new version service to the first server, so that the first server deploys the new version service and provides the new version service to the client corresponding to the first server through path switching.
11. A server upgrade device, characterized in that: Applied to the first server, including: A second receiving module is configured to receive a version update message sent by the service management terminal, wherein the version update message is generated based on the new version service; A monitoring module, configured to monitor a current load in response to the version update message, and send a first file acquisition request to the service management end when the load reaches a set load condition; A third receiving module is configured to receive an update file corresponding to the new version service, where the update file is obtained by the service management end in response to the first file acquisition request; The deployment module is configured to deploy the new version service according to the update file and provide the new version service to the client corresponding to the first server through path switching.