A method and system for supporting large-scale data query and retrieval of aerospace engineering

By using preset rules and automatic routing algorithms in a large-scale data query system for aerospace engineering, the problem of difficulty in querying structured and unstructured data in distributed databases at the same time in high concurrency scenarios has been solved, and query stability and accuracy have been achieved. Efficiency.

CN118093654BActive Publication Date: 2024-10-18TECH & ENG CENT FOR SPACE UTILIZATION CHINESE ACAD OF SCI
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410184616.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-19
Publication Date
2024-10-18
Estimated Expiration
2044-02-19

AI Technical Summary

Technical Problem

It is difficult for existing distributed databases to meet the query requirements for structured and unstructured data at the same time. Especially in high-concurrency scenarios, the stability and efficiency of queries cannot be guaranteed.

Method used

By designing a method in the aerospace engineering large-scale data query system, the first server responds to the received query request and forwards the query request to the second server based on preset rules, using the automatic routing algorithm and OLTP query optimization algorithm. , supports querying of structured and unstructured data, and ensures load balancing in high concurrency scenarios through traffic distribution.

Benefits of technology

It realizes simultaneous query of structured and unstructured data, meets the needs of complex query scenarios, ensures the stability and efficiency of queries, and improves the reliability and efficiency of query results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118093654B_ABST
    Figure CN118093654B_ABST
Patent Text Reader

Abstract

The present invention relates to a method and system for supporting large-scale data query and retrieval of aerospace engineering, which can simultaneously realize the query of structured type and unstructured type data, and meet the needs of complex query scenarios of multi-type data. In the method, a first server responds to at least one received query request and forwards the query request to at least one second server based on preset rules. A query request is forwarded by the first server to a second server. Any query request is sent by any client to the first server, and any query request carries at least one query request parameter associated with the result to be queried by any client. Any second server obtains the corresponding query result based on the data type of the result to be queried by any client. The data type includes structured type and unstructured type. Any second server sends the query result to any client so that any client displays the data associated with the query result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of aerospace engineering big data query, and in particular to a method and system for supporting large-scale aerospace engineering data query and retrieval. Background Art

[0002] In the field of manned space engineering, with the long-term in-orbit operation of the space station and the implementation of subsequent missions, massive engineering data and scientific data will continue to be generated. The data is huge in volume and diverse in types, which poses a great challenge to the query performance of the current distributed database.

[0003] However, the current single type of distributed database cannot satisfy queries on both structured and unstructured data. Summary of the invention

[0004] The technical problem to be solved by the present invention is to provide a method and system for querying and retrieval of large-scale and multi-type data in aerospace engineering, which can simultaneously realize the query of structured data and unstructured data to meet the needs of complex query scenarios; and in high concurrency scenarios, ensure the stability and efficiency of complex queries.

[0005] The technical solution of the present invention to solve the above technical problems is as follows:

[0006] On the one hand, the present invention provides a method for supporting large-scale data query and retrieval of aerospace engineering, in which a first server, in response to at least one received query request, forwards the query request to at least one second server based on a preset rule. Among them, one query request is forwarded by the first server to one second server. For any query request in the at least one query request, the any query request is sent to the first server by any client among at least one client, and the any query request carries at least one query request parameter associated with the result to be queried by the any client. For any second server among the at least one second server, the any second server receives the any query request, and, based on the data type of the result to be queried by the any client, obtains the query result corresponding to the at least one query request parameter; the data type includes a structured type and an unstructured type. The any second server sends the query result to the any client; the any client displays the data associated with the query result in response to the received query result.

[0007] The beneficial effects of the present invention are: it can realize the query of structured data and unstructured data at the same time, meeting the needs of complex query scenarios. In addition, the first server distributes the traffic of each received query request through preset rules to ensure load balancing in high-concurrency scenarios, guaranteeing the stability of the query, and ensuring the efficiency of the query through automatic routing algorithms and query optimization algorithms.

[0008] Further, any of the clients enters the full-text query mode and displays the full-text query page in response to a first query mode setting instruction input by the user. The first query mode setting instruction is used to instruct any of the clients to enter the full-text query mode. Any of the clients sends a query request carrying the at least one query request parameter to the first server in response to at least one query request parameter input by the user in the full-text query page. The data type of the query result associated with each query request parameter input by the user in the full-text query page is an unstructured type.

[0009] Alternatively, any of the clients enters the advanced query mode and displays the advanced query page in response to a second query mode setting instruction input by the user. The second query mode setting instruction is used to instruct any of the clients to enter the advanced query mode. The advanced query page includes at least one query request parameter. The data type of the query result associated with each query request parameter included in the advanced query page is a structured type. In response to a selection operation of at least one target query request parameter among the at least one query request parameter input by the user in the advanced query page, any of the clients sends a query request carrying the at least one target query request parameter to the first server.

[0010] The beneficial effect of adopting the above further scheme is: it can support users to customize the query mode. If the query mode of any client is set to full-text query mode by the user, the user is supported to enter at least one query request parameter in the displayed full-text query page. If the query mode of any client is set to advanced query mode by the user, the user is supported to select at least one query request parameter in the displayed advanced query page. Among them, in the full-text query mode, it can be determined that the data type of the result to be queried is an unstructured type. In the advanced query mode, it can be determined that the data type of the result to be queried is a structured type.

