CN109324959A - A kind of method, server and the computer readable storage medium of automatic transfer data - Google Patents

A kind of method, server and the computer readable storage medium of automatic transfer data Download PDF

Info

Publication number
CN109324959A
CN109324959A CN201810915354.7A CN201810915354A CN109324959A CN 109324959 A CN109324959 A CN 109324959A CN 201810915354 A CN201810915354 A CN 201810915354A CN 109324959 A CN109324959 A CN 109324959A
Authority
CN
China
Prior art keywords
data
target data
transferred
test
business scenario
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201810915354.7A
Other languages
Chinese (zh)
Other versions
CN109324959B (en
Inventor
郭丽丽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 CN201810915354.7A priority Critical patent/CN109324959B/en
Publication of CN109324959A publication Critical patent/CN109324959A/en
Application granted granted Critical
Publication of CN109324959B publication Critical patent/CN109324959B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management

Abstract

The present invention is suitable for field of computer technology, provides method, server and the computer readable storage medium of a kind of automatic transfer data, comprising: receive the data transfer instruction for shifting data automatically;The data transfer instruction carries the business scenario mark of the application identities and the data to be transferred applied belonging to data to be transferred;Mirror image Production database associated with the application identities establishes connection;If detecting, default trigger event is triggered, then identified based on the business scenario, target data to be transferred is obtained from the mirror image Production database, and it is identified based on the business scenario of the target data, the target data is transferred in test database in corresponding test data table, to not only save cost of labor, data transfer efficiency is improved, and ensure that the integrality of data to be transferred.

Description

A kind of method, server and the computer readable storage medium of automatic transfer data
Technical field
The invention belongs to field of computer technology, more particularly to a kind of method, server and the calculating of automatic transfer data Machine readable storage medium storing program for executing.
Background technique
In general, before certain application program or a certain purpose new version are online, in order to guarantee the stability of new version function And reliability, it needs to test the various functions of new version, after the various functions test of new version passes through, just allow new Version is online.And the test data for being used to test the function of new version would generally select legacy version in actual production environment The data of middle generation, i.e. creation data, and when the different function to new version is tested, need to use different types of life Produce data.
The prior art is by database administrator manually from the mirror image Production database for storing legacy version creation data Data required for middle selection is tested, and the data of selection are transferred in corresponding test database, and manually choose and turn Move data efficiency is lower, the duty cycle is longer, and due in mirror image Production database data to deposit the phase limited, manually choose number According to relatively slow, the integrality of data needed for not can guarantee test.
Summary of the invention
In view of this, the embodiment of the invention provides a kind of automatic methods of transfer data, server and computer-readable Storage medium, it is long to solve existing artificial selection and shift low efficiency, the period existing for the method for data, it not can guarantee test The problem of integrality of required data.
The first aspect of the embodiment of the present invention provides a kind of method of automatic transfer data, comprising:
Receive the data transfer instruction for shifting data automatically;The data transfer instruction carries belonging to data to be transferred The business scenario of the application identities of application and the data to be transferred mark;
Mirror image Production database associated with the application identities establishes connection;
If detecting, default trigger event is triggered, and is identified based on the business scenario, from the mirror image creation data Target data to be transferred is obtained in library, and is identified based on the business scenario of the target data, and the target data is shifted Into test database in corresponding test data table;The default trigger event is used to describe to shift the opportunity of data automatically.
The second aspect of the embodiment of the present invention provides a kind of server, including memory, processor and is stored in institute The computer program that can be run in memory and on the processor is stated, the processor executes real when the computer program Existing following steps:
Receive the data transfer instruction for shifting data automatically;The data transfer instruction carries belonging to data to be transferred The business scenario of the application identities of application and the data to be transferred mark;
Mirror image Production database associated with the application identities establishes connection;
If detecting, default trigger event is triggered, and is identified based on the business scenario, from the mirror image creation data Target data to be transferred is obtained in library, and is identified based on the business scenario of the target data, and the target data is shifted Into test database in corresponding test data table;The default trigger event is used to describe to shift the opportunity of data automatically.
The third aspect of the embodiment of the present invention provides a kind of computer readable storage medium, the computer-readable storage Media storage has computer program, and the computer program realizes following steps when being executed by processor:
Receive the data transfer instruction for shifting data automatically;The data transfer instruction carries belonging to data to be transferred The business scenario of the application identities of application and the data to be transferred mark;
Mirror image Production database associated with the application identities establishes connection;
If detecting, default trigger event is triggered, and is identified based on the business scenario, from the mirror image creation data Target data to be transferred is obtained in library, and is identified based on the business scenario of the target data, and the target data is shifted Into test database in corresponding test data table;The default trigger event is used to describe to shift the opportunity of data automatically.
Implement method, server and the computer-readable storage medium of a kind of automatic transfer data provided in an embodiment of the present invention Matter has the advantages that
In the embodiment of the present invention, server first and is counted when receiving the data transfer instruction for shifting data automatically Connection is established according to the associated mirror image Production database of application identities that transfer instruction carries, by creation for describing from turn The default trigger event for moving data opportunity, when default trigger event is triggered, the business field based on the carrying of data transfer instruction Scape mark, obtains target data to be transferred, and the business scenario mark based on target data from mirror image Production database automatically Know, target data is automatically transferred in test database in corresponding test data table, in this way, user only needs trigger data to turn Instruction is moved, data to be transferred can be transferred in test database by server from corresponding mirror image Production database automatically, Without manually carrying out data decimation and transfer operation, cost of labor is not only saved, improves data transfer efficiency, and by In the raising of data transfer efficiency, so as to guarantee for data to be transferred to be fully transferred in corresponding test database, protect The integrality of data to be transferred is demonstrate,proved.
Detailed description of the invention
It to describe the technical solutions in the embodiments of the present invention more clearly, below will be to embodiment or description of the prior art Needed in attached drawing be briefly described, it should be apparent that, the accompanying drawings in the following description is only of the invention some Embodiment for those of ordinary skill in the art without any creative labor, can also be according to these Attached drawing obtains other attached drawings.
Fig. 1 is the implementation flow chart of the method for the automatic transfer data of one kind that first embodiment of the invention provides;
Fig. 2 is the specific implementation flow of S13 in the method for the automatic transfer data of one kind that second embodiment of the invention provides Figure;
Fig. 3 is the specific implementation flow of S133 in the method for the automatic transfer data of one kind that third embodiment of the invention provides Figure;
Fig. 4 is the specific implementation flow of S133 in the method for the automatic transfer data of one kind that fourth embodiment of the invention provides Figure;
Fig. 5 is the specific implementation flow of S13 in the method for the automatic transfer data of one kind that fifth embodiment of the invention provides Figure;
Fig. 6 is a kind of structural block diagram of server provided in an embodiment of the present invention;
Fig. 7 be another embodiment of the present invention provides a kind of server structural block diagram.
Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to the accompanying drawings and embodiments, right The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and It is not used in the restriction present invention.
Referring to Fig. 1, Fig. 1 is the implementation process of the method for the automatic transfer data of one kind that first embodiment of the invention provides Figure.In the present embodiment, the executing subject of the automatic method for shifting data is server.Automatic transfer data as shown in Figure 1 Method the following steps are included:
S11: the data transfer instruction for shifting data automatically is received;The data transfer instruction carries data to be transferred The business scenario of the application identities of affiliated application and the data to be transferred mark.
In general, an application program (hereinafter referred to as applying) can include multinomial different function, that is, correspond to multiple and different Business scenario.Such as insurable interest demo platform comprising client rights verify scene, premium calculates scene, interests item is shown The business scenarios such as scene.When user operates under the different business scene of application, the user with different data structure can be generated Data.In practical applications, developer can be used to carry out it application mark of unique identification for each application configuration in advance Know, and configure corresponding unique identification for each business scenario of each application, is i.e. business scenario identifies.Wherein, application identities It can be the title of application.Business scenario, which identifies, can be the title of business scenario, be also possible to it is customized by number and/or The character string of the compositions such as letter, the business scenario of the different business scene of same application identify different.
It should be noted that user actually uses the creation data that the user data generated when application is referred to as application, answer Creation data is generally stored inside in the Production database of application, and the Production database of application and the application identities of application are related Connection.In practical applications, since Production database does not allow to carry out data reading operation, it usually can also be by the production of application Data are backed up to simultaneously with the Production database of application each other in the mirror image Production database of mirror image, the mirror image creation data of application Library is also associated with the application identities of application.In practical applications, the Production database of application and the equal portion of mirror image Production database Administration is in the corresponding application server of application.In the present embodiment, for the production number to same application under different business scene According to distinguishing, application server when storing the creation data applied into Production database and mirror image Production database, It can be that creation data adds corresponding business scenario mark according to the business scenario that user is presently in.
It applies when being iterated update, in general, after the completion of the exploitation of the new version of application, in order to guarantee new version function Stability and reliability, need to test the various functions of new version, new version various functions test pass through after, Just allow new version online.And the test data for being used to test the function of new version would generally select the production of legacy version Data, and when the different function to new version is tested, need the production number using legacy version under different business scene According to, in this way, in practical applications, when testing the new version of application, it is necessary to according to testing requirement, from for storing Creation data of the legacy version under different business scene is obtained in the mirror image Production database of legacy version creation data.And due to mirror As data deposit that the phase is limited in Production database, therefore, it is necessary to be transferred to the corresponding data in mirror image Production database in time In customized test database, so as to it is subsequent can be at any time based on the creation data being stored in test database to application New version carries out functional test.
In embodiments of the present invention, when a certain item for needing to treat test application (such as interests demo platform) or certain is multinomial When function is tested, developer can be inputted by the interactive interface of server application to be tested application identities and to Test application is identified to business scenario corresponding to brake, and the data for triggering interactive interface shift button automatically.Service If device detect user by interactive interface input application to be tested application identities and application to be tested to brake institute it is right The business scenario mark answered, and the data for triggering interactive interface shift button automatically, then are identified as receiving for shifting automatically Data transfer instruction, at this point, the application identities for the application to be tested that server inputs user and application to be tested is to be measured The mark of business scenario corresponding to function is respectively identified as the application applied belonging to the data to be transferred of data transfer instruction carrying The business scenario of mark and data to be transferred mark.That is, for treat test application when brake is tested Required data are data to be transferred, and user is as to be transferred by the application identities for the application to be tested that interactive interface inputs The application identities applied belonging to data, the application to be tested that user is inputted by interactive interface to business corresponding to brake Scene identity is the business scenario mark of data to be transferred.
It is understood that user can pass through interaction when only needing the new version to some application to test Interface inputs the application identities of the application, at this point, the application identities that data transfer instruction carries are one;When needs are at least two When the new version of a application is tested, user can input the application identities of at least two application by interactive interface, this When, the application identities that data transfer instruction carries are at least two.When needing a certain item function to certain application to test, User can be inputted by interactive interface to be identified to the corresponding business scenario of brake, at this point, what data transfer instruction carried Business scenario is identified as one, and when needing at least two functions to certain application to test, user can pass through interaction circle Face inputs this at least two to the corresponding business scenario mark of brake, at this point, the business field that data transfer instruction carries Scape is identified as at least two.
S12: mirror image Production database associated with the application identities establishes connection.
In the embodiment of the present invention, when server receives the data transfer instruction for shifting data automatically, illustrate user It needs to move creation data from the mirror image Production database transfer of application to be measured, at this point, server is carried based on data transfer instruction Application identities and application identities and application server port between default corresponding relationship, determine data transfer instruction carry The corresponding application server port of application identities, and based on data transfer instruction carry the corresponding application service of application identities The application identities that device port is established with destination application server and communicated to connect, and then carried based on data transfer instruction, with deployment The application identities carried with data transfer instruction associated mirror image Production database foundation company in destination application server It connects.
In embodiments of the present invention, in order to realize data transfer automation, developer can in advance in the server The default trigger event for describing to shift data opportunity automatically is created, presets trigger event when meeting corresponding preset condition It is automatically triggered, indicates that the opportunity of automatic transfer data arrives when default trigger event is triggered.Server turns with data It moves after instructing the associated mirror image Production database of application identities carried to establish connection, detects whether default trigger event is touched Hair.In practical applications, presetting the corresponding preset condition of trigger event can be arranged according to actual needs, herein with no restrictions.
S13: if detecting, default trigger event is triggered, and is identified based on the business scenario, produces from the mirror image Target data to be transferred is obtained in database, and is identified based on the business scenario of the target data, by the target data It is transferred in test database in corresponding test data table;The default trigger event be used for describe automatically shift data when Machine.
In embodiments of the present invention, if server detects that default trigger event is triggered, illustrate to walk around automatically and move number According to opportunity arrive, at this point, the business scenario for the data to be transferred that server is carried based on data transfer instruction identifies, from number Target data to be transferred is obtained in the associated mirror image Production database of application identities carried according to transfer instruction.Wherein, to The target data of transfer is business field in mirror image Production database associated with the application identities that data transfer instruction carries Scape mark identifies identical creation data with the business scenario that data transfer instruction carries, meanwhile, target data to be transferred Required test data when as testing application to be measured.
In the embodiment of the present invention, in order to which test data needed for corresponding be used under different business scene distinguishes, develop Multiple test data tables can be pre-created in personnel in customized test database, are respectively used to storage and apply not of the same trade or business Test data needed under scene of being engaged in.In practical applications, developer can be by test data table and its survey to be stored The corresponding business scenario mark of examination data establishes incidence relation, is wanted for example, can set it for the table name of test data table The corresponding business scenario mark of the test data of storage.
After server gets target data to be transferred, the business scenario mark based on target data, by target data It is transferred in customized test database in corresponding test data table.For example, server can be based on the industry of target data Business scene identity, target data is stored to table name and the business scenario of target data and is identified in identical test data table.
Above as can be seen that a kind of method of automatic transfer data provided in this embodiment is being received for shifting automatically When the data transfer instruction of data, first mirror image Production database associated with the application identities that data transfer instruction carries is established Connection, by creating the default trigger event for describing to shift data opportunity automatically, when default trigger event is triggered, base In the business scenario mark that data transfer instruction carries, target data to be transferred is obtained from mirror image Production database automatically, And the business scenario mark based on target data, target data is automatically transferred in test database corresponding test data table In, in this way, user only needs trigger data transfer instruction, data to be transferred can be produced number from corresponding mirror image automatically by server According to being transferred in test database in library, without manually carrying out data decimation and transfer operation, not only save manually at This, improves data transfer efficiency, and due to the raising of data transfer efficiency, so as to guarantee all to turn data to be transferred It moves in corresponding test database, ensure that the integrality of data to be transferred.
Referring to Fig. 2, Fig. 2 is the tool of S13 in the method for the automatic transfer data of one kind that second embodiment of the invention provides Body implementation flow chart.Relative to the corresponding embodiment of Fig. 1, S13 in the method for the automatic transfer data of one kind provided in this embodiment S131~S133 is specifically included, details are as follows:
S131: being identified based on the business scenario, and target data to be transferred is determined from the mirror image Production database, The total amount of the target data is counted, and the storage duration of the target data is monitored.
S132: if detecting, the maximum value of the storage duration of the target data is greater than preset duration threshold value, and the mesh The total amount for marking data is greater than preset quantity threshold value, then is identified as default trigger event and is triggered.
S133: the target data is transferred in test database by the business scenario mark based on the target data In corresponding test data table.
It is often necessary to the target data shifted from the mirror image Production database of application to be tested have it is a plurality of, and it is different Target data is stored in time possible difference when mirror image Production database, some target datas are stored in mirror image Production database When time it is more early, time when some target datas are stored in mirror image Production database is later.In the present embodiment, application service Device also records every creation data and is stored in mirror when storing the creation data applied in the mirror image Production database to application Time when as Production database.
In practical applications, there is vacant memory space to guarantee mirror image Production database always to store new production Data, it will usually which the phase of depositing of the creation data stored in mirror image Production database is limited.For example, it is raw that mirror image can be set The phase of depositing for producing database data is m days, when the storage duration of the creation data stored in mirror image Production database reaches m days, Creation data will be destroyed.That is, the more early creation data being stored in mirror image Production database the early destroyed, more It is more late destroyed that evening is stored in the creation data in mirror image Production database.It follows that the transfer opportunity of target data and mesh The storage duration for marking data is related, and in practical applications, the transfer opportunity of target data is also related with the total amount of target data. Wherein, between the time and current time when a length of target data is stored in mirror image Production database when the storage of target data The storage duration of time interval, target data can be measured as unit of day, can also be measured as unit of hour, Herein with no restrictions.For example, if time when target data is stored in mirror image Production database is on March 15th, 2018, currently Time is on March 20th, 2018, then the storage duration of target data is 5 days.The total amount of target data is target data Total number.
It in the present embodiment, need to only guarantee that target data is transferred to test number before target data to be transferred is destroyed According to library.Therefore, in the present embodiment, the storage duration of target data to be transferred and the total amount of target data can be passed through To be defined to the opportunity of automatic transfer data, it can pass through the storage duration and number of targets of target data to be transferred According to total amount default trigger event is described.Specifically, default trigger event can be set are as follows: the storage of target data The maximum value of duration is greater than preset duration threshold value and the total amount of target data is greater than preset quantity threshold value.
Wherein, the maximum value of the storage duration of target data is that depositing for the longest target data of duration is stored in target data Store up duration.In practical applications, server can compare the storage duration of each target data, and then when determining storage Long longest target data, is determined as the storage duration of target data for the storage duration for storing the longest target data of duration Maximum value.Preset duration threshold value and preset data amount threshold value can shift the rate of data according to server to determine, for example, If the rate that server shifts data is a item/day, the total amount of target data is b item, then to have shifted these target datas just needs Take b/a days.Assuming that in mirror image Production database data deposit the phase be m days, then the maximum value of the storage duration of target data cannot Greater than the day (m-b/a), i.e. the value of preset duration threshold value is necessarily less than the day (m-b/a), simultaneously as in mirror image Production database User data can irregularly increased, the user data newly increased is also to need to be shifted within the phase of depositing, therefore, In practical application, preset duration threshold value can be adjusted in real time according to the total amount for the target data that the same day counts on, to guarantee Any target data is not omitted.
Since the storage duration of target data is not fixed and invariable, but increase with the time, therefore, the present embodiment In, the business scenario mark that server is first carried based on data transfer instruction, from the application identities carried with data transfer instruction Target data to be transferred is determined in associated mirror image Production database, after target data to be transferred has been determined, service Time when device is stored in mirror image Production database based on each target data determines the storage duration of each target data, and right The storage duration of each target data is monitored, when whether being greater than default to detect the maximum value of storage duration of target data Long threshold value, meanwhile, the total amount of server also real-time statistics target data, and whether the total amount for detecting target data is greater than present count Measure threshold value.If server detects that the maximum value of the storage duration of target data is greater than preset duration threshold value, and target data Total amount is greater than preset quantity threshold value, then is identified as default trigger event and is triggered, at this point, server is based on each target data Business scenario mark, target data is transferred in database to be tested in corresponding test data table.
Above as can be seen that a kind of method of automatic transfer data provided in this embodiment is according to target data to be transferred The maximum value of storage duration and the total amount of target data determine opportunitys of automatic transfer data, when the storage duration of target data Maximum value be greater than preset duration threshold value, and the total amount of target data be greater than preset quantity threshold value when be identified as shifting data automatically Opportunity arrive, target data is transferred in test database in corresponding test data table at this time, to can not only protect All target datas are transferred in test database by card before target data destruction, and can maximize raising service The utilization rate of the system resource of device.
Referring to Fig. 3, Fig. 3 is the tool of S133 in the method for the automatic transfer data of one kind that third embodiment of the invention provides Body implementation flow chart.Relative to the corresponding embodiment of Fig. 2, S133 in the method for the automatic transfer data of one kind provided in this embodiment S1331~S1333 is specifically included, details are as follows:
S1331: it is determining identify with the business scenario it is associated to the corresponding field to be verified of brake.
Due to each business scenario for corresponding to application to be tested to brake of application to be tested, it is to be tested The business scenario mark of each business scenario of application is corresponding to application to be tested to have incidence relation between brake.And The each of application to be tested corresponds at least one field to be verified to brake.
Wherein, it is used to identify the data word for the creation data for constituting application to be tested to the corresponding field to be verified of brake Duan Zhonghui treats the data field that the test result of brake has an impact.For example, the premium for interests demo platform calculates This waits for brake, since the data fields such as the kind of insurance, age of user can have an impact subject premium, and then to premium meter It calculates the result that function is calculated in test to have an impact, therefore, premium calculates this and waits for the corresponding word to be verified of brake Section may include insurance kind identification field, age of user field etc..
In the present embodiment, developer can be to be verified accordingly for each functional configuration to be measured of application to be tested in advance Field, and in the server by each to be verified field associated storage corresponding to brake of application to be measured.Server Can be identified based on the business scenario of application to be tested and application to be tested to the default corresponding relationship between brake, determine The business scenario mark carried with data transfer instruction is associated to brake, and based on application to be tested to brake and Default corresponding relationship between field to be verified, determination are associated to be measured with the business scenario mark that data transfer instruction carries The corresponding field to be verified of function.
S1332: the value based on field to be verified described in target data described in each item screens the target data, The target data is filtered out from the identical target data of value of the field to be verified as test data, and by institute The different target data of value for stating field to be verified is identified as test data.
In practical applications, accuracy in order to ensure the test results, it usually needs the value by field to be verified is endless Exactly the same creation data to brake to testing accordingly, and production number identical for the value of field to be verified According to only need to therefrom retaining a data since its test result for treating test function does not have any influence.
In the present embodiment, under the premise of guaranteeing the accuracy height of test result, in order to save the storage of test database Space avoids test database from storing a plurality of to useless repeated data is tested, and server is determining and data transfer instruction The business scenario mark of carrying is associated after the corresponding field to be verified of brake, is based in each target data and data The business scenario that transfer instruction carries identifies the associated value to the corresponding field to be verified of brake, carries out to target data Screening.Specifically, target data identical for the value of field to be verified, server is only from wherein filtering out a target Data are as test data;And it is identified as by the target data not exactly the same for the value of field to be verified, server Test data.
S1333: successively the test data is shifted according to the descending sequence of the storage duration of the test data Into test database in corresponding test data table.
In the present embodiment, server is stored in after the test data that needs shift has been determined based on each test data Time when mirror image Production database, determine the storage duration of each test data, and according to the storage duration of test data by Successively test data is transferred in test database in corresponding test data table to small sequence greatly, that is to say, that this reality It applies in example, server first shifts the storage longer test data of duration, and rear transfer stores the shorter test data of duration, so as to Enough guarantee to be transferred to all test datas in test database before test data is destroyed.
In practical applications, can also be per minute to server the total amount of the data shifted daily is remembered/per hour/ Record, so that the subsequent rate to server transfer data counts.
As an embodiment of the present invention, S133 can specifically include following steps:
The test data is averagely allocated to each default thread, so that the default thread will be for described in its distribution Test data is transferred in test database in corresponding test data table.
In the present embodiment, in order to improve data transfer efficiency, multiple threads can be pre-created in server, determined After the test data for needing to shift, test data can be averagely allocated to each thread being pre-created by server, so that respectively A thread being pre-created will be transferred in test database in corresponding test data table for the test data of its distribution.When So, in practical applications, the data volume that per thread can be handled every time may be not identical, therefore, can be according to each line Journey every time can the data volume that handled and the test data to be shifted total amount, to distribute survey to be transferred for each thread Try data.
Above as can be seen that a kind of method of automatic transfer data provided in this embodiment can not only guarantee to be tested answer Test result accuracy with higher to brake, and the memory space of test database can be saved, it avoids Test database stores a plurality of repeated data useless to test.
Referring to Fig. 4, Fig. 4 is the tool of S133 in the method for the automatic transfer data of one kind that fourth embodiment of the invention provides Body implementation flow chart.Relative to the corresponding embodiment of Fig. 2, S133 in the method for the automatic transfer data of one kind provided in this embodiment S1334~S1336 is specifically included, details are as follows:
S1334: if being detected during shifting the target data preset for identifying stopping transfer data Interrupt instruction then carries out proof of identity to the user for triggering the interrupt instruction.
S1335: if proof of identity passes through, stop shifting the target data.
S1336: if proof of identity does not pass through, continue to shift the target data.
In practical applications, during server shifts data automatically, developer can hand according to actual needs Dynamic control server stops transfer data, for example, that is, crash, card occurs in server in the system resource wretched insufficiency of server Pause in the case where waiting, developer can manually control server and stop transfer data.Specifically, developer can pass through touching The stopping transfer data options of the data transfer progress display interface of hair server stop transfer to trigger the preset mark that is used for The interrupt instruction of data.If server detects the stopping transfer data options of user's trigger data transfer progress display interface, It is then identified as detecting preset for identifying the interrupt instruction for stopping transfer data.
In the present embodiment, only developer's control server of just having the right with data base administration permission stops to survey Data are shifted in examination database.Therefore, server detect it is preset for identify stop shift data interrupt instruction when, Proof of identity is carried out to the user of triggering interrupt instruction, to detect whether the user of triggering interrupt instruction has data base administration power Limit.
In practical applications, the developer with data base administration permission usually has and can successfully log in for managing The user account of the application of test database.In the present embodiment, specifically, server is detecting preset interrupt instruction When, user can be requested to carry out account login, surveyed if user is successfully logged in by its pre-registered user account for managing The application for trying database is then identified as user with data base administration permission, that is, is identified as proof of identity and passes through, at this point, service Device stops shifting target data to be transferred.If user logs in the application for managing test database not successfully, it is identified as User does not have data base administration permission, that is, is identified as proof of identity and does not pass through, at this point, server continues to shift mesh to be transferred Mark data.
It should be noted that S1335 and S1336 is step arranged side by side, server selects an execution.
Above as can be seen that a kind of method of automatic transfer data provided in this embodiment is in the data that divert the aim automatically In the process, preset for identifying the middle severed finger for stopping transfer data if detecting that the user with data base administration permission triggers It enables, then stops the data that divert the aim, so that developer can manually control server according to actual needs stops transfer Target data.
Referring to Fig. 5, Fig. 5 is the tool of S13 in the method for the automatic transfer data of one kind that fifth embodiment of the invention provides Body implementation flow chart.Relative to the corresponding embodiment of Fig. 1, S13 in the method for the automatic transfer data of one kind provided in this embodiment S134~S135 is specifically included, details are as follows:
S134: it if detecting current time within the preset data transfer period, is identified as default trigger event and is touched Hair.
S135: the target data is transferred in test database by the business scenario mark based on the target data In corresponding test data table.
In the present embodiment, presetting the corresponding preset condition of trigger event can be set are as follows: current time is in preset number According in the transfer period.I.e. whether server real-time detection current time is within the preset data transfer period, if detecting current Time within the preset data transfer period, is then identified as default trigger event and is triggered, at this point, server is based on target data Business scenario mark, target data is transferred in customized test database in corresponding test data table.
In practical applications, the preset data transfer period can be arranged according to actual needs, at this time with no restrictions.Example Such as, the preset data transfer period can be daily 0:00~5:00.
So that as can be seen that a kind of method of automatic transfer data provided in this embodiment shifts the period in preset data Inside target data is transferred in test database from mirror image Production database automatically, without manually carry out data decimation and Transfer operation not only saves cost of labor, improves data transfer efficiency, and due to the raising of data transfer efficiency, thus It can guarantee for data to be transferred to be fully transferred in corresponding test database, ensure that the integrality of data to be transferred.
Fig. 6 show be a kind of server provided in an embodiment of the present invention structural block diagram, each unit which includes uses Each step in the corresponding embodiment of execution Fig. 1 to Fig. 5.Referring specifically to reality corresponding to Fig. 1 to Fig. 5 and Fig. 1 to Fig. 5 Apply the associated description in example.For ease of description, only the parts related to this embodiment are shown.Referring to Fig. 6, server 600 It include: the first receiving unit 61, communication unit 62 and data transfer unit 63.Wherein:
First receiving unit 61 is used to receive the data transfer instruction for shifting data automatically;The data transfer instruction Carry the business scenario mark of the application identities and the data to be transferred applied belonging to data to be transferred.
Communication unit 62 establishes connection for mirror image Production database associated with the application identities.
If data transfer unit 63 for detecting that default trigger event is triggered, is identified based on the business scenario, Target data to be transferred is obtained from the mirror image Production database, and is identified based on the business scenario of the target data, The target data is transferred in test database in corresponding test data table;The default trigger event is for describing certainly The opportunity of turn shifting data.
As an embodiment of the present invention, data transfer unit 63 may include the first determination unit, the first recognition unit and Automatic buanch unit.Wherein:
First determination unit is used to identify based on the business scenario, and determination is to be transferred from the mirror image Production database Target data, count the total amount of the target data, and be monitored to the storage duration of the target data.
If the first recognition unit is used to detect that the maximum value of the storage duration of the target data to be greater than preset duration threshold Value, and the total amount of the target data is greater than preset quantity threshold value, then is identified as default trigger event and is triggered.
The target data is transferred to survey for the business scenario mark based on the target data by automatic buanch unit It tries in database in corresponding test data table.
As an embodiment of the present invention, automatic buanch unit may include that the second determination unit, screening unit and order turn Move unit.Wherein:
Second determination unit for it is determining identify with the business scenario it is associated to the corresponding word to be verified of brake Section.
Screening unit for the value based on field to be verified described in target data described in each item to the target data into Row screening filters out the target data as test number from the identical target data of value of the field to be verified According to, and the different target data of the value of the field to be verified is identified as test data.
Order buanch unit is used for according to the descending sequence of the storage duration of the test data successively by the survey Examination data are transferred in test database in corresponding test data table.
As another embodiment of the present invention, automatic buanch unit can also include proof of identity unit, stop buanch unit And continue buanch unit.Wherein:
If proof of identity unit is preset for identifying stopping for detecting during shifting the target data The interrupt instruction of data is shifted, then proof of identity is carried out to the user for triggering the interrupt instruction.
If stopping buanch unit passing through for proof of identity, stop shifting the target data.
If continuing buanch unit not pass through for proof of identity, continue to shift the target data.
As another embodiment of the present invention, data transfer unit 63 can also include the second recognition unit.
If the second recognition unit is for detecting that current time within the preset data transfer period, is identified as default touching Hair event is triggered.
Automatic buanch unit is also used to the mark of the business scenario based on the target data, and the target data is transferred to In test database in corresponding test data table.
Above as can be seen that a kind of server provided in this embodiment is receiving the data for shifting data automatically turn When moving instruction, first mirror image Production database associated with the application identities that data transfer instruction carries establishes connection, passes through wound The default trigger event for describing to shift data opportunity automatically is built to shift when default trigger event is triggered based on data The business scenario mark that instruction carries, obtains target data to be transferred, and be based on target from mirror image Production database automatically The business scenario of data identifies, and target data is automatically transferred in test database in corresponding test data table, in this way, with Family only needs trigger data transfer instruction, and server can automatically shift data to be transferred from corresponding mirror image Production database Into test database, without manually carrying out data decimation and transfer operation, cost of labor is not only saved, number is improved According to transfer efficiency, and due to the raising of data transfer efficiency, so as to guarantee for data to be transferred to be fully transferred to accordingly In test database, the integrality of data to be transferred ensure that.
Fig. 7 be another embodiment of the present invention provides a kind of server structural block diagram.As shown in fig. 7, the embodiment Server 7 includes: processor 70, memory 71 and is stored in the memory 71 and can run on the processor 70 Computer program 72, such as automatic transfer data method program.Processor 70 executes real when the computer program 72 Step in each embodiment of method of existing above-mentioned each automatic transfer data, such as S11 shown in FIG. 1 to S13.Alternatively, described Processor 70 realizes the function of each unit in the corresponding embodiment of above-mentioned Fig. 6 when executing the computer program 72, for example, Fig. 6 Shown in the function of unit 61 to 63 do not repeated herein referring specifically to the associated description in the corresponding embodiment of Fig. 6.
Illustratively, the computer program 72 can be divided into one or more units, one or more of Unit is stored in the memory 71, and is executed by the processor 70, to complete the present invention.One or more of lists Member can be the series of computation machine program instruction section that can complete specific function, and the instruction segment is for describing the computer journey Implementation procedure of the sequence 72 in the server 7.For example, the computer program 72 can be divided into the first receiving unit, Communication unit and data transfer unit, each unit concrete function are as described above.
The server may include, but be not limited only to, processor 70, memory 71.It will be understood by those skilled in the art that Fig. 7 is only the example of server 7, does not constitute the restriction to server 7, may include than illustrating more or fewer portions Part perhaps combines certain components or different components, such as the server can also include input-output equipment, network Access device, bus etc..
Alleged processor 70 can be central processing unit (Central Processing Unit, CPU), can also be Other general processors, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field- Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic, Discrete hardware components etc..General processor can be microprocessor or the processor is also possible to any conventional processor Deng.
The memory 71 can be the internal storage unit of the server 7, such as the hard disk or memory of server 7. The memory 71 is also possible to the External memory equipment of the server 7, such as the plug-in type being equipped on the server 7 is hard Disk, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card, flash card (Flash Card) etc..Further, the memory 71 can also both include the internal storage unit of the server 7 or wrap Include External memory equipment.The memory 71 is for other programs needed for storing the computer program and the server And data.The memory 71 can be also used for temporarily storing the data that has exported or will export.
Embodiment described above is merely illustrative of the technical solution of the present invention, rather than its limitations;Although referring to aforementioned reality Applying example, invention is explained in detail, those skilled in the art should understand that: it still can be to aforementioned each Technical solution documented by embodiment is modified or equivalent replacement of some of the technical features;And these are modified Or replacement, the spirit and scope for technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution should all It is included within protection scope of the present invention.

Claims (10)

1. a kind of method of automatic transfer data characterized by comprising
Receive the data transfer instruction for shifting data automatically;The data transfer instruction carries application belonging to data to be transferred Application identities and the data to be transferred business scenario mark;
Mirror image Production database associated with the application identities establishes connection;
If detecting, default trigger event is triggered, and is identified based on the business scenario, from the mirror image Production database Target data to be transferred is obtained, and is identified based on the business scenario of the target data, the target data is transferred to survey It tries in database in corresponding test data table;The default trigger event is used to describe to shift the opportunity of data automatically.
2. the method for automatic transfer data according to claim 1, which is characterized in that if described detect default triggering thing Part is triggered, then is identified based on the business scenario, target data to be transferred is obtained from the mirror image Production database, and Business scenario mark based on the target data, is transferred to corresponding test data in test database for the target data In table, comprising:
It is identified based on the business scenario, the determining target data to be transferred from the mirror image Production database, described in statistics The total amount of target data, and the storage duration of the target data is monitored;
If detecting, the maximum value of the storage duration of the target data is greater than preset duration threshold value, and the target data is total Amount is greater than preset quantity threshold value, then is identified as default trigger event and is triggered;
Business scenario mark based on the target data, the target data is transferred in test database and is tested accordingly In tables of data.
3. the method for automatic transfer data according to claim 2, which is characterized in that described based on the target data The target data is transferred in test database in corresponding test data table by business scenario mark, comprising:
It is determining identify with the business scenario it is associated to the corresponding field to be verified of brake;
Value based on field to be verified described in target data described in each item screens the target data, from described to school It tests in the identical target data of value of field and filters out the target data as test data, and by the word to be verified The different target data of value of section is identified as test data;
The test data is successively transferred to test data according to the descending sequence of the storage duration of the test data In library in corresponding test data table.
4. the method for automatic transfer data according to claim 2, which is characterized in that described based on the target data The target data is transferred in test database in corresponding test data table by business scenario mark, comprising:
If detecting the preset interrupt instruction for shifting data for identifying stopping during shifting the target data, Proof of identity is carried out to the user for triggering the interrupt instruction;
If proof of identity passes through, stop shifting the target data;
If proof of identity does not pass through, continue to shift the target data.
5. the method for automatic transfer data according to claim 1, which is characterized in that if described detect default triggering thing Part is triggered, then is identified based on the business scenario, target data to be transferred is obtained from the mirror image Production database, and Business scenario mark based on the target data, is transferred to corresponding test data in test database for the target data In table, comprising:
If detecting current time within the preset data transfer period, it is identified as default trigger event and is triggered;
Business scenario mark based on the target data, the target data is transferred in test database and is tested accordingly In tables of data.
6. a kind of server, which is characterized in that the server includes memory, processor and stores in the memory And the computer program that can be run on the processor, the processor realize following step when executing the computer program It is rapid:
Receive the data transfer instruction for shifting data automatically;The data transfer instruction carries application belonging to data to be transferred Application identities and the data to be transferred business scenario mark;
Mirror image Production database associated with the application identities establishes connection;
If detecting, default trigger event is triggered, and is identified based on the business scenario, from the mirror image Production database Target data to be transferred is obtained, and is identified based on the business scenario of the target data, the target data is transferred to survey It tries in database in corresponding test data table;The default trigger event is used to describe to shift the opportunity of data automatically.
7. server according to claim 6, which is characterized in that if described detect that default trigger event is triggered, It is identified based on the business scenario, target data to be transferred is obtained from the mirror image Production database, and be based on the mesh The business scenario mark for marking data, the target data is transferred in test database in corresponding test data table, comprising:
It is identified based on the business scenario, the determining target data to be transferred from the mirror image Production database, described in statistics The total amount of target data, and the storage duration of the target data is monitored;
If detecting, the maximum value of the storage duration of the target data is greater than preset duration threshold value, and the target data is total Amount is greater than preset quantity threshold value, then is identified as default trigger event and is triggered;
Business scenario mark based on the target data, the target data is transferred in test database and is tested accordingly In tables of data.
8. server according to claim 7, which is characterized in that the business scenario mark based on the target data Know, the target data be transferred in test database in corresponding test data table, comprising:
It is determining identify with the business scenario it is associated to the corresponding field to be verified of brake;
Value based on field to be verified described in target data described in each item screens the target data, from described to school It tests in the identical target data of value of field and filters out the target data as test data, and by the word to be verified The different target data of value of section is identified as test data;
The test data is successively transferred to test data according to the descending sequence of the storage duration of the test data In library in corresponding test data table.
9. server according to claim 7, which is characterized in that the business scenario mark based on the target data Know, the target data be transferred in test database in corresponding test data table, comprising:
If detecting the preset interrupt instruction for shifting data for identifying stopping during shifting the target data, Proof of identity is carried out to the user for triggering the interrupt instruction;
If proof of identity passes through, stop shifting the target data;
If proof of identity does not pass through, continue to shift the target data.
10. a kind of computer readable storage medium, the computer-readable recording medium storage has computer program, and feature exists In when the computer program is executed by processor the step of any one of such as claim 1 to 5 of realization the method.
CN201810915354.7A 2018-08-13 2018-08-13 Method for automatically transferring data, server and computer readable storage medium Active CN109324959B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810915354.7A CN109324959B (en) 2018-08-13 2018-08-13 Method for automatically transferring data, server and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810915354.7A CN109324959B (en) 2018-08-13 2018-08-13 Method for automatically transferring data, server and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN109324959A true CN109324959A (en) 2019-02-12
CN109324959B CN109324959B (en) 2024-02-09

Family

ID=65263331

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810915354.7A Active CN109324959B (en) 2018-08-13 2018-08-13 Method for automatically transferring data, server and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN109324959B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110377586A (en) * 2019-07-04 2019-10-25 上海润吧信息技术有限公司 A kind of control method and data base management system of dependent data management
CN110457187A (en) * 2019-06-28 2019-11-15 武汉迎风聚智科技有限公司 Based on backup test data can convenient operation TPC-E test method and testing service device
CN111339105A (en) * 2020-03-27 2020-06-26 泰康保险集团股份有限公司 Data storage method and device and server
CN114461150A (en) * 2022-02-09 2022-05-10 马来西亚明试国际有限公司 Method, system and storage medium for automatic test equipment data aggregation

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1858730A (en) * 2005-05-06 2006-11-08 鸿富锦精密工业(深圳)有限公司 Data automatic transfer system and method
US20070156781A1 (en) * 2006-01-05 2007-07-05 Aditya Kapoor Detecting failover in a database mirroring environment
US20130173547A1 (en) * 2011-12-30 2013-07-04 Bmc Software, Inc. Systems and methods for migrating database data
US20150006476A1 (en) * 2013-06-26 2015-01-01 Sap Ag Upgrading and migrating a database
CN105359146A (en) * 2013-07-09 2016-02-24 甲骨文国际公司 Automated database migration architecture
CN106649117A (en) * 2016-12-27 2017-05-10 广州唯品会信息科技有限公司 Data providing method and system for software pressure test
CN107122135A (en) * 2017-04-25 2017-09-01 北京小米移动软件有限公司 Data processing method and device
CN107329890A (en) * 2017-06-06 2017-11-07 北京金山安全软件有限公司 Test method and device based on Mock and server
CN108363796A (en) * 2018-02-23 2018-08-03 北京网信云服信息科技有限公司 A kind of moving method and device of data

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1858730A (en) * 2005-05-06 2006-11-08 鸿富锦精密工业(深圳)有限公司 Data automatic transfer system and method
US20070156781A1 (en) * 2006-01-05 2007-07-05 Aditya Kapoor Detecting failover in a database mirroring environment
US20130173547A1 (en) * 2011-12-30 2013-07-04 Bmc Software, Inc. Systems and methods for migrating database data
US20150006476A1 (en) * 2013-06-26 2015-01-01 Sap Ag Upgrading and migrating a database
CN105359146A (en) * 2013-07-09 2016-02-24 甲骨文国际公司 Automated database migration architecture
CN106649117A (en) * 2016-12-27 2017-05-10 广州唯品会信息科技有限公司 Data providing method and system for software pressure test
CN107122135A (en) * 2017-04-25 2017-09-01 北京小米移动软件有限公司 Data processing method and device
CN107329890A (en) * 2017-06-06 2017-11-07 北京金山安全软件有限公司 Test method and device based on Mock and server
CN108363796A (en) * 2018-02-23 2018-08-03 北京网信云服信息科技有限公司 A kind of moving method and device of data

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
仇道霞 等: "烟草企业数据归档的研究", 山东社会科学, no. 1, pages 142 - 144 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110457187A (en) * 2019-06-28 2019-11-15 武汉迎风聚智科技有限公司 Based on backup test data can convenient operation TPC-E test method and testing service device
CN110377586A (en) * 2019-07-04 2019-10-25 上海润吧信息技术有限公司 A kind of control method and data base management system of dependent data management
CN111339105A (en) * 2020-03-27 2020-06-26 泰康保险集团股份有限公司 Data storage method and device and server
CN111339105B (en) * 2020-03-27 2023-08-15 泰康保险集团股份有限公司 Data storage method, device and server
CN114461150A (en) * 2022-02-09 2022-05-10 马来西亚明试国际有限公司 Method, system and storage medium for automatic test equipment data aggregation

Also Published As

Publication number Publication date
CN109324959B (en) 2024-02-09

Similar Documents

Publication Publication Date Title
CN109324959A (en) A kind of method, server and the computer readable storage medium of automatic transfer data
CN108595157B (en) Block chain data processing method, device, equipment and storage medium
CN110210227B (en) Risk detection method, device, equipment and storage medium
CN103401698B (en) For the monitoring system that server health is reported to the police in server set group operatione
CN107346272B (en) Method and device for determining dynamic heterogeneous redundant system
CN109634728A (en) Job scheduling method, device, terminal device and readable storage medium storing program for executing
CN107786616A (en) Main frame intelligent monitor system based on high in the clouds
WO2014143279A1 (en) Bottleneck detector for executing applications
CN109241709A (en) User behavior recognition method and device based on the verifying of sliding block identifying code
CN110390584A (en) A kind of recognition methods of abnormal user, identification device and readable storage medium storing program for executing
CN110457175B (en) Service data processing method and device, electronic equipment and medium
CN106453150B (en) Flow control method and device
CN109344611A (en) Access control method, terminal device and the medium of application
CN109460432A (en) A kind of data processing method and system
CN110471821A (en) Abnormal alteration detection method, server and computer readable storage medium
CN109495291B (en) Calling abnormity positioning method and device and server
CN113792341B (en) Automatic detection method, device, equipment and medium for privacy compliance of application program
CN106685894B (en) Risk identification method, device and system
CN106873957A (en) The processing method and equipment of a kind of operation flow
CN109271762A (en) User authen method and device based on sliding block identifying code
CN110414246A (en) Shared file method for managing security, device, terminal and storage medium
CN113949652B (en) User abnormal behavior detection method and device based on artificial intelligence and related equipment
CN106502887A (en) A kind of stability test method, test controller and system
CN110427259A (en) A kind of task processing method and device
CN109359034A (en) A kind of operation system test method, computer readable storage medium and terminal device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant