CN109284278A - Calculating logic moving method and terminal device based on data analysis technique - Google Patents
Calculating logic moving method and terminal device based on data analysis technique Download PDFInfo
- Publication number
- CN109284278A CN109284278A CN201810916413.2A CN201810916413A CN109284278A CN 109284278 A CN109284278 A CN 109284278A CN 201810916413 A CN201810916413 A CN 201810916413A CN 109284278 A CN109284278 A CN 109284278A
- Authority
- CN
- China
- Prior art keywords
- file
- result
- implementing result
- calling
- application project
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 98
- 238000007405 data analysis Methods 0.000 title claims abstract description 20
- 238000006243 chemical reaction Methods 0.000 claims abstract description 31
- 230000006870 function Effects 0.000 claims description 143
- 238000013508 migration Methods 0.000 claims description 31
- 230000005012 migration Effects 0.000 claims description 31
- 238000004590 computer program Methods 0.000 claims description 18
- 238000012545 processing Methods 0.000 abstract description 8
- 230000008569 process Effects 0.000 description 31
- 235000013399 edible fruits Nutrition 0.000 description 6
- 238000010586 diagram Methods 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 4
- 230000008859 change Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 238000000605 extraction Methods 0.000 description 3
- MROJXXOCABQVEF-UHFFFAOYSA-N Actarit Chemical compound CC(=O)NC1=CC=C(CC(O)=O)C=C1 MROJXXOCABQVEF-UHFFFAOYSA-N 0.000 description 2
- 206010033799 Paralysis Diseases 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 230000008878 coupling Effects 0.000 description 2
- 238000001514 detection method Methods 0.000 description 2
- 238000013316 zoning Methods 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000007796 conventional method Methods 0.000 description 1
- 230000010485 coping Effects 0.000 description 1
- 238000013075 data extraction Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000005611 electricity Effects 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
- 238000005192 partition Methods 0.000 description 1
- 230000000737 periodic effect Effects 0.000 description 1
- 238000000926 separation method Methods 0.000 description 1
- 238000004804 winding Methods 0.000 description 1
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The present invention is suitable for technical field of data processing, provide calculating logic moving method, terminal device and computer readable storage medium based on data analysis technique, it include: the calling file obtained in application project, the calling file is for being performed to realize business function;Database relevant to the application project is connected, and executes the calling file, obtains the first implementing result;The calling file is converted according to preset conversion module, obtains migrated file, and obtains the second implementing result obtained by executing the migrated file;If first implementing result is identical as second implementing result, the migrated file is added to the application project.The present invention is based on data analysis techniques, and the calculating logic of business function in application project is moved to the level of upper-level system from database tier, realizes Interval data, improve the realization efficiency of business function.
Description
Technical field
The invention belongs to technical field of data processing, more particularly to the calculating logic migration side based on data analysis technique
Method, terminal device and computer readable storage medium.
Background technique
Database is the warehouse for coming tissue, storage and management data according to data structure, due to the memory capacity of database
Greatly, and stability is high, therefore in actual business scenario, the relevant data of business are usually pre-deposited into database, and pass through tune
Specific business function is realized with the data in database.
But in the business scopes such as insurance business or banking, when realizing business function by application project, meter
It calculates logic to place one's entire reliance upon database, i.e. the calling data and process for calculating data is carried out in data store internal completely,
When calculating multiple data at the same time, process performance bottleneck easy to form, and single business function will lead to database extremely
Upper-level system paralysis.To sum up, the realization of business function is excessively high to the degree of dependence of database in the prior art, realizes efficiency limitation
In the treatment effeciency of database, and poor fault tolerance.
Summary of the invention
In view of this, the embodiment of the invention provides the calculating logic moving method based on data analysis technique, terminals to set
Standby and computer readable storage medium depends on database unduly to solve the realization of business function in the prior art, realizes effect
There is the upper limit in rate.
The first aspect of the embodiment of the present invention provides a kind of calculating logic moving method based on data analysis technique, packet
It includes:
The calling file in application project is obtained, the calling file is for being performed to realize business function;
Database relevant to the application project is connected, and executes the calling file, obtains the first implementing result;
The calling file is converted according to preset conversion module, obtains migrated file, and obtain and pass through execution
The second implementing result that the migrated file obtains;
If first implementing result is identical as second implementing result, the migrated file is added to described answer
Use engineering.
The second aspect of the embodiment of the present invention provides a kind of terminal device, and the terminal device includes memory, processing
Device and storage in the memory and the computer program that can run on the processor, described in the processor execution
Following steps are realized when computer program:
The calling file in application project is obtained, the calling file is for being performed to realize business function;
Database relevant to the application project is connected, and executes the calling file, obtains the first implementing result;
The calling file is converted according to preset conversion module, obtains migrated file, and obtain and pass through execution
The second implementing result that the migrated file obtains;
If first implementing result is identical as second implementing result, the migrated file is added to described answer
Use engineering.
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:
The calling file in application project is obtained, the calling file is for being performed to realize business function;
Database relevant to the application project is connected, and executes the calling file, obtains the first implementing result;
The calling file is converted according to preset conversion module, obtains migrated file, and obtain and pass through execution
The second implementing result that the migrated file obtains;
If first implementing result is identical as second implementing result, the migrated file is added to described answer
Use engineering.
Existing beneficial effect is the embodiment of the present invention compared with prior art:
The embodiment of the present invention determines calling file relevant to business function in application project first, and business function is to pass through
Data in database are called and are calculated, by executing available first implementing result of the calling file,
Then according to preset conversion module by call file be converted to migrated file, in migrated file, to data in database into
The process that row calculates is migrated in upper-level system, by executing available second implementing result of the migrated file, if the
One implementing result is identical with the second implementing result, then proves that file and migrated file is called to can be realized identical business function,
Then migrated file is added in application project, calculating logic is moved to upper-level system by the embodiment of the present invention, reduces business
Function reduces the probability of occurrence of performance bottleneck to the degree of dependence of database, effectively improves the realization efficiency of business function.
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 process for the calculating logic moving method based on data analysis technique that the embodiment of the present invention one provides
Figure;
Fig. 2 is the implementation process of the calculating logic moving method provided by Embodiment 2 of the present invention based on data analysis technique
Figure;
Fig. 3 is the implementation process for the calculating logic moving method based on data analysis technique that the embodiment of the present invention three provides
Figure;
Fig. 4 is the implementation process for the calculating logic moving method based on data analysis technique that the embodiment of the present invention four provides
Figure;
Fig. 5 is the implementation process for the calculating logic moving method based on data analysis technique that the embodiment of the present invention five provides
Figure;
Fig. 6 is the structural block diagram for the terminal device that the embodiment of the present invention six provides;
Fig. 7 is the schematic diagram for the terminal device that the embodiment of the present invention seven provides.
Specific embodiment
In being described below, for illustration and not for limitation, the tool of such as particular system structure, technology etc is proposed
Body details, to understand thoroughly the embodiment of the present invention.However, it will be clear to one skilled in the art that there is no these specific
The present invention also may be implemented in the other embodiments of details.In other situations, it omits to well-known system, device, electricity
The detailed description of road and method, in case unnecessary details interferes description of the invention.
In order to illustrate technical solutions according to the invention, the following is a description of specific embodiments.
Fig. 1 shows the realization stream of the calculating logic moving method provided in an embodiment of the present invention based on data analysis technique
Journey, details are as follows:
In S101, the calling file in application project is obtained, the calling file is for being performed to realize business function
Energy.
Application project is related to business, is the general designation of all bottom codes of process on the line of realization business, for convenience
Manage and check, the bottom code general set of application project is that code file is stored, therefore application project generally comprise it is more
A code file.In the present embodiment, file is called to refer to the code file in application project for realizing business function, specifically
Ground, which calculates the data of calling for calling data from database, to realize business function.
In conventional methods where, it calls file to realize that the process of business function carries out all in database tier by executing, leads to business
Function is excessively high for the degree of dependence of database, realizes that efficiency is easy to be influenced by database performance bottleneck, and in data
When a certain link error calculated, database is easily caused to paralyse.Therefore in embodiments of the present invention, it is first determined and obtain using work
Calling file in journey, then the calculating logic in calling file is migrated.Usually, call file that there is specified text
Part format, file format is different and different according to the scene of application project, and for the ease of being illustrated, the embodiment of the present invention is to adjust
It is that the script file that structured query language (Structured Query Language, SQL) sentence is constituted is said with file
Bright, i.e. calling file contains the SQL statement for being called and calculating to data, and calls the file suffixes of file to be
".sql".When obtaining the calling file in application project, search all code file in application project, and by with it is specified
File format is consistent, and (file suffixes is used as the code file of " .sql ") and calls file.
Optionally, the code file in application project is identified, and the code file for containing Function Identification is literary as calling
Part.In embodiments of the present invention, Function Identification uniformly can be established to the code file for realizing business function in advance, and obtained
When taking calling file, the code file of Function Identification will be contained as calling file, wherein Function Identification can establish in code
In the file name of file or the code of code file.For example, original for realizing the code file of business function
File name is " Code.sql ", and the file name after Function Identification is established to it is that " Id_Code.sql " (i.e. Function Identification is
" Id_ "), when searching calling file, only i.e. using the corresponding code file of the file name for containing " Id_ " as calling file
Can, improve the accuracy for determining and calling file.Further, since the business function that application project is realized is there may be multiple, therefore
Multiple business functions can be directed to, multiple code files corresponding to multiple business functions preset different Function Identifications, than
It is such as " IdA_ " to business function A corresponding code file setting Function Identification, the corresponding code file of business function B is arranged
Function Identification is " IdB_ ", after being provided with, to carry out calculating logic migration to specified business function, then in this step
Determine code file corresponding with the Function Identification of the specified business function, and using the code file as calling file.
In S102, database relevant to the application project is connected, and execute the calling file, obtain first and hold
Row result.
It is to realize business function, then relevant to application project firstly the need of connecting if the data in database to be called
Database.In the present embodiment, (Java DataBase Connectivity, JDBC) technical battery is connected by java database
Database is connect, using database as oracle database, and is illustrated using Oralce thin mode connection oracle database, it is first
First obtain user name, password, database connection string and the registration driving of oracle database, the user of above-mentioned oracle database
Name, password, database connection string and registration driving can be stored in advance in application project or specific storage address.Assuming that
The database connection string of oracle database is " jdbc:oracle:thin:@192.168.1.1:1521:ORCL ", wherein
ORCL is the title of oracle database, and registration is driven to " oracle.jdbc.driver.OracleDriver ", above-mentioned number
String is connected according to library and example is only made in registration driving, does not constitute restriction.After the completion of acquisition, the registration driving of oracle database is added
It is downloaded in the driven management program of JDBC, and by the connection method (getConnectin) in the driven management program of JDBC, leads to
Series winding, which is connected, after user name, password and the database obtained connects oracle database.Certainly, the mistake of above-mentioned connection database
Journey can be integrated into code file with code form, and be added in application project.After successfully connecting database, execution is answered
With the calling file in engineering, data are called from database, and exchanges the data used and is calculated, and obtain the first execution knot
Fruit.For example, if business function is to calculate national average traffic, in the implementation procedure for calling file, first from data
The portfolio in each province in the whole nation is called in library, then mean value is measured to the business in all provinces and obtains national average traffic.
In S103, the calling file is converted according to preset conversion module, obtains migrated file, and obtain
The second implementing result obtained by executing the migrated file.
By executing the process for calling file to realize business function all in database tier, since database is to data
Processing capacity is limited, if data to be calculated are more, it is easy to and forming properties bottleneck causes computational efficiency low, therefore in this hair
In bright embodiment, the calculating logic in file will be called to move to (java layers of level of upper-level system from database tier
Grade), with specific reference to preset conversion module to calling file to convert, obtain migrated file.Conversion module is preset with multiple
The corresponding migration sentence of relevant to data calculating SQL statement (migration sentence is java sentence).Calling file is converted
Process, be that the SQL statement relevant to data calculating in file will be called to replace with corresponding migration in conversion module actually
The process of sentence.It is noted that migrated file is formal general designation, the migrated file converted out generally comprises two portions
Point, first part is the migration sentence for executing data calculating operation in application project, which is by turning
Change the mold plate conversion generate, another part be for from database call data extraction sentence, the extraction sentence with
It calls in file for calling the sentence of data identical, says, can be converted to calling in file in addition to being performed from constructive ways
SQL statement except SQL statement replicated, generate the extraction sentence.
After migrated file generates, migrated file is temporarily added in application project, and executes migrated file to obtain
To the second implementing result.It is to calculate national average traffic for example, according to conversion module pair with above-mentioned business function
After calling file to be converted, the extraction sentence in the migrated file of generation executes in database tier, in implementation procedure
In, the portfolio in each province in the whole nation is transferred from database;Migration sentence in migrated file is held in the level of upper-level system
Row carries out mean value computation to the portfolio in all provinces in the whole nation and obtains national average traffic in the process of implementation.
In S104, if first implementing result is identical as second implementing result, the migrated file is added
Add to the application project.
After executing migrated file, the first implementing result is compared with the second implementing result, if the first implementing result
It is not identical as the second implementing result, then it proves that migrated file fails to reach effect same as original calling file, then will move
Text move part is removed from application project, and the log in exportable migrated file implementation procedure, convenient for user to implementation procedure into
Row is checked;If the first implementing result is identical as the second implementing result, it was demonstrated that migrated file is identical as the effect for calling file to reach,
It then keeps migrated file to be located at the state in application project, is that migrated file is permanently added to application project.
Optionally, it after migrated file is permanently added to application project, deletes and calls file.Due to migrated file and tune
Business function can be all realized with file, therefore can be removed in application project after being permanently added to migrated file in application project
Original calling file promotes the portability of application project to reduce capacity shared by application project.
By embodiment illustrated in fig. 1 it is found that in embodiments of the present invention, by obtaining in application project for realizing business
The calling file of function, and the calling file is executed, the first implementing result is obtained, it is literary to calling further according to preset conversion module
Part carries out being converted to migrated file, and executes the migrated file, obtains the second implementing result, finally by the first implementing result with
Second implementing result is compared, if the first implementing result is identical as the second implementing result, migrated file is added to application
Engineering, the embodiment of the present invention will realize that the calculating logic of business function moves to upper-level system from database tier in application project
Level improve the realization efficiency of business function so that business function reduces the degree of dependence of database.
It shown in Fig. 2, is carried out to according to preset conversion module to calling file on the basis of the embodiment of the present invention one
Conversion, obtain migrated file process refined after a kind of obtained implementation method.The embodiment of the invention provides based on number
According to the implementation flow chart of the calculating logic moving method of analytical technology, patrolled as shown in Fig. 2, being somebody's turn to do the calculating based on data analysis technique
Collecting moving method may comprise steps of:
In S201, identify it is described call file in computing statement, the computing statement include data name to be calculated and
Function is calculated, the data name to be calculated is the title for the database data that the computing statement is performed calling.
When to calling file to convert, the call statement and computing statement called in file are identified first, wherein
Call statement, which refers to call, is only used for calling database data or the relatively simple SQL statement of calculating process in file, calculate
Sentence, which refers to, calls the more complicated SQL statement of calculating process in file.In embodiments of the present invention, identifying call sentence and meter
Calculate sentence method include it is a variety of, first method therein be pre-establish belong to call statement function name and belong to calculating
The function name of sentence, for example the entitled AVG function of function and DATEDIFF function for belonging to computing statement are pre-established, then pass through
Function name comes identifying call sentence and computing statement;Second method is to obtain output in the operational process of application project
Running log, and determine that the sentence for calling every SQL statement of file executes duration from running log, and when sentence is executed
The long SQL statement for being greater than or equal to preset threshold executes the SQL statement that duration is less than preset threshold as computing statement, by sentence
As call statement.After determining computing statement, extracts the data name to be calculated in computing statement and calculate function, it is to be calculated
Variable name in the entitled computing statement of data calculates the function name that function is computing statement.It is noted that above-mentioned tune
The restriction to its purposes is not constituted with the name of sentence and computing statement, for example call statement and computing statement may be used to
It calls data and calculates data, the specific division of two kinds of sentences can be determined according to practical application scene, but should be known, be counted
It calculates sentence and is partial to the more complicated sentence of calculating process in application project.
In S202, the calculating function is converted into migration sentence by the conversion module, by the number to be calculated
It is added to the migration sentence according to name, and generates the migrated file comprising the migration sentence after the completion of addition.
In embodiments of the present invention, include in conversion module with multiple function names multiple migration sentences correspondingly,
After determining the calculating function in computing statement, by calculate function be input to conversion module, and obtain conversion module output with
Calculate the corresponding migration sentence of function.Then, using data name to be calculated as the change in migration sentence corresponding with function is calculated
Data name to be calculated is added to the migration sentence by amount, and the migration sentence that addition is completed is placed in a new files, and
Sentence (duplication for calling the call statement in file) will be extracted and be equally placed in the new files, the new files eventually formed are i.e.
For migrated file.
By embodiment illustrated in fig. 2 it is found that in embodiments of the present invention, by the computing statement in identifying call file,
The computing statement includes data name to be calculated and calculates function, and data name to be calculated is the data that computing statement is performed calling
Then the title of library data will calculate function by conversion module and be converted to migration sentence, and data name to be calculated is added to
Sentence is migrated, using migration sentence as a part of migrated file, generates migrated file, the embodiment of the present invention is according to function name
Sentence conversion is carried out, the accuracy of sentence conversion is improved.
Shown in Fig. 3, it is on the basis of the embodiment of the present invention one, and includes the basis of multiple subfunctions in business function
On, if pair the first implementing result is identical as the second implementing result, the process that migrated file is added to application project is carried out thin
A kind of implementation method obtained after change.The embodiment of the invention provides the calculating logic moving methods based on data analysis technique
Implementation flow chart, as shown in figure 3, being somebody's turn to do the calculating logic moving method based on data analysis technique may comprise steps of:
In S301, obtains in first implementing result and tied with one-to-one multiple first sons of the multiple subfunction
Fruit, and obtain in second implementing result with one-to-one multiple second sons of the multiple subfunction as a result, by described more
A first sub- result is compared one by one with the multiple second sub- result.
Direction due to business now progressively towards complication is developed, therefore business function may include multiple subfunctions,
For example multiple subfunctions are followed successively by function FunctionA, function FunctionBWith function FunctionC, function FunctionAFor
The average traffic of zoning A, function FunctionBFor the average traffic of zoning B, function FunctionCTo calculate
The average traffic of region C.After executing the calling file in application project, the first implementing result is obtained, is implemented in the present invention
In example, in the first implementing result for acquiring with the one-to-one multiple first sub- results of multiple subfunctions.It is corresponding,
After migrated file generation, application project is added to by migrated file is temporary, and execute the migrated file in application project, obtained
To the second implementing result, obtain in the second implementing result with the one-to-one multiple second sub- results of multiple subfunctions.It is obtaining
To the multiple first sub- results with multiple second sons as a result, the multiple first sub- results and the multiple second sub- results are compared one by one
It is right.
In S302, if the result that the multiple first sub- result and the multiple second sub- result are compared one by one
It is all successfully, then the migrated file to be added to the application project.
In embodiments of the present invention, the knot for being compared the multiple first sub- results and the multiple second sub- results one by one is checked
Fruit.For example, if multiple first sub- results are the first sub- result ResultA1, the first sub- result ResultB1With the first son knot
Fruit ResultC1, respectively correspond function FunctionA, function FunctionBWith function FunctionC, multiple second sub- results are
Second sub- result ResultA2, the second sub- result ResultB2With the second sub- result ResultC2, respectively correspond function
FunctionA, function FunctionBWith function FunctionC, then by the first sub- result ResultA1With the second sub- result
ResultA2It is compared, by the first sub- result ResultB1With the second sub- result ResultB2It is compared, by the first sub- result
ResultC1With the second sub- result ResultC2It is compared, and checks the result of each group of comparison.If multiple first sub- results
The result compared one by one with the multiple second sub- results is all success, then is permanently added to migrated file in application project.
Optionally, if calling file there are multiple, multiple subfunctions are respectively corresponded, then it is corresponding individually to calculate each subfunction
The first sub- result and second son as a result, and the first sub- result and the second sub- result are compared, obtain comparison result, if
The corresponding comparison result of multiple subfunctions is all success, then migrated file is permanently added to application project.If calling file
There are multiple, for example including calling file A, calling file B and calling file C, respectively correspond function FunctionA, function
FunctionBWith function FunctionC, also include migrated file A, migrated file B and move with the corresponding migrated file of file is called
Text move part C then in embodiments of the present invention in order to check the case where different subfunctions are implemented separately, individually calculates every sub- function
The corresponding first sub- result of energy and the second sub- result, for example, function Function is individually performedACorresponding calling file A,
Obtain the first sub- result ResultA1, and function Function is individually performedACorresponding migrated file A obtains the second sub- result
ResultA2, finally by the first sub- result ResultA1With the second sub- result ResultA2It is compared, obtains comparison result A;It is single
Solely execute function FunctionBCorresponding calling file B obtains the first sub- result ResultB1, and migrated file B is individually performed,
Obtain the second sub- result ResultB2, finally by the first sub- result ResultB1With the second sub- result ResultB2It is compared, obtains
To comparison result B ....When the corresponding comparison result of multiple subfunctions is all successfully, just migrated file is permanently added to and is answered
Use engineering.
Optionally, if calling file there are multiple, multiple subfunctions are respectively corresponded, then individually calculate specified subfunction group
Close corresponding first sub- result and second son as a result, and the first sub- result and the second sub- result are compared, obtain compare knot
Fruit, if it is successfully, migrated file to be permanently added to application project that specified subfunction, which combines corresponding comparison result,.?
Practical application scene, the database data that there is a situation where that different subfunctions is called is identical, therefore in the aforementioned side being compared
On the basis of method, can also corresponding first sub- result be combined to specified subfunction and the second sub- result is compared, if compared
Success, then be permanently added to application project for migrated file.For example, multiple subfunction combinations include function FunctionA+
Function FunctionB, function FunctionA+ function FunctionC, function FunctionB+ function FunctionCAnd function
FunctionA+ function FunctionB+ function FunctionC, specified subfunction group is combined into function FunctionA+ function
FunctionB, then in calculating process, it is performed simultaneously function Function firstACorresponding calling file A and function
FunctionBCorresponding calling file B obtains the first son as a result, being then performed simultaneously function FunctionACorresponding migration text
Part A and function FunctionBCorresponding migrated file B obtains the second son as a result, the first sub- result and the second sub- result are carried out
It compares, obtains comparison result.When the comparison result that specified subfunction combines is successfully, migrated file is permanently added to and is answered
With engineering, wherein specified subfunction combination can be one or more of multiple subfunctions combination, according to practical application field
Scape determines.
By embodiment illustrated in fig. 3 it is found that in embodiments of the present invention, including the case where multiple subfunctions in business function
Under, it obtains in the first implementing result with one-to-one multiple first sons of multiple subfunctions as a result, and obtaining the second implementing result
In with one-to-one multiple second sons of multiple subfunctions as a result, will the multiple first sub- results and the multiple second sub- results progress one
One compares, if comparison result is all success, migrated file is permanently added to application project, the embodiment of the present invention is for multiple
Subfunction is compared one by one, is improved to there are the applicabilities of the scene of multiple subfunctions.
It is on the basis of the embodiment of the present invention one, if pair the first implementing result and the second implementing result phase shown in Fig. 4
Together, then a kind of implementation method obtained after being refined the process that migrated file is added to application project.The embodiment of the present invention
The implementation flow chart of the calculating logic moving method based on data analysis technique is provided, as shown in figure 4, should analyze based on data
The calculating logic moving method of technology may comprise steps of:
In S401, acquire first implementing result first executes duration, and acquires described second and hold
The second of row result executes duration.
Since in business scenario, the realization efficiency of business function is usually the duration for being embodied in realization process and being consumed, therefore
In embodiments of the present invention, the process for obtaining the first implementing result to the calling file executed in application project carries out timing, obtains
To first execute duration, and by migrated file it is temporary be added to application project after, to execute application project in migration text
The process that part obtains the second implementing result carries out timing, obtains the second execution duration.
In S402, if described first executes duration more than or equal to the second execution duration, and described first is executed
As a result identical as second implementing result, then the migrated file is added to the application project.
On the basis of the first implementing result is identical with the second implementing result, duration is executed to first and executes duration with second
It is compared, if first executes duration greater than the second execution duration, proves that the execution efficiency of migrated file is higher than and call file,
Then migrated file is permanently added in application project;If first, which executes duration, is equal to the second execution duration, migration text is proved
The execution efficiency of part is identical as file is called, but when being located at the level of upper-level system due to calculating logic, can support bigger number
The data of magnitude are handled, strong applicability, thus will migrated file be permanently added in application project;If first executes duration
Duration is executed less than second, then migrated file is deleted in application project.It is noted that migrated file is permanently added
To application project, original calling file can be deleted to save capacity.
By embodiment illustrated in fig. 4 it is found that in embodiments of the present invention, obtaining to execute and file being called to obtain the first execution knot
The first of fruit executes duration, and obtains execution migrated file and obtain the second execution duration of the second implementing result, and first is held
Row duration is compared with the second execution duration, if first executes duration more than or equal to the second execution duration, and first holds
Row result is equal to the second implementing result, then migrated file is permanently added to application project, and the embodiment of the present invention is literary according to calling
The execution duration of part and migrated file prevents the realization of business function from imitating to determine whether migrated file is added to application project
Rate reduces.
Shown in Fig. 5, be on the basis of the embodiment of the present invention one, it is right after migrated file is added to application project
A kind of implementation method that original process for calling file to be operated obtains after being refined in application project.The present invention is implemented
Example provides the implementation flow chart of the calculating logic moving method based on data analysis technique, as shown in figure 5, should be based on data point
The calculating logic moving method of analysis technology may comprise steps of:
In S501, the calling file is disabled.
In embodiments of the present invention, after migrated file being permanently added to application project, due in subsequent application project
In normal course of operation, it need to only execute migrated file and realize business function, therefore calling file original in application project is executed
Disable operation.Wherein, disable operation, which can be, will call file to store to Cloud Server, and removes from application project and call text
Part is also possible to not remove calling file, but executes permission to the calling file setting in application project, and normally transporting
Under row mode, forbids executing and call file.
In S502, when the business function for detecting the application project realizes failure, the tune is reactivated
Use file.
After completing the disabling to calling file, application project of the operation comprising migrated file, and periodic detection business function
Whether realize, it specifically can be by the implementing result that the migrated file in detection execution application project obtains whether in preset value
In range, if business function is realized successfully in value range;If business function is realized not in value range
Failure.If detecting, at some moment, business function realizes failure, then application project out of service, and in application project
Calling file is reactivated, the operation reactivated is corresponding with disable operation, if disable operation is that file will be called to store
It to Cloud Server, is then downloaded in this step from Cloud Server and calls file, and file will be called to be added to application project;If
Disable operation is the then execution permission of open call file in this step to calling file setting to execute permission.It is worth mentioning
, while reactivating calling file, disable operation is executed to migrated file.
It should be understood that the size of the serial number of each step is not meant that the order of the execution order in above-described embodiment, each process
Execution sequence should be determined by its function and internal logic, the implementation process without coping with the embodiment of the present invention constitutes any limit
It is fixed.
Fig. 6 shows the structural block diagram of terminal device provided in an embodiment of the present invention, each unit which includes
For executing each step in the corresponding embodiment of Fig. 1.It is retouched referring specifically to Fig. 1 is related in embodiment corresponding to Fig. 1
It states.For ease of description, only the parts related to this embodiment are shown.
Referring to Fig. 6, the terminal device includes:
Acquiring unit 61, for obtaining the calling file in application project, the calling file is for being performed to realize
Business function;
Execution unit 62 for connecting database relevant to the application project, and executes the calling file, obtains
First implementing result;
Converting unit 63 obtains migrated file for converting according to preset conversion module to the calling file,
And obtain the second implementing result obtained by executing the migrated file;
Adding unit 64, if identical as second implementing result for first implementing result, by the migration
File is added to the application project.
Optionally, the converting unit 63, comprising:
Recognition unit, for identification it is described call file in computing statement, the computing statement includes data to be calculated
Name and calculating function, the data name to be calculated is the title for the database data that the computing statement is performed calling;
Conversion subunit, for the calculating function to be converted to migration sentence by the conversion module, will it is described to
It calculates data name and is added to the migration sentence, and generate the migration text comprising the migration sentence after the completion of addition
Part.
Optionally, the business function includes multiple subfunctions, the adding unit 64, comprising:
Comparing unit, for obtain in first implementing result with the multiple subfunction one-to-one multiple first
Son is as a result, and obtain in second implementing result with one-to-one multiple second sons of the multiple subfunction as a result, by institute
The multiple first sub- results are stated to be compared one by one with the multiple second sub- result;
First adding unit, if for being compared the multiple first sub- result and the multiple second sub- result one by one
Pair result be successfully, then the migrated file to be added to the application project.
Optionally, the adding unit 64, comprising:
Duration acquiring unit, first for acquiring first implementing result executes duration, and acquires institute
State the second implementing result second executes duration;
Second adding unit executes duration if executing duration for described first and being greater than or equal to described second, and described
First implementing result is identical as second implementing result, then the migrated file is added to the application project.
Optionally, the adding unit 64, further includes:
Forbidden cell, for disabling the calling file;
Unit is enabled, for reactivating institute when the business function for detecting the application project realizes failure
State calling file.
Therefore, terminal device provided in an embodiment of the present invention is by will realize the calculating logic of business function in application project
The level that upper-level system has been moved to from database tier improves the realization efficiency of business function.
Fig. 7 is the schematic diagram of terminal device provided in an embodiment of the present invention.As shown in fig. 7, the terminal device 7 of the embodiment
Include: processor 70, memory 71 and is stored in the calculating that can be run in the memory 71 and on the processor 70
Machine program 72.The processor 70 realizes above-mentioned each calculating based on data analysis technique when executing the computer program 72
Step in logic moving method embodiment, such as step S101 to S104 shown in FIG. 1.Alternatively, the processor 70 executes
Realize the function of each unit in above-mentioned each terminal device embodiment when the computer program 72, for example, unit 61 shown in Fig. 6 to
64 function.
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 terminal device 7.For example, the computer program 72 can be divided into acquiring unit, hold
Row unit, converting unit and adding unit, each unit concrete function are as follows:
Acquiring unit, for obtaining the calling file in application project, the calling file is for being performed to realize industry
Business function;
Execution unit for connecting relevant to application project database, and executes the calling file, obtains the
One implementing result;
Converting unit obtains migrated file for converting according to preset conversion module to the calling file, and
Obtain the second implementing result obtained by executing the migrated file;
Adding unit, if identical as second implementing result for first implementing result, by the migration text
Part is added to the application project.
The terminal device 7 can be the calculating such as desktop PC, notebook, palm PC and cloud server and set
It is standby.The terminal device 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
The only example of terminal device 7 does not constitute the restriction to terminal device 7, may include than illustrating more or fewer portions
Part perhaps combines certain components or different components, such as the terminal device can also include input-output equipment, net
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 terminal device 7, such as the hard disk or interior of terminal device 7
It deposits.The memory 71 is also possible to the External memory equipment of the terminal device 7, such as be equipped on the terminal device 7
Plug-in type hard disk, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card dodge
Deposit card (Flash Card) etc..Further, the memory 71 can also both include the storage inside list of the terminal device 7
Member also includes External memory equipment.The memory 71 is for storing needed for the computer program and the terminal device
Other programs and data.The memory 71 can be also used for temporarily storing the data that has exported or will export.
It is apparent to those skilled in the art that for convenience of description and succinctly, only with above-mentioned each function
Can unit division progress for example, in practical application, can according to need and by above-mentioned function distribution by different functions
Unit is completed, i.e., the internal structure of the terminal device is divided into different functional units, to complete whole described above
Or partial function.Each functional unit in embodiment can integrate in one processing unit, be also possible to each unit list
It is solely physically present, can also be integrated in one unit with two or more units, above-mentioned integrated unit can both use
Formal implementation of hardware can also be realized in the form of software functional units.In addition, the specific name of each functional unit also only
It is the protection scope that is not intended to limit this application for the ease of mutually distinguishing.The specific work process of unit in above system,
It can refer to corresponding processes in the foregoing method embodiment, details are not described herein.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, is not described in detail or remembers in some embodiment
The part of load may refer to the associated description of other embodiments.
Those of ordinary skill in the art may be aware that list described in conjunction with the examples disclosed in the embodiments of the present disclosure
Member and algorithm steps can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually
It is implemented in hardware or software, the specific application and design constraint depending on technical solution.Professional technician
Each specific application can be used different methods to achieve the described function, but this realization is it is not considered that exceed
The scope of the present invention.
In embodiment provided by the present invention, it should be understood that disclosed terminal device and method can pass through it
Its mode is realized.For example, terminal device embodiment described above is only schematical, for example, the unit is drawn
Point, only a kind of logical function partition, there may be another division manner in actual implementation, such as multiple units or components can
To combine or be desirably integrated into another system, or some features can be ignored or not executed.Another point, it is shown or beg for
The mutual coupling or direct-coupling or communication connection of opinion can be through some interfaces, the INDIRECT COUPLING of device or unit
Or communication connection, it can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit
The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple
In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme
's.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit
It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list
Member both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated unit is realized in the form of SFU software functional unit and sells or use as independent product
When, it can store in a computer readable storage medium.Based on this understanding, the present invention realizes above-described embodiment side
All or part of the process in method can also instruct relevant hardware to complete, the computer by computer program
Program can be stored in a computer readable storage medium, and the computer program is when being executed by processor, it can be achieved that above-mentioned each
The step of a embodiment of the method.Wherein, the computer program includes computer program code, and the computer program code can
Think source code form, object identification code form, executable file or certain intermediate forms etc..The computer-readable medium can be with
It include: any entity or device, recording medium, USB flash disk, mobile hard disk, magnetic disk, light that can carry the computer program code
Disk, computer storage, read-only memory (Read-Only Memory, ROM), random access memory (Random Access
Memory, RAM), electric carrier signal, telecommunication signal and software distribution medium etc..It should be noted that described computer-readable
The content that medium includes can carry out increase and decrease appropriate according to the requirement made laws in jurisdiction with patent practice, such as at certain
A little jurisdictions do not include electric carrier signal and telecommunication signal according to legislation and patent practice, computer-readable medium.
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 calculating logic moving method based on data analysis technique characterized by comprising
The calling file in application project is obtained, the calling file is for being performed to realize business function;
Database relevant to the application project is connected, and executes the calling file, obtains the first implementing result;
The calling file is converted according to preset conversion module, obtains migrated file, and obtain by described in execution
The second implementing result that migrated file obtains;
If first implementing result is identical as second implementing result, the migrated file is added to described using work
Journey.
2. calculating logic moving method as described in claim 1, which is characterized in that it is described according to preset conversion module to institute
It states and file is called to be converted, obtain migrated file, comprising:
Identify the computing statement in the calling file, the computing statement includes data name to be calculated and calculates function, described
The entitled computing statement of data to be calculated is performed the title of the database data of calling;
The calculating function is converted into migration sentence by the conversion module, the data name to be calculated is added to described
Sentence is migrated, and generates the migrated file comprising the migration sentence after the completion of addition.
3. calculating logic moving method as described in claim 1, which is characterized in that the business function includes multiple sub- function
Can, if first implementing result is identical as second implementing result, the migrated file is added to described answer
With engineering, comprising:
It obtains in first implementing result with one-to-one multiple first sons of the multiple subfunction as a result, and described in acquisition
In second implementing result with one-to-one multiple second sons of the multiple subfunction as a result, will the multiple first sub- result and
The multiple second sub- result is compared one by one;
It, will if the result that the multiple first sub- result and the multiple second sub- result are compared one by one is all success
The migrated file is added to the application project.
4. calculating logic moving method as described in claim 1, which is characterized in that if first implementing result and institute
It is identical to state the second implementing result, then the migrated file is added to the application project, comprising:
Acquire first implementing result first executes duration, and acquires the second of second implementing result and hold
Row duration;
If described first, which executes duration, is greater than or equal to the second execution duration, and first implementing result and described second
Implementing result is identical, then the migrated file is added to the application project.
5. calculating logic moving method as described in claim 1, which is characterized in that if first implementing result and institute
It is identical to state the second implementing result, then the migrated file is added to after the application project, further includes:
Disable the calling file;
When the business function for detecting the application project realizes failure, the calling file is reactivated.
6. a kind of terminal device, which is characterized in that the terminal device includes memory, processor and is stored in the storage
In device and the computer program that can run on the processor, the processor are realized as follows when executing the computer program
Step:
The calling file in application project is obtained, the calling file is for being performed to realize business function;
Database relevant to the application project is connected, and executes the calling file, obtains the first implementing result;
The calling file is converted according to preset conversion module, obtains migrated file, and obtain by described in execution
The second implementing result that migrated file obtains;
If first implementing result is identical as second implementing result, the migrated file is added to described using work
Journey.
7. terminal device as claimed in claim 6, which is characterized in that described literary to the calling according to preset conversion module
Part is converted, and migrated file is obtained, comprising:
Identify the computing statement in the calling file, the computing statement includes data name to be calculated and calculates function, described
Data name to be calculated is the title for the database data that the computing statement is performed calling;
The calculating function is converted into migration sentence by the conversion module, and the data name to be calculated is added to institute
Migration sentence is stated, the migrated file comprising the migration sentence after the completion of addition is generated.
8. terminal device as claimed in claim 6, which is characterized in that the business function includes multiple subfunctions, if described
First implementing result is identical as second implementing result, then the migrated file is added to the application project, packet
It includes:
It obtains in first implementing result with one-to-one multiple first sons of the multiple subfunction as a result, and described in acquisition
In second implementing result with one-to-one multiple second sons of the multiple subfunction as a result, will the multiple first sub- result and
The multiple second sub- result is compared one by one;
It, will if the result that the multiple first sub- result and the multiple second sub- result are compared one by one is all success
The migrated file is added to the application project.
9. terminal device as claimed in claim 6, which is characterized in that if first implementing result is held with described second
Row result is identical, then the migrated file is added to the application project, comprising:
Acquire first implementing result first executes duration, and acquires the second of second implementing result and hold
Row duration;
If described first, which executes duration, is greater than or equal to the second execution duration, and first implementing result and described second
Implementing result is identical, then the migrated file is added to the application project.
10. a kind of computer readable storage medium, the computer-readable recording medium storage has computer program, and feature exists
In realizing the calculating logic moving method as described in any one of claim 1 to 5 when the computer program is executed by processor
Step.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810916413.2A CN109284278B (en) | 2018-08-13 | 2018-08-13 | Calculation logic migration method based on data analysis technology and terminal equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810916413.2A CN109284278B (en) | 2018-08-13 | 2018-08-13 | Calculation logic migration method based on data analysis technology and terminal equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109284278A true CN109284278A (en) | 2019-01-29 |
CN109284278B CN109284278B (en) | 2023-10-31 |
Family
ID=65183224
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810916413.2A Active CN109284278B (en) | 2018-08-13 | 2018-08-13 | Calculation logic migration method based on data analysis technology and terminal equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109284278B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113032385A (en) * | 2021-05-31 | 2021-06-25 | 北京江融信科技有限公司 | Easily-extensible configurable data backup system and method |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2009116288A1 (en) * | 2008-03-19 | 2009-09-24 | 株式会社インフォース | Database system transition method |
CN104636257A (en) * | 2015-03-13 | 2015-05-20 | 胡兢玉 | SQL coverage-based automatic testing method for application software in database based on |
CN106953893A (en) * | 2017-02-15 | 2017-07-14 | 北京百度网讯科技有限公司 | Data Migration between cloud storage system |
CN107368486A (en) * | 2016-05-12 | 2017-11-21 | 阿里巴巴集团控股有限公司 | A kind of business migration method and device |
-
2018
- 2018-08-13 CN CN201810916413.2A patent/CN109284278B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2009116288A1 (en) * | 2008-03-19 | 2009-09-24 | 株式会社インフォース | Database system transition method |
CN104636257A (en) * | 2015-03-13 | 2015-05-20 | 胡兢玉 | SQL coverage-based automatic testing method for application software in database based on |
CN107368486A (en) * | 2016-05-12 | 2017-11-21 | 阿里巴巴集团控股有限公司 | A kind of business migration method and device |
CN106953893A (en) * | 2017-02-15 | 2017-07-14 | 北京百度网讯科技有限公司 | Data Migration between cloud storage system |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113032385A (en) * | 2021-05-31 | 2021-06-25 | 北京江融信科技有限公司 | Easily-extensible configurable data backup system and method |
CN113032385B (en) * | 2021-05-31 | 2021-09-07 | 北京江融信科技有限公司 | Easily-extensible configurable data backup system and method |
Also Published As
Publication number | Publication date |
---|---|
CN109284278B (en) | 2023-10-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109344153A (en) | The processing method and terminal device of business datum | |
CN113419823B (en) | Alliance chain system suitable for high concurrency transaction and design method thereof | |
CN102236672A (en) | Method and device for importing data | |
CN104462222A (en) | Distributed storage method and system for checkpoint vehicle pass data | |
CN104424018A (en) | Distributed calculating transaction processing method and device | |
CN109814524A (en) | A kind of Vehicular diagnostic method, apparatus and system | |
CN109376142A (en) | Data migration method and terminal device | |
CN104077438A (en) | Power grid large-scale topological structure construction method and system | |
CN105930417B (en) | A kind of big data ETL interactive process platform based on cloud computing | |
CN109241068A (en) | The method, apparatus and terminal device that foreground and background data compares | |
CN107528912A (en) | A kind of automatic method, system and relevant apparatus for realizing distributing real time system | |
CN102915344B (en) | SQL (structured query language) statement processing method and device | |
CN103049516A (en) | Method and device for processing data | |
CN112529596A (en) | Battery source tracing system and method based on block chain | |
CN108228787A (en) | According to the method and apparatus of multistage classification processing information | |
CN108345658A (en) | Algorithm calculates decomposing process, server and the storage medium of track | |
CN110263104A (en) | JSON character string processing method and device | |
CN109388636A (en) | Business datum is inserted into database method, apparatus, computer equipment and storage medium | |
CN110737425A (en) | billing platform system application program establishing method and device | |
CN110245281A (en) | Internet assets information collection method and terminal device | |
CN109284278A (en) | Calculating logic moving method and terminal device based on data analysis technique | |
BRPI0920319B1 (en) | method for accessing magnitude data from the smart grid services database and system and device for it | |
CN110399534A (en) | Terminal capabilities report form generation method, device, equipment and storage medium | |
CN109992630B (en) | Data model matching method and device | |
CN114020446A (en) | Cross-multi-engine routing processing method, device, equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |