Supercharge Your Innovation With Domain-Expert AI Agents!

Method and device for data routing based on Java annotations

A data routing, java-like technology, applied in the field of data query and operation, can solve problems such as small business/team size, unfriendly, unsuitable for small-scale teams, etc.

Active Publication Date: 2020-09-08
北京思特奇信息技术股份有限公司
View PDF6 Cites 4 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

At present, the mainstream solution for sub-database and sub-table is to use database proxy middleware, which will perform data routing by parsing SQL statements. However, powerful database proxy middleware is generally more complex in architecture and requires the team to Its operation and maintenance capabilities also require certain restrictions on the SQL written by developers. For some applications that require data fragmentation, but the business / team size is small, it is not friendly. The cost of building a complete set of database proxy middleware Larger, not suitable for small teams

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method and device for data routing based on Java annotations
  • Method and device for data routing based on Java annotations
  • Method and device for data routing based on Java annotations

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0044] The principles and features of the present invention will be described below in conjunction with the accompanying drawings, and the examples given are only used to explain the present invention, and are not intended to limit the scope of the present invention.

[0045] Such as figure 1 As shown, a method for data routing based on Java annotations provided by the embodiment of the present invention, the method includes: S1, creating routing annotations on the target object method of the Java class;

[0046] It should be noted that according to the Java annotation syntax, create a custom data routing annotation @DataSourceRouter(routingKey=XXX), which can be placed on a Java class or method, where the routingKey attribute can accept e1 expression. In a certain embodiment, in the java environment, the code that realizes the dynamic data routing function can be constructed as a public jar package, wherein the jar can include: data routing annotations, automatically generate...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a method and device for data routing based on Java annotations, and relates to the field of data query and operation. The method comprises the following steps of creating a routing annotation on a target object method of a Java class; generating a corresponding Proxy proxy class for the method for creating the target object after the routing annotation; dynamically loadinginto the JVM; generating a Proxy proxy object; intercepting a method calling request by the Proxy proxy object; analyzing routing annotations, obtaining an in-parameter parameter of the request and anel expression carried by the route annotation; according to the data routing method, the input parameter is calculated through the el expression on the routing annotation to obtain the database connection information, the target object method is called, the database connection information is combined, the target database is operated, communication analysis and SQL analysis are not needed, the cost is lower, the speed is higher, and the simpler, lighter and more efficient data routing method is achieved.

Description

technical field [0001] The invention relates to the field of data query and operation, in particular to a method and device for data routing based on Java annotations. Background technique [0002] With the growth of business, the amount of data stored in the tables of relational databases (MySQL / Oracle, etc.) is increasing. When the amount of data reaches a certain level, MySq1 single table is more than 800w, and Oracle single table is more than 3000w-5000w), There will be performance problems with complex queries or change operations. In response to this situation, the general processing method is to split the data into databases. At present, the mainstream solution for sub-database and sub-table is to use database proxy middleware, which will perform data routing by parsing SQL statements. However, powerful database proxy middleware is generally more complex in architecture and requires the team to Its operation and maintenance capabilities also require certain restrict...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): G06F9/445G06F16/242G06F16/2455G06F16/28G06F16/25
CPCG06F9/44521G06F16/2456G06F16/2433G06F16/284G06F16/25Y02D10/00
Inventor 张少峰
Owner 北京思特奇信息技术股份有限公司
Features
  • R&D
  • Intellectual Property
  • Life Sciences
  • Materials
  • Tech Scout
Why Patsnap Eureka
  • Unparalleled Data Quality
  • Higher Quality Content
  • 60% Fewer Hallucinations
Social media
Patsnap Eureka Blog
Learn More