Physical machine service upgrade method, system, device and computer-readable medium

The combination of iptables and proxy processes solves the consistency verification problem of switching between old and new services during physical machine service upgrades, achieving smooth and imperceptible upgrades and reducing the complexity and risks of the service architecture.

CN119166176BActive Publication Date: 2025-09-30SHANGHAI BILIBILI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411163860.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-22
Publication Date
2025-09-30
Estimated Expiration
2044-08-22

AI Technical Summary

Technical Problem

Existing technologies cannot implement dual-write/dual-read functions for new and old services during physical machine service upgrades, cannot verify the consistency of response information, and complex load balancer configuration updates increase the risk and complexity of the service architecture and require changes to business programs.

Method used

A combination of iptables and proxy processes is used to receive and forward request information, verify the consistency of response information between new and old services, and switch the new service to the main service according to preset rules to achieve imperceptible service upgrades.

Benefits of technology

It enables free switching between new and old services without upstream and downstream perception, reduces the complexity and risk of the service architecture, and ensures the consistency of response information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119166176B_ABST
    Figure CN119166176B_ABST
Patent Text Reader

Abstract

The present application provides a physical machine service upgrade method, system, device and computer-readable medium, the method being applied to a physical machine service upgrade system, the system comprising iptables and a proxy process, the method comprising: in response to a service upgrade request, the proxy process receiving request information forwarded by the iptables, the request information being issued by an upper-layer user; the proxy process sending the request information to the old service and the new service, and receiving response information returned by the old service and the new service; based on the response information returned by the old service and the new service, in accordance with a preset old-new service switching rule, the proxy process switching the new service to the main service so that it returns response information to the upper-layer user, thereby implementing a physical machine service upgrade.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a physical machine service upgrade method, system, device, and computer-readable medium. Background Art

[0002] This section is intended to provide a background or context to the embodiments of the present application that are recited in the claims. Nothing herein is admitted to be prior art by virtue of its inclusion in this section.

[0003] In the process of upgrading the traditional service architecture, the gradual iterative upgrade of the service is generally achieved through the following two methods: one method is to directly use the new service to replace the old service; the other method is to directly deploy the new service and use the load balancer to allocate part of the traffic to the new service.

[0004] However, the above method has the following problems: on the one hand, although service upgrades and rollbacks can be achieved by configuring the retry strategy, functional requirements such as dual writing / dual reading of new / old services cannot be achieved; on the other hand, the consistency of the response information returned by the new / old service cannot be verified without modifying the service architecture program; on the other hand, when a load balancer is used to achieve upgrades, the load balancer configuration needs to be updated every time the service is upgraded and rolled back, which increases the risk and complexity of the service architecture; on the other hand, in specific business scenarios, the business program needs to be modified to achieve service upgrades.

[0005] Therefore, there is an urgent need to propose a physical machine service upgrade method, system, device and computer-readable medium that can solve the above problems. Summary of the Invention

[0006] Multiple aspects of the present application provide a physical machine service upgrade method, device, computer-readable storage medium and program product to achieve free switching between new services and old services without upstream and downstream perception.

[0007] In one aspect of the present application, a physical machine service upgrade method is provided for upgrading an old service to a new service. The method is applied to a physical machine service upgrade system, the system including iptables and a proxy process, and the method includes:

[0008] In response to a service upgrade request, the proxy process receives a request message forwarded by the iptables, the request message being sent by an upper-layer user;

[0009] The proxy process sends the request information to the old service and the new service, and receives response information returned by the old service and the new service;

[0010] Based on the response information returned by the old service and the new service, and in accordance with the preset old and new service switching rules, the proxy process switches the new service to the main service so that it returns response information to the upper-level user to implement the physical machine service upgrade.

[0011] Furthermore, the preset new and old service switching rules include: the proxy process verifies the consistency of response information returned by the old service and the new service, and obtains the consistency frequency of the response information returned by the old service and the new service.

