Movatterモバイル変換


[0]ホーム

URL:


CN110837517A - Back-end data processing method and device under front-end and back-end decoupling scene - Google Patents

Back-end data processing method and device under front-end and back-end decoupling scene
Download PDF

Info

Publication number
CN110837517A
CN110837517ACN201911079904.7ACN201911079904ACN110837517ACN 110837517 ACN110837517 ACN 110837517ACN 201911079904 ACN201911079904 ACN 201911079904ACN 110837517 ACN110837517 ACN 110837517A
Authority
CN
China
Prior art keywords
query
data
data corresponding
cache library
parameters
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.)
Pending
Application number
CN201911079904.7A
Other languages
Chinese (zh)
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.)
Unihub China Information Technology Co Ltd
Zhongying Youchuang Information Technology Co Ltd
Original Assignee
Unihub China Information Technology Co 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 Unihub China Information Technology Co LtdfiledCriticalUnihub China Information Technology Co Ltd
Priority to CN201911079904.7ApriorityCriticalpatent/CN110837517A/en
Publication of CN110837517ApublicationCriticalpatent/CN110837517A/en
Pendinglegal-statusCriticalCurrent

Links

Images

Classifications

Landscapes

Abstract

The invention discloses a back-end data processing method and a device under a front-end and back-end decoupling scene, wherein the method comprises the following steps: when a data query instruction sent by a front-end interface is received, scanning a back-end cache library according to a query parameter carried in the data query instruction, acquiring data corresponding to the query parameter from the back-end cache library or a source database according to a scanning result, and responding to the back-end interface according to the data corresponding to the query parameter; when the source database sends a data change instruction, scanning a back-end cache library according to change parameters carried in the data change instruction, and deleting data corresponding to the change parameters from the back-end cache library according to a scanning result. The invention can avoid wasting the back-end performance resource, and effectively improve the accuracy of the query result while ensuring the query efficiency.

Description

