CN106339253B - Method and device for data calling between systems - Google Patents

Method and device for data calling between systems Download PDF

Info

Publication number
CN106339253B
CN106339253B CN201510390902.5A CN201510390902A CN106339253B CN 106339253 B CN106339253 B CN 106339253B CN 201510390902 A CN201510390902 A CN 201510390902A CN 106339253 B CN106339253 B CN 106339253B
Authority
CN
China
Prior art keywords
data
database table
change characteristics
calling system
upper layer
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
CN201510390902.5A
Other languages
Chinese (zh)
Other versions
CN106339253A (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.)
Alibaba China Network Technology Co Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201510390902.5A priority Critical patent/CN106339253B/en
Publication of CN106339253A publication Critical patent/CN106339253A/en
Application granted granted Critical
Publication of CN106339253B publication Critical patent/CN106339253B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

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

Abstract

the application provides a method and a device for data calling between systems, wherein the method comprises the following steps: inquiring the change characteristics of each related database table according to a data abstract acquisition request sent by an upper calling system; sending the change characteristics of the database table obtained by query to the upper layer calling system; receiving a comparison result of the local storage change characteristics returned by the upper layer calling system and the received change characteristics of the database table; and if the comparison result is inconsistent, sending the related database table data to the upper layer calling system. According to the method and the device, the bottom data does not need to be abstracted, and the time consumption for data interaction between systems is reduced.

Description