[0011] Further, any of the clients sends the preset rules to the first server in response to the rule configuration instruction input by the user on the rule configuration page. The rule configuration instruction is used to instruct setting the preset rules. The first server receives and stores the preset rules.

[0012] The beneficial effect of adopting the above further solution is that the client can display a rule configuration page for supporting users to set preset rules. Users can customize preset rules on the rule configuration page of the client. The traffic distribution determined by the preset rules set by the user ensures load balancing in high-concurrency scenarios and guarantees the query stability of the system provided by the present invention.

[0013] Furthermore, the preset rule includes a destination address corresponding to the query request sent by any client. Based on the destination address, the first server forwards the query request sent by any client to the second server whose address is the destination address.

[0014] The beneficial effect of adopting the above further solution is that the forwarding path corresponding to each query request determined by the first server based on the preset rule can meet the sending needs of each client and improve the stability of the query results obtained.

[0015] Furthermore, the preset rule includes a weight of each second server end. The first server end forwards the query request to at least one second server end based on the weight of each second server end.

[0016] The beneficial effect of adopting the above further solution is that the forwarding path corresponding to each query request determined by the first server based on the preset rule can ensure the query stability of each second server.

[0017] Further, if any of the second servers receives the query request sent by the first server, feedback information indicating successful reception of the query request is sent to the first server. If the first server does not receive the feedback information within the first time period, the query request is forwarded to a second server other than any of the second servers based on the preset rule.

[0018] The beneficial effect of adopting the above further solution is that the first server determines whether to successfully send the query request to the second server based on whether the feedback information can be received within the first time period. If the sending is successful, the first server completes the distribution of the query request and can generate a distribution record. If the sending fails, the first server can redistribute the distribution path of the query request to improve the query reliability and avoid query failure.

[0019] Further, if any of the second servers determines that the data type of the query result is an unstructured type, the query result is obtained based on the Elasticsearch database. If any of the second servers determines that the data type of the query result is a structured type, a query scheme is determined, and the query result is obtained based on the query scheme; the query scheme is determined based on an automatic routing algorithm.

[0020] The beneficial effect of adopting the above further solution is: providing a specific implementation method for obtaining query results based on the automatic routing algorithm and the data type of the query results.

[0021] Further, the automatic routing algorithm includes determining at least one query statement associated with the query request parameter according to the query request parameter. For any query statement among the at least one query statement, extracting at least one related table name included in the any query statement. Based on the related table corresponding to each of the related table names being included in the OLAP database, determining the query solution as a query based on the OLAP database. Based on the related table corresponding to the related table name being not included in the OLAP database, determining the query solution as a query based on the OLTP database.

[0022] The beneficial effects of adopting the above further solution are: providing the specific content of the automatic routing algorithm, providing an efficient query implementation method for querying structured data, and improving query efficiency.

[0023] Furthermore, the query solution can also be optimized based on the query optimization algorithm of the OLTP database. The query optimization algorithm based on the OLTP database includes: determining the query information corresponding to each query result obtained based on the OLTP database within the second time period. The query information includes time information and frequency information. For any query result in each of the query results, the time information corresponding to any query result includes the time used to obtain the any query result based on the OLTP database. The frequency information includes the frequency of obtaining the any query result based on the OLTP database. Based on the query information, the query solution is optimized.

[0024] The beneficial effect of adopting the above further solution is: providing the specific content of the query optimization algorithm based on the OLTP database, optimizing the query solution based on the query optimization algorithm of the OLTP database, and improving the query efficiency.

[0025] In a second aspect, the present invention provides a system for supporting large-scale data query and retrieval in aerospace engineering, the system comprising at least one client and at least one server; the at least one server comprises a first server and at least one second server. The first server is used to respond to at least one query request received and forward the query request to different second servers based on preset rules; wherein one query request is forwarded by the first server to one second server; for any query request in the at least one query request, the any query request carries at least one query request parameter associated with the result to be queried by the at least one client;

[0026] For any second server among the at least one second server, the any second server is used to receive the any query request, and to obtain a query result corresponding to the at least one query request parameter based on the data type of the result to be queried by the any client; the data type includes a structured type and an unstructured type. The any second server is used to send the query result to the any client. The any client is used to display content associated with the query result in response to the received query result.

[0027] The beneficial effects of the present invention are: it can realize the query of structured data and unstructured data at the same time, meeting the needs of complex query scenarios. In addition, the first server distributes the traffic of each received query request through preset rules to ensure load balancing in high-concurrency scenarios, guarantee the stability of the query, and ensure the efficiency of the query through the automatic routing algorithm and the OLTP query optimization algorithm. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 A schematic diagram of a flow chart of a method for supporting large-scale data query and retrieval in aerospace engineering provided by the present invention;

[0029] Figure 2 A schematic diagram of a full-text search page provided by the present invention;

[0030] Figure 3 A schematic diagram of an advanced query page provided by the present invention;

[0031] Figure 4 A schematic diagram of the process flow of the automatic routing algorithm provided by the present invention;

[0032] Figure 5 A schematic diagram of the structure of a system for supporting large-scale data query and retrieval of aerospace engineering provided by the present invention;

[0033] Figure 6 A schematic diagram of the structures of the client, the first server and the second server provided by the present invention. DETAILED DESCRIPTION

