Data processing method and device, equipment and storage medium

By identifying and processing data operation requests on the first server side and forwarding other operations to the second server for execution, the data inconsistency problem of dual cloud multi-master databases when data synchronization is paused is solved, and support for low-latency services is achieved.

CN119691074APending Publication Date: 2025-03-25GREE ELECTRIC APPLIANCE INC OF ZHUHAI +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411753026.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-02
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

After performing data synchronization pause between the two cloud servers, due to inconsistency between the two databases, the dual cloud multi-master database cannot support low-latency services.

Method used

By receiving data operation requests on the first server side and determining the service type, identifying read-only and update requests, only reading operations are performed on the first server, and other operations are forwarded to the second server for execution, the effective status update of the data object is realized, and data synchronization is performed when the dedicated network is restored.

Benefits of technology

Ensure that during the data synchronization pause, the first server only provides read-only services, updates the valid status of the data object, and forwards other operations to the second server for execution, thereby ensuring that the user obtains the latest data and meeting the requirements of low-latency services for data real-timeness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119691074A_ABST
    Figure CN119691074A_ABST
Patent Text Reader

Abstract

The invention relates to a data processing method and device, equipment and a storage medium. The method comprises the following steps: receiving a data operation request at a first server side; when it is determined that the service type of the first server is a read-only service, identifying a data operation request requesting to read a valid data object and identifying a data operation request used for updating a data valid state; executing a data operation request for reading the valid data object and updating the data valid state of the data object according to the data operation request for updating the data valid state; and sending the other data operation requests to a second server of which the service type is read-write service through the public network, so that the second server executes the other data operation requests. After the data synchronization between the two servers is paused, the latest data object can be ensured to be returned to the user terminal, the data object before updating is prevented from being sent to the user object, and the requirement of the low data delay service on the data real-time performance is met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a data processing method, apparatus, device and storage medium. Background Art

[0002] A dual-cloud multi-master database is a database cluster formed by running two database services on two cloud servers. Both databases in a dual-cloud multi-master database are master nodes. The two cloud servers receive data operation requests and perform data synchronization between the two cloud servers, so that the databases on the two cloud servers maintain data consistency.

[0003] However, after the data synchronization between the two cloud servers is suspended, data inconsistency will occur between the two databases, and this inconsistency between the databases will cause the dual-cloud multi-master database to be unable to support low data latency services. For example: the current dual-cloud multi-master database needs to achieve data synchronization between the two databases through a dedicated network established between the two cloud servers. If the dedicated network fails, the two cloud servers will not be able to synchronize data, and then the databases on the two cloud servers will be inconsistent. During the failure of the dedicated network, if a data object has been written on the first server, it means that the data object has been updated, and the second server cannot be notified in time that the data object has been updated. If the second server receives a read request for the data object and returns the unupdated data object, the user will obtain incorrect data. Summary of the invention

[0004] The present application provides a data processing method, apparatus, device and storage medium to solve the problem that after data synchronization between two cloud servers is suspended, the dual-cloud multi-master database cannot support low-latency services due to inconsistency between the two databases.

[0005] In view of the above technical problems, the technical solution of this application is solved by the following embodiments:

[0006] An embodiment of the present application provides a data processing method, which is applied to a first server, including: receiving a data operation request and determining the service type of the first server; in the case of determining that the service type of the first server is a read-only service, identifying the data operation request for requesting to read a valid data object and identifying the data operation request for updating the data validity status; executing the data operation request for requesting to read a valid data object and updating the data validity status of the data object according to the data operation request for updating the data validity status; sending the other data operation requests to a second server whose service type is a read-write service through a public network, so that the second server executes the other data operation requests.

[0007] Among them, the identifying the data operation request for reading a valid data object includes: when it is identified that the data operation request is for requesting to perform a read operation on a data object, querying whether the data object is set with an expiration tag; when the data object is not set with the expiration tag, determining the data operation request as the data operation request for requesting to read a valid data object; when the data object is set with the expiration tag, determining the data operation request as other data operation requests.

[0008] Among them, the identifying of the data operation request for updating the valid status of data includes: when it is identified that the data operation request is used to request a write operation to a data object, determining whether the data operation request has been executed on the second server by querying a preset field in the data operation request; when the data operation request has been executed on the second server, determining the data operation request as the data operation request for updating the valid status of data; when the data operation request has not been executed on the second server, determining the data operation request as other data operation requests.

[0009] The method also includes: when it is determined that the service type of the first server is switched from the read-only service to the normal service, sending a data synchronization request to the second server through a dedicated network between the first server and the second server, and performing data synchronization between the first server and the second server through the dedicated network between the first server and the second server.

[0010] Among them, the data synchronization between the first server and the second server includes: querying the first database for data objects with expired tags and obtaining the data identifier of the data objects with expired tags; obtaining the data object corresponding to the data identifier from the second server through a dedicated network between the first server and the second server; and using the data object obtained from the second server to update the data object with expired tags in the first database.

[0011] An embodiment of the present application also provides a data processing method, which is applied to a second server, including: receiving a data operation request and determining the service type of the second server; when it is determined that the service type of the second server is a read-write service, executing the data operation request and identifying the data operation request for writing a data object; sending the data operation request for writing a data object to the first server via a public network, so that the first server updates the data validity status according to the data operation request.

[0012] The method further includes: receiving a data synchronization request from the first server through a dedicated network between the first server and the second server; and performing data synchronization between the first server and the second server through the dedicated network between the first server and the second server.

[0013] Among them, the data synchronization between the first server and the second server includes: obtaining the data object corresponding to the data identifier in the second database according to the data identifier carried in the data synchronization request; returning the data object corresponding to the data identifier in the second database to the first server through the dedicated network between the first server and the second server, so that the first server updates the data object with an expired tag in the first server.

[0014] The embodiment of the present application also provides a data processing device, including: the data processing device set on a first server, including: a first receiving module, used to receive a data operation request and determine the service type of the first server; a first identification module, used to identify the data operation request for reading a valid data object and identify the data operation request for updating the data validity state when the service type of the first server is determined to be a read-only service; a first processing module, used to execute the data operation request for reading a valid data object and update the data validity state of the data object according to the data operation request for updating the data validity state; a first sending module, used to send other data operation requests to a second server whose service type is a read-write service through a public network, so that the second server executes the other data operation requests; the data processing device set on the second server, including: a second receiving module, used to receive a data operation request and determine the service type of the second server; a second processing module, used to execute the data operation request and identify the data operation request for writing a data object when the service type of the second server is determined to be a read-write service; a second sending module, used to send the data operation request for writing a data object to the first server through a public network, so that the first server updates the data validity state according to the data operation request.

[0015] An embodiment of the present application also provides a data processing device, comprising: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor connected to the at least one bus; and at least one memory connected to the at least one bus, wherein the processor is configured to: execute a data processing program stored in the memory to implement any of the above-mentioned data processing methods executed on the first server, or to implement any of the above-mentioned data processing methods executed on the first server.

[0016] An embodiment of the present application also provides a computer-readable storage medium, which stores computer-executable instructions, and the computer-executable instructions are executed to implement any of the above-mentioned data processing methods executed on the first server, or to implement any of the above-mentioned data processing methods executed on the first server.

[0017] The above technical solution provided by the embodiment of the present application has the following advantages over the prior art: the method provided by the embodiment of the present application can receive a data operation request on the first server side and determine the service type of the first server; in the case of determining that the service type of the first server is a read-only service, identify the data operation request for requesting to read a valid data object and identify the data operation request for updating the valid state of data; execute the data operation request for requesting to read a valid data object and update the data valid state of the data object according to the data operation request for updating the valid state of data; send other data operation requests to the second server whose service type is a read-write service through a public network so that the second server executes other data operation requests. After the data synchronization between the first server and the second server is suspended, the embodiment of the present application provides a read-only service on the first server, updates the data valid state of the data object according to the data operation request, only executes the data operation request for reading the valid data object, and forwards other data operation requests to the second server for execution, which can ensure that the latest data object is returned to the user terminal, avoids sending the data object before the update to the user object, and thus can meet the requirements of low data latency services for data real-time performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0019] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0020] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0021] Figure 1 is a flowchart of a data processing method executed on a first server according to an embodiment of the present application;

[0022] Figure 2 is a flow chart of a data processing method executed on a second server according to an embodiment of the present application;

[0023] Figure 3 A flowchart of steps for identifying a data operation request according to an embodiment of the present application;

[0024] Figure 4 A flowchart of the steps of data synchronization performed on the first server according to an embodiment of the present application;

[0025] Figure 5 A flowchart of the steps of data synchronization performed on the second server according to an embodiment of the present application;

[0026] Figure 6 is a structural diagram of a data processing device disposed on a first server according to an embodiment of the present application;

[0027] Figure 7 is a structural diagram of a data processing device disposed on a second server according to an embodiment of the present application;

[0028] Figure 8 is a structural diagram of a data processing device according to an embodiment of the present application. DETAILED DESCRIPTION

[0029] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0030] The disclosure below provides many different embodiments or examples to realize the different structures of the present application. In order to simplify the disclosure of the present application, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present application. In addition, the present application can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.

[0031] The embodiment of the present application provides a data processing method executed on a first server. The execution subject of the embodiment of the present application is the first server. Figure 1 2 is a flowchart of a data processing method executed on a first server according to an embodiment of the present application.

[0032] Step S110: receiving a data operation request and determining a service type of the first server.

[0033] A data operation request is used to request to perform a data operation on a data object. The data object is data stored in a database. The data operation request received by the first server comes from a user terminal or from a second server. Both the first server and the second server can be cloud servers. The first database running in the first server and the second database running in the second server are used to form a dual-cloud multi-master database.

[0034] The types of services include at least: read-only service and read-write service. Read-only service means that only reading of data objects is allowed. Read-write service means that both reading and writing of data are allowed.

[0035] In an embodiment of the present application, after data synchronization between the first server and the second server is suspended, a data operation request is received and the service type of the first server is determined. Further, the reason for suspending data synchronization includes: a failure of the dedicated line network between the first server and the second server. That is, in the case of a failure of the dedicated line network between the first server and the second server, a data operation request is received and the service type of the first server is determined.

[0036] Step S120: When it is determined that the service type of the first server is a read-only service, identify the data operation request for reading a valid data object and identify the data operation request for updating a valid state of data.

[0037] A valid data object refers to a data object that has not been updated on the second server.

[0038] The data validity status is used to identify whether the data object is a valid data object.

[0039] In an embodiment of the present application, it is possible to determine whether a data object is a valid data object based on the data validity status of the data object corresponding to the data operation request, and then identify the data operation request for reading the valid data object; based on the source of the data operation request, identify the data operation request for updating the data validity status.

[0040] The types of data validity status include: valid status and expired status. The valid status indicates that the data object has not been updated on the second server, and the data object is a valid data object. The expired status indicates that the data object has been updated on the second server, and the data object is an expired data object. Further, the data validity status can be represented by an expiration tag. The data validity status of a data object with an expiration tag set is an expired status. The data validity status of a data object without an expiration tag set is a valid status.

[0041] Step S130, executing the data operation request for reading a valid data object and updating the data validity status of the data object according to the data operation request for updating the data validity status.

[0042] Executing the data operation request for reading a valid data object includes: reading a data object corresponding to the data operation request from a first database running on a first server according to the data operation request, and sending the data object to a destination address carried in the data operation request.

[0043] According to the data operation request for updating the data validity state, updating the data validity state of the data object includes: according to the data operation request, querying the data object corresponding to the data operation request in the first database running on the first server; setting the data validity state of the data object to an expired state. Furthermore, if the data object is not set with an expiration tag, an expiration tag can be added to the data object to indicate that the data validity state of the data object is an expired state.

[0044] Step S140: Send the other data operation requests to a second server whose service type is read-write service through a public network, so that the second server executes the other data operation requests.

[0045] Other data operation requests refer to data operation requests that are neither for requesting to read a valid data object nor for updating the valid status of data.

[0046] A public network refers to a public network, such as the Internet.

[0047] In an embodiment of the present application, in order to ensure that other data operation requests can be sent to the second server, the other data operation requests are sent to the second server whose service type is read and write service through the public network, thereby avoiding the problem of being unable to use the dedicated line network to send data during a dedicated line network failure.

[0048] In an embodiment of the present application, at the first server side, a data operation request is received and the service type of the first server is determined; when it is determined that the service type of the first server is a read-only service, the data operation request for requesting to read a valid data object and the data operation request for updating the valid state of the data are identified; the data operation request for requesting to read a valid data object is executed and the data valid state of the data object is updated according to the data operation request for updating the valid state of the data; the other data operation requests are sent to the second server whose service type is a read-write service through a public network so that the second server executes the other data operation requests. After the data synchronization between the first server and the second server is suspended, the first server is made to perform only a read operation, so that the incremental data can be concentrated in the second database running on the second server, so that no data conflict will occur during the subsequent data synchronization between the first server and the second server; when the first server provides a read-only service, the data valid state of the data object is updated according to the data operation request, and only the data operation request for reading the valid data object is executed, and the other data operation requests are forwarded to the second server for execution, which can ensure that the latest data object is returned to the user terminal, avoid sending the data object before the update to the user object, and meet the requirements of low data latency business for data real-time performance. Furthermore, low data latency services refer to services that have high requirements for data real-time performance, such as stock services and train ticket booking services.

[0049] Based on the above data processing method executed on the first server, the embodiment of the present application also provides a data processing method executed on the second server. The execution subject of the embodiment of the present application is the second server. Figure 2 2 is a flow chart of a data processing method executed on a second server according to an embodiment of the present application.

