CN113032021A - System switching and data processing method, device, equipment and storage medium thereof - Google Patents

System switching and data processing method, device, equipment and storage medium thereof Download PDF

Info

Publication number
CN113032021A
CN113032021A CN202110209236.6A CN202110209236A CN113032021A CN 113032021 A CN113032021 A CN 113032021A CN 202110209236 A CN202110209236 A CN 202110209236A CN 113032021 A CN113032021 A CN 113032021A
Authority
CN
China
Prior art keywords
access request
state
response parameter
data
http
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110209236.6A
Other languages
Chinese (zh)
Other versions
CN113032021B (en
Inventor
李文涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Huya Technology Co Ltd
Original Assignee
Guangzhou Huya Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Huya Technology Co Ltd filed Critical Guangzhou Huya Technology Co Ltd
Priority to CN202110209236.6A priority Critical patent/CN113032021B/en
Publication of CN113032021A publication Critical patent/CN113032021A/en
Application granted granted Critical
Publication of CN113032021B publication Critical patent/CN113032021B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4416Network booting; Remote initial program loading [RIPL]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/442Shutdown
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/549Remote execution
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Abstract

The embodiment of the application provides a system switching method, a system switching device, a data processing method, a data processing device and a computer readable storage medium, which relate to the technical field of computers, and respectively receive a first access request and a second access request synchronously sent by a first system and a second system; and respectively acquiring corresponding state parameters from the HTTP switch service according to the first access request and the second access request, determining a first state response parameter and a second state response parameter, and respectively returning the first state response parameter and the second state response parameter to the first system and the second system so as to control the first system and the second system to carry out system switching according to a mutual exclusion state rule or send data to a data center. According to the technical scheme, the first system and the second system can be switched rapidly and smoothly, instantaneous switching of the first system and the second system can be realized, and the problem of data redundancy of the data center caused by the fact that the first system and the second system work simultaneously and send repeated data to the data center is avoided.

Description

System switching and data processing method, device, equipment and storage medium thereof
Technical Field
The present application relates to the field of computer technologies, and in particular, to a system switching method, a system switching apparatus, a system switching device, a data processing method, a data processing apparatus, a device and a computer-readable storage medium.
Background
With the continuous development and progress of the technology, in order to improve the performance of the system and improve the use experience of the system, especially the reconfiguration and upgrade of the system are indispensable processes in the business development process, which inevitably involves the switching between different systems.
In the related art, taking the system 1 and the system 2 as an example, in the process of system switching, configuration parameters of a configuration file are changed, a switch of the system 1 is set to be turned off, a switch of the system 2 is set to be turned on, configuration is issued to restart the systems 1 and 2, when all machines on the systems 1 and 2 are completely executed, the system 1 is turned off, and the system 2 works to complete switching between the two systems.
However, the above method cannot guarantee that the machines running the two systems can be stopped and started at the same time, causing the systems 1 and 2 to exist at the same time and both send data to the data center during the process of restarting the systems 1 and 2, resulting in data duplication. Meanwhile, if the number of machines in the systems 1 and 2 is large, or if a problem occurs in the system switching process and rollback processing is performed, the systems need to be restarted again, so that a long time is spent, and the switching efficiency between different systems is reduced.
Disclosure of Invention
An object of the present application is to provide a system switching method, a device, an apparatus and a computer readable storage medium, which at least solve one of the above technical drawbacks, especially the problems of low switching efficiency and easy data duplication in different systems.
In a first aspect, an embodiment of the present application provides a data processing method for system switching, including the following steps:
respectively receiving a first access request and a second access request synchronously sent by a first system and a second system;
respectively acquiring corresponding state parameters from HTTP switch service according to the first access request and the second access request, and determining a first state response parameter and a second state response parameter according to the state parameters; the HTTP switching service is a service program based on an HTTP protocol;
and returning the first state response parameter and the second state response parameter to the first system and the second system respectively, so that the first system and the second system send data to a data center according to the first state response parameter, the second state response parameter and a mutual exclusion state rule respectively.
In one embodiment, the mutual exclusion state rule includes that when any one of the first system and the second system sends data to a data center, the other system stops data transmission to the data center.
In one embodiment, the data processing method for system switching further includes: creating a timer task, and respectively sending synchronous trigger signals to the first system and the second system through the timer task;
the step of receiving the first access request and the second access request synchronously sent by the first system and the second system respectively comprises:
and respectively receiving a first access request and a second access request which are sent by a first system and a second system according to the synchronous trigger signal timing synchronization.
In one embodiment, before the step of obtaining the corresponding status parameters from the HTTP switch service according to the first access request and the second access request, the method further includes:
extracting state parameters carried by the HTTP switch service, storing the response parameters to a database corresponding to the HTTP switch service, and writing the state parameters into a memory according to a preset time interval;
the step of respectively acquiring corresponding state parameters from HTTP switch services according to the first access request and the second access request comprises:
and respectively acquiring corresponding state parameters from a memory corresponding to the HTTP switch service according to the first access request and the second access request.
In one embodiment, the data processing method for system switching further includes: in the process that the first system or the second system sends data to a data center, detecting whether the data received by the data center is lost;
and if the data loss occurs, modifying the state parameters carried by the HTTP switch service in a parameter transmission mode, and restoring the data sent to the data center by the first system and the second system to the state before the data loss.
In a second aspect, an embodiment of the present application provides a system switching method, including:
respectively receiving a first access request and a second access request synchronously sent by a first system and a second system;
respectively acquiring corresponding state parameters from HTTP switch service according to the first access request and the second access request, and determining a first state response parameter and a second state response parameter according to the state parameters; the HTTP switching service is a service program based on an HTTP protocol;
and returning the first state response parameter and the second state response parameter to the first system and the second system respectively so as to control the first system and the second system to switch according to a mutual exclusion state rule.
In a third aspect, an embodiment of the present application provides a data processing apparatus for system switching, including:
the access request receiving module is used for respectively receiving a first access request and a second access request synchronously sent by a first system and a second system;
the state parameter acquisition module is used for respectively acquiring corresponding state parameters from HTTP switch services according to the first access request and the second access request, and determining a first state response parameter and a second state response parameter according to the state parameters; the HTTP switching service is a service program based on an HTTP protocol;
and the data sending control module is used for respectively returning the first state response parameter and the second state response parameter to the first system and the second system so that the first system and the second system respectively send data to a data center according to the first state response parameter, the second state response parameter and a mutual exclusion state rule.
In a fourth aspect, an embodiment of the present application provides a system switching apparatus, including:
the access request receiving module is used for respectively receiving a first access request and a second access request synchronously sent by a first system and a second system;
the state parameter acquisition module is used for respectively acquiring corresponding state parameters from HTTP switch services according to the first access request and the second access request, and determining a first state response parameter and a second state response parameter according to the state parameters; the HTTP switching service is a service program based on an HTTP protocol;
and the system switching control module is used for respectively returning the first state response parameter and the second state response parameter to the first system and the second system so as to control the first system and the second system to switch according to a mutual exclusion state rule.
In a fifth aspect, an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the data processing method for system switching mentioned in any embodiment of the first aspect or the system switching method mentioned in any embodiment of the second aspect when executing the program.
In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements the data processing method for system handover mentioned in any embodiment of the first aspect or the system handover method mentioned in any embodiment of the second aspect.
The system switching and data processing method, device, equipment and computer readable storage medium provided by the above embodiments receive a first access request and a second access request synchronously sent by a first system and a second system respectively; and respectively acquiring corresponding state parameters from HTTP switch service according to the first access request and the second access request, determining a first state response parameter and a second state response parameter, and respectively returning the first state response parameter and the second state response parameter to the first system and the second system so as to control the first system and the second system to carry out system switching, or respectively enabling the first system and the second system to respectively send data to a data center according to the first state response parameter, the second state response parameter and a mutual exclusion state rule. According to the technical scheme, the first system and the second system can be switched rapidly and smoothly, the first system and the second system can be switched instantly, when one system is started to work, the other system stops working, and the problem that the first system and the second system work simultaneously to send repeated data to the data center to cause data redundancy of the data center is solved. Meanwhile, the system switching of the technical scheme can be realized without configuration files and system restarting, the system can be quickly switched, and the system switching time is saved.
Additional aspects and advantages of the present application will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the present application.
Drawings
The foregoing and/or additional aspects and advantages of the present application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
FIG. 1 is a schematic diagram of an environment suitable for system handover and a data processing method thereof according to the present application;
fig. 2 is a flowchart of a data processing method for system switching according to an embodiment of the present application;
fig. 3 is a flowchart of a system handover method according to an embodiment of the present application;
FIG. 4 is a schematic diagram illustrating a system switching and a data processing method thereof according to an embodiment of the present application;
FIG. 5 is a schematic structural diagram of a system switching data processing apparatus according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a system switching device according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are exemplary only for the purpose of explaining the present application and are not to be construed as limiting the present application.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. As used herein, the term "and/or" includes all or any element and all combinations of one or more of the associated listed items.
It will be understood by those within the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
For better understanding of the system switching and the data processing method, apparatus, device, and computer-readable storage medium thereof in the embodiments of the present disclosure, first, an application environment to which the present application is applicable will be described. The method provided by the embodiment of the application is applied to a system switching scene.
Fig. 1 is an environment diagram applicable to system handover and a data processing method thereof according to the present application. As shown in fig. 1, one of the first system 101 and the second system 102 may be a new system, the other may be an old system, the old system is a system providing services to the outside before the system is upgraded, and the new system is a system providing services to the outside after the system is upgraded, in this application, the first system 101 and the second system 102 switch to replace the old system with the new system to provide services to the outside, wherein data generated during the service providing process of the new system and the old system is sent to a data center 103, the data center is used for storing data generated during the service providing process of the first system and the second system to the outside, and the data center includes but is not limited to a server, a database, a cluster, a distributed storage system, and the like. In order to avoid data redundancy caused by simultaneous operation of the first system 101 and the second system 102, the first system 101 and the second system 102 need to be switched quickly and accurately, that is, when the first system 101 sends data to the data center 103, the second system 102 does not send data to the data center 103, so that the first system 101 and the second system 103 are prevented from providing service to the outside at the same time, and sending repeated data to the data center 103, so as to cause data redundancy.
In the related art, the first system and the second system are switched over, typically by changing configuration files of the first system and the second system, and when a system switching request is received, the first system and the second system are switched over according to the configuration files. For example, a switch in a configuration file of a first system is set to be turned off, a switch in a configuration file of a second system is set to be turned on, when a system switching request is received, the configuration files of the first system and the second system are issued to each machine device, and each machine device executes a corresponding program according to the configuration files of the first system and the second system, so that the first system is turned off, and the second system is turned on to be switched to the second system to work.
However, the above implementation method implements system switching by restarting, and the system restarting takes a long time, and the restarting time of systems of different devices is different, it is difficult to ensure that the first system and the second system can be accurately switched, i.e. it is difficult to ensure that the second system is started when the first system is closed, thereby causing the first system and the second system to exist at the same time, which results in data duplication. When a problem is found, such as data format incompatibility or data loss, and a rollback (rollback, which refers to the action of a program or data processing error to restore the program or data to the last correct state) is required, it also takes a long time for the first system and the second system to perform system switching again.
The application provides a system switching method, a data processing method, a device, equipment and a computer readable storage medium thereof, which aim to solve the above technical problems in the prior art.
The following describes the technical solutions of the present application and how to solve the above technical problems with specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments.
Fig. 2 is a flowchart of a system-switched data processing method executed by a server, such as a control server according to an embodiment of the present disclosure. In one embodiment, the control server may be located on the HTTP switch service, and in another embodiment, the control server may be independent of the HTTP switch service.
The following embodiment will explain the scheme of the present application by taking a control server as an example.
Specifically, as shown in fig. 2, the data processing for the system handover may include the following steps:
s210, receiving a first access request and a second access request synchronously sent by a first system and a second system respectively.
The first system and the second system are different systems, for example, one of the first system and the second system is an old system, and the other is a new system; one of the first system and the second system may be a system that is to stop data transmission, and the other may be a system that is to start data transmission; one of the first system and the second system may be a system before upgrading is modified, and the other may be a system after upgrading is modified.
The first system and the second system can provide services for the outside, and send data generated by the services to the data center, wherein the data comprises various types of data such as business data, index data, system logs and the like.
In this embodiment, the control server receives a first access request and a second access request synchronously sent by a first system and a second system, respectively, where the control server may be a device having a control function, and may also be a service program having a control function.
In order to enable the first system and the second system to synchronously send the first access request and the second access request, the control server may synchronously send a synchronization trigger signal to the first system and the second system, so that the first system and the second system simultaneously send the first access request and the second access request to the control server according to the synchronization trigger signal, or a timer may be created in the first system and the second system, and the first access request and the second access request are simultaneously sent to the control server through the timer when the first system and the second system reach a stipulated time.
In an embodiment, the data processing method for system switching may further include the following steps:
s110, creating a timer task, and respectively sending synchronous trigger signals to the first system and the second system through the timer task.
In an embodiment, the timer tasks may be created in the first system and the second system, and when the same appointed time is reached, the synchronization trigger signals may be simultaneously sent to the first system and the second system, respectively, or a common timer task may be created, so that the synchronization trigger signals may be simultaneously sent to the first system and the second system, respectively, through the common timer task.
In an embodiment, the step S210 receives a first access request and a second access request synchronously sent by a first system and a second system, respectively, and may include the following steps:
s2101, a first access request and a second access request which are periodically and synchronously sent by a first system and a second system according to the synchronous trigger signal are respectively received.
And according to the created timer task, when the system time (the system time of the first system is the same as that of the second system) reaches a preset time, if the modulo 5 is equal to 0, sending a synchronous trigger signal, so that the first system and the second system synchronously send a first access request and a second access request to a control server according to the synchronous trigger signal in a timing mode, and obtaining the state parameters carried by the HTTP switching service.
S220, respectively acquiring corresponding state parameters from HTTP switch services according to the first access request and the second access request, and determining a first state response parameter and a second state response parameter according to the state parameters.
Wherein the HTTP switch service is a service program based on HTTP protocol.
In this embodiment, the HTTP switching service is a service program based on an HTTP protocol, and may be represented as a Uniform Resource Locator (URL), where the URL carries a status parameter, such as "false" or "true", and the first access request and the second access request may be access requests based on a Get method.
The HTTP switching service is pre-constructed according to the address, name, etc. of the system, and the state parameters carried by the HTTP switching service are set. The control server periodically extracts and stores the state parameters from the HTTP switching service. In an embodiment, if the state parameter of the HTTP switching service is changed, the state parameter of the HTTP switching service is extracted when a regular time is reached, and the changed state parameter is replaced and stored.
For example, the parameter initially carried by the HTTP switch service is "false", the state parameter of the HTTP switch service is modified to "true" by transferring the parameter at 1 st minute, and the parameter carried by the HTTP switch service is set to be read every 1 second, and when the state parameter of the HTTP switch service changes, the modified "true" state parameter can be stored in time by replacing the "false" state parameter before modification with the "true" state parameter after the reading interval is short.
And when receiving a first access request and a second access request sent by the first system and the second system, the control server acquires the state parameters, and determines a first state response parameter and a second state response parameter returned to the first system and the second system according to the state parameters.
Because the first access request and the second access request are sent out synchronously, the control server obtains the state parameters according to the first access request and the second access request to determine that the first state response parameters and the second state response parameters are almost the same.
In an embodiment, the first status response parameter and the second status response parameter may be the same, and both the first status response parameter and the second status response parameter are consistent with the status parameter, for example, the status parameter is "false", and both the first status parameter and the second status parameter may be "false".
In another embodiment, the first state response parameter and the second state response parameter may also be opposite to each other, one of the first state response parameter and the second state response parameter is consistent with the state parameter, and the other state response parameter is obtained by inverting the state parameter, for example, the state parameter is "false", the first state parameter is "false", but the second state parameter is "true", that is, the state parameter "false" is inverted to obtain "true".
S230, returning the first state response parameter and the second state response parameter to the first system and the second system respectively, so that the first system and the second system send data to a data center according to the first state response parameter, the second state response parameter and a mutual exclusion state rule respectively.
In this embodiment, the first status response parameter and the second status response parameter are respectively returned to the first system and the second system, and the first system and the second system respectively send data to the data center according to the first status response parameter, the second status response parameter, and the mutual exclusion status rule.
In one embodiment, the mutual exclusion state rule includes that when any one of the first system and the second system sends data to the data center, the other system stops data transmission to the data center.
According to the mutual exclusion state rule, a description will be given of a case where the first state response parameter and the second state response parameter are the same and the first state response parameter and the second state response parameter are opposite.
(1) In the case that the first and second state response parameters are the same:
defining that one of the first system and the second system sends data to the data center and the other system does not send data to the data center under the condition that the first state response parameter and the second state response parameter are the same, for example, when the first state response parameter is false, the first system sends data to the data center, and when the first state response parameter is true, the first system does not send data to the data center; on the contrary, when the second state response parameter is false, the second system does not send data to the data center, and when the second state response parameter is true, the second system sends data to the data center.
(2) In the case where the first and second state response parameters are opposite:
defining that one of the first system and the second system sends data to the data center and the other system does not send data to the data center under the condition that the first state response parameter and the second state response parameter are opposite, for example, when the first state response parameter is false, the first system sends data to the data center, and when the first state response parameter is true, the first system does not send data to the data center; similarly, when the second state response parameter is false, the second system sends data to the data center, and when the second state response parameter is true, the second system does not send data to the data center.
As can be seen from the above, according to the first state response parameter, the second state response parameter and the mutual exclusion state rule, the first system and the second system are controlled to be in the mutual exclusion state to send data to the data center, that is, when one of the systems sends data to the data center, the other system does not send data to the data center.
In the data processing method for system switching provided by this embodiment, a first access request and a second access request synchronously sent by a first system and a second system are received respectively; respectively acquiring corresponding state parameters from HTTP switch service according to the first access request and the second access request; and determining a first state response parameter and a second state response parameter according to the state parameters, and respectively returning the first state response parameter and the second state response parameter to the first system and the second system, so that the first system and the second system respectively send data to a data center according to the first state response parameter, the second state response parameter and a mutual exclusion state rule. According to the technical scheme, the first system and the second system can be switched rapidly and smoothly, the first system and the second system can be switched instantly, when one system is started to work, the other system stops working, and the problem that the first system and the second system work simultaneously to send repeated data to the data center to cause data redundancy of the data center is solved.
In order to more clearly illustrate the technical solution of the present application, more embodiments are provided below for a data processing method of system switching.
In an embodiment, before acquiring the corresponding status parameters from the HTTP switch service according to the first access request and the second access request in step S220, the method may further include the following steps:
s120, extracting the state parameters carried by the HTTP switch service, storing the response parameters to a database corresponding to the HTTP switch service, and writing the state parameters into a memory according to a preset time interval.
In this embodiment, the state parameters carried by the HTTP switch service are associated with the returned first state response parameters and second state response parameters, and the first state response parameters and the second state response parameters are the same as or opposite to the state parameters.
The HTTP switching service carries a state parameter, such as false or true, and the control server periodically extracts the state parameter carried by the HTTP switching service to detect whether the state parameter changes. The extracted state parameters are stored in a database corresponding to the HTTP switch service, the state parameters in the database are read according to preset time, and the state parameters are written into a memory. And when the state parameters of the HTTP switching service change, the state parameters in the database and the memory are updated in time.
In an embodiment, the step S220 of obtaining the corresponding state parameters from the HTTP switch service according to the first access request and the second access request may specifically include the following steps:
s2201, respectively acquiring corresponding state parameters from the memory corresponding to the HTTP switch service according to the first access request and the second access request.
When the first system and the second system send out the first access request and the second access request to access the HTTP switch service, the control server directly obtains the state parameters corresponding to the HTTP switch service from the memory.
In the scheme of the application, system switching and data processing of the first system and the second system require frequent access to the HTTP switch service for many times, because the database can meet a high availability requirement, but has low performance, the state parameters in the database need to be refreshed each time when responding to the first access request or the second access request, the frequent refreshing affects the performance of the database, if the database completely depends on the memory, the state parameters are recorded in the memory to realize temporary storage, although the performance is high, the availability is relatively low, and if the memory has a fault such as downtime or the stored state is cleared, the state parameters may be lost, and the first access request and the second access request cannot be responded to, so that the service is unavailable. In this embodiment, the state parameters are extracted from the HTTP switching service and stored in the database, and then the state parameters are written into the memory from the database, and when the first system and the second system send the first access request and the second access request, the state parameters are directly obtained from the memory, thereby improving throughput of the HTTP switching service and stability of system switching.
In an embodiment, the data processing method for system switching may further include the following steps:
s130, in the process that the first system or the second system sends data to a data center, detecting whether the data received by the data center is lost; and if the data loss occurs, modifying the state parameters carried by the HTTP switch service in a parameter transmission mode, and restoring the data sent to the data center by the first system and the second system to the state before the data loss.
In the process that the first system and the second system send data to the data center, whether data loss occurs to the data received by the data center is detected in real time, for example, when the situation that the data received by the data center is lack of fields or the like is detected, or when the data is not received within a preset time, the data loss can be considered to occur.
When data loss is determined to occur, modifying the state parameter carried by the HTTP switch service in the form of a transfer parameter, for example, the state parameter initially carried by the HTTP switch service is false, transferring "true" to the HTTP switch service in the form of a transfer parameter to modify the state parameter, that is, modifying the state parameter from "false" to "true", and recovering data sent by the first system and the second system to the data center to a data state before the data loss occurs. For example, the data center receives data "12345679", and since it is detected that the received data is lost, i.e. lost "8", the data is restored to the previous data loss, i.e. to "1234567".
The control server extracts the state parameters carried by the HTTP switch service according to the preset time interval, for example, the state parameters carried by the HTTP switch service are extracted every 1 second, so that when the state parameters change, the modified state parameters can be extracted in time, the modified state parameters are replaced with the state parameters before modification, the modified state parameters are stored in the database, the state parameters in the database are written into the memory, and when the next first access request or second access request is made, the modified state parameters are obtained from the memory and returned to the first system or the second system.
For example, initially, the state parameter of the HTTP switching service is false, at this time, the first system does not send data to the data center, the second system sends data to the data center, if data loss occurs when the second data sends data to the data center, at this time, the state parameter is modified to true in a parameter transmission manner, and the state parameter true is stored in the database and the memory, because the first system and the second system continuously send the first access request and the second access request to the HTTP switching service, when the next first access request and the second access request are received, the state parameter true is obtained from the memory to determine the first state response parameter and the second state response parameter, and is returned to the first system and the second system, and when the first system and the second system receive the returned first state response parameter and the second state response parameter, the first system sends data to the data center, and the second system stops sending data to the data center so as to realize rollback in a quick mode when the data is lost or incompatible.
The following describes a related embodiment of a system switching method.
Fig. 3 is a flowchart of a system switching method according to an embodiment of the present application, where the system switching method may be implemented by a server, such as a control server. In one embodiment, the control server may be located on the HTTP switch service, and in another embodiment, the control server may be independent of the HTTP switch service.
Specifically, as shown in fig. 3, the system switching method may include the steps of:
s310, receiving a first access request and a second access request synchronously sent by a first system and a second system respectively.
The first system and the second system are different systems, for example, one of the first system and the second system is an old system, and the other is a new system; one of the first system and the second system may be a system that is to stop data transmission, and the other may be a system that is to start data transmission; one of the first system and the second system may be a system before upgrading is modified, and the other may be a system after upgrading is modified.
The first system and the second system can provide services for the outside, and send data generated by the services to the data center, wherein the data comprises various types of data such as business data, index data, system logs and the like.
In this embodiment, the control server receives a first access request and a second access request synchronously sent by a first system and a second system, respectively, where the control server may be a device having a control function, and may also be a service program having a control function.
In order to enable the first system and the second system to synchronously send the first access request and the second access request, the control server may synchronously send a synchronization trigger signal to the first system and the second system, so that the first system and the second system simultaneously send the first access request and the second access request to the control server according to the synchronization trigger signal, or a timer may be created in the first system and the second system, and the first access request and the second access request are simultaneously sent to the control server through the timer when the first system and the second system reach a stipulated time.
S320, respectively acquiring corresponding state parameters from HTTP switch services according to the first access request and the second access request, and determining a first state response parameter and a second state response parameter according to the state parameters.
The HTTP switch service is a service program based on the HTTP protocol.
In this embodiment, the HTTP switching service is a service program based on an HTTP protocol, and may be represented as a Uniform Resource Locator (URL), where the URL carries a status parameter, such as "false" or "true", and the first access request and the second access request may be access requests based on a Get method.
The HTTP switching service is pre-constructed according to the address, name, etc. of the system, and the state parameters carried by the HTTP switching service are set. The control server periodically extracts and stores the state parameters from the HTTP switching service. In an embodiment, if the state parameter of the HTTP switching service is changed, the state parameter of the HTTP switching service is extracted when a regular time is reached, and the changed state parameter is replaced and stored.
For example, the parameter initially carried by the HTTP switch service is "false", the state parameter of the HTTP switch service is modified to "true" by transferring the parameter at 1 st minute, and the parameter carried by the HTTP switch service is set to be read every 1 second, and when the state parameter of the HTTP switch service changes, the modified "true" state parameter can be stored in time by replacing the "false" state parameter before modification with the "true" state parameter after the reading interval is short.
And when receiving a first access request and a second access request sent by the first system and the second system, the control server acquires the state parameters, and determines to return a first state response parameter and a second state response parameter to the first system and the second system according to the state parameters.
Because the first access request and the second access request are sent out synchronously, the control server obtains the state parameters according to the first access request and the second access request to determine that the first state response parameters and the second state response parameters are almost the same.
In an embodiment, the first status response parameter and the second status response parameter may be the same, and both the first status response parameter and the second status response parameter are consistent with the status parameter, for example, the status parameter is "false", and both the first status parameter and the second status parameter may be "false".
In another embodiment, the first state response parameter and the second state response parameter may also be opposite to each other, one of the first state response parameter and the second state response parameter is consistent with the state parameter, and the other state response parameter is obtained by inverting the state parameter, for example, the state parameter is "false", the first state parameter is "false", but the second state parameter is "true", that is, the state parameter "false" is inverted to obtain "true".
S330, returning the first state response parameter and the second state response parameter to the first system and the second system respectively, so as to control the first system and the second system to switch according to a mutual exclusion state rule.
And respectively returning the first state response parameter and the second state response parameter to the first system and the second system, and stopping or starting the first system and the second system according to the first state response parameter and the second state response parameter.
In this embodiment, a mutual exclusion state rule is preset, that is, one of the first system and the second system is controlled to start working according to the first state response parameter and the second state response parameter, and the other one stops working to perform system switching. According to the mutual exclusion state rule, a description will be given of a case where the first state response parameter and the second state response parameter are the same and the first state response parameter and the second state response parameter are opposite.
(1) In the case that the first and second state response parameters are the same:
defining that one of the first system and the second system starts working and the other one stops working under the condition that the first state response parameter and the second state response parameter are the same, for example, when the first state response parameter is false, the first system starts working, and when the first state response parameter is true, the first system stops working; conversely, when the second state response parameter is false, the second system stops working, and when the second state response parameter is true, the second system starts working.
(2) In the case where the first and second state response parameters are opposite:
defining that one of the first system and the second system starts working and the other one stops working under the condition that the first state response parameter and the second state response parameter are opposite, for example, when the first state response parameter is false, the first system starts working, and when the first state response parameter is true, the first system stops working; similarly, when the second state response parameter is false, the second system starts to operate, and when the second state response parameter is true, the second system stops operating.
As can be seen from the above, according to the first state response parameter, the second state response parameter and the mutual exclusion state rule, the first system and the second system are controlled to operate in the mutual exclusion state, that is, when one of the systems starts to operate, the other system stops operating.
In the system switching method provided by this embodiment, a first access request and a second access request synchronously sent by a first system and a second system are received respectively; respectively acquiring corresponding state parameters from HTTP switch service according to the first access request and the second access request; and determining a first state response parameter and a second state response parameter according to the state parameters, and respectively returning the first state response parameter and the second state response parameter to the first system and the second system so as to control the first system and the second system to switch according to a mutual exclusion state rule. According to the technical scheme, the first system and the second system can be switched without restarting the system, so that the first system and the second system can be switched rapidly, and the time for switching the systems is saved.
In order to more clearly illustrate the solution of the present application, the technical solution is exemplarily illustrated with reference to fig. 4.
Fig. 4 is a schematic diagram illustrating a system switching and a data processing method thereof according to an embodiment of the present application, where as shown in fig. 4, a first system and a second system simultaneously send a first access request and a second access request to a control server, respectively, and in this process, the control server extracts a state parameter of an HTTP switching service, stores the state parameter in a database, and writes the state parameter into a memory from the database.
When the control server receives the first access request and the second access request, the state parameters are obtained from the memory, the first state response parameters and the second state response parameters are determined according to the state parameters, the first state response parameters are returned to the first system, the second state response parameters are returned to the second system, so that the first system and the second system respectively receive the first state response parameters and the second state response parameters at the same time, one of the first system and the second system stops working under the mutual exclusion state rule, the other starts to act to realize system switching, and in the system switching realization process, when one of the first system and the second system stops sending data to the data center, the other starts to send data to the data center.
When the system needs to be switched again, the state parameters of the HTTP switch service are modified in a parameter transmission mode, so that the originally working system stops working, the originally stopping system starts working, or the originally sending data to the data center system stops sending data, and the originally not sending data to the data center system starts sending data to the data center.
According to the technical scheme of the embodiment, the first access request and the second access request are sent to the HTTP switch service through the first system and the second system simultaneously, the first state response parameter and the second state response parameter are obtained through returning according to the first access request and the second access request, so that the first system and the second system can simultaneously perform corresponding actions according to the first state response parameter and the second state response parameter, one of the first system and the second system stops working, the other one starts working, only one of the first system and the second system is guaranteed to send data to the data center, the other one does not send data, the two systems are prevented from working simultaneously, data repetition caused by the fact that data are sent to the data center, and data redundancy is caused. According to the technical scheme, when the system switching is realized, the configuration file and the system restarting are not needed, the instantaneous switching of the system can be realized, and the system switching time is saved.
The above examples are merely used to assist in explaining the technical solutions of the present disclosure, and the drawings and specific flows related thereto do not constitute a limitation on the usage scenarios of the technical solutions of the present disclosure.
A related embodiment of a system switched data processing apparatus is described in detail below.
Fig. 5 is a schematic structural diagram of a system-switched data processing apparatus according to an embodiment of the present disclosure, where the system-switched data processing apparatus may be applied to a server.
Specifically, as shown in fig. 5, the data processing apparatus 200 for system switching may include: an access request receiving module 210, a state parameter obtaining module 220 and a data sending control module 230;
the access request receiving module 210 is configured to receive a first access request and a second access request synchronously sent by a first system and a second system, respectively;
a status parameter obtaining module 220, configured to obtain corresponding status parameters from an HTTP switch service according to the first access request and the second access request, and determine a first status response parameter and a second status response parameter according to the status parameters; the HTTP switching service is a service program based on an HTTP protocol;
the data sending control module 230 is configured to return the first status response parameter and the second status response parameter to the first system and the second system, respectively, so that the first system and the second system send data to a data center according to the first status response parameter, the second status response parameter, and a mutual exclusion rule, respectively.
The data processing apparatus for system switching provided in this embodiment sends data to the data center according to the mutual exclusion state rule and the first status response parameter and the second status response parameter returned by the HTTP switch service. According to the technical scheme, the first system and the second system can be switched rapidly and smoothly, the first system and the second system can be switched instantly, when one system is started to work, the other system stops working, and the problem that the first system and the second system work simultaneously to send repeated data to the data center to cause data redundancy of the data center is solved.
In one possible implementation manner, the mutual exclusion state rule includes that when any one of the first system and the second system sends data to a data center, the other system stops data transmission to the data center.
In one possible implementation manner, the system-switched data processing apparatus 200 further includes: a synchronous trigger signal sending module, configured to create a timer task, and send a synchronous trigger signal to the first system and the second system through the timer task, respectively;
in one possible implementation, the access request receiving module 210 includes: and the timing synchronization receiving unit is used for respectively receiving a first access request and a second access request which are sent by the first system and the second system according to the synchronization trigger signal timing synchronization.
In one possible implementation manner, the system-switched data processing apparatus 200 further includes: a status parameter write module; the state parameter writing module is used for extracting the state parameters carried by the HTTP switch service, storing the response parameters to a database corresponding to the HTTP switch service, and writing the state parameters into a memory according to a preset time interval;
in one possible implementation manner, the state parameter obtaining module 220 is specifically configured to obtain corresponding state parameters from the memory corresponding to the HTTP switch service according to the first access request and the second access request.
In one possible implementation manner, the system-switched data processing apparatus 200 further includes: the data loss detection module and the data recovery module;
the data loss detection module is used for detecting whether data loss occurs to the data received by the data center in the process of sending the data to the data center by the first system or the second system; and the data recovery module is used for modifying the state parameters carried by the HTTP switch service in a parameter transmission mode if data loss occurs, and recovering the data sent to the data center by the first system and the second system to the state before the data loss.
The data processing apparatus for system switching in this embodiment can execute the data processing method for system switching in the foregoing embodiments of the present application, and the implementation principles thereof are similar and will not be described herein again.
Fig. 6 is a schematic structural diagram of a system switching device according to an embodiment of the present disclosure, where the system switching device may be applied to a server.
Specifically, as shown in fig. 6, the system switching device 300 may include: an access request receiving module 310, a state parameter obtaining module 320 and a system switching control module 330;
the access request receiving module 310 is configured to receive a first access request and a second access request synchronously sent by a first system and a second system, respectively;
a status parameter obtaining module 320, configured to obtain corresponding status parameters from an HTTP switch service according to the first access request and the second access request, and determine a first status response parameter and a second status response parameter according to the status parameters; the HTTP switch service is a service program based on the HTTP protocol.
The system switching control module 330 is configured to return the first state response parameter and the second state response parameter to the first system and the second system, respectively, so as to control the first system and the second system to switch according to a mutual exclusion state rule.
The system switching device provided in this embodiment implements simultaneous and instantaneous switching of the system through the first state response parameter and the second state response parameter returned by the HTTP switch service and according to the mutual exclusion state rule, and can implement system switching without configuring a file and restarting the system, thereby enabling rapid switching of the system.
The system switching device of the present embodiment can execute the system switching method shown in the foregoing embodiments of the present application, and the implementation principles thereof are similar, and are not described herein again.
An embodiment of the present application provides an electronic device, including: a memory and a processor; at least one program stored in the memory for execution by the processor, which when executed by the processor, implements: the fast and smooth switching between the first system and the second system avoids repeated data transmission during system switching.
In an alternative embodiment, an electronic device is provided, as shown in fig. 7, the electronic device 4000 shown in fig. 7 comprising: a processor 4001 and a memory 4003. Processor 4001 is coupled to memory 4003, such as via bus 4002. Optionally, the electronic device 4000 may further include a transceiver 4004, and the transceiver 4004 may be used for data interaction between the electronic device and other electronic devices, such as transmission of data and/or reception of data. In addition, the transceiver 4004 is not limited to one in practical applications, and the structure of the electronic device 4000 is not limited to the embodiment of the present application.
The Processor 4001 may be a CPU (Central Processing Unit), a general-purpose Processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other Programmable logic device, a transistor logic device, a hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. The processor 4001 may also be a combination that performs a computational function, including, for example, a combination of one or more microprocessors, a combination of a DSP and a microprocessor, or the like.
Bus 4002 may include a path that carries information between the aforementioned components. The bus 4002 may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus 4002 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 7, but this is not intended to represent only one bus or type of bus.
The Memory 4003 may be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical Disc storage, optical Disc storage (including Compact Disc, laser Disc, optical Disc, digital versatile Disc, blu-ray Disc, etc.), a magnetic Disc storage medium or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to these.
The memory 4003 is used for storing application codes for executing the scheme of the present application, and the execution is controlled by the processor 4001. Processor 4001 is configured to execute application code stored in memory 4003 to implement what is shown in the foregoing method embodiments.
Among them, electronic devices include but are not limited to: mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and fixed terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
The present application provides a computer-readable storage medium, on which a computer program is stored, which, when running on a computer, enables the computer to execute the corresponding content in the foregoing method embodiments. Compared with the prior art, the embodiment of the application can realize fast and smooth switching of the first system and the second system, save system switching time, simultaneously ensure that only one of the first system and the second system works, and avoid the problem of data redundancy of the data center caused by the fact that the first system and the second system work simultaneously and send repeated data to the data center.
Embodiments of the present application provide a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. A computer device, such as an electronic device, having a processor that reads the computer instructions from the computer-readable storage medium, the processor executing the computer instructions, such that the computer device, when executed, implements:
respectively receiving a first access request and a second access request synchronously sent by a first system and a second system;
respectively acquiring corresponding state parameters from HTTP switch service according to the first access request and the second access request, and determining a first state response parameter and a second state response parameter according to the state parameters; the HTTP switching service is a service program based on an HTTP protocol;
and returning the first state response parameter and the second state response parameter to the first system and the second system respectively, so that the first system and the second system send data to a data center according to the first state response parameter, the second state response parameter and a mutual exclusion state rule respectively.
Embodiments of the present application also provide a computer program product or computer program comprising computer instructions stored in a computer-readable storage medium. A computer device, such as an electronic device, having a processor that reads the computer instructions from the computer-readable storage medium, the processor executing the computer instructions, such that the computer device, when executed, implements:
respectively receiving a first access request and a second access request synchronously sent by a first system and a second system;
respectively acquiring corresponding state parameters from HTTP switch service according to the first access request and the second access request, and determining a first state response parameter and a second state response parameter according to the state parameters; the HTTP switching service is a service program based on an HTTP protocol;
and returning the first state response parameter and the second state response parameter to the first system and the second system respectively so as to control the first system and the second system to switch according to a mutual exclusion state rule.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to perform the methods shown in the above embodiments.
Computer program code for carrying out operations for aspects of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the 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 the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present disclosure may be implemented by software or hardware. The name of a module does not in some cases constitute a limitation of the module itself, and for example, the access request receiving module may also be described as a "module that receives an access request".
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
The foregoing is only a partial embodiment of the present application, and it should be noted that, for those skilled in the art, several modifications and decorations can be made without departing from the principle of the present application, and these modifications and decorations should also be regarded as the protection scope of the present application.

Claims (10)

1. A data processing method for system switching is characterized by comprising the following steps:
respectively receiving a first access request and a second access request synchronously sent by a first system and a second system;
respectively acquiring corresponding state parameters from HTTP switch service according to the first access request and the second access request, and determining a first state response parameter and a second state response parameter according to the state parameters; the HTTP switching service is a service program based on an HTTP protocol;
and returning the first state response parameter and the second state response parameter to the first system and the second system respectively, so that the first system and the second system send data to a data center according to the first state response parameter, the second state response parameter and a mutual exclusion state rule respectively.
2. The method of claim 1, wherein the mutual exclusion state rule comprises that when either one of the first system and the second system sends data to a data center, the other system stops data transmission to the data center.
3. The method of claim 1, further comprising: creating a timer task, and respectively sending synchronous trigger signals to the first system and the second system through the timer task;
the step of receiving the first access request and the second access request synchronously sent by the first system and the second system respectively comprises:
and respectively receiving a first access request and a second access request which are sent by a first system and a second system according to the synchronous trigger signal timing synchronization.
4. The method according to claim 1, wherein before the step of obtaining the corresponding status parameters from the HTTP switching service according to the first access request and the second access request, respectively, further comprising:
extracting state parameters carried by the HTTP switch service, storing the response parameters to a database corresponding to the HTTP switch service, and writing the state parameters into a memory according to a preset time interval;
the step of respectively acquiring corresponding state parameters from HTTP switch services according to the first access request and the second access request comprises:
and respectively acquiring corresponding state parameters from a memory corresponding to the HTTP switch service according to the first access request and the second access request.
5. The method of any of claims 1 to 4, further comprising: in the process that the first system or the second system sends data to a data center, detecting whether the data received by the data center is lost;
and if the data loss occurs, modifying the state parameters carried by the HTTP switch service in a parameter transmission mode, and restoring the data sent to the data center by the first system and the second system to the state before the data loss.
6. A method for system switching, comprising:
respectively receiving a first access request and a second access request synchronously sent by a first system and a second system;
respectively acquiring corresponding state parameters from HTTP switch service according to the first access request and the second access request, and determining a first state response parameter and a second state response parameter according to the state parameters; the HTTP switching service is a service program based on an HTTP protocol;
and returning the first state response parameter and the second state response parameter to the first system and the second system respectively so as to control the first system and the second system to switch according to a mutual exclusion state rule.
7. A system switching data processing apparatus, comprising:
the access request receiving module is used for respectively receiving a first access request and a second access request synchronously sent by a first system and a second system;
a state parameter obtaining module, configured to obtain corresponding state parameters from an HTTP switch service according to the first access request and the second access request, and determine a first state response parameter and a second state response parameter according to the state parameters; the HTTP switching service is a service program based on an HTTP protocol;
and the data sending control module is used for respectively returning the first state response parameter and the second state response parameter to the first system and the second system, so that the first system and the second system respectively send data to a data center according to the first state response parameter, the second state response parameter and a mutual exclusion state rule.
8. A system switching apparatus, comprising:
the access request receiving module is used for respectively receiving a first access request and a second access request synchronously sent by a first system and a second system;
a state parameter obtaining module, configured to obtain corresponding state parameters from an HTTP switch service according to the first access request and the second access request, and determine a first state response parameter and a second state response parameter according to the state parameters; the HTTP switching service is a service program based on an HTTP protocol;
and the system switching control module is used for respectively returning the first state response parameter and the second state response parameter to the first system and the second system so as to control the first system and the second system to switch according to a mutual exclusion state rule.
9. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements the data processing method of system switching of any one of claims 1-5 or the system switching method of claim 6 when executing the program.
10. A computer-readable storage medium, characterized in that a computer program is stored thereon, which when executed by a processor implements the system switching data processing method of any one of claims 1 to 5 or the system switching method of claim 6.
CN202110209236.6A 2021-02-24 2021-02-24 System switching and data processing method, device, equipment and storage medium thereof Active CN113032021B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110209236.6A CN113032021B (en) 2021-02-24 2021-02-24 System switching and data processing method, device, equipment and storage medium thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110209236.6A CN113032021B (en) 2021-02-24 2021-02-24 System switching and data processing method, device, equipment and storage medium thereof

Publications (2)

Publication Number Publication Date
CN113032021A true CN113032021A (en) 2021-06-25
CN113032021B CN113032021B (en) 2023-07-14

Family

ID=76461208

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110209236.6A Active CN113032021B (en) 2021-02-24 2021-02-24 System switching and data processing method, device, equipment and storage medium thereof

Country Status (1)

Country Link
CN (1) CN113032021B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113687635A (en) * 2021-08-23 2021-11-23 明度智云(浙江)科技有限公司 Method, system and storage medium for managing state of equipment based on complete object

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5778349A (en) * 1994-11-30 1998-07-07 Nec Corporation Method of processing input/output request in computer system including a plurality of subsystems
US20050055595A1 (en) * 2001-09-17 2005-03-10 Mark Frazer Software update method, apparatus and system
CN101150838A (en) * 2006-09-18 2008-03-26 大唐移动通信设备有限公司 A method and system for inter-system switching
CN102104936A (en) * 2009-12-18 2011-06-22 联想(北京)有限公司 Method for switching system states and portable terminal
CN104580728A (en) * 2015-01-07 2015-04-29 宇龙计算机通信科技(深圳)有限公司 Service processing method and device and terminal
US9208167B1 (en) * 2014-09-04 2015-12-08 Edifire LLC Distributed data synchronization and conflict resolution
CN112256482A (en) * 2020-10-30 2021-01-22 中国建设银行股份有限公司 Data processing method and device and server

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5778349A (en) * 1994-11-30 1998-07-07 Nec Corporation Method of processing input/output request in computer system including a plurality of subsystems
US20050055595A1 (en) * 2001-09-17 2005-03-10 Mark Frazer Software update method, apparatus and system
CN101150838A (en) * 2006-09-18 2008-03-26 大唐移动通信设备有限公司 A method and system for inter-system switching
CN102104936A (en) * 2009-12-18 2011-06-22 联想(北京)有限公司 Method for switching system states and portable terminal
US9208167B1 (en) * 2014-09-04 2015-12-08 Edifire LLC Distributed data synchronization and conflict resolution
CN104580728A (en) * 2015-01-07 2015-04-29 宇龙计算机通信科技(深圳)有限公司 Service processing method and device and terminal
CN112256482A (en) * 2020-10-30 2021-01-22 中国建设银行股份有限公司 Data processing method and device and server

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113687635A (en) * 2021-08-23 2021-11-23 明度智云(浙江)科技有限公司 Method, system and storage medium for managing state of equipment based on complete object

Also Published As

Publication number Publication date
CN113032021B (en) 2023-07-14

Similar Documents

Publication Publication Date Title
CN111090699A (en) Service data synchronization method and device, storage medium and electronic device
CN111917846A (en) Kafka cluster switching method, device and system, electronic equipment and readable storage medium
CN111327703A (en) Block chain-based consensus method and device
CN107016029B (en) Method, device and system for processing service data
CN113032085A (en) Management method, device, server, management system and medium of cloud operating system
CN107729515B (en) Data synchronization method, device and storage medium
CN112636992B (en) Dynamic routing method, device, equipment and storage medium
CN111399764B (en) Data storage method, data reading device, data storage equipment and data storage medium
CN110765165B (en) Method, device and system for synchronously processing cross-system data
CN105242990A (en) Cloud platform based data backup method and apparatus
CN111212183B (en) Method, device and computer readable medium for running hosted application
CN104268229A (en) Resource obtaining method and device based on multi-process browser
US11240302B1 (en) Live migration of log-based consistency mechanisms for data stores
CN111198777A (en) Data processing method, device, terminal and storage medium
CN107888434B (en) Network equipment configuration synchronization method and device
CN111865632A (en) Switching method of distributed data storage cluster and switching instruction sending method and device
CN112052230A (en) Multi-machine room data synchronization method, computing equipment and storage medium
CN113032021B (en) System switching and data processing method, device, equipment and storage medium thereof
CN114328097A (en) File monitoring method and device, electronic equipment and storage medium
CN112015595B (en) Master-slave database switching method, computing device and storage medium
CN108881452B (en) Data synchronization method, device and storage medium
CN112905668B (en) Database derivative method, device and medium based on distributed data stream processing engine
CN114546725A (en) Cross-cluster backup method, system, medium and electronic device for stateful application
CN113157392A (en) High-availability method and equipment for mirror image warehouse
CN109783272B (en) Disk snapshot processing method, device and equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant