Physical machine service upgrading method, system and equipment and computer readable medium

Through the combination of iptables and proxy processes, the problem of the verification and switching of the response information between new and old services in the service architecture upgrade is solved, and the unconscious service upgrade is achieved, reducing system complexity and risks, and ensuring service upgrades are ensured. reliability and stability.

CN119166176AActive Publication Date: 2024-12-20SHANGHAI BILIBILI TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The existing technology cannot realize the dual write/double read function of new services and old services during the service architecture upgrade process, and the load balancer configuration update increases system complexity and risks, and it is impossible to verify that the response information of new services and old services are consistent. affects the reliability of service upgrades and rollbacks.

Method used

Through iptables and proxy processes, receive and forward user requests, verify the consistency of response information of new and old services, switch the new service as the main service according to preset rules, realize unaware service upgrades upstream and downstream, and use iptables and proxy processes to decouple them. Dependency relationship ensures that the consistency frequency of response information reaches the threshold and switches.

Benefits of technology

It realizes the consistency between the response information between the new service and the old service without modifying the service architecture program, reduces the complexity of service upgrades and rollbacks, improves the stability and reliability of the system, and realizes new services and Smooth switching of old services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119166176A_ABST
    Figure CN119166176A_ABST
Patent Text Reader

Abstract

The invention provides a physical machine service upgrading method, system and device and a computer readable medium, the method is applied to the physical machine service upgrading system, the system comprises iptables and a proxy process, and the method comprises the following steps: in response to a service upgrading request, the proxy process receives request information forwarded by the iptables, and sends the request information to the iptables; the request information is 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; on the basis of response information returned by the old service and the new service, according to a preset new and old service switching rule, the agent process switches the new service as a main service to enable the main service to return response information to the upper layer user so as to achieve physical machine service upgrading.
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 application that are recited in the claims. The description herein is not admitted to be prior art by inclusion in this section.

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

[0004] However, the above method has the following problems: on the one hand, although the service upgrade and rollback 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, without modifying the service architecture program, the consistency of the response information returned by the new / old service cannot be verified; on the other hand, when a load balancer is used to implement the upgrade, the configuration of the load balancer 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 implement the service upgrade.

[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 of 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 to upgrade 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 request information forwarded by the iptables, the request information 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 a 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] Further, 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 return response information to the upper-level user as the main service.

[0014] 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, 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 as 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 achieve 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] In another aspect of the present application, a physical machine service upgrade system is provided, the system is used to upgrade an old service to a new service, the system comprising: Iptables and a proxy process;

[0018] The iptables is connected to the request information receiving port of the old service for intercepting and forwarding the request information sent by the upper layer user to the old service;

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

[0020] The proxy process is communicated with the old service and the new service respectively, so as 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, the 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 so that the at least one processor can execute 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, wherein the computer program implements the physical machine service upgrade method when executed by a processor.

[0027] In the scheme 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 sent by the upper-layer 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-layer 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 the description 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 paying any creative labor.

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

[0030] Figure 1 A flow chart 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 present invention 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] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

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

[0036] The 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. The memory is an example of a computer-readable medium.

