CN111090701B - Service request processing method, device, readable storage medium and computer equipment - Google Patents

Service request processing method, device, readable storage medium and computer equipment Download PDF

Info

Publication number
CN111090701B
CN111090701B CN201911316795.6A CN201911316795A CN111090701B CN 111090701 B CN111090701 B CN 111090701B CN 201911316795 A CN201911316795 A CN 201911316795A CN 111090701 B CN111090701 B CN 111090701B
Authority
CN
China
Prior art keywords
data
database
service request
flag bit
request
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.)
Active
Application number
CN201911316795.6A
Other languages
Chinese (zh)
Other versions
CN111090701A (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201911316795.6A priority Critical patent/CN111090701B/en
Publication of CN111090701A publication Critical patent/CN111090701A/en
Application granted granted Critical
Publication of CN111090701B publication Critical patent/CN111090701B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • G06F16/275Synchronous replication

Abstract

The application relates to a service request processing method, a device, a computer readable storage medium and computer equipment, wherein the method comprises the following steps: receiving a service request forwarded by a first system, wherein the service request is a request initiated by a user terminal in the process of migrating data in a first database corresponding to the first system to a second database; acquiring a flag bit of first data from the first database according to the service request, wherein the first data is data related to the service request; when the flag bit of the first data is not synchronous, processing the first data in the first database according to the service request; and when the flag bit of the first data is synchronized, processing the first data in the second database according to the service request. The scheme provided by the application can provide external service in the data migration process and complete the processing of the user service request.

Description

Service request processing method, device, readable storage medium and computer equipment
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a service request processing method, a service request processing device, a computer readable storage medium, and a computer device.
Background
For online operation service, when reconstructing system architecture or upgrading service, migration of service data is often accompanied. For example, in the field of games, data migration is typically performed by stopping the machine. The conventional method is to make a notice of shutdown maintenance in advance, stop the old system from external service, migrate the user data from the old database to the new database, and finally start the new system to external service.
However, for service platforms with relatively large data volumes, such as application stores, e-commerce platforms, etc., the reconfiguration or upgrade time is relatively long, during which stopping the external service results in the platform not responding to the user request.
Disclosure of Invention
Based on this, it is necessary to provide a service request processing method, apparatus, computer readable storage medium and computer device for the technical problem that the system platform reconfiguration or upgrade cannot respond to the user request.
A service request processing method, comprising:
receiving a service request forwarded by a first system, wherein the service request is a request initiated by a user terminal in the process of migrating data in a first database corresponding to the first system to a second database;
Acquiring a flag bit of first data from the first database according to the service request, wherein the first data is data related to the service request;
when the flag bit of the first data is not synchronous, processing the first data in the first database according to the service request;
and when the flag bit of the first data is synchronized, processing the first data in the second database according to the service request.
A service request processing apparatus, the apparatus comprising:
the system comprises a receiving module, a first database and a second database, wherein the receiving module is used for receiving a service request forwarded by a first system, and the service request is a request initiated by a user terminal in the process of migrating data in the first database corresponding to the first system to the second database;
the acquisition module is used for acquiring a flag bit of first data from the first database according to the service request, wherein the first data is data related to the service request;
the unsynchronized processing module is used for processing the first data in the first database according to the service request when the flag bit of the first data is unsynchronized;
and the synchronous processing module is used for processing the first data in the second database according to the service request when the flag bit of the first data is synchronous.
A computer readable storage medium storing a computer program which, when executed by a processor, causes the processor to perform the steps of:
receiving a service request forwarded by a first system, wherein the service request is a request initiated by a user terminal in the process of migrating data in a first database corresponding to the first system to a second database;
acquiring a flag bit of first data from the first database according to the service request, wherein the first data is data related to the service request;
when the flag bit of the first data is not synchronous, processing the first data in the first database according to the service request;
and when the flag bit of the first data is synchronized, processing the first data in the second database according to the service request.
A computer device comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, causes the processor to perform the steps of:
receiving a service request forwarded by a first system, wherein the service request is a request initiated by a user terminal in the process of migrating data in a first database corresponding to the first system to a second database;
Acquiring a flag bit of first data from the first database according to the service request, wherein the first data is data related to the service request;
when the flag bit of the first data is not synchronous, processing the first data in the first database according to the service request;
and when the flag bit of the first data is synchronized, processing the first data in the second database according to the service request.
According to the service request processing method, the device, the computer readable storage medium and the computer equipment, the service request forwarded by the first system is received, the service request is a request initiated by a user terminal in the process of migrating data in the first database corresponding to the first system to the second database, the flag bit of the first data is acquired from the first database according to the service request, the first data is data related to the service request, when the flag bit of the first data is unsynchronized, the first data in the first database is processed according to the service request, and when the flag bit of the first data is synchronized, the first data in the second database is processed according to the service request, so that the service request of a user can be received and corresponding processing can be performed in the data migration process of the system. Thereby completing the user response while the system is being reconfigured or upgraded.
Drawings
FIG. 1 is an application environment diagram of a service request processing method in one embodiment;
FIG. 2 is a flow diagram of a method for processing a service request in one embodiment;
FIG. 3 is a flowchart illustrating steps for processing first data in a first database according to a service request when a flag bit of the first data is not synchronized in one embodiment;
FIG. 4 is a flowchart illustrating steps for determining an association between first data and second data in a first database, in one embodiment;
FIG. 5 is a flow diagram of service request processing when first data is not synchronized in one embodiment;
FIG. 6 is a flow diagram of service request processing when first data is synchronized in one embodiment;
FIG. 7 is a block diagram showing a service request processing apparatus according to another embodiment;
FIG. 8 is a block diagram of a computer device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
Fig. 1 is an application environment diagram of a service request processing method in one embodiment. As shown in fig. 1, the service request processing method is applied to a service request processing system. The service request processing system includes a user terminal 102, a first system 104, a second system 106, an online migration server 108, a first database 110, and a second database 112. The user terminal 102 and the first system 104 and the second system 106 are connected via a network. The online migration server 108 is connected to the first system 104 and the second system 106 via a network. The first system 104 corresponds to a first database 110 and the second system 106 corresponds to a second database 112. The user terminal 102 may be a desktop terminal or a mobile terminal, and the mobile terminal may be at least one of a mobile phone, a tablet computer, a notebook computer, and the like. The online migration server 108 may be implemented as a stand-alone server or as a server cluster of multiple servers.
In this embodiment, the online migration server 108 migrates the data in the first database corresponding to the first system to the second database. During the data migration process, the user sends a service request to the first system through the user terminal 102, and the first system 104 forwards the service request to the online migration server 108. The online migration server 108 receives the service request forwarded by the first system 104, and queries the first database for data related to the service request, i.e., first data. Next, the online migration server 108 obtains a flag bit of the first data, the flag bit including a synchronized state and an unsynchronized state. When the flag bit of the first data is not synchronized, the online migration server 108 processes the first data in the first database 110 according to the service request. When the flag bit of the first data is synchronized, the online migration server 108 processes the first data in the second database 112 according to the service request.
Further, when the service request includes a read request and the flag bit of the first data is not synchronized, the online migration server 108 obtains the first data from the first database 110. The first data is sent to the first system 104 and returned to the user terminal 102 by the first system 104. When the flag bit of the first data is synchronized, the online migration server 108 obtains the first data from the second database 112. The first data is sent to the first system 104 and returned to the user terminal 102 by the first system 104.
Further, when the write request and the second data are included in the service request, the online migration server 108 may determine that the second data is full data or incremental data. When the second data is full data and the flag bit of the first data is not synchronized, the online migration server 108 writes the second data into the first database 110 and deletes the first data, and modifies the flag bit of the second data written into the first database 110 to be synchronized.
When the second data is incremental data and the flag bit of the first data is unsynchronized, the second data is written into the first database 110. And merges the first data in the first database 110 with the written second data. Next, the online migration server 108 obtains the first data in the first database, writes the first data and the second data into the second database 112, and merges the first data and the first data. Next, the online migration server 108 modifies the flag bit of the data obtained by merging the first data and the second data in the first database 110 to be synchronized.
When the second data is full data and the flag bit of the first data is synchronized, the online migration server 108 writes the second data to the second database 112 according to the write request and deletes the first data in the second database.
When the second data is incremental data and the flag bit of the first data is synchronized, the online migration server 108 writes the second data into the second database 112 according to the write request, and performs merging processing on the second data and the first data in the second database.
In another embodiment, when the user terminal 102 initiates a service request to the second system 106, the processing procedure is similar to the processing procedure when the user terminal 102 initiates a service request to the first system 104, which is not described herein. It will be appreciated that the first system 104 and the second system 106 are user terminal 102 oriented, and that the user terminal 102 sends a service request to the first system 104, and the first system 104 returns a response to the user terminal 102. The user terminal 102 sends a service request to the second system 106, and the second system 106 returns a response to the user terminal 102.
As shown in fig. 2, in one embodiment, a service request processing method is provided. The present embodiment is mainly exemplified by the application of the method to the online migration server 108 in fig. 1. Referring to fig. 2, the service request processing method specifically includes the following steps:
Step 202, a service request forwarded by a first system is received, where the service request is a request initiated by a user terminal in a process of migrating data in a first database corresponding to the first system to a second database.
Wherein the service request includes at least one of a read request and a write request. A read request refers to a request that does not change the original data, such as reading data, querying data, etc. A write request refers to a request that changes the original data, writes data, adds, deletes, and modifies data, etc. The data corresponding to the first system is stored in a first database.
Specifically, the online migration server migrates data in a first database corresponding to the first system to a second database. In the data migration process, a user sends a service request to a first system through a user terminal, and the first system forwards the service request to an online migration server. And the online migration server receives the service request forwarded by the first system and analyzes the service request.
Step 204, obtaining the flag bit of the first data from the first database according to the service request, where the first data is the data related to the service request.
The identification bit refers to a marking field corresponding to data in the first database and is used for marking whether the data is migrated to the second database. The flag bit corresponding to the data which is not migrated is in an unsynchronized state, and the flag bit corresponding to the data which is migrated is in a synchronized state.
Specifically, the online migration server analyzes the service request, and determines data related to the service request in the first database, namely, first data. Then, the online migration server inquires first data in the first database and acquires a flag bit of the first data.
And 206, processing the first data in the first database according to the service request when the flag bit of the first data is not synchronous.
And step 208, when the flag bit of the first data is synchronized, processing the first data in the second database according to the service request.
Specifically, the online migration server detects that a flag bit of the first data is not synchronized or is synchronized, and if the flag bit is not synchronized, the first data in the first database is processed. The first data in the second database is processed if synchronized. Further, the first data is processed according to specific instructions in the service request. For example, if the service request is read data, the first data is read from the first database, if the service request is write data, the data carried in the service request is written in the first database, and the flag bit of the first data is modified.
According to the service request processing method, the service request forwarded by the first system is received, the service request is a request initiated by the user terminal in the process of transferring the data in the first database corresponding to the first system to the second database, the flag bit of the first data is acquired from the first database according to the service request, the first data is the data related to the service request, and whether the data is transferred is determined by judging the flag bit of the data. When the flag bit of the first data is not synchronous, the first data in the first database is processed according to the service request, and when the flag bit of the first data is synchronous, the first data in the second database is processed according to the service request, so that the data can be transferred online in the process of reconstructing or upgrading the system, external services can be provided in the process of transferring the data, and the request initiated by the user terminal can be responded in real time.
In one embodiment, the service request includes a read request; when the flag bit of the first data is not synchronous, processing the first data in the first database according to the service request includes: when the flag bit of the first data is not synchronous, acquiring the first data from the first database; the first data is returned to the user terminal through the first system.
Specifically, the online migration server analyzes the service request to obtain a specific operation instruction. When the service request includes a read request, it is determined that the user terminal needs to query or read data. The online migration server determines a flag bit of the first data in the first database, and when the flag bit of the first data is unsynchronized, the first data is acquired from the first database. When the flag bit of the first data is not synchronous, the first data in the first database is processed, the online migration server returns the first data to the first system, and the first data is returned to the user terminal through the first system, so that the processing of the service request of the user terminal is completed.
In one embodiment, the service request includes a read request; when the flag bit of the first data is synchronized, processing the first data in the second database according to the service request includes: when the flag bit of the first data is synchronized, acquiring the first data from the second database; the first data is returned to the user terminal through the first system.
Specifically, for synchronized data, reading and querying are performed from the second database, and the like. And returning the first data to the user terminal through the first system for receiving the service request, thereby completing the processing of the service request of the user terminal.
In one embodiment, as shown in FIG. 3, the service request includes a write request and second data; when the flag bit of the first data is not synchronous, processing the first data in the first database according to the service request includes:
step 302, determining an association between the first data and the second data in the first database when the flag bit of the first data is not synchronized.
Wherein, the association between the first data and the second data may refer to whether the same data exists in the first data and the second data, and how much the same data exists.
Specifically, when the online migration server analyzes the service request to obtain a write request and second data, it is determined that the second data needs to be written into the first database. The online migration server obtains a flag bit of the first data related to the service request, and when the flag bit of the first data is unsynchronized, the first data is identified as not being migrated to the second database. The online migration server determines the association that exists between the first data and the second data, i.e., the same data in the first data and the second data.
Step 304, writing the second data into the first database according to the association between the first data and the second data.
Specifically, the online migration server writes the second data into the first database according to the write request according to the association existing between the first data and the second data. Then, merging the first data and the second data in the first database according to the association between the first data and the second data.
Step 306, writing the second data into the second database according to the write request.
Step 308, modifying the flag bits of the first data and the second data in the first database to be synchronized.
Specifically, the online migration server synchronizes the write request and the second data one copy to a second database. I.e. the online migration server writes the second data into the second database according to the write request. Then, the online migration server modifies the flag bits of the first data and the second data in the first database to be synchronized. Further, the online migration server may determine whether the first data needs to be written into the second database based on an association between the first data and the second data.
According to the service request processing method, when the flag bit of the first data is unsynchronized, the association between the first data and the second data in the first database is determined, the second data is written into the first database according to the association between the first data and the second data, the second data is written into the second database according to the writing request, and the flag bits of the first data and the second data in the first database are modified to be synchronized, so that the second data can be written into the first database and the second database in the state that the first data is unsynchronized, a user request is completed in the data migration process, and the newly added data of a user can be migrated into the second database at the same time, and the data migration efficiency is improved.
In one embodiment, when the online migration server receives the service request, the service request may be parsed, and when the service request includes the write request and the second data, the second data is further determined to be incremental data or full data. Specifically, the second data carries a corresponding data identifier, and the data identifier is used for identifying the second data as incremental data or full data. The online migration server can directly determine that the second data is incremental data or full data through the data identifier carried by the second data.
In one embodiment, as shown in fig. 4, the determining the association between the first data and the second data in the first database includes:
step 402, determining a proportion of the same data as the first data in the second data to the first data.
Specifically, the online migration server searches the first database for data related to the service request, i.e., first data. And comparing the first data with the second data in the service request, and determining the same data in the first data and the second data. The online migration server may then determine the proportion of the same data to the first data or the proportion of the same data to the second data.
Step 404, determining the second data to be full data when the ratio is greater than the first ratio threshold.
Step 406, determining the second data as incremental data when the ratio is less than a second ratio threshold; wherein the second proportional threshold is less than the first proportional threshold.
The first proportional threshold is a preset critical value for judging whether the second data is full data or not. The second proportion threshold value is a preset critical value for judging whether the second data is incremental data or not. The second proportional threshold is less than the first proportional threshold. The incremental data is new data different from the original data, and the total data is data including all the original data.
Specifically, after calculating the proportion of the same data to the first data, the online migration server compares the proportion with a first proportion threshold. When the ratio is greater than the first ratio threshold, indicating that the specific gravity of the first data in the second data is very large, the second data may be determined to be full-size data.
When the ratio is less than or equal to the first ratio threshold, a second ratio threshold is obtained. The ratio is compared to a second ratio threshold. When the ratio is smaller than the second ratio threshold, the first data is very small in the second data, and the second data can be judged to be incremental data.
In this embodiment, when the ratio is less than or equal to the first ratio threshold, the ratio is compared with the second ratio threshold, and when the ratio is greater than or equal to the second ratio threshold, the second data is taken as full data.
In this embodiment, the proportion of the same data as the first data in the second data to the first data is determined, when the proportion is greater than a first proportion threshold, the second data is determined to be full data, and when the proportion is less than a second proportion threshold, the second data is determined to be incremental data, wherein the second proportion threshold is less than the first proportion threshold, so that the type of the second data can be determined according to the proportion of the same data in the second data and the first data, and corresponding processing can be performed according to the type of the second data.
In one embodiment, the writing the second data to the first database according to the association between the first data and the second data includes: when the second data is full data, writing the second data into the first database and deleting the first data;
the modifying the flag bit of the first data and the second data in the first database to be synchronized includes: the flag bit of the second data written in the first database is modified to be synchronized.
Specifically, when the online migration server detects that the second data is full data, it means that all data of the first data is included in the second data, and new data not included in the first data exists. The online migration server writes the second data to the first database in accordance with the write request and overwrites the first data with the second data. And then, the online migration server writes the second data into a second database according to the writing request so as to realize the migration and updating of the data at the same time. And then, after receiving the result of the writing result returned by the second database, the online migration server modifies the flag bit of the second data written into the first database to be synchronized.
In the above embodiment, when the second data is full data, the second data is written into the first database and the first data is deleted, so that the update of the data is realized by overlapping the old data with the full new data. And writing the second data into the second database according to the writing request, so that the migration of the data and the updating of the data can be realized at the same time, and the user response is completed. External service is provided in the data migration process, processing of user service requests is completed, and inconvenience and loss caused by stopping providing service for the system during upgrading or reconstruction are avoided.
In one embodiment, the writing the second data to the first database according to the association between the first data and the second data includes: and when the second data is incremental data, writing the second data into the first database.
The method further comprises the steps of: acquiring the first data in the first database; and writing the first data into the second database according to the write request.
Specifically, when the online migration server detects that the second data is incremental data, the online migration server indicates that the second data only contains data which is not contained in the first data. The online migration server writes the second data to the first database in accordance with the write request. Further, the online migration server performs merging processing on the second data written into the first database and the first data.
When the flag bit of the first data is not synchronous, the first data is not migrated to the second database, and the second data is incremental data, which indicates that the online migration server needs to migrate both the first data and the second data to the second database. The online migration server acquires the first data in the first database, and writes the first data and the second data into the second database according to the write request. And combining the first data written into the second database with the second data to realize the updating of the first data.
And then, after receiving the information returned by the second database and written successfully, the online migration server modifies the flag bit of the data obtained by combining the first data and the second data in the first database into synchronized data.
In this embodiment, when the flag bit of the first data is not synchronized and the second data is incremental data, the second data is directly written into the first database and combined with the first data to update the first data. The first data in the first database is acquired, and the first data and the second data are written into the second database according to the write request, so that data migration and response processing of service requests initiated by users are realized.
In one embodiment, the service request includes a write request and second data; when the flag bit of the first data is synchronized, processing the first data in the second database according to the service request, including: writing the second data into the second database according to the write request; and processing the first data in the second database according to the second data.
Specifically, when the online migration server analyzes that the service request contains the write request and the second data, the flag bit of the first data related to the service data in the first database is further determined. When the flag bit of the first data is synchronized, the first data is migrated to the second database. The online migration server may write the second data directly to the second database according to the write request and determine the type of the second data, i.e., whether the second data is full data or incremental data. And determining the first data in the second database, and correspondingly processing the first data according to the type of the second data.
In this embodiment, when the flag bit of the first data is synchronized, the second data is written into the second database according to the write request, and for the synchronized data, the read-write operation is performed on the second database. And processing the first data in the second database according to the second data, so as to realize data migration and complete response processing of service requests initiated by users.
In one embodiment, the processing the first data in the second database according to the second data includes: when the second data is full data, writing the second data into the second database according to the writing request, and deleting the first data in the second database; and when the second data is incremental data, writing the second data into the second database according to the writing request, and merging the second data with the first data in the second database.
Specifically, the online migration server may obtain a data identifier carried by the second data, and directly determine the type of the second data according to the data identifier. When the second data is full data, it means that all the data including the first data exist in the second data, and new data not included in the first data exist. And writing the second data into the position of the first data in the second database according to the writing request, and covering the first data.
When the second data is incremental data, it means that the second data only contains data that is not contained in the first data. And writing the second data into the second database according to the write request, and merging the second data with the first data in the second database. The merging process refers to replacing part of the data in the first data with the second data based on a difference in the second data and the first data to effect updating of the first data. Further, the merging process may be to modify, replace, and add operations to corresponding part of the data in the first data according to the second data, so that the merged data can implement corresponding functions.
In this embodiment, when the second data is full data, the second data is written into the second database according to the write request, and the first data in the second database is deleted; when the second data is incremental data, the second data is written into the second database according to the writing request, and the second data and the first data in the second database are combined, so that corresponding processing is completed according to the service request of a user in the data migration process, and data migration and user response are realized.
As shown in fig. 5, in one embodiment, the flow of processing the service request when the first data is not synchronized is shown.
As shown in fig. 5, when data in a first database corresponding to a first system is migrated to a second database, the online migration server takes over read-write operations of the first system, the second system, the first database and the second database. And the user terminal used by the user initiates a service request to the first system or the second system, and the first system or the second system forwards the service request to the online migration server after receiving the service request. The online migration server receives the service request, analyzes the service request, and determines data related to the service request in a first database, namely first data.
Then, the online migration server pulls the synchronization mark from the first database, namely, initiates a request for acquiring the flag bit to the first server, and receives a result returned by the first database. And performing corresponding data read-write operation on the first data according to the flag bit of the first data and the service request, and receiving a result returned by the first database.
When the flag bit of the first data is unsynchronized, the data is read from and written to the first database. Corresponding to the writing request, the online migration server needs to synchronize the first data and the second data to the second database, so that the first data and the second data are written into the second database, and a writing result returned by the first database is received. After the writing is successful, the online migration server modifies the synchronous mark of the first data in the first database, namely, the flag bit is modified from unsynchronized to synchronized. And returning the response result to the first system or the second system, and returning the response result to the user terminal initiating the service request by the first system or the second system. Therefore, in the data migration process, the system can still receive the service request of the user and complete corresponding processing, and the inconvenience that the system stops external service when the system is reconfigured or upgraded is avoided.
As shown in fig. 6, in one embodiment, the flow of processing the service request when the first data is synchronized is shown.
And in the process of migrating the data in the first database corresponding to the first system to the second database, the online migration server takes over the read-write operation of the first system, the second system, the first database and the second database. And the user terminal used by the user initiates a service request to the first system or the second system, and the first system or the second system forwards the service request to the online migration server after receiving the service request. The online migration server receives the service request, analyzes the service request, and determines data related to the service request in a first database, namely first data.
Then, the online migration server pulls the synchronization mark from the first database, namely, initiates a request for acquiring the flag bit to the first server, and receives a result returned by the first database. And performing corresponding data read-write operation on the first data according to the flag bit of the first data and the service request, and receiving a result returned by the first database. When the flag bit of the first data is synchronized, the data is read from and written to the second database.
And directly writing the second data into the second database corresponding to the writing request, and returning a writing result. The online migration server receives the writing result, returns the response result to the first system or the second system, and returns the response result to the user terminal initiating the service request by the first system or the second system. Therefore, in the data migration process, the system can still receive the service request of the user and complete corresponding processing, and the inconvenience that the system stops external service when the system is reconfigured or upgraded is avoided.
It is understood that the second system is another system provided by the first system during the data migration process. The first system and the second system both face the user terminal, the user terminal initiates a service request to which system, and the system returns the processing result of the service request to the user terminal.
In one embodiment, a service request processing method is provided, including:
the online migration server receives a service request forwarded by a first system, wherein the service request is a request initiated by a user terminal in the process of migrating data in a first database corresponding to the first system to a second database.
And the online migration server acquires the flag bit of first data from the first database according to the service request, wherein the first data is data related to the service request.
When the service request comprises a read request and the flag bit of the first data is not synchronous, the online migration server acquires the first data from the first database; the first data is returned to the user terminal through the first system.
When the service request comprises a read request and the flag bit of the first data is not synchronous, the online migration server determines that the data which is the same as the first data in the second data occupies the proportion of the first data; when the ratio is greater than a first ratio threshold, determining that the second data is full data; when the ratio is less than a second ratio threshold, determining that the second data is incremental data; wherein the second proportional threshold is less than the first proportional threshold.
When the second data is full data, the online migration server writes the second data into the first database and deletes the first data; the flag bit of the second data written in the first database is modified to be synchronized.
When the second data is incremental data, the online migration server writes the second data into the first database; acquiring the first data in the first database; writing the first data into the second database according to the write request; writing the second data into the second database according to the write request; the flag bits of the first data and the second data in the first database are modified to be synchronized.
When the service request comprises a writing request and second data and the flag bit of the first data is synchronized, the online migration server writes the second data into the second database according to the writing request; when the second data is full data, the second data is written into the second database according to the writing request, and the first data in the second database is deleted.
When the second data is incremental data, the online migration server writes the second data into the second database according to the write request, and performs merging processing on the second data and the first data in the second database.
In the service request processing method, the service request forwarded by the first system is received, the service request is a request initiated by the user terminal in the process of transferring the data in the first database corresponding to the first system to the second database, the flag bit of the first data is acquired from the first database according to the service request, and the first data is the data related to the service request. And correspondingly processing the first data according to the fact that the service request is a read request or a write request and the second data is incremental data or full data when the service request is written, so that the data can be migrated online and the request initiated by the user terminal can be responded in real time in the reconstruction or upgrading process of the system.
Fig. 2-4 are flow diagrams of a service request processing method in one embodiment. It should be understood that, although the steps in the flowcharts of fig. 2-4 are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in fig. 2-4 may include multiple sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor does the order in which the sub-steps or stages are performed necessarily occur in sequence, but may be performed alternately or alternately with at least a portion of the other steps or sub-steps of other steps.
In one embodiment, as shown in fig. 7, there is provided a service request processing apparatus, including: a receiving module 702, an acquiring module 704, an unsynchronized processing module 706, and a synchronized processing module 708.
Wherein,
and the receiving module 702 is configured to receive a service request forwarded by the first system, where the service request is a request initiated by a user terminal in a process of migrating data in a first database corresponding to the first system to a second database.
And the acquiring module 704 is configured to acquire, from the first database, a flag bit of first data according to the service request, where the first data is data related to the service request.
And the unsynchronized processing module 706 is configured to process the first data in the first database according to the service request when the flag bit of the first data is unsynchronized.
And the synchronization processing module 708 is configured to process the first data in the second database according to the service request when the flag bit of the first data is synchronized.
According to the service request processing device, the service request forwarded by the first system is received, the service request is a request initiated by the user terminal in the process of migrating the data in the first database corresponding to the first system to the second database, the flag bit of the first data is acquired from the first database according to the service request, the first data is the data related to the service request, when the flag bit of the first data is not synchronous, the first data in the first database is processed according to the service request, when the flag bit of the first data is synchronous, the first data in the second database is processed according to the service request, so that the data can be migrated online in the reconstruction or upgrading process of the system, and the request initiated by the user terminal can be responded in real time.
In one embodiment, the service request includes a read request; the unsynchronized processing module 706 is further configured to: when the flag bit of the first data is not synchronous, acquiring the first data from the first database; and returning the first data to the user terminal through the first system, thereby completing the processing of the service request of the user terminal.
In one embodiment, the service request includes a write request and second data; the unsynchronized processing module 706 is further configured to: when the flag bit of the first data is not synchronous, determining the association between the first data and the second data in the first database; writing the second data into the first database according to the association between the first data and the second data; writing the second data into the second database according to the write request; the flag bits of the first data and the second data in the first database are modified to be synchronized.
According to the service request processing device, when the flag bit of the first data is not synchronous, the association between the first data and the second data in the first database is determined, the second data is written into the first database according to the association between the first data and the second data, the second data is written into the second database according to the writing request, and the flag bit of the first data and the flag bit of the second data in the first database are modified to be synchronous, so that the second data can be written into the first database and the second database in the state that the first data is not synchronous, a user request is completed in the data migration process, and the data added by a user can be migrated into the second database at the same time, and the data migration efficiency is improved.
In one embodiment, the unsynchronized processing module 706 is further configured to: determining the proportion of the data which is the same as the first data in the second data to the first data; when the ratio is greater than a first ratio threshold, determining that the second data is full data; when the ratio is less than a second ratio threshold, determining that the second data is incremental data; wherein the second proportional threshold is less than the first proportional threshold.
In this embodiment, the proportion of the same data as the first data in the second data to the first data is determined, when the proportion is greater than a first proportion threshold, the second data is determined to be full data, and when the proportion is less than a second proportion threshold, the second data is determined to be incremental data, wherein the second proportion threshold is less than the first proportion threshold, so that the type of the second data can be determined according to the proportion of the same data in the second data and the first data, and corresponding processing can be performed according to the type of the second data.
In one embodiment, the unsynchronized processing module 706 is further configured to: when the second data is full data, writing the second data into the first database and deleting the first data; the flag bit of the second data written in the first database is modified to be synchronized.
In the above embodiment, when the second data is full data, the second data is written into the first database and the first data is deleted, so that the update of the data is realized by overlapping the old data with the full new data. And writing the second data into the second database according to the writing request, so that the migration of the data and the updating of the data can be realized at the same time, and the user response is completed. External service is provided in the data migration process, processing of user service requests is completed, and inconvenience and loss caused by stopping providing service for the system during upgrading or reconstruction are avoided.
In one embodiment, the unsynchronized processing module 706 is further configured to: when the second data is incremental data, writing the second data into the first database; acquiring the first data in the first database; and writing the first data into the second database according to the write request.
In this embodiment, when the flag bit of the first data is not synchronized and the second data is incremental data, the second data is directly written into the first database and combined with the first data to update the first data. The first data in the first database is acquired, and the first data and the second data are written into the second database according to the write request, so that data migration and response processing of service requests initiated by users are realized.
In one embodiment, the service request includes a write request and second data; the synchronization processing module 708 is further configured to: writing the second data into the second database according to the write request; and processing the first data in the second database according to the second data.
In this embodiment, when the flag bit of the first data is synchronized, the second data is written into the second database according to the write request, and the first data in the second database is processed according to the second data, so as to implement data migration and complete response processing of the service request initiated by the user.
In one embodiment, the synchronization processing module 708 is further configured to: when the second data is full data, writing the second data into the second database according to the writing request, and deleting the first data in the second database; and when the second data is incremental data, writing the second data into the second database according to the writing request, and merging the second data with the first data in the second database.
In this embodiment, when the second data is full data, the second data is written into the second database according to the write request, and the first data in the second database is deleted; when the second data is incremental data, the second data is written into the second database according to the writing request, and the second data and the first data in the second database are combined, so that corresponding processing is completed according to the service request of a user in the data migration process, and data migration and user response are realized.
FIG. 8 illustrates an internal block diagram of a computer device in one embodiment. The computer device may be in particular the online migration server 108 of fig. 1. As shown in fig. 8, the computer device includes a processor, a memory, a network interface, an input device, and a display screen connected by a system bus. The memory includes a nonvolatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system, and may also store a computer program that, when executed by a processor, causes the processor to implement a service request processing method. The internal memory may also store a computer program that, when executed by the processor, causes the processor to perform the service request processing method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, the input device of the computer equipment can be a touch layer covered on the display screen, can also be keys, a track ball or a touch pad arranged on the shell of the computer equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the structure shown in fig. 8 is merely a block diagram of some of the structures associated with the present application and is not limiting of the computer device to which the present application may be applied, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, the service request processing apparatus provided in the present application may be implemented in the form of a computer program, which may be executed on a computer device as shown in fig. 8. The memory of the computer device may store various program modules that make up the service request processing apparatus, such as the receiving module 702, the acquiring module 704, the unsynchronized processing module 706, and the synchronized processing module 708 shown in fig. 7. The computer program constituted by the respective program modules causes the processor to execute the steps in the service request processing method of the respective embodiments of the present application described in the present specification.
For example, the computer device shown in fig. 8 may execute, by the receiving module 702 in the service request processing apparatus shown in fig. 7, a step of receiving a service request forwarded by a first system, where the service request is a request initiated by a user terminal in a process of migrating data in a first database corresponding to the first system to a second database. The computer device may perform the step of obtaining, by the obtaining module 704, a flag bit of first data from the first database according to the service request, the first data being data related to the service request. The computer device may perform the step of processing the first data in the first database according to the service request when the flag bit of the first data is unsynchronized through the unsynchronized processing module 706. The computer device may perform the step of processing the first data in the second database according to the service request when the flag bit of the first data is synchronized through the synchronization processing module 708.
In one embodiment, a computer device is provided that includes a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of the service request processing method described above. The steps of the service request processing method herein may be the steps of the service request processing method of each of the above embodiments.
In one embodiment, a computer readable storage medium is provided, storing a computer program which, when executed by a processor, causes the processor to perform the steps of the service request processing method described above. The steps of the service request processing method herein may be the steps of the service request processing method of each of the above embodiments.
Those skilled in the art will appreciate that all or part of the processes in the methods of the above embodiments may be implemented by a computer program for instructing relevant hardware, where the program may be stored in a non-volatile computer readable storage medium, and where the program, when executed, may include processes in the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the various embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples only represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the present application. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application is to be determined by the claims appended hereto.

Claims (14)

1. A service request processing method applied to an online migration server, the method comprising:
in the process of migrating data in a first database corresponding to a first system to a second database corresponding to a second system, controlling the first system, the second system, the first database and the second database by the online migration server;
Receiving a service request forwarded by a system, wherein the service request is a request initiated by a user terminal in the process of migrating data in a first database corresponding to a first system to a second database corresponding to a second system, and comprises a write request and second data; the system is a first system or a second system;
acquiring a flag bit of first data from the first database according to the service request, wherein the first data is data related to the service request;
when the flag bit of the first data is not synchronous, processing the first data in the first database according to the service request;
when the flag bit of the first data is synchronized and the second data is full data, writing the second data into the second database according to the writing request, and deleting the first data in the second database; the second data is full data, and the proportion of the same data representing the second data and the first data to the first data is larger than a first proportion threshold;
when the flag bit of the first data is synchronized and the second data is incremental data, writing the second data into the second database according to the writing request, and combining the second data with the first data in the second database; the second data is incremental data, the proportion is represented to be smaller than a second proportion threshold value, and the second proportion threshold value is smaller than the first proportion threshold value;
And generating a response result based on the processing of the first data, and returning the response result to the system for forwarding the service request.
2. The method of claim 1, wherein the service request further comprises a read request; and when the flag bit of the first data is not synchronous, processing the first data in the first database according to the service request, including:
when the flag bit of the first data is not synchronous, acquiring the first data from the first database;
and returning the first data to the user terminal through the first system.
3. The method of claim 1, wherein processing the first data in the first database according to the service request when the flag bit of the first data is unsynchronized comprises:
when the flag bit of the first data is not synchronous, determining an association between the first data and the second data in the first database;
writing the second data into the first database according to the association between the first data and the second data;
Writing the second data into the second database according to the write request;
and modifying the flag bits of the first data and the second data in the first database to be synchronized.
4. A method according to claim 3, wherein said determining an association between said first data and said second data in said first database comprises:
determining the proportion of the data which is the same as the first data in the second data to the first data;
when the ratio is greater than a first ratio threshold, determining that the second data is full data;
when the ratio is smaller than a second ratio threshold, determining that the second data is incremental data;
wherein the second proportional threshold is less than the first proportional threshold.
5. The method of claim 4, wherein the writing the second data to the first database according to the association between the first data and the second data comprises:
when the second data is full data, writing the second data into the first database and deleting the first data;
the modifying the flag bit of the first data and the second data in the first database to be synchronized includes:
And modifying the flag bit of the second data written in the first database to be synchronized.
6. The method of claim 4, wherein the writing the second data to the first database according to the association between the first data and the second data comprises:
when the second data is incremental data, writing the second data into the first database;
the method further comprises the steps of:
acquiring the first data in the first database;
and writing the first data into the second database according to the write request.
7. A service request processing apparatus, the apparatus comprising:
the online migration server is used for controlling the first system, the second system, the first database and the second database in the process of migrating data in the first database corresponding to the first system to the second database corresponding to the second system;
the system comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving a service request forwarded by a system, the service request is a request initiated by a user terminal in the process of migrating data in a first database corresponding to a first system to a second database corresponding to a second system, and the service request comprises a write request and second data; the system is a first system or a second system;
The acquisition module is used for acquiring a flag bit of first data from the first database according to the service request, wherein the first data is data related to the service request;
the unsynchronized processing module is used for processing the first data in the first database according to the service request when the flag bit of the first data is unsynchronized;
the synchronous processing module is used for writing the second data into the second database according to the write request and deleting the first data in the second database when the flag bit of the first data is synchronous and the second data is full data; the second data is full data, and the proportion of the same data representing the second data and the first data to the first data is larger than a first proportion threshold; when the flag bit of the first data is synchronized and the second data is incremental data, writing the second data into the second database according to the writing request, and combining the second data with the first data in the second database; the second data is incremental data, the proportion is represented to be smaller than a second proportion threshold value, and the second proportion threshold value is smaller than the first proportion threshold value;
And the module is used for generating a response result based on the processing of the first data and returning the response result to the system for forwarding the service request.
8. The apparatus of claim 7, wherein the service request further comprises a read request; the unsynchronized processing module is further configured to acquire the first data from the first database when the flag bit of the first data is unsynchronized; and returning the first data to the user terminal through the first system.
9. The apparatus of claim 7, wherein the unsynchronized processing module is further configured to determine an association between the first data and the second data in the first database when a flag bit of the first data is unsynchronized; writing the second data into the first database according to the association between the first data and the second data; writing the second data into the second database according to the write request; and modifying the flag bits of the first data and the second data in the first database to be synchronized.
10. The apparatus of claim 9, wherein the unsynchronized processing module is further configured to determine a proportion of the second data to the first data that is the same as the first data; when the ratio is greater than a first ratio threshold, determining that the second data is full data; when the ratio is smaller than a second ratio threshold, determining that the second data is incremental data; wherein the second proportional threshold is less than the first proportional threshold.
11. The apparatus of claim 10, wherein the unsynchronized processing module is further configured to write the second data to the first database and delete the first data when the second data is a full amount of data; and modifying the flag bit of the second data written in the first database to be synchronized.
12. The apparatus of claim 10, wherein the unsynchronized process module is further configured to write the second data to the first database when the second data is incremental data; acquiring the first data in the first database; and writing the first data into the second database according to the write request.
13. A computer readable storage medium storing a computer program which, when executed by a processor, causes the processor to perform the steps of the method of any one of claims 1 to 6.
14. A computer device comprising a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of the method of any of claims 1 to 6.
CN201911316795.6A 2019-12-19 2019-12-19 Service request processing method, device, readable storage medium and computer equipment Active CN111090701B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911316795.6A CN111090701B (en) 2019-12-19 2019-12-19 Service request processing method, device, readable storage medium and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911316795.6A CN111090701B (en) 2019-12-19 2019-12-19 Service request processing method, device, readable storage medium and computer equipment

Publications (2)

Publication Number Publication Date
CN111090701A CN111090701A (en) 2020-05-01
CN111090701B true CN111090701B (en) 2024-04-02

Family

ID=70395960

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911316795.6A Active CN111090701B (en) 2019-12-19 2019-12-19 Service request processing method, device, readable storage medium and computer equipment

Country Status (1)

Country Link
CN (1) CN111090701B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112434050B (en) * 2020-10-16 2022-12-09 广东电力信息科技有限公司 Data synchronization method and device of power grid business processing system and business processing system
CN112348465A (en) * 2020-11-04 2021-02-09 云镝智慧科技有限公司 Business data write-back method and device, computer equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106294387A (en) * 2015-05-19 2017-01-04 深圳市腾讯计算机系统有限公司 Data migration method and device
CN109977127A (en) * 2019-02-28 2019-07-05 北京创鑫旅程网络技术有限公司 Data-updating method and device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106294387A (en) * 2015-05-19 2017-01-04 深圳市腾讯计算机系统有限公司 Data migration method and device
CN109977127A (en) * 2019-02-28 2019-07-05 北京创鑫旅程网络技术有限公司 Data-updating method and device

Also Published As

Publication number Publication date
CN111090701A (en) 2020-05-01

Similar Documents

Publication Publication Date Title
CN110209650B (en) Data normalization and migration method and device, computer equipment and storage medium
CN102667772B (en) File level hierarchical storage management system, method, and apparatus
US8874515B2 (en) Low level object version tracking using non-volatile memory write generations
US20100088270A1 (en) Data versioning concept including time dependency and active and inactive states
EP3025255A1 (en) Virtual synchronization with on-demand data delivery
CN110781214A (en) Database reading and writing method and device, computer equipment and storage medium
US20110093437A1 (en) Method and system for generating a space-efficient snapshot or snapclone of logical disks
CN111090701B (en) Service request processing method, device, readable storage medium and computer equipment
JP4755244B2 (en) Information generation method, information generation program, and information generation apparatus
CN111241791A (en) Editing method and device of webpage text, computer equipment and storage medium
CN112306993A (en) Data reading method, device and equipment based on Redis and readable storage medium
CN110837441A (en) KVM virtual machine backup method based on dirty data bitmap and network block equipment
CN109298873B (en) System upgrading method and device
CN115344284A (en) Automatic driving software upgrading method and device, storage medium and computer equipment
CN115221156A (en) Database cluster capacity expansion method and device, computer equipment and storage medium
CN111309799A (en) Method, device and system for realizing data merging and storage medium
CN110119388B (en) File reading and writing method, device, system, equipment and computer readable storage medium
CN113312205A (en) Data verification method and device, storage medium and computer equipment
CN113590643B (en) Data synchronization method, device, equipment and storage medium based on dual-track database
CN113377458B (en) Plug-in management method and device, electronic equipment and storage medium
CN114138734A (en) Web-based version management method facing database and file resource
WO2022068220A1 (en) Data processing method and apparatus, computer device, and storage medium
CN114756293A (en) Service processing method, device, computer equipment and storage medium
CN110837442B (en) KVM virtual machine backup system based on dirty data bitmap and network block equipment
CN111931010B (en) Dynamic binding method, device, equipment and storage medium for anchor point and line

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