CN114218191A - System function migration method and device, computer equipment and storage medium - Google Patents

System function migration method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN114218191A
CN114218191A CN202111539887.8A CN202111539887A CN114218191A CN 114218191 A CN114218191 A CN 114218191A CN 202111539887 A CN202111539887 A CN 202111539887A CN 114218191 A CN114218191 A CN 114218191A
Authority
CN
China
Prior art keywords
data
test point
database
old
new
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.)
Pending
Application number
CN202111539887.8A
Other languages
Chinese (zh)
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.)
Ping An Life Insurance Company of China Ltd
Original Assignee
Ping An Life Insurance Company of China 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 Ping An Life Insurance Company of China Ltd filed Critical Ping An Life Insurance Company of China Ltd
Priority to CN202111539887.8A priority Critical patent/CN114218191A/en
Publication of CN114218191A publication Critical patent/CN114218191A/en
Pending legal-status Critical Current

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/21Design, administration or maintenance of databases
    • G06F16/214Database migration support
    • 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/25Integrating or interfacing systems involving database management systems
    • G06F16/254Extract, transform and load [ETL] procedures, e.g. ETL data flows in data warehouses
    • 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

Abstract

The embodiment of the application belongs to the technical field of cloud, and relates to a system function migration method, which comprises the steps of initializing database table data of a new database to obtain initialized data; acquiring test point function data corresponding to the test point request, writing the test point function data into an old database to obtain old function data, and writing the test point function data into a new database to obtain new function data; determining whether the target migration system has abnormal functions according to the old functional data and the new functional data; when the function is abnormal, stopping writing, emptying all data in the new database to obtain an initial database, and rewriting the test point function data; and when the rewriting is successful, determining that the initial database passes the verification, and reading all target function data corresponding to the old database based on the initial database passing the verification. The application also provides a system function migration device, computer equipment and a storage medium. The target function data may be stored in a block chain. The method and the device improve the accuracy of system function migration.

Description