[0050] Step S210: receiving a data operation request and determining a service type of the second server.

[0051] The data operation request received by the second server comes from the user terminal or from the first server. If the data operation request comes from the first server, it means that the data operation request is a data operation request that has not been executed by the first server.

[0052] In an embodiment of the present application, after data synchronization is suspended between the first server and the second server, a data operation request is received and the service type of the second server is determined. Further, the reason for suspending data synchronization includes: a failure of the dedicated line network between the first server and the second server. That is, in the case of a failure of the dedicated line network between the first server and the second server, a data operation request is received and the service type of the second server is determined.

[0053] Step S220: When it is determined that the service type of the second server is a read-write service, execute the data operation request and identify the data operation request for writing a data object.

[0054] The service type of the second server is a read-write service, which means that the second server can perform both read operations and write operations. In this case, the second server can execute each data operation request received.

[0055] The data operation request for writing a data object refers to a data operation request for performing a write operation on the data object, wherein the write operation includes: adding, deleting and modifying operations.

[0056] Step S230: Send the data operation request for writing the data object to the first server through the public network, so that the first server updates the data validity status according to the data operation request.

[0057] In an embodiment of the present application, on the second server side, a data operation request is received and the service type of the second server is determined; when it is determined that the service type of the second server is a read-write service, the data operation request is executed and the data operation request for writing a data object is identified; the data operation request for writing a data object is sent to the first server through a public network so that the first server updates the data validity status according to the data operation request. In order to ensure that the first server can promptly know that the second server has updated the data object, in an embodiment of the present application, it is necessary to identify the data operation request for performing a write operation after receiving the data operation request, and in order to ensure that the data operation request for performing a write operation can be sent to the first server normally, the second server sends the data operation request for performing a write operation to the first server through a public network, so that after receiving the data operation request for performing a write operation, the first server identifies the data operation request for performing a write operation as a data operation request for updating the data validity status and updates the data validity status of the data object according to the data operation request.

[0058] In order to make the data processing process of the present application clearer, the steps performed by the first server and the second server will be further described below.

[0059] In an embodiment of the present application, the data processing process of the present application can be executed when data synchronization between the first server and the second server is suspended.

[0060] Furthermore, the suspension of data synchronization between the first server and the second server may be a situation where a dedicated network between the first server and the second server fails. The following description is made by taking a situation where a dedicated network between the first server and the second server fails as an example. When it is desired to know the situation where data synchronization between the first server and the second server is suspended, the suspension of data synchronization between the first server and the second server may be directly replaced with a situation where a dedicated network between the first server and the second server fails for understanding.

[0061] Specifically, the first server side and the second server side can monitor whether a failure occurs in the dedicated line network between the first server and the second server; and when a failure occurs in the dedicated line network, the service type of the server is determined.

[0062] The dedicated network is a dedicated network for the first server and the second server, wherein the first server and the second server perform data synchronization through the dedicated network.

[0063] The types of services include: read-only service, read-write service and normal service.

[0064] Read-only service means that only read operations are allowed.

[0065] Read-write service means that both read operations and write operations are allowed.

[0066] Normal service means that both read operations and write operations are allowed.

[0067] In the embodiment of the present application, read-only service and read-write service are service types that can be provided by two servers during a dedicated network failure. Normal service is a service that can be provided by two servers when the dedicated network is normal.

[0068] In an embodiment of the present application, when the first server monitors that a fault occurs in the dedicated network between the first server and the second server, the first server determines that the service type of the first server is a read-only service; when the first server monitors that the dedicated network between the first server and the second server returns to normal, the first server determines that the service type of the first server is switched from read-only service to normal service.

[0069] In an embodiment of the present application, when the second server monitors that a fault occurs in the dedicated network between the first server and the second server, it can be determined that the service type of the second server is a read-write service; when the dedicated network between the first server and the second server is monitored to return to normal, it can be determined that the service type of the first server is switched from a read-write service to a normal service.

[0070] Furthermore, the embodiments of the present application can pre-configure a first server that can provide a read-only service and a second server that can provide a read-write service between two servers during a failure in a dedicated network. On the first server side for providing read-only service, when a failure in the dedicated network is detected, the service type of the first server is switched from normal service to read-only service, and the first server side can determine that the service type is a read-only service; when the dedicated network is detected to be restored to normal, the service type of the first server is switched from read-only service to normal service, and the first server side can determine that the service type is a normal service. On the second server side for providing read-write service, when a failure in the dedicated network is detected, the service type of the second server is switched from normal service to read-write service, and the second server side can determine that the service type is a read-write service; when the dedicated network is detected to be restored to normal, the service type of the second server is switched from read-write service to normal service, and the second server side can determine that the service type is a normal service.