Method and device for data calling between systems
Technical Field
The present application relates to the field of information technology, and in particular, to a method and an apparatus for inter-system data call.
background
in a common business operation process, an upper calling system has a large amount of data dependence on a base data (basedata) system. The underlying data may be changed at any time, and if the underlying data is called in real time in each business operation process, more than 100 times of the underlying data is usually called for one business completion. Although the underlying data is cached for the common data, the network consumption, the customer responsiveness and the load between systems are all greatly affected. For example, a normal network interaction takes 2ms, and each service operation procedure calls more than 100 times of underlying data, which takes more than 200 ms. In addition, in the process of waiting for returning to the bottom layer data, the upper layer calling system causes frequent CPU context switching due to a large number of waiting threads, and the concurrency performance of various applications is reduced.
In order to improve the technical defects, the bottom layer data required by the upper layer calling system is usually loaded to the local memory of the upper layer calling system, and the upper layer calling system only acquires the bottom layer data when the upper layer calling system is started for the first time and after the bottom layer data is changed. Referring to fig. 1, when the bottom layer data is changed, the bottom layer data system a sends a message, and after the upper layer calling system B monitors the message, the bottom layer data system a is called again to obtain the latest data and cache the latest data in the local memory of the upper layer calling system B. However, when there are a plurality of upper layer calling systems and the underlying data depended on by the underlying data system are different, some upper layer service systems receive the message sent by the upper layer calling system even if the changed underlying data cannot be applied, and have to retrieve the data.
Disclosure of Invention
in view of this, the present application provides a method and an apparatus for performing data call between systems, which do not need to abstract underlying data, and reduce time consumption for performing data interaction between systems.
The application provides a method for data calling between systems, which is applied to a bottom layer data system and comprises the following steps:
inquiring the change characteristics of each related database table according to a data abstract acquisition request sent by an upper calling system;
Sending the change characteristics of the database table obtained by query to the upper layer calling system;
receiving a comparison result of the change characteristics of the locally stored database table returned by the upper layer calling system and the received change characteristics of the database table;
And if the comparison result is inconsistent, sending the related database table data to the upper layer calling system.
in a specific implementation of the present application, querying change characteristics of each database table related to according to a data summary acquisition request sent by an upper-layer call system further includes:
If the bottom data is modified, the last modification time of the database table is saved or updated;
The change characteristics of the database table include: the number of records of the database table and the last modification time.
In a specific implementation of the present application, the method further includes:
and if the comparison result is consistent, data does not need to be sent to the upper layer calling system.
The application also provides a method for detecting data change, which is applied to an upper layer calling system and comprises the following steps:
initiating a data summary acquisition request to a bottom data system, and enabling the bottom data system to inquire the change characteristics of each database table related to the change characteristics;
receiving change characteristics of a database table obtained by the inquiry of the bottom data system;
Comparing the change characteristics of the locally stored database table with the received change characteristics of the database table, and sending a comparison result to the bottom data system;
and if the comparison result is inconsistent, receiving the related database table data sent by the underlying data system.
In a specific implementation of the present application, the change feature of the database table includes: the number of records of the database table and the last modification time.
Corresponding to the above method, the present application further provides a device for data call between systems, which is applied to a bottom layer data system, and the device includes:
The characteristic query module is used for querying the change characteristics of each database table according to a data abstract acquisition request sent by the upper-layer calling system;
The characteristic sending module is used for sending the change characteristics of the database table obtained by query to the upper layer calling system;
the result receiving module is used for receiving a comparison result of the change characteristics of the locally stored database table returned by the upper layer calling system and the received change characteristics of the database table;
And the data sending module is used for sending the related database table data to the upper-layer calling system when the comparison result is inconsistent.
in a specific implementation of the present application, the apparatus further includes:
the modification storage module is used for storing or updating the last modification time of the database table when the bottom data is modified;
the change characteristics of the database table include: the number of records of the database table and the last modification time.
In a specific implementation of the present application, the apparatus further includes:
And the data forbidding module is used for not sending data to the upper layer calling system when the comparison result is consistent.
The present application further provides a device for detecting data change, which is applied to an upper layer calling system, the device includes:
And the request sending module is used for initiating a data abstract obtaining request to the bottom layer data system and enabling the bottom layer data system to inquire the change characteristics of each database table related to the change characteristics.
And the characteristic receiving module is used for receiving the change characteristics of the database table obtained by the inquiry of the bottom data system.
and the result sending module is used for comparing the change characteristics of the locally stored database table with the received change characteristics of the database table and sending the comparison result to the bottom data system.
And the data receiving module is used for receiving the related database table data sent by the underlying data system when the comparison result is inconsistent.
In a specific implementation of the present application, the change feature of the database table includes: the number of records of the database table and the last modification time.
According to the technical scheme, the bottom data system queries the change characteristics of each related database table according to the data abstract acquisition request sent by the upper calling system, the data abstract is not needed, and the bottleneck of the high-concurrency high-performance system caused by the data abstract is avoided. The upper layer calling system compares the change characteristics of the locally stored database table with the received change characteristics of the database table. If the comparison result is inconsistent, the change of the bottom data is represented, and the related database table data is sent to the upper calling system, so that the response time of the system is prolonged, and the network I/O consumption and the context switching of the CPU are reduced.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be 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 described in the present application, and other drawings can be obtained by those skilled in the art according to the drawings.
FIG. 1 is a data interaction diagram of a prior art application scenario;
FIG. 2 is a hardware block diagram of a distributed server for use in the underlying data system of the present application;
FIG. 3 is a flowchart of an embodiment of a method for inter-system data invocation of the present application;
FIG. 4 is a flow chart of another embodiment of a method for inter-system data invocation of the present application;
FIG. 5 is a flow diagram of yet another embodiment of a method for inter-system data invocation according to the present application;
FIG. 6 is a hardware structure diagram of a distributed server applied to the upper layer calling system of the present application;
FIG. 7 is a flowchart of an embodiment of a method for inter-system data invocation of the present application;
FIG. 8 is a flow chart of another embodiment of a method for inter-system data invocation of the present application;
FIG. 9 is a block diagram of an embodiment of an apparatus for inter-system data invocation of the present application;
FIG. 10 is a block diagram of another embodiment of an apparatus for inter-system data invocation of the present application;
FIG. 11 is a block diagram of yet another embodiment of an apparatus for inter-system data invocation according to the present application;
FIG. 12 is a flow chart of yet another embodiment of an apparatus for inter-system data invocation of the present application;
FIG. 13 is a schematic diagram of data interaction of an application scenario for inter-system data invocation according to the present application.
Detailed Description
Because the bottom layer data is required to be called in real time for many times in each business operation process, some upper layer business systems receive the message sent by the upper layer calling system even if the changed bottom layer data cannot be applied, and the bottom layer data has to be obtained again. When the upper layer service system B calls the bottom layer data system A, all the used database tables are transmitted to the bottom layer data system A before the service call is initiated. The data summary is made once by the bottom data system A, namely the data base table is summarized into a simple value, and the upper business system B can determine whether the data changes by comparing the change of the current value with the change of the historical value. Specifically, the upper layer service system B matches the data summary returned by the bottom layer data system a with the local data summary stored in the local memory, and if the two data summaries match, the data is not repeatedly acquired, otherwise, the data is repeatedly acquired. However, in general, a data summary is a query of all records of a database table involved, and an algorithm such as MD5 is used to obtain a numerical value. The acquisition of data summaries can present a bottleneck for systems requiring high concurrency and high performance.
According to the method and the system, the bottom data system queries the change characteristics of each related database table according to the data abstract acquisition request sent by the upper calling system, and data abstract is not needed, so that the bottleneck of the high-concurrency high-performance system caused by the data abstract is avoided. The upper layer calling system compares the change characteristics of the locally stored database table with the received change characteristics of the database table. If the comparison result is inconsistent, the change of the bottom data is represented, and the related database table data is sent to the upper calling system, so that the response time of the system is prolonged, and the network I/O consumption and the context switching of the CPU are reduced.
of course, it is not necessary for any particular embodiment of the invention to achieve all of the above-described advantages at the same time.
in order to make those skilled in the art better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not examples. All other embodiments that can be derived from the embodiments given herein by a person of ordinary skill in the art are intended to be within the scope of the present disclosure.
The application provides a method for data calling between systems, which is applied to a bottom layer data system. The underlying data system of the present application may be a distributed server in a hardware structure, see fig. 2, the hardware structure of the distributed server 2 includes a controller 21, a memory 22, and other hardware 23.
Referring to fig. 3, an embodiment of the present application describes a method 3 including:
And S1, inquiring the change characteristics of each database table according to the data abstract acquisition request sent by the upper-layer calling system.
Specifically, the upper calling system periodically sends a data summary acquisition request to the lower data system, and transmits the related database table in an array form. And after receiving the data abstract acquisition request, the bottom layer data system does not summarize the database tables related to the data abstract acquisition request into a data abstract. The underlying data system of this embodiment only queries the change characteristics of the database table to which the data summary acquisition request relates.
Because the database tables involved in the data summary acquisition request are summarized into the data summary, a bottleneck can be brought to a high-concurrency and high-performance system. The embodiment queries the change characteristics of the database table related to the data abstract acquisition request, so that the time for data abstraction is reduced, and the bottleneck of a high-concurrency high-performance system caused by the data abstract is avoided.
And S2, sending the change characteristics of the database table obtained by query to the upper layer calling system.
in a specific implementation of the present application, the present embodiment sends the change characteristic of the database table related to the query data summary obtaining request to the upper-layer calling system that sends the query data summary obtaining request.
And S3, receiving a comparison result of the change characteristics of the locally stored database table returned by the upper layer calling system and the change characteristics of the received database table.
and after the upper layer calling system receives the change characteristics of the database table, comparing the change characteristics of the database table stored locally with the received change characteristics. And the upper layer calling system sends the comparison result to the bottom layer data system.
And S4, if the comparison result is inconsistent, sending the related database table data to the upper layer calling system.
if the comparison result sent by the upper layer calling system is inconsistent, it indicates that the data of the bottom layer data system is changed, and the upper layer calling system needs to reacquire the data of the bottom layer data system. And the bottom layer data system sends the related database table data to the upper layer calling system. And the upper layer calls the system to obtain the updated data sent by the bottom layer data system.
in another specific implementation of the present application, referring to fig. 4, the method 4 includes:
s0, such as modifying the bottom data, the last modification time of the database table is saved or updated.
The change characteristics of the database table include: the number of records of the database table and the last modification time.
Specifically, if the bottom layer data system modifies a certain bottom layer data, the database tables of the bottom layer data system can be modified synchronously, and if the last modification time of the database tables of the bottom layer data system is not stored in the history record, the last modification time of the database tables of the bottom layer data system is stored after the bottom layer data is modified this time. And the bottom layer data system modifies certain bottom layer data, and if the last modification time of the database table is stored in the history record, the last modification time of the database table is updated after the bottom layer data is modified this time.
according to the method and the device, the last modification time of the database table is saved or updated according to the modification of the bottom data, so that the record number and the last modification time of the database table are used as the change characteristics of the database table and are used as the basis for judging whether the bottom data is changed or not.
s1', according to the data abstract obtaining request sent by the upper calling system, inquiring the record number and the last modification time of each database table involved.
Specifically, the upper calling system periodically sends a data summary acquisition request to the lower data system, and transmits the related database table in an array form. And after receiving the data abstract acquisition request, the bottom layer data system does not summarize the database tables related to the data abstract acquisition request into a data abstract. The underlying data system of the embodiment only queries the record number and the last modification time of the database table involved in the data summary obtaining request.
Because the database tables involved in the data summary acquisition request are summarized into the data summary, a bottleneck can be brought to a high-concurrency and high-performance system. In the embodiment, only the record number and the last modification time of the database table related to the data abstract acquisition request are inquired, so that the time for performing data abstract is reduced, and the bottleneck of a high-concurrency high-performance system caused by the data abstract is avoided.
s2', the record number of the database table obtained by the query and the last modification time are sent to the upper calling system.
In a specific implementation of the present application, the present embodiment sends the record number and the last modification time of the database table related to the query data summary obtaining request to the upper layer calling system that sends the query data summary obtaining request.
S3', receiving the comparison result of the record number and the last modification time of the locally saved database table returned by the upper layer calling system and the received record number and the last modification time of the database table.
and after the upper layer calling system receives the record number and the last modification time of the database table, comparing the record number and the last modification time of the database table stored locally with the received record number and the last modification time. And the upper layer calling system sends the comparison result to the bottom layer data system.
And S4', if the comparison result is inconsistent, sending the related database table data to the upper-layer calling system.
If the comparison result sent by the upper layer calling system is inconsistent, it indicates that the data of the bottom layer data system is changed, and the upper layer calling system needs to reacquire the data of the bottom layer data system. And the bottom layer data system sends the related database table data to the upper layer calling system. And the upper layer calls the system to obtain the updated data sent by the bottom layer data system.
In this embodiment, the upper layer call system determines whether the data of the bottom layer data system changes by comparing the record number and the last modification time of the database table sent by the bottom layer data system with the record number and the last modification time of the locally stored database table. The method and the device are simple to operate, network consumption and load among systems are avoided, and customer responsiveness is improved.
in another specific implementation of the present application, referring to fig. 5, the method 5 includes, in addition to the above steps S1-S4, the steps of:
And S5, if the comparison result is consistent, data does not need to be sent to the upper layer calling system.
If the comparison result sent by the upper layer calling system is inconsistent, it indicates that the data of the bottom layer data system is not changed, and the upper layer calling system does not need to reacquire the data of the bottom layer data system. The bottom data system does not need to send data to the upper layer calling system, so that data interaction between the upper layer calling system and the bottom data system is reduced, the response time of the system is prolonged, the network I/O consumption is reduced, and the context switching of a CPU is reduced.
The application also provides a method for data calling between systems, which is applied to an upper calling system. The upper calling system of the present application may be a distributed server in a hardware structure, and referring to fig. 6, the hardware structure of the distributed server 6 includes a controller 61, a memory 62, and other hardware 653.
Referring to fig. 7, the method 7 of the present application includes:
And P1, initiating a data summary acquisition request to the bottom layer data system, and enabling the bottom layer data system to inquire the change characteristics of each database table involved.
Specifically, the upper calling system periodically sends a data summary acquisition request to the lower data system, and transmits the related database table in an array form. And after receiving the data abstract acquisition request, the bottom layer data system does not summarize the database tables related to the data abstract acquisition request into a data abstract. The underlying data system of this embodiment only queries the change characteristics of the database table to which the data summary acquisition request relates.
Because the database tables involved in the data summary acquisition request are summarized into the data summary, a bottleneck can be brought to a high-concurrency and high-performance system. In the embodiment, only the change characteristics of the database table related to the data abstract acquisition request are queried, so that the time for data abstraction is reduced, and the bottleneck of a high-concurrency high-performance system caused by the data abstract is avoided.
And P2, receiving the change characteristics of the database table obtained by the inquiry of the bottom data system.
in a specific implementation of the present application, the present embodiment sends the change characteristic of the database table related to the query data summary obtaining request to the upper-layer calling system that sends the query data summary obtaining request.
And P3, comparing the change characteristics of the locally stored database table with the received change characteristics of the database table, and sending the comparison result to the bottom layer data system.
And after the upper layer calling system receives the change characteristics of the database table, comparing the change characteristics of the database table stored locally with the received change characteristics. If the comparison result obtained by the upper layer calling system is inconsistent, the data of the bottom layer data system is changed, otherwise, the data of the bottom layer data system is not changed. And the upper layer calling system sends the comparison result to the bottom layer data system.
and P4, if the comparison result is inconsistent, receiving the related database table data sent by the bottom data system.
And if the comparison result obtained by the upper-layer calling system is inconsistent, namely the data of the bottom-layer data system is changed, the bottom-layer data system sends the related database table data to the upper-layer calling system. And the upper calling system receives the related database table data sent by the bottom data system.
Specifically, the upper layer calling system acquires the related database table data sent by the bottom layer data system at one time, and then acquires each bottom layer data according to the database table data.
If the comparison result obtained by the upper calling system is consistent, namely the data of the bottom data system is not changed, the bottom data system does not send the data to the upper calling system any more. Therefore, data interaction between the upper layer calling system and the bottom layer data system is reduced, the response time of the system is prolonged, network I/O consumption is reduced, and context switching of a CPU is reduced.
in another specific implementation of the present application, the change characteristic of the database table includes: the number of records of the database table and the last modification time.
Referring to fig. 8, the method 8 described herein includes:
P1', initiates a data summary get request to the underlying data system, which makes the underlying data system query the number of records and the last modification time of each database table involved.
specifically, the upper calling system periodically sends a data summary acquisition request to the lower data system, and transmits the related database table in an array form. And after receiving the data abstract acquisition request, the bottom layer data system does not summarize the database tables related to the data abstract acquisition request into a data abstract. The underlying data system of the embodiment only queries the record number and the last modification time of the database table involved in the data summary obtaining request.
Because the database tables involved in the data summary acquisition request are summarized into the data summary, a bottleneck can be brought to a high-concurrency and high-performance system. In the embodiment, only the record number and the last modification time of the database table related to the data abstract acquisition request are inquired, so that the time for performing data abstract is reduced, and the bottleneck of a high-concurrency high-performance system caused by the data abstract is avoided.
P2', the number of records and the last modification time of the database table obtained by receiving the query of the underlying data system.
In a specific implementation of the present application, the present embodiment sends the record number and the last modification time of the database table related to the query data summary obtaining request to the upper layer calling system that sends the query data summary obtaining request.
And P3', comparing the record number and the last modification time of the database table stored locally with the record number and the last modification time of the received database table, and sending the comparison result to the bottom layer data system.
and after the upper layer calling system receives the record number and the last modification time of the database table, comparing the record number and the last modification time of the database table stored locally with the received record number and the last modification time. If the comparison result obtained by the upper layer calling system is inconsistent, the data of the bottom layer data system is changed, otherwise, the data of the bottom layer data system is not changed. And the upper layer calling system sends the comparison result to the bottom layer data system.
and P4', if the comparison result is inconsistent, receiving the related database table data sent by the underlying data system.
And if the comparison result obtained by the upper-layer calling system is inconsistent, namely the data of the bottom-layer data system is changed, the bottom-layer data system sends the related database table data to the upper-layer calling system. And the upper calling system receives the related database table data sent by the bottom data system.
Specifically, the upper layer calling system acquires the related database table data sent by the bottom layer data system at one time, and then acquires each bottom layer data according to the database table data.
if the comparison result obtained by the upper calling system is consistent, namely the data of the bottom data system is not changed, the bottom data system does not send the data to the upper calling system any more. Therefore, data interaction between the upper layer calling system and the bottom layer data system is reduced, the response time of the system is prolonged, network I/O consumption is reduced, and context switching of a CPU is reduced.
in this embodiment, the upper layer call system determines whether the data of the bottom layer data system changes by comparing the record number and the last modification time of the database table sent by the bottom layer data system with the record number and the last modification time of the locally stored database table. The method and the device are simple to operate, network consumption and load among systems are avoided, and customer responsiveness is improved.
Corresponding to the method, the application also provides a device for data calling between systems, which is applied to a bottom layer data system. The underlying data system of the present application may be a distributed server in a hardware structure, and referring to fig. 1, the hardware structure of the distributed server 1 includes a controller 11, a memory 12, and other hardware 13.
Referring to fig. 9, the apparatus 9 according to an embodiment of the present application includes:
And the characteristic query module 91 is configured to query the change characteristic of each database table according to the data summary acquisition request sent by the upper-layer call system.
and the characteristic sending module 92 is configured to send the change characteristic of the database table obtained through the query to the upper-layer calling system.
And a result receiving module 93, configured to receive a comparison result, returned by the upper layer calling system, of the change feature of the locally stored database table and the received change feature of the database table.
And a data sending module 94, configured to send the related database table data to the upper-layer calling system when the comparison result is inconsistent.
specifically, the upper calling system periodically sends a data summary acquisition request to the lower data system, and transmits the related database table in an array form. And after receiving the data abstract acquisition request, the bottom layer data system does not summarize the database tables related to the data abstract acquisition request into a data abstract. The underlying data system of this embodiment only queries the change characteristics of the database table to which the data summary acquisition request relates.
Because the database tables involved in the data summary acquisition request are summarized into the data summary, a bottleneck can be brought to a high-concurrency and high-performance system. In the embodiment, only the change characteristics of the database table related to the data abstract acquisition request are queried, so that the time for data abstraction is reduced, and the bottleneck of a high-concurrency high-performance system caused by the data abstract is avoided.
In a specific implementation of the present application, the present embodiment sends the change characteristic of the database table related to the query data summary obtaining request to the upper-layer calling system that sends the query data summary obtaining request.
And after the upper layer calling system receives the change characteristics of the database table, comparing the change characteristics of the database table stored locally with the received change characteristics. And the upper layer calling system sends the comparison result to the bottom layer data system.
If the comparison result sent by the upper layer calling system is inconsistent, it indicates that the data of the bottom layer data system is changed, and the upper layer calling system needs to reacquire the data of the bottom layer data system. And the bottom layer data system sends the related database table data to the upper layer calling system. And the upper layer calls the system to obtain the updated data sent by the bottom layer data system.
in another specific implementation of the present application, referring to fig. 10, the apparatus 10 further comprises:
and a modification saving module 100 for saving or updating the last modification time of the database table when the underlying data is modified.
The change characteristics of the database table include: the number of records of the database table and the last modification time.
Specifically, if the bottom layer data system modifies a certain bottom layer data, the database tables of the bottom layer data system can be modified synchronously, and if the last modification time of the database tables of the bottom layer data system is not stored in the history record, the last modification time of the database tables of the bottom layer data system is stored after the bottom layer data is modified this time. And the bottom layer data system modifies certain bottom layer data, and if the last modification time of the database table is stored in the history record, the last modification time of the database table is updated after the bottom layer data is modified this time.
According to the method and the device, the last modification time of the database table is saved or updated according to the modification of the bottom data, so that the record number and the last modification time of the database table are used as the change characteristics of the database table and are used as the basis for judging whether the bottom data is changed or not.
The feature query module 101 is specifically configured to query the record number and the last modification time of each database table related to according to a data summary acquisition request sent by the upper-layer call system.
The feature sending module 102 is specifically configured to send the record number of the database table obtained by the query and the last modification time to the upper-layer call system.
The result receiving module 103 is specifically configured to receive a comparison result between the number of records and the last modification time of the locally stored database table returned by the upper layer calling system and the number of records and the last modification time of the received database table.
the data sending module 104 is specifically configured to send the related database table data to the upper-layer calling system when the comparison result is inconsistent.
Specifically, the upper calling system periodically sends a data summary acquisition request to the lower data system, and transmits the related database table in an array form. And after receiving the data abstract acquisition request, the bottom layer data system does not summarize the database tables related to the data abstract acquisition request into a data abstract. The underlying data system of the embodiment only queries the record number and the last modification time of the database table involved in the data summary obtaining request.
Because the database tables involved in the data summary acquisition request are summarized into the data summary, a bottleneck can be brought to a high-concurrency and high-performance system. In the embodiment, only the record number and the last modification time of the database table related to the data abstract acquisition request are inquired, so that the time for performing data abstract is reduced, and the bottleneck of a high-concurrency high-performance system caused by the data abstract is avoided.
In a specific implementation of the present application, the present embodiment sends the record number and the last modification time of the database table related to the query data summary obtaining request to the upper layer calling system that sends the query data summary obtaining request.
And after the upper layer calling system receives the record number and the last modification time of the database table, comparing the record number and the last modification time of the database table stored locally with the received record number and the last modification time. And the upper layer calling system sends the comparison result to the bottom layer data system.
If the comparison result sent by the upper layer calling system is inconsistent, it indicates that the data of the bottom layer data system is changed, and the upper layer calling system needs to reacquire the data of the bottom layer data system. And the bottom layer data system sends the related database table data to the upper layer calling system. And the upper layer calls the system to obtain the updated data sent by the bottom layer data system.
In this embodiment, the upper layer call system determines whether the data of the bottom layer data system changes by comparing the record number and the last modification time of the database table sent by the bottom layer data system with the record number and the last modification time of the locally stored database table. The method and the device are simple to operate, network consumption and load among systems are avoided, and customer responsiveness is improved.
In another specific implementation of the present application, referring to fig. 11, the apparatus 11 includes, in addition to the feature query module 91, the feature sending module 92, the result receiving module 93, and the data sending module 94:
and a data prohibition module 95, configured to, when the comparison result is consistent, not send data to the upper layer call system.
if the comparison result sent by the upper layer calling system is inconsistent, it indicates that the data of the bottom layer data system is not changed, and the upper layer calling system does not need to reacquire the data of the bottom layer data system. The bottom data system does not need to send data to the upper layer calling system, so that data interaction between the upper layer calling system and the bottom data system is reduced, the response time of the system is prolonged, the network I/O consumption is reduced, and the context switching of a CPU is reduced.
the application also provides a device for data calling between systems, which is applied to an upper layer calling system. The upper calling system of the present application may be a distributed server in a hardware structure, and referring to fig. 6, the hardware structure of the distributed server 6 includes a controller 61, a memory 62, and other hardware 653.
Referring to fig. 12, the apparatus 12 of the present application includes:
the request sending module 121 is configured to initiate a data summary obtaining request to a bottom data system, so that the bottom data system queries change characteristics of each database table involved in the query.
And the characteristic receiving module 122 is configured to receive change characteristics of the database table obtained by querying the underlying data system.
And the result sending module 123 is configured to compare the change characteristic of the locally stored database table with the received change characteristic of the database table, and send a comparison result to the underlying data system.
And the data receiving module 124 is configured to receive the related database table data sent by the underlying data system when the comparison result is inconsistent.
Specifically, the upper calling system periodically sends a data summary acquisition request to the lower data system, and transmits the related database table in an array form. And after receiving the data abstract acquisition request, the bottom layer data system does not summarize the database tables related to the data abstract acquisition request into a data abstract. The underlying data system of this embodiment only queries the change characteristics of the database table to which the data summary acquisition request relates.
Because the database tables involved in the data summary acquisition request are summarized into the data summary, a bottleneck can be brought to a high-concurrency and high-performance system. In the embodiment, only the change characteristics of the database table related to the data abstract acquisition request are queried, so that the time for data abstraction is reduced, and the bottleneck of a high-concurrency high-performance system caused by the data abstract is avoided.
In a specific implementation of the present application, the present embodiment sends the change characteristic of the database table related to the query data summary obtaining request to the upper-layer calling system that sends the query data summary obtaining request.
And after the upper layer calling system receives the change characteristics of the database table, comparing the locally stored change characteristics with the received change characteristics. If the comparison result obtained by the upper layer calling system is inconsistent, the data of the bottom layer data system is changed, otherwise, the data of the bottom layer data system is not changed. And the upper layer calling system sends the comparison result to the bottom layer data system.
And if the comparison result obtained by the upper-layer calling system is inconsistent, namely the data of the bottom-layer data system is changed, the bottom-layer data system sends the related database table data to the upper-layer calling system. And the upper calling system receives the related database table data sent by the bottom data system.
Specifically, the upper layer calling system acquires the related database table data sent by the bottom layer data system at one time, and then acquires each bottom layer data according to the database table data.
if the comparison result obtained by the upper calling system is consistent, namely the data of the bottom data system is not changed, the bottom data system does not send the data to the upper calling system any more. Therefore, data interaction between the upper layer calling system and the bottom layer data system is reduced, the response time of the system is prolonged, network I/O consumption is reduced, and context switching of a CPU is reduced.
In another specific implementation of the present application, the change characteristic of the database table includes: the number of records of the database table and the last modification time.
The apparatus of the present application comprises:
The request sending module 121 is specifically configured to initiate a data summary obtaining request to a bottom data system, so that the bottom data system queries the record number and the last modification time of each database table involved in the query.
The feature receiving module 122 is specifically configured to receive the record number and the last modification time of the database table obtained by querying the underlying data system.
The result sending module 123 is specifically configured to compare the number of records and the last modification time of the locally stored database table with the number of records and the last modification time of the received database table, and send a comparison result to the underlying data system.
The data receiving module 124 is specifically configured to receive the related database table data sent by the underlying data system if the comparison result is inconsistent.
Specifically, the upper calling system periodically sends a data summary acquisition request to the lower data system, and transmits the related database table in an array form. And after receiving the data abstract acquisition request, the bottom layer data system does not summarize the database tables related to the data abstract acquisition request into a data abstract. The underlying data system of the embodiment only queries the record number and the last modification time of the database table involved in the data summary obtaining request.
Because the database tables involved in the data summary acquisition request are summarized into the data summary, a bottleneck can be brought to a high-concurrency and high-performance system. In the embodiment, only the record number and the last modification time of the database table related to the data abstract acquisition request are inquired, so that the time for performing data abstract is reduced, and the bottleneck of a high-concurrency high-performance system caused by the data abstract is avoided.
In a specific implementation of the present application, the present embodiment sends the record number and the last modification time of the database table related to the query data summary obtaining request to the upper layer calling system that sends the query data summary obtaining request.
and after the upper layer calling system receives the record number and the last modification time of the database table, comparing the locally stored record number and the last modification time with the received record number and the last modification time. If the comparison result obtained by the upper layer calling system is inconsistent, the data of the bottom layer data system is changed, otherwise, the data of the bottom layer data system is not changed. And the upper layer calling system sends the comparison result to the bottom layer data system.
And if the comparison result obtained by the upper-layer calling system is inconsistent, namely the data of the bottom-layer data system is changed, the bottom-layer data system sends the related database table data to the upper-layer calling system. And the upper calling system receives the related database table data sent by the bottom data system.
specifically, the upper layer calling system acquires the related database table data sent by the bottom layer data system at one time, and then acquires each bottom layer data according to the database table data.
If the comparison result obtained by the upper calling system is consistent, namely the data of the bottom data system is not changed, the bottom data system does not send the data to the upper calling system any more. Therefore, data interaction between the upper layer calling system and the bottom layer data system is reduced, the response time of the system is prolonged, network I/O consumption is reduced, and context switching of a CPU is reduced.
in this embodiment, the upper layer call system determines whether the data of the bottom layer data system changes by comparing the record number and the last modification time of the database table sent by the bottom layer data system with the record number and the last modification time of the locally stored database table. The method and the device are simple to operate, network consumption and load among systems are avoided, and customer responsiveness is improved.
the following further illustrates an implementation of the present application through a specific application scenario of the embodiment of the present application.
Referring to fig. 13, the data transfer flow of the upper layer calling system and the lower layer data system is as follows:
The bottom data system modifies the bottom data and saves or updates the last modification time of the database table.
Specifically, the underlying data system modifies some underlying data, and if the last modification time of the database table is not saved, the last modification time of the database table is saved. And modifying certain bottom data by the bottom data system, and updating the last modification time of the database table if the last modification time of the database table is saved.
and secondly, the upper layer calls a data abstract acquisition request sent by the system to the bottom layer data system.
And thirdly, the bottom data system queries the record number and the last modification time of each related database table according to the data abstract acquisition request sent by the upper calling system.
Because the database tables involved in the data summary acquisition request are summarized into the data summary, a bottleneck can be brought to a high-concurrency and high-performance system. In the embodiment, only the record number and the last modification time of the database table related to the data abstract acquisition request are inquired, so that the time for performing data abstract is reduced, and the bottleneck of a high-concurrency high-performance system caused by the data abstract is avoided.
And fourthly, the bottom data system sends the record number of the database table obtained by query and the final modification time to the upper calling system.
The number of records and the last modification time may be a pseudo code and a return value.
Pseudo code:
select 1id,count(1)size,max(gmt_modified)max_gmt_modified from t_basedata_table1
union
select 2id,count(1)size,max(gmt_modified)max_gmt_modified from t_basedata_table2
...
union
select n id,count(1)size,max(gmt_modified)max_gmt_modified from t_basedata_tablen
And returning a value:
1,100,2015-02-14T22:17:13.612+0800
2,150,2015-02-14T22:18:13.612+0800
n,100,2015-02-14T22:57:13.612+0800
and the upper layer calling system compares the record number and the last modification time of the database table stored locally with the record number and the last modification time of the received database table.
and sixthly, the upper layer calling system sends the comparison result to the bottom layer data system.
And if the comparison result is inconsistent, the bottom layer data system sends the related database table data to the upper layer calling system.
If the comparison result sent by the upper layer calling system is inconsistent, it indicates that the data of the bottom layer data system is changed, and the upper layer calling system needs to reacquire the data of the bottom layer data system. And the bottom layer data system sends the related database table data to the upper layer calling system. And the upper layer calls the system to obtain the updated data sent by the bottom layer data system.
And the upper layer calling system acquires the bottom data according to the database table data sent by the bottom data system.
the upper-layer calling system determines whether the data of the bottom-layer data system changes or not by comparing the record number and the last modification time of the database table sent by the bottom-layer data system with the record number and the last modification time of the locally stored database table. The method and the device are simple to operate, network consumption and load among systems are avoided, and customer responsiveness is improved.
Assuming that the upper layer calling system needs to call the underlying data system 100 times per business operation, and each time one record, 0.1KB, is returned, the database table involved is 10. In the case that the database table involved in the underlying data system is changed, the time consumption of each business operation is increased from 200ms to 4.5 ms. The network consumption is reduced from 0.1KB by 100 times to 10KB to 36B by 10 tables to 0.36 KB.
In addition, if the comparison result sent by the upper layer calling system is inconsistent, it indicates that the data of the bottom layer data system is not changed, and the upper layer calling system does not need to acquire the data of the bottom layer data system again. The bottom data system does not need to send data to the upper layer calling system, so that data interaction between the upper layer calling system and the bottom data system is reduced, the response time of the system is prolonged, the network I/O consumption is reduced, and the context switching of a CPU is reduced.
the apparatus provided by the embodiments of the present application may be implemented by a computer program. It should be understood by those skilled in the art that the above-mentioned division of the units and modules is only one of many divisions, and if the division is into other units or modules or not into blocks, the information objects with the above-mentioned functions should be within the scope of the present application.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, apparatus (device), or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application 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 application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (devices) and computer program products according to embodiments of the application. 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.
While the preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all alterations and modifications as fall within the scope of the application. It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (8)

