Service back-switching method and device, equipment and storage medium
By synchronizing the difference data between the virtual machine and the business host and determining the turning back moment based on the business status, the problem of busy business during the business turning back is solved, and the business demand that cannot be responded to when the turning back is achieved is reduced, bringing convenience to users.
Patent Information
- Application Number
- CN202411811962.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-03-18
AI Technical Summary
When the business switches back from the cloud to the business host, it often occurs during the busy stage of the business, resulting in a large number of services being unable to respond, causing inconvenience to users.
By synchronizing the difference data between the virtual machine and the service host corresponding to the rewind service, when the difference data synchronization is completed, the service status of the rewind service periodically obtains the service status and determines the time when the rewind service returns to the service host based on the service status.
When the frequency of retelling services is low, the retelling services will be cut back, which reduces the service demand that cannot be responded to at the time of retelling, bringing convenience to users.
Smart Images

Figure CN119645574A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a service switching back method, device, equipment and storage medium. Background Art
[0002] With the development of network communication technology, the business data on the business host will be protected in the cloud. In the event of a failure of the business host, the cloud will take over the business executed by the business host to ensure the normal operation of the business, and when the failure of the business host is restored, the business will be switched back to the business host. However, when the business is switched back from the cloud to the business host, it often happens during the busy business phase, which will cause a large number of business needs to be unable to be responded to, causing inconvenience to users.
[0003] Therefore the prior art still needs to be improved and enhanced. Summary of the invention
[0004] The technical problem to be solved by the present application is to provide a service switching back method, device, equipment and storage medium in view of the deficiencies in the prior art.
[0005] In order to solve the above technical problems, the first aspect of the present application provides a service switching back method, wherein the service switching back method specifically includes:
[0006] Synchronizing the difference data between the virtual machine and the service host corresponding to the switchback service, wherein the virtual machine is constructed based on the backup data of the service host and is used to execute the switchback service when the host is in a fault state;
[0007] When synchronization of the difference data is completed, periodically obtaining the service status of the switchback service;
[0008] When the service state is a first preset state, switching the switchback service back to the service host;
[0009] When the service status is the second preset status, the switchback service continues to be executed through the virtual machine, and the service data formed by the execution is synchronously written to the virtual machine and the service host, and the step of periodically obtaining the service status of the switchback service is re-executed.
[0010] The service switching back method, wherein the service status is determined based on the current time; and the periodic acquisition of the service status of the switching back service specifically includes:
[0011] Periodically obtaining the current time and matching the current time with a preset time period, wherein the preset time period is an idle time period for the switchback service;
[0012] If the current time matches the preset time period, the service state of the switchback service is set to the first preset state;
[0013] If the current time does not match the preset time period, the service state of the switchback service is set to a second preset state.
[0014] The service switching back method, wherein the service status is determined by the execution frequency of the switching back service; and the periodic acquisition of the service status of the switching back service specifically includes:
[0015] Periodically obtaining the execution frequency of the switchback service;
[0016] If the executed frequency is less than or equal to the frequency threshold, setting the service state of the switched back service to a first preset state;
[0017] If the execution frequency is greater than the frequency threshold, the service state of the switchback service is set to a second preset state.
[0018] The service switching back method, wherein before synchronizing the difference data between the virtual machine and the service host corresponding to the switched back service, the method further comprises:
[0019] Detect the host status of the service host corresponding to the switchback service;
[0020] When the host state is normal, the difference data between the virtual machine and the service host corresponding to the switched-back service is synchronized.
[0021] The service switching back method, wherein, before detecting the host status of the service host corresponding to the switching back service, the method further comprises:
[0022] When a service host fails, a detection operation is initiated to detect the host status of the service host corresponding to the switchback service, and a virtual machine is synchronously constructed in the cloud based on the backup data corresponding to the service host;
[0023] The switchback service is migrated to the virtual machine so as to execute the switchback service through the virtual machine.
[0024] The service switching back method, wherein before synchronizing the difference data between the virtual machine and the service host corresponding to the switched back service, the method further comprises:
[0025] Guide the business host to start up through the startup service preset in the cloud;
[0026] A host IP address configured by the service host based on the startup service is received, and the difference data is synchronized to the service host based on the host IP address.
[0027] The service switching back method, wherein the step of synchronizing the difference data to the service host based on the host IP address specifically includes:
[0028] Determine the service host based on the host IP address;
[0029] The synchronization service in the startup service communicates with the synchronization service in the virtual machine, and synchronizes the difference data to the service host through the communication.
[0030] A second aspect of the present application provides a service switching back device, wherein the service switching back device specifically includes:
[0031] A synchronization module, used to synchronize the difference data between the virtual machine and the service host corresponding to the switchback service, wherein the virtual machine is constructed based on the backup data of the service host, and is used to execute the switchback service when the host state is a fault state;
[0032] An acquisition module, used for periodically acquiring the service status of the switchback service after the synchronization of the difference data is completed;
[0033] A first processing module, configured to switch the switchback service back to the service host when the service state is a first preset state;
[0034] The second processing module is used to continue to execute the switchback service through the virtual machine when the service status is the second preset status, and synchronize the service data formed by the execution to the virtual machine and the service host, and re-execute the step of periodically obtaining the service status of the switchback service.
[0035] A third aspect of the present application provides a computer-readable storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the steps in any of the service switching back methods described above.
[0036] A fourth aspect of the present application provides a terminal device, comprising: a processor and a memory;
[0037] The memory stores a computer-readable program executable by the processor;
[0038] When the processor executes the computer-readable program, the steps in any of the above-mentioned service switching back methods are implemented.
[0039] Beneficial effect: Compared with the prior art, the present application provides a service switching back method, device, equipment and storage medium, the method comprising synchronizing the difference data between the virtual machine and the service host corresponding to the switching back service; when the synchronization of the difference data is completed, periodically obtaining the service status of the switching back service; when the service status is a first preset state, switching the switching back service to the service host; when the service status is a second preset state, continuing to execute the switching back service through the virtual machine, and synchronizing the service data formed by the execution to the virtual machine and the service host, and re-executing the step of periodically obtaining the service status of the switching back service. After the synchronization of the difference data between the virtual machine and the service host is completed, the present application determines the switching back time of the switching back service to the service host according to the service status of the switching back service, so that the switching back service can be switched back when the frequency of use of the switching back service is low, reducing the amount of service demand that cannot be responded to at the switching back time, bringing convenience to users. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0041] Figure 1 A flowchart of a service switching back method provided in an embodiment of the present application.
[0042] Figure 2 The following is a flowchart of an implementation method of the business status acquisition process.
[0043] Figure 3 The flowchart is another implementation of the business status acquisition process.
[0044] Figure 4 This is a functional block diagram of the service switching device provided in an embodiment of the present application.
[0045] Figure 5 A functional block diagram of a terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0046] The embodiments of the present application provide a service switching back method, device, equipment and storage medium. In order to make the purpose, technical solution and effect of the present application clearer and more specific, the present application is further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described here are only used to explain the present application and are not used to limit the present application.
[0047] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present application refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.
[0048] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as those generally understood by those skilled in the art to which this application belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with those in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined as here.
[0049] It should be understood that the sequence numbers and sizes of the steps in this embodiment do not mean the order of execution. The execution order of each process is determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application.
[0050] After research, it was found that with the development of network communication technology, the business data on the business host will be protected in the cloud. In the event of a failure of the business host, the cloud will take over the business executed by the business host to ensure the normal operation of the business, and when the failure of the business host is restored, the business will be switched back to the business host. However, when the business is switched back from the cloud to the business host, it often happens during the busy business phase, which will cause a large number of business needs to be unable to be responded to, causing inconvenience to users.
[0051] In order to solve the above problems, in an embodiment of the present application, the difference data between the virtual machine and the service host corresponding to the switchback service is synchronized; when the synchronization of the difference data is completed, the service status of the switchback service is periodically obtained; when the service status is a first preset state, the switchback service is switched back to the service host; when the service status is a second preset state, the switchback service continues to be executed through the virtual machine, and the service data formed by the execution is synchronized to the virtual machine and the service host, and the step of periodically obtaining the service status of the switchback service is re-executed. After the synchronization of the difference data between the virtual machine and the service host is completed, the present application determines the switchback time when the switchback service is switched back to the service host according to the service status of the switchback service, so that the switchback service can be switched back when the frequency of use of the switchback service is low, reducing the amount of business demand that cannot be responded to at the switchback time, bringing convenience to users.
[0052] The application content is further explained below through the description of embodiments in conjunction with the accompanying drawings.
[0053] This embodiment provides a service switching method, such as Figure 1 As shown, the method includes:
[0054] S10: Synchronize the difference data between the virtual machine and the service host corresponding to the switchback service.
[0055] Specifically, the switchback service is a service executed by the service host, wherein the service host can execute one service or multiple services. That is, the switchback service can be one or multiple. Here, the switchback service is taken as an example for subsequent description.
[0056] The difference data is the business data generated during the time period when the business host fails, and the business data is generated by the virtual machine in response to the switchback business. That is to say, during the time period when the business host fails, the virtual machine takes over the switchback business as the backup host of the business, and writes the business data corresponding to the switchback business to the virtual machine. It can be seen that two conditions need to be met before synchronizing the difference data to the business host. One is that the business host is converted from a faulty state to a normal state, and the other is that the difference data is stored on the virtual machine. Based on this, before synchronizing the difference data to the business host, it will be detected based on the above two conditions whether the synchronization operation is triggered, that is, before synchronizing the difference data between the virtual machine and the business host corresponding to the switchback business, the method also includes:
[0057] Detect the host status of the service host corresponding to the switchback service;
[0058] When the host state is normal, the difference data between the virtual machine and the service host corresponding to the switched-back service is synchronized.
[0059] Specifically, the host status includes a fault state and a normal state, the fault state indicates that the service host cannot perform the switchback service, and the normal state indicates that the service host can perform the switchback service. It should be noted that in the embodiment of the present application, when the host status of the service host is turned on, the service host is in a fault state. In other words, the host status of the service host corresponding to the switchback service detected in the embodiment of the present application refers to whether the service host corresponding to the switchback service is converted from a fault state to a normal state, and when the host status of the service host is monitored to be a fault state, the host status of the service host corresponding to the switchback service will continue to be detected, and when the host status of the service host is monitored to be a fault state, the difference data between the virtual machine and the service host will be synchronized.
[0060] In addition, before detecting the host status of the service host corresponding to the switching back service, a trigger condition for the detection operation is obtained, and only when the trigger condition is obtained will the detection operation be started to detect the host status of the service host corresponding to the switching back service, wherein the trigger condition for the detection operation is that the service host fails. Based on this, before detecting the host status of the service host corresponding to the switching back service, the method also includes:
[0061] When a service host fails, a detection operation is initiated to detect the host status of the service host corresponding to the switchback service, and a virtual machine is synchronously constructed in the cloud based on the backup data corresponding to the service host;
[0062] The switchback service is migrated to the virtual machine so as to execute the switchback service through the virtual machine.
[0063] Specifically, the failure of the service host can be determined by the service status of the back-switching service. For example, when the service status is in a down state, it is determined that the service host has failed. When the service host fails, it means that the service host cannot perform the back-switching service. At this time, a detection operation will be started to detect the host status of the service host corresponding to the back-switching service, and a virtual machine for performing the back-switching service will be built in the cloud to avoid the problem of the back-switching service being unable to be performed due to the failure of the service host.
[0064] Furthermore, the cloud backs up all the business data generated by the business host running the cutback business, which is recorded here as backup data. When the business host fails, the cloud can build a virtual machine based on the backup data. The virtual machine is used as the backup business host of the business host, and the virtual machine is used to take over the business host to execute the cutback business. In other words, the cloud will protect the business host, and then when the business host fails, it will build a backup business host for the business host by protecting the backed up backup data, and then migrate the cutback business to the backup business host (i.e., virtual device), realizing the active-standby switching of the cutback business between the host device and the backup business host.
[0065] In the embodiment of the present application, after a service host fails, the cloud will monitor the service status of the service host and build a virtual machine for the service host to serve as a backup service host, and then take over the switchback service through the virtual machine to ensure the normal operation of the switchback service. In this way, without adding additional hardware resources, the master-slave function between the service host and the backup service host is realized, and the function of automatically switching to the backup service host in the event of a service host failure is realized. Not only does it realize the migration of the switchback service without the user noticing, and the normal use of the switchback service is not required, which brings convenience to the user, but also does not require additional hardware resources, reducing the implementation cost of the master-slave service host.
[0066] In addition, when the cloud monitors the host status of the service host, it can monitor by receiving the host status notification sent by the service host, or by monitoring the connection status between the service host and the cloud, etc. There is no specific restriction here, as long as the method of monitoring the service status of the service host can be implemented. At the same time, in order to facilitate monitoring the host status from the fault state to the normal state, after migrating the switchback service to the virtual machine and executing the switchback service through the virtual machine, the host status of the service host corresponding to the switchback service will also be marked as a fault state.
[0067] In one implementation, before synchronizing the difference data between the virtual machine and the service host corresponding to the switched-back service, the method further includes:
[0068] Guide the business host to start up through the startup service preset in the cloud;
[0069] A host IP address configured by the service host based on the startup service is received, and the difference data is synchronized to the service host based on the host IP address.
[0070] Specifically, the preset startup service is pre-set and used to guide the host system startup of the business host (especially when there is no operating system in the business host). That is to say, the cloud will provide a startup service to the business host, so that the business host can start the system based on the guidance of the startup service, so as to synchronize data with the virtual machine. In addition, in actual applications, multiple virtual machines can be run on the cloud, and each of the multiple virtual machines corresponds to a different business host. Then, in order to obtain the virtual machine that needs to synchronize the difference time, after the business host is booted and started by the startup service, it will configure the host IP address in the synchronization service in the startup service, and then communicate with the synchronization service in the virtual machine through the synchronization service in the startup service, so that the cloud can know the host IP address of the business host that needs to synchronize the difference data, and then determine the virtual machine corresponding to the business host based on the host IP address, and synchronize the difference data on the virtual machine to the business host. It can be seen that each virtual machine is configured with the host IP address of its corresponding business host, and the host IP address is used as the host identifier of the business host.
[0071] In addition, the communication between the synchronization service in the startup service and the synchronization service in the virtual machine is used to transmit the difference data in addition to the host IP address. To this end, the synchronization of the difference data to the business host based on the host IP address specifically includes: determining the business host based on the host IP address; communicating with the synchronization service in the virtual machine through the synchronization service in the startup service, and synchronizing the difference data to the business host through the communication.
[0072] It should be noted that in actual applications, other information can also be used as the host identification (for example, the physical address of the business host, etc.). At the same time, the synchronization of differential data between the virtual machine and the business host can also be achieved in other ways, for example, directly establishing a connection channel between the business host and the virtual machine, and then synchronizing the differential data through the connection channel.
[0073] Furthermore, in the process of synchronizing the difference data between the virtual machine and the service host corresponding to the switchback service, the virtual machine responds to the switchback service, and the service data formed by the virtual machine in response to the switchback service is synchronously written to the disk of the virtual machine and the service host. In other words, while the virtual machine synchronizes the difference data to the service host, it also responds to the switchback service and writes the service data formed by the response service to the disk of the virtual machine and the service host at the same time, so that the service host synchronously obtains the difference data and the service data responding to the switchback service, so as to prepare for the service host to take over the switchback service.
[0074] S20: After synchronization of the difference data is completed, periodically obtain the service status of the switchback service.
[0075] Specifically, the completion of differential data synchronization means that the differential data between the virtual machine and the business host is zero, that is, the business host backs up the business data generated by the switchback service during the business host failure time period and the business data generated during the differential data synchronization time, so that the business host will not be unable to respond to the switchback service or the switchback service response will be incorrect due to lack of business data.
[0076] The service status is used to reflect whether the switchback service meets the switchback requirements, wherein the service status includes a first preset status and a second preset status, wherein the first preset status indicates that the switchback service meets the switchback requirements, and the second preset status indicates that the switchback service does not meet the switchback requirements. That is, when the service status is the first preset status, the switchback service can be switched back to the service host, whereas, when the service status is the second preset status, the switchback service cannot be switched back to the service host.
[0077] In one implementation, the switchback requirement is a predetermined time period, and the service status is determined based on the current time. Figure 2 As shown, the periodic acquisition of the service status of the switchback service specifically includes:
[0078] S210, periodically obtaining the current time and matching the current time with a preset time period;
[0079] S211, if the current time matches the preset time period, setting the service state of the switchback service to the first preset state;
[0080] S212: If the current time does not match the preset time period, set the service state of the switchback service to a second preset state.
[0081] Specifically, the preset time period can be pre-set, or can be determined based on historical experience data, or can be determined based on a neural network, etc. Among them, the process of determining the preset time period based on historical experience data can be: obtaining the back-switching service response data of the previous preset time (such as the previous 7 days, etc.) at a preset time (such as 0 o'clock every day, etc.), and based on the response data volume of each time period in several time periods preset by the back-switching service response data (such as dividing 1 day into 24 time periods with 1 hour as a time period, etc.), and based on the time period with the smallest response data volume as the preset time period. The process of determining the preset time period based on the neural network can be obtaining all the back-switching service response data of the previous day at 0 o'clock every day, and then inputting all the obtained back-switching service response data into a trained time period prediction model, and outputting the preset time period of the day through the time period prediction model, so that the preset time period of the next day can be determined according to the back-switching service response data of each day, so that the matching degree of the preset time period and the frequency of use of the back-switching service can be further improved, and then the amount of business demand that cannot be responded to at the back-switching moment can be further reduced.
[0082] Further, after obtaining the current time, the current time is matched with the preset time period, that is, it is checked whether the current time is included in the preset time period. If the current time is included in the preset time period, it is determined that the current time matches the preset time period, and the service state of the switchback service is set to the first preset state. On the contrary, if the current time is not included in the preset time period, it is determined that the current time does not match the preset time period, and the service state of the switchback service is set to the second preset state.
[0083] In another implementation, the switching back requirement is that the execution frequency is lower than the preset execution frequency, then the service status is determined by the execution frequency of the switching back service. Figure 3 As shown, the periodic acquisition of the service status of the switchback service specifically includes:
[0084] S220, periodically obtaining the execution frequency of the switchback service;
[0085] S221: If the executed frequency is less than or equal to the frequency threshold, set the service state of the switchback service to a first preset state;
[0086] S222: If the executed frequency is greater than the frequency threshold, set the service state of the switchback service to a second preset state.
[0087] Specifically, the executed frequency refers to the executed frequency between the current acquisition moment and the previous acquisition moment, that is, the executed frequency of the back-switched service between the current acquisition moment and the previous acquisition moment is periodically acquired. After the executed frequency is acquired, the executed frequency is compared with a preset frequency threshold. When the executed frequency is less than or equal to the frequency threshold, the service state of the back-switched service is set to the first preset state. On the contrary, when the executed frequency is greater than the frequency threshold, the service state of the back-switched service is set to the second preset state.
[0088] In addition, the execution frequency can also be a predicted execution frequency, which is the execution frequency between the current acquisition moment and the next acquisition moment, wherein the predicted execution frequency can be determined based on the first execution frequency between the current acquisition moment and the previous acquisition moment in the current time period (for example, the current day, etc.), the second execution frequency between the current acquisition moment and the previous acquisition moment in the previous time period (for example, the previous day, etc.), and the third execution frequency between the current acquisition moment and the next acquisition moment in the previous time period, for example, predicted execution frequency = (first execution frequency * third execution frequency) / second execution frequency; or, the first execution frequency, the second execution frequency and the third execution frequency are input into a trained frequency prediction model, and the frequency prediction model outputs the execution frequency between the current acquisition moment and the next acquisition moment (i.e., the predicted execution frequency).
[0089] S30: When the service state is a first preset state, switch the switchback service back to the service host.
[0090] Specifically, the service status being the first preset status indicates that the switchback service can be switched back to the service host, and for this purpose, the switchback service can be restarted, and when the switchback service is started, the service host executes the switchback service to switch the switchback service back to the service host. Of course, in actual applications, when the service status is the first preset status, a switchback notification of the switchback service can be sent to the administrator, and then feedback information formed by the administrator in response to the switchback notification can be received. If the feedback information is disagreement, the service status of the switchback service is periodically obtained again. If the feedback information is agreement or no feedback information is received, the switchback service is switched back to the service host.
[0091] S40. When the service status is the second preset status, continue to execute the switchback service through the virtual machine, and synchronously write the service data formed by the execution to the virtual machine and the service host, and re-execute the step of periodically obtaining the service status of the switchback service.
[0092] Specifically, the service status being the second preset status indicates that it is not suitable to switch back the switchback service to the service host, and for this purpose, the step of periodically obtaining the service status of the switchback service can be re-executed, and in the process, the switchback service continues to be executed through the virtual machine, and the service data formed by the execution is synchronously written to the virtual machine and the service host. Of course, in actual applications, when the service status is the second preset status, a switchback notification of the switchback service can be sent to the administrator to inquire whether to switch back the switchback service immediately through the switchback notification; then, feedback information formed by the administrator in response to the switchback notification is received, and if the feedback information is to switch back the service immediately, the switchback service is switched back to the service host; if the feedback information is not to switch back the service immediately or no feedback information is received, the step of periodically obtaining the service status of the switchback service is re-executed.
[0093] In summary, this embodiment provides a service switching back method, the method comprising synchronizing the difference data between the virtual machine and the service host corresponding to the switching back service; when the synchronization of the difference data is completed, periodically obtaining the service status of the switching back service; when the service status is a first preset state, switching the switching back service to the service host; when the service status is a second preset state, continuing to execute the switching back service through the virtual machine, and synchronizing the service data formed by the execution to the virtual machine and the service host, and re-executing the step of periodically obtaining the service status of the switching back service. After the synchronization of the difference data between the virtual machine and the service host is completed, the present application determines the switching back time of the switching back service to the service host according to the service status of the switching back service, so that the switching back service can be switched back when the frequency of use of the switching back service is low, reducing the amount of service demand that cannot be responded to at the switching back time, bringing convenience to users.
[0094] Based on the above service switching back method, this embodiment provides a service switching back device, such as Figure 4 As shown, the service switching back device specifically includes:
[0095] A synchronization module 100, used to synchronize the difference data between the virtual machine and the service host corresponding to the switchback service, wherein the virtual machine is constructed based on the backup data of the service host and is used to execute the switchback service when the host state is a fault state;
[0096] An acquisition module 200 is used to periodically acquire the service status of the switchback service after the synchronization of the difference data is completed;
[0097] A first processing module 300, configured to switch the switchback service back to the service host when the service state is a first preset state;
[0098] The second processing module 400 is used to continue to execute the switchback service through the virtual machine when the service status is the second preset status, and synchronize the service data formed by the execution to the virtual machine and the service host, and re-execute the step of periodically obtaining the service status of the switchback service.
[0099] Based on the above-mentioned service switching back method, this embodiment provides a computer-readable storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the steps in the service switching back method as described in the above-mentioned embodiment.
[0100] Based on the above service switching back method, the present application also provides a terminal device, such as Figure 5As shown, it includes at least one processor 20, a display screen 21, and a memory 22, and may also include a communication interface 23 and a bus 24. The processor 20, the display screen 21, the memory 22, and the communication interface 23 may communicate with each other through the bus 24. The display screen 21 is configured to display a preset user guide interface in the initial setting mode. The communication interface 23 may transmit information. The processor 20 may call the logic instructions in the memory 22 to execute the method in the above embodiment.
[0101] In addition, the logic instructions in the memory 22 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product.
[0102] The memory 22 is a computer-readable storage medium that can be configured to store software programs, computer executable programs, such as program instructions or modules corresponding to the methods in the embodiments of the present disclosure. The processor 20 executes functional applications and data processing by running the software programs, instructions or modules stored in the memory 22, that is, implementing the methods in the above embodiments.
[0103] The memory 22 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 22 may include a high-speed random access memory and may also include a non-volatile memory. For example, a variety of media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, may also be a transient storage medium.
[0104] In addition, the specific process of loading and executing the multiple instruction processors in the above-mentioned storage medium and the terminal device has been described in detail in the above-mentioned method, and will not be described one by one here.
[0105] 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.
Claims
1. A service switching back method, characterized in that: The service switching back method specifically includes: Synchronizing the difference data between the virtual machine and the service host corresponding to the switchback service, wherein the virtual machine is constructed based on the backup data of the service host and is used to execute the switchback service when the host is in a fault state; When synchronization of the difference data is completed, periodically obtaining the service status of the switchback service; When the service state is a first preset state, switching the switchback service back to the service host; When the service status is the second preset status, the switchback service continues to be executed through the virtual machine, and the service data formed by the execution is synchronously written to the virtual machine and the service host, and the step of periodically obtaining the service status of the switchback service is re-executed.
2. The service switching back method according to claim 1, characterized in that: The service status is determined based on the current time; the service status of the periodically obtained switchback service specifically includes: Periodically obtaining the current time and matching the current time with a preset time period, wherein the preset time period is an idle time period for the switchback service; If the current time matches the preset time period, the service state of the switchback service is set to the first preset state; If the current time does not match the preset time period, the service state of the switchback service is set to a second preset state.
3. The service switching back method according to claim 1, characterized in that: The service status is determined by the execution frequency of the switchback service; the periodic acquisition of the service status of the switchback service specifically includes: Periodically obtaining the execution frequency of the switchback service; If the executed frequency is less than or equal to the frequency threshold, setting the service state of the switched back service to a first preset state; If the execution frequency is greater than the frequency threshold, the service state of the switchback service is set to a second preset state.
4. The service switching back method according to claim 1, characterized in that: Before synchronizing the difference data between the virtual machine and the service host corresponding to the switchback service, the method further includes: Detect the host status of the service host corresponding to the switchback service; When the host state is normal, the difference data between the virtual machine and the service host corresponding to the switched-back service is synchronized.
5. The service switching back method according to claim 4, characterized in that: Before detecting the host status of the service host corresponding to the switchback service, the method further includes: When a service host fails, a detection operation is initiated to detect the host status of the service host corresponding to the switchback service, and a virtual machine is synchronously constructed in the cloud based on the backup data corresponding to the service host; The switchback service is migrated to the virtual machine so as to execute the switchback service through the virtual machine.
6. The service switching back method according to claim 4, characterized in that: Before synchronizing the difference data between the virtual machine and the service host corresponding to the switchback service, the method further includes: Guide the business host to start up through the startup service preset in the cloud; A host IP address configured by the service host based on the startup service is received, and the difference data is synchronized to the service host based on the host IP address.
7. The service switching back method according to claim 6, characterized in that: The synchronizing the difference data to the service host based on the host IP address specifically includes: Determine the service host based on the host IP address; The synchronization service in the startup service communicates with the synchronization service in the virtual machine, and synchronizes the difference data to the service host through the communication.
8. A service switching back device, characterized in that: The service switching back device specifically includes: A synchronization module, used to synchronize the difference data between the virtual machine and the service host corresponding to the switchback service, wherein the virtual machine is constructed based on the backup data of the service host, and is used to execute the switchback service when the host state is a fault state; An acquisition module, used for periodically acquiring the service status of the switchback service after the synchronization of the difference data is completed; A first processing module, configured to switch the switchback service back to the service host when the service state is a first preset state; The second processing module is used to continue to execute the switchback service through the virtual machine when the service status is the second preset status, and synchronize the service data formed by the execution to the virtual machine and the service host, and re-execute the step of periodically obtaining the service status of the switchback service.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps in the service switchback method according to any one of claims 1 to 7.
10. A terminal device, characterized in that: include: Processor and memory; The memory stores a computer-readable program executable by the processor; When the processor executes the computer-readable program, the steps in the service switching back method according to any one of claims 1 to 7 are implemented.