[0071] Furthermore, the embodiments of the present application can also configure a first server that can provide read-only services and a second server that can provide read-write services between two servers by means of dynamic configuration when a dedicated network fails. For example: a server with low resource utilization is configured as a server that provides read-write services, or, when two consecutive dedicated network failures occur, different servers are used to provide read-write services. Types of resource utilization include, but are not limited to: memory utilization, CPU occupancy. When the number of resource utilizations obtained is multiple, the average or weighted average of each resource utilization can be calculated as the resource utilization of the server. In order to achieve dynamic configuration, an independent configuration device can be set up, and the dedicated network can be monitored by the configuration device; when a fault in the dedicated network is detected, the service type of the first server with low resource utilization is switched from normal service to read-only service, and the service type of the second server with high resource utilization is switched from normal service to read-write service. At this time, the first server side can determine that the service type of the first server is read-only service, and the second server side can determine that the service type of the second server is read-write service; when it is monitored that the dedicated network has returned to normal, the service type of the first server is switched from read-only service to normal service, and the service type of the second server is switched from read-write service to normal server. At this time, the first server side can determine that the service type of the first server is normal service, and the second server side can determine that the service type of the second server is normal service.

[0072] In an embodiment of the present application, in the event that a failure occurs in the dedicated network between the first server and the second server, the first server and the second server can both normally receive data operation requests, and the first server and the second server respectively execute different step processes according to the services they can provide.

[0073] The following describes the steps performed after the first server receives the data operation request.

[0074] In the process of receiving the data operation request, the first server needs to identify the data operation request for reading the valid data object and the data operation request for updating the valid state of the data. Figure 3 , which is a flow chart of the steps for identifying a data operation request according to an embodiment of the present application.

[0075] Step S310: The first server receives a data operation request.

[0076] Step S320, the first server identifies whether the data operation request is for requesting a read operation on a data object; if yes, execute step S330; if not, execute step S340.

[0077] The operation types corresponding to the data operation request include a read operation type and a write operation type.

[0078] A data operation request of the read operation type is used to request to perform a read operation on a data object.

[0079] A data operation request of the write operation type is used to request to perform a write operation on a data object.

[0080] Step S330, when the first server identifies that the data operation request is for requesting a read operation on a data object, it queries whether the data object is set with an expiration tag; if not, execute step S340; if yes, execute step S360.

[0081] Step S340: When the first server identifies that the data object does not have the expiration tag set, the first server determines the data operation request as the data operation request for requesting to read a valid data object.

[0082] Since data synchronization needs to be performed between the first server and the second server, the data objects between the first server and the second server should be the same. However, when data synchronization cannot be performed between the first server and the second server, there may be inconsistencies in the data objects. At this time, it is necessary to query whether the data object in the first server has an expiration tag. If the data object does not have an expiration tag, it means that the data object of the second server has not performed a write operation and the data object has not changed. The data object in the first server is a valid data object and can be provided to the user.

[0083] Step S350: When the first server identifies that the data object is set with the expiration tag, the first server determines the data operation request as another data operation request.

[0084] When a data object is set with an expiration tag, it means that a write operation has been performed on the data object in the second server, and the data object has changed, while the data object in the first server is still the data object before the change, which has expired and the data object in the first server becomes an invalid data object.

[0085] Step S360, when the first server identifies that the data operation request is used to request a write operation on a data object, it determines whether the data operation request has been executed on the second server by querying a preset field in the data operation request; if yes, execute step S370; if not, execute step S380.

[0086] The preset field is the source device address field, which is used to store the source device address; or the preset field is the executed tag field, which is used to store the executed tag. The source device refers to the source of the data operation request, that is, the second server or the user terminal.

[0087] In the case where the preset field is the address field of the source device, if the address of the source device stored in the address field is the address of the second server, it means that the data operation request has been executed on the second server; if the address of the source device stored in the address field is the address of the user terminal, it means that the data operation request has not yet been executed on the second server.

[0088] In the case where the preset field is an executed tag field, if the executed tag field stores an executed tag, it means that the data operation request has been executed on the second server; otherwise, it means that the data operation request has not been executed on the second server.

[0089] Step S370: When the data operation request has been executed by the second server, the first server determines the data operation request as the data operation request for updating the valid state of data.

[0090] Step S380: If the data operation request has not been executed on the second server, the first server determines the data operation request as another data operation request.

[0091] In an embodiment of the present application, after the first server identifies a data operation request for reading a valid data object, it executes the data operation request for reading a valid data object. After the first server identifies a data operation request for updating a valid data state, according to the data operation request for updating a valid data state, it sets an expiration tag for the data object corresponding to the data operation request in the first database.

