System switching method and device and electronic equipment
By generating and sending a request signal of preconfigured data heads during the system switching process, the problem of service interruption during the system upgrade is solved, and the stability verification of the second system is realized without affecting the normal service of the terminal equipment.
Patent Information
- Application Number
- CN202510607686.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-12
- Publication Date
- 2025-08-29
AI Technical Summary
In key industries, the system cannot be shut down during the upgrade process, resulting in business interruption when the new system is not tested intact.
By acquiring the request signal of the terminal device, adding a pre-configured data header to generate a second request signal, and sending it to the first and second systems, the system switches based on the response data after receiving the response data, ensuring that the stability of the second system is verified without affecting the normal request of the terminal device.
Without interrupting the business, the stability verification of the second system is achieved, avoiding the problem of business interruption.
Smart Images

Figure CN120560698A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of electronic technology, and in particular to a system switching method, device, and electronic equipment. Background Art
[0002] With the continuous advancement and development of science and technology, major upgrades or updates to existing data processing systems have become inevitable. However, in some critical industries, system upgrades require no downtime, meaning that business operations cannot be interrupted or impacted. Therefore, before a new system is implemented, it must be independently tested and verified, and then the new system, having been tested and verified, can be used to directly replace the old one. However, this approach can lead to business interruptions if the new system is not fully tested. Summary of the Invention
[0003] The present application provides a system switching method, device and electronic equipment for implementing system switching without interrupting services.
[0004] In a first aspect, the present application provides a system switching method, the method comprising: Obtaining main body data in a first request signal sent by a terminal device, and adding a preconfigured data header to the main body data to generate a second request signal, wherein the preconfigured data header includes at least a destination address; Sending the first request signal to the first system, and sending the second request signal to the second system according to the destination address; receiving response data returned by the second system based on the second request signal; Based on the response data, the signal of the terminal device is switched from the first system response to the second system response.
[0005] Based on the above solution, before switching the response system for a terminal device's request, the terminal device's request is copied and then sent to the second system for response. After the response is accepted, the switch is performed. Furthermore, before the switch, the terminal device's request will continue to be responded to by the first system, without affecting the terminal device's normal requests, thus avoiding service interruption for the terminal device.
[0006] In an optional embodiment, obtaining body data in a first request signal sent by a terminal device, and adding a preconfigured data header to the body data to generate a second request signal includes: Obtaining a first request signal sent by a terminal device, splitting the first request signal into a data header and the body data, Based on the destination address, a preconfigured data header is determined, and the preconfigured data header is added to the main data to generate the second request signal.
[0007] This method can copy the request of the terminal device and forward the copied request signal to the second system for processing, thereby ensuring that the second system can be verified based on the second request without affecting the services of the first system.
[0008] In an optional embodiment, switching the signal of the terminal device from the first system response to the second system response based on the response data includes: Determining whether the response data is consistent with pre-stored response data; If they are consistent, switching the signal of the terminal device from the first system response to the second system response; If they are inconsistent, the first system continues to respond to the information of the terminal device.
[0009] In an optional embodiment, switching the signal of the terminal device from the first system response to the second system response based on the response data includes: In response to the response data passing the verification, the verification pass count is updated; Determine whether the updated verification pass count is greater than a threshold; If yes, switching the signal of the terminal device from the first system response to the second system response; If not, the first system continues to respond to the signal from the terminal device.
[0010] In this way, the stability of the second system can be determined by the number of verification passes, and then when the second system can stably and correctly output response data, the response object of the terminal device can be directly switched. In this way, the second system can be verified without affecting the normal business of the terminal device, thereby avoiding business interruption.
[0011] In an optional embodiment, after switching the information of the terminal device from the first system response to the second system response, the method includes: monitoring whether the response information of the second system is abnormal; If so, the signal of the terminal device is switched from the second system response back to the first system response.
[0012] In a second aspect, the present application provides a system switching device, the device comprising: a processing module, configured to obtain main body data in a first request signal sent by a terminal device, and add a preconfigured data header to the main body data to generate a second request signal, wherein the preconfigured data header includes at least a destination address; a sending module, configured to send the first request signal to the first system, and send the second request signal to the second system according to the destination address; The switching module is configured to receive response data returned by the second system based on the second request signal; and based on the response data, switch the signal of the terminal device from the first system response to the second system response.
[0013] In an optional embodiment, the processing module is specifically used to obtain a first request signal sent by the terminal device, split the first request signal into a data header and the main data, determine a pre-configured data header based on the destination address, add a pre-configured data header to the main data, and generate the second request signal.
[0014] In an optional embodiment, the switching module is specifically configured to update the verification pass count in response to the response data passing the verification; Determine whether the updated verification pass count is greater than a threshold; If yes, switching the signal of the terminal device from the first system response to the second system response; If not, the first system continues to respond to the signal from the terminal device.
[0015] In a third aspect, the present application provides an electronic device, comprising: Memory for storing computer programs; The processor is configured to implement the steps of the above-mentioned system switching method when executing the computer program stored in the memory.
[0016] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned system switching method are implemented.
[0017] For each of the above-mentioned aspects from the second to the fourth aspects and the technical effects that may be achieved by each of the aspects, please refer to the above-mentioned description of the technical effects that can be achieved by the first aspect or the various possible solutions in the first aspect, and no further details will be given here. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 A flowchart of a system switching method provided by this application; Figure 2 A schematic diagram of the structure of a dual system provided for this application; Figure 3 A schematic structural diagram of a system switching device provided in this application; Figure 4This is a schematic diagram of the structure of an electronic device provided in this application. DETAILED DESCRIPTION
[0019] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail with reference to the accompanying drawings. The specific operating methods in the method embodiments can also be applied to device embodiments or system embodiments. It should be noted that in the description of the present application, "multiple" is understood as "at least two". "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent the following three situations: A exists alone, A and B exist at the same time, and B exists alone. A is connected to B, which can represent the following two situations: A is directly connected to B and A is connected to B through C. In addition, in the description of the present application, words such as "first" and "second" are only used to distinguish the purpose of description, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying order.
[0020] Major upgrades or updates to existing data processing systems are now inevitable. However, in some critical industries, system upgrades require no downtime, meaning no disruption to business operations. Therefore, before a new system is implemented, it must be independently tested and verified, and then the new, verified system is directly installed to replace the old one. However, this approach can lead to business interruptions if the new system is not fully tested.
[0021] In response to the above technical problems, the present application provides a system switching method, which is applied to a controller, which is connected to a first system and a second system, and the second system is a new system created after the function or service of the first system is updated. Therefore, the controller obtains the main data in the first request signal sent by the terminal device, adds a pre-configured data header to the main data, generates a second request signal, sends the first request signal to the first system, and sends the second request signal to the second system according to the destination address, receives the response data returned by the second system based on the second request signal, and finally, based on the response data, switches the information of the terminal device from the first system response to the second system response. Therefore, it can be seen from the above technical solution that before switching the response system of the terminal device's request, the terminal device's request will be copied, and then the copied request will be responded to by the second system, and the switching will be performed after the response is passed. And before switching, the terminal device's request will still be responded to by the first system, which will not affect the normal request of the terminal device, thereby avoiding the service interruption problem of the terminal device.
[0022] The embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0023] Reference Figure 1As shown, the embodiment of the present application provides a system switching method, which is applied as follows Figure 2 In the controller of the system shown, Figure 2 The system shown includes a controller, a first system, and a second system. Of course, the controller can also be configured in the first system, the second system, or other systems. The method includes: S1, obtaining the main body data in the first request signal sent by the terminal device, and adding a preconfigured data header to the main body data to generate a second request signal; Specifically, in an embodiment of the present application, the controller is connected to a terminal device and is capable of receiving a request signal sent by the terminal device. Therefore, after receiving a first request signal from the terminal device, the controller first parses the first request signal and splits the first request signal into a data header and body data. It should be noted that the split first request signal is a signal copied from the original first request signal.
[0024] After splitting out the main data and the data header, the destination address is retrieved. The destination address is a pre-configured destination address. The configured destination address here can be any destination address selected from an address database, or it can be a destination address determined based on the server identifier parsed from the first request signal.
[0025] After obtaining the destination address, a preconfigured data header is determined or generated, the preconfigured data header including the destination address, and then the preconfigured data header is combined with the main data to generate a second request signal. Ultimately, the second request signal includes the destination address.
[0026] This method can copy the request of the terminal device and forward the copied request signal to the second system for processing, thereby ensuring that the second system can be verified based on the second request without affecting the services of the first system.
[0027] S2, sending the first request signal to the first system, and sending the second request signal to the second system according to the destination address; After generating the second request signal, the first request signal is first sent to the first system, so that the first system will forward it to the corresponding server for response according to the destination address in the first request signal, and then the response data of the server corresponding to the first system will be obtained.
[0028] Of course, in the next process, the controller also sends a second request signal to the second system, so that the second system will forward it to the corresponding server for response according to the destination address in the second request signal, and at this time the response data of the server corresponding to the second system will be obtained.
[0029] In step S2, the request signals of different data headers can be forwarded to the corresponding systems, and then the response data of different systems can be obtained. In this way, the second system can be verified without affecting the normal business of the terminal device, thereby avoiding business interruption.
[0030] S3, receiving response data returned by the second system based on the second request signal; Specifically, after sending the second request signal to the second system, the second system will parse the destination address in the data header of the second request signal, and then send the second request signal to the corresponding server according to the destination address. The server will then respond according to the second request signal, and finally the controller will obtain the response data.
[0031] S4, based on the response data, switching the signal of the terminal device from the first system response to the second system response.
[0032] After receiving the response data of the second system, the response data of the second system is first analyzed, and then it is determined whether it is necessary to switch from the first system to the second system according to the analysis result. In the embodiment of the present application, whether switching is required can be determined in the following two ways: Method 1: After receiving the response data from the second system, it is determined whether the response data is normal. For example, if the second request signal is a Hypertext Transfer Protocol (HTTP) request, and after processing in the second system, a response code is obtained, if the response code is 200, it indicates that the response data is normal. At this point, it can be further confirmed that the second system can respond normally to the request signal. At this point, the terminal device's signal can be switched from the first system to the second system for response.
[0033] In this way, request signals with different data headers can be forwarded to the corresponding systems, and then response data from different systems can be obtained. When the response data indicates that the second system can respond normally to the request signal of the terminal device, the response object of the terminal device is directly switched. In this way, the second system can be verified without affecting the normal business of the terminal device, thereby avoiding business interruption.
[0034] Method 2: Before receiving the response data from the second system, the response data corresponding to the second request signal is first saved. Therefore, after receiving the response data from the second system, a determination is made as to whether the response data is consistent with the pre-stored response data. If the response data from the second system is consistent with the pre-stored response data, it is determined that the second system is capable of responding normally to the terminal device's request signal. At this point, the terminal device's signal is switched from being responded to by the first system to being responded to by the second system.
[0035] Of course, if the response data of the second system is inconsistent with the pre-stored response data, the first system will continue to respond to the signal of the terminal device.
[0036] In this way, request signals with different data headers can be forwarded to the updated system, and then the corresponding response data can be obtained. When the response data of the second system is consistent with the pre-stored response data, the response object of the terminal device is directly switched. In this way, the second system can be verified without affecting the normal business of the terminal device, thereby avoiding business interruption.
[0037] Method 3: After receiving the response data from the second system, the response data is first verified to determine whether the response data is normal. If the response data is normal, the verification passes. If the response data is abnormal, the verification fails.
[0038] When the response data is verified, the verification pass count is updated. A counter can be configured here to accumulate the verification pass count.
[0039] It should be noted that the number of verification passes does not refer to the number of times the same response data has been verified, but rather the number of times different response data has been verified. In other words, the response data corresponding to different request signals needs to be verified, and if the verification passes, the verification pass count is accumulated.
[0040] Then, a determination is made as to whether the updated number of verification passes is greater than a threshold. If so, the terminal device's signal is switched from the first system to the second system. If so, the first system continues to respond to the terminal device's signal.
[0041] In this way, the stability of the second system can be determined by the number of verification passes, and then when the second system can stably and correctly output response data, the response object of the terminal device can be directly switched. In this way, the second system can be verified without affecting the normal business of the terminal device, thereby avoiding business interruption.
[0042] Furthermore, in an optional embodiment, after switching the terminal device's signal from the first system to the second system for response, the controller will monitor in real time whether the second system's response to the terminal device's signal is abnormal, that is, monitor whether the second system is operating normally. If the second system's response is abnormal, another switch will be triggered. At this time, the terminal device's signal response will be switched from the second system back to the first system for response. This effectively prevents the second system from switching back to the normally operating first system to respond to the terminal device in the event of an abnormality.
[0043] Of course, after switching the signal of the terminal device from the second system response back to the first system for response, if the abnormal recovery of the second system is detected, the controller switches the signal of the terminal device from the first system back to the second system for response, so as to ensure that the second system can promptly recover the response to the terminal device.
[0044] Based on the same inventive concept, a system switching device is also provided in the embodiment of the present application, referring to Figure 3 The structure diagram of a system switching device provided by the present application is shown, and the device includes: The processing module 301 is configured to obtain body data in a first request signal sent by a terminal device, and add a preconfigured data header to the body data to generate a second request signal, wherein the preconfigured data header includes at least a destination address; a sending module 302, configured to send the first request signal to the first system, and send the second request signal to the second system according to the destination address; The switching module 303 is configured to receive response data returned by the second system based on the second request signal; and based on the response data, switch the signal of the terminal device from the first system response to the second system response.
[0045] Further, in an embodiment of the present application, the processing module 301 is specifically used to obtain a first request signal sent by the terminal device, split the first request signal into a data header and the main data, determine a pre-configured data header based on the destination address, add a pre-configured data header to the main data, and generate the second request signal.
[0046] Further, in an embodiment of the present application, the switching module 303 is specifically used to update the number of verification passes in response to the response data verification being passed; determine whether the updated number of verification passes is greater than a threshold; if so, switch the signal of the terminal device from the first system response to the second system response; if not, maintain the first system response to the signal of the terminal device.
[0047] Based on the same inventive concept, an electronic device is also provided in an embodiment of the present application. The electronic device can realize the function of the aforementioned system switching device. Figure 4 , the electronic device includes: At least one processor 401, and a memory 402 connected to the at least one processor 401. The specific connection medium between the processor 401 and the memory 402 is not limited in the embodiment of the present application. Figure 4 In the example, the processor 401 and the memory 402 are connected via a bus 400. Figure 4 The bus 400 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 The diagram is represented by only one thick line, but this does not mean that there is only one bus or one type of bus. Alternatively, the processor 401 may also be referred to as a controller, without limitation to the name.
[0048] In the embodiment of the present application, the memory 402 stores instructions that can be executed by at least one processor 401. The at least one processor 401 can execute a system switching method discussed above by executing the instructions stored in the memory 402. The processor 401 can implement Figure 3 The functions of each module in the device shown.
[0049] Among them, the processor 401 is the control center of the device, which can use various interfaces and lines to connect the various parts of the entire control device, and monitor the device as a whole by running or executing instructions stored in the memory 402 and calling data stored in the memory 402, the various functions of the device and processing data.
[0050] In one possible design, processor 401 may include one or more processing units. Processor 401 may integrate an application processor and a modem processor. The application processor primarily processes the operating system, user interface, and application programs, while the modem processor primarily handles wireless communications. It is understood that the modem processor may not be integrated into processor 401. In some embodiments, processor 401 and memory 402 may be implemented on the same chip. In some embodiments, they may also be implemented on separate chips.
[0051] The processor 401 can be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, and can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of a system switching method disclosed in conjunction with the embodiments of the present application can be directly embodied as being executed by a hardware processor, or can be executed by a combination of hardware and software modules in the processor.
[0052] The memory 402 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 402 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (Random Access Memory, RAM), a static random access memory (Static Random Access Memory, SRAM), a programmable read-only memory (Programmable Read Only Memory, PROM), a read-only memory (Read Only Memory, ROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic memory, a disk, an optical disk, etc. The memory 402 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 402 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.
[0053] By designing and programming the processor 401, the code corresponding to the system switching method described in the above embodiment can be fixed into the chip, so that the chip can execute the system switching method when running. Figure 1 The steps of a system switching method in the embodiment shown are as follows: How to design and program the processor 401 is a technique well known to those skilled in the art and will not be described in detail here.
[0054] Based on the same inventive concept, an embodiment of the present application further provides a storage medium storing computer instructions. When the computer instructions are executed on a computer, the computer executes a system switching method discussed above.
[0055] In some possible implementations, various aspects of a system switching method provided in the present application may also be implemented in the form of a program product, which includes program code. When the program product is run on an apparatus, the program code is used to enable the control device to execute the steps of a system switching method according to various exemplary implementations of the present application described above in this specification.
[0056] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0057] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0058] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0059] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0060] Obviously, those skilled in the art may make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalents, this application is intended to include these modifications and variations.
Claims
1. A system switching method, characterized in that: The method comprises: Obtaining main body data in a first request signal sent by a terminal device, and adding a preconfigured data header to the main body data to generate a second request signal, wherein the preconfigured data header includes at least a destination address; Sending the first request signal to the first system, and sending the second request signal to the second system according to the destination address; receiving response data returned by the second system based on the second request signal; Based on the response data, the signal of the terminal device is switched from the first system response to the second system response.
2. The method according to claim 1, wherein Obtaining body data in a first request signal sent by a terminal device, and adding a preconfigured data header to the body data to generate a second request signal, including: Obtaining a first request signal sent by a terminal device, splitting the first request signal into a data header and the body data, Based on the destination address, a preconfigured data header is determined, and the preconfigured data header is added to the main data to generate the second request signal.
3. The method according to claim 1, wherein Switching the signal of the terminal device from the first system response to the second system response based on the response data includes: Determining whether the response data is consistent with pre-stored response data; If they are consistent, switching the signal of the terminal device from the first system response to the second system response; If they are inconsistent, the first system continues to respond to the information of the terminal device.
4. The method according to claim 1, wherein Switching the signal of the terminal device from the first system response to the second system response based on the response data includes: In response to the response data passing the verification, the verification pass count is updated; Determine whether the updated verification pass count is greater than a threshold; If yes, switching the signal of the terminal device from the first system response to the second system response; If not, the first system continues to respond to the signal from the terminal device.
5. The method according to claim 1, wherein After switching the information of the terminal device from the first system response to the second system response, the method includes: monitoring whether the response information of the second system is abnormal; If so, the signal of the terminal device is switched from the second system response back to the first system response.
6. A system switching device, characterized in that: The device comprises: a processing module, configured to obtain main body data in a first request signal sent by a terminal device, and add a preconfigured data header to the main body data to generate a second request signal, wherein the preconfigured data header includes at least a destination address; a sending module, configured to send the first request signal to the first system, and send the second request signal to the second system according to the destination address; The switching module is configured to receive response data returned by the second system based on the second request signal; and based on the response data, switch the signal of the terminal device from the first system response to the second system response.
7. The device according to claim 6, characterized in that The processing module is specifically used to obtain a first request signal sent by the terminal device, split the first request signal into a data header and the main data, determine a pre-configured data header based on the destination address, add a pre-configured data header to the main data, and generate the second request signal.
8. The device according to claim 6, wherein The switching module is specifically configured to update the verification pass count in response to the response data passing the verification; Determine whether the updated verification pass count is greater than a threshold; If yes, switching the signal of the terminal device from the first system response to the second system response; If not, the first system continues to respond to the signal from the terminal device.
9. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the method steps of any one of claims 1 to 5 when executing the computer program stored in the memory.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps according to any one of claims 1 to 5 are implemented.