[0034] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. Among them, in the description of the present application, unless otherwise specified, " / " indicates that the objects associated before and after are in an "or" relationship, for example, A / B can represent A or B; "and / or" in the present application is only a description of the association relationship of the associated objects, indicating that there can be three relationships, for example, A and / or B, which can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. And, in the description of the present application, unless otherwise specified, "multiple" refers to two or more than two. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple. In addition, in order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first", "second" and the like are used to distinguish between the same items or similar items with substantially the same functions and effects. Those skilled in the art will understand that the words "first", "second" and the like do not limit the quantity and execution order, and the words "first", "second" and the like do not necessarily limit the differences. At the same time, in the embodiments of the present application, the words "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or design.

[0035] Data engines usually include structured data engines for querying and analyzing structured data and unstructured data engines for querying and analyzing unstructured data. Among them, structured data engines can be divided into online analytical processing (OLAP) engines and online transaction processing (OLTP) engines.

[0036] However, current structured data engines can only query and analyze structured data but not unstructured data. Similarly, current unstructured data engines can only query and analyze unstructured data but not structured data. That is, current data engines can only query and analyze data of a single data type (structured data or unstructured data), and cannot simultaneously query and analyze both structured and unstructured data.

[0037] However, efficient query methods require choosing a more appropriate query engine for different query requirements. In addition, with the evolution of business systems and the increase in data volume, how to improve query efficiency has gradually become a problem that needs to be solved urgently.

[0038] In view of the problem that the current query engine cannot simultaneously satisfy the query and analysis of structured data and unstructured data, the present invention provides a method for supporting large-scale data query and retrieval in aerospace engineering. Figure 1 The method includes the following steps S100-S104.

[0039] S100: At least one client sends a query request to a first server.

[0040] In some embodiments, each client supports being set to a corresponding query mode. The query mode may include a full-text query mode and an advanced query mode. The full-text query mode and the advanced query mode are described in detail below.

[0041] Full-text query mode: After storing images, texts, videos, audios and other files related to manned space projects in the corresponding locations in advance, you can extract meta-information related to the files. The meta-information related to the files may include the name of the file, the storage path, the size of the file, etc. After storing the extracted meta-information related to the file in the Elasticsearch database, if the user needs to obtain the above-mentioned file, the query request parameters associated with the above-mentioned file can be entered on the client. When the client is in full-text query mode, it can be determined that the data type of the result to be queried by the user is an unstructured type. Afterwards, the meta-information of the above-mentioned file can be obtained in the Elasticsearch database based on the query request parameters entered by the user, thereby obtaining the above-mentioned file in the storage path of the above-mentioned file. Afterwards, the content associated with the above-mentioned file can be rendered and displayed on the client in a preset manner.

[0042] It can be seen that the full-text query mode supports the user to define the query request parameters, and the full-text query mode supports querying unstructured data based on the query request parameters defined by the user.

[0043] Advanced query mode: Pre-store structured data to be queried through ClickHouse. After that, the key parameters of each query can be displayed on the client. If the user needs to query business-related data, he can select the query request parameters corresponding to the business in the client. After that, the data associated with the request can be obtained through the OLTP database or OLAP database based on the query request parameters selected by the user. After that, the information related to the above query result data can be rendered and displayed on the client in a preset way.

[0044] It can be seen that the advanced query mode supports users to select pre-set query request parameters. When the client is in the advanced query mode, it can determine that the data type of the result to be queried by the user is a structured type. Among them, since the advanced query mode involves a variety of structured data attributes, it can provide multi-dimensional combined analysis. Therefore, when it is necessary to query data records with certain attributes in large-scale data, or to perform statistical analysis on certain attributes of large-scale data, the client's query mode can be set to advanced query mode.

[0045] For ease of description, in this embodiment, any client among the at least one client may be referred to as a target client, the query request sent by the target client to the first server may be referred to as a target query request, the query request parameters carried by the target query request may be referred to as target query request parameters, and the second server that receives the target query request forwarded by the first server may be referred to as a target second server.

[0046] The following is a detailed description of the method for setting the query mode of the target client.

[0047] In some embodiments, see Figure 2 , the target client may display a page for setting the query mode. The page includes a control 201 for setting the target client to the full-text query mode and a control 202 for setting the target client to the advanced query mode. The user may select the control 201 to instruct the target client to enter the full-text query mode. The user may also select the control 202 to instruct the target client to enter the advanced query mode.

[0048] Among them, the user's selection operation on control 201 can also be regarded as the user inputting a first query mode setting instruction to the target client. The user's selection operation on control 202 can also be regarded as the user inputting a second query mode setting instruction to the target client. After receiving the first query mode setting instruction or the second query mode setting instruction input by the user, the target client can make a corresponding response.

[0049] In some embodiments, after receiving the first query mode setting instruction input by the user, the target client may enter the full-text query mode in response to the first query mode setting instruction, and display the following Figure 2The full-text query page 210 shown. The full-text query page 210 includes an input box 211. The input box 211 supports the user to input at least one query request parameter to the target client. After the user enters at least one query request parameter (for example, enters the keyword "TG") in the input box 211, the target client sends a query request carrying the query request parameter entered by the user to the first server in response to the at least one query request parameter entered by the user. Correspondingly, the first server can receive the query request sent by the target client.