[0092] Furthermore, when setting an expiration tag for the data object corresponding to the data operation request in the first database, if the data object corresponding to the data operation request in the first database has already been set with an expiration tag, then there is no need to set the expiration tag again this time. This situation indicates that the data object has been written to multiple times on the second server.

[0093] The following describes the steps performed after the second server receives the data operation request.

[0094] The second server executes each received data operation request in the process of receiving the data operation request, and identifies the data operation request for performing a write operation in the process of receiving the data operation request. In order for the first server to be informed in time that a write operation has been performed on the data object, the second server sends the data operation request for performing a write operation to the first server after identifying the data operation request for performing a write operation.

[0095] Specifically, the second server can add an executed tag to the data operation request for performing a write operation. The executed tag is used to indicate that the data operation request for performing a write operation has been executed by the second server. In this way, after receiving the data operation request for performing a write operation, the first server can identify the data operation request for performing a write operation as a data operation request for updating the valid state of data, and then add an expired tag to the data object corresponding to the data operation request in the first database.

[0096] Further, after receiving the data operation request, the first server determines the operation type corresponding to the data operation request; if it is determined that the operation type corresponding to the data operation request is a write operation, the first server checks the address of the source device carried in the data operation request; if it is determined that the address of the source device is the address corresponding to the second server, the first server identifies the data operation request as a data operation request for updating the valid state of the data. Alternatively, after receiving the data operation request, the first server determines the operation type corresponding to the data operation request; if it is determined that the operation type corresponding to the data operation request is a write operation, the first server checks whether the data operation request carries an executed tag; if the data operation request carries an executed tag, the first server identifies the data operation request as a data operation request for updating the valid state of the data.

[0097] In the embodiment of the present application, after the dedicated line network between the first server and the second server returns to normal, data synchronization needs to be performed between the first server and the second server.

[0098] When determining that the service type of the first server is switched from the read-only service to the normal service, the first server sends a data synchronization request to the second server through the dedicated network between the first server and the second server, and performs data synchronization between the first server and the second server through the dedicated network between the first server and the second server.

[0099] The data synchronization request is used to request data synchronization with the second server. The data synchronization request may carry information about the data object that needs to be synchronized. The information about the data object includes at least the following: a data identifier of the data object and a generation time period of the data object. The data identifier is unique.

[0100] The second server receives a data synchronization request from the first server through a dedicated network between the first server and the second server; and performs data synchronization between the first server and the second server through the dedicated network between the first server and the second server.

[0101] like Figure 4 2 is a flowchart of the steps of data synchronization performed on the first server according to an embodiment of the present application.

[0102] Step S410: Search the first database for data objects with expired tags and obtain data identifiers of the data objects with expired tags.

[0103] The first database is a database running on the first server.

[0104] Step S420: Acquire the data object corresponding to the data identifier from the second server through the dedicated network between the first server and the second server.

[0105] Step S430: Use the data object obtained from the second server to update the data object with the expired tag in the first server.

[0106] like Figure 5 2 is a flowchart of the steps of data synchronization performed on the second server according to an embodiment of the present application.

[0107] Step S510: acquiring the data object corresponding to the data identifier in the second database according to the data identifier carried in the data synchronization request; wherein the data identifier is the data identifier of the data object having an expired tag in the first database run by the first server.

[0108] Step S520: Return the data object corresponding to the data identifier in the second database to the first server through the dedicated network between the first server and the second server, so that the first server updates the data object with the expired tag in the first server.

[0109] Of course, the method of performing data synchronization between the first server and the second server in the embodiment of the present application is not limited to this. For example: the first server obtains the first time when the service type of the first server switches from normal service to read-only service and the second time when the service type of the first server switches from read-only service to normal service; wherein the first time is earlier than the second time; the first time is subtracted from the preset first delay time to obtain the third time, and the second time is added to the preset second delay time to obtain the fourth time; through the dedicated network between the first server and the second server, the write operation log data with a generation time between the third time and the fourth time is obtained from the second server and the write operation log data is executed; wherein the write operation log data is at least used to record each write operation task performed by the second server between the third time and the fourth time. Thus, the first server can update the data objects between the third time and the fourth time to maintain the data consistency between the first database and the second database.

[0110] The present application also provides a data processing device disposed on a first server. Figure 6 2 is a structural diagram of a data processing device disposed on a first server according to an embodiment of the present application.

[0111] The data processing device disposed on the first server includes:

[0112] The first receiving module 610 is configured to receive a data operation request and determine a service type of the first server.