[0012] Furthermore, the preset new and old service switching rules also include: if the proxy process verifies that the response information returned by the old service and the new service are consistent, the consistency frequency of the response information returned by the old service and the new service is accumulated and added by 1; if the proxy process verifies that the response information returned by the old service and the new service are inconsistent, the consistency frequency of the response information returned by the old service and the new service is cleared to 0 and accumulated again, and the new service is optimized until the response information returned by the new service is consistent with the response information returned by the old service.

[0013] Furthermore, according to the preset new and old service switching rules, the proxy process switches the new service as the main service so that it returns response information to the upper-level user, including: if the consistency frequency of the response information returned by the old service and the new service exceeds a first preset value, the proxy process switches the new service as the main service so that it returns response information to the upper-level user; if the consistency frequency of the response information returned by the old service and the new service does not exceed the first preset value, the old service continues to be the main service and returns response information to the upper-level user.

[0014] Furthermore, according to the preset new and old service switching rules, the proxy process switches the new service to the main service so that it returns response information to the upper-level user, and also includes: if the consistency frequency of the response information returned by the old service and the new service does not exceed a second preset value, then continue to verify the consistency of the response information of the old service and the new service, wherein the second preset value is greater than the first preset value; if the proxy process verifies that the response information returned by the old service and the new service are consistent, then the new service continues to return response information to the upper-level user as the main service; if the proxy process verifies that the response information of the old service and the new service are inconsistent, then the proxy process re-switches the old service to the main service so that it returns response information to the upper-level user until the consistency frequency exceeds the first preset value.

[0015] Furthermore, the proxy process switches the new service as the main service so that it returns response information to the upper-level user, and also includes: if the consistency frequency exceeds a second preset value, deleting iptables, terminating the proxy process and decoupling the old service, and the proxy process switches the new service as the main service so that it returns response information to the upper-level user to realize the physical machine service upgrade.

[0016] Furthermore, the preset new and old service switching rules also include: if the consistency frequency of the response information returned by the old service and the new service exceeds a first preset value and does not exceed a second preset value, the proxy process verifies the consistency of the response information returned by the old service and the new service; if the proxy process verifies that the response information returned by the old service and the new service are consistent, the proxy process discards the response information returned by the old service.

[0017] Another aspect of the present application provides a physical machine service upgrade system, the system being used to upgrade an old service to a new service, the system comprising: Iptables and a proxy process;

[0018] The iptables is in communication with the request information receiving port of the old service, so as to intercept and forward the request information sent by the upper layer user to the old service;

[0019] The proxy process is connected to the iptables for receiving the request information forwarded by the iptables;

[0020] The proxy process is respectively communicated with the old service and the new service to send the request information to the new service and the old service and receive the response information returned by the old service and the new service; it is also used to switch the new service to the main service based on the response information returned by the new service and the old service and in accordance with the preset new and old service switching rules so that it returns the response information to the upper-level user to realize the physical machine service upgrade.

[0021] Another aspect of the present application provides an electronic device, comprising:

[0022] at least one processor; and

[0023] a memory communicatively connected to the at least one processor; wherein,

[0024] The memory stores instructions that can be executed by the at least one processor. The instructions are executed by the at least one processor to enable the at least one processor to perform the physical machine service upgrade method as described above.

[0025] In another aspect of the present application, a computer-readable storage medium is provided, on which computer program instructions are stored. The computer program instructions can be executed by a processor to implement the physical machine service upgrade method.

[0026] Another aspect of the present application provides a computer program product, including a computer program, which implements the physical machine service upgrade method when executed by a processor.

[0027] In the solution provided by the embodiment of the present application, by responding to the service upgrade request, the proxy process receives the request information forwarded by the iptables, and the request information is issued by the upper-level user; the proxy process sends the request information to the old service and the new service, and receives the response information returned by the old service and the new service; based on the response information returned by the old service and the new service, according to the preset new and old service switching rules, the proxy process switches the new service to the main service so that it returns the response information to the upper-level user to achieve the physical machine service upgrade. The method described in the present application decouples the upstream and downstream dependencies by setting iptables and proxy processes, and achieves smooth service upgrade (silky switching between new and old services) without upstream and downstream perception. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the technical solutions in the embodiments of the present application, a brief introduction will be given below to the drawings required for use in the embodiments or descriptions of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0029] Other features, objects and advantages of the present application will become more apparent upon reading the detailed description of non-limiting embodiments made with reference to the following drawings:

