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

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

Info

Publication number
CN111090701A
CN111090701A CN201911316795.6A CN201911316795A CN111090701A CN 111090701 A CN111090701 A CN 111090701A CN 201911316795 A CN201911316795 A CN 201911316795A CN 111090701 A CN111090701 A CN 111090701A
Authority
CN
China
Prior art keywords
data
database
service request
request
processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201911316795.6A
Other languages
Chinese (zh)
Other versions
CN111090701B (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

Images

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application relates to a service request processing method, a service request processing 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 zone 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 zone bit of the first data is not synchronous, processing the first data in the first database according to the service request; and when the zone 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 services in the data migration process and complete the processing of the user service request.

Description

Service request processing method and device, readable storage medium and computer equipment
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for processing a service request, a computer-readable storage medium, and a computer device.
Background
For services operated on line, when a system architecture is reconstructed or services are upgraded, migration of service data is often accompanied. For example, in the field of gaming, data migration is generally performed by a method of stopping a game. The traditional method is usually to make notice of shutdown maintenance in advance, then stop the external service of the old system, then migrate the user data from the old database to the new database, and finally start the external service of the new system.
However, for service platforms with large data volume, such as application stores, e-commerce platforms, etc., the reconstruction or upgrade time is long, during which the external service is stopped, so that the platform cannot respond 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 cannot respond to the user request due to reconfiguration or upgrade.
A service request processing 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 zone 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 zone bit of the first data is not synchronous, processing the first data in the first database according to the service request;
and when the zone 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:
a receiving module, configured to receive 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;
an obtaining module, configured to obtain a flag bit of first data from the first database according to the service request, where the first data is data related to the service request;
an unsynchronized processing module, configured to, when the flag bit of the first data is unsynchronized, process the first data in the first database according to the service request;
and the synchronous processing module is used for processing the first data in the second database according to the service request when the zone 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 zone 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 zone bit of the first data is not synchronous, processing the first data in the first database according to the service request;
and when the zone 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 that, 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 zone 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 zone bit of the first data is not synchronous, processing the first data in the first database according to the service request;
and when the zone bit of the first data is synchronized, processing the first data in the second database according to the service request.
The service request processing method, the service request processing device, the computer readable storage medium and the computer device receive a service request forwarded by a first system, 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, a flag bit of first data is obtained 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 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, and therefore the service request of the user can be received and correspondingly processed in the data migration process of the system. Thereby completing the user response while the system is reconfigured or upgraded.
Drawings
FIG. 1 is a diagram of an application environment of a method for processing service requests in one embodiment;
FIG. 2 is a flow diagram illustrating a method for processing a service request according to an embodiment;
FIG. 3 is a flowchart illustrating steps of processing first data in a first database according to a service request when a flag of the first data is not synchronized according to an embodiment;
FIG. 4 is a flowchart illustrating the steps of determining an association between first data and second data in a first database in one embodiment;
FIG. 5 is a flow diagram that illustrates processing of a service request when first data is not synchronized, according to an embodiment;
FIG. 6 is a flow diagram that illustrates processing of a service request when first data is synchronized, according to one embodiment;
fig. 7 is a block diagram showing the construction of 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 is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
Fig. 1 is an application environment diagram of a service request processing method in an 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 is connected to the first system 104 and the second system 106 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 comprised of multiple servers.
In this embodiment, the online migration server 108 migrates data in a first database corresponding to the first system to a 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. the first data. Next, the online migration server 108 obtains a flag bit of the first data, the flag bit including a synchronized status and an unsynchronized status. 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 via 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 via the first system 104.
Further, when the service request includes a write request and second data, 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 not synchronized, the second data is written to the first database 110. And merges the first data in the first database 110 with the written second data. Then, 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. Then, 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 into 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 that when the user terminal 102 initiates a service request to the first system 104, and is not described herein again. It is understood that the first system 104 and the second system 106 are oriented to the user terminal 102, and the service request initiated by the user terminal 102 to the first system 104 is returned by the first system 104 to the user terminal 102. The service request initiated by the user terminal 102 to the second system 106 is returned by the second system 106 to the user terminal 102.
As shown in fig. 2, in one embodiment, a service request processing method is provided. The embodiment is mainly illustrated by applying 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, receiving a service request forwarded by the first system, where the service request is a request initiated by the user terminal in a process of migrating data in the first database corresponding to the first system to the 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. Write requests refer to requests that change the original data, write data, add, delete, modify data, and so forth. 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 into 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 a flag bit of first data from the first database according to the service request, where the first data is data related to the service request.
The identification bit is a mark field corresponding to the 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 parses the service request, and determines data related to the service request in the first database, that is, the first data. Then, the online migration server queries the first data in the first database and obtains the zone bit of the first data.
Step 206, when the flag bit of the first data is not synchronized, the first data in the first database is processed according to the service request.
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 the flag bit of the first data is unsynchronized or synchronized, and processes the first data in the first database if the flag bit of the first data is unsynchronized. And processing the first data in the second database after synchronization. And further, processing the first data according to a specific instruction in the service request. For example, if the service request is read data, the first data is read from the first database, and 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.
The service request processing method includes receiving a service request forwarded by a first system, the service request being 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, obtaining 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, and determining whether the data has been migrated or not by judging the flag bit of the data. When the zone 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 zone 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 reconfiguration or upgrade process of the system, and external services can be provided in the data migration process, 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 synchronized, 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.
Specifically, the online migration server analyzes the service request to obtain a specific operation instruction. And when the service request comprises a reading request, determining that the user terminal needs to inquire or read data. The online migration server determines the flag bit of the first data in the first database, and acquires the first data from the first database when the flag bit of the first data is not synchronized. 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, including: when the flag bit of the first data is synchronized, acquiring the first data from the second database; and returning the first data to the user terminal through the first system.
Specifically, for the synchronized data, reading and querying and the like are performed from the second database. And the first data is returned to the user terminal through the first system 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 synchronized, processing the first data in the first database according to the service request, including:
step 302, when the flag bit of the first data is not synchronized, determining the association between the first data and the second data in the first database.
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 same data exists.
Specifically, when the online migration server parses the service request to obtain the write request and the second data, it is determined that the second data needs to be written into the first database. The online migration server obtains the flag bit of the first data related to the service request, and when the flag bit of the first data is not synchronized, the online migration server identifies that the first data has not been migrated to the second database. The online migration server determines that an association 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 association between the first data and the second data according to the write request. Next, the first data and the second data in the first database are merged 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 to a second database. That is, 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 to the second database based on the 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 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 bits of the first data and 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 when the first data is not synchronous, the user request is completed in the data migration process, the newly-added data of the 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 a service request, the service request may be parsed, and when the service request includes a write request and second data, the second data is further determined to be incremental data or full data. Specifically, the second data carries a corresponding data identifier, where the data identifier is used to identify that the second data is 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 identification 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 comprises:
step 402, determining the proportion of the second data which is the same as the first data in the first data.
Specifically, the online migration server searches the first database for data related to the service request, i.e., the first data. And comparing the first data with the second data in the service request to determine the same data in the first data and the second data. The online migration server may then determine a proportion of the same data to the first data, or alternatively, determine a proportion of the same data to the second data.
And step 404, when the ratio is larger than the first ratio threshold, determining that the second data is full data.
Step 406, when the ratio is smaller than a second ratio threshold, determining that the second data is incremental data; wherein the second ratio threshold is smaller than the first ratio 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 is a preset critical value for judging whether the second data is incremental data. The second proportional threshold is less than the first proportional threshold. Incremental data refers to new data that is not identical to the original data, and full data refers to data that includes all of 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, it indicates that the specific gravity of the first data in the second data is very large, and it can be determined that the second data is full 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, indicating that the specific gravity of the first data in the second data is very small, it may be determined that the second data is 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 proportion is larger than or equal to a second proportion threshold value, taking the second data as the full-scale data.
In this embodiment, a ratio of data, which is the same as the first data, in the second data to the first data is determined, when the ratio is greater than a first ratio threshold, the second data is determined to be full data, and when the ratio is smaller than a second ratio threshold, the second data is determined to be incremental data, where the second ratio threshold is smaller than the first ratio threshold, so that a type of the second data can be determined by a specific gravity of the same data in the second data and the first data, and corresponding processing is performed on 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 bits of the first data and the second data in the first database to be synchronized comprises: and modifying the flag bit of the second data written into the first database into synchronization.
Specifically, when the online migration server detects that the second data is the full amount of data, it indicates that all the data of the first data is included in the second data and that there is new data that is not included in the first data. The online migration server writes the second data to the first database according to 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 write request so as to realize the migration and the update 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 in the first database into synchronization.
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 old data is overwritten by the full amount of new data, and the data is updated. And writing the second data into the second database according to the write request, thereby realizing the data migration and the data update at the same time and completing the user response. And external service is provided in the data migration process, the processing of the user service request is completed, and the inconvenience and loss caused by stopping the service provision of 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 following steps: acquiring the first data in the first database; and writing the first data into the second database according to the writing request.
Specifically, when the online migration server detects that the second data is incremental data, it indicates that only data that is not included in the first data is included in the second data. The online migration server writes the second data to the first database in accordance with the write request. Further, the online migration server combines the second data written into the first database with the first data.
When the flag bit of the first data is not synchronized, it indicates that 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 merging the first data and the second data written in the second database to realize the updating of the first data.
And then, after receiving the information of successful writing returned by the second database, the online migration server modifies the flag bit of the data obtained after the merging processing of the first data and the second data in the first database into synchronization.
In this embodiment, when the flag bit of the first data is unsynchronized and the second data is incremental data, the second data is directly written into the first database and merged with the first data to update the first data. And acquiring the first data in the first database, and writing the first data and the second data into the second database according to the write request, thereby realizing data migration and completing response processing of a service request initiated by a user.
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 includes a write request and second data, the flag bit of first data related to the service data in the first database is further determined. When the flag bit of the first data is synchronized, it indicates that the first data has been migrated to the second database. The online migration server may write the second data into the second database directly according to the write request and determine the type of the second data, that is, the second data is full data or incremental data. And determining first data in the second database, and performing corresponding processing on 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 second database is read and written. And processing the first data in the second database according to the second data, thereby realizing data migration and completing response processing of a service request initiated by a user.
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 write 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 write 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 indicates that the second data includes all the data of the first data and that there is new data that is not included in the first data. And writing the second data into the position of the first data in the second database according to the writing request, and overwriting the first data.
When the second data is incremental data, it indicates that the second data includes only data that is not included 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 according to a difference between the second data and the first data to achieve updating of the first data. Further, the merging process may be to modify, replace, add and the like the corresponding partial data in the first data according to the second data, so that the merged data can realize the corresponding function.
In this embodiment, when the second data is full data, writing the second data into the second database according to the write 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 write request, and merging the second data with the first data in the second database, so that corresponding processing is completed according to a service request of a user in the data migration process, and data migration and user response are realized simultaneously.
Fig. 5 shows a service request processing flow when the first data is not synchronized in one embodiment.
As shown in fig. 5, when data in a first database corresponding to a first system is migrated into a second database, an online migration server takes over read-write operations of the first system, the second system, the first database, and the second database. 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. And the online migration server receives the service request, analyzes the service request and determines data related to the service request in the first database, namely the 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 zone 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 not synchronized, the data is read from the first database. In response to the write request, the online migration server needs to synchronously copy the first data and the second data to the second database, so as to write the first data and the second data into the second database, and receive a write result returned by the first database. And after the successful writing, the online migration server modifies the synchronization mark of the first data in the first database, namely, the zone 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 reconstructed or upgraded is avoided.
Fig. 6 shows a service request processing flow when the first data is synchronized in one embodiment.
In the process of migrating data in a first database corresponding to a first system 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. 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. And the online migration server receives the service request, analyzes the service request and determines data related to the service request in the first database, namely the 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 zone bit of the first data and the service request, and receiving a result returned by the first database. And when the flag bit of the first data is synchronized, reading and writing the data from the second database.
And corresponding to the write request, directly writing the second data into the second database, and returning a write result. And 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 reconstructed or upgraded is avoided.
It is to be 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 are both oriented to the user terminal, and the system returns the processing result of the service request to the user terminal when the user terminal initiates the service request to which system.
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 zone 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 zone bit of the first data is not synchronous, the online migration server acquires the first data from the first database; and returning the first data to the user terminal through the first system.
When the service request comprises a read request and the zone bit of the first data is not synchronous, the online migration server determines the proportion of data which is the same as the first data in the second data in the first data; when the ratio is larger than a first ratio threshold, determining that the second data is full data; when the ratio is smaller than a second ratio threshold value, determining that the second data is incremental data; wherein the second ratio threshold is smaller than the first ratio 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; and modifying the flag bit of the second data written into the first database into synchronization.
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; and modifying the flag bits of the first data and the second data in the first database into synchronization.
When the service request comprises a write 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 write request; and when the second data is full data, writing the second data into the second database according to the write request, and deleting the first data in the second database.
And 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 merges the second data and the first data in the second database.
In the service request processing method, a service request forwarded by a first system is received, 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 a flag bit of first data is acquired from the first database according to the service request, wherein the first data is 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 in the write request is incremental data or full data, so that the data can be migrated on line and the request initiated by the user terminal can be responded possibly in real time in the reconfiguration or upgrade process of the system.
Fig. 2-4 are schematic flow diagrams of a service request processing method in an embodiment. It should be understood that although the various steps in the flowcharts of fig. 2-4 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-4 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternating with other steps or at least some of the sub-steps or stages 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 obtaining module 704, an unsynchronized processing module 706, and a synchronized processing module 708.
Wherein the content of the first and second substances,
a receiving module 702, configured to receive 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.
An obtaining module 704, configured to obtain the flag bit of the first data from the first database according to the service request, where the first data is data related to the service request.
An unsynchronized processing module 706, configured to, when the flag bit of the first data is unsynchronized, process the first data in the first database according to the service request.
A synchronization processing module 708, 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.
The service request processing device 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, a flag bit of first data is obtained 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 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 migrated online in the process of reconstructing or upgrading the system, and the request initiated by the user terminal can be responded possibly 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; and modifying the flag bits of the first data and the second data in the first database into synchronization.
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 bits of the first data and 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 when the first data is not synchronous, the user request is completed in the data migration process, the newly-added data of the 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 second data which is the same as the first data in the first data; when the ratio is larger than a first ratio threshold, determining that the second data is full data; when the ratio is smaller than a second ratio threshold value, determining that the second data is incremental data; wherein the second ratio threshold is smaller than the first ratio threshold.
In this embodiment, a ratio of data, which is the same as the first data, in the second data to the first data is determined, when the ratio is greater than a first ratio threshold, the second data is determined to be full data, and when the ratio is smaller than a second ratio threshold, the second data is determined to be incremental data, where the second ratio threshold is smaller than the first ratio threshold, so that a type of the second data can be determined by a specific gravity of the same data in the second data and the first data, and corresponding processing is performed on 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; and modifying the flag bit of the second data written into the first database into synchronization.
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 old data is overwritten by the full amount of new data, and the data is updated. And writing the second data into the second database according to the write request, thereby realizing the data migration and the data update at the same time and completing the user response. And external service is provided in the data migration process, the processing of the user service request is completed, and the inconvenience and loss caused by stopping the service provision of 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 writing request.
In this embodiment, when the flag bit of the first data is unsynchronized and the second data is incremental data, the second data is directly written into the first database and merged with the first data to update the first data. And acquiring the first data in the first database, and writing the first data and the second data into the second database according to the write request, thereby realizing data migration and completing response processing of a service request initiated by a user.
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 that data migration and response processing of a service request initiated by a user are realized.
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 write 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 write request, and merging the second data with the first data in the second database.
In this embodiment, when the second data is full data, writing the second data into the second database according to the write 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 write request, and merging the second data with the first data in the second database, so that corresponding processing is completed according to a service request of a user in the data migration process, and data migration and user response are realized simultaneously.
FIG. 8 is a diagram illustrating an internal structure of a computer device in one embodiment. The computer device may specifically be online migration server 108 in fig. 1. As shown in fig. 8, the computer apparatus includes a processor, a memory, a network interface, an input device, and a display screen connected through a system bus. Wherein the memory includes a non-volatile 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 the processor, causes the processor to implement the service request processing method. The internal memory may also have stored therein a computer program that, when executed by the processor, causes the processor to perform a method of service request processing. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 8 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those 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 a form of a computer program, and the computer program may be run on a computer device as shown in fig. 8. The memory of the computer device may store various program modules constituting the service request processing apparatus, such as the receiving module 702, the obtaining 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 embodiments of the present application described in the present specification.
For example, the computer device shown in fig. 8 may perform, through 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 execute the step of obtaining the flag bit of the first data from the first database according to the service request through the obtaining module 704, where the first data is data related to the service request. The computer device can execute 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 not synchronized through the unsynchronized processing module 706. The computer device can execute 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, 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 the above-mentioned service request processing method. Here, the steps of the service request processing method may be steps in the service request processing methods of the above embodiments.
In one embodiment, a computer-readable storage medium is provided, which stores a computer program that, when executed by a processor, causes the processor to perform the steps of the above-mentioned service request processing method. Here, the steps of the service request processing method may be steps in the service request processing methods of the above embodiments.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a non-volatile computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the program is executed. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile 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), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (11)