[0113] The first identification module 620 is used to identify the data operation request for reading a valid data object and the data operation request for updating a valid state of data when it is determined that the service type of the first server is a read-only service.

[0114] The first processing module 630 is used to execute the data operation request for reading a valid data object and update the data validity state of the data object according to the data operation request for updating the data validity state.

[0115] The first sending module 640 is used to send the other data operation requests to the second server whose service type is read-write service through the public network, so that the second server executes the other data operation requests.

[0116] The functions of the device described in the embodiment of the present application have been described in the above method embodiment. Therefore, for any details not provided in the description of this embodiment, please refer to the relevant descriptions in the above embodiment and will not be repeated here.

[0117] The present application also provides a data processing device disposed on a second server. Figure 7 , which is a structural diagram of a data processing device disposed on a second server according to an embodiment of the present application.

[0118] The data processing device disposed on the second server includes:

[0119] The second receiving module 710 is configured to receive a data operation request and determine a service type of the second server.

[0120] The second processing module 720 is configured to, when determining that the service type of the second server is a read-write service, execute the data operation request and identify the data operation request for writing a data object.

[0121] The second sending module 730 is used to send the data operation request for writing the data object to the first server through the public network, so that the first server updates the data validity status according to the data operation request.

[0122] The functions of the device described in the embodiment of the present application have been described in the above method embodiment. Therefore, for any details not provided in the description of this embodiment, please refer to the relevant descriptions in the above embodiment and will not be repeated here.

[0123] The present application also provides a data processing device, such as Figure 8 , which is a structural diagram of a data processing device according to an embodiment of the present application.

[0124] The data processing device includes: a processor 810, a communication interface 820, a memory 830 and a communication bus 840. The processor 810, the communication interface 820 and the memory 830 communicate with each other via the communication bus 840.

[0125] The memory 830 is used to store computer programs.

[0126] In one embodiment of the present application, the processor 810, when used to execute the program stored in the memory 830, implements the data processing method provided by any of the aforementioned method embodiments on the first server, including: receiving a data operation request and determining the service type of the first server; when determining that the service type of the first server is a read-only service, identifying the data operation request requesting to read a valid data object and identifying the data operation request for updating the data validity status; executing the data operation request requesting to read a valid data object and updating the data validity status of the data object according to the data operation request for updating the data validity status; sending the other data operation requests to a second server whose service type is a read-write service through a public network, so that the second server executes the other data operation requests.

[0127] Among them, the identifying the data operation request for reading a valid data object includes: when it is identified that the data operation request is for requesting to perform a read operation on a data object, querying whether the data object is set with an expiration tag; when the data object is not set with the expiration tag, determining the data operation request as the data operation request for requesting to read a valid data object; when the data object is set with the expiration tag, determining the data operation request as other data operation requests.

[0128] Among them, the identifying of the data operation request for updating the valid status of data includes: when it is identified that the data operation request is used to request a write operation to a data object, determining whether the data operation request has been executed on the second server by querying a preset field in the data operation request; when the data operation request has been executed on the second server, determining the data operation request as the data operation request for updating the valid status of data; when the data operation request has not been executed on the second server, determining the data operation request as other data operation requests.

[0129] The method also includes: when it is determined that the service type of the first server is switched from the read-only service to the normal service, sending a data synchronization request to the second server through a dedicated network between the first server and the second server, and performing data synchronization between the first server and the second server through the dedicated network between the first server and the second server.

[0130] Among them, the data synchronization between the first server and the second server includes: querying the first database for data objects with expired tags and obtaining the data identifier of the data objects with expired tags; obtaining the data object corresponding to the data identifier from the second server through a dedicated network between the first server and the second server; and using the data object obtained from the second server to update the data object with expired tags in the first database.

[0131] In one embodiment of the present application, the processor 810, when executing the program stored in the memory 830, implements the data processing method provided by the second server of any of the aforementioned method embodiments, including: receiving a data operation request and determining the service type of the second server; when determining that the service type of the second server is a read-write service, executing the data operation request and identifying the data operation request for writing a data object; sending the data operation request for writing a data object to the first server via a public network, so that the first server updates the data validity status according to the data operation request.

[0132] The method further includes: receiving a data synchronization request from the first server through a dedicated network between the first server and the second server; and performing data synchronization between the first server and the second server through the dedicated network between the first server and the second server.

[0133] Among them, the data synchronization between the first server and the second server includes: obtaining the data object corresponding to the data identifier in the second database according to the data identifier carried in the data synchronization request; returning the data object corresponding to the data identifier in the second database to the first server through the dedicated network between the first server and the second server, so that the first server updates the data object with an expired tag in the first server.