System function migration method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of cloud technologies, and in particular, to a method and an apparatus for migrating system functions, a computer device, and a storage medium.
Background
With the rapid development of information networks, more and more service data need to be processed, and the amount of data to be processed is larger and larger. Currently, when a new system function is migrated through a service system and a database is migrated at the same time, how to ensure function test point in view of such a scenario is not provided, and data in the test point process is not lost and rolled back. Even if the strategy of gray scale distribution is adopted, there is a risk that part of data is lost when an abnormality occurs.
Disclosure of Invention
An embodiment of the present application provides a method and an apparatus for migrating system functions, a computer device, and a storage medium, so as to solve the technical problem of data migration loss.
In order to solve the above technical problem, an embodiment of the present application provides a system function migration method, which adopts the following technical solutions:
when an initialization request is received, acquiring new database table data of a target migration system, and initializing the new database table data to obtain initialization data;
when a test point request is received, test point function data corresponding to the test point request are obtained, the test point function data are written into an old database based on an old data interface to obtain old function data, and the test point function data are written into a new database based on a new data interface and the initialization data to obtain new function data;
determining whether the target migration system has abnormal functions according to the old functional data and the new functional data;
when the target migration system has functional abnormality, stopping writing the data of the test point functional data in the old database and the new database, emptying all the data in the new database to obtain an initial database, and rewriting the test point functional data based on the initial database and the old database;
and when the pilot point functional data is successfully written into the initial database again, determining that the initial database passes verification, and reading all target functional data corresponding to the old database based on the verified initial database.
Further, the step of obtaining the test point function data corresponding to the test point request includes:
forwarding the initialization request to an old system, and acquiring and returning a URL mapping set to a client from the old system based on the initialization request;
and when the client side is determined to receive the test point request, obtaining the test point function data from the URL mapping set according to the test point request.
Further, the step of retrieving and returning a URL mapping set from the old system to a client based on the initialization request comprises:
analyzing the test point request to obtain test point functional parameters, and acquiring URL addresses corresponding to the test point functional parameters from the URL mapping set;
and reading the test point function data based on the URL address.
Further, the step of writing the test point functional data in a new database based on the new data interface and the initialization data to obtain new functional data includes:
determining whether the test point request is a write request, and when the test point request is the write request, copying the write request and forwarding the write request to a new data interface of the target migration system;
and synchronously writing the test point function data in the new database and the old database based on the new data interface and the initialization data.
Further, the step of determining whether the test point request is a write request includes:
acquiring an identifier of the test point request, and determining the test point request as a write request when the identifier is the write identifier;
and when the identifier is a read identifier, determining that the test point request is a read request.
Further, the step of determining whether the target migration system has a functional abnormality according to the old functional data and the new functional data includes:
acquiring target trial writing time corresponding to the old functional data or the new functional data, and acquiring a trial point log generated based on the old functional data and the new functional data when the target trial writing time is greater than or equal to a preset time threshold;
and determining whether the target migration system has abnormal functions according to the test point log.
Further, the step of reading all target function data corresponding to the old database based on the verified initial database includes:
selecting a preset number of target clients as sub-clients from the target number of target clients corresponding to the old database, and reading target function data of the sub-clients based on the verified initial database;
and when the sub-clients finish reading, acquiring the rest clients in the preset target clients, and reading the target function data of the rest clients based on the initial database passing the verification.
In order to solve the above technical problem, an embodiment of the present application further provides a system function migration apparatus, which adopts the following technical solutions:
the acquisition module is used for acquiring new database table data of the target migration system when an initialization request is received, and initializing the new database table data to obtain initialization data;
the device comprises a first writing-in module, a second writing-in module and a third writing-in module, wherein the first writing-in module is used for acquiring test point function data corresponding to a test point request when the test point request is received, writing the test point function data into an old database based on an old data interface to obtain the old function data, and writing the test point function data into a new database based on a new data interface and the initialization data to obtain new function data;
the confirming module is used for determining whether the target migration system has abnormal functions according to the old functional data and the new functional data;
a second writing module, configured to stop, when there is a functional abnormality in the target migration system, data writing of the test point functional data in the old database and the new database, clear all data in the new database to obtain an initial database, and rewrite the test point functional data based on the initial database and the old database;
and the reading module is used for determining that the initial database passes verification when the test point function data is successfully written into the initial database again, and reading all target function data corresponding to the old database based on the verified initial database.
In order to solve the above technical problem, an embodiment of the present application further provides a computer device, which adopts the following technical solutions:
when an initialization request is received, acquiring new database table data of a target migration system, and initializing the new database table data to obtain initialization data;
when a test point request is received, test point function data corresponding to the test point request are obtained, the test point function data are written into an old database based on an old data interface to obtain old function data, and the test point function data are written into a new database based on a new data interface and the initialization data to obtain new function data;
determining whether the target migration system has abnormal functions according to the old functional data and the new functional data;
when the target migration system has functional abnormality, stopping writing the data of the test point functional data in the old database and the new database, emptying all the data in the new database to obtain an initial database, and rewriting the test point functional data based on the initial database and the old database;
and when the pilot point functional data is successfully written into the initial database again, determining that the initial database passes verification, and reading all target functional data corresponding to the old database based on the verified initial database.
In order to solve the above technical problem, an embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solutions:
when an initialization request is received, acquiring new database table data of a target migration system, and initializing the new database table data to obtain initialization data;
when a test point request is received, test point function data corresponding to the test point request are obtained, the test point function data are written into an old database based on an old data interface to obtain old function data, and the test point function data are written into a new database based on a new data interface and the initialization data to obtain new function data;
determining whether the target migration system has abnormal functions according to the old functional data and the new functional data;
when the target migration system has functional abnormality, stopping writing the data of the test point functional data in the old database and the new database, emptying all the data in the new database to obtain an initial database, and rewriting the test point functional data based on the initial database and the old database;
and when the pilot point functional data is successfully written into the initial database again, determining that the initial database passes verification, and reading all target functional data corresponding to the old database based on the verified initial database.
According to the system function migration method, when an initialization request is received, new database table data of a target migration system are obtained, the new database table data are initialized, and initialization data are obtained, so that the new database table data and the old database table data are completely consistent; then, when a test point request is received, test point function data corresponding to the test point request is obtained, the test point function data is written into the old database based on the old data interface to obtain the old function data, the test point function data is written into the new database based on the new data interface and the initialization data to obtain the new function data, and the data are written into the new database and the old database simultaneously, so that efficient test point of the new database is realized, and the migration efficiency of the function data is further improved; then, determining whether the target migration system has abnormal functions according to the old functional data and the new functional data; when the target migration system has function abnormality, stopping writing the data of the test point function data in the old database and the new database, emptying all the data in the new database to obtain an initial database, and rewriting the test point function data based on the initial database and the old database, thereby reducing the workload of development and avoiding the waste of resources; when the test point functional data is successfully written into the initial database again, the verification of the initial database is determined to be passed, all target functional data corresponding to the old database are read based on the verified initial database, finally, the stability and reliability of the system during function migration are ensured, the data loss of the old database during migration is prevented, and the efficiency and accuracy of the system function migration are further improved.
Drawings
In order to more clearly illustrate the solution of the present application, the drawings needed for describing the embodiments of the present application will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and that other drawings can be obtained by those skilled in the art without inventive effort.
FIG. 1 is an exemplary system architecture diagram in which the present application may be applied;
FIG. 2 is a flow diagram of one embodiment of a system function migration method according to the present application;
FIG. 3 is a schematic block diagram illustrating one embodiment of a system function migration apparatus according to the present application;
FIG. 4 is a schematic block diagram of one embodiment of a computer device according to the present application.
Reference numerals: the system function migration apparatus 300, an obtaining module 301, a first writing module 302, a confirming module 303, a second writing module 304, and a reading module 305.
Detailed Description
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "including" and "having," and any variations thereof, in the description and claims of this application and the description of the above figures are intended to cover non-exclusive inclusions. The terms "first," "second," and the like in the description and claims of this application or in the above-described drawings are used for distinguishing between different objects and not for describing a particular order.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have various communication client applications installed thereon, such as a web browser application, a shopping application, a search application, an instant messaging tool, a mailbox client, social platform software, and the like.
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture experts Group Audio Layer III, mpeg compression standard Audio Layer 3), MP4 players (Moving Picture experts Group Audio Layer IV, mpeg compression standard Audio Layer 4), laptop portable computers, desktop computers, and the like.
The server 105 may be a server providing various services, such as a background server providing support for pages displayed on the terminal devices 101, 102, 103.
It should be noted that, the system function migration method provided in the embodiment of the present application is generally executed by a server, and accordingly, the system function migration apparatus is generally disposed in the server.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to FIG. 2, a flow diagram of one embodiment of a method of system function migration is shown, in accordance with the present application. The system function migration method comprises the following steps:
step S201, when receiving the initialization request, acquiring new database table data of the target migration system, and initializing the new database table data to obtain initialization data.
In this embodiment, the new database table data is database table data of the target migration system, and the data is migrated from the old system to the target migration system. When data of an old system is migrated, the data of a new database table needs to be initialized first. Therefore, when the initialization request is received, the data of the new database table corresponding to the target migration system is obtained, and the data of the new database table is initialized, so that the data in the new database corresponding to the target migration system is ensured to be consistent with the data in the old database corresponding to the old system. Specifically, when obtaining the data of the new database table, generating an initialization script according to the table name corresponding to the data of the new database table, the database name corresponding to the data of the new database table, the table name corresponding to the old database and the database name corresponding to the old database; the initialization script is executed by an ETL (Extract-Transform-Load) tool such as a key, which is an open-source ETL tool through which data can be extracted, converted, and loaded, and the like, so that data in various tables of an old database is completely written into corresponding tables in a new database. Therefore, the initialization of the data of the new database table is finally realized, and the initialized data is obtained.
Step S202, when a test point request is received, test point function data corresponding to the test point request is obtained, the test point function data is written into an old database based on an old data interface to obtain old function data, and the test point function data is written into a new database based on a new data interface and the initialization data to obtain new function data.
In this embodiment, when the initialization of the data of the new database table in the new database is completed, the test point function data is acquired. The test point function data is function data corresponding to a function identifier carried by the initialization request, such as function data corresponding to a write function; the function identifier is a test point function identifier which needs data migration currently. When data migration is performed, different functions need to be tested in sequence to determine whether the function of the target migration system is normal. When the test point functional data is obtained, writing the test point functional data into an old database based on an old data interface of an old system to obtain the old functional data; and simultaneously, writing the test point functional data into the new database based on a new data interface and initialization data of the target migration system to obtain new functional data so as to realize the process of simultaneously writing in the new database and the old database.
Step S203, determining whether the target migration system has a functional abnormality according to the old functional data and the new functional data.
In this embodiment, when new function data and old function data are obtained, it is determined whether a functional abnormality exists in the target migration system according to the old function data and the new function data. Specifically, the new function data and the old function data are compared, whether the new function data and the old function data are consistent or not is determined, and if the new function data and the old function data are consistent, it is determined that the target migration system has no function abnormality; and if the new functional data is inconsistent with the old functional data, determining that the target migration system has functional abnormality.
Step S204, when the target migration system has function abnormality, stopping writing the data of the test point function data in the old database and the new database, emptying all the data in the new database to obtain an initial database, and rewriting the test point function data based on the initial database and the old database.
In this embodiment, when the target migration system has a function abnormality, the writing of the test point function data in the old database and the new database is stopped, all the data in the new database is emptied, and the new database after the data is emptied is determined as the initial database; and respectively and simultaneously rewriting the test point function data according to the initial database and the old database. If the target migration system has no function abnormality, respectively and simultaneously writing test point function data based on the new database and the old database.
Step S205, when the pilot function data is successfully written into the initial database again, determining that the initial database passes verification, and reading all target function data in the old database based on the verified initial database.
In this embodiment, when the pilot function data is successfully written into the initial database again, it is determined that the initial database passes verification, and all target function data of the old database are read based on the initial database and the new data interface that pass verification, where the target function data is function data corresponding to the read function. And when the functional data is successfully read, determining that the basic function verification of the target migration system is completed and the functional data migration is completed.
It is emphasized that, in order to further ensure the privacy and security of the target function data, the target function data may also be stored in a node of a block chain.
The block chain referred by the application is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
The method and the system ensure the stability and reliability of the system during function migration, prevent the loss of the old database data during migration, and further improve the efficiency and accuracy of the system function migration.
In some optional implementation manners of this embodiment, the step of obtaining the test point function data corresponding to the test point request includes:
forwarding the initialization request to an old system, and acquiring and returning a URL mapping set to a client from the old system based on the initialization request;
and when the client side is determined to receive the test point request, obtaining the test point function data from the URL mapping set according to the test point request.
In this embodiment, when receiving the initialization request, the data processing side forwards the initialization request to the old system, and acquires and returns the URL mapping set to the client from the old system based on the initialization request. Specifically, the initialization request is a request sent by the client, and when the data processing end completes initialization of the new database table data of the new system, the data processing end forwards the initialization request to the old system. When the old system is determined to pass the verification of the initialization request, the old system returns the URL mapping sets corresponding to all the functions to the data processing end, the data processing end returns the URL mapping sets corresponding to all the functions of the old system to the client, and the URL mapping sets are URL data corresponding to all the functions in the old system. And then, when the client side is determined to receive the test point request, the data processing side acquires the test point function parameters according to the test point request, and obtains the test point function data from the URL mapping set according to the test point function parameters. The test point function parameter is an identification parameter associated with the test point function data, and the corresponding test point function data can be acquired from the URL mapping set according to the test point function parameter.
In this embodiment, the test point function data is acquired through the URL mapping set, so that partial test point verification can be performed on the test point function through the test point function data, and further, function rollback can be performed at any time in the data migration process, so that the data processing amount is reduced, and data loss is avoided.
In some optional implementations of this embodiment, the step of obtaining and returning the URL mapping set from the old system to the client based on the initialization request includes:
analyzing the test point request to obtain test point functional parameters, and acquiring URL addresses corresponding to the test point functional parameters from the URL mapping set;
and reading the test point function data based on the URL address.
In this embodiment, the test point request is analyzed to obtain the test point function parameters of the test point request, the corresponding URL address is read from the obtained URL mapping set by using the test point function parameters as keys, and the test point function data corresponding to the test point function parameters can be obtained based on the URL address.
In the embodiment, the test point function data is read through the URL address, so that the test point function data can be accurately acquired through the URL address, and the accuracy of data acquisition is further improved.
In some optional implementation manners of this embodiment, the writing the test point function data in the new database based on the new data interface and the initialization data to obtain new function data includes:
determining whether the test point request is a write request, and when the test point request is the write request, copying the write request and forwarding the write request to a new data interface of the target migration system;
and synchronously writing the test point function data in the new database and the old database based on the new data interface and the initialization data.
In this embodiment, when obtaining the test point function data, the test point request is analyzed to determine whether the test point request is a write request. When the test point request is a write request, the write request is copied and forwarded to a new data interface of the target migration system, and the test point functional data is synchronously written into an old database corresponding to an old system in a new database of the target migration system based on the new data interface and the initialization data. Specifically, data can be synchronously written, namely double-write, through ngx _ http _ mirror _ module (traffic replication module) of nginx, when the test point request is determined to be a write request, the write request is forwarded to the old system, and meanwhile, the write request is replicated and forwarded to the new system; and when the new system and the old system receive the write request, writing test point function data in the corresponding databases respectively based on the write request. Wherein nginx is a proxy server, through which load balancing can be realized.
In the embodiment, the new data interface and the initialization data are used for synchronously writing the test point functional data with the old database in the new database, so that the flow replication of the write request is realized, the workload of development is reduced, the waste of resources is avoided, and the efficiency of data processing is further improved.
In some optional implementation manners of this embodiment, the step of determining whether the test point request is a write request includes:
acquiring an identifier of the test point request, and determining the test point request as a write request when the identifier is a write identifier;
and when the identifier is a read identifier, determining that the test point request is a read request.
In this embodiment, an identifier of the test point request is obtained, and if the test point request carries a write identifier, the test point request is determined to be a write request; and if the identifier carried by the test point request is a read identifier, determining that the test point request is a read request. For example, if the URL of the test point request carries/write/, it indicates that the test point request is a write request, and if the URL of the test point request carries/read/, it indicates that the test point request is a read request.
In the embodiment, the request type of the test point request is determined through the identifier of the test point request, so that the test point request is accurately judged, and the data reading and writing efficiency is further improved.
In some optional implementation manners of this embodiment, the step of determining whether the target migration system has a functional abnormality according to the old functional data and the new functional data includes:
acquiring target trial writing time corresponding to the old functional data or the new functional data, and acquiring a trial point log generated based on the old functional data and the new functional data when the target trial writing time is greater than or equal to a preset time threshold;
and determining whether the target migration system has abnormal functions according to the test point log.
In this embodiment, by obtaining the target test writing duration of the old functional data or the new functional data, whether the functional abnormality exists in the target migration system may be determined according to the target test writing duration. The target trial writing duration is the writing duration of the test point function data in the old database or the new database, and the target trial writing durations of the old database and the new database are the same because the old database and the new database are written simultaneously. And acquiring a target trial writing time corresponding to the old functional data or the new functional data, and acquiring a trial point log generated by the old functional data and the new functional data when the target trial writing time is greater than or equal to a preset time threshold. Determining whether the error-reporting identification exists in the test point log, and determining that the target migration system has abnormal functions when the error-reporting identification exists in the test point log; and when the error reporting identification does not exist in the test point log, determining that the target migration system does not have the function abnormality. If the target trial writing time length is smaller than a preset time length threshold value, determining whether the target migration system has abnormal functions by comparing whether the new function data is consistent with the old function data; if the new functional data is consistent with the old functional data, determining that the target migration system has no functional abnormality; and if the new functional data is inconsistent with the old functional data, determining that the target migration system has functional abnormality.
In the embodiment, the target test writing duration of the old functional data or the new functional data is obtained, and whether the function of the target migration system is abnormal is determined according to the target test writing duration and the test point log, so that the efficient determination of the function of the target migration system is realized, the stability and the reliability of the system are ensured, and the loss of the old database data is avoided.
In some optional implementation manners of this embodiment, the step of reading all target function data corresponding to the old database based on the initial database that passes the verification includes:
selecting a preset number of preset target clients from a preset number of target clients corresponding to the old database as sub-clients, and reading target function data of the sub-clients based on the initial database passing the verification;
and when the sub-clients finish reading, acquiring the rest clients in the preset target clients, and reading the target function data of the rest clients based on the initial database passing the verification.
In this embodiment, the preset target clients are all clients associated with the old database, a preset number of preset target clients are selected from the preset target clients of the target number as sub-clients, and the target function data of the sub-clients is read based on the initial database that passes the verification. And when the target function data of the sub-client is completely read, acquiring the residual clients in the preset target clients, and reading the target function data of the residual clients according to the initial database passing the verification, wherein the target function data of the sub-client and the target function data of the residual clients are combined into all the target function data corresponding to the old database. In addition, the number of the remaining clients is larger than the preset number corresponding to the sub-clients. And reading a small part of target function data of the sub-clients through the verified initial database, so that when the reading of the small part of clients is completed, the target function data of the remaining large part of remaining clients is read through the verified initial database, and the fault tolerance rate of the reading of the target function data is improved.
In the embodiment, the target function data of the sub-client and the target function data of the remaining clients are respectively read, and the number of the sub-clients is smaller than that of the remaining clients, so that the pilot reading of the target function data is realized, the data loss is avoided, and the fault tolerance rate of the data reading is improved.
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 hardware associated with computer readable instructions, which can be stored in a computer readable storage medium, and when executed, the processes of the embodiments of the methods described above can be included. The storage medium may be a non-volatile storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a Random Access Memory (RAM).
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
With further reference to fig. 3, as an implementation of the method shown in fig. 2, the present application provides an embodiment of a system function migration apparatus, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 2, and the apparatus may be specifically applied to various electronic devices.
As shown in fig. 3, the system function migration apparatus 300 according to the present embodiment includes: a fetch module 301, a first write module 302, a confirm module 303, a second write module 304, and a read module 305. Wherein:
an obtaining module 301, configured to obtain new database table data of a target migration system when an initialization request is received, and initialize the new database table data to obtain initialization data;
a first writing module 302, configured to, when a test point request is received, obtain test point function data corresponding to the test point request, write the test point function data in an old database based on an old data interface to obtain old function data, and write the test point function data in a new database based on a new data interface and the initialization data to obtain new function data;
in some optional implementations of this embodiment, the first writing module 302 includes:
the forwarding unit is used for forwarding the initialization request to an old system, acquiring and returning a URL mapping set to a client from the old system based on the initialization request;
and the first confirmation unit is used for obtaining the test point function data from the URL mapping set according to the test point request when the client side is determined to receive the test point request.
In some optional implementations of this embodiment, the forwarding unit includes:
the analysis unit is used for analyzing the test point request to obtain test point functional parameters and acquiring URL addresses corresponding to the test point functional parameters from the URL mapping set;
and the first reading unit is used for reading the test point function data based on the URL address.
In this embodiment, the new database table data is database table data of the target migration system, and the data is migrated from the old system to the target migration system. When data of an old system is migrated, the data of a new database table needs to be initialized first. Therefore, when the initialization request is received, the data of the new database table corresponding to the target migration system is obtained, and the data of the new database table is initialized, so that the data in the new database corresponding to the target migration system is ensured to be consistent with the data in the old database corresponding to the old system. Specifically, when obtaining the data of the new database table, generating an initialization script according to the table name corresponding to the data of the new database table, the database name corresponding to the data of the new database table, the table name corresponding to the old database and the database name corresponding to the old database; the initialization script is executed by an ETL (Extract-Transform-Load) tool such as a key, which is an open-source ETL tool through which data can be extracted, converted, and loaded, and the like, so that data in various tables of an old database is completely written into corresponding tables in a new database. Therefore, the initialization of the data of the new database table is finally realized, and the initialized data is obtained.
In some optional implementations of this embodiment, the first writing module 302 further includes:
the copying unit is used for determining whether the test point request is a write request, and when the test point request is the write request, copying the write request and forwarding the write request to a new data interface of the target migration system;
and the writing unit is used for synchronously writing the test point function data in the new database and the old database based on the new data interface and the initialization data.
In some optional implementations of this embodiment, the copying unit further includes:
a first obtaining unit, configured to obtain an identifier of the test point request, and when the identifier is a write identifier, determine that the test point request is the write request;
and the second confirming unit is used for determining the test point request as a read request when the identifier is a read identifier.
In this embodiment, when the initialization of the data of the new database table in the new database is completed, the test point function data is acquired. The test point function data is function data corresponding to a function identifier carried by the initialization request, such as function data corresponding to a write function; the function identifier is a test point function identifier which needs data migration currently. When data migration is performed, different functions need to be tested in sequence to determine whether the function of the target migration system is normal. When the test point functional data is obtained, writing the test point functional data into an old database based on an old data interface of an old system to obtain the old functional data; and simultaneously, writing the test point functional data into the new database based on a new data interface and initialization data of the target migration system to obtain new functional data so as to realize the process of simultaneously writing in the new database and the old database.
A confirming module 303, configured to determine whether the target migration system has a functional abnormality according to the old functional data and the new functional data;
in some optional implementations of this embodiment, the confirming module 303 includes:
the second obtaining unit is used for obtaining a target trial writing time length corresponding to the old functional data or the new functional data, and obtaining a trial point log generated based on the old functional data and the new functional data when the target trial writing time length is greater than or equal to a preset time length threshold;
and the third confirming unit is used for determining whether the target migration system has abnormal functions according to the test point log.
In this embodiment, when new function data and old function data are obtained, it is determined whether a functional abnormality exists in the target migration system according to the old function data and the new function data. Specifically, the new function data and the old function data are compared, whether the new function data and the old function data are consistent or not is determined, and if the new function data and the old function data are consistent, it is determined that the target migration system has no function abnormality; and if the new functional data is inconsistent with the old functional data, determining that the target migration system has functional abnormality.
A second writing module 304, configured to stop, when the target migration system has a function abnormality, data writing of the test point function data in the old database and the new database, clear all data in the new database to obtain an initial database, and rewrite the test point function data based on the initial database and the old database;
in this embodiment, when the target migration system has a function abnormality, the writing of the test point function data in the old database and the new database is stopped, all the data in the new database is emptied, and the new database after the data is emptied is determined as the initial database; and respectively and simultaneously rewriting the test point function data according to the initial database and the old database.
A reading module 305, configured to determine that the initial database passes verification when the pilot function data is successfully written into the initial database again, and read all target function data corresponding to the old database based on the verified initial database.
In some optional implementations of this embodiment, the reading module 305 includes:
the second reading unit is used for selecting a preset number of target clients as sub-clients from the target number of target clients corresponding to the old database, and reading target function data of the sub-clients based on the initial database passing the verification;
and the third reading unit is used for acquiring the rest clients in the preset target clients when the sub-clients finish reading, and reading the target function data of the rest clients based on the initial database passing the verification.
In this embodiment, when the pilot function data is successfully written into the initial database again, it is determined that the initial database passes verification, and all target function data of the old database are read based on the initial database and the new data interface that pass verification, where the target function data is function data corresponding to the read function. And when the functional data is successfully read, determining that the basic function verification of the target migration system is completed and the functional data migration is completed.
It is emphasized that, in order to further ensure the privacy and security of the target function data, the target function data may also be stored in a node of a block chain.
The block chain referred by the application is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
The system function migration device provided by the embodiment ensures the stability and reliability of the system during function migration, prevents the loss of old database data during migration, and further improves the efficiency and accuracy of system function migration.
In order to solve the technical problem, an embodiment of the present application further provides a computer device. Referring to fig. 4, fig. 4 is a block diagram of a basic structure of a computer device according to the present embodiment.
The computer device 6 comprises a memory 61, a processor 62, a network interface 63 communicatively connected to each other via a system bus. It is noted that only a computer device 6 having components 61-63 is shown, but it is understood that not all of the shown components are required to be implemented, and that more or fewer components may be implemented instead. As will be understood by those skilled in the art, the computer device is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction, and the hardware includes, but is not limited to, a microprocessor, an Application Specific Integrated Circuit (ASIC), a Programmable Gate Array (FPGA), a Digital Signal Processor (DSP), an embedded device, and the like.
The computer device can be a desktop computer, a notebook, a palm computer, a cloud server and other computing devices. The computer equipment can carry out man-machine interaction with a user through a keyboard, a mouse, a remote controller, a touch panel or voice control equipment and the like.
The memory 61 includes at least one type of readable storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the memory 61 may be an internal storage unit of the computer device 6, such as a hard disk or a memory of the computer device 6. In other embodiments, the memory 61 may also be an external storage device of the computer device 6, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the computer device 6. Of course, the memory 61 may also comprise both an internal storage unit of the computer device 6 and an external storage device thereof. In this embodiment, the memory 61 is generally used for storing an operating system installed in the computer device 6 and various types of application software, such as computer readable instructions of a system function migration method. Further, the memory 61 may also be used to temporarily store various types of data that have been output or are to be output.
The processor 62 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 62 is typically used to control the overall operation of the computer device 6. In this embodiment, the processor 62 is configured to execute computer readable instructions stored in the memory 61 or process data, for example, computer readable instructions for executing the system function migration method.
The network interface 63 may comprise a wireless network interface or a wired network interface, and the network interface 63 is typically used for establishing a communication connection between the computer device 6 and other electronic devices.
The computer device provided by the embodiment ensures the stability and reliability of the system during function migration, prevents the loss of old database data during migration, and further improves the efficiency and accuracy of system function migration.
The present application further provides another embodiment, which is to provide a computer-readable storage medium storing computer-readable instructions executable by at least one processor to cause the at least one processor to perform the steps of the system function migration method as described above.
The computer-readable storage medium provided by the embodiment ensures the stability and reliability of the system during function migration, prevents the loss of old database data during migration, and further improves the efficiency and accuracy of system function migration.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present application.
It is to be understood that the above-described embodiments are merely illustrative of some, but not restrictive, of the broad invention, and that the appended drawings illustrate preferred embodiments of the invention and do not limit the scope of the invention. This application is capable of embodiments in many different forms and is provided for the purpose of enabling a thorough understanding of the disclosure of the application. Although the present application has been described in detail with reference to the foregoing embodiments, it will be apparent to one skilled in the art that the present application may be practiced without modification or with equivalents of some of the features described in the foregoing embodiments. All equivalent structures made by using the contents of the specification and the drawings of the present application are directly or indirectly applied to other related technical fields and are within the protection scope of the present application.

Claims (10)

1. A method for migrating system functions, comprising the steps of:
when an initialization request is received, acquiring new database table data of a target migration system, and initializing the new database table data to obtain initialization data;
when a test point request is received, test point function data corresponding to the test point request are obtained, the test point function data are written into an old database based on an old data interface to obtain old function data, and the test point function data are written into a new database based on a new data interface and the initialization data to obtain new function data;
determining whether the target migration system has abnormal functions according to the old functional data and the new functional data;
when the target migration system has functional abnormality, stopping writing the data of the test point functional data in the old database and the new database, emptying all the data in the new database to obtain an initial database, and rewriting the test point functional data based on the initial database and the old database;
and when the pilot point functional data is successfully written into the initial database again, determining that the initial database passes verification, and reading all target functional data corresponding to the old database based on the verified initial database.
2. The system function migration method according to claim 1, wherein the step of obtaining the test point function data corresponding to the test point request comprises:
forwarding the initialization request to an old system, and acquiring and returning a URL mapping set to a client from the old system based on the initialization request;
and when the client side is determined to receive the test point request, obtaining the test point function data from the URL mapping set according to the test point request.
3. The system function migration method of claim 2, wherein said step of obtaining and returning a URL mapping set from said old system to a client based on said initialization request comprises:
analyzing the test point request to obtain test point functional parameters, and acquiring URL addresses corresponding to the test point functional parameters from the URL mapping set;
and reading the test point function data based on the URL address.
4. The method according to claim 1, wherein the step of writing the test point function data in a new database based on a new data interface and the initialization data to obtain new function data comprises:
determining whether the test point request is a write request, and when the test point request is the write request, copying the write request and forwarding the write request to a new data interface of the target migration system;
and synchronously writing the test point function data in the new database and the old database based on the new data interface and the initialization data.
5. The method according to claim 4, wherein the step of determining whether the test point request is a write request comprises:
acquiring an identifier of the test point request, and determining the test point request as a write request when the identifier is the write identifier;
and when the identifier is a read identifier, determining that the test point request is a read request.
6. The method according to claim 1, wherein the step of determining whether the target migration system has a functional abnormality according to the old functional data and the new functional data comprises:
acquiring target trial writing time corresponding to the old functional data or the new functional data, and acquiring a trial point log generated based on the old functional data and the new functional data when the target trial writing time is greater than or equal to a preset time threshold;
and determining whether the target migration system has abnormal functions according to the test point log.
7. The method according to claim 1, wherein the step of reading all target function data corresponding to the old database based on the verified initial database comprises:
selecting a preset number of target clients as sub-clients from the target number of target clients corresponding to the old database, and reading target function data of the sub-clients based on the verified initial database;
and when the sub-clients finish reading, acquiring the rest clients in the preset target clients, and reading the target function data of the rest clients based on the initial database passing the verification.
8. A system function migration apparatus, comprising:
the acquisition module is used for acquiring new database table data of the target migration system when an initialization request is received, and initializing the new database table data to obtain initialization data;
the device comprises a first writing-in module, a second writing-in module and a third writing-in module, wherein the first writing-in module is used for acquiring test point function data corresponding to a test point request when the test point request is received, writing the test point function data into an old database based on an old data interface to obtain the old function data, and writing the test point function data into a new database based on a new data interface and the initialization data to obtain new function data;
the confirming module is used for determining whether the target migration system has abnormal functions according to the old functional data and the new functional data;
a second writing module, configured to stop, when there is a functional abnormality in the target migration system, data writing of the test point functional data in the old database and the new database, clear all data in the new database to obtain an initial database, and rewrite the test point functional data based on the initial database and the old database;
and the reading module is used for determining that the initial database passes verification when the test point function data is successfully written into the initial database again, and reading all target function data corresponding to the old database based on the verified initial database.
9. A computer device comprising a memory having computer readable instructions stored therein and a processor which when executed implements the steps of the system function migration method of any one of claims 1 to 7.
10. A computer-readable storage medium having computer-readable instructions stored thereon which, when executed by a processor, implement the steps of the system function migration method of any one of claims 1 to 7.
CN202111539887.8A 2021-12-15 2021-12-15 System function migration method and device, computer equipment and storage medium Pending CN114218191A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111539887.8A CN114218191A (en) 2021-12-15 2021-12-15 System function migration method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111539887.8A CN114218191A (en) 2021-12-15 2021-12-15 System function migration method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114218191A true CN114218191A (en) 2022-03-22

Family

ID=80702714

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111539887.8A Pending CN114218191A (en) 2021-12-15 2021-12-15 System function migration method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114218191A (en)

Similar Documents

Publication Publication Date Title
CN112613917A (en) Information pushing method, device and equipment based on user portrait and storage medium
CN112632071A (en) Database primary key id generation method, device, equipment and storage medium
CN112631924A (en) Automatic testing method and device, computer equipment and storage medium
CN113259342A (en) Login verification method, device, computer equipment and medium
CN112631911A (en) Automatic testing method and device, computer equipment and storage medium
CN115455058A (en) Cache data processing method and device, computer equipment and storage medium
CN112328486A (en) Interface automation test method and device, computer equipment and storage medium
CN115757492A (en) Hotspot data processing method and device, computer equipment and storage medium
CN113434254B (en) Client deployment method, client deployment apparatus, computer device, and storage medium
CN110677506A (en) Network access method, device, computer equipment and storage medium
CN112860662A (en) Data blood relationship establishing method and device, computer equipment and storage medium
CN107657155B (en) Method and device for authenticating user operation authority
CN111813418A (en) Distributed link tracking method, device, computer equipment and storage medium
CN108241732B (en) Electronic device, information processing method, and storage medium
CN114637672A (en) Automatic data testing method and device, computer equipment and storage medium
CN114968822A (en) Interface testing method and device, computer equipment and storage medium
CN114186976A (en) Workflow transfer method and device, computer equipment and storage medium
CN114143308A (en) File uploading information processing method and device, computer equipment and storage medium
CN114626352A (en) Report automatic generation method and device, computer equipment and storage medium
CN115061916A (en) Method for automatically generating interface test case and related equipment thereof
CN114218191A (en) System function migration method and device, computer equipment and storage medium
CN112632192A (en) Node maintenance method and device, computer equipment and medium
CN112416875A (en) Log management method and device, computer equipment and storage medium
CN113806372B (en) New data information construction method, device, computer equipment and storage medium
CN109409922A (en) Data aggregate modeling 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