CN111159198B - Parameter transaction processing method and device, computer equipment and readable storage medium - Google Patents
Parameter transaction processing method and device, computer equipment and readable storage medium Download PDFInfo
- Publication number
- CN111159198B CN111159198B CN201911415764.6A CN201911415764A CN111159198B CN 111159198 B CN111159198 B CN 111159198B CN 201911415764 A CN201911415764 A CN 201911415764A CN 111159198 B CN111159198 B CN 111159198B
- Authority
- CN
- China
- Prior art keywords
- parameter
- data
- transaction
- class
- information
- 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
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 13
- 230000009466 transformation Effects 0.000 claims abstract description 37
- 238000000034 method Methods 0.000 claims abstract description 23
- 238000012423 maintenance Methods 0.000 claims abstract description 7
- 238000012545 processing Methods 0.000 claims description 29
- 230000006870 function Effects 0.000 claims description 19
- 238000006243 chemical reaction Methods 0.000 claims description 18
- 238000004590 computer program Methods 0.000 claims description 17
- 238000000844 transformation Methods 0.000 claims 1
- 238000011161 development Methods 0.000 abstract description 7
- 230000008569 process Effects 0.000 abstract description 4
- 238000010586 diagram Methods 0.000 description 7
- 230000004048 modification Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000008520 organization Effects 0.000 description 3
- 230000007547 defect Effects 0.000 description 2
- 238000007792 addition Methods 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000012217 deletion Methods 0.000 description 1
- 230000037430 deletion Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000003780 insertion Methods 0.000 description 1
- 230000037431 insertion Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000001131 transforming effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
- G06F16/2282—Tablespace storage structures; Management thereof
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Stored Programmes (AREA)
Abstract
The invention provides a parameter transaction processing method and device, computer equipment and a readable storage medium, wherein the method comprises the following steps: acquiring parameter transaction data, wherein the parameter transaction data comprises functional parameter data and information parameter data; performing field name transformation on the information parameter data, and performing table entity class assignment according to a transformation result; and obtaining the path and the parameter table name stored in the table entity class by using Java reflection, obtaining the table operation class according to the path and the parameter table name, and operating the database by using the table operation class according to the functional parameter data. The invention can process the parameter transaction according to a unified mode, and reduces the workload of development and maintenance of the parameter transaction.
Description
Technical Field
The present invention relates to the field of parameter transactions, and in particular, to a method and apparatus for processing a parameter transaction, a computer device, and a readable storage medium.
Background
The parameter transaction in the prior art is a set of realization methods, a set of realization methods are required to be independently developed for each type of parameter transaction, the development workload of the existing parameter transaction realization methods is large, the modification cost is high, and all the parameter transaction realization methods need to be modified once when new functions are added.
Disclosure of Invention
In order to solve the defects of large development workload and high modification cost in the parameter transaction implementation method in the prior art, a first aspect of the present invention provides a parameter transaction processing method, which includes:
Acquiring parameter transaction data, wherein the parameter transaction data comprises functional parameter data and information parameter data;
Performing field name transformation on the information parameter data, and performing table entity class assignment according to a transformation result;
And obtaining the path and the parameter table name stored in the table entity class by using Java reflection, obtaining the table operation class according to the path and the parameter table name, and operating the database by using the table operation class according to the functional parameter data.
In a further embodiment, obtaining parametric transaction data includes:
and acquiring parameter transaction data by using a unified interface, wherein the unified interface uses generic definition.
In a further embodiment, performing field name transformation on the information parameter data includes:
and carrying out field name conversion on the information parameter data according to a preset conversion rule, wherein the conversion rule comprises the association relation between the information parameter fields and the unified fields in each parameter transaction data.
In a further embodiment, performing table entity class assignment according to the transformation result includes:
and obtaining data corresponding to each field name in the transformation result by using Java reflection, and assigning the data to the table entity class.
A second aspect of the present invention provides a parameter transaction processing device, comprising:
The entry module is used for acquiring parameter transaction data, wherein the parameter transaction data comprises functional parameter data and information parameter data;
the parameter processing module is used for carrying out field name transformation on the information parameter data and carrying out table entity class assignment according to a transformation result;
And the database operation module is used for acquiring the path and the parameter table name stored in the table entity class by using Java reflection, acquiring the table operation class according to the path and the parameter table name, and performing database operation by using the table operation class according to the functional parameter data.
In a further embodiment, the portal module obtains parametric transaction data comprising:
and acquiring parameter transaction data by using a unified interface, wherein the unified interface uses generic definition.
In a further embodiment, the processing module performs field name transformation on the information parameter data, including:
and carrying out field name conversion on the information parameter data according to a preset conversion rule, wherein the conversion rule comprises the association relation between the information parameter fields and the unified fields in each parameter transaction data.
In a further embodiment, the operation module performs table entity class assignment according to the transformation result, including:
and obtaining data corresponding to each field name in the transformation result by using Java reflection, and assigning the data to the table entity class.
A third aspect of the invention provides a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method of parameter transaction processing as described in any of the preceding embodiments when the computer program is executed.
A fourth aspect of the present invention provides a computer-readable storage medium storing an executable computer program which when executed by a processor implements a parameter transaction processing method according to any one of the preceding embodiments.
The invention provides a parameter transaction processing method and device, computer equipment and a readable storage medium, wherein parameter transaction data are obtained, and the parameter transaction data comprise functional parameter data and information parameter data; performing field name transformation on the information parameter data, and performing table entity class assignment according to a transformation result; the path and the parameter table names stored in the table entity class are acquired by utilizing Java reflection, the table operation class is acquired according to the path and the parameter table names, the database is operated by utilizing the table operation class according to the functional parameter data, the parameter transaction can be processed according to a unified mode, and the workload of development and maintenance of the parameter transaction is reduced.
The foregoing and other objects, features and advantages of the invention will be apparent from the following more particular description of preferred embodiments, as illustrated in the accompanying drawings.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method of processing a parameter transaction according to an embodiment of the present invention;
fig. 2 shows a block diagram of a parameter transaction processing device according to an embodiment of the present invention.
Detailed Description
In order to make the technical features and effects of the present invention more obvious, the technical solution of the present invention will be further described with reference to the accompanying drawings, and the present invention may be described or implemented by other different specific examples, and any equivalent transformation made by those skilled in the art within the scope of the claims falls within the protection scope of the present invention.
The exemplary embodiments of the present invention and the descriptions thereof are intended to illustrate the present invention, but not to limit the present invention. In addition, the same or similar reference numerals are used for the same or similar parts in the drawings and the embodiments.
In the description of the present specification, reference to the terms "one embodiment," "a particular embodiment," "some embodiments," "for example," or "some examples," etc., means that a particular feature, structure, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiments or examples. Furthermore, the particular features, structures, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. The order of steps involved in the embodiments is illustrative of the practice of the invention, and is not limited and may be suitably modified as desired.
It should be noted that, in the running state, the Java reflection in the present invention can know, for any class, what methods and attributes the class has. For any one object, we can call on its methods and properties. The Java generic type refers to the parameterization of variable types.
Considering the defects of large development workload and high modification cost in the prior art of parameter transaction, in an embodiment of the present invention, a parameter transaction processing method is provided, as shown in fig. 1, including:
step 110, obtaining parameter transaction data, wherein the parameter transaction data comprises function parameter data and information parameter data.
In detail, the parameter transaction data may be obtained using a unified interface, wherein the unified interface uses a generic definition.
The function parameter data is used for indicating the functions realized by the parameter transaction, including inquiry parameters, addition parameters and maintenance parameters. The information parameter data is determined according to the parameter transaction, for example, the agent bank parameter transaction, wherein the information parameter data comprises a bank number, an organization number and an agent bank BIC, and the invention does not limit the information parameter data in particular.
And 120, carrying out field name transformation on the information parameter data, and carrying out table entity class assignment according to the transformation result.
In one embodiment, performing field name transformation on information parameter data includes: and carrying out field name conversion on the information parameter data according to a preset conversion rule, wherein the conversion rule comprises the association relation between the information parameter fields and the unified fields in each parameter transaction data. The unified fields correspond to the names of the fields in the database table and can be set by a developer, the specific values of the unified fields are not limited, such as a parameter bank number, a mechanism number and a proxy line BIC, and the corresponding unified fields are bank_no, branch_no and agent_ BIC.
In a specific embodiment, performing table entity class assignment according to a transformation result includes: and obtaining data corresponding to each field name in the transformation result by using Java reflection, and assigning the data to the table entity class.
And 130, obtaining a path and a parameter table name stored in the table entity class by using Java reflection, obtaining a table operation class according to the path and the parameter table name, and performing database operation by using the table operation class according to the functional parameter data.
In detail, the table operation class and the table entity class exist under the same directory, and the table operation class names are the parameter table name+dao (last-level package name), so that the path and the parameter table stored in the table entity class are obtained through Java reflection.
The parameter transaction processing method provided by the invention comprises the steps of obtaining parameter transaction data, wherein the parameter transaction data comprises functional parameter data and information parameter data; performing field name transformation on the information parameter data, and performing table entity class assignment according to a transformation result; the path and the parameter table names stored in the table entity class are acquired by utilizing Java reflection, the table operation class is acquired according to the path and the parameter table names, the database is operated by utilizing the table operation class according to the functional parameter data, the parameter transaction can be processed according to a unified mode, and the workload of development and maintenance of the parameter transaction is reduced.
Based on the same inventive concept, the embodiment of the invention also provides a parameter transaction processing device, as described in the following embodiment. Because the principle of the device for solving the problems is similar to that of the parameter transaction processing method, the implementation of the device can refer to the implementation of the parameter transaction processing method, and the repetition is omitted.
Specifically, as shown in fig. 2, the parameter transaction processing device includes:
An entry module 210, configured to obtain parameter transaction data, where the parameter transaction data includes functional parameter data and information parameter data;
the parameter processing module 220 is configured to perform field name transformation on the information parameter data, and perform table entity class assignment according to the transformation result;
And the operation module 330 is configured to obtain a path and a parameter table name stored in the table entity class by using Java reflection, obtain a table operation class according to the path and the parameter table name, and perform database operation by using the table operation class according to the functional parameter data.
In one embodiment of the present invention, the portal module 310 obtains the parameter transaction data, including:
and acquiring parameter transaction data by using a unified interface, wherein the unified interface uses generic definition.
In an embodiment of the present invention, the parameter processing module 320 performs field name transformation on information parameter data, including:
and carrying out field name conversion on the information parameter data according to a preset conversion rule, wherein the conversion rule comprises the association relation between the information parameter fields and the unified fields in each parameter transaction data.
In an embodiment of the present invention, the database operation module 330 performs table entity class assignment according to the transformation result, including:
and obtaining data corresponding to each field name in the transformation result by using Java reflection, and assigning the data to the table entity class.
The parameter transaction processing device provided by the invention can process the parameter transaction according to a unified mode, and reduces the workload of development and maintenance of the parameter transaction.
In an embodiment of the present invention, a computer device is further provided, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, where the processor implements the method for processing a parameter transaction according to any one of the foregoing embodiments when executing the computer program.
In an embodiment of the present invention, there is further provided a computer readable storage medium storing an executable computer program, where the computer program when executed by a processor implements the method for processing a parameter transaction according to any one of the foregoing embodiments.
For a clearer description of the technical solution of the present invention, the following details are given by proxy parameter transaction. The agent row parameter trade name is 31000, the parameter list name is AgentInfo, the corresponding function parameter data is one of inquiry, addition, deletion and maintenance, and the information parameters comprise three fields of bank number, organization number and agent row BIC.
The parameter transaction processing process comprises the following steps:
1) And acquiring agent line parameter transaction data.
2) And carrying out field transformation on information parameters in the agent line parameter transaction data, and transforming a field bank number, an organization number and an agent line BIC into a bank_no, a branch_no and an agent_ BIC.
3) And obtaining data corresponding to each field name in the transformation result by using Java reflection, and assigning the data to the table entity class AgentInfoEntity.
4) The storage path p and the table parameter name of the table entity class AgentInfoEntity are obtained by using Java reflection, the table operation class AgentInfoDao (the class mainly has three operation methods, namely, the class inquires a data table according to a main key, inserts data into the data table and modifies the data table according to the main key) of the table entity class AgentInfoEntity can be found under the same-level directory according to the path p and the table parameter name, and the operation of the database is carried out by using the table operation class according to the functional parameter data.
Taking the function parameter as the insertion data as an example, the call table operation class AgentInfoDao checks whether the data to be inserted exists in the parameter table, and if so, the error is reported. If not, call AgentInfoDao performs the update operation, insert success returns ok, fail to perform the failure processing.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only for the purpose of illustrating the technical solution of the present invention, and any person skilled in the art may modify and change the above-mentioned embodiments without departing from the spirit and scope of the present invention. Therefore, the protection scope of the invention should be considered as the scope of the claims.
Claims (8)
1. A method of processing a parameter transaction, comprising:
Acquiring parameter transaction data, wherein the parameter transaction data comprises function parameter data and information parameter data, the function parameter data is used for indicating the function realized by the parameter transaction, the function comprises inquiring parameters, adding parameters and maintaining parameters, and the information parameter data is determined according to the parameter transaction;
Performing field name transformation on the information parameter data, and performing table entity class assignment according to the transformation result comprises:
Obtaining data corresponding to each field name in the transformation result by using Java reflection, and assigning the data to the table entity class;
Obtaining a path and a parameter table name stored in a table entity class by using Java reflection, obtaining a table operation class from a catalog in the same level as the table entity class according to the path and the parameter table name, and performing database operation by using the table operation class according to functional parameter data, wherein the method comprises the following steps:
When the function parameters are the inserted data, calling a list operation class to check whether the data to be inserted exist in the parameter list, and if so, reporting errors;
If not, the call table operation class performs the update operation.
2. The parametric transaction processing method of claim 1, wherein obtaining parametric transaction data comprises:
and acquiring parameter transaction data by using a unified interface, wherein the unified interface uses generic definition.
3. The parametric transaction processing method of claim 1, wherein performing field name transformations on the information parameter data comprises:
and carrying out field name conversion on the information parameter data according to a preset conversion rule, wherein the conversion rule comprises the association relation between the information parameter fields and the unified fields in each parameter transaction data.
4. A parameter transaction processing device, comprising:
The system comprises an inlet module, a data processing module and a data processing module, wherein the inlet module is used for acquiring parameter transaction data, the parameter transaction data comprises function parameter data and information parameter data, the function parameter data is used for indicating the function realized by parameter transaction and comprises inquiry parameters, addition parameters and maintenance parameters, and the information parameter data is determined according to the parameter transaction;
the parameter processing module is used for carrying out field name transformation on the information parameter data, and carrying out table entity class assignment according to the transformation result comprises the following steps: obtaining data corresponding to each field name in the transformation result by using Java reflection, and assigning the data to the table entity class;
The database operation module is used for obtaining the path and the parameter table name stored in the table entity class by using Java reflection, obtaining the table operation class from the catalog of the same class as the table entity class according to the path and the parameter table name, and performing the operation of the database by using the table operation class according to the functional parameter data, and comprises the following steps:
When the function parameters are the inserted data, calling a list operation class to check whether the data to be inserted exist in the parameter list, and if so, reporting errors;
If not, the call table operation class performs the update operation.
5. The parametric transaction processing device of claim 4, wherein the portal module obtains parametric transaction data comprising:
and acquiring parameter transaction data by using a unified interface, wherein the unified interface uses generic definition.
6. The parametric transaction processing device of claim 4, wherein the processing module performs a field name transformation on the information parameter data, comprising:
and carrying out field name conversion on the information parameter data according to a preset conversion rule, wherein the conversion rule comprises the association relation between the information parameter fields and the unified fields in each parameter transaction data.
7. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method of parameter transaction processing according to any of claims 1 to 3 when the computer program is executed by the processor.
8. A computer readable storage medium, characterized in that the computer readable storage medium stores an executing computer program which, when executed by a processor, implements the parameter transaction processing method of any one of claims 1 to 3.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911415764.6A CN111159198B (en) | 2019-12-31 | 2019-12-31 | Parameter transaction processing method and device, computer equipment and readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911415764.6A CN111159198B (en) | 2019-12-31 | 2019-12-31 | Parameter transaction processing method and device, computer equipment and readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111159198A CN111159198A (en) | 2020-05-15 |
CN111159198B true CN111159198B (en) | 2024-04-19 |
Family
ID=70560166
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911415764.6A Active CN111159198B (en) | 2019-12-31 | 2019-12-31 | Parameter transaction processing method and device, computer equipment and readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111159198B (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101339559A (en) * | 2008-07-18 | 2009-01-07 | 北京航空航天大学 | Long lasting implementing method for data |
CN108304463A (en) * | 2017-12-26 | 2018-07-20 | 中国广核电力股份有限公司 | A kind of data managing method and its database application component for database |
CN108845793A (en) * | 2018-05-03 | 2018-11-20 | 蔡廷超 | A kind of ORM design method and device |
CN109725953A (en) * | 2018-12-11 | 2019-05-07 | 山东浪潮通软信息科技有限公司 | A kind of data interconnection method and system based on Java reflection technology |
-
2019
- 2019-12-31 CN CN201911415764.6A patent/CN111159198B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101339559A (en) * | 2008-07-18 | 2009-01-07 | 北京航空航天大学 | Long lasting implementing method for data |
CN108304463A (en) * | 2017-12-26 | 2018-07-20 | 中国广核电力股份有限公司 | A kind of data managing method and its database application component for database |
CN108845793A (en) * | 2018-05-03 | 2018-11-20 | 蔡廷超 | A kind of ORM design method and device |
CN109725953A (en) * | 2018-12-11 | 2019-05-07 | 山东浪潮通软信息科技有限公司 | A kind of data interconnection method and system based on Java reflection technology |
Also Published As
Publication number | Publication date |
---|---|
CN111159198A (en) | 2020-05-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109840429B (en) | Intelligent contract deployment and calling method and device | |
EP1960899B1 (en) | Conforming web services to an updated contract | |
US7506311B2 (en) | Test tool for application programming interfaces | |
CN110032599B (en) | Data structure reading and updating method and device, and electronic equipment | |
CN110032568B (en) | Data structure reading and updating method and device, and electronic equipment | |
EP3938907A1 (en) | Methods, systems, and computer readable media for data translation using a representational state transfer (rest) application programming interface (api) | |
CN113867719A (en) | Third-party library function disassembling and calling method and system for software platform | |
CN111159198B (en) | Parameter transaction processing method and device, computer equipment and readable storage medium | |
US6934949B2 (en) | Method, computer program product, and system for dual mode batch program execution | |
CN112506516A (en) | Code generation method of security protocol, computer and storage medium | |
US9396239B2 (en) | Compiling method, storage medium and compiling apparatus | |
CN107277108B (en) | Method, device and system for processing messages at nodes of block chain | |
US7007280B1 (en) | Schema driven management of a component-based application | |
US20090144752A1 (en) | Unmanaged-to-managed aggregation | |
TWI414995B (en) | Development and execution platform | |
CN109582330B (en) | Data model upgrading method, device, equipment and readable storage medium | |
US7814069B2 (en) | Wrapper for use with global standards compliance checkers | |
CN113327167B (en) | Block chain data processing method | |
US20130104151A1 (en) | Interface Profiles for Customizing Application Programming Interface Behavior | |
CN111861381B (en) | Access method and system of multi-fund channel | |
CN115729946B (en) | Method, device, equipment and storage medium for processing distributed transaction | |
CN111209295B (en) | Optimization method of computation flow graph, database access method and device | |
CN112000366B (en) | System parameter configuration method and device based on code generator | |
CN116186131A (en) | ETL data processing system and method combining Dubbo service | |
CN115756414A (en) | Database object processing method, storage medium and computer equipment |
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 |