1. A method for data call between systems is applied to a bottom layer data system, and is characterized in that the method comprises the following steps:
Inquiring the change characteristics of each related database table according to a data abstract acquisition request sent by an upper calling system; the change characteristics of the database table include: the record number and the last modification time of the database table;
Sending the change characteristics of the database table obtained by query to the upper layer calling system;
Receiving a comparison result of the change characteristics of the locally stored database table returned by the upper layer calling system and the received change characteristics of the database table;
And if the comparison result is inconsistent, sending the related database table data to the upper layer calling system.
2. The method according to claim 1, wherein the querying the change characteristic of each database table involved according to the data summary obtaining request sent by the upper layer calling system further comprises:
Such as modifying the underlying data, saving or updating the last modification time of the database table.
3. The method of claim 1, further comprising:
And if the comparison result is consistent, data does not need to be sent to the upper layer calling system.
4. a method for detecting data change is applied to an upper calling system, and is characterized in that the method comprises the following steps:
Initiating a data summary acquisition request to a bottom data system, and enabling the bottom data system to inquire the change characteristics of each database table related to the change characteristics;
Receiving change characteristics of a database table obtained by the inquiry of the bottom data system; the change characteristics of the database table include: the record number and the last modification time of the database table;
Comparing the change characteristics of the locally stored database table with the received change characteristics of the database table, and sending a comparison result to the bottom data system;
and if the comparison result is inconsistent, receiving the related database table data sent by the underlying data system.
5. An apparatus for performing data call between systems, applied to an underlying data system, the apparatus comprising:
The characteristic query module is used for querying the change characteristics of each database table according to a data abstract acquisition request sent by the upper-layer calling system; the change characteristics of the database table include: the record number and the last modification time of the database table;
The characteristic sending module is used for sending the change characteristics of the database table obtained by query to the upper layer calling system;
the result receiving module is used for receiving a comparison result of the change characteristics of the locally stored database table returned by the upper layer calling system and the received change characteristics of the database table;
And the data sending module is used for sending the related database table data to the upper-layer calling system when the comparison result is inconsistent.
6. The apparatus of claim 5, further comprising:
And the modification storage module is used for storing or updating the last modification time of the database table when the underlying data is modified.
7. the apparatus of claim 5, further comprising:
And the data forbidding module is used for not sending data to the upper layer calling system when the comparison result is consistent.
8. An apparatus for detecting data change, applied to an upper calling system, the apparatus comprising:
The request sending module is used for initiating a data abstract obtaining request to a bottom data system and enabling the bottom data system to inquire the change characteristics of each database table related to the change characteristics; the change characteristics of the database table include: the record number and the last modification time of the database table;
The characteristic receiving module is used for receiving the change characteristics of the database table obtained by the inquiry of the bottom data system;
The result sending module is used for comparing the change characteristics of the locally stored database table with the received change characteristics of the database table and sending a comparison result to the bottom data system;
And the data receiving module is used for receiving the related database table data sent by the underlying data system when the comparison result is inconsistent.
CN201510390902.5A 2015-07-06 2015-07-06 Method and device for data calling between systems Active CN106339253B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510390902.5A CN106339253B (en) 2015-07-06 2015-07-06 Method and device for data calling between systems

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510390902.5A CN106339253B (en) 2015-07-06 2015-07-06 Method and device for data calling between systems