[0030] Figure 1 A flowchart of a physical machine service upgrade method provided in one embodiment of the present application;

[0031] Figure 2 A schematic diagram of the structure of a physical machine service upgrade system provided in one embodiment of the present application;

[0032] Figure 3 The figure is a schematic diagram of the structure of an electronic device suitable for implementing the solution in the embodiment of the present application.

[0033] The same or similar reference numerals in the drawings represent the same or similar components. DETAILED DESCRIPTION

[0034] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0035] In a typical configuration of the present application, the terminal and the equipment of the service network each include one or more processors (CPUs), input / output interfaces, network interfaces and memories.

[0036] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.

[0037] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology for information storage. The information can be computer program instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc-read only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission medium that can be used to store information that can be accessed by a computing device.

[0038] An embodiment of the present application provides a physical machine service upgrade method for upgrading an old service to a new service. The method is applied to a physical machine service upgrade system, the system including iptables and a proxy process, and the method includes:

[0039] In response to a service upgrade request, the proxy process receives a request message forwarded by the iptables, the request message being sent by an upper-layer user;

[0040] The proxy process sends the request information to the old service and the new service, and receives response information returned by the old service and the new service;

[0041] Based on the response information returned by the old service and the new service, and in accordance with the preset old and new service switching rules, the proxy process switches the new service to the main service so that it returns response information to the upper-level user to implement the physical machine service upgrade.

[0042] Specifically, the iptables described in this application is a management tool for the Linux firewall working in user space, which is used to implement control over the inbound and outbound forwarding of network data packets.

[0043] In actual scenarios, the execution subject of this method can be a user device, or a device formed by integrating a user device and a network device through a network, or an application running on the above device. The user device includes but is not limited to various terminal devices such as computers, mobile phones, tablets, smart watches, and bracelets. The network device includes but is not limited to network hosts, single network servers, multiple network server sets, or cloud computing-based computer collections, which can be used to implement some processing functions when setting an alarm. Here, the cloud is composed of a large number of hosts or network servers based on cloud computing (Cloud Computing), where cloud computing is a type of distributed computing, a virtual computer composed of a group of loosely coupled computers.

[0044] Example 1

[0045] This embodiment provides a physical machine service upgrade method, which is applied to a physical machine service upgrade system including iptables and a proxy process to upgrade an old service to a new service. The method includes:

[0046] In response to a service upgrade request, obtain the old service port, start the new service, and set the new service port;

[0047] Start the proxy process to forward the request information sent by the upper-level user to the old service port to the new service port;

[0048] Configure iptables to forward request information sent by upper-layer users to the old service port to the proxy process, and the proxy process sends the request information forwarded by iptables to the old service and / or the new service.

[0049] Specifically, the proxy process acts as the decision-making mechanism for new and existing services. Its primary tasks include determining traffic flow, data comparison, and the node where the new and old services will switch. Specifically, when a new service is first launched, its accuracy cannot be guaranteed. At this point, the proxy process bases its decisions on the read and write results of the old service, with the new service merely observing from the side. However, after the new service's basic functionality has been successfully verified, the proxy process can be configured to compare the data returned by the new service with that of the old service to ensure consistency. Once sufficient consistency is verified, the old service can then be used for failure rollback, using the new service's read and write results as the benchmark. This allows the proxy process to control the roles of both new and old services.

[0050] In one embodiment, the method further includes: within a preset first time period, the proxy process sets the old service as the main service, so that the old service returns response information to the upper-level user.

[0051] In one embodiment, the method further includes: within a preset second time period, the proxy process sets the new service as the primary service and the old service as the secondary service, so that the new service returns response information to the upper-level user.

[0052] In one embodiment, the method further includes: within a preset second time period and / or within a preset first time period, the proxy service obtains and verifies response information returned by the new service and the old service. If the response information returned by the new service is inconsistent with the response information returned by the old service within the preset second time period, the old service is switched back to the primary service, and the business code of the new service is modified and released online, so as to achieve client-unawareness and program hotfix.

