Data retrieval method, device and electronic device
By storing associated search directories and search results in the pre-aggregated cache area, the problem of poor performance of automatic code generation platform when retrieving large-scale data is solved, and the rapid retrieval and efficient retrieval performance of form data is achieved.
Patent Information
- Application Number
- CN202111243695.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-25
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2041-10-25
AI Technical Summary
Applications built on automatic code generation platform perform extremely poorly when retrieving large-scale data (such as searching hundreds of millions of data), which affects user experience.
The first search results corresponding to the associated search directory set and the associated search directory are generated respectively, and stored in the pre-aggregation cache area. By determining whether there is a target search index matching the data search request in the pre-aggregation cache area, the second search result of the data search request is generated to avoid repeated search of the data source of the form data.
It realizes rapid retrieval of form data based on form correlation, improves the performance of applications generated by the automatic code generation platform when retrieving large-scale data, and improves retrieval efficiency.
Smart Images

Figure CN113868265B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the technical field of data retrieval, and particularly relates to a data retrieval method, apparatus, and electronic device. Background Art
[0002] An automatic code generation platform is a development platform that can quickly generate application programs without coding (zero code) or with a small amount of coding. Its strength lies in allowing end-users to develop their own application programs using easy-to-understand visual tools, rather than the traditional way of writing code.
[0003] The applicant's research found that when applications built / generated based on an automatic code generation platform retrieve large-scale data (e.g., retrieving hundreds of millions of data), the data retrieval performance is extremely poor, greatly affecting the user experience. Summary of the Invention
[0004] To this end, the present application discloses the following technical solutions:
[0005] A data retrieval method, the method comprising:
[0006] Obtain a data retrieval request for an application form;
[0007] Determine whether there is a target retrieval index in the pre-aggregated cache area that matches the data retrieval request, and obtain a determination result; wherein, the pre-aggregated cache area stores a pre-generated set of associated retrieval directories and first retrieval results respectively corresponding to each associated retrieval directory in the set of associated retrieval directories, and the associated retrieval directory includes multiple retrieval indexes with an association relationship between form data for retrieval;
[0008] Generate a second retrieval result for the data retrieval request based on the determination result.
[0009] Optionally, the generating a second retrieval result for the data retrieval request based on the determination result includes:
[0010] If the determination result indicates existence, generate a second retrieval result for the data retrieval request based on the first retrieval result corresponding to the associated retrieval directory to which the target retrieval index in the pre-aggregated cache area belongs;
[0011] If the determination result indicates non-existence, retrieve the data source of the form data of the application form according to the data retrieval request to generate a second retrieval result for the data retrieval request.
[0012] Optionally, when retrieving the data source of the form data of the application form according to the data retrieval request, the method further includes:
[0013] By retrieving the data source, the retrieval results of the associated retrieval requests for the data retrieval request are obtained, and the retrieval results of the data retrieval request and its associated retrieval requests are stored in the pre-aggregation buffer area.
[0014] Optionally, the step of retrieving the data source to obtain the retrieval results of the associated retrieval requests for the data retrieval request and storing the retrieval results of the data retrieval request and its associated retrieval requests in the pre-aggregation buffer area includes:
[0015] Based on at least one pre-generated retrieval relationship model, determine the associated retrieval requests for the data retrieval request and the retrieval associations when the data retrieval request and its respective associated retrieval requests retrieve form data;
[0016] According to the associated retrieval requests for the data retrieval request and the retrieval associations among the data retrieval request and its respective associated retrieval requests, retrieve the data source of the form data of the application form to generate the retrieval results of the respective associated retrieval requests for the data retrieval request;
[0017] Store the second retrieval result of the data retrieval request and the retrieval results of the respective associated retrieval requests for the data retrieval request in the pre-aggregation buffer area;
[0018] Wherein, the retrieval relationship model includes multiple data retrieval requests with an associated relationship among the form data for retrieval, and the retrieval associations of each data retrieval request when retrieving the form data determined based on the associated relationship among the form data for retrieval.
[0019] Optionally, the first retrieval result corresponding to the associated retrieval directory includes: classifying the data retrieval requests for retrieving the same data model in the data source in the retrieval relationship model into the same category, and merging the retrieval processes of the data retrieval requests in the same category into one retrieval process and then retrieving the data source to obtain the retrieval result;
[0020] The step of generating the second retrieval result of the data retrieval request based on the first retrieval result corresponding to the associated retrieval directory to which the target retrieval index belongs in the pre-aggregation buffer area includes:
[0021] Determine the retrieval result corresponding to the category to which the target retrieval index belongs from the first retrieval result corresponding to the associated retrieval directory to which the target retrieval index belongs;
[0022] Use the retrieval result corresponding to the category to which the target retrieval index belongs as the second retrieval result of the data retrieval request, or retrieve the retrieval result corresponding to the category to which the target retrieval index belongs according to the data retrieval request to obtain the second retrieval result.
[0023] Optionally, the process of generating the retrieval relationship model includes:
[0024] When an application form is published, determine each target application form that meets the association condition in different application forms and the association relationship between each target application form;
[0025] Based on the relevant attribute configuration data of each target application form and the association relationship between each target application form, generate each data retrieval request for retrieving the form data of each target application form respectively;
[0026] Based on the association relationship between each target application form and each of the data retrieval requests, construct the retrieval relationship model.
[0027] Optionally, the determination of each target application form that meets the association condition in different application forms and the association relationship between each target application form includes:
[0028] Determine the shortest traversal path between different application forms in a predetermined path traversal manner;
[0029] According to the shortest traversal path between different application forms in the predetermined path traversal manner, determine the association relationship and the association strength between different application forms;
[0030] Determine different application forms with the association strength meeting the strength condition as each target application form that meets the association condition, and determine the association relationship between different application forms with the association strength meeting the strength condition as the association relationship between each target application form.
[0031] Optionally, after constructing the retrieval relationship model, the above method further includes:
[0032] Classify the data retrieval requests for retrieving the same data model in the data source in the retrieval relationship model into the same category;
[0033] Merge the data retrieval requests in the same category into one data retrieval request, and update the retrieval relationship model based on the merging result.
[0034] A data retrieval device, the device includes:
[0035] An acquisition module, configured to acquire a data retrieval request for a corresponding application form;
[0036] A determination module, configured to determine whether there is a target retrieval index matching the data retrieval request in a pre-aggregation buffer; wherein, the pre-aggregation buffer stores a pre-generated associated retrieval catalog set and the first retrieval results respectively corresponding to each associated retrieval catalog in the associated retrieval catalog set, and the associated retrieval catalog includes multiple retrieval indexes with an association relationship between the form data for retrieval;
[0037] A generation module, configured to generate a second retrieval result of the data retrieval request based on the determination result.
[0038] An electronic device, comprising:
[0039] A memory, configured to store a computer instruction set;
[0040] A processor, configured to implement the data retrieval method according to any one of the above by executing the instruction set stored on the memory.
[0041] As can be seen from the above solutions, the data retrieval method, device, and electronic device disclosed in this application pre-generate an associated retrieval directory set and a first retrieval result corresponding to each associated retrieval directory in the set, and store them in a pre-aggregation buffer area, where the associated retrieval directories in the set include multiple retrieval indexes with an association relationship between form data for retrieval; on this basis, after obtaining a data retrieval request for a corresponding form, it is determined whether there is a target retrieval index in the associated retrieval directories in the pre-aggregation buffer area that matches the data retrieval request, and finally a second retrieval result of the data retrieval request is generated based on the determination result. The solution of this application, by using the information stored in the pre-aggregation buffer area as the retrieval basis, can avoid retrieving the data source of the form data when the requested form data exists in the pre-aggregation buffer area, thereby realizing fast retrieval of form data automatically according to form relevance, and can effectively improve the retrieval performance of applications generated based on an automatic code generation platform when retrieving large-scale data. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained according to the provided drawings without creative efforts.
[0043] Figure 1 It is a processing logic diagram for realizing fast retrieval of form data according to form relevance provided by the present application;
[0044] Figure 2 It is an implementation flowchart for determining each target application form that meets the association condition and the association relationship between each target application form in different application forms provided by the present application;
[0045] Figure 3 It is a schematic flowchart of a data retrieval method provided by the present application;
[0046] Figure 4 It is another schematic flowchart of a data retrieval method provided by the present application;
[0047] Figure 5 is a schematic structural diagram of the data retrieval device provided by the present application;
[0048] Figure 6 is a schematic structural diagram of the electronic device provided by the present application. Detailed implementation manners
[0049] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0050] The present application discloses a data retrieval method, device, and electronic device. The method and device can be applied to a server in a server for providing form data retrieval services, and can quickly retrieve form data by automatically realizing form relevance, so as to overcome the problem that applications generated based on an automatic code generation platform have extremely poor performance when retrieving large-scale data (such as retrieving hundreds of millions of data).
[0051] Optionally, in the embodiments of the present application, the application form is an application form of an application constructed based on an automatic code generation platform, and the automatic code generation platform can reduce the amount of development code and development difficulty of developers by providing visual programming components and software full life cycle management capabilities.
[0052] The application form is used to realize the interactive transmission of information between the user side and the server side. Through the application form, information such as user retrieval requests and user orders can be collected from the user side, and then the collected information can be fed back to the user side after being processed by the server side. The application form can be, but is not limited to, basic form objects such as text fields, buttons, check boxes, drop-down boxes, lists / drop-down menus, or more complex form objects constructed based on basic form objects, such as an employee information list component with paging and query functions constructed based on input boxes and drop-down boxes.
[0053] The data retrieval method, device, and electronic device disclosed in the embodiments of the present application pre-construct a retrieval relationship model to support the quick retrieval of form data according to the form relevance of the application form automatically. The implementation process of constructing the retrieval relationship model will be described first below.
[0054] The implementation process of constructing the retrieval relationship model can be executed by a pre-generated pre-aggregation engine. With reference to Figure 1 , the process of constructing the retrieval relationship model specifically includes:
[0055] 11) When the application form is published, determine each target application form that meets the association conditions in different application forms and the association relationship between each target application form.
[0056] Specifically, the user can perform operations such as dragging, stacking, and combining on the automatic code generation platform to layout and associate the design of the application form on the page, and configure the association relationship between each application form according to actual needs, as well as configure the binding relationship between the application form and the data model.
[0057] For the configuration of the association relationship between each application form, for example, for the organization dropdown form to cascade the employee data query form under the organization. In this example, the "cascade" association relationship is configured for the organization dropdown form and the employee data query form; for another example, in the same page view, multiple independent application forms are laid out at the same time. In this example, there is a layout association between the multiple independent application forms laid out in the same page view.
[0058] The above data model can refer to data files, data tables, etc. in the form data source (such as the form database) of the application form. For the configuration of the binding relationship between the application form and the data model, the business data parameters (such as employee basic information, department information of each organizational department of the company, etc.) can be set as the interface parameters of the dynamic data interface (Application Programming Interface, API), and the corresponding required dynamic data interface (such as interface address, name, etc.) can be configured for the application form to realize the binding of the application form and the corresponding business data parameters, and then realize the binding of the application form and the data model (such as the business data parameters - "gender", "position", "home address" of the employee corresponding to the data table "employee basic information table" in the application form database).
[0059] And use the business data parameters (such as the name, gender, position, etc. of the employee) bound through the interface parameters as form attributes. In addition, basic attributes can also be configured for the designed application form, such as configuring a series of basic attributes such as length, width, font, and allowed input language (Chinese / English) for the input box form.
[0060] During the process of the user performing application form interaction design and binding the dynamic data interface on the automatic code generation platform, the association relationship between the application forms and the binding relationship between the application form and the data model are determined at the same time. When the user completes the application development based on the application form through the above process on the automatic code generation platform, the application release process can be further executed.
[0061] In this step 11), when the application form is published, the server automatically triggers the correlation analysis of the application forms in the published application to determine each target application form that meets the correlation conditions in different application forms and the specific correlation relationships between the target application forms.
[0062] Among them, referring to Figure 2 , the process of determining each target application form that meets the correlation conditions in different application forms and the correlation relationships between the target application forms can be further implemented as follows:
[0063] Step 201: Determine the shortest traversal path between different application forms in a predetermined path traversal mode;
[0064] Specifically, the shortest path graph algorithm can be used to calculate the shortest traversal path between any two different forms. There are various path traversal methods between forms. For example: traversal through form attribute variable references, traversal through the function call chain between forms, traversal through the form hierarchy structure of the application view, etc.
[0065] Step 202: According to the shortest traversal path between different application forms in the above-mentioned predetermined path traversal mode, determine the correlation relationships and correlation strengths between different application forms;
[0066] Among them, through traversal by form attribute variable references or through the function call chain between forms, it can be determined whether there is a cascading correlation between forms, and through traversal of the form hierarchy structure of the application view, it can be determined whether there is a layout correlation between forms (that is, whether different application forms are laid out in the same page view).
[0067] In addition, this embodiment also converts the shortest path between different application forms into an index of the strength of the correlation between forms. Among them, the shorter the path, the stronger the correlation between the two forms, and the longer the path, the weaker the correlation between the two forms.
[0068] Through the above process, the specific correlation relationships (such as cascading correlation, layout correlation, etc.) and correlation strengths between different application forms are determined.
[0069] Step 203: Determine the different application forms whose correlation strengths meet the strength conditions as each target application form that meets the correlation conditions, and determine the correlation relationships between the different application forms whose correlation strengths meet the strength conditions as the correlation relationships between the target application forms.
[0070] Optionally, the above strength condition can be set as: the correlation strength between different application forms reaches a predetermined strength threshold. In implementation, the size of this strength threshold can be determined with reference to the data cache space size that the server can handle (such as the cache space size of the pre-aggregation buffer area involved later).
[0071] Based on the set intensity conditions, different application forms with the relevance intensity reaching a predetermined intensity threshold can be specifically determined as each target application form meeting the association conditions; correspondingly, the association relationships between different application forms with the relevance intensity reaching the predetermined intensity threshold are determined as the association relationships between each target application form, such as cascading association, layout association, etc.
[0072] 12) Generate respective data retrieval requests for retrieving the form data of each target application form based on the relevant attribute configuration data of each target application form and the association relationships between each target application form.
[0073] The applicant's research finds that the application forms with an association relationship in the page view of the application usually also have corresponding association relationships during the retrieval of form data. For example, for forms with a cascading relationship, they are usually retrieved in a cascading manner (e.g., after querying the information of a certain organization based on the organization dropdown box, the employee information under that organization is often further retrieved in a cascade), correspondingly triggering different data query requests in a cascade manner; for another example, multiple independent application forms laid out in the same page view are usually also clicked by the user one after another, thereby initiating different data query requests one after another.
[0074] Based on this, in this embodiment, multiple data retrieval requests for retrieving the form data of each associated target application form are generated by combining the relevant attribute configuration data of each target application form with an association relationship and the association relationships between each target application form.
[0075] Specifically, the attribute configuration data of each target application form can be scanned to obtain dynamic form attributes and interface API attributes, such as dynamic form attributes such as "gender" and "department of affiliated organization" of employees bound through a dynamic data interface, and interface API attributes such as the address of the dynamic data interface. And based on the dynamic form attributes, interface API attributes and the association relationships between each target application form, respective data retrieval requests for retrieving the form data of each target application form are generated.
[0076] For example, according to the "department of organization" attribute, the corresponding API address, and the cascading relationship between different forms, an SQL statement for querying the department information of a certain organization department and an SQL statement for querying the employee information under that department are generated, etc.
[0077] 13) Construct a retrieval relationship model based on the association relationships between each target application form and the respective data retrieval requests.
[0078] After generating respective data retrieval requests for retrieving the form data of each target application form with an association relationship, a retrieval relationship model is further constructed based on the association relationship between the target application forms and the respective data retrieval requests generated for the target application forms.
[0079] Among them, the constructed retrieval relationship model includes: multiple data retrieval requests with an association relationship between the form data for retrieval, and the retrieval association of each data retrieval request when retrieving the form data determined based on the association relationship between the form data for retrieval.
[0080] Exemplarily, the data retrieval request can specifically be an SQL query statement, and the retrieval relationship model is correspondingly an SQL query relationship model between different SQL query statements, which can be specifically referred to in combination with Figure 1 as shown.
[0081] For example, for each target application form with a cascading relationship, the constructed retrieval relationship model includes: multiple SQL query statements for one-to-one retrieval of the form data of each associated target application form, and the cascading retrieval relationship of each SQL query statement when retrieving different target application forms. Correspondingly, for each target application form with a layout association, the constructed retrieval relationship model includes: multiple SQL query statements for one-to-one retrieval of the form data of each associated target application form, and the sequential retrieval relationship of each SQL query statement when retrieving different target application forms.
[0082] Based on the above constructed retrieval relationship model, it is supported to quickly retrieve form data automatically according to the form association of the application form.
[0083] Optionally, in one embodiment, after constructing the above retrieval relationship model, the data retrieval requests in the retrieval relationship model for retrieving the same data model in the application form data source can also be classified into the same category; and the data retrieval requests of the same category are merged into one data retrieval request, and the retrieval relationship model is updated based on the merge result.
[0084] For example, querying employees with programming skills and querying male employees with programming skills in the database will be divided into at least 2 form query requests / operations from the application interaction end. However, in this embodiment, according to the characteristic that both are used to retrieve the same data model (such as the same data table in the form database: employee basic information table), in the pre-aggregation engine, they are merged into one data retrieval request "query employees with programming skills" to meet the query requirements of these 2 types of query requests. And based on the above classification and merging processing, the constructed retrieval relationship model is updated and optimized to further achieve the purpose of saving cache.
[0085] Based on the above-mentioned pre-constructed retrieval relationship model, refer to Figure 3 the flowchart of the data retrieval method provided. The data retrieval method disclosed in the embodiments of the present application at least includes the following steps:
[0086] Step 301, obtain a data retrieval request for the corresponding application form.
[0087] The embodiments of the present application achieve fast retrieval of form data according to form relevance.
[0088] After the application generated based on the automatic code generation platform is released and the application instance is started, combined with referring to Figure 1 , the user can initiate a retrieval / query request for form data by operating the application form. For example, select an organizational department in the organization dropdown box to initiate a query for the information of that organizational department, etc.
[0089] Exemplarily, the initiated data retrieval request can be an SQL query request. The data retrieval request includes target attributes used as the retrieval basis, such as the "certain organizational department" selected above.
[0090] Step 302, determine whether there is a target retrieval index in the pre-aggregation buffer that matches the above data retrieval request, and obtain a determination result.
[0091] Among them, the pre-aggregation buffer stores a pre-generated set of associated retrieval directories and the first retrieval results respectively corresponding to each associated retrieval directory in the set of associated retrieval directories. The associated retrieval directories in the set of associated retrieval directories include multiple retrieval indexes with an association relationship between the form data used for retrieval.
[0092] For the above-mentioned constructed retrieval relationship model, the multiple retrieval indexes in the set of associated retrieval directories can specifically be: SQL query statements respectively corresponding to each application form with an association (such as cascading association, layout association) in the retrieval relationship model, or information obtained after processing the SQL query statements respectively corresponding to each application form with an association (such as attribute information used as the query basis extracted from the SQL query statements).
[0093] Furthermore, the first retrieval result corresponding to the associated retrieval directory includes: classifying the data retrieval requests for retrieving the same data model in the data source in the above-mentioned constructed retrieval relationship model, and retrieving the data source after combining the retrieval processing of the data retrieval requests of the same category into one retrieval processing.
[0094] For example, assume that among multiple search indexes in an associated search catalog, there are two SQL query statements: "query employees with programming skills" and "query male employees with programming skills". Then, the first search result corresponding to the associated search catalog may specifically include the search result information of "employees with programming skills" obtained by querying the form database after combining the two SQL query statements into one search process (query employees with programming skills).
[0095] After obtaining a data retrieval request for a corresponding form, the embodiment of the present application matches the data retrieval request with the search indexes included in the associated search catalog in the pre-aggregation buffer to determine whether there is a target search index in the associated search catalog of the pre-aggregation buffer that matches the data retrieval request.
[0096] Step 303: Generate a second search result for the data retrieval request based on the determination result.
[0097] After that, according to the determination result of whether there is a target search index in the associated search catalog of the pre-aggregation buffer that matches the data retrieval request, a second search result for the data retrieval request is generated.
[0098] Among them, if there is a target search index in the associated search catalog of the pre-aggregation buffer that matches the data retrieval request, then directly generate a second search result for the data retrieval request based on the first search result corresponding to the associated search catalog to which the target search index belongs in the pre-aggregation buffer; that is, in this case, there is no need to retrieve the form data source again.
[0099] Specifically, first, the search result corresponding to the category to which the target search index belongs can be determined from the first search result corresponding to the associated search catalog to which the target search index belongs. Then, the search result corresponding to the category to which the target search index belongs is directly used as the second search result for the data retrieval request, or the search result corresponding to the category to which the target search index belongs is retrieved again according to the data retrieval request, and the secondary search result is used as the second search result for the data retrieval request.
[0100] For example, assume that the search result corresponding to the category to which the target search index that matches the data retrieval request in the pre-aggregation buffer belongs is: "employee information with programming skills" obtained through the above classification and search combination process. Then, if the data retrieval request is an SQL query statement for instructing to query "employees with programming skills", then directly use this search result as the second search result for the data retrieval request. If the data retrieval request is an SQL query statement for instructing to query "male employees with programming skills", then continue to perform a secondary search on this search result according to the attribute information in the data retrieval request (such as, gender male), and obtain the second search result for the data retrieval request through the secondary search.
[0101] Conversely, if there is no target retrieval index in the associated retrieval directory of the pre-aggregation buffer that matches the data retrieval request, then according to the data retrieval request, the form data source (e.g., form database) of the application form is retrieved to generate a second retrieval result of the data retrieval request.
[0102] As can be seen from the above solution, in the method of this embodiment, an associated retrieval directory set and the first retrieval results respectively corresponding to each associated retrieval directory in the set are pre-generated and stored in the pre-aggregation buffer, where the associated retrieval directories in the set include multiple retrieval indexes with an associated relationship among the form data for retrieval; on this basis, after obtaining a data retrieval request for the corresponding application form, it is determined whether there is a target retrieval index in the associated retrieval directory of the pre-aggregation buffer that matches the data retrieval request, and finally a second retrieval result of the data retrieval request is generated based on the determination result. In the solution of this application, by using the information stored in the pre-aggregation buffer as the retrieval basis, when the requested form data exists in the pre-aggregation buffer, the retrieval of the data source of the form data can be avoided, thereby realizing the fast retrieval of form data automatically according to the form association, and effectively improving the retrieval performance of applications generated based on the automatic code generation platform when retrieving large-scale data.
[0103] In one embodiment, referring to Figure 4 the provided flowchart of the data retrieval method, the data retrieval method disclosed in the embodiment of this application, when there is no target retrieval index in the pre-aggregation buffer that matches the data retrieval request and the data source of the form data of the corresponding application form is retrieved accordingly, may further include the following processing:
[0104] Step 304: By retrieving the data source of the corresponding application form, obtain the retrieval result of the associated retrieval request of the data retrieval request, and store the data retrieval request and its retrieval result of the associated retrieval request in the pre-aggregation buffer.
[0105] Specifically, this step 304 can be further implemented as:
[0106] 21) Based on at least one pre-generated retrieval relationship model, determine the associated retrieval request of the data retrieval request and the retrieval association when the data retrieval request and each of its associated retrieval requests retrieve form data.
[0107] Among them, the constructed retrieval relationship model includes multiple data retrieval requests with an associated relationship among the form data for retrieval, and the retrieval association of each data retrieval request when retrieving form data determined based on the associated relationship among the form data for retrieval.
[0108] This step can be specifically implemented by matching the information of the initiated data retrieval request with each retrieval relationship model, such asFigure 1 Match the SQL query statements initiated by the general to the SQL query statements in the SQL query relationship model, etc., to determine the associated retrieval requests of the data retrieval request and the retrieval associations when the data retrieval request and its respective associated retrieval requests retrieve form data.
[0109] The determined retrieval associations can be, but are not limited to, cascading retrieval associations or sequential retrieval associations. For example, when retrieving a certain organization's information, cascade to retrieve the employee information under that organization, or, for multiple independent forms in the same page view, the layout association causes sequential retrieval of the data of each form due to sequential clicks on each form, etc.
[0110] 22) Retrieve the data source of the form data of the application form based on the associated retrieval requests of the data retrieval request and the retrieval associations between the data retrieval request and its respective associated retrieval requests, to generate the retrieval results of the respective associated retrieval requests of the data retrieval request;
[0111] After that, retrieve the application form data source based on the respective associated retrieval requests of the data retrieval request and the retrieval associations between the requests. For example, based on the cascading association between the associated SQL statements, use the associated SQL statements to cascade and retrieve the form database (such as after retrieving the required organization department information, continue to use the retrieved organization department information as a basis to retrieve the employee information under that organization department), etc., and correspondingly obtain the retrieval results of the respective associated retrieval requests of the data retrieval request.
[0112] Among them, if there are retrievals of the same data model (such as the same data table) in the data source in the data retrieval request and its respective associated retrieval requests, retrieval merging can be performed during the execution of the retrieval.
[0113] 23) Store the second retrieval result of the data retrieval request and the retrieval results of the respective associated retrieval requests of the data retrieval request in the pre-aggregation buffer area.
[0114] Finally, store all or part of the data in the second retrieval result of the data retrieval request and the retrieval results of its respective associated retrieval requests in the pre-aggregation buffer area.
[0115] Generally, users will initiate data query requests for forms with associated relationships, such as cascading associations and layout associations, in sequence. For example, after querying the information of an organizational department, they will continue to initiate a query for the employee information under that department. Based on the processing procedure of this embodiment, when the user continues to initiate a certain associated retrieval request for the current data retrieval request, the retrieval result of the initiated associated retrieval request can be directly generated based on the retrieval results stored in the pre-aggregation buffer for the data retrieval request and its various associated retrieval requests, avoiding the retrieval of the data source of the application form, realizing the fast retrieval of form data according to form associations, and achieving the purpose of accelerating the retrieval process of application form data and improving the retrieval efficiency.
[0116] Corresponding to the above method, an embodiment of the present application also discloses a data retrieval device, and the composition structure of the device is as Figure 5 shown, including at least:
[0117] An acquisition module 501, configured to acquire a data retrieval request for the corresponding application form;
[0118] A determination module 502, configured to determine whether there is a target retrieval index in the pre-aggregation buffer that matches the data retrieval request; wherein, the pre-aggregation buffer stores a pre-generated set of associated retrieval directories and first retrieval results respectively corresponding to each associated retrieval directory in the set of associated retrieval directories, and the associated retrieval directory includes multiple retrieval indexes with associated relationships between the form data for retrieval.
[0119] A generation module 503, configured to generate a second retrieval result of the data retrieval request based on the determination result.
[0120] In an embodiment, the generation module 503 is specifically configured to:
[0121] If the above determination result indicates existence, generate a second retrieval result of the data retrieval request based on the first retrieval result corresponding to the associated retrieval directory to which the target retrieval index in the pre-aggregation buffer belongs;
[0122] If the above determination result indicates non-existence, retrieve the data source of the form data of the application form according to the data retrieval request to generate a second retrieval result of the data retrieval request.
[0123] In an embodiment, the generation module 503 is further configured to: when retrieving the data source of the form data of the application form according to the data retrieval request, obtain the retrieval result of the associated retrieval request of the data retrieval request by retrieving the data source of the form data, and store the retrieval results of the data retrieval request and its associated retrieval requests in the pre-aggregation buffer.
[0124] In one embodiment, the generation module 503, when retrieving the data source of the form data to obtain the retrieval result of the associated retrieval request of the data retrieval request and storing the data retrieval request and the retrieval result of its associated retrieval request in the pre-aggregation buffer, is specifically configured to:
[0125] Based on at least one pre-generated retrieval relationship model, determine the associated retrieval request of the data retrieval request and the retrieval association when the data retrieval request and its respective associated retrieval requests retrieve the form data;
[0126] According to the associated retrieval request of the data retrieval request and the retrieval association between the data retrieval request and its respective associated retrieval requests, retrieve the data source of the form data of the application form to generate the retrieval results of the respective associated retrieval requests of the data retrieval request;
[0127] Store the second retrieval result of the data retrieval request and the retrieval results of the respective associated retrieval requests of the data retrieval request in the pre-aggregation buffer;
[0128] Wherein, the retrieval relationship model includes multiple data retrieval requests with an associated relationship between the form data for retrieval, and the retrieval association when each data retrieval request retrieves the form data determined based on the associated relationship between the form data for retrieval.
[0129] In one embodiment, the first retrieval result corresponding to the associated retrieval directory includes: classifying the data retrieval requests for retrieving the same data model in the data source in the retrieval relationship model into the same category, and combining the retrieval processes of the data retrieval requests in the same category into one retrieval process and then retrieving the data source to obtain the retrieval result;
[0130] When the generation module 503 generates the second retrieval result of the data retrieval request based on the first retrieval result corresponding to the associated retrieval directory to which the target retrieval index belongs in the pre-aggregation buffer, it is specifically configured to:
[0131] Determine the retrieval result corresponding to the category to which the target retrieval index belongs from the first retrieval result corresponding to the associated retrieval directory to which the target retrieval index belongs;
[0132] Use the retrieval result corresponding to the category to which the target retrieval index belongs as the second retrieval result of the data retrieval request, or retrieve the retrieval result corresponding to the category to which the target retrieval index belongs according to the data retrieval request to obtain the second retrieval result of the data retrieval request.
[0133] In one embodiment, the above device further includes:
[0134] A retrieval relationship model construction module, configured to:
[0135] When an application form is published, determine each target application form that meets the association conditions in different application forms and the association relationships between the target application forms;
[0136] Based on the relevant attribute configuration data of each target application form and the association relationships between the target application forms, generate respective data retrieval requests for retrieving the form data of each target application form;
[0137] Based on the association relationships between the target application forms and the data retrieval requests, construct the retrieval relationship model.
[0138] In one embodiment, when the retrieval relationship model construction module determines each target application form that meets the association conditions in different application forms and the association relationships between the target application forms, it is specifically configured to:
[0139] Determine the shortest traversal path between different application forms in a predetermined path traversal manner;
[0140] According to the shortest traversal path between different application forms in a predetermined path traversal manner, determine the association relationships and the strength of association between different application forms;
[0141] Determine different application forms whose strength of association meets the strength condition as each target application form that meets the association conditions, and determine the association relationships between different application forms whose strength of association meets the strength condition as the association relationships between the target application forms.
[0142] In one embodiment, the retrieval relationship model construction module is further configured to:
[0143] After constructing the retrieval relationship model, classify the data retrieval requests for retrieving the same data model in the data source in the retrieval relationship model into the same category; merge the data retrieval requests of the same category into one data retrieval request, and update the retrieval relationship model based on the merge result.
[0144] For the data retrieval device disclosed in the embodiments of the present application, since it corresponds to the data retrieval method disclosed in the above method embodiments, the description is relatively simple. For relevant similarities, please refer to the description of the corresponding method embodiments above, and details are not described here again.
[0145] The embodiments of the present application also disclose an electronic device. The electronic device may be, but is not limited to, a server used to provide form data retrieval services in a server. The composition structure of the electronic device is as Figure 6 shown, and specifically includes:
[0146] A memory 601 for storing a computer instruction set;
[0147] The computer instruction set can be implemented in the form of a computer program.
[0148] A processor 602 for implementing the data retrieval method disclosed in any of the above method embodiments by executing a computer instruction set.
[0149] The processor 602 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, etc.
[0150] In addition, the electronic device may further include components such as a communication interface and a communication bus. The memory, the processor, and the communication interface complete communication with each other through the communication bus.
[0151] The communication interface is used for communication between the electronic device and other devices. The communication bus may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The communication bus may be divided into an address bus, a data bus, a control bus, etc.
[0152] In summary, the data retrieval method, apparatus, and electronic device disclosed in the embodiments of the present application have at least the following technical advantages compared with the traditional technology:
[0153] 31) Under the same data scale, with relatively small storage space consumption, automatically optimize the SQL query call rules of the application generated based on the automatic code generation platform, speed up the data retrieval process of the application form, improve its retrieval efficiency, and obtain a better user experience;
[0154] 32) Pre-aggregate multiple associated retrieval requests of the data retrieval requests of the application generated based on the automatic code generation platform, and exchange the associated retrieval and retrieval result caching operations during one data retrieval for the subsequent improvement of the response performance of the associated retrieval requests, greatly improving the overall data retrieval performance of the application generated based on the automatic code generation platform;
[0155] 33) Through corresponding classification and retrieval merging processing, realize generating query results of multiple forms based on one data retrieval, reduce the number of database retrievals and disk I / O operations, and significantly improve the data query performance of the automatic code generation platform.
[0156] It should be noted that the various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same or similar parts among the various embodiments, reference can be made to each other.
[0157] For the convenience of description, when describing the above system or device, it is divided into various modules or units according to functions for separate description. Of course, when implementing the present application, the functions of each unit can be realized in one or more software and / or hardware.
[0158] From the description of the above embodiments, those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the technical solution of the present application, in essence, or the part that makes contributions to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of the present application.
[0159] Finally, it should also be noted that in this article, relational terms such as first, second, third, and fourth are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including an..." does not exclude the existence of additional identical elements in the process, method, article or device including the said element.
[0160] The above are only the preferred embodiments of the present application. It should be pointed out that for those of ordinary skill in the art, without departing from the principle of the present application, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present application.
Claims
1. A data retrieval method, the method comprising: Obtaining a data retrieval request for a corresponding application form; Determining whether there is a target retrieval index in the pre-aggregation buffer that matches the data retrieval request, and obtaining a determination result; wherein, the pre-aggregation buffer stores a pre-generated associated retrieval directory set and first retrieval results respectively corresponding to each associated retrieval directory in the associated retrieval directory set, and the associated retrieval directory includes multiple retrieval indexes with an association relationship between form data for retrieval; Generating a second retrieval result of the data retrieval request based on the determination result; Wherein, based on a pre-constructed retrieval relationship model, retrieving form data; the retrieval relationship model includes multiple data retrieval requests with an association relationship between form data for retrieval, and retrieval associations of each data retrieval request when retrieving form data determined based on the association relationship between form data for retrieval; After constructing the retrieval relationship model, it further includes: Classifying the data retrieval requests in the retrieval relationship model for retrieving the same data model in the data source into the same category; Merging the data retrieval requests in the same category into one data retrieval request, and updating the retrieval relationship model based on the merging result.
2. The method according to claim 1, wherein generating a second retrieval result of the data retrieval request based on the determination result includes: If the determination result indicates existence, generating a second retrieval result of the data retrieval request based on the first retrieval result corresponding to the associated retrieval directory to which the target retrieval index in the pre-aggregation buffer belongs; If the determination result indicates non-existence, retrieving the data source of the form data of the application form according to the data retrieval request to generate a second retrieval result of the data retrieval request.
3. The method according to claim 2, when retrieving the data source of the form data of the application form according to the data retrieval request, the method further includes: Obtaining the retrieval result of the associated retrieval request of the data retrieval request by retrieving the data source, and storing the retrieval results of the data retrieval request and its associated retrieval requests in the pre-aggregation buffer.
4. The method according to claim 3, wherein obtaining the retrieval result of the associated retrieval request of the data retrieval request by retrieving the data source, and storing the retrieval results of the data retrieval request and its associated retrieval requests in the pre-aggregation buffer includes: Based on at least one pre-generated retrieval relationship model, determining the associated retrieval request of the data retrieval request and the retrieval associations of the data retrieval request and its respective associated retrieval requests when retrieving form data; Retrieving the data source of the form data of the application form according to the associated retrieval request of the data retrieval request and the retrieval associations between the data retrieval request and its respective associated retrieval requests to generate the retrieval results of the respective associated retrieval requests of the data retrieval request; Storing the second retrieval result of the data retrieval request and the retrieval results of the respective associated retrieval requests of the data retrieval request in the pre-aggregation buffer.
5. The method according to claim 4, wherein the first search result corresponding to the associated search directory includes: Classify the data retrieval requests for retrieving the same data model in the data source in the retrieval relationship model into the same category, and combine the retrieval processing of the data retrieval requests of the same category into one retrieval processing, and then retrieve the data source to obtain the retrieval result; Generating a second retrieval result of the data retrieval request based on the first retrieval result corresponding to the associated retrieval directory to which the target retrieval index in the pre-aggregation buffer belongs, including: Determine the retrieval result corresponding to the category to which the target retrieval index belongs from the first retrieval result corresponding to the associated retrieval directory to which the target retrieval index belongs; Use the retrieval result corresponding to the category to which the target retrieval index belongs as the second retrieval result of the data retrieval request, or retrieve the retrieval result corresponding to the category to which the target retrieval index belongs according to the data retrieval request to obtain the second retrieval result.
6. The method according to claim 4, wherein the generating process of the retrieval relationship model includes: When an application form is published, determine each target application form that satisfies the association condition in different application forms and the association relationship between each target application form; Based on the relevant attribute configuration data of each target application form and the association relationship between each target application form, generate each data retrieval request for retrieving the form data of each target application form; Based on the association relationship between each target application form and each of the data retrieval requests, construct the retrieval relationship model.
7. The method according to claim 6, wherein determining each target application form that satisfies the association condition in different application forms and the association relationship between each target application form includes: Determine the shortest traversal path between different application forms in a predetermined path traversal manner; According to the shortest traversal path between different application forms in the predetermined path traversal manner, determine the association relationship and the association strength between different application forms; Determine different application forms whose association strength satisfies the strength condition as each target application form that satisfies the association condition, and determine the association relationship between different application forms whose association strength satisfies the strength condition as the association relationship between each target application form.
8. A data retrieval device, the device includes: An acquisition module for acquiring a data retrieval request for an application form; A determination module for determining whether there is a target retrieval index in the pre-aggregation buffer that matches the data retrieval request to obtain a determination result; wherein, the pre-aggregation buffer stores a pre-generated set of associated retrieval directories and the first retrieval results respectively corresponding to each associated retrieval directory in the set of associated retrieval directories, and the associated retrieval directory includes multiple retrieval indexes with an association relationship between form data for retrieval; A generation module for generating a second retrieval result of the data retrieval request based on the determination result; Wherein, based on a pre-constructed retrieval relationship model, retrieve form data; the retrieval relationship model includes multiple data retrieval requests with an association relationship between form data for retrieval, and the retrieval association of each data retrieval request when retrieving form data determined based on the association relationship between form data for retrieval; After constructing the retrieval relationship model, it further includes: Classifying the data retrieval requests in the retrieval relationship model for retrieving the same data models in the data source into the same category; Merging the data retrieval requests of the same category into one data retrieval request, and updating the retrieval relationship model based on the merging result.
9. An electronic device, comprising: A memory for storing a computer instruction set; A processor for implementing the data retrieval method according to any one of claims 1-7 by executing the instruction set stored on the memory.
Citation Information
Patent Citations
Retrieval device and retrieval method for log database
CN105279213A