1. A service request processing 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 zone 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 zone bit of the first data is not synchronous, processing the first data in the first database according to the service request;
and when the zone bit of the first data is synchronized, processing the first data in the second database according to the service request.
2. The method of claim 1, wherein the service request comprises a read request; when the flag bit of the first data is not synchronized, 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 according to claim 1 or 2, wherein the service request comprises a write request and second data; when the flag bit of the first data is not synchronized, processing the first data in the first database according to the service request, including:
determining 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 to 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;
modifying the flag bits of the first data and the second data in the first database to be synchronized.
4. The method of claim 3, wherein the determining the association between the first data and the second data in the first database comprises:
determining the proportion of the second data which is the same as the first data in the first data;
when the proportion is larger than a first proportion threshold value, determining that the second data is full data;
when the proportion is smaller than a second proportion threshold value, determining that the second data are incremental data;
wherein the second ratio threshold is less than the first ratio threshold.
5. The method of claim 4, wherein 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 bits of the first data and the second data in the first database to be synchronized comprises:
modifying the flag bit of the second data written in the first database to be synchronized.
6. The method of claim 4, wherein 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 following steps:
acquiring the first data in the first database;
and writing the first data into the second database according to the writing request.
7. The method according to claim 1 or 2, wherein the service request comprises 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.
8. The method of claim 7, wherein the processing the first data in the second database according to the second data comprises:
when the second data is full data, writing the second data into the second database according to the write 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 write request, and merging the second data with the first data in the second database.
9. A service request processing apparatus, characterized in that the apparatus comprises:
a receiving module, configured to receive 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;
an obtaining module, configured to obtain a flag bit of first data from the first database according to the service request, where the first data is data related to the service request;
an unsynchronized processing module, configured to, when the flag bit of the first data is unsynchronized, process the first data in the first database according to the service request;
and the synchronous processing module is used for processing the first data in the second database according to the service request when the zone bit of the first data is synchronous.
10. A computer-readable storage medium, storing a computer program which, when executed by a processor, causes the processor to carry out the steps of the method according to any one of claims 1 to 8.
11. 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 according to any one of claims 1 to 8.
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 true CN111090701A (en) 2020-05-01
CN111090701B 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)

