Unlock instant, AI-driven research and patent intelligence for your innovation.

Data reading method and terminal

A data reading and data technology, applied in the computer field, can solve problems such as the client cannot read data, business abnormalities, etc., to achieve the effects of ensuring accuracy, reducing the amount of reading, and reducing pressure

Pending Publication Date: 2021-12-07
FUJIAN TIANQUAN EDUCATION TECH LTD
View PDF6 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, under such a read-write separation architecture, there will be a certain delay due to data synchronization from the master node to each slave node. If network jitter or other abnormal conditions cause master-slave delays, at this time, the client slave node The data will not be read, or the read data will be dirty, resulting in abnormal business

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
  • Data reading method and terminal
  • Data reading method and terminal

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0059] Please refer to figure 1 , a data reading method, comprising steps:

[0060] S1. Establish a database proxy layer. When a data change operation is received, the proxy layer modifies the data in the database master node, and caches the updated updated data in the proxy layer.

[0061] Specifically, in this embodiment, there is a mysql proxy layer proxy, and all clients that need to operate the mysql database need to perform unified processing through the proxy layer.

[0062] Wherein, if the data change operation is received, changing the data in the database master node through the proxy layer, and caching the changed update data to the proxy layer includes:

[0063] After receiving the data modification operation, the proxy layer modifies the data in the master node, and caches the ID of the updated updated data and the table name of the database table where it is located in the proxy layer.

[0064] Specifically, in this embodiment, assuming that there is a master n...

Embodiment 2

[0079] A data reading method. The difference between this embodiment and Embodiment 1 is that it further defines how to confirm unsynchronized data and synchronized data, specifically:

[0080] The calculation of the delayed data volume according to the delayed time and the number of transactions per second of the database includes:

[0081] Calculate the total amount of delayed data corresponding to each time period based on the number of database transactions per second and the delay time in different time periods.

[0082] Wherein, the data contained in the delayed data amount is compared with the updated data cached in the proxy layer, and the unsynchronized data and synchronized data obtained include:

[0083] Comparing the slave node data corresponding to the total amount of delayed data in each time period with the update data cached in the proxy layer, and judging whether the slave node data is the same as the update data, if so, then The data in the time period is sy...

Embodiment 3

[0086] Please refer to figure 2 , a data reading terminal, comprising a memory, a processor, and a computer program stored on the memory and operable on the processor, and one of the first or second embodiments is implemented when the processor executes the computer program The various steps of the data reading method.

[0087]To sum up, the data reading method and terminal provided by the present invention, by establishing a database proxy layer, can change the data in the master node when receiving a data change operation, and save the changed updated data In the proxy layer, among them, the ID of the updated updated data and the table name of the database table where it is located are cached to the proxy layer, which can be cached in units of data, and can be stored in the same table according to different data when subsequent data is read. Choose different reading methods for data to reduce the pressure on the master node to a certain extent; when receiving data read ope...

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 data reading method and a terminal, and the method comprises the steps: building a database agent layer, changing data in a main node when a data change operation is received, and storing the changed update data in the agent layer; and when a data reading operation is received, judging whether the master-slave synchronization is delayed or not, if so, calculating a delayed data volume according to the delay time and the number of transactions per second of the database, comparing data contained in the delayed data volume with the updated data cached in the proxy layer to obtain unsynchronized data and synchronized data. Through interaction between the agent layer and the database, synchronized data can be read from the slave node, unsynchronized data can be read from the master node, and the phenomenon that a client cannot read data or dirty data from the slave node to cause business abnormity is avoided, so that the data reading accuracy is ensured, meanwhile, and the reading amount of the master node is reduced. And the pressure of the main node is reduced to a certain extent.

Description

technical field [0001] The invention relates to the field of computer technology, in particular to a data reading method and a terminal. Background technique [0002] Today, with the vigorous development of the mobile Internet, there are various databases, and due to the use of a large number of Internet users, a large amount of data will be brought, which will put a lot of pressure on the database. In order to alleviate the pressure on the database, the general architecture of the database is distributed deployment to improve the QPS (Query Per Second, query rate per second) data of the database. [0003] However, as the number of users continues to increase, there are higher requirements for the QPS of the database. At this time, the read-write separation architecture of the master-slave database is generally adopted, and the data is written on the master node, and the read data is on the slave node. on the node. Using this read-write separation architecture can further ...

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): G06F16/23G06F16/27G06F16/25
CPCG06F16/23G06F16/27G06F16/25
Inventor 刘德建林伟陈宏
Owner FUJIAN TIANQUAN EDUCATION TECH LTD
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