Back-end data processing method and device under front-end and back-end decoupling scene
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for processing backend data in a front-end and back-end decoupling scene.
Background
Under the scene of front-back end decoupling, data query can be carried out through the front-back end interface. The existing back-end data processing scheme has the problems that the waste of back-end performance resources is serious, and the query efficiency and the query result accuracy cannot be considered at the same time.
Disclosure of Invention
The embodiment of the invention provides a back-end data processing method under a front-end and back-end decoupling scene, which is used for carrying out back-end interface response under the front-end and back-end decoupling scene, avoiding wasting back-end performance resources, and effectively improving the accuracy of a query result while ensuring the query efficiency, and comprises the following steps:
when a data query instruction sent by a front-end interface is received, scanning a back-end cache library according to a query parameter carried in the data query instruction, acquiring data corresponding to the query parameter from the back-end cache library or a source database according to a scanning result, and responding to the back-end interface according to the data corresponding to the query parameter;
when the source database sends a data change instruction, scanning a back-end cache library according to change parameters carried in the data change instruction, and deleting data corresponding to the change parameters from the back-end cache library according to a scanning result.
The embodiment of the invention provides a back-end data processing device under a front-end and back-end decoupling scene, which is used for carrying out back-end interface response under the front-end and back-end decoupling scene, avoiding wasting back-end performance resources, and effectively improving the accuracy of a query result while ensuring the query efficiency, and the device comprises:
the response module is used for scanning a back-end cache library according to query parameters carried in a data query instruction when the data query instruction sent by a front-end interface is received, acquiring data corresponding to the query parameters from the back-end cache library or a source database according to a scanning result, and responding to the back-end interface according to the data corresponding to the query parameters;
and the deleting module is used for scanning a back-end cache library according to the change parameters carried in the data change instruction when the source database sends the data change instruction, and deleting the data corresponding to the change parameters from the back-end cache library according to the scanning result.
The embodiment of the invention also provides computer equipment which comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the processor executes the computer program to realize the back-end data processing method under the front-end and back-end decoupling scene.
The embodiment of the invention also provides computer equipment which comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the processor executes the computer program to realize the back-end data processing method under the front-end and back-end decoupling scene.
Compared with the scheme that the back end does not cache historical query results or judges whether to use the cache results or re-query data to respond to the interface based on time or query conditions in the prior art, the embodiment of the invention scans the back-end cache library according to query parameters carried in a data query instruction when the data query instruction sent by the front end interface is received, acquires data corresponding to the query parameters from the back-end cache library or a source database according to the scanning result, and performs back-end interface response according to the data corresponding to the query parameters; when the source database sends a data change instruction, scanning a back-end cache library according to change parameters carried in the data change instruction, and deleting data corresponding to the change parameters from the back-end cache library according to a scanning result. When a data query instruction sent by a front-end interface is received, the embodiment of the invention determines whether to acquire data from a back-end cache library or a source database according to the scanning result of the back-end cache library, and does not need to query data from the source database again every time the data query instruction is received, thereby avoiding wasting back-end performance resources, effectively shortening query time, and when a data change instruction is sent by the source database, deleting data corresponding to a change parameter from the back-end cache library according to the scanning result of the back-end cache library, thereby avoiding the problem of query error caused by the change of the source database data and the non-synchronous update of the back-end cache library, and effectively improving the accuracy of the query result while ensuring the query efficiency.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts. In the drawings:
fig. 1 is a schematic diagram of a back-end data processing method in a front-end and back-end decoupling scenario according to an embodiment of the present invention;
fig. 2 is a structural diagram of a back-end data processing apparatus in a front-end and back-end decoupling scenario in the embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the embodiments of the present invention are further described in detail below with reference to the accompanying drawings. The exemplary embodiments and descriptions of the present invention are provided to explain the present invention, but not to limit the present invention.
In order to perform backend interface response in a front-end and backend decoupling scenario, avoid wasting backend performance resources, and effectively improve accuracy of a query result while ensuring query efficiency, an embodiment of the present invention provides a backend data processing method in a front-end and backend decoupling scenario, where as shown in fig. 1, the method may include:
step 101, when a data query instruction sent by a front-end interface is received, scanning a back-end cache library according to a query parameter carried in the data query instruction, acquiring data corresponding to the query parameter from the back-end cache library or a source database according to a scanning result, and performing back-end interface response according to the data corresponding to the query parameter;
step 102, when the source database sends a data change instruction, scanning a back-end cache library according to a change parameter carried in the data change instruction, and deleting data corresponding to the change parameter from the back-end cache library according to a scanning result.
As shown in fig. 1, in the embodiment of the present invention, when a data query instruction sent by a front-end interface is received, a back-end cache library is scanned according to a query parameter carried in the data query instruction, data corresponding to the query parameter is obtained from the back-end cache library or a source database according to a scanning result, and a back-end interface response is performed according to the data corresponding to the query parameter; when the source database sends a data change instruction, scanning a back-end cache library according to change parameters carried in the data change instruction, and deleting data corresponding to the change parameters from the back-end cache library according to a scanning result. When a data query instruction sent by a front-end interface is received, the embodiment of the invention determines whether to acquire data from a back-end cache library or a source database according to the scanning result of the back-end cache library, and does not need to query data from the source database again every time the data query instruction is received, thereby avoiding wasting back-end performance resources, effectively shortening query time, and when a data change instruction is sent by the source database, deleting data corresponding to a change parameter from the back-end cache library according to the scanning result of the back-end cache library, thereby avoiding the problem of query error caused by the change of the source database data and the non-synchronous update of the back-end cache library, and effectively improving the accuracy of the query result while ensuring the query efficiency.
In specific implementation, when a data query instruction sent by a front-end interface is received, a back-end cache library is scanned according to a query parameter carried in the data query instruction, data corresponding to the query parameter is acquired from the back-end cache library or a source database according to a scanning result, and a back-end interface response is carried out according to the data corresponding to the query parameter.
It should be noted that the back-end cache library may be a database capable of quickly completing data reading and writing and matching, such as redis, es, sqlite, and the like, or may directly use a memory to implement the function of the back-end cache library.
In an embodiment, the query parameters carried in the data query instruction include: the interface label, the base table information, the file information, the index information and the partition information are any one or any combination. When the back-end cache library stores information, the interface label is used as a Key value of a main Key, the library table information, the file information, the index information and the partition information related to the interface are used as index columns, and the data corresponding to the interface query parameters are used as specific storage information.
In the embodiment, the main Key value can be used for scanning the back-end cache library, and the query parameters carried in other data query instructions can also be used for scanning the back-end cache library.
In an embodiment, acquiring data corresponding to the query parameter from the back-end cache database or the source database according to the scanning result includes: if the back-end cache library contains the data corresponding to the query parameters, acquiring the data corresponding to the query parameters from the back-end cache library; and if the back-end cache library does not contain the data corresponding to the query parameters, acquiring the data corresponding to the query parameters from the source database.
In an embodiment, the obtaining, according to the scanning result, the data corresponding to the query parameter from the back-end cache database or the source database further includes: and if the back-end cache library does not contain the data corresponding to the query parameters, after the data corresponding to the query parameters are obtained from the source database, the data corresponding to the query parameters are stored in the back-end cache library.
In this embodiment, the data corresponding to the query parameter is stored in the back-end cache library, where the interface tag is used as a Key value of a primary Key, the library table information, the file information, the index information, and the partition information related to the interface are used as an index column, and the data corresponding to the interface query parameter is used as specific storage information.
In specific implementation, when the source database sends a data change instruction, scanning a back-end cache library according to a change parameter carried in the data change instruction, and deleting data corresponding to the change parameter from the back-end cache library according to a scanning result.
In an embodiment, the change parameters carried in the data change instruction include: the interface label, the base table information, the file information, the index information and the partition information are any one or any combination.
The inventor finds that the existing back-end data processing scheme has the problem of query errors caused by the fact that the data of a source database is changed and a back-end cache library is not synchronously updated, so in the embodiment of the invention, when the source database relates to operations such as data warehousing, cleaning, statistics, analysis and the like, a data change instruction is sent by the source database, the back-end cache library is scanned according to change parameters carried in the data change instruction, and if the data corresponding to the change parameters are scanned in the back-end cache library, the data corresponding to the change parameters are deleted from the back-end cache library. The query efficiency is guaranteed, and meanwhile, the accuracy of the query result is effectively improved.
Based on the same inventive concept, the embodiment of the present invention further provides a back-end data processing apparatus in a front-end and back-end decoupling scenario, as described in the following embodiments. Because the principles for solving the problems are similar to the back-end data processing method in the front-end and back-end decoupling scenario, the implementation of the device can refer to the implementation of the method, and repeated details are not repeated.
Fig. 2 is a structural diagram of a back-end data processing apparatus in a front-end and back-end decoupling scenario in an embodiment of the present invention, as shown in fig. 2, the apparatus includes:
a response module 201, configured to, when a data query instruction sent by a front-end interface is received, scan a back-end cache library according to a query parameter carried in the data query instruction, obtain data corresponding to the query parameter from the back-end cache library or a source database according to a scanning result, and perform a back-end interface response according to the data corresponding to the query parameter;
a deleting module 202, configured to scan a back-end cache library according to a change parameter carried in a data change instruction when the source database sends the data change instruction, and delete data corresponding to the change parameter from the back-end cache library according to a scanning result.
In one embodiment, the query parameters carried in the data query instruction include: one or any combination of interface labels, base table information, file information, index information and partition information;
the change parameters carried in the data change instruction include: the interface label, the base table information, the file information, the index information and the partition information are any one or any combination.
In one embodiment, the response module 201 is further configured to:
if the back-end cache library contains the data corresponding to the query parameters, acquiring the data corresponding to the query parameters from the back-end cache library;
and if the back-end cache library does not contain the data corresponding to the query parameters, acquiring the data corresponding to the query parameters from the source database.
In one embodiment, the response module 201 is further configured to:
and if the back-end cache library does not contain the data corresponding to the query parameters, after the data corresponding to the query parameters are obtained from the source database, the data corresponding to the query parameters are stored in the back-end cache library.
In summary, in the embodiment of the present invention, when a data query instruction sent by a front-end interface is received, a back-end cache library is scanned according to a query parameter carried in the data query instruction, data corresponding to the query parameter is obtained from the back-end cache library or a source database according to a scanning result, and a back-end interface response is performed according to the data corresponding to the query parameter; when the source database sends a data change instruction, scanning a back-end cache library according to change parameters carried in the data change instruction, and deleting data corresponding to the change parameters from the back-end cache library according to a scanning result. When a data query instruction sent by a front-end interface is received, the embodiment of the invention determines whether to acquire data from a back-end cache library or a source database according to the scanning result of the back-end cache library, and does not need to query data from the source database again every time the data query instruction is received, thereby avoiding wasting back-end performance resources, effectively shortening query time, and when a data change instruction is sent by the source database, deleting data corresponding to a change parameter from the back-end cache library according to the scanning result of the back-end cache library, thereby avoiding the problem of query error caused by the change of the source database data and the non-synchronous update of the back-end cache library, and effectively improving the accuracy of the query result while ensuring the query efficiency.
As will be appreciated by one skilled in the art, 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 flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams 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-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are only exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (10)