[0050] In some embodiments, after receiving the second query mode setting instruction input by the user, the target client may enter the advanced query mode in response to the second query mode setting instruction input by the user, and display the following Figure 3 The advanced query page shown. The advanced query page 300 includes at least one pre-set query request parameter (for example, "file ID true", "space code true", "model name true", "model description true", etc.). The user can select at least one target query request parameter (for example, "file ID true" and "space code true") among the query request parameters displayed by the target client. In response to the user's selection operation, the target client sends a query request carrying the target query request parameter selected by the user to the first server. Correspondingly, the first server can receive the query request sent by the target client.

[0051] S101: In response to at least one received query request, a first server forwards the query request to at least one second server based on a preset rule.

[0052] Among them, a query request is forwarded by the first server to a second server. That is, the same query request will not be forwarded by the first server to different second servers, avoiding repeated queries and reducing resource waste of the second server.

[0053] In some embodiments, before forwarding the query request to at least one second server, the first server may obtain a preset rule. The method for the first server to obtain the preset rule is described in detail below.

[0054] First, the target client (e.g., client 401) may display a rule configuration page. A user may enter a rule configuration instruction for indicating setting a preset rule on the rule configuration page. In response to the rule configuration instruction entered by the user, the target client may send the preset rule to the first server. The first server may receive and store the preset rule sent by the target client. For example, the first server may store the preset rule in a configuration library.

[0055] Among them, the preset rules can be set based on configuration parameters, and the configuration parameters may include at least one of the address of each second server, the listening port of each second server, the resource utilization of each second server, and the operating status of each second server, which is not limited by the embodiments of the present application.

[0056] In some embodiments, since some businesses in a production environment have high real-time requirements, the first server needs to forward the query request of the target client to the designated second server to improve the sending efficiency and query stability. In this case, the preset rule determined by the first server may include the destination address corresponding to the query request sent by the target client (for example, the IP address and / or port number of the target second server). Based on the destination address, the first server can forward the query request sent by the target client to the target second server.

[0057] In some embodiments, since in a production environment, there are generally differences in the business programs executed on different second service terminals, different second service terminals can support different traffic sizes for queries. In this case, the preset rules may also include the weights of each second service terminal. The weight of each second service terminal may reflect the priority of each second service terminal in receiving the query request. The weight of each second service terminal may be determined based on at least one of the listening port of each second service terminal, the resource utilization of each second service terminal, and the operating status of each second service terminal, and the embodiments of the present application are not limited thereto.

[0058] The first server can forward the query request to at least one second server based on preset rules. For example, if there are two second servers, and the weights of the two second servers are equal, the first server can send the received query requests to the two second servers evenly. That is, the number of query requests received by the two second servers is equal. For another example, if there are two second servers, one second server has fewer available computing resources and its weight is 2, and the other second server has more available computing resources and its weight is 8, then the first server can send 80% of the received query requests to the second server with a weight of 8, and send the other 20% of the received query requests to the second server with a weight of 2.

[0059] In some embodiments, as each second server receives a query request, the user can update the preset rules set on the rule configuration page to fully utilize the computing resources of each second server and improve query efficiency.

[0060] In some embodiments, if the preset rule includes both a destination address corresponding to the query request sent by the target client and the weight of each second server, the first server can forward the query request to the corresponding second server based on the destination address.

[0061] In some embodiments, if the preset rules only include at least two destination addresses corresponding to the query request sent by the target client, the first server can evenly distribute the received query requests to the second servers corresponding to the two destination addresses respectively, so as to achieve load balancing, improve query efficiency, and reduce the load rate of each second server.

[0062] In some embodiments, if the preset rules include both at least two destination addresses corresponding to the query request sent by the target client and the weights of each second server, the first server can forward the query request to the second server corresponding to each destination address based on the weight of the second server corresponding to each destination address.

[0063] In some embodiments, after the target second server receives the query request sent by the first server, it can send feedback information to the first server to indicate that the query request has been successfully received. Correspondingly, if the first server receives the feedback information within the first time period, it means that the query request has been sent successfully, and the first server completes the distribution of the query request and can generate a distribution record. If the first server does not receive the feedback information within the first time period, it means that the sending has failed. The first server can re-distribute the distribution path of the query request based on the preset rules to forward the query request to the second server other than the target second server to avoid query failure.

[0064] In some embodiments, a threshold of the number of failed transmissions is set in the configuration library. When the number of failed transmissions does not reach the threshold, if the transmission is successful, the first server can log the meta information of the query request sent. If the transmission fails, the first server can distribute the query request weighted polling to other second servers. When the number of failed transmissions reaches the threshold, the client can prompt the user that the query failed, and alert the operation and maintenance personnel through the background monitoring system.

[0065] S102: The target second server receives the target query request, and obtains the corresponding query result based on the target query request parameters and the data type of the result to be queried by the target client.

[0066] Among them, data types include structured types and unstructured types.

[0067] In some embodiments, if the target second server determines that the data type of the result to be queried by the target client is an unstructured type, the query result corresponding to the target query request parameter is obtained based on the Elasticsearch database.

[0068] Among them, the role of the Elasticsearch database is to organize and classify data for storage, so that users can quickly and efficiently query the required information. In the Elasticsearch database, data is stored in indexes in JSON format, and each index can contain multiple documents. An index is a collection of documents with similar characteristics, similar to a database or data storage solution in SQL. Through indexes, the Elasticsearch database can achieve distributed storage and retrieval of data, and support query and analysis of large-scale data sets.