[0053] In one embodiment, within a preset third time period, after confirming that the response information returned by the new service is correct, iptables will be deleted, the proxy process will be terminated and the old service will be decoupled. The proxy process will switch the new service as the main service so that it returns the response information to the upper-level user to realize the physical machine service upgrade.

[0054] Example 2

[0055] Figure 1 The present invention provides a process flow for a physical machine service upgrade method provided in an embodiment of the present invention, for upgrading an old service to a new service. The method is applied to a physical machine service upgrade system, the system including iptables and a proxy process, and the method includes:

[0056] Step S101: In response to a service upgrade request, the proxy process receives a request message forwarded by the iptables, where the request message is sent by an upper-layer user;

[0057] Step S102: the proxy process sends the request information to the old service and the new service, and receives response information returned by the old service and the new service;

[0058] Step S103: Based on the response information returned by the old service and the new service, and in accordance with the preset old and new service switching rules, the proxy process switches the new service to the main service so that it returns response information to the upper-level user to implement the physical machine service upgrade.

[0059] In order to ensure the accuracy of the response information returned by the upgraded new service, in one embodiment, the preset new and old service switching rules include: the proxy process verifies the consistency of the response information returned by the old service and the new service, and obtains the consistency frequency of the response information returned by the old service and the new service.

[0060] In one embodiment, the preset new and old service switching rules further include: if the proxy process verifies that the response information returned by the old service and the new service are consistent, then the consistency frequency of the response information returned by the old service and the new service is accumulated and added by 1; if the proxy process verifies that the response information returned by the old service and the new service are inconsistent, then the consistency frequency of the response information returned by the old service and the new service is cleared to 0 and accumulated again, and the new service is optimized until the response information returned by the new service is consistent with the response information returned by the old service. By configuring iptables and the proxy process, data verification and data selection can be freely implemented without making any business changes.

[0061] In one embodiment, according to the preset new and old service switching rules, the proxy process switches the new service as the main service so that it returns response information to the upper-level user, including: if the consistency frequency of the response information returned by the old service and the new service exceeds a first preset value, the proxy process switches the new service as the main service so that it returns response information to the upper-level user; if the consistency frequency of the response information returned by the old service and the new service does not exceed the first preset value, the old service continues to be the main service and returns response information to the upper-level user.

[0062] In one embodiment, according to the preset new and old service switching rules, the proxy process switches the new service to the main service so that it returns a response message to the upper-level user, and also includes: if the consistency frequency of the response information returned by the old service and the new service does not exceed a second preset value, then continue to verify the consistency of the response information of the old service and the new service, wherein the second preset value is greater than the first preset value; if the proxy process verifies that the response information returned by the old service and the new service is consistent, then the new service continues to return the response information to the upper-level user as the main service; if the proxy process verifies that the response information of the old service and the new service is inconsistent, then the proxy process re-switches the old service to the main service so that it returns a response message to the upper-level user until the consistency frequency exceeds the first preset value.

[0063] In one embodiment, the proxy process switches the new service as the main service so that it returns a response message to the upper-level user, and also includes: if the consistency frequency exceeds a second preset value, deleting iptables, terminating the proxy process and decoupling the old service, and the proxy process switches the new service as the main service so that it returns a response message to the upper-level user to achieve a physical machine service upgrade.

[0064] In order to ensure the accuracy of the response information returned by the new service while reducing the occupancy rate of the system storage space, in one embodiment, the preset new and old service switching rules further include: if the consistency frequency of the response information returned by the old service and the new service exceeds a first preset value and does not exceed a second preset value, the proxy process verifies the consistency of the response information returned by the old service and the new service; if the proxy process verifies that the response information returned by the old service and the new service are consistent, the proxy process discards the response information returned by the old service.

[0065] Based on the physical machine service upgrade method described in this embodiment, by configuring iptables and proxy processes, the upstream and downstream are decoupled without the need for business changes, so as to achieve free and smooth switching of new and old services without the upstream and downstream perception, and ultimately achieve the purpose of service upgrade.