Cited By (2)

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

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

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112434050A (en) * 2020-10-16 2021-03-02 广东电力信息科技有限公司 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

Also Published As

Publication number Publication date
CN111090701B (en) 2024-04-02

Similar Documents

Publication Publication Date Title
CN110008118B (en) Page data testing method and device, computer equipment and storage medium
CN110209650B (en) Data normalization and migration method and device, computer equipment and storage medium
US20110093437A1 (en) Method and system for generating a space-efficient snapshot or snapclone of logical disks
CN110781214A (en) Database reading and writing method and device, computer equipment and storage medium
CN108829485A (en) Update method, device, storage medium and the computer equipment of application interface layout
CN106789249B (en) Hot updating method, client and server
WO2020155771A1 (en) Spreadsheet data processing method and apparatus, computer device, and storage medium
CN111090701B (en) Service request processing method, device, readable storage medium and computer equipment
CN112306993A (en) Data reading method, device and equipment based on Redis and readable storage medium
CN107577775B (en) Data reading method and device, electronic equipment and readable storage medium
CN115344284A (en) Automatic driving software upgrading method and device, storage medium and computer equipment
CN113312205B (en) Data verification method and device, storage medium and computer equipment
CN115221156A (en) Database cluster capacity expansion method and device, computer equipment and storage medium
CN110119388B (en) File reading and writing method, device, system, equipment and computer readable storage medium
CN111966701A (en) Metadata updating method, device, equipment and storage medium
CN115344428A (en) Data processing method, data processing apparatus, computer device, storage medium, and program product
CN115687350A (en) Index construction method and device, computer equipment and storage medium
CN114756293A (en) Service processing method, device, computer equipment and storage medium
CN114138734A (en) Web-based version management method facing database and file resource
CN114064674A (en) Data synchronization method, device, computer equipment, storage medium and product
CN111931010B (en) Dynamic binding method, device, equipment and storage medium for anchor point and line
CN114675776A (en) Resource storage method and device, storage medium and electronic equipment
CN112835886A (en) Data table field adding method and device
CN115617580B (en) Incremental backup and recovery method and system based on Shared SST (SST) file
CN110162507B (en) Snapshot overwriting method, device, computer equipment and storage medium

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