CN201911079904.7A2019-11-072019-11-07Back-end data processing method and device under front-end and back-end decoupling scenePendingCN110837517A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201911079904.7ACN110837517A (en)2019-11-072019-11-07Back-end data processing method and device under front-end and back-end decoupling scene

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201911079904.7ACN110837517A (en)2019-11-072019-11-07Back-end data processing method and device under front-end and back-end decoupling scene

Publications (1)

Publication NumberPublication Date
CN110837517Atrue CN110837517A (en)2020-02-25

Family

ID=69576286

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201911079904.7APendingCN110837517A (en)2019-11-072019-11-07Back-end data processing method and device under front-end and back-end decoupling scene

Country Status (1)

CountryLink
CN (1)CN110837517A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN114020790A (en)*2021-11-082022-02-08中国建设银行股份有限公司 Method and device for querying data

Citations (7)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN102279880A (en)*2011-07-282011-12-14深圳市五巨科技有限公司Method and system for updating cache in real time
US20140317084A1 (en)*2013-04-192014-10-23Oracle International CorporationCaching external data sources for sql processing
CN106202485A (en)*2016-07-182016-12-07乐视控股(北京)有限公司Data manipulation method and system
CN109145020A (en)*2018-07-232019-01-04程之琴Information query method, from server, client and computer readable storage medium
CN109376175A (en)*2018-10-242019-02-22上海中商网络股份有限公司A kind of data managing method, device, equipment and storage medium
CN109656955A (en)*2018-12-102019-04-19泰康保险集团股份有限公司User data query method, system and storage medium
KR102027823B1 (en)*2019-04-242019-10-02주식회사 리앙커뮤니케이션즈Intelligent caching system with improved system response performance based on plug in method

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN102279880A (en)*2011-07-282011-12-14深圳市五巨科技有限公司Method and system for updating cache in real time
US20140317084A1 (en)*2013-04-192014-10-23Oracle International CorporationCaching external data sources for sql processing
CN106202485A (en)*2016-07-182016-12-07乐视控股(北京)有限公司Data manipulation method and system
CN109145020A (en)*2018-07-232019-01-04程之琴Information query method, from server, client and computer readable storage medium
CN109376175A (en)*2018-10-242019-02-22上海中商网络股份有限公司A kind of data managing method, device, equipment and storage medium
CN109656955A (en)*2018-12-102019-04-19泰康保险集团股份有限公司User data query method, system and storage medium
KR102027823B1 (en)*2019-04-242019-10-02주식회사 리앙커뮤니케이션즈Intelligent caching system with improved system response performance based on plug in method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
罗承廉: "《继电保护及自动化新原理、新技术研究与应用》", 28 February 2005, 华中科技大学出版社*
陈新宇 等: "《中台战略 中台建设与数字商业》", 31 October 2019, 机械工业出版社*