[0069] In some embodiments, each second server can view the index list, index status, and index information in the Elasticsearch database. Corresponding management operations can be performed on the Elasticsearch database, including: creating a new index, creating a new index alias, merging indexes, closing indexes, and deleting indexes. When a file is stored in the Elasticsearch database, the data can be stored in a specified index according to its characteristics, such as the time when the data was uploaded, the source of the data (ground support center), the name of the fuzzy search object, the file type, etc. When data is queried based on the Elasticsearch database, data browsing, data query, and other operations can be performed on the indexes in a single cluster in the Elasticsearch database cluster. By selecting the index for which data browsing is required, the data records in the index can be viewed.

[0070] In some embodiments, if the target second server determines that the data type of the result to be queried by the target client is a structured type, it determines a query scheme, and obtains a query result corresponding to the target query request parameter based on the determined query scheme. The target query scheme is determined based on an automatic routing algorithm.

[0071] In an embodiment of the present application, when querying data of a structured type, there are multiple query scenarios, including: real-time processing of transactions of large amounts of data, high-concurrency query requests, and multi-dimensional analysis and processing of historical data. Different query scenarios are suitable for different query databases. Considering that some businesses have certain requirements for transaction processing and data analysis, the OLTP database can be synchronized with the OLAP database. Among them, the OLAP database is mainly used for complex analytical operations and decision support, and provides intuitive and easy-to-understand query results. A typical application is a complex dynamic reporting system. The OLTP database focuses more on applications with high real-time requirements, and is designed to quickly process single transactions.

[0072] An OLTP table and an OLAP table will be established by synchronizing the OLAP database with the OLTP database, with the OLTP database as the entry. If a piece of data is inserted into the OLTP database, the data will be synchronously inserted into the OLAP database. Based on this storage mechanism, the present invention provides an automatic routing algorithm. Based on the automatic routing algorithm, the second server can determine a suitable query solution, so that the user does not need to worry about which query database is suitable for the current query scenario. After the user provides the screening conditions, the second server can automatically route the query request to the appropriate query database, which greatly improves the efficiency of retrieval.

[0073] Combine the following Figure 4 The automatic routing algorithm is described in detail.

[0074] S400: Determine, according to the query request parameters, at least one query statement associated with the query request parameters.

[0075] The query statement may be a SQL statement, and may be used to obtain query results associated with corresponding query request parameters.

[0076] S401: For any query statement, extract at least one related table name included in the query statement.

[0077] Since the query statement is an SQL statement, at least one related table name in the SQL statement can be extracted by formatting the SQL statement. The query solution can be determined based on whether all related tables corresponding to the related table names are included in the OLAP database.

[0078] If the related table corresponding to each related table name is included in the OLAP database, then the following step S402 may be continued to be executed. If there is a related table corresponding to the related table name that is not included in the OLAP database, then the following step S403 may be continued to be executed.

[0079] S402: Determine the query solution as being based on OLAP database query.

[0080] S403: Determine the query solution as being based on OLTP database query.

[0081] In some embodiments, after the target second server determines the query solution, it can map and convert the query statement used to request the query result according to the grammatical rules. If the query statement is executed on the OLTP database, no conversion is required. If the query statement is executed on the OLAP database, the query statement is converted into a ClickHouse query statement according to fixed conversion rules. Among them, the conversion rules may include structure conversion, function conversion, and function conversion compatibility required for type comparison. The following is a description of the structure conversion, function conversion, and function conversion compatibility required for type comparison with specific examples.

[0082] Structural transformation: For example, it may include converting some subqueries into join queries.

[0083] Function conversion: For example, it can include converting year into toYear, day into toDay, is not null into isNotNull, etc.

[0084] Function conversion compatibility is required when comparing types: for example, some types of a=b may require adding functions for comparison: a=cast(b as xxxx).

[0085] Corresponding conversion rules have been formulated to address the compatibility differences between ClickHouse and MySQL syntax systems.

[0086] S103: The target second server sends the query result to the target client.

[0087] In some embodiments, the target second server may directly send the query result to the target client. The target second server may also forward the query result to the target client through the first server, which is not limited in the embodiments of the present application.

[0088] Correspondingly, the target client can receive the query result sent by the target second server.

[0089] S104: The target client displays content associated with the query result in response to the received query result.

[0090] The content associated with the query result may be presented in at least one of a document data form (e.g., text, file), an image data form (e.g., photo, thumbnail, chart, pattern), an audio data form, and a video data form. Data in the document data form, image data form, and video data form may be directly displayed on the target client to support online browsing by the user. Data in the audio data form may be played through the target client to support online listening by the user.

[0091] In some embodiments, as business systems and data evolve, queries based on OLTP databases may slow down. Therefore, query solutions can be optimized based on query optimization algorithms of OLTP databases to increase query speed.

[0092] The query optimization algorithm based on the OLTP database includes: traversing the query records within the second time period (for example, the past 30 days) to determine the query information corresponding to each query result obtained based on the OLTP database within the second time period. The query information includes time information and frequency information. The time information is the time used to obtain the corresponding query result based on the OLTP database. The frequency information is the frequency of obtaining the corresponding query result based on the OLTP database. The query solution is optimized based on the obtained query information.

[0093] The following describes in detail the optimization method used in the query optimization algorithm based on the OLTP database in conjunction with Table 1.

