Report form inquiring method, device, server and storage mediumTechnical field
The present embodiments relate to big data technical field more particularly to a kind of report form inquiring method, device, server andStorage medium.
Background technique
Show that the tool of data is referred to as report with formats such as table, icons.Report can be from different dimensions to userData required for showing, are the common data exhibition methods of people.Meanwhile in order to meet the report of service management and decision requirementsTable system also is created out, company manager or operation personnel etc., and the overall operation state of enterprise can be understood by report.
However, the rapid development based on Internet technology and information technology, the growth rate of business datum amount is also continuousIt breaks a record.Under this big data environment, how to optimize reporting system, improves the search efficiency of report under mass data, atFor a technical problem to be solved urgently.
Summary of the invention
The embodiment of the present invention provides a kind of report form inquiring method, device, server and storage medium, to improve report queryEfficiency.
In a first aspect, the embodiment of the invention provides a kind of report form inquiring methods, this method comprises:
According at least one report evaluation factor, the pre- query assessment value of each report is calculated;
The report that the pre- query assessment value meets preset threshold is inquired into report as pre-, from database described in acquisitionThe query result data of pre- inquiry report, and the query result data are written and are cached;
The target report query at customer in response end is requested, if target report hits the caching, from the cachingThe query result data for reading target report are back to client.
Second aspect, the embodiment of the invention also provides a kind of report query device, which includes:
Assessed value computing module, for calculating the pre- query assessment value of each report according at least one report evaluation factor;
Pre- enquiry module, the report for the pre- query assessment value to be met to preset threshold inquire report as pre-, fromThe query result data of the pre- inquiry report are obtained in database, and the query result data are written and are cached;
Query result return module, the target report query for customer in response end is requested, if target report hits instituteCaching is stated, then the query result data that target report is read from the caching are back to client.
The third aspect, the embodiment of the invention also provides a kind of servers, comprising:
One or more processors;
Storage device, for storing one or more programs,
When one or more of programs are executed by one or more of processors, so that one or more of processingDevice realizes the report form inquiring method as described in any embodiment of the present invention.
Fourth aspect, the embodiment of the invention also provides a kind of computer readable storage mediums, are stored thereon with computerProgram realizes the report form inquiring method as described in any embodiment of the present invention when the program is executed by processor.
The embodiment of the present invention is according to the pre- query assessment value of at least one report evaluation factor accounting report, by each reportPre- query assessment value is compared with preset threshold, according to comparison result, will meet the report of preset threshold as pre- inquiry reportTable obtains the query result data of pre- inquiry report, write-in caching from database.It receives to work as target reportWhen inquiry request, if target report hit caching, the query result data of target report are read directly from caching, are avoidedIt is read from database.Therefore, the response time for optimizing report query improves report query efficiency.
Detailed description of the invention
Fig. 1 is the flow chart of the report form inquiring method in the embodiment of the present invention one;
Fig. 2 is the flow chart of the report form inquiring method in the embodiment of the present invention two;
Fig. 3 is the flow chart of the report form inquiring method in the embodiment of the present invention three;
Fig. 4 a is the flow chart of the report form inquiring method in the embodiment of the present invention four;
Fig. 4 b is the flow chart of another report form inquiring method in the embodiment of the present invention four;
Fig. 5 is the structural schematic diagram of the report query device in the embodiment of the present invention five;
Fig. 6 is the structural schematic diagram of the server in the embodiment of the present invention six.
Specific embodiment
The present invention is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouchedThe specific embodiment stated is used only for explaining the present invention rather than limiting the invention.It also should be noted that in order to justOnly the parts related to the present invention are shown in description, attached drawing rather than entire infrastructure.
It is well known that exponential data are stored under big data environment, in database, and report data is from numberAccording in the multiple associated tables of data stored in library, come out according to certain extracted.Therefore, if being directed to eachReport query demand all is initiated to request to database, since the data volume of database is huge, necessarily will affect the inquiry effect of reportRate.In order to improve report query efficiency, in embodiments of the present invention, the method inquired in advance using report, that is, in conjunction with reportTechnical indicator and operation indicator select some reports as pre- inquiry report according to assessment result by assessing reportTable is inquired in advance to database, and query result data are written and are cached.So asked for the inquiry of either objective reportIt asks, if target report hit caching, can directly read data from caching, without initiating to request to database, fromAnd improve report query efficiency.Just the embodiment of the present invention is described in detail below.
Embodiment one
Fig. 1 is the flow chart for the report form inquiring method that the embodiment of the present invention one provides, and the present embodiment is applicable to reportThe case where being inquired, obtaining the query result of report, this method can be executed by report query device, which can adoptIt is realized, and can configure in the server, such as reporting system server with the mode of software and/or hardware.As shown in Figure 1, shouldMethod specifically includes:
S101, according at least one report evaluation factor, calculate the pre- query assessment value of each report.
The report evaluation factor is at least technical indicator and operation indicator based on report, preconfigured assessment becauseSon, for assessing report.Wherein, technical indicator for example can be history average lookup time-consuming, and operation indicator for example may be usedTo be user's amount of access, service priority etc..
What needs to be explained here is that due to the query demand of unpredictable user out, namely do not know which user can be directed toOne or which report sending inquiry request.Therefore, if according to preset static policies, the one of the strategy will be met alwaysIt criticizes report to be inquired in advance as pre- inquiry report, then flexible and changeable based on unpredictable query demand and report demandThe fact, it is cached when inquiry request from the user is not to have done the report of pre- inquiry for these, namely without hit,Then still it is unable to reach the purpose for improving report query efficiency.And in embodiments of the present invention, then use a kind of dynamic planSlightly, that is, configuring report evaluation factor from the various dimensions such as technical indicator and operation indicator, report is carried out based on the evaluation factorDynamic assessment, and since assessment result is able to reflect the temperature and desirability of report, then can basisAssessment result will be more likely to by the report of user query as pre- inquiry report, thus improve the probability of hit caching, thusImprove report query efficiency.Moreover, the pre- query assessment value of accounting report, and to the relevant operation that report is inquired in advance,It can be carried out according to setpoint frequency, such as every 10 minutes, to achieve the purpose that carry out real-time update to assessed value.
Based on this, optionally, the report evaluation factor includes at least one following: miss is cached in preset time periodInquiry is time-consuming, access times and preset report service priority.
Wherein, the inquiry that miss caches in preset time period is time-consuming, such as is configurable to miss in nearly one week and delaysThe inquiry deposited is time-consuming, it will be understood that inquiry is time-consuming longer, and illustrating to be unable to satisfy the inquiry timeliness to the report in nearly one week needsIt asks, therefore the urgent degree that the report needs to be inquired in advance is higher;Access times are the inquiry total degree to some report;IndustryBusiness priority is then the priority according to the preset business domains one-to-one therewith of report content, it will be understood that businessPriority is higher, and the urgent degree which needs to be inquired in advance is also higher.
Correspondingly, calculating the pre- query assessment value of each report, comprising:
The statistical data of at least one report evaluation factor is obtained by inquiry log;
It is calculated each according to the default weight and the statistical data of each report evaluation factor using the method for weighted sumThe pre- query assessment value of report.
Specifically, server in day-to-day operation, can record whole report query situations, as the inquiry dayWill can count each report evaluation factor according to the inquiry log.It in one embodiment, can be differentThe factor configures different weights, and the method for then utilizing weighted sum calculates the pre- query assessment value of report.Wherein, due toThere is the possibility of variation in the structure and data volume for the tables of data that report scale, report logic or report are relied on, lead to the factorDefinition and its weight also change, and therefore, can carry out flexible configuration to the factor and its weight according to business needs, can alsoWith the operation for being increased the factor, being modified or deleted, the embodiment of the present invention is not limited in any way this.
In addition, can be the immediate data obtained according to the definition of the different factors as a result, for example about the statistical dataAccess times are 20 times, are also possible to the data being converted to according to default corresponding relationship to immediate data result, for example,If default corresponding relationship is 5 to correspond to result when access times are between 20-30 times, by the statistics of the access times factorData are determined as 5.About the specific statistical method of report evaluation factor, the embodiment of the present invention is not limited in any way.
S102, the report that the pre- query assessment value is met to preset threshold are obtained from database as pre- inquiry reportThe query result data of the pre- inquiry report are taken, and the query result data are written and are cached.
The preset threshold is according to the preconfigured parameter of actual needs, it is also possible to be adjusted at any time.It needsIllustrate, if preset threshold is higher, the report for meeting pre- inquiry is then fewer, then pre- query effect is not obvious, greatlyUser's request of amount cannot hit caching, can not improve search efficiency;Preset threshold is lower, then the report for meeting pre- inquiry is got overMore, still, if user's access probability is not high, the meaning inquired in advance will give a discount, waste of resource.So needing rootThe preset threshold is adjusted according to actual report operation data dynamic.It preferably, should if report quantity is more than 1000 or moreThe pre- query assessment value of ranking the 20th can be set into preset threshold.Certainly, the different business scale of constructions, different number report,Different user group can all have an impact to the threshold value, therefore, not make to the specific setting embodiment of the present invention of preset threshold anyIt limits.
Optionally, the query result data of the pre- inquiry report are obtained from database, comprising:
The querying condition of the pre- inquiry report is obtained, and the querying condition is sent to the database, wherein instituteIt states querying condition and is used to indicate the result data for inquiring report described in the data base querying in advance;
Receive the query result data for the pre- inquiry report that the database returns.
In reporting system server, it is stored with a large amount of report, these reports are set by business personnel or technical staffIt counts and safeguards, therefore, according to the different data dimension and logic in each report, each report has querying condition, according toThis querying condition can inquire the data of different dimensions in report.When execution, server can parse the querying condition, exampleSuch as SQL query statement, then send parsing result to the query engine of database, so as to query engine according to parsing result intoRow data query.Moreover, querying condition can be configured according to the type of database.Further, it is also possible to be arranged to databaseThe time-out time of data, such as 10 minutes are inquired, that is, if not yet getting query result data within time-out time,Inquiry is then re-started, and is not without and waits in limited time, occupies database resource to prevent the big inquiry in cost source.
The target report query request of S103, customer in response end are delayed if target report hits the caching from describedIt deposits the middle query result data for reading target report and is back to client.
Wherein, hit caching namely target report have passed through to inquire to be written its query result data in advance and cache, and implementWhen, it can use the information such as report ID and be compared, to judge whether hit caching.If hit caching, can directly fromData are read in caching, to improve report query efficiency.
The embodiment of the present invention is according to the pre- query assessment value of at least one report evaluation factor accounting report, by each reportPre- query assessment value is compared with preset threshold, according to comparison result, will meet the report of preset threshold as pre- inquiry reportTable obtains the query result data of pre- inquiry report, write-in caching from database.It receives to work as target reportWhen inquiry request, if target report hit caching, the query result data of target report are read directly from caching, are avoidedIt is read from database, to improve search efficiency.Moreover, because the process for determining pre- inquiry report is to be based on evaluation factor,Namely the technical indicator of report and operation indicator is combined to be dynamically determined pre- inquiry report, the probability of hit caching is further increased,Optimize the response time of report query, improves report query efficiency.
Optionally, the method also includes:
Pass through reserved triggering pre- inquiry instruction of the interface from external system, wherein the pre- inquiry instruction is usedSpecific report is inquired in advance in instruction;
Based on the pre- inquiry instruction, using the specific report as the pre- inquiry report, and execute described from dataThe operation of the query result data of the pre- inquiry report is obtained in library.
Specifically, will have a direct impact on the query result of report since data have the possibility of change, therefore, by reservedInterface is triggered, may be implemented to allow external system by the pre- inquiry of the interface starting while automatic execution pre- inquiry, thusThe flexibility that the accuracy and scheme for improving report query are realized.
Embodiment two
Fig. 2 is the flow chart of report form inquiring method provided by Embodiment 2 of the present invention, and the present embodiment two is in embodiment oneOn the basis of further optimized.As shown in Figure 2, which comprises
S201, according at least one report evaluation factor, calculate the pre- query assessment value of each report.
S202, the report that the pre- query assessment value is met to preset threshold are obtained from database as pre- inquiry reportThe query result data of the pre- inquiry report are taken, and the query result data are written and are cached.
S203, caching record table is updated, wherein pre- inquiry report ID and inquiry item are at least recorded in the caching record tablePart.
Whether the target report query request of S204, customer in response end, judge target report according to the caching record tableThe caching is hit, if hit, executes S205.
S205, the query result data that target report is read from the caching are back to client.
Wherein, caching record table is the record to pre- inquiry operation, for record which report carried out it is pre- inquiry and writeEnter caching, to be directed to real-time inquiry request, judges whether the targeted report of the request hits caching.In caching record tableIncluding at least pre- inquiry report ID and querying condition.A report can be uniquely determined by report ID and querying condition, therefore,It can judge whether target report hits caching by report ID and querying condition.
In addition, if not hitting caching, then can continue the inquiry request of target report being sent to database, in numberAccording to being inquired in library.
S206, it is requested for other report querys from client, passes through the caching record table, if it is determined that existInquiry request identical with target report, and the inquiry state of target report query request is in processing, then from the cachingWhen the middle query result data for reading target report are back to client, looked into the query result data as other described reportsThe query result data for asking request are back to client.
Specifically, going back the inquiry state of carrying target report query request, the inquiry state in the caching record tableIncluding at least in processing.For example, can then record target report in caching record table after receiving the inquiry request of target reportTable and its inquiry state are in processing, and before the query result data of feedback target report, the inquiry shape of target reportState can be constantly in processing.
In view of the inquiry request for the same report is likely to occur the situation that multi-user proposes simultaneously or successively, becauseThis is avoided repeating to inquire, be requested for other report querys from client to further increase the efficiency of inquiry, canWith first according to caching record table, inquiry whether there is inquiry request identical with target report, that is, in query caching record sheetIt is in processing and report identical with other current reports, if it is present can not be to current its with the presence or absence of stateHe inquires report, but shares the query result data of same report, that is, reading target from the cachingWhen the query result data of report are back to client, using the query result data looking into as other report querys requestIt askes result data and is back to client.As a result, when other report miss cache, but exist in caching record table with this otherThe identical inquiry request of report, and state be processing in when, so that it may share its query result.
Optionally, the cache-time of pre- inquiry report is also recorded in the caching record table;
Correspondingly, the method also includes:
According to the default scan period, the caching is scanned;
According to the pre- inquiry report recorded in the preset data renewal time of pre- inquiry report and the caching record tableCache-time, determine expired data cached, and it is expired data cached to delete this;
Data cached expired pre- inquiry report will be present as inquiry report to be mended, and obtain institute from the databaseThe query result data wait mend inquiry report are stated, which is written and is cached.
Specifically, the data in database are dynamic datas, therefore, to each report, according to the number of its different dimensionsAccording to report logic, report data can change with the variation of data in tables of data associated therewith in database.InIt is to need to preset its data renewal time for report, to improve query accuracy.Further, also remember in caching record tableThe cache-time of pre- inquiry report is carried, the time that will be also cached by the report result data write-in inquired in advance, then,According to the preset data renewal time of cache-time and pre- inquiry report, can judge be in the report result data of pre- inquiryIt is no that there are stale datas.
When realization, periodically caching can be scanned according to the preset scan period, and compare cache-time and presetData renewal time, illustratively, if scanning when, such as 7 points 01 minute, find have report cache-time be 6: 55, butThe data renewal time for being the report is daily 7 points, then can be determined that the report, there are stale datas, then delete stale dataIt removes.
Meanwhile in order to ensure inquiring the integrality of report data in advance, need will be present data cached expired pre- inquiry reportTable is used as inquiry report to be mended, and the query result data for waiting mending inquiry report are obtained from database, by the query resultData write-in caching.That is, there are data cached expired pre- inquiry reports to be inquired in advance again to this for needs.And it is looked into wait mendThe pre- inquiry operation for asking report is identical as the conventional pre- inquiry operation of report, and details are not described herein again.
In a kind of specific embodiment, caching is preferably Key-value structure, and caching record table then can be used asKey is cached, using caching Key, to determine whether hit caching.In addition, to avoid the length of caching Key too long, it can be by itCharacter compression is carried out, then carries out Hash operation, is stored using the result of Hash operation as final caching Key, to saveThe memory space of occupancy, and avoid the problem that data skew.
The embodiment of the present invention is according to the pre- query assessment value of at least one report evaluation factor accounting report, by each reportPre- query assessment value is compared with preset threshold, according to comparison result, will meet the report of preset threshold as pre- inquiry reportTable obtains the query result data of pre- inquiry report, write-in caching from database, and updates caching record table.It is connect to work asWhen receiving the inquiry request for target report, if judging target report hit caching according to caching record table, directlyThe query result data that target report is read from caching, avoid reading from database.Therefore, the sound of report query is optimizedBetween seasonable, report query efficiency is improved.In addition, may also determine whether based on the inquiry state recorded in caching record tableIn the presence of inquiry request identical with target report, and if it exists, can then share the query result of target report to the inquiry requestData, to avoid repeating to inquire.Finally, based on the cache-time recorded in caching record table, it can also be periodically to expiredIt is data cached to be updated, to ensure data cached accuracy.
Embodiment three
Fig. 3 is the flow chart for the report form inquiring method that the embodiment of the present invention three provides, and the present embodiment three is in above-described embodimentOn the basis of further optimized.As shown in Figure 3, which comprises
S301, according at least one report evaluation factor, calculate the pre- query assessment value of each report.
S302, the report that the pre- query assessment value is met to preset threshold are inquired report as pre-, and are sent out to databaseSend the data inquiry request to pre- inquiry report.
If the query result data that S303, the database are returned for current pre- inquiry report are sky, and currentPre- inquiry report meets querying condition to be mended in current time, then will currently inquire report in advance as inquiry report to be mended, and fromThe query result data wait mend inquiry report are obtained in the database, which is written and is cached, whereinThe querying condition to be mended was predefined according to the data renewal time of different reports.
In embodiments of the present invention, the query result data that database is returned for current pre- inquiry report are sky, mayIt is based on many reasons, for example, be easy the system problem being repaired or communication issue etc., and these problems and non-data sheetThe problem of body.Therefore, when primary pre- inquiry is come to nothing, it is necessary to be inquired in advance again, to ensure that pre- inquiry can reachExpected effect improves search efficiency.Based on this, when the query result data that database is returned for current pre- inquiry report areSky, and current pre- inquiry report meets querying condition to be mended in current time, then looks into using current pre- inquiry report as wait mendReport is ask, and obtains the query result data wait mend inquiry report from the database, which is writeEnter caching, namely again requested database treat benefit inquiry report inquired in advance.
In addition, if being that empty pre- inquiry all carries out repetitive requests to whole query result data, then waste is easy to appearThe case where resource.Therefore, in embodiments of the present invention, querying condition to be mended is preset, such as can be according to different reportsData renewal time predefines, and will meet the report of querying condition to be mended as inquiry report to be mended.For example, for inquiryResult data is empty report, and the data of the current time report have been updated, then returning the result as empty reason maximum probabilityThe problem of not being data itself, then using the report as inquiry report to be mended.
The embodiment of the present invention is according to the pre- query assessment value of at least one report evaluation factor accounting report, by each reportPre- query assessment value is compared with preset threshold, according to comparison result, will meet the report of preset threshold as pre- inquiry reportTable, and pre- inquiry is initiated to database.If the query result data that the database is returned for current pre- inquiry report areSky, and meet querying condition to be mended, then pre- inquiry is initiated to database to current pre- inquiry report again, so that it is guaranteed that looking into advanceThe success rate and report query efficiency of inquiry.
Example IV
Fig. 4 a is the flow chart for the report form inquiring method that the embodiment of the present invention four provides, and the present embodiment four is in above-described embodimentOn the basis of further optimized.As shown in fig. 4 a, which comprises
S401, according at least one report evaluation factor, calculate the pre- query assessment value of each report.
S402, the report that the pre- query assessment value is met to preset threshold are obtained from database as pre- inquiry reportThe query result data of the pre- inquiry report are taken, and the query result data are written and are cached.
The target report query request of S403, customer in response end will be described if cached described in target report missThe request of target report query is sent to the database, and the database is requested to be inquired.
It in embodiments of the present invention, is not directly to inquire to fail to client feedback, but into one when miss cachesIt walks and is inquired to database, it is ensured that the success rate of inquiry.
S404, the instruction message for entering poll to client feedback, wherein the instruction message into poll is for referring toShow that client will enter polling status for the inquiry request of target report.
Since report query may be very time-consuming, under most of scene even can break through server gateway time-out whenBetween limit, so gateway may directly will disconnect the connection with client, lead to not complete response.Therefore, of the invention realIt applies in example, the interaction of client and server is by the way of polled async.That is, when miss caching, by target reportAfter inquiry request is sent to the database, then enter the instruction message of poll to client feedback, instruction client will be directed toThe inquiry request of target report enters polling status, rather than waits query result always.It is super that request can be not only eliminated as a result,When the problem of, but also can be reduced gateway requests maintenance pressure.
S405, the query result data that target report is received from the database, and the query result data are writtenThe caching.
Miss is cached then to the situation of data base querying, after Database Feedback query result data, also togetherSample, which needs to be written the query result data, to be cached, and the pre- inquiry operation for completing the report is equivalent to.
The target report query request of S406, the response poll, and target report hits the caching, then it will be describedThe query result data of target report in caching are back to client.
Since client has entered polling status before, inquiry request can be initiated to server according to certain frequency, thatAfter caching successfully is written in query result data, the target report query request of the poll is responded, judges that target report is orderedMiddle caching then can read query result data directly from caching and be back to client, complete the sound of this inquiry requestIt answers.
Fig. 4 b is the flow chart for another report form inquiring method that the embodiment of the present invention four provides, as shown in Figure 4 b, methodExecution be related to client, server, caching and database, caching can be only fitted in server, can also be separately configured.Wherein, S1-S4 describes the implementation procedure of hit caching, and S5-S14 describes the implementation procedure of miss caching.
The embodiment of the present invention is according to the pre- query assessment value of at least one report evaluation factor accounting report, by each reportPre- query assessment value is compared with preset threshold, according to comparison result, will meet the report of preset threshold as pre- inquiry reportTable obtains the query result data of pre- inquiry report, write-in caching from database.It receives to work as target reportWhen inquiry request, if target report hit caching, the query result data of target report are read directly from caching, are avoidedIt is read from database.And when miss caching, then it further initiates to inquire to database, and indicate that client enters pollState.When database returns to query result data, then the query result data is written and is cached, and the inquiry for responding poll is askedIt asks, data is directly read from caching, optimize the response time of report query, improve report query efficiency.
Embodiment five
Fig. 5 is the structural schematic diagram of the report query device in the embodiment of the present invention five.As shown in figure 5, report query fillsIt sets and includes:
Assessed value computing module 510, for calculating the pre- query assessment of each report according at least one report evaluation factorValue;
Pre- enquiry module 520, the report for the pre- query assessment value to be met to preset threshold inquire report as pre-,The query result data of the pre- inquiry report are obtained from database, and the query result data are written and are cached;
Query result return module 530, the target report query for customer in response end is requested, if target report is hitThe caching, then the query result data that target report is read from the caching are back to client.
Optionally, the report evaluation factor includes at least one following: what miss cached in preset time period is averagedInquiry time-consuming, access times and preset report service priority;
Correspondingly, the assessed value computing module 510 includes:
Statistical data acquiring unit, for obtaining the statistical number of at least one report evaluation factor by inquiry logAccording to;
Assessed value computing unit, for the default weight and the statistical data according to each report evaluation factor, using addingThe method for weighing summation, calculates the pre- query assessment value of each report.
Optionally, the pre- enquiry module 520 includes:
Threshold value comparison unit, for the pre- query assessment value to be met to the report of preset threshold as pre- inquiry report;
Querying condition acquiring unit for obtaining the querying condition of the pre- inquiry report, and the querying condition is sent outIt send to the database, wherein the querying condition is used to indicate the number of results for inquiring report described in the data base querying in advanceAccording to;
Query result receiving unit, for receiving the query result number for the pre- inquiry report that the database returnsAccording to.
Optionally, described device further include:
Caching record table update module is used for after pre- enquiry module 520 is by query result data write-in caching,Update caching record table, wherein pre- inquiry report ID and querying condition are at least recorded in the caching record table;
Correspondingly, query result return module 530, is specifically used for:
The target report query at customer in response end is requested, and judges whether target report hits institute according to the caching record tableState caching;
If target report hits the caching, the query result data that target report is read from the caching are returnedTo client.
Optionally, the cache-time of pre- inquiry report is also recorded in the caching record table;
Correspondingly, described device further includes scan module, it is specifically used for:
According to the default scan period, the caching is scanned;
According to the pre- inquiry report recorded in the preset data renewal time of pre- inquiry report and the caching record tableCache-time, determine expired data cached, and it is expired data cached to delete this;
Data cached expired pre- inquiry report will be present as inquiry report to be mended, and obtain institute from the databaseThe query result data wait mend inquiry report are stated, which is written and is cached.
Optionally, the inquiry state of carrying target report query request is gone back in the caching record table, wherein the inquiryState includes at least in processing;
Correspondingly, the query result return module 530, is also used to:
For other report querys request from client, pass through the caching record table, if it is determined that exist and meshThe identical inquiry request of report is marked, and the inquiry state of target report query request is then to read from the caching in processingWhen the query result data of target report being taken to be back to client, asked the query result data as other described report querysThe query result data asked are back to client.
Optionally, described device further includes mending enquiry module, is specifically used for:
Pre- enquiry module 520 using the pre- query assessment value meet the report of preset threshold as pre- inquiry report itAfterwards, if the query result data that the database is returned for the current report of inquiry in advance are sky, and currently pre- inquiry reportMeet querying condition to be mended in current time, then will currently inquire report in advance as inquiry report to be mended, and from the databaseWait mend the query result data for inquiring report described in middle acquisition, which is written and is cached;Wherein, described to be looked into wait mendInquiry condition was predefined according to the data renewal time of different reports.
Optionally, the query result return module 530, is also used to:
If cached described in target report miss, target report query request is sent to the database,The database is requested to be inquired;
The query result data of target report are received from the database, and query result data write-in is described slowIt deposits;
The query result data of target report in the caching are back to client.
Optionally, described device further includes poll instruction message feedback module, is specifically used for:
After target report query request is sent to the database by the query result return module 530,Enter the instruction message of poll to client feedback, wherein the instruction message into poll is used to indicate client for needlePolling status is entered to the inquiry request of target report;
Correspondingly, the query result return module 530, is also used to:
The target report query request of the poll is responded, and target report hits the caching, then by the cachingIn the query result data of target report be back to client.
Optionally, described device further includes interface trigger module, is specifically used for:
Pass through reserved triggering pre- inquiry instruction of the interface from external system, wherein the pre- inquiry instruction is usedSpecific report is inquired in advance in instruction;
Based on the pre- inquiry instruction, using the specific report as the pre- inquiry report, and turn by the pre- inquiryModule 520 executes the operation of the query result data that the pre- inquiry report is obtained from database.
Report query device provided by the embodiment of the present invention can be performed report provided by any embodiment of the invention and look intoInquiry method has and executes the corresponding functional module of report form inquiring method and beneficial effect.
Embodiment six
Fig. 6 is a kind of structural schematic diagram for server that the embodiment of the present invention six provides.Fig. 6, which is shown, to be suitable for being used to realizingThe block diagram of the exemplary servers 12 of embodiment of the present invention, the server 12 for example can be the back-end services of reporting systemDevice.The server 12 that Fig. 6 is shown is only an example, should not function to the embodiment of the present invention and use scope bring it is anyLimitation.
As shown in fig. 6, server 12 is showed in the form of universal computing device.The component of server 12 may include but notBe limited to: one or more processor or processing unit 16, system storage 28 connect different system components (including systemMemory 28 and processing unit 16) bus 18.
Bus 18 indicates one of a few class bus structures or a variety of, including memory bus or Memory Controller,Peripheral bus, graphics acceleration port, processor or the local bus using any bus structures in a variety of bus structures.It liftsFor example, these architectures include but is not limited to industry standard architecture (ISA) bus, microchannel architecture (MAC)Bus, enhanced isa bus, Video Electronics Standards Association (VESA) local bus and peripheral component interconnection (PCI) bus.
Server 12 typically comprises a variety of computer system readable media.These media can be and any can be servicedThe usable medium that device 12 accesses, including volatile and non-volatile media, moveable and immovable medium.
System storage 28 may include the computer system readable media of form of volatile memory, such as arbitrary accessMemory (RAM) 30 and/or cache memory 32.Server 12 may further include other removable/nonremovable, volatile/non-volatile computer system storage medium.Only as an example, storage system 34 can be used for reading and writing not removableDynamic, non-volatile magnetic media (Fig. 6 do not show, commonly referred to as " hard disk drive ").Although being not shown in Fig. 6, can provideDisc driver for being read and write to removable non-volatile magnetic disk (such as " floppy disk "), and to removable anonvolatile optical diskThe CD drive of (such as CD-ROM, DVD-ROM or other optical mediums) read-write.In these cases, each driver canTo be connected by one or more data media interfaces with bus 18.Memory 28 may include at least one program product,The program product has one group of (for example, at least one) program module, these program modules are configured to perform each implementation of the inventionThe function of example.
Program/utility 40 with one group of (at least one) program module 42 can store in such as memory 28In, such program module 42 include but is not limited to operating system, one or more application program, other program modules andIt may include the realization of network environment in program data, each of these examples or certain combination.Program module 42 is usualExecute the function and/or method in embodiment described in the invention.
Server 12 can also be logical with one or more external equipments 14 (such as keyboard, sensing equipment, display 24 etc.)Letter, can also be enabled a user to one or more equipment interact with the server 12 communicate, and/or with make the serverThe 12 any equipment (such as network interface card, modem etc.) that can be communicated with one or more of the other calculating equipment communicate.This communication can be carried out by input/output (I/O) interface 22.Also, server 12 can also pass through network adapter 20With one or more network (such as local area network (LAN), wide area network (WAN) and/or public network, such as internet) communication.As shown, network adapter 20 is communicated by bus 18 with other modules of server 12.It should be understood that although not showing in figureOut, can in conjunction with server 12 use other hardware and/or software module, including but not limited to: microcode, device driver,Redundant processing unit, external disk drive array, RAID system, tape drive and data backup storage system etc..
Processing unit 16 by the program that is stored in system storage 28 of operation, thereby executing various function application andData processing, such as realize report form inquiring method provided by the embodiment of the present invention, comprising:
According at least one report evaluation factor, the pre- query assessment value of each report is calculated;
The report that the pre- query assessment value meets preset threshold is inquired into report as pre-, from database described in acquisitionThe query result data of pre- inquiry report, and the query result data are written and are cached;
The target report query at customer in response end is requested, if target report hits the caching, from the cachingThe query result data for reading target report are back to client.
Embodiment seven
The embodiment of the present invention seven additionally provides a kind of computer readable storage medium, is stored thereon with computer program, shouldThe report form inquiring method as provided by the embodiment of the present invention is realized when program is executed by processor, comprising:
According at least one report evaluation factor, the pre- query assessment value of each report is calculated;
The report that the pre- query assessment value meets preset threshold is inquired into report as pre-, from database described in acquisitionThe query result data of pre- inquiry report, and the query result data are written and are cached;
The target report query at customer in response end is requested, if target report hits the caching, from the cachingThe query result data for reading target report are back to client.
The computer storage medium of the embodiment of the present invention, can be using any of one or more computer-readable mediaCombination.Computer-readable medium can be computer-readable signal media or computer readable storage medium.It is computer-readableStorage medium for example may be-but not limited to-the system of electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor, device orDevice, or any above combination.The more specific example (non exhaustive list) of computer readable storage medium includes: toolThere are electrical connection, the portable computer diskette, hard disk, random access memory (RAM), read-only memory of one or more conducting wires(ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory device or above-mentioned any appropriate combination.In this document, computer-readable storageMedium can be any tangible medium for including or store program, which can be commanded execution system, device or deviceUsing or it is in connection.
Computer-readable signal media may include in a base band or as carrier wave a part propagate data-signal,Wherein carry computer-readable program code.The data-signal of this propagation can take various forms, including but unlimitedIn electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be that computer canAny computer-readable medium other than storage medium is read, which can send, propagates or transmit and be used forBy the use of instruction execution system, device or device or program in connection.
The program code for including on computer-readable medium can transmit with any suitable medium, including --- but it is unlimitedIn wireless, electric wire, optical cable, RF etc. or above-mentioned any appropriate combination.
The computer for executing operation of the present invention can be write with one or more programming languages or combinations thereofProgram code, described program design language include object oriented program language-such as Java, Smalltalk, C++,Further include conventional procedural programming language-such as " C " language or similar programming language.Program code can be withIt fully executes, partly execute on the user computer on the user computer, being executed as an independent software package, portionDivide and partially executes or executed on a remote computer or server completely on the remote computer on the user computer.?Be related in the situation of remote computer, remote computer can pass through the network of any kind --- including local area network (LAN) orWide area network (WAN)-be connected to subscriber computer, or, it may be connected to outer computer (such as mentioned using Internet serviceIt is connected for quotient by internet).
Note that the above is only a better embodiment of the present invention and the applied technical principle.It will be appreciated by those skilled in the art thatThe invention is not limited to the specific embodiments described herein, be able to carry out for a person skilled in the art it is various it is apparent variation,It readjusts and substitutes without departing from protection scope of the present invention.Therefore, although being carried out by above embodiments to the present inventionIt is described in further detail, but the present invention is not limited to the above embodiments only, without departing from the inventive concept, alsoIt may include more other equivalent embodiments, and the scope of the invention is determined by the scope of the appended claims.