[0037] Computer readable media include permanent and non-permanent, removable and non-removable media, and can be implemented by any method or technology to store information. Information can be computer program instructions, data structures, modules of programs 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, read-only compact disk (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.

[0038] The 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 request information forwarded by the iptables, the request information 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 a physical machine service upgrade.

[0042] Specifically, the iptables described in this application is a management tool of 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 the 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, tablet computers, 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 sets, 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, where cloud computing is a type of distributed computing, a virtual computer composed of a group of loosely coupled computer sets.

[0044] Embodiment 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 the request information sent by the upper-layer user 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 serves as the decision-making mechanism for new and old services, and its main operations include: traffic direction decision, data comparison decision, new and old service switching node decision, etc. That is, when a new service is just launched, the accuracy of the service cannot be guaranteed. At this time, the decision in the proxy process is based on the read and write results of the old service, and the new service is only observed in the bypass; but after the basic function of the new service is successfully verified, the proxy process decision can be set to compare whether the data returned by the new service is consistent with the data returned by the old service. After confirming that the consistency verification is sufficient, the new service read and write results can be set as the benchmark, and the old service can be used for fault rollback. In this way, the proxy process can control the role positioning of new and old services.

[0050] In one of the implementation modes, 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 the response information to the upper-level user.

[0051] In one of the embodiments, 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 the response information returned by the new service and the old service for verification. Within the preset second time period, when the response information returned by the new service is inconsistent with the response information returned by the old service, the old service is switched back to the main service, and the business code of the new service is re-modified and launched, so as to achieve client-unawareness and program hot repair.

[0053] In one of the embodiments, 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 response information to the upper-level user to achieve a physical machine service upgrade.

[0054] Embodiment 2

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

[0056] Step S101: In response to a service upgrade request, the proxy process receives request information forwarded by the iptables, wherein the request information 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, according to 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 also 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 of 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 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 return response information to the upper-level user as the main service.

[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 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.

[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 also include: if the consistency frequency of the response information returned by the old service and the new service exceeds the first preset value and does not exceed the 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 is 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 upstream and downstream perception, ultimately achieving the purpose of service upgrade.

[0066] Embodiment 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 the old service to the new service, and the system includes:

[0068] Iptables and proxy processes;

[0069] The iptables is connected to the request information receiving port of the old service for intercepting and forwarding the request information sent by the upper layer user to the old service;

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

[0071] The proxy process is communicated with the old service and the new service respectively, so as 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] Embodiment 4

[0073] Based on the same inventive concept, an electronic device is also provided in an embodiment of the present application, and the method corresponding to the electronic device may be the method for physical machine service upgrade 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 executable 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 through a network, or may be an application running on the above device. The user device includes but is not limited to various terminal devices such as computers, mobile phones, tablet computers, 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 sets, 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, where cloud computing is a type of distributed computing, a virtual computer composed of a group of loosely coupled computer sets.

[0075] Embodiment 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, and the device 300 includes a central processing unit (CPU, Central Processing Unit) 301, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM, Read Only Memory) 302 or the program loaded from the storage part 308 to the random access memory (RAM, Random Access Memory) 303. In RAM303, 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, Input / Output) 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 a cathode ray tube (CRT), a liquid crystal display (LCD), an LED display, an OLED display, etc., and a speaker, etc.; 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 may 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 functions defined in the method of the present application are executed.

[0079] Embodiment 6

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

[0081] Specifically, the present embodiment may adopt any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, 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 may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device, or device.

[0082] Computer readable signal media may include a data signal propagated in baseband or as part of a carrier wave, which carries a computer readable program code. Such propagated data signals may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than a computer readable storage medium, which may send, propagate, or transmit 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] Embodiment 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 described above.

[0086] Computer program code for performing the operations of the present application may 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 may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may 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 may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0087] The flow chart or block diagram in the accompanying drawings shows the possible architecture, function and operation of the equipment, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square 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 square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated system for hardware that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0088] Those skilled in the art can 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 the present 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 separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0091] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit 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, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program codes.

[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 it. 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] In addition, 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 stated in a device claim can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate 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 includes iptables and a proxy process, and the method includes: In response to a service upgrade request, the proxy process receives request information forwarded by the iptables, the request information 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 a 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 is consistent with that returned by the new service, 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 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.

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 response information 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 3 or 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 response information to the upper 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, continue to check 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 again 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, and also includes: If the consistency frequency exceeds the 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 so that it returns response information to the upper-level user to implement the 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 the old service to the new service, and the system includes: Iptables and a proxy process; The iptables is connected to the request information receiving port of the old service for intercepting and forwarding the request information sent by the upper layer user to the old service; The proxy process is connected to the iptables for receiving request information forwarded by the iptables; The proxy process is communicated with the old service and the new service respectively, so as 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.

Citation Information

Patent Citations

  • Server gray scale upgrading method and apparatus, and corresponding gray scale upgrading server

    CN103888281A

  • Method and system for keeping functional consistency of SOA service conversion language

    CN107229566A

  • Service request processing method and device, storage medium and computing equipment

    CN112311786A

  • Gateway-based old server upgrading method and system

    CN112637326A

  • Interface consistency verification method and device, equipment and storage medium

    CN114661590A