[0066] Example 3

[0067] In addition, the embodiment of the present application also provides a physical machine service upgrade system, the structure of which is as follows: Figure 2 As shown, the system is used to upgrade an old service to a new service, and the system includes:

[0068] Iptables and proxy processes;

[0069] The iptables is in communication with the request information receiving port of the old service, so as to intercept and forward the request information sent by the upper layer user to the old service;

[0070] The proxy process is connected to the iptables for receiving the request information forwarded by the iptables;

[0071] The proxy process is respectively communicated with the old service and the new service to send the request information to the new service and the old service and receive the response information returned by the old service and the new service; it is also used to switch the new service to the main service based on the response information returned by the new service and the old service and in accordance with the preset new and old service switching rules so that it returns the response information to the upper-level user to realize the physical machine service upgrade.

[0072] Example 4

[0073] Based on the same inventive concept, an electronic device is also provided in an embodiment of the present application. The method corresponding to the electronic device may be the method for upgrading physical machine services in the aforementioned embodiment, and its principle of solving the problem is similar to that of the method. The electronic device provided in an embodiment of the present application includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the methods and / or technical solutions of the aforementioned multiple embodiments of the present application.

[0074] The electronic device may be a user device, or a device formed by integrating a user device and a network device via a network, or an application running on the above device. The user device includes but is not limited to various terminal devices such as computers, mobile phones, tablets, smart watches, and bracelets. The network device includes but is not limited to network hosts, single network servers, multiple network server sets, or cloud computing-based computer collections, and can be used to implement some of the processing functions when setting an alarm. Here, the cloud is composed of a large number of hosts or network servers based on cloud computing (Cloud Computing), where cloud computing is a type of distributed computing, a virtual computer composed of a group of loosely coupled computers.

[0075] Example 5

[0076] Figure 3The structure of an electronic device suitable for implementing the method and / or technical solution in the embodiment of the present application is shown. The device 300 includes a central processing unit (CPU) 301, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 302 or the program loaded from the storage part 308 into the random access memory (RAM) 303. In RAM 303, various programs and data required for system operation are also stored. CPU 301, ROM 302 and RAM 303 are connected to each other through a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.

[0077] The following components are connected to the I / O interface 305: an input section 306 including a keyboard, a mouse, a touch screen, a microphone, an infrared sensor, etc.; an output section 307 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), an LED display, an OLED display, etc., and a speaker; a storage section 308 including one or more computer-readable media such as a hard disk, an optical disk, a magnetic disk, a semiconductor memory, etc.; and a communication section 309 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 309 performs communication processing via a network such as the Internet.

[0078] In particular, the methods and / or embodiments in the embodiments of the present application can be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program code for executing the method shown in the flowchart. When the computer program is executed by the central processing unit (CPU) 301, the above-mentioned functions defined in the method of the present application are performed.

[0079] Example 6

[0080] Another embodiment of the present application further provides a computer-readable storage medium having computer program instructions stored thereon, which can be executed by a processor to implement the methods and / or technical solutions of any one or more embodiments of the present application.

[0081] Specifically, the present embodiment can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination thereof. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device.

[0082] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. This propagated data signal may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0083] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0084] Example 7

[0085] Another embodiment of the present application further provides a computer program product having a computer program stored thereon, wherein the computer program can be executed by a processor to implement the method and / or technical solution of any one or more embodiments of the present application

[0086] Computer program code for performing the operations of the present application can be written in one or more programming languages, or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0087] The flow chart or block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the equipment, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, program segment or a part of code, and the module, program segment or a part of code include one or more executable instructions for realizing the logical function of the specification. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated system for hardware that performs the function or operation of the specification, or can be implemented with a combination of dedicated hardware and computer instructions.

[0088] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0089] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or page components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0090] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0091] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0092] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute some steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program code.

[0093] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application 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 application.

[0094] Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices recited in a device claim may also be implemented by a single unit or device through software or hardware. Terms such as "first" and "second" are used to indicate names and do not imply any particular order.

Claims