[0094] Referring to Table 1, if it is determined that the query time for obtaining a certain query result based on the OLTP database in the second time period is between 1s and 5s, and the query frequency is less than 5 times, when the query result is subsequently queried, the query result can be queried by modifying the SQL statement to improve the query efficiency.

[0095] If the target second server determines that the query time for obtaining a certain query result based on the OLTP database within the second time period is 6s-10s, and the query frequency is 5-10 times. When the query result is queried later, the query result can be queried by routing to the slave database to improve query efficiency.

[0096] If the target second server determines that the query time for obtaining a certain query result based on the OLTP database within the second time period is more than 10 seconds, and the query frequency is more than 10 times, when the query result is subsequently queried, the query result can be queried based on the OLAP database query method to improve the query efficiency.

[0097] Table 1

[0098]

[0099]

[0100] In some embodiments, the present invention also provides a system for supporting large-scale data query and retrieval in aerospace engineering. The system provided by the present invention can support the implementation of some or all steps of a method for supporting large-scale data query and retrieval in aerospace engineering provided by the present invention. Figure 5The system provided by the present invention includes at least one client 510 and at least one server 520. The at least one server 520 includes a first server 521 and at least one second server (eg, a second server 522).

[0101] See also Figure 6 The client may include a query page module, a rule configuration module, and a data display module. The first server may include a traffic distribution module and a first query monitoring module. The second server may include a query optimization module, a second query monitoring module, and a query processing module. The following is a detailed description of a large-scale data query and retrieval system for aerospace engineering provided by the present invention in conjunction with a specific embodiment.

[0102] In some embodiments, the query page module of each client supports setting the corresponding client to a corresponding query mode. Among them, the query mode may include a full-text query mode and an advanced query mode. For the description of the full-text query mode and the advanced query mode, please refer to the description in the aforementioned embodiment, which will not be repeated here.

[0103] In some embodiments, the query page module can control the target client to display the query mode setting page. The description of the query mode setting page can refer to the description in the above embodiment, which will not be repeated here.

[0104] The user can enter the first query mode setting instruction or the second query mode setting instruction in the query mode setting page. Among them, the description of the first query mode setting instruction or the second query mode setting can refer to the description in the aforementioned embodiment, which is not repeated here. After the query page module of the target client receives the first query mode setting instruction or the second query mode setting instruction input by the user, it can make a corresponding response.

[0105] In some embodiments, after the query page module of the target client receives the first query mode setting instruction input by the user, it can control the target client to enter the full-text query mode and display the full-text query page in response to the first query mode setting instruction. The full-text query page includes an input box. After the user enters at least one query request parameter in the input box (for example, enters the keyword "TG"), the target client responds to the at least one query request parameter input by the user and sends a query request carrying the query request parameter input by the user to the first server. Correspondingly, the first server can receive the query request sent by the target client.

[0106] In some embodiments, after the query page module of the target client receives the second query mode setting instruction input by the user, it can control the target client to enter the advanced query mode and display the advanced query page in response to the second query mode setting instruction input by the user. The advanced query page includes at least one query request parameter that is pre-set. The user can select at least one target query request parameter among the query request parameters displayed by the target client. In response to the user's selection operation, the target client sends a query request carrying the target query request parameter selected by the user to the first server. Correspondingly, the first server can receive the query request sent by the target client (also referred to as a target query request in the embodiment of the present application).

[0107] In some embodiments, after the first server receives at least one query request including a target query request, the traffic distribution module of the first server may forward the query request to at least one second server based on a preset rule to distribute the received query requests. One query request is forwarded from the first server to one second server.

[0108] In some embodiments, before forwarding the query request to at least one second server, the first server may obtain a preset rule. The method for the first server to obtain the preset rule is described in detail below.

[0109] First, the rule configuration module of the target client can control the target client to display a rule configuration page. The user can enter a rule configuration instruction for indicating setting a preset rule on the rule configuration page. The rule configuration module of the target client can send the preset rule to the first server in response to the rule configuration instruction input by the user. The first server can receive and store the preset rule sent by the target client. For example, the first server can store the preset rule in a configuration library.

[0110] For the description of the preset rules, please refer to the description in the aforementioned embodiment and will not be repeated here.

[0111] In some embodiments, as each second server receives a query request, the user can update the preset rules set on the rule configuration page to fully utilize the computing resources of each second server and improve query efficiency.

[0112] In some embodiments, if the preset rules include both a destination address corresponding to the query request sent by the target client and the weights of each second server, the traffic distribution module of the first server can forward the query request to the corresponding second server based on the destination address.

[0113] In some embodiments, if the preset rules only include at least two destination addresses corresponding to the query request sent by the target client, the traffic distribution module of the first server can evenly distribute the received query requests to the second server corresponding to the two destination addresses respectively, so as to achieve load balancing, improve query efficiency, and reduce the load rate of each second server.

[0114] In some embodiments, if the preset rules include both at least two destination addresses corresponding to the query request sent by the target client and the weights of each second server, the traffic distribution module of the first server can forward the query request to the second server corresponding to each destination address based on the weight of the second server corresponding to each destination address.

[0115] In some embodiments, after the target second server receives the query request sent by the first server, it can send feedback information to the first server to indicate that the query request has been successfully received. Correspondingly, if the first server receives the feedback information within the first time period, it means that the query request has been sent successfully, and the first server completes the distribution of the query request this time. The first query monitoring module of the first server can generate a distribution record. If the first server does not receive the feedback information within the first time period, it means that the sending has failed. The traffic distribution module of the first server can re-distribute the distribution path of the query request based on preset rules to forward the query request to the second server other than the target second server to avoid query failure.