Cited By (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN114020790A (en)*2021-11-082022-02-08中国建设银行股份有限公司 Method and device for querying data

Similar Documents

PublicationPublication DateTitle
KR102230661B1 (en) SQL review methods, devices, servers and storage media
CN109815240B (en)Method, apparatus, device and storage medium for managing index
CN109471851B (en)Data processing method, device, server and storage medium
US20190102383A1 (en)Association analysis method and apparatus
CN111143470A (en)Cross-platform database data synchronization comparison method and device
CN104423982A (en)Request processing method and device
CN112115105A (en)Service processing method, device and equipment
CN110647562A (en)Data query method and device, electronic equipment and storage medium
CN111026736A (en)Data blood margin management method and device and data blood margin analysis method and device
CN107451203B (en)Database access method and device
CN111125067B (en)Data maintenance method and device
CN112395307A (en)Statement execution method, statement execution device, server and storage medium
CN110019444B (en)Operation request processing method, device, equipment and system
CN106648839A (en)Method and device for processing data
CN110837517A (en)Back-end data processing method and device under front-end and back-end decoupling scene
CN113868267A (en)Method for injecting time sequence data, method for inquiring time sequence data and database system
CN112579641A (en)Data query method and device, storage medium and electronic equipment
CN111694992A (en)Data processing method and device
CN103092955B (en)Checkpointed method, Apparatus and system
CN110019448B (en)Data interaction method and device
CN108363671B (en)Interface switching method, terminal equipment and storage medium
CN107656868B (en)Debugging method and system for acquiring thread name by using thread private data
CN117271587A (en)Data processing method, device and storage medium based on relational database
CN116610718A (en)Database query method and device, storage medium and computer equipment
CN108121733B (en) Data query method and device

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
RJ01Rejection of invention patent application after publication
RJ01Rejection of invention patent application after publication

Application publication date:20200225


[8]ページ先頭

©2009-2025 Movatter.jp