[0134] The present application embodiment also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the data processing method provided in any of the aforementioned method embodiments are implemented. Since the data processing method has been described in detail above, for any details not fully described in the description of this embodiment, please refer to the relevant descriptions in the aforementioned embodiments, and no further description will be given here.

[0135] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0136] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0137] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.

[0138] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest range consistent with the principles and novel features applied for herein.

Claims

1. A data processing method, characterized in that: Applied to the first server, comprising: receiving a data operation request and determining a service type of the first server; In the case where it is determined that the service type of the first server is a read-only service, identifying the data operation request for requesting to read a valid data object and identifying the data operation request for updating a valid state of data; Executing the data operation request for reading a valid data object and updating the data validity status of the data object according to the data operation request for updating the data validity status; The other data operation requests are sent to a second server whose service type is read-write service through a public network, so that the second server executes the other data operation requests.

2. The method according to claim 1, characterized in that The identifying request to read the data operation request of the valid data object comprises: In the case of identifying that the data operation request is for requesting to perform a read operation on a data object, querying whether an expiration tag is set for the data object; In a case where the expiration tag is not set for the data object, determining the data operation request as the data operation request for requesting to read a valid data object; In a case where the data object is set with the expiration tag, the data operation request is determined as another data operation request.

3. The method according to claim 1, characterized in that The identifying the data operation request for updating the valid state of data comprises: In the case where it is identified that the data operation request is for requesting to perform a write operation on a data object, determining whether the data operation request has been executed on the second server by querying a preset field in the data operation request; In a case where the data operation request has been executed on the second server, determining the data operation request as the data operation request for updating the valid state of data; In a case where the data operation request has not been executed on the second server, the data operation request is determined as another data operation request.

4. The method according to claim 1, characterized in that: The method further comprises: When it is determined that the service type of the first server is switched from the read-only service to the normal service, a data synchronization request is sent to the second server through the dedicated network between the first server and the second server, and data synchronization is performed between the first server and the second server through the dedicated network between the first server and the second server.

5. The method according to claim 4, characterized in that The synchronizing data between the first server and the second server includes: Searching the first database for data objects with expired tags and obtaining data identifiers of the data objects with expired tags; Acquire, from the second server through a dedicated network between the first server and the second server, a data object corresponding to the data identifier; The data object with the expired tag in the first database is updated by using the data object obtained from the second server.

6. A data processing method, characterized in that: Applied to the second server, including: receiving a data operation request and determining a service type of the second server; In the case where it is determined that the service type of the second server is a read-write service, executing the data operation request and identifying the data operation request for writing a data object; The data operation request for writing the data object is sent to the first server through a public network, so that the first server updates the data validity status according to the data operation request.

7. The method according to claim 6, characterized in that The method further comprises: receiving a data synchronization request from the first server via a dedicated network between the first server and the second server; and Data synchronization is performed between the first server and the second server through a dedicated network between the first server and the second server.

8. The method according to claim 7, characterized in that The synchronizing data between the first server and the second server includes: According to the data identifier carried in the data synchronization request, obtaining a data object corresponding to the data identifier in the second database; The data object corresponding to the data identifier in the second database is returned to the first server through the dedicated network between the first server and the second server, so that the first server updates the data object with the expired tag in the first server.

9. A data processing device, characterized in that: include: The data processing device provided on the first server includes: A first receiving module, configured to receive a data operation request and determine a service type of the first server; A first identification module is used to identify the data operation request for reading a valid data object and the data operation request for updating a valid state of data when it is determined that the service type of the first server is a read-only service; A first processing module, configured to execute the data operation request for reading a valid data object and to update the data validity state of the data object according to the data operation request for updating the data validity state; A first sending module, used for sending the other data operation requests to a second server whose service type is read-write service through a public network, so that the second server executes the other data operation requests; The data processing device provided on the second server includes: A second receiving module, configured to receive a data operation request and determine a service type of the second server; A second processing module, configured to execute the data operation request and identify the data operation request for writing a data object when determining that the service type of the second server is a read-write service; The second sending module is used to send the data operation request for writing the data object to the first server through the public network, so that the first server updates the data validity status according to the data operation request.

10. A data processing device, characterized in that: include: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor connected to the at least one bus; At least one memory connected to the at least one bus, wherein the processor is configured to: execute a data processing program stored in the memory to implement the data processing method of any one of claims 1 to 5 executed on the first server, or to implement the data processing method of any one of claims 6 to 8 executed on the first server.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are executed to implement the data processing method of any one of claims 1-5 executed on the first server, or to implement the data processing method of any one of claims 6-8 executed on the first server.