CN109284278B - Calculation logic migration method based on data analysis technology and terminal equipment - Google Patents

Calculation logic migration method based on data analysis technology and terminal equipment Download PDF

Info

Publication number
CN109284278B
CN109284278B CN201810916413.2A CN201810916413A CN109284278B CN 109284278 B CN109284278 B CN 109284278B CN 201810916413 A CN201810916413 A CN 201810916413A CN 109284278 B CN109284278 B CN 109284278B
Authority
CN
China
Prior art keywords
file
migration
execution result
sub
calling
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.)
Active
Application number
CN201810916413.2A
Other languages
Chinese (zh)
Other versions
CN109284278A (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 CN201810916413.2A priority Critical patent/CN109284278B/en
Publication of CN109284278A publication Critical patent/CN109284278A/en
Application granted granted Critical
Publication of CN109284278B publication Critical patent/CN109284278B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL 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
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE 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/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention is applicable to the technical field of data processing, and provides a computational logic migration method, terminal equipment and a computer readable storage medium based on a data analysis technology, which comprise the following steps: acquiring a calling file in application engineering, wherein the calling file is used for being executed to realize service functions; connecting databases related to the application engineering, and executing the calling file to obtain a first execution result; converting the calling file according to a preset conversion template to obtain a migration file, and obtaining a second execution result obtained by executing the migration file; and if the first execution result is the same as the second execution result, adding the migration file to the application engineering. Based on the data analysis technology, the invention transfers the calculation logic of the service function in the application engineering from the database level to the level of the upper system, realizes data separation, and improves the realization efficiency of the service function.

Description

Calculation logic migration method based on data analysis technology and terminal equipment
Technical Field
The invention belongs to the technical field of data processing, and particularly relates to a computational logic migration method, terminal equipment and a computer readable storage medium based on a data analysis technology.
Background
The database is a warehouse for organizing, storing and managing data according to a data structure, and because the database has large storage capacity and high stability, in actual service scenes, data related to services are usually stored in the database in advance, and specific service functions are realized by calling the data in the database.
However, in the business fields of security business or banking business, when the business functions are implemented through application engineering, the calculation logic is completely dependent on the database, that is, the process of calling data and calculating the data is completely performed inside the database, when a plurality of data are calculated simultaneously, a processing performance bottleneck is easily formed, and the upper layer system of the database is paralyzed due to a single business function abnormality. In summary, the implementation of the service function in the prior art has too high dependency on the database, the implementation efficiency is limited to the processing efficiency of the database, and the fault tolerance is poor.
Disclosure of Invention
In view of this, the embodiments of the present invention provide a computational logic migration method, a terminal device, and a computer readable storage medium based on a data analysis technique, so as to solve the problem that in the prior art, implementation of service functions excessively depends on a database, and implementation efficiency has an upper limit.
A first aspect of an embodiment of the present invention provides a computing logic migration method based on a data analysis technique, including:
acquiring a calling file in application engineering, wherein the calling file is used for being executed to realize service functions;
connecting databases related to the application engineering, and executing the calling file to obtain a first execution result;
converting the calling file according to a preset conversion template to obtain a migration file, and obtaining a second execution result obtained by executing the migration file;
and if the first execution result is the same as the second execution result, adding the migration file to the application engineering.
A second aspect of an embodiment of the present invention provides a terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the following steps when executing the computer program:
acquiring a calling file in application engineering, wherein the calling file is used for being executed to realize service functions;
connecting databases related to the application engineering, and executing the calling file to obtain a first execution result;
Converting the calling file according to a preset conversion template to obtain a migration file, and obtaining a second execution result obtained by executing the migration file;
and if the first execution result is the same as the second execution result, adding the migration file to the application engineering.
A third aspect of the embodiments of the present invention provides a computer readable storage medium storing a computer program which when executed by a processor performs the steps of:
acquiring a calling file in application engineering, wherein the calling file is used for being executed to realize service functions;
connecting databases related to the application engineering, and executing the calling file to obtain a first execution result;
converting the calling file according to a preset conversion template to obtain a migration file, and obtaining a second execution result obtained by executing the migration file;
and if the first execution result is the same as the second execution result, adding the migration file to the application engineering.
Compared with the prior art, the embodiment of the invention has the beneficial effects that:
the method comprises the steps of firstly determining the calling file related to the service function in the application project, calling and calculating the service function by data in a database, obtaining a first execution result by executing the calling file, then converting the calling file into the migration file according to a preset conversion template, migrating the data in the database to an upper system in the migration file, obtaining a second execution result by executing the migration file, and if the first execution result is the same as the second execution result, proving that the calling file and the migration file can realize the same service function, and adding the migration file to the application project.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of an implementation of a method for computing logical migration based on data analysis technology according to an embodiment of the present invention;
FIG. 2 is a flowchart of a method for implementing a data analysis technology-based computational logic migration according to a second embodiment of the present invention;
FIG. 3 is a flowchart of an implementation of a method for computing logical migration based on data analysis technology according to a third embodiment of the present invention;
FIG. 4 is a flowchart of a method for implementing a data analysis technology-based computational logic migration according to a fourth embodiment of the present invention;
FIG. 5 is a flowchart of a method for implementing a data analysis technology-based computational logic migration method according to a fifth embodiment of the present invention;
fig. 6 is a block diagram of a terminal device according to a sixth embodiment of the present invention;
fig. 7 is a schematic diagram of a terminal device according to a seventh embodiment of the present invention.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth such as the particular system architecture, techniques, etc., in order to provide a thorough understanding of the embodiments of the present invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
In order to illustrate the technical scheme of the invention, the following description is made by specific examples.
Fig. 1 shows an implementation flow of a computational logic migration method based on a data analysis technology according to an embodiment of the present invention, which is described in detail below:
in S101, a calling file in the application engineering is acquired, the calling file being used to be executed to implement a business function.
The application engineering is related to the service, is a generic term for all bottom codes of online processes for realizing the service, and is generally collected into code files for storage for convenient management and viewing, so the application engineering generally comprises a plurality of code files. In this embodiment, the calling file refers to a code file for implementing a service function in an application project, and specifically, the code file is used for calling data from a database and calculating the called data, thereby implementing the service function. In the traditional method, the process of realizing the service function by executing the calling file is carried out in a database hierarchy, so that the dependency degree of the service function on the database is too high, the realization efficiency is easily affected by the performance bottleneck of the database, and the database is easily paralyzed when a certain link of data calculation is in error. Therefore, in the embodiment of the invention, the calling file in the application engineering is firstly determined and acquired, and then the calculation logic in the calling file is migrated. In general, the calling file has a specified file format, the file format is different according to the scene of the application engineering, and for convenience of explanation, the embodiment of the invention uses the calling file as a script file formed by structured query language (Structured Query Language, SQL) sentences, that is, the calling file contains SQL sentences for calling and calculating data, and the file suffix of the calling file is ". SQL". When the calling file in the application engineering is obtained, searching all code files in the application engineering, and taking the code files conforming to the specified file format (the file suffix is ". Sql") as the calling file.
Optionally, code files in the application engineering are identified, and the code files containing the function identification are used as calling files. In the embodiment of the invention, the function identification can be uniformly established on the code file for realizing the service function in advance, and the code file containing the function identification is used as the calling file when the calling file is acquired, wherein the function identification can be established in the file name of the code file or the code of the code file. For example, the original file name of the code file for implementing the service function is "code_sql", the file name after the function identifier is established for the code file is "id_code_sql" (i.e., the function identifier is "id_"), and when the call file is searched, only the code file corresponding to the file name containing "id_") is used as the call file, thereby improving the accuracy of determining the call file. In addition, since there may be multiple service functions implemented by the application engineering, different function identifiers may be preset for multiple code files corresponding to multiple service functions, for example, the function identifier is set to "ida_" for the code file corresponding to the service function a, the function identifier is set to "idb_" for the code file corresponding to the service function B, and after the setting is completed, if the specified service function is to be subjected to the computational logic migration, the code file corresponding to the function identifier of the specified service function is determined in this step, and the code file is used as the calling file.
In S102, a database related to the application engineering is connected, and the calling file is executed, so as to obtain a first execution result.
If the data in the database is to be called to realize the service function, the database related to the application engineering needs to be connected first. In this embodiment, the database is connected by a java database connection (Java DataBase Connectivity, JDBC) technology, the database is an Oracle database, and the Oracle database is connected by using an Oracle thin mode for example, firstly, the user name, the password, the database connection string and the registration driver of the Oracle database are obtained, and the user name, the password, the database connection string and the registration driver of the Oracle database can be stored in the application engineering or a specific storage address in advance. The database connection string of the Oracle database is assumed to be "jdbc: oracle: thin @192.168.1.1:1521:ORCL", wherein ORCL is the name of the Oracle database, and the registration driver is "Oracle. Jdbc. Driver. Oracle driver", and the database connection string and the registration driver are only examples and are not limiting. After the acquisition is completed, the registration driver of the Oracle database is loaded into the driver management program of the JDBC, and the Oracle database is connected through the acquired user name, password and database connection string by the connection method (getConnectin) in the driver management program of the JDBC. Of course, the above-mentioned process of connecting databases may be integrated into a code file in the form of a code and added to an application project. And after the database is successfully connected, executing a calling file in the application engineering, calling data from the database, and calculating the called data to obtain a first execution result. For example, if the service function is to calculate the average nationwide service volume, in the execution process of the calling file, the service volume of each province nationwide is called from the database, and then the average value of the service volumes of all provinces is measured to obtain the average nationwide service volume.
In S103, the call file is converted according to a preset conversion template, a migration file is obtained, and a second execution result obtained by executing the migration file is obtained.
The process of implementing the service function by executing the calling file is in a database level, and because the processing capacity of the database on data is limited, if the data to be calculated is more, performance bottlenecks are easily formed, and the calculation efficiency is low. The conversion template is preset with a plurality of migration sentences corresponding to SQL sentences related to data calculation (the migration sentences are java sentences). The process of converting the calling file is a process of replacing SQL sentences related to data calculation in the calling file with corresponding migration sentences in a conversion template. It should be noted that, the migration file is a generic term in form, the converted migration file generally includes two parts, the first part is a migration statement for performing a data computing operation in an application engineering, the migration statement is generated through conversion of a conversion template, the other part is an extraction statement for calling data from a database, the extraction statement is the same as a statement for calling data in the calling file, and from the aspect of generation, an SQL statement in the calling file except for the SQL statement for performing conversion can be copied to generate the extraction statement.
After the migration file is generated, the migration file is temporarily added into the application engineering, and the migration file is executed to obtain a second execution result. The service functions are taken as calculation of the average nationwide service volume for illustration, after the call files are converted according to the conversion templates, the extraction sentences in the generated migration files are executed in the database level, and in the execution process, the service volume of each province nationwide is called from the database; and executing the migration sentences in the migration file at the level of the upper system, and carrying out average calculation on the traffic of all provinces nationwide in the execution process to obtain the nationwide average traffic.
In S104, if the first execution result is the same as the second execution result, the migration file is added to the application engineering.
After the migration file is executed, comparing the first execution result with the second execution result, if the first execution result is different from the second execution result, proving that the migration file cannot achieve the same effect as the original calling file, removing the migration file from the application engineering, and outputting a log in the execution process of the migration file, so that a user can check the execution process conveniently; if the first execution result is the same as the second execution result, the migration file is proved to have the same effect as the calling file, and the migration file is kept in the application engineering, namely, the migration file is permanently added to the application engineering.
Optionally, after permanently adding the migration file to the application project, the calling file is deleted. Because the migration file and the calling file can realize the service function, the original calling file in the application project can be removed after the migration file is permanently added into the application project, so that the capacity occupied by the application project is reduced, and the portability of the application project is improved.
As can be seen from the embodiment shown in fig. 1, in the embodiment of the present invention, by acquiring a calling file for implementing a service function in an application project, and executing the calling file, a first execution result is obtained, then, the calling file is converted according to a preset conversion template, a migration file is obtained, and the migration file is executed, a second execution result is obtained, and finally, the first execution result and the second execution result are compared, if the first execution result is the same as the second execution result, the migration file is added to the application project.
Fig. 2 shows an implementation method of the first embodiment of the present invention after refining the process of transforming the calling file according to the preset transformation template to obtain the migration file. The embodiment of the invention provides a flow chart for realizing a computational logic migration method based on a data analysis technology, as shown in fig. 2, the computational logic migration method based on the data analysis technology can comprise the following steps:
In S201, a calculation statement in the call file is identified, the calculation statement including a to-be-calculated data name and a calculation function, the to-be-calculated data name being a name of database data called when the calculation statement is executed.
When the calling file is converted, firstly, calling sentences and computing sentences in the calling file are identified, wherein the calling sentences are SQL sentences which are only used for calling database data or are simpler in computing process in the calling file, and the computing sentences are SQL sentences which are more complex in computing process in the calling file. In the embodiment of the invention, the methods for identifying the calling statement and the calculating statement comprise a plurality of methods, wherein the first method is to pre-make the function names belonging to the calling statement and the function names belonging to the calculating statement, such as pre-make the function names belonging to the calculating statement as an AVG function and a DATEDIFF function, and then identify the calling statement and the calculating statement through the function names; the second method is that in the running process of the application engineering, an output running log is obtained, the statement execution duration of each SQL statement of the calling file is determined from the running log, the SQL statement with the statement execution duration being greater than or equal to a preset threshold value is used as a calculation statement, and the SQL statement with the statement execution duration being less than the preset threshold value is used as a calling statement. After the calculation statement is determined, extracting a data name to be calculated and a calculation function in the calculation statement, wherein the data name to be calculated is a variable name in the calculation statement, and the calculation function is a function name of the calculation statement. It should be noted that the naming of the call statement and the calculation statement does not limit the application, for example, the call statement and the calculation statement can be used for call data and calculation data, and the specific division of the two statements can be determined according to the actual application scenario, but it should be known that the calculation statement is biased to the statement with a relatively complex calculation process in the application engineering.
In S202, the computing function is converted into a migration statement through the conversion template, the data name to be computed is added to the migration statement, and the migration file containing the migration statement after the addition is completed is generated.
In the embodiment of the invention, the conversion template comprises a plurality of migration sentences corresponding to a plurality of function names one by one, after the calculation function in the calculation sentence is determined, the calculation function is input into the conversion template, and the migration sentences corresponding to the calculation function output by the conversion template are obtained. Then, taking the data name to be calculated as a variable in a migration statement corresponding to the calculation function, adding the data name to be calculated to the migration statement, placing the migration statement after the addition into a new file, placing the extraction statement (the copy of the calling statement in the calling file) into the new file as well, and finally forming the new file as the migration file.
As can be seen from the embodiment shown in fig. 2, in the embodiment of the present invention, by identifying a calculation statement in a calling file, where the calculation statement includes a to-be-calculated data name and a calculation function, where the to-be-calculated data name is a name of database data called when the calculation statement is executed, then converting the calculation function into a migration statement through a conversion template, adding the to-be-calculated data name to the migration statement, and using the migration statement as a part of the migration file to generate the migration file, the embodiment of the present invention performs statement conversion according to the function name, thereby improving accuracy of statement conversion.
Fig. 3 shows an implementation method of refining a process of adding a migration file to an application engineering if a first execution result is the same as a second execution result on the basis of the first embodiment of the present invention and on the basis that a service function includes a plurality of sub-functions. The embodiment of the invention provides a flow chart for realizing a computational logic migration method based on a data analysis technology, as shown in fig. 3, the computational logic migration method based on the data analysis technology can comprise the following steps:
in S301, a plurality of first sub-results corresponding to the plurality of sub-functions in one-to-one manner in the first execution result are obtained, a plurality of second sub-results corresponding to the plurality of sub-functions in one-to-one manner in the second execution result are obtained, and one-to-one comparison is performed between the plurality of first sub-results and the plurality of second sub-results.
As the business of today gradually progresses toward the complexity, the business functions may include multiple sub-functions, such as the multiple sub-functions in turn being functions A Function B And Function C Function A To calculate the average traffic of region a, function B To calculate the average traffic of region B, function C To calculate the average traffic for region C. After a calling file in application engineering is executed, a first execution result is obtained, and in the embodiment of the invention, a plurality of first sub-results corresponding to a plurality of sub-functions one by one in the obtained first execution result are obtained. And correspondingly, after the migration file is generated, temporarily adding the migration file to the application project, executing the migration file in the application project to obtain a second execution result, and obtaining a plurality of second sub-results corresponding to the plurality of sub-functions one by one in the second execution result. And after the plurality of first sub-results and the plurality of second sub-results are obtained, performing one-to-one comparison on the plurality of first sub-results and the plurality of second sub-results.
In S302, if the result of comparing the first sub-results with the second sub-results is successful, the migration file is added to the application engineering.
In the embodiment of the invention, a result of performing one comparison on a plurality of first sub-results and a plurality of second sub-results is checked. For example, if the plurality of first sub-results are first sub-results Result A1 First sub-Result B1 And a first sub-Result C1 Respectively corresponding to functions A Function B And Function C The plurality of second sub-results are second sub-results Result A2 Second sub-Result B2 And a second sub-Result C2 Respectively corresponding to functions A Function B And Function C Then the first sub Result is processed A1 And the second sub-Result A2 Comparing the first sub-Result B1 And the second sub-result Result B2 Comparing the first sub-Result C1 And the second sub-Result C2 And comparing, and checking the result of each group of comparison. If the result of one comparison of the first sub-results and the second sub-results is successful, permanently adding the migration file to the application project.
Optionally, if there are multiple call files corresponding to the multiple sub-functions, respectively, calculating a first sub-result and a second sub-result corresponding to each sub-function separately, comparing the first sub-result with the second sub-result to obtain a comparison result, and if the comparison results corresponding to the multiple sub-functions are all successful, permanently adding the migration file to the application engineering. If there are multiple calling files, such as calling file A, calling file B and calling file C, respectively corresponding to Function functions A Function B And Function C In the embodiment of the present invention, in order to view the situation that different sub-functions are implemented separately, the first sub-result and the second sub-result corresponding to each sub-Function are calculated separately, for example, the Function is executed separately A Corresponding calling file A to obtain a first sub-Result A1 And independently execute Function A Corresponding migration file A, obtaining second sub Result A2 Finally, the first sub Result A1 And the second sub-Result A2 Comparing to obtain a comparison result A; function execution alone B Corresponding calling file B to obtain a first sub-Result B1 And independently executing the migration file B to obtain a second sub-Result B2 Finally, the first sub Result B1 And the second sub-Result B2 And (5) comparing to obtain a comparison result B … …. And when the comparison results corresponding to the plurality of sub-functions are successful, permanently adding the migration file to the application engineering.
Optionally, if there are multiple calling files, respectively corresponding to multiple sub-functions, separately calculating a first sub-result and a second sub-result corresponding to the specified sub-function combination, and combining the first sub-result with the second sub-result And comparing the first sub-result with the second sub-result to obtain a comparison result, and permanently adding the migration file to the application engineering if the comparison result corresponding to the specified sub-function combination is successful. In an actual application scene, the database data of different sub-function calls are the same, so that on the basis of the comparison method, the first sub-result and the second sub-result corresponding to the designated sub-function combination can be compared, and if the comparison is successful, the migration file is permanently added to the application engineering. For example, the plurality of sub-Function combinations include Function functions A + Function B Function A + Function C Function B + Function C And Function A + Function B + Function C The designated sub-Function combination is a Function A + Function B In the calculation process, the Function functions are executed at the same time A Corresponding calling file A and Function B The corresponding calling file B obtains a first sub-result, and then simultaneously executes the Function A Corresponding migration file A and Function B And (3) corresponding to the migration file B, obtaining a second sub-result, and comparing the first sub-result with the second sub-result to obtain a comparison result. And when the comparison result of the specified sub-function combination is successful, permanently adding the migration file into the application engineering, wherein the specified sub-function combination can be one or more of a plurality of sub-function combinations, and is determined according to the actual application scene.
As can be seen from the embodiment shown in fig. 3, in the embodiment of the present invention, when the service function includes a plurality of sub-functions, a plurality of first sub-results corresponding to the plurality of sub-functions in one-to-one manner in the first execution result are obtained, a plurality of second sub-results corresponding to the plurality of sub-functions in one-to-one manner in the second execution result are obtained, the plurality of first sub-results and the plurality of second sub-results are compared one by one, and if the comparison results are successful, the migration file is permanently added to the application engineering.
Fig. 4 shows an implementation method of refining a process of adding a migration file to an application engineering if a first execution result is the same as a second execution result on the basis of the first embodiment of the present invention. The embodiment of the invention provides a flow chart for realizing a computational logic migration method based on a data analysis technology, as shown in fig. 4, the computational logic migration method based on the data analysis technology can comprise the following steps:
in S401, a first execution duration for obtaining the first execution result is obtained, and a second execution duration for obtaining the second execution result is obtained.
In the embodiment of the invention, the process of obtaining the first execution result by calling the file in the execution application engineering is timed to obtain the first execution duration, and the process of obtaining the second execution result by the migration file in the execution application engineering is timed to obtain the second execution duration after the migration file is temporarily added to the application engineering.
In S402, if the first execution time length is greater than or equal to the second execution time length and the first execution result is the same as the second execution result, the migration file is added to the application engineering.
Comparing the first execution time length with the second execution time length on the basis that the first execution result is the same as the second execution result, if the first execution time length is longer than the second execution time length, proving that the execution efficiency of the migration file is higher than that of the calling file, and permanently adding the migration file into the application engineering; if the first execution duration is equal to the second execution duration, the execution efficiency of the migration file is proved to be the same as that of the call file, but as the calculation logic is positioned at the level of the upper system, data with larger orders of magnitude can be supported for processing, and the applicability is strong, the migration file is permanently added into the application engineering; and if the first execution duration is smaller than the second execution duration, deleting the migration file in the application engineering. It should be noted that after the migration file is permanently added to the application engineering, the original calling file may be deleted to save capacity.
As can be seen from the embodiment shown in fig. 4, in the embodiment of the present invention, a first execution duration of a first execution result is obtained by obtaining an execution calling file, a second execution duration of a second execution result is obtained by obtaining an execution migration file, the first execution duration is compared with the second execution duration, and if the first execution duration is greater than or equal to the second execution duration and the first execution result is equal to the second execution result, the migration file is permanently added to the application engineering.
Fig. 5 shows an implementation method of the first embodiment of the present invention, where after a migration file is added to an application project, the process of operating on an original call file in the application project is refined. The embodiment of the invention provides a flow chart for realizing a computational logic migration method based on a data analysis technology, as shown in fig. 5, the computational logic migration method based on the data analysis technology can comprise the following steps:
in S501, the calling file is disabled.
In the embodiment of the invention, after the migration file is permanently added to the application project, the migration file is only required to be executed to realize the service function in the normal operation process of the subsequent application project, so that the disabling operation is executed on the original calling file in the application project. The disabling operation may be to store the calling file in the cloud server and remove the calling file from the application engineering, or may be to set the execution authority for the calling file in the application engineering without removing the calling file, and disable execution of the calling file in the normal operation mode.
In S502, when it is detected that the service function of the application engineering fails to be implemented, the calling file is re-enabled.
After the disabling of the calling file is completed, an application project containing the migration file is operated, whether the service function is realized or not is detected regularly, specifically, whether an execution result obtained by executing the migration file in the application project is in a preset value range or not can be detected, and if the execution result is in the value range, the service function is successfully realized; if the service function is not in the value range, the service function fails to be realized. If the fact that the service function fails in a certain moment is detected, stopping running the application engineering, re-enabling the calling file in the application engineering, enabling the re-enabling operation to correspond to the disabling operation, and if the disabling operation is that the calling file is stored in the cloud server, downloading the calling file from the cloud server in the step, and adding the calling file to the application engineering; if the disabling operation is to set the execution authority of the calling file, the execution authority of the calling file is opened in this step. It is worth mentioning that the disabling operation is performed on the migration file while the calling file is re-enabled.
It should be understood that the sequence number of each step in the foregoing embodiment does not mean that the execution sequence of each process should be determined by the function and the internal logic, and should not limit the implementation process of the embodiment of the present invention.
Fig. 6 shows a block diagram of a terminal device according to an embodiment of the present invention, where the terminal device includes units for performing the steps in the corresponding embodiment of fig. 1. Please refer to fig. 1 and the related description of the embodiment corresponding to fig. 1. For convenience of explanation, only the portions related to the present embodiment are shown.
Referring to fig. 6, the terminal device includes:
an acquiring unit 61, configured to acquire a calling file in an application engineering, where the calling file is used to be executed to implement a service function;
the execution unit 62 is configured to connect to a database related to the application engineering, and execute the calling file to obtain a first execution result;
a conversion unit 63, configured to convert the calling file according to a preset conversion template, obtain a migration file, and obtain a second execution result obtained by executing the migration file;
and an adding unit 64, configured to add the migration file to the application engineering if the first execution result is the same as the second execution result.
Optionally, the conversion unit 63 includes:
the identification unit is used for identifying a calculation statement in the calling file, wherein the calculation statement comprises a data name to be calculated and a calculation function, and the data name to be calculated is the name of database data called when the calculation statement is executed;
and the conversion subunit is used for converting the calculation function into a migration statement through the conversion template, adding the data name to be calculated to the migration statement, and generating the migration file containing the migration statement after the addition is completed.
Optionally, the service function includes a plurality of sub-functions, and the adding unit 64 includes:
the comparison unit is used for acquiring a plurality of first sub-results corresponding to the plurality of sub-functions in one-to-one correspondence in the first execution result, acquiring a plurality of second sub-results corresponding to the plurality of sub-functions in one-to-one correspondence in the second execution result, and comparing the plurality of first sub-results with the plurality of second sub-results;
and the first adding unit is used for adding the migration file to the application engineering if the result of one comparison of the plurality of first sub-results and the plurality of second sub-results is successful.
Optionally, the adding unit 64 includes:
the duration acquisition unit is used for acquiring a first execution duration for acquiring the first execution result and acquiring a second execution duration for acquiring the second execution result;
and the second adding unit is used for adding the migration file to the application engineering if the first execution time length is longer than or equal to the second execution time length and the first execution result is the same as the second execution result.
Optionally, the adding unit 64 further includes:
the disabling unit is used for disabling the calling file;
and the starting unit is used for restarting the calling file when detecting that the service function of the application engineering fails to be realized.
Therefore, the terminal equipment provided by the embodiment of the invention improves the realization efficiency of the service function by migrating the calculation logic for realizing the service function in the application engineering from the database level to the level of the upper system.
Fig. 7 is a schematic diagram of a terminal device according to an embodiment of the present invention. As shown in fig. 7, the terminal device 7 of this embodiment includes: a processor 70, a memory 71, and a computer program 72 stored in the memory 71 and executable on the processor 70. The processor 70, when executing the computer program 72, implements the steps of the various embodiments of the computational logic migration method based on data analysis techniques described above, such as steps S101 to S104 shown in fig. 1. Alternatively, the processor 70, when executing the computer program 72, implements the functions of the units in the embodiments of the terminal device described above, for example, the functions of the units 61 to 64 shown in fig. 6.
By way of example, the computer program 72 may be divided into one or more units, which are stored in the memory 71 and executed by the processor 70 to accomplish the present invention. The one or more units may be a series of computer program instruction segments capable of performing a specific function for describing the execution of the computer program 72 in the terminal device 7. For example, the computer program 72 may be divided into an acquisition unit, an execution unit, a conversion unit, and an addition unit, each unit functioning specifically as follows:
the system comprises an acquisition unit, a service function acquisition unit and a service function acquisition unit, wherein the acquisition unit is used for acquiring a calling file in an application project, and the calling file is used for being executed to realize the service function;
the execution unit is used for connecting the database related to the application engineering and executing the calling file to obtain a first execution result;
the conversion unit is used for converting the calling file according to a preset conversion template to obtain a migration file, and obtaining a second execution result obtained by executing the migration file;
and the adding unit is used for adding the migration file to the application engineering if the first execution result is the same as the second execution result.
The terminal device 7 may be a computing device such as a desktop computer, a notebook computer, a palm computer, a cloud server, etc. The terminal device may include, but is not limited to, a processor 70, a memory 71. It will be appreciated by those skilled in the art that fig. 7 is merely an example of the terminal device 7 and does not constitute a limitation of the terminal device 7, and may include more or less components than illustrated, or may combine certain components, or different components, e.g., the terminal device may further include an input-output device, a network access device, a bus, etc.
The processor 70 may be a central processing unit (Central Processing Unit, CPU), or may be another general purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), an off-the-shelf programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 71 may be an internal storage unit of the terminal device 7, such as a hard disk or a memory of the terminal device 7. The memory 71 may be an external storage device of the terminal device 7, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided on the terminal device 7. Further, the memory 71 may also include both an internal storage unit and an external storage device of the terminal device 7. The memory 71 is used for storing the computer program as well as other programs and data required by the terminal device. The memory 71 may also be used for temporarily storing data that has been output or is to be output.
It will be clearly understood by those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units is illustrated, and in practical application, the above-mentioned functional allocation may be performed by different functional units, that is, the internal structure of the terminal device is divided into different functional units, so as to perform all or part of the above-mentioned functions. The functional units in the embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a software functional unit. In addition, the specific names of the functional units are also only for distinguishing from each other, and are not used to limit the protection scope of the present application. The specific working process of the units in the above system may refer to the corresponding process in the foregoing method embodiment, which is not described herein again.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and in part, not described or illustrated in any particular embodiment, reference is made to the related descriptions of other embodiments.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed terminal device and method may be implemented in other manners. For example, the above-described terminal device embodiments are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection via interfaces, devices or units, which may be in electrical, mechanical or other forms.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the present invention may implement all or part of the flow of the method of the above embodiment, or may be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium, and when the computer program is executed by a processor, the computer program may implement the steps of each of the method embodiments described above. Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth. It should be noted that the computer readable medium contains content that can be appropriately scaled according to the requirements of jurisdictions in which such content is subject to legislation and patent practice, such as in certain jurisdictions in which such content is subject to legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunication signals.
The above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention, and are intended to be included in the scope of the present invention.

Claims (8)

1. A method for computing logic migration based on data analysis technology, comprising:
acquiring a calling file in application engineering, wherein the calling file is used for being executed to realize service functions;
connecting databases related to the application engineering, and executing the calling file to obtain a first execution result;
converting the calling file according to a preset conversion template to obtain a migration file, and obtaining a second execution result obtained by executing the migration file;
if the first execution result is the same as the second execution result, adding the migration file to the application project;
The step of converting the calling file according to a preset conversion template to obtain a migration file comprises the following steps:
identifying a calculation statement in the calling file, acquiring an output running log in the running process of an application project, determining the statement execution time length of the SQL statement of the calling file from the running log, and taking the SQL statement with the statement execution time length being greater than or equal to a preset threshold value as a calculation statement, wherein the calculation statement comprises a data name to be calculated and a calculation function, and the data name to be calculated is the name of database data called when the calculation statement is executed;
the conversion template comprises a plurality of migration sentences corresponding to a plurality of function names one by one, the calculation function is input into the conversion template, the conversion template is used for converting the calculation function into the migration sentences corresponding to the calculation function, the data names to be calculated are used as variables in the migration sentences corresponding to the calculation function, the data names to be calculated are added to the migration sentences, the added migration sentences are placed into a new file, the extraction sentences are placed into the new file, and the migration file containing the migration sentences after the addition is completed is generated.
2. The method of computing logic migration of claim 1, wherein the business function includes a plurality of sub-functions, and the adding the migration file to the application engineering if the first execution result is the same as the second execution result includes:
acquiring a plurality of first sub-results corresponding to the plurality of sub-functions in one-to-one correspondence in the first execution result, acquiring a plurality of second sub-results corresponding to the plurality of sub-functions in one-to-one correspondence in the second execution result, and comparing the plurality of first sub-results with the plurality of second sub-results;
and if the result of one comparison of the first sub-results and the second sub-results is successful, adding the migration file to the application engineering.
3. The method of computing logic migration of claim 1, wherein adding the migration file to the application if the first execution result is the same as the second execution result comprises:
acquiring a first execution duration for acquiring the first execution result, and acquiring a second execution duration for acquiring the second execution result;
and if the first execution time length is longer than or equal to the second execution time length and the first execution result is the same as the second execution result, adding the migration file to the application engineering.
4. The method of computing logic migration according to claim 1, wherein if the first execution result is the same as the second execution result, adding the migration file to the application engineering further comprises:
disabling the calling file;
and restarting the calling file when detecting that the service function of the application engineering fails to be realized.
5. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the following steps when executing the computer program:
acquiring a calling file in application engineering, wherein the calling file is used for being executed to realize service functions;
connecting databases related to the application engineering, and executing the calling file to obtain a first execution result;
converting the calling file according to a preset conversion template to obtain a migration file, and obtaining a second execution result obtained by executing the migration file;
if the first execution result is the same as the second execution result, adding the migration file to the application project;
The step of converting the calling file according to a preset conversion template to obtain a migration file comprises the following steps:
identifying a calculation statement in the calling file, acquiring an output running log in the running process of an application project, determining the statement execution time length of the SQL statement of the calling file from the running log, and taking the SQL statement with the statement execution time length being greater than or equal to a preset threshold value as a calculation statement, wherein the calculation statement comprises a data name to be calculated and a calculation function, and the data name to be calculated is the name of database data called when the calculation statement is executed;
the conversion template comprises a plurality of migration sentences corresponding to a plurality of function names one by one, the calculation function is input into the conversion template, the conversion template is used for converting the calculation function into the migration sentences corresponding to the calculation function, the data names to be calculated are used as variables in the migration sentences corresponding to the calculation function, the data names to be calculated are added to the migration sentences, the added migration sentences are placed into a new file, the extraction sentences are placed into the new file, and the migration file containing the migration sentences after the addition is completed is generated.
6. The terminal device of claim 5, wherein the service function includes a plurality of sub-functions, and the adding the migration file to the application engineering if the first execution result is the same as the second execution result includes:
acquiring a plurality of first sub-results corresponding to the plurality of sub-functions in one-to-one correspondence in the first execution result, acquiring a plurality of second sub-results corresponding to the plurality of sub-functions in one-to-one correspondence in the second execution result, and comparing the plurality of first sub-results with the plurality of second sub-results;
and if the result of one comparison of the first sub-results and the second sub-results is successful, adding the migration file to the application engineering.
7. The terminal device of claim 5, wherein adding the migration file to the application engineering if the first execution result is the same as the second execution result comprises:
acquiring a first execution duration for acquiring the first execution result, and acquiring a second execution duration for acquiring the second execution result;
and if the first execution time length is longer than or equal to the second execution time length and the first execution result is the same as the second execution result, adding the migration file to the application engineering.
8. A computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the steps of the computational logic migration method of any one of claims 1 to 4.
CN201810916413.2A 2018-08-13 2018-08-13 Calculation logic migration method based on data analysis technology and terminal equipment Active CN109284278B (en)

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 CN109284278A (en) 2019-01-29
CN109284278B true 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)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113032385B (en) * 2021-05-31 2021-09-07 北京江融信科技有限公司 Easily-extensible configurable data backup system and method