[0116] In some embodiments, a threshold value for the number of failed transmissions is set in the configuration library. When the first query monitoring module of the first server detects that the number of failed transmissions does not reach the threshold value, if the transmission is successful, the first query monitoring module of the first server may record the metadata of the query request sent through a log. If the transmission fails, the first query monitoring module of the first server may distribute the query requests to other second servers by weighted polling. When the first query monitoring module of the first server detects that the number of failed transmissions reaches the threshold value, the first query monitoring module of the first server may generate a prompt message and send the prompt message to the client. The client may display content associated with the prompt message to prompt the user that the query has failed, and the first query monitoring module of the first server may alert the operation and maintenance personnel through the background monitoring system.

[0117] In some embodiments, the target second server receives the target query request, and the query processing module of the target second server obtains the query result corresponding to the target query request parameter based on the data type of the target query request parameter, wherein the data type includes a structured type and an unstructured type.

[0118] In some embodiments, if the query processing module of the target second server determines that the data type of the result to be queried by the target client is an unstructured type, the query result corresponding to the target query request parameter is obtained based on the Elasticsearch database. The description of the Elasticsearch database can be found in the description of the aforementioned embodiment, which is not repeated here.

[0119] In some embodiments, the query processing module of each second server can view the index list, index status, and index information in the Elasticsearch database. Corresponding management operations can be performed on the Elasticsearch database, including: creating a new index, creating a new index alias, merging indexes, closing indexes, and deleting indexes. When a file is stored in the Elasticsearch database, the data can be stored in a specified index according to its characteristics, such as the time when the data was uploaded, the source of the data (business unit), the name of the fuzzy search object, the file type, etc. When data is queried based on the Elasticsearch database, data browsing, data query, and other operations can be performed on the indexes in a single cluster in the Elasticsearch database cluster. By selecting the index for which data browsing is required, the data records in the index can be viewed.

[0120] In some embodiments, if the query processing module of the target second server determines that the data type of the result to be queried by the target client is a structured type, a query scheme is determined, and a query result corresponding to the target query request parameter is obtained based on the determined query scheme. The target query scheme is determined based on an automatic routing algorithm. For a description of the automatic routing algorithm, please refer to the description in the aforementioned embodiment, which will not be repeated here.

[0121] In some embodiments, after the target second server determines the query result, it can send the query result to the target client. Correspondingly, the target client can receive the query result sent by the target second server. The data display module of the target client can display the content associated with the query result in response to the received query result. Among them, the description of the content associated with the query result can refer to the description in the aforementioned embodiment, which will not be repeated here.

[0122] In some embodiments, as the business system and data evolve, the query speed of the second server based on the OLTP database may slow down. Therefore, the query optimization module of the second server can optimize the query solution based on the query optimization algorithm of the OLTP database to improve the query speed.

[0123] Among them, the description of optimizing the query solution based on the query optimization algorithm of the OLTP database can be found in the description of the aforementioned embodiment, which will not be repeated here.

[0124] In some embodiments, the second query monitoring module included in the second server can monitor the query status of the second server. For example, the second query monitoring module can monitor the operation status of the corresponding query processing module to obtain the query progress. For another example, the second query monitoring module can monitor the corresponding query optimization module to obtain the optimization progress, etc. The embodiments of the present application are not limited.

[0125] In some schemes, multiple embodiments of the present application can be combined, and the combined scheme can be implemented. Optionally, some operations in the process of each method embodiment are optionally combined, and / or the order of some operations is optionally changed. In addition, the execution order between the steps of each process is only exemplary and does not constitute a restriction on the execution order between the steps. There can also be other execution orders between the steps. It is not intended to indicate that the execution order is the only order in which these operations can be performed. A person of ordinary skill in the art will think of a variety of ways to reorder the operations described herein. In addition, it should be noted that the process details involved in a certain embodiment of this article are also applicable to other embodiments in a similar manner, or different embodiments can be used in combination.

[0126] In addition, some steps in the method embodiment may be equivalently replaced by other possible steps. Alternatively, some steps in the method embodiment may be optional and may be deleted in certain usage scenarios. Alternatively, other possible steps may be added to the method embodiment. Furthermore, the method embodiments may be implemented separately or in combination.

[0127] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the system can be divided into different functional modules to complete all or part of the functions described above.

[0128] In the several embodiments provided in the present application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of systems or units, which can be electrical, mechanical or other forms.

[0129] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0130] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

[0131] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims

1. A method for querying and retrieving large-scale data in aerospace engineering. It is characterized in that include: The first server, in response to at least one query request received, forwards the query request to at least one second server based on a preset rule; wherein one query request is forwarded by the first server to one second server; for any query request among the at least one query request, the any query request is sent to the first server by any client among at least one client, and the any query request carries at least one query request parameter associated with the result to be queried by the any client; wherein, in the case where the preset rule includes a destination address corresponding to the query request sent by the any client, the first server forwards the query request sent by the any client to the second server whose address is the destination address based on the destination address; in the case where the preset rule includes a weight of each second server, the first server forwards the query request to at least one second server based on the weight of each second server; For any second server among the at least one second server, the any second server receives the any query request, and, based on the data type of the result to be queried by the any client, obtains a query result corresponding to the at least one query request parameter; the data type includes a structured type and an unstructured type; Any second server sends the query result to any client; In response to the received query result, any one of the clients displays content associated with the query result; Before the first server responds to the received at least one query request, the method further includes: The any one of the clients enters the full-text query mode and displays the full-text query page in response to the first query mode setting instruction input by the user; the first query mode setting instruction is used to instruct the any one of the clients to enter the full-text query mode; the any one of the clients sends a query request carrying the at least one query request parameter to the first server in response to at least one query request parameter input by the user in the full-text query page; the data type of the query result associated with each query request parameter input by the user in the full-text query page is an unstructured type; or, Before the first server responds to the received at least one query request, the method further includes: In response to a second query mode setting instruction input by a user, any one of the clients enters an advanced query mode and displays an advanced query page; the second query mode setting instruction is used to instruct any one of the clients to enter the advanced query mode; the advanced query page includes at least one query request parameter; the data type of the query result associated with each query request parameter included in the advanced query page is a structured type; in response to a selection operation of at least one target query request parameter among the at least one query request parameter input by the user in the advanced query page, any one of the clients sends a query request carrying the at least one target query request parameter to the first server.

2. The method according to claim 1, It is characterized in that Before the first server responds to the received at least one query request, the method further includes: The any client sends the preset rule to the first server in response to the rule configuration instruction input by the user on the rule configuration page; the rule configuration instruction is used to instruct setting the preset rule; The first server receives and stores the preset rule.

3. The method according to claim 2, It is characterized in that After the first server, in response to the received at least one query request, forwards the query request to at least one second server based on a preset rule, the method further includes: If any of the second servers receives the query request sent by the first server, then feedback information indicating successful receipt of the query request is sent to the first server; If the first server does not receive the feedback information within the first time period, the query request is forwarded to a second server other than any one of the second servers based on the preset rule.

4. The method according to claim 3, It is characterized in that The any second server obtains the query result corresponding to the at least one query request parameter based on the data type of the result to be queried by the any client, including: If any of the second servers determines that the data type of the query result is an unstructured type, obtaining the query result based on Elasticsearch; If any of the second servers determines that the data type of the query result is a structured type, then a query scheme is determined, and the query result is obtained based on the query scheme; the query scheme is determined based on an automatic routing algorithm.

5. The method according to claim 4, It is characterized in that The automatic routing algorithm includes: Determining, according to the query request parameter, at least one query statement associated with the query request parameter; For any query statement among the at least one query statement, extract at least one related table name included in the any query statement; Based on the fact that the related table corresponding to each of the related table names is included in the OLAP database, determining the query solution as a query based on the OLAP database; Based on the fact that the related table corresponding to the related table name is not included in the OLAP database, the query solution is determined to be based on the OLTP database query.

6. The method according to claim 5, It is characterized in that The method further includes: optimizing the query solution based on a query optimization algorithm of the OLTP database; wherein the query optimization algorithm based on the OLTP database includes: Determine query information corresponding to each query result obtained based on the OLTP database within a second time period; the query information includes time information and frequency information; for any query result in each query result, the time information corresponding to any query result includes the time used to obtain the any query result based on the OLTP database; the frequency information includes the frequency of obtaining the any query result based on the OLTP database; Based on the query information, the query solution is optimized.

7. A large-scale data query and retrieval system supporting aerospace engineering, It is characterized in that include: At least one client and at least one server; the at least one server includes a first server and at least one second server; The first server is used to respond to at least one query request received and forward the query request to different second servers based on preset rules; wherein one query request is forwarded by the first server to one second server; for any query request among the at least one query request, the any query request is sent to the first server by any client among at least one client, and the any query request carries at least one query request parameter associated with the result to be queried by the at least one client; wherein, in the case where the preset rule includes a destination address corresponding to the query request sent by the any client, the first server forwards the query request sent by the any client to the second server whose address is the destination address based on the destination address; in the case where the preset rule includes the weight of each second server, the first server forwards the query request to at least one second server based on the weight of each second server; For any second server among the at least one second server, the any second server is used to receive the any query request, and to obtain a query result corresponding to the at least one query request parameter based on a data type of a result to be queried by the any client; the data type includes a structured type and an unstructured type; Any second server is used to send the query result to any client; The any one of the clients is used to display data associated with the query result in response to the received query result; Wherein, any of the clients is also used for: In response to a first query mode setting instruction input by a user, entering a full-text query mode and displaying a full-text query page; the first query mode setting instruction is used to instruct any client to enter the full-text query mode; In response to at least one query request parameter entered by the user in the full-text query page, a query request carrying the at least one query request parameter is sent to the first server; the data type of the query result associated with each query request parameter entered by the user in the full-text query page is an unstructured type; Any of the clients is also used to: In response to a second query mode setting instruction input by a user, an advanced query mode is entered, and an advanced query page is displayed; the second query mode setting instruction is used to instruct any client to enter the advanced query mode; the advanced query page includes at least one query request parameter; the data type of the query result associated with each query request parameter included in the advanced query page is a structured type; In response to a user selecting at least one target query request parameter among the at least one query request parameter in the advanced query page, a query request carrying the at least one target query request parameter is sent to the first server.

Citation Information

Patent Citations

  • Structured and unstructured data query method, device and equipment, and storage medium

    CN111563098A