Disclosure of Invention
The embodiment of the application aims to provide a system function migration method, a system function migration device, computer equipment and a storage medium, so as to solve the technical problem of data migration loss.
In order to solve the above technical problems, the embodiment of the present application provides a system function migration method, which adopts the following technical schemes:
When an initialization request is received, new database table data of a target migration system are obtained, and the new database table data are initialized to obtain initialization data;
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 in an old database based on an old data interface to obtain the old function data, and the test point function data is written in 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 function data and the new function data;
Stopping writing the test point function data into the old database and the new database when the target migration system has abnormal functions, and emptying all data in the new database to obtain an initial database, and rewriting the test point function data into the old database based on the initial database;
and when the test point function data is successfully written into the initial database again, determining that the initial database passes verification, and reading all target function data corresponding to the old database based on the initial database passing verification.
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, acquiring and returning a URL mapping set to a client from the old system based on the initialization request;
And when the client receives the trial request, obtaining the trial function data from the URL mapping set according to the trial request.
Further, the step of obtaining and returning the URL mapping set to the client from the old system based on the initialization request includes:
analyzing the test point request to obtain test point function parameters, and acquiring URL addresses corresponding to the test point function 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 function data in a 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 copying the write request and forwarding the write request to a new data interface of the target migration system when the test point request is the write request;
and writing the test point function data in the new database synchronously with 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 that the test point request is the 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.
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 length corresponding to the old function data or the new function data, and acquiring a trial point log generated based on the old function data and the new function data when the target trial writing time length is greater than or equal to a preset time length 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 initial database passing the verification includes:
Selecting a preset number of target clients from target clients with the target number corresponding to the old database as sub-clients, and reading target function data of the sub-clients based on the initial database passing verification;
And when all the sub-clients are read, acquiring the residual clients in the preset target clients, and reading the target function data of the residual clients based on the initial database passing the verification.
In order to solve the above technical problems, the embodiment of the present application further provides a system function migration device, which adopts the following technical scheme:
The system comprises an acquisition module, a storage module and a storage module, wherein the acquisition module is used for acquiring new database table data of a target migration system when receiving an initialization request, and initializing the new database table data to obtain initialization data;
The first writing 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 confirmation module is used for determining whether the target migration system has abnormal functions according to the old function data and the new function data;
the second writing module is used for stopping writing the test point function data into the old database and the new database when the target migration system has abnormal functions, emptying all data in the new database to obtain an initial database, and rewriting the test point function data into the initial database and the old database based on the initial database;
and the reading module is used for determining that the verification of the initial database is passed 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 initial database which is passed by the verification.
In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical schemes:
When an initialization request is received, new database table data of a target migration system are obtained, and the new database table data are initialized to obtain initialization data;
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 in an old database based on an old data interface to obtain the old function data, and the test point function data is written in 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 function data and the new function data;
Stopping writing the test point function data into the old database and the new database when the target migration system has abnormal functions, and emptying all data in the new database to obtain an initial database, and rewriting the test point function data into the old database based on the initial database;
and when the test point function data is successfully written into the initial database again, determining that the initial database passes verification, and reading all target function data corresponding to the old database based on the initial database passing verification.
In order to solve the above technical problems, an embodiment of the present application further provides a computer readable storage medium, which adopts the following technical schemes:
When an initialization request is received, new database table data of a target migration system are obtained, and the new database table data are initialized to obtain initialization data;
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 in an old database based on an old data interface to obtain the old function data, and the test point function data is written in 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 function data and the new function data;
Stopping writing the test point function data into the old database and the new database when the target migration system has abnormal functions, and emptying all data in the new database to obtain an initial database, and rewriting the test point function data into the old database based on the initial database;
and when the test point function data is successfully written into the initial database again, determining that the initial database passes verification, and reading all target function data corresponding to the old database based on the initial database passing verification.
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 old database table data are completely consistent; after that, 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 in an old database based on an old data interface to obtain the old function data, the test point function data is written in a new database based on a new data interface and initialization data to obtain the new function data, and the data is written in the new database and the old database simultaneously, so that efficient test point on the new database is realized, and the efficiency of function data migration is further improved; then, determining whether the target migration system has abnormal functions according to the old function data and the new function data; when the target migration system has abnormal functions, stopping writing the test point function data in the old database and the new database, and emptying all 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 development workload and avoiding the waste of resources; when the test point function data is successfully written into the initial database again, determining that the initial database passes verification, and reading all target function data corresponding to the old database based on the initial database passing verification, finally, ensuring the stability and reliability of the system during function migration, preventing the loss of the old database data during migration, and further improving the efficiency and accuracy of system function migration.
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 applications herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "comprising" and "having" and any variations thereof in the description of the application and the claims and the description of the drawings above are intended to cover a non-exclusive inclusion. The terms first, second and the like in the description and in the claims or in the above-described figures, are used for distinguishing between different objects and not necessarily for describing a sequential or chronological order.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearances of such phrases 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. Those of skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments.
In order to make the person skilled in the art better understand the solution of the present application, the technical solution of the embodiment of the present application will be clearly and completely described below with reference to the accompanying drawings.
As shown in fig. 1, a system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used as a medium to provide communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The user may interact with the server 105 via the network 104 using the terminal devices 101, 102, 103 to receive or send messages or the like. Various communication client applications, such as a web browser application, a shopping class application, a search class application, an instant messaging tool, a mailbox client, social platform software, etc., may be installed on the terminal devices 101, 102, 103.
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablet computers, electronic book readers, MP3 players (Moving Picture ExpertsGroup Audio Layer III, dynamic video expert compression standard audio plane 3), MP4 (Moving PictureExperts Group Audio Layer IV, dynamic video expert compression standard audio plane 4) players, laptop and 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 by the embodiment of the present application is generally executed by a server, and accordingly, the system function migration device 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 chart of one embodiment of a method of system function migration in accordance with the present application is shown. The system function migration method comprises the following steps:
Step S201, when an initialization request is received, new database table data of a target migration system is obtained, and the new database table data is initialized 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 migrating data of an old system, initializing new database table data is needed. Therefore, when an initialization request is received, new database table data corresponding to the target migration system is acquired, and the new database table data is initialized to ensure that the data in the new database corresponding to the target migration system is consistent with the data in the old database corresponding to the old system. Specifically, when new database table data is obtained, generating an initialization script according to a table name corresponding to the new database table data, a database name corresponding to the new database table data, a table name corresponding to an old database, and a database name of the old database; the initialization script is executed by an ETL (Extract-Transform-Load) tool such as KETTLE, and data in various tables of the old database are completely written into corresponding tables in the new database, wherein KETTLE is an open-source ETL tool, and processes such as extraction, conversion and loading can be performed on the data by the KETTLE tool. Therefore, the initialization of the new database table data is finally realized, and the initialization 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 in an old database based on an old data interface to obtain the old function data, and the test point function data is written in 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 new database table data in the new database is completed, the test point function data is acquired. The test point function data are 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 is required to be subjected to data migration currently. When data migration is performed, different functions need to be tested in sequence to determine whether the functions of the target migration system are normal. When the test point function data is obtained, writing the test point function data into an old database based on an old data interface of an old system to obtain the old function data; meanwhile, based on a new data interface and initialization data of the target migration system, writing the test point function data into a new database to obtain new function data so as to realize the process of simultaneously double 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 or not there is a functional abnormality in the target migration system based on the old function data and the new function data. Specifically, comparing the new function data with the old function data, determining whether the new function data is consistent with the old function data, and if the new function data is consistent with the old function data, determining that the target migration system has no function abnormality; and if the new function data is inconsistent with the old function data, determining that the target migration system has abnormal functions.
And step S204, stopping writing the test point function data into the old database and the new database when the function abnormality exists in the target migration system, and emptying all data in the new database to obtain an initial database, and rewriting the test point function data into the old database based on the initial database and the old database.
In this embodiment, when a functional abnormality exists in the target migration system, writing of test point functional data in the old database and the new database is stopped, all data in the new database is emptied, and the new database after the data is emptied is determined to be an initial database; and simultaneously rewriting test point function data according to the initial database and the old database respectively. If the target migration system has no function abnormality, writing test point function data respectively and simultaneously based on the new database and the old database.
Step S205, when the test point function data is rewritten in the initial database, determining that the verification of the initial database is passed, and reading all target function data in the old database based on the initial database passed the verification.
In this embodiment, when the test point function data is rewritten in the initial database, it is determined that the initial database passes verification, and all target function data of the old database is 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 function data is successfully read, determining that the basic function verification of the target migration system is completed, and completing the function data migration.
It is emphasized that, to further ensure the privacy and security of the target function data, the target function data may also be stored in a blockchain node.
The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm and the like. The blockchain (Blockchain), essentially a de-centralized database, is a string of data blocks that are generated in association using cryptographic methods, each of which contains information from a batch of network transactions for verifying the validity (anti-counterfeit) of its information and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, an application services layer, and the like.
The application ensures the stability and reliability of the system when the function migration is performed, prevents the loss of the old database data during the migration, and further improves the efficiency and accuracy of the system function migration.
In some optional implementations 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, acquiring and returning a URL mapping set to a client from the old system based on the initialization request;
And when the client receives the trial request, obtaining the trial function data from the URL mapping set according to the trial request.
In this embodiment, when receiving an initialization request, the data processing end forwards the initialization request to the old system, and acquires and returns a 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 initialization of the new database table data of the new system is completed by the data processing end, the data processing end forwards the initialization request to the old system. When the old system passes the initialization request verification, the old system returns the URL mapping sets corresponding to all functions to the data processing end, and the data processing end returns the URL mapping sets corresponding to all functions of the old system to the client, wherein the URL mapping sets are URL data corresponding to all functions in the old system. And when the client receives the test point request, the data processing end obtains test point function parameters according to the test point request, and obtains 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 corresponding test point function data can be obtained from the URL mapping set according to the test point function parameter.
According to the embodiment, the test point function data are acquired through the URL mapping set, so that partial test point verification can be carried out on the test point function through the test point function data, further, function rollback can be carried out at any time in the data migration process, 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 to the client from the old system based on the initialization request includes:
analyzing the test point request to obtain test point function parameters, and acquiring URL addresses corresponding to the test point function 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 parameter of the test point request, the corresponding URL address is read from the obtained URL mapping set by using the test point function parameter as a key, and the test point function data corresponding to the test point function parameter can be obtained based on the URL address.
According to 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 implementations of this embodiment, the step of writing the test point function data in a 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 copying the write request and forwarding the write request to a new data interface of the target migration system when the test point request is the write request;
and writing the test point function data in the new database synchronously with the old database based on the new data interface and the initialization data.
In this embodiment, when the test point function data is obtained, the test point request is parsed, and it is determined whether the test point request is a write request. And when the test point request is a 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 an old database corresponding to the old system in a new database of the target migration system based on the new data interface and the initialization data. Specifically, through ngx _http_minor_module (flow replication module) of the nginx, synchronous writing, namely double writing, can be performed on the data, when the test point request is determined to be a write request, the write request is forwarded to an old system, and meanwhile, the write request is replicated and forwarded to a new system; when the new system and the old system receive the write request, test point function data are written in the corresponding databases based on the write request at the same time. Wherein, nginx is a proxy server through which load balancing can be achieved.
According to the embodiment, the test point function data is synchronously written into the new database with the old database through the new data interface and the initialization data, so that the flow replication of the writing request is realized, the development workload is reduced, the waste of resources is avoided, and the data processing efficiency is further improved.
In some optional implementations 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 that the test point request is a writing request when the identifier is a writing identifier;
and when the identifier is a read identifier, determining that the test point request is a read request.
In this embodiment, the identifier of the test point request is obtained, and if the test point request carries the writing identifier, the test point request is determined to be a writing request; and if the identifier carried by the test point request is a read identifier, determining the test point request as a read request. For example, the URL of the test point request carries/write/, which indicates that the test point request is a write request, and if the URL of the test point request carries/read/, which indicates that the test point request is a read request.
According to the embodiment, the request type of the test point request is determined through the identification of the test point request, so that accurate judgment of the test point request is realized, and the data reading and writing efficiency is further improved.
In some optional implementations 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 length corresponding to the old function data or the new function data, and acquiring a trial point log generated based on the old function data and the new function data when the target trial writing time length is greater than or equal to a preset time length threshold;
and determining whether the target migration system has abnormal functions according to the test point log.
In this embodiment, by acquiring the target test writing duration of the old function data or the new function data, whether the target migration system has a functional abnormality may be determined according to the target test writing duration. The target trial writing time is the writing time of the trial point function data in the old database or the new database, and the old database and the new database are written simultaneously, so that the target trial writing time of the old database and the new database is the same. And acquiring target trial writing time length corresponding to the old function data or the new function data, and acquiring trial point logs generated by the old function data and the new function data when the target trial writing time length is greater than or equal to a preset time length threshold value. Determining whether an error report mark exists in the test point log, and determining that the target migration system has abnormal functions when the error report mark exists in the test point log; and when the error reporting mark does not exist in the test point log, determining that the target migration system does not have abnormal functions. 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 are consistent with the old function data; if the new function data is consistent with the old function data, determining that the target migration system has no function abnormality; and if the new function data and the old function data are inconsistent, determining that the target migration system has abnormal functions.
According to the method and the device, the target test writing time of the old function data or the new function data is obtained, whether the function of the target migration system is abnormal or not is determined according to the target test writing time and the test point log, efficient determination of the function of the target migration system is achieved, stability and reliability of the system are guaranteed, and loss of old database data is avoided.
In some optional implementations of this embodiment, the step of reading all target function data corresponding to the old database based on the verified initial database includes:
selecting a preset target client of a preset number from the preset target clients of a target number corresponding to the old database as sub-clients, and reading target function data of the sub-clients based on the initial database passing verification;
And when all the sub-clients are read, acquiring the residual clients in the preset target clients, and reading the target function data of the residual clients based on the initial database passing the verification.
In this embodiment, the preset target clients are all clients associated with the old database, and a preset number of preset target clients are selected from the preset target clients with a target number to serve as sub-clients, and target function data of the sub-clients are read based on the initial database passing the verification. And when the target function data of the sub-client are read, acquiring the residual client in the preset target client, and reading the target function data of the residual client 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 client are combined into all target function data corresponding to the old database. In addition, the number of the remaining clients is greater than the preset number corresponding to the sub-clients. And reading the target function data of a small part of sub-clients through the verification passing initial database, so that when the reading of the small part of clients is completed, the target function data of the rest of clients is read through the verification passing initial database, and the fault tolerance rate of the target function data reading is improved.
According to the method and the device for reading the target function data of the sub-client and the target function data of the residual client, the target function data of the sub-client and the target function data of the residual client are respectively read, the number of the sub-clients is smaller than that of the residual clients, trial-and-error reading of the target function data is achieved, data loss is avoided, and the fault tolerance rate of data reading is improved.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by computer readable instructions stored in a computer readable storage medium that, when executed, may comprise the steps of the embodiments of the methods described above. The storage medium may be a nonvolatile storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a random access Memory (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, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited in order and may be performed in other orders, unless explicitly stated herein. Moreover, at least some of the steps in the flowcharts of the figures may include a plurality of sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, the order of their execution not necessarily being sequential, but may be performed in turn or alternately with other steps or at least a portion of the other steps or stages.
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 an 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: an acquisition module 301, a first writing module 302, a confirmation module 303, a second writing module 304, and a reading module 305. Wherein:
the acquiring module 301 is configured to acquire 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;
the first writing module 302 is configured to obtain, when a test point request is received, 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 alternative implementations of the present embodiment, the first writing module 302 includes:
a forwarding unit, configured to forward the initialization request to an old system, acquire and return 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 receives the test point request.
In some optional implementations of the present embodiment, the forwarding unit includes:
The analyzing unit is used for analyzing the test point request to obtain test point function parameters, and acquiring URL addresses corresponding to the test point function 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 migrating data of an old system, initializing new database table data is needed. Therefore, when an initialization request is received, new database table data corresponding to the target migration system is acquired, and the new database table data is initialized to ensure that the data in the new database corresponding to the target migration system is consistent with the data in the old database corresponding to the old system. Specifically, when new database table data is obtained, generating an initialization script according to a table name corresponding to the new database table data, a database name corresponding to the new database table data, a table name corresponding to an old database, and a database name of the old database; the initialization script is executed by an ETL (Extract-Transform-Load) tool such as KETTLE, and data in various tables of the old database are completely written into corresponding tables in the new database, wherein KETTLE is an open-source ETL tool, and processes such as extraction, conversion and loading can be performed on the data by the KETTLE tool. Therefore, the initialization of the new database table data is finally realized, and the initialization data is obtained.
In some alternative implementations of the present embodiment, the first writing module 302 further includes:
The copying unit is used for determining whether the trial request is a write request, and copying the write request and forwarding the write request to a new data interface of the target migration system when the trial request is the write request;
And the writing unit is used for synchronously writing the test point function data with the old database in the new database based on the new data interface and the initialization data.
In some optional implementations of this embodiment, the replication unit further includes:
the first acquisition unit is used for acquiring the identifier of the test point request, and determining that the test point request is the writing request when the identifier is the writing identifier;
And the second confirmation unit is used for determining that the test point request is a read request when the identifier is a read identifier.
In this embodiment, when the initialization of the new database table data in the new database is completed, the test point function data is acquired. The test point function data are 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 is required to be subjected to data migration currently. When data migration is performed, different functions need to be tested in sequence to determine whether the functions of the target migration system are normal. When the test point function data is obtained, writing the test point function data into an old database based on an old data interface of an old system to obtain the old function data; meanwhile, based on a new data interface and initialization data of the target migration system, writing the test point function data into a new database to obtain new function data so as to realize the process of simultaneously double writing in the new database and the old database.
A confirmation module 303, configured to determine whether a functional abnormality exists in the target migration system according to the old functional data and the new functional data;
In some alternative implementations of the present embodiment, the validation module 303 includes:
the second acquisition unit is used for acquiring target trial writing time length corresponding to the old function data or the new function data, and acquiring a trial point log generated based on the old function data and the new function data when the target trial writing time length is greater than or equal to a preset time length threshold;
And the third confirmation 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 or not there is a functional abnormality in the target migration system based on the old function data and the new function data. Specifically, comparing the new function data with the old function data, determining whether the new function data is consistent with the old function data, and if the new function data is consistent with the old function data, determining that the target migration system has no function abnormality; and if the new function data is inconsistent with the old function data, determining that the target migration system has abnormal functions.
A second writing module 304, configured to stop writing data of the test point function data in the old database and the new database when the target migration system has a function abnormality, and empty 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 a functional abnormality exists in the target migration system, writing of test point functional data in the old database and the new database is stopped, all data in the new database is emptied, and the new database after the data is emptied is determined to be an initial database; and simultaneously rewriting test point function data according to the initial database and the old database respectively.
And the reading module 305 is configured to determine that the verification of the initial database is passed when the test point function data is successfully written into the initial database again, and read all the target function data corresponding to the old database based on the initial database that is passed the verification.
In some alternative implementations of the present embodiment, the reading module 305 includes:
The second reading unit is used for selecting a preset number of target clients from target clients with target numbers corresponding to the old database as sub-clients, and reading target function data of the sub-clients based on the initial database passing verification;
and the third reading unit is used for acquiring the residual clients in the preset target clients when the sub-clients are all read, and reading the target function data of the residual clients based on the initial database passing the verification.
In this embodiment, when the test point function data is rewritten in the initial database, it is determined that the initial database passes verification, and all target function data of the old database is 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 function data is successfully read, determining that the basic function verification of the target migration system is completed, and completing the function data migration.
It is emphasized that, to further ensure the privacy and security of the target function data, the target function data may also be stored in a blockchain node.
The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm and the like. The blockchain (Blockchain), essentially a de-centralized database, is a string of data blocks that are generated in association using cryptographic methods, each of which contains information from a batch of network transactions for verifying the validity (anti-counterfeit) of its information and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, an application services layer, and the like.
The system function migration device provided by the embodiment ensures the stability and reliability of the system when performing 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 problems, the embodiment of the application also provides computer equipment. Referring specifically to fig. 4, fig. 4 is a basic structural block diagram 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 computer device 6 having components 61-63 is shown in the figures, but it should be understood that not all of the illustrated components are required to be implemented and that more or fewer components may be implemented instead. It will be appreciated by those skilled in the art that the computer device herein is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction, and its hardware includes, but is not limited to, a microprocessor, an Application SPECIFIC INTEGRATED Circuit (ASIC), a Programmable gate array (Field-Programmable GATE ARRAY, FPGA), a digital Processor (DIGITAL SIGNAL Processor, DSP), an embedded device, and the like.
The computer equipment can be a desktop computer, a notebook computer, a palm computer, a cloud server and other computing equipment. The computer equipment can perform man-machine interaction with a user through a keyboard, a mouse, a remote controller, a touch pad or voice control equipment and the like.
The memory 61 includes at least one type of readable storage media including flash memory, hard disk, multimedia card, card memory (e.g., SD or DX memory, etc.), random Access Memory (RAM), static Random Access Memory (SRAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), programmable Read Only Memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the storage 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 memory card (SMART MEDIA CARD, SMC), a Secure Digital (SD) card, a flash memory card (FLASH CARD) or the like, which are provided on the computer device 6. Of course, the memory 61 may also comprise both an internal memory unit of the computer device 6 and an external memory device. In this embodiment, the memory 61 is typically used to store an operating system and various application software installed on the computer device 6, such as computer readable instructions of a system function migration method. Further, the memory 61 may 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 (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, such as 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, which network interface 63 is typically used for establishing a communication connection between the computer device 6 and other electronic devices.
The computer equipment provided by the embodiment ensures the stability and reliability of the system when the function migration is performed, prevents the loss of the old database data during the migration, and further improves the efficiency and accuracy of the system function migration.
The present application also provides another embodiment, namely, 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 a system function migration method as described above.
The computer readable storage medium provided by the embodiment ensures the stability and reliability of the system when the function migration is performed, prevents the loss of old database data during the migration, and further improves the efficiency and accuracy of the system function migration.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present application.
It is apparent that the above-described embodiments are only some embodiments of the present application, but not all embodiments, and the preferred embodiments of the present application are shown in the drawings, which do not limit the scope of the patent claims. This application may be embodied in many different forms, but rather, embodiments are provided in order to provide a thorough and complete understanding of the present disclosure. Although the application has been described in detail with reference to the foregoing embodiments, it will be apparent to those skilled in the art that modifications may be made to the embodiments described in the foregoing description, or equivalents may be substituted for elements thereof. All equivalent structures made by the content of the specification and the drawings of the application are directly or indirectly applied to other related technical fields, and are also within the scope of the application.