Citations (4)

* Cited by examiner, † Cited by third party
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

Patent Citations (4)

* Cited by examiner, † Cited by third party
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

Also Published As

Publication number Publication date
CN109284278A (en) 2019-01-29

Similar Documents

Publication Publication Date Title
CN110795455B (en) Dependency analysis method, electronic device, computer apparatus, and readable storage medium
CN109344153B (en) Service data processing method and terminal equipment
CN109814524B (en) Vehicle diagnosis method, device and system
CN108762898B (en) Thread interface management method, terminal equipment and computer readable storage medium
CN110737594B (en) Database standard conformance testing method and device for automatically generating test cases
CN109376142B (en) Data migration method and terminal equipment
CN111241177A (en) Data acquisition method, system and network equipment
CN112906054A (en) Multi-tenant database isolation method and device and electronic equipment
CN113312338A (en) Data consistency checking method, device, equipment, medium and program product
CN113434482A (en) Data migration method and device, computer equipment and storage medium
CN111177113A (en) Data migration method and device, computer equipment and storage medium
CN112084179A (en) Data processing method, device, equipment and storage medium
CN115858488A (en) Parallel migration method and device based on data governance and readable medium
CN110737458A (en) code updating method and related device
CN113111669B (en) Increment-based front-end multi-language internationalized translation method and device
CN109284278B (en) Calculation logic migration method based on data analysis technology and terminal equipment
CN116483707A (en) Test method, test device, test apparatus, test program, and test program
CN114157662B (en) Cloud platform parameter adaptation method, device, terminal equipment and storage medium
CN116204540A (en) Operation log recording method, device, equipment and storage medium
CN114722927A (en) Collapse clustering method and device, electronic equipment and storage medium
CN116628042A (en) Data processing method, device, equipment and medium
CN110222105B (en) Data summarization processing method and device
CN114356454A (en) Account checking data processing method, account checking data processing device, account checking data storage medium and program product
US20200097573A1 (en) Identification of records for post-cloning tenant identifier translation
CN117349267B (en) Database migration processing method and system

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