1. A physical machine service upgrade method for upgrading an old service to a new service, wherein: The method is applied to a physical machine service upgrade system, the system including iptables and a proxy process, and the method includes: In response to a service upgrade request, the proxy process receives a request message forwarded by the iptables, the request message being sent by an upper-layer user; The proxy process sends the request information to the old service and the new service, and receives response information returned by the old service and the new service; Based on the response information returned by the old service and the new service, and in accordance with the preset old and new service switching rules, the proxy process switches the new service to the main service so that it returns response information to the upper-level user to implement the physical machine service upgrade.

2. The physical machine service upgrade method according to claim 1, wherein: The preset new and old service switching rules include: The proxy process verifies the consistency of the response information returned by the old service and the new service, and obtains the consistency frequency of the response information returned by the old service and the new service.

3. The physical machine service upgrade method according to claim 2, wherein: The preset new and old service switching rules also include: If the proxy process verifies that the response information returned by the old service and the new service are consistent, the consistency frequency of the response information returned by the old service and the new service is cumulatively increased by 1; If the proxy process verifies that the response information returned by the old service and the new service are inconsistent, the consistency frequency of the response information of the old service and the new service will be cleared to 0 and accumulated again, and the new service will be optimized until the response information returned by the new service is consistent with the response information returned by the old service.

4. The physical machine service upgrade method according to claim 3, wherein: According to the preset new and old service switching rules, the proxy process switches the new service to the main service so that it returns a response message to the upper-layer user, including: If the consistency frequency of the response information returned by the old service and the new service exceeds a first preset value, the proxy process switches the new service to the main service so that it returns the response information to the upper-layer user; If the consistency frequency of the response information returned by the old service and the new service does not exceed a first preset value, the old service continues to return the response information to the upper-layer user as the main service.

5. The physical machine service upgrade method according to claim 4, wherein: According to the preset new and old service switching rules, the proxy process switches the new service to the main service so that it returns a response message to the upper-layer user, and further includes: If the consistency frequency of the response information returned by the old service and the new service does not exceed a second preset value, continuing to verify the consistency of the response information of the old service and the new service, wherein the second preset value is greater than the first preset value; If the proxy process verifies that the response information returned by the old service and the new service are consistent, the new service continues to return the response information to the upper-layer user as the main service; If the proxy process verifies that the response information of the old service and the new service are inconsistent, the proxy process switches the old service to the main service so that it returns the response information to the upper-layer user until the consistency frequency exceeds the first preset value.

6. The physical machine service upgrade method according to claim 5, wherein: The proxy process switches the new service to the main service so that it returns response information to the upper-layer user, further comprising: If the consistency frequency exceeds a second preset value, iptables is deleted, the proxy process is terminated, and the old service is decoupled. The proxy process switches the new service as the main service and returns a response message to the upper-level user to implement a physical machine service upgrade.

7. The physical machine service upgrade method according to claim 6, wherein: The preset new and old service switching rules also include: If the consistency frequency of the response information returned by the old service and the new service exceeds a first preset value and does not exceed a second preset value, the proxy process verifies the consistency of the response information returned by the old service and the new service; If the proxy process verifies that the response information returned by the old service is consistent with the response information returned by the new service, the proxy process discards the response information returned by the old service.

8. A physical machine service upgrade system, wherein: The system is used to upgrade old services to new services, and the system includes: iptables and a proxy process; The iptables is in communication with the request information receiving port of the old service, so as to intercept and forward the request information sent by the upper layer user to the old service; The proxy process is connected to the iptables for receiving the request information forwarded by the iptables; The proxy process is respectively communicated with the old service and the new service to send the request information to the new service and the old service and receive the response information returned by the old service and the new service; it is also used to switch the new service to the main service based on the response information returned by the new service and the old service and in accordance with the preset new and old service switching rules so that it returns the response information to the upper-level user to realize the physical machine service upgrade.

9. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7.

10. A computer-readable medium having computer program instructions stored thereon, wherein the computer program instructions can be executed by a processor to implement the method according to any one of claims 1 to 7.

11. A computer program product comprising a computer program, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.