Publications (2)

Publication Number Publication Date
CN106339253A CN106339253A (en) 2017-01-18
CN106339253B true CN106339253B (en) 2019-12-10

Family

ID=57826206

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510390902.5A Active CN106339253B (en) 2015-07-06 2015-07-06 Method and device for data calling between systems

Country Status (1)

Country Link
CN (1) CN106339253B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101493826A (en) * 2008-12-23 2009-07-29 中兴通讯股份有限公司 Database system based on WEB application and data management method thereof
CN102281320A (en) * 2011-04-25 2011-12-14 程旭 Method for controlling data redundancy in cloud storage and apparatus thereof
CN103853727A (en) * 2012-11-29 2014-06-11 深圳中兴力维技术有限公司 Method and system for improving large data volume query performance
CN104573128A (en) * 2014-10-28 2015-04-29 北京国双科技有限公司 Business data processing method, a business data processing device and server

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070226226A1 (en) * 2006-03-23 2007-09-27 Elta Systems Ltd. Method and system for distributing processing of computerized tasks

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101493826A (en) * 2008-12-23 2009-07-29 中兴通讯股份有限公司 Database system based on WEB application and data management method thereof
CN102281320A (en) * 2011-04-25 2011-12-14 程旭 Method for controlling data redundancy in cloud storage and apparatus thereof
CN103853727A (en) * 2012-11-29 2014-06-11 深圳中兴力维技术有限公司 Method and system for improving large data volume query performance
CN104573128A (en) * 2014-10-28 2015-04-29 北京国双科技有限公司 Business data processing method, a business data processing device and server

Also Published As

Publication number Publication date
CN106339253A (en) 2017-01-18

Similar Documents

Publication Publication Date Title
CN107622091B (en) Database query method and device
US20180239800A1 (en) Data query method and apparatus
CN106059825A (en) Distributed system and configuration method
US20140298313A1 (en) Method, server, client and system for updating data
CN105302840B (en) A kind of buffer memory management method and equipment
CN111464615A (en) Request processing method, device, server and storage medium
CN108566291B (en) Event processing method, server and system
US20160179836A1 (en) Method for updating data table of keyvalue database and apparatus for updating table data
US10509716B2 (en) Automated recovery of flighted features based on service requests
CN104346345A (en) Data storage method and device
CN109783258A (en) A kind of message treatment method, device and server
CN110740155A (en) Request processing method and device in distributed system
CN104539583A (en) Real-time database subscription system and method
CN114218267A (en) Query request asynchronous processing method and device, computer equipment and storage medium
WO2020094064A1 (en) Performance optimization method, device, apparatus, and computer readable storage medium
EP3422186B1 (en) Method, device and system for preventing memory data loss
US20210279240A1 (en) Efficient storage method for time series data
CN111046106A (en) Cache data synchronization method, device, equipment and medium
CN113626449A (en) Data storage method, data query method and related equipment
CN103905512A (en) Data processing method and equipment
CN106339253B (en) Method and device for data calling between systems
US11789957B2 (en) System, method, and apparatus for querying a database
CN112434037A (en) Data processing method, processing device, data processing apparatus, and storage medium
CN106302374A (en) A kind of for improving list item access bandwidth and the device and method of atomicity operation
CN109783499B (en) Data caching method, device and server

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20211110

Address after: No. 699, Wangshang Road, Binjiang District, Hangzhou, Zhejiang

Patentee after: Alibaba (China) Network Technology Co., Ltd

Address before: P.O. Box 847, 4th floor, Grand Cayman capital building, British Cayman Islands

Patentee before: Alibaba Group Holdings Limited

TR01 Transfer of patent right