Query method, device and system and storage medium
Through the dynamic multi-layer index structure, the problem that traditional data query methods are difficult to efficiently handle multi-dimensional and complex conditions is solved, and efficient query and query efficiency of multi-dimensional data is improved.
Patent Information
- Application Number
- CN202510147546.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-10
- Publication Date
- 2025-06-03
AI Technical Summary
Traditional data query methods are difficult to efficiently handle multi-dimensional and complex conditions, especially when the amount of data is huge.
It adopts a dynamic multi-layer index structure, consisting of a parallel index layer of multiple different attributes. By receiving query requests, query conditions are extracted, and data that meets the conditions is filtered through dynamic multi-layer indexes to finally determine the query results.
It realizes efficient query of multi-dimensional data and improves query efficiency, especially in query scenarios that deal with multi-dimensional and complex conditions.
Smart Images

Figure CN120086216A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of data query, and particularly relates to a query method, device, system, and storage medium. Background Art
[0002] In traditional data query scenarios, indexing techniques are mostly single-layer structures. For example, linear scanning directly traverses all data. Although the operation is simple, the query efficiency is not high. Especially when the data volume is extremely large, the latency will increase significantly. Single indexes, such as time series indexes based on B+ trees and object indexes based on hash tables, can improve the query efficiency in a single dimension but are difficult to solve queries with multiple dimensions and complex conditions.
[0003] Therefore, how to provide a query method to improve the efficiency of multi-dimensional queries has become an urgent technical problem to be solved. Summary of the Invention
[0004] This application provides a query method, device, system, and storage medium to improve the efficiency of multi-dimensional queries.
[0005] This application provides a query method, including:
[0006] Receiving a query request;
[0007] Extracting at least one query condition from the query request according to the type of the dynamic multi-layer index, so that the query condition corresponds to the type of the dynamic multi-layer index, where the dynamic multi-layer index is composed of multiple index layers with different attributes in parallel;
[0008] Filtering the data that meets the query condition through the dynamic multi-layer index to obtain a preliminary query result corresponding to each query condition;
[0009] Determining the final query result according to the preliminary query result.
[0010] The beneficial effect of this application is that when receiving a query request, at least one query condition is extracted from the query request according to the type of the dynamic multi-layer index, so that the query condition corresponds to the type of the dynamic multi-layer index. Then, the data that meets the query condition is filtered through the dynamic multi-layer index to obtain a preliminary query result corresponding to each query condition; finally, the final query result is determined according to the preliminary query result. Since the dynamic multi-layer index in this application is composed of multiple index layers with different attributes in parallel, the query of multi-dimensional data can be realized, thereby improving the query efficiency.
[0011] In one embodiment, the determining the final query result according to the preliminary query result includes:
[0012] When the preliminary query result is one, determine the preliminary query result as the final query result;
[0013] When the preliminary query results are multiple, determine the intersection of the multiple preliminary query results as the final query result.
[0014] In one embodiment, when there are multiple query conditions, screening the data that meets the query conditions through the dynamic multi-layer index includes:
[0015] Determine the index corresponding to the query condition in the dynamic multi-layer index;
[0016] Determine the execution order of each index;
[0017] According to the execution order of each index, sequentially call the corresponding index to screen the data that meets the query conditions.
[0018] In one embodiment, the determining the execution order of each index includes:
[0019] Obtain the priority of each index;
[0020] Determine the query order of each index according to the priority of each index.
[0021] In one embodiment, the method further includes:
[0022] Construct a region block index as the first-layer index through a multi-way tree;
[0023] Construct a hash table through vehicle IDs and construct a balanced tree through time series as the second-layer index;
[0024] Construct various types of indexes including a status index, an inverted index, and a nested index as the third-layer index.
[0025] In one embodiment, the method further includes:
[0026] Construct the dynamic multi-layer index according to the multi-layer index including at least the first-layer index, the second-layer index, and the third-layer index.
[0027] In one embodiment, the screening the data that meets the query conditions through the dynamic multi-layer index to obtain the preliminary query results corresponding to each query condition respectively includes:
[0028] Locate the spatial region where the vehicle is located through the first-layer index;
[0029] Determine the IDs of the target vehicles within a specific time range in the spatial region according to the second-layer index;
[0030] Query the specified information of the target vehicle through the third - layer index.
[0031] This application also provides a query device, including:
[0032] A receiving module, configured to receive a query request;
[0033] An extraction module, configured to extract at least one query condition in the query request according to the type of the dynamic multi - layer index, so that the query condition corresponds to the type of the dynamic multi - layer index, where the dynamic multi - layer index is composed of parallel index layers with multiple different attributes;
[0034] A screening module, configured to screen the data that meets the query conditions through the dynamic multi - layer index to obtain preliminary query results respectively corresponding to each query condition;
[0035] A determination module, configured to determine the final query result according to the preliminary query results.
[0036] In one embodiment, the determination module includes:
[0037] A first determination sub - module, configured to determine the preliminary query result as the final query result when the preliminary query result is one;
[0038] A second determination sub - module, configured to determine the intersection of the multiple preliminary query results as the final query result when the preliminary query results are multiple.
[0039] In one embodiment, the screening module includes:
[0040] A third determination sub - module, configured to determine the index corresponding to the query condition in the dynamic multi - layer index;
[0041] A fourth determination sub - module, configured to determine the execution order of each index;
[0042] A calling sub - module, configured to sequentially call the corresponding index according to the execution order of each index to screen the data that meets the query conditions.
[0043] In one embodiment, the fourth determination sub - module is further configured to:
[0044] Obtain the priorities of each index;
[0045] Determine the query order of each index according to the priorities of each index.
[0046] In one embodiment, the device further includes:
[0047] A first construction module, configured to construct a regional block index as the first - layer index through a multi - way tree;
[0048] A second construction module, configured to construct a hash table through a vehicle ID and construct a balanced tree through a time series as a second-layer index;
[0049] A third construction module, configured to construct various types of indexes including a status index, an inverted index, and a nested index as a third-layer index.
[0050] In one embodiment, the apparatus further includes:
[0051] A fourth construction module, configured to construct the dynamic multi-layer index according to multi-layer indexes including at least the first-layer index, the second-layer index, and the third-layer index.
[0052] In one embodiment, the screening module includes:
[0053] A positioning sub-module, configured to locate the spatial area where the vehicle is located through the first-layer index;
[0054] A fifth determination sub-module, configured to determine the ID of the target vehicle within a specific time range in the spatial area according to the second-layer index;
[0055] A query sub-module, configured to query the specified information of the target vehicle through the third-layer index.
[0056] This application also provides a query system, including:
[0057] At least one processor; and,
[0058] A memory communicatively connected to the at least one processor; wherein,
[0059] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to implement the query method described in any of the above embodiments.
[0060] This application also provides a computer-readable storage medium. When the instructions in the storage medium are executed by the processor corresponding to the query system, the query system can implement the query method described in any of the above embodiments.
[0061] Other features and advantages of this application will be described in the subsequent specification, and part of them will become obvious from the specification, or will be understood by implementing this application. The objectives and other advantages of this application can be achieved and obtained through the structures specifically pointed out in the written specification, claims, and drawings.
[0062] Next, through the drawings and embodiments, the technical solutions of this application will be further described in detail. Description of the Drawings
[0063] The accompanying drawings are used to provide a further understanding of the present application and form a part of the specification. Together with the embodiments of the present application, they are used to explain the present application and do not constitute a limitation to the present application. In the accompanying drawings:
[0064] Figure 1 is a flowchart of a query method in an embodiment of the present application;
[0065] Figure 2 is a schematic structural diagram of a query device in an embodiment of the present application;
[0066] Figure 3 is a schematic hardware structure diagram of a query system in an embodiment of the present application. Detailed implementation manners
[0067] The following describes the preferred embodiments of the present application with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to explain and illustrate the present application and are not used to limit the present application.
[0068] Figure 1 is a flowchart of a query method in an embodiment of the present application. As Figure 1 shown, the method can be implemented as the following steps S101 - S104:
[0069] In step S101, a query request is received;
[0070] In step S102, at least one query condition in the query request is extracted according to the type of the dynamic multi - layer index, so that the query condition corresponds to the type of the dynamic multi - layer index. Among them, the dynamic multi - layer index is composed of parallel index layers with multiple different attributes;
[0071] In step S103, data that meets the query condition is filtered through the dynamic multi - layer index to obtain a preliminary query result corresponding to each query condition respectively;
[0072] In step S104, a final query result is determined according to the preliminary query result.
[0073] A query request is received; in the present application, the query system provides an efficient query of data in complex scenarios through a flexibly adjustable dynamic multi - layer index structure. The query system can receive a query request sent from a user terminal or other modules. The query request contains at least one query condition, which serves as a key basis for subsequent data retrieval and matching operations.
[0074] Extract at least one query condition from the query request according to the type of the dynamic multi-layer index, so that the query condition corresponds to the type of the dynamic multi-layer index, where the dynamic multi-layer index is composed of multiple index layers with different attributes in parallel. In this application, in order to query multi-dimensional data, multiple index layers with different attributes are set in the dynamic multi-layer index, such as a spatial index layer, a time index layer, etc., to implement corresponding data queries. The dynamic multi-layer index structure does not require serial dependence, ensuring the scalability of the independent index layer, and different index layers with different attributes can be added to expand the corresponding query functions. After receiving the query request, extract at least one query condition from the query request according to the type of the dynamic multi-layer index, so that the query condition corresponds to the type of the dynamic multi-layer index. For example, to query vehicles with a speed greater than 60 Km / h in a certain area at a certain time, the corresponding query conditions can be extracted as follows: (1) Since the spatial index layer queries space, the area range can be correspondingly extracted; (2) Since the time index layer queries time, the time range can be correspondingly extracted; (3) Since the speed index layer is extended to query speed, the corresponding speed range can be extracted.
[0075] Filter the data that meets the query conditions through the dynamic multi-layer index to obtain the preliminary query results corresponding to each query condition respectively. After the query conditions are extracted, the indexes in the dynamic multi-layer index corresponding to the query conditions can be determined, and the execution order of each index can be determined. According to the execution order of each index, the corresponding index is called in turn to filter the data that meets the query conditions. Since the index layers with different attributes in the dynamic multi-layer index are in a parallel relationship, different execution orders can be determined according to different query conditions to improve the query efficiency. For example, the priorities of each index can be obtained; the query order of each index can be determined according to the priorities of each index. It is also possible to determine the availability and cost evaluation of different indexes through a query optimizer or a rule engine according to the query conditions and the requirements for performance optimization, and adaptively determine the order, so that the query can be performed in the optimal order to reduce the amount of data and improve the query efficiency. First, identify the index availability. For example, if the query condition contains "spatial range" and the use of a spatial index (R-Tree) can significantly reduce the amount of data, then R-Tree is preferentially used for preliminary filtering; if the query condition does not involve space, then R-Tree is directly skipped. Then, estimate the "filtering efficiency" of each layer of index. If the time range is wide and the spatial range is narrow, performing spatial filtering first can significantly reduce the data set, and then performing time query is more efficient; if the time range is narrow, but the spatial range is large, or the spatial range itself cannot filter out much data, then performing time filtering first has a better effect. Finally, determine the mutual exclusion and inclusion relationships of multi-modal and multi-conditions. For example: If the vehicle ID is a unique identifier, directly finding the corresponding record in the hash table by the vehicle ID first and then checking whether the remaining attributes meet the conditions will be faster than performing a large-scale spatial search first.
[0076] Determine the final query result according to the preliminary query result. At least one preliminary query result can be output through the dynamic multi-layer index. When the preliminary query result is one, determine the preliminary query result as the final query result; when the preliminary query result is multiple, determine the intersection of the multiple preliminary query results as the final query result.
[0077] In an embodiment of the present application, the efficient query of vehicle data in a complex scenario is realized through a dynamic multi-layer index structure. For this purpose, the dynamic multi-layer index structure includes a regional block index, an in-grid data index, and a multi-modal extension. Based on the above three-layer index structure, the present application performs a query through the following steps:
[0078] The first step: Spatial range query
[0079] The first - layer index of this embodiment, that is, the regional block index, can quickly find the spatial area where vehicles are distributed through an R - Tree. To quickly locate the search area, the present application pre - divides the map into grids. When dividing the grids, they can be divided into first - level grids according to the first preset step size. For example, the area can be divided into 50x50 grids. In addition, the density of the first - level grids can be obtained. For areas where the grid density is greater than the first preset value, they can be further refined according to the second preset step size. For example, the grids can be divided into second - level grids with a size of 10x10. For adjacent areas where the grid density is less than the second preset value, they can be merged. The second preset value is less than the first preset value. For example, if the densities in two adjacent areas are both 0, these two areas can be merged to improve the query efficiency.
[0080] Based on the grid division of the region, an R - Tree can be used to locate the spatial area where the vehicle is located. Specifically, through the R - Tree, using the following query formula, the target grid set corresponding to the query range (x_min, y_min) to (x_max, y_max) can be queried:
[0081] GridSet = R - Tree.query([x_min, x_max, y_min, y_max]).
[0082] Step 2: Quickly locate within the target grid
[0083] The second - layer index of this embodiment is the data index within the grid. In the target grid set involved, the target data can be quickly located according to the vehicle ID or time range using a hash table or a B + - tree. For the hash table, the vehicle information can be directly queried according to the vehicle ID through the following formula:
[0084] HashMap[VehicleID]->VehicleData.
[0085] If querying the data within the time range [t_start, t_end], it can be queried through the following formula:
[0086] Result_time = B + Tree.query([t_start, t_end]).
[0087] Step 3: Multi - condition filtering
[0088] The third - layer index of this embodiment is a multimodal extension, which is used to adapt to complex conditional queries and provide indexes for vehicle attributes. By constructing state indexes, such as speed indexes and driving - direction indexes, and using an inverted index to manage vehicle attributes, Index[Attribute]->VehicleList, the multimodal data of vehicles (such as GPS and sensor data) is stored as a structured or nested index.
[0089] When using an inverted index or a state index to filter data that meets the query conditions, for example, filtering vehicles with a speed v>60 km / h, the query is performed through the following formula:
[0090] Result_speed=InvertedIndex.query(v>60)
[0091] Finally, a merge is performed to obtain the final query result:
[0092] FinalResult=Result_time∩Result_speed.
[0093] For example, assume that the urban area ranges from (0,0) to (200,200), and there are 10,000 vehicles in total. Query the vehicles that meet the following query conditions:
[0094] (1) Area range: from (50,50) to (150,150).
[0095] (2) Time range: within the last 10 minutes, that is, the time range is [t - 600,t].
[0096] (3) Additional condition: vehicle speed>60 km / h.
[0097] To quickly locate the search area, this application has pre - divided the urban area into grids. Among them, the first - level grids divide the area into 50x50, generating 16 first - level grids; the second - level grids further divide the high - density areas into 10x10. For example, the first grid Grid(1,1) can be further divided into 25 second - level grids.
[0098] When performing a query, first, use an R - Tree to locate the set of target grids involved in the area range from (50,50) to (150,150) within the urban area, and then the set of target grids {Grid(1,1),Grid(1,2),Grid(2,1),Grid(2,2)} can be returned accordingly.
[0099] Then, since the time series data of each vehicle is stored in a B+ tree, the data in the target grid set is queried for a time range through the B+ tree to obtain a candidate vehicle set for the time range [t - 600, t]. For example, the query results that meet the time range within Grid(1,1) are {1001, 1003, 1005}.
[0100] Finally, target vehicles that meet other additional conditions are filtered out through multiple conditions. For example, to filter vehicles with a speed v > 60 km / h, the target vehicle IDs within Grid(1,1) can be obtained through an inverted index query as {1001, 1005}. By merging the results queried in multiple grids, all target vehicle IDs that meet the query conditions are obtained.
[0101] It can be understood that the execution order is jointly determined by the type of query conditions and the consideration of query efficiency. If the query conditions only include vehicle IDs and speed ranges, then the spatial query layer (R-Tree) has no query significance and can be skipped, and the query can be directly performed at the hash table / B+ tree level or the inverted index level. If the query instruction only has a time query, the spatial index layer can also be skipped, and the time interval query can be directly performed on the B+ tree.
[0102] In this embodiment, by subdividing / merging grids: in high-density areas, "secondary grids" or finer-grained divisions are performed to make the nodes of the R-Tree more targeted, avoiding excessive data volume in high-density areas and loading too much irrelevant data at one time during query. Real-time updates can also be achieved. When the vehicle status changes frequently, the dynamic index can adjust the structure in a timely manner to maintain query efficiency; while if there is only a static R-Tree + hash table, in the case of high concurrency and high changes, problems such as index invalidation or frequent reconstruction may occur.
[0103] The beneficial effect of this application is that when receiving a query request, at least one query condition in the query request is extracted according to the type of the dynamic multi-layer index, so that the query condition corresponds to the type of the dynamic multi-layer index. Then, the data that meets the query condition is filtered through the dynamic multi-layer index to obtain a preliminary query result corresponding to each query condition; finally, the final query result is determined according to the preliminary query result. Since the dynamic multi-layer index in this application is composed of multiple parallel index layers with different attributes, multi-dimensional data queries can be realized, thereby improving query efficiency.
[0104] In one embodiment, the above step S104 can be implemented as the following step A1 or A2:
[0105] In step A1, when the preliminary query result is one, the preliminary query result is determined as the final query result;
[0106] In step A2, when there are multiple preliminary query results, determine the intersection of the multiple preliminary query results as the final query result.
[0107] In one embodiment, when there are multiple query conditions, the above step S103 can be implemented as the following steps B1 - B3:
[0108] In step B1, determine the index corresponding to the query condition in the dynamic multi - level index;
[0109] In step B2, determine the execution order of each index;
[0110] In step B3, screen the data that meets the query conditions by sequentially calling the corresponding indexes according to the execution order of each index.
[0111] In one embodiment, the above step B2 can be implemented as the following steps B21 - B22:
[0112] In step B21, obtain the priority of each index;
[0113] In step B22, determine the query order of each index according to the priority of each index.
[0114] In one embodiment, the dynamic multi - level index includes at least a spatial index, a grid index, and a multi - modal index. The above step B2 can be implemented as the following steps:
[0115] The priority of the spatial index is greater than that of the grid index, the priority of the grid index is greater than that of the multi - modal index, and the multi - modal index includes multiple parallel indexes with the same priority.
[0116] In one embodiment, the method can also be implemented as the following steps C1 - C3:
[0117] In step C1, construct a regional block index as the first - layer index through a multi - way tree;
[0118] In step C2, construct a hash table through the vehicle ID and construct a balanced tree through the time series as the second - layer index;
[0119] In step C3, construct multiple types of indexes including a status index, an inverted index, and a nested index as the third - layer index.
[0120] In this embodiment, a multi-way tree is used to construct a regional block index as the first-level index. Specifically, an R-Tree is used to construct the regional block index. ① Function: Quickly locate the spatial area where vehicles are distributed. ② Principle: An R-Tree is a multi-way tree suitable for storing the minimum bounding rectangle (MBR) of spatial objects. Each node stores a rectangular area, and the leaf nodes store the specific grids where the vehicles are located. ③ Dynamic adjustment: The grids in high-density areas can be further subdivided to update the R-Tree; the grids in low-density areas can be merged to reduce the depth of the tree. ④ Complexity: The complexity of insertion and deletion operations is O(logN); for range queries and nearest neighbor queries: O(log N+K), where K is the number of results.
[0121] A hash table is constructed based on the vehicle ID, and a balanced tree is constructed based on the time series as the second-level index, i.e., the grid index. ① Function: Construct a hash table based on the vehicle ID to support fast positioning by object; construct a B+ tree based on the time series to support query by time range. ② Index design: Hash table: HashMap[VehicleID]->VehicleData; B+ tree: Store the time series data of each vehicle for query by time interval. ③ Advantage: The positioning efficiency of the hash table is O(1); the time query complexity of the B+ tree is O(log N), which is suitable for interval queries.
[0122] Multiple types of indexes including a status index, an inverted index, and a nested index are constructed as the third-level index, i.e., the multi-modal index. ① Function: Adapt to complex condition queries and provide indexes for vehicle attributes. ② Design: Construct a status index, such as a speed index and a direction index; use an inverted index to manage vehicle attributes; store the multi-modal data of vehicles (such as GPS and sensor data) as a structured or nested index.
[0123] In one embodiment, the method may also be implemented as the following step C4:
[0124] In step C4, a dynamic multi-level index is constructed based on multi-level indexes including at least the first-level index, the second-level index, and the third-level index.
[0125] In one embodiment, the above step S103 may be implemented as the following steps D1-D3:
[0126] In step D1, the spatial area where the vehicle is located is located through the first-level index;
[0127] In step D2, the IDs of the target vehicles within a specific time range in the spatial area are determined according to the second-level index;
[0128] In step D3, the specified information of the target vehicle is queried through the third-layer index.
[0129] Figure 2 As shown in the structural schematic diagram of a query device in an embodiment of the present application, Figure 2 as shown, the device includes:
[0130] A receiving module 201, configured to receive a query request;
[0131] An extraction module 202, configured to extract at least one query condition in the query request according to the type of the dynamic multi-layer index, so that the query condition corresponds to the type of the dynamic multi-layer index, where the dynamic multi-layer index is composed of parallel index layers of multiple different attributes;
[0132] A screening module 203, configured to screen data that meets the query condition through the dynamic multi-layer index to obtain a preliminary query result corresponding to each query condition;
[0133] A determination module 204, configured to determine a final query result according to the preliminary query result.
[0134] In one embodiment, the determination module includes:
[0135] A first determination sub-module, configured to determine the preliminary query result as the final query result when the preliminary query result is one;
[0136] A second determination sub-module, configured to determine the intersection of the multiple preliminary query results as the final query result when the preliminary query result is multiple.
[0137] In one embodiment, the screening module includes:
[0138] A third determination sub-module, configured to determine an index corresponding to the query condition in the dynamic multi-layer index;
[0139] A fourth determination sub-module, configured to determine the execution order of each index;
[0140] A calling sub-module, configured to sequentially call the corresponding index according to the execution order of each index to screen the data that meets the query condition.
[0141] In one embodiment, the fourth determination sub-module is further configured to:
[0142] Obtain the priority of each index;
[0143] Determine the query order of each index according to the priority of each index.
[0144] Embodiment: The area index has a higher priority than the grid index, the grid index has a higher priority than the multi-modal index, and the multi-modal index includes multiple parallel indexes, and their priorities can be the same.
[0145] In one embodiment, the device further includes:
[0146] A first construction module, configured to construct a regional block index through a multi-way tree as the first-level index;
[0147] A second construction module, configured to construct a hash table through the vehicle ID and construct a balanced tree through the time series as the second-level index;
[0148] A third construction module, configured to construct multiple types of indexes including a status index, an inverted index, and a nested index as the third-level index.
[0149] In one embodiment, the device further includes:
[0150] A fourth construction module, configured to construct the dynamic multi-level index according to multi-level indexes including at least the first-level index, the second-level index, and the third-level index.
[0151] In one embodiment, the screening module includes:
[0152] A positioning sub-module, configured to locate the spatial area where the vehicle is located through the first-level index;
[0153] A fifth determination sub-module, configured to determine the ID of the target vehicle within a specific time range in the spatial area according to the second-level index;
[0154] A query sub-module, configured to query the specified information of the target vehicle through the third-level index.
[0155] Figure 3 It is a schematic diagram of the hardware structure of a query system in an embodiment of the present application. As Figure 3 shown, the query system includes:
[0156] At least one processor 320; and,
[0157] A memory 304 communicatively connected to the at least one processor 320; wherein,
[0158] The memory 304 stores instructions executable by the at least one processor 320, and the instructions are executed by the at least one processor 320 to implement the query method described in any of the above embodiments.
[0159] Refer to Figure 3, the query system 300 may include one or more of the following components: a processing component 302, a memory 304, a power supply component 306, a multimedia component 308, an audio component 310, an input / output (I / O) interface 312, a sensor component 314, and a communication component 316.
[0160] The processing component 302 generally controls the overall operation of the query system 300. The processing component 302 may include one or more processors 320 to execute instructions to complete all or part of the steps of the above-described method. In addition, the processing component 302 may include one or more modules to facilitate the interaction between the processing component 302 and other components. For example, the processing component 302 may include a multimedia module to facilitate the interaction between the multimedia component 308 and the processing component 302.
[0161] The memory 304 is configured to store various types of data to support the operation of the query system 300. Examples of such data include instructions for any application or method operating on the query system 300, such as text, pictures, videos, etc. The memory 304 may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, a magnetic disk, or an optical disk.
[0162] The power supply component 306 provides power to various components of the query system 300. The power supply component 306 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the query system 300.
[0163] The multimedia component 308 includes a screen that provides an output interface between the query system 300 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors can not only sense the boundaries of touch or swipe actions, but also detect the duration and pressure associated with the touch or swipe operation. In some embodiments, the multimedia component 308 may further include a front camera and / or a rear camera. When the query system 300 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each of the front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capabilities.
[0164] The audio component 310 is configured to output and / or input audio signals. For example, the audio component 310 includes a microphone (MIC), which is configured to receive external audio signals when the query system 300 is in an operating mode, such as an alarm mode, a recording mode, a voice recognition mode, and a voice output mode. The received audio signals can be further stored in the memory 304 or transmitted via the communication component 316. In some embodiments, the audio component 310 further includes a speaker for outputting audio signals.
[0165] The I / O interface 312 provides an interface between the processing component 302 and peripheral interface modules, and the peripheral interface modules can be a keyboard, a click wheel, buttons, etc. These buttons can include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0166] The sensor component 314 includes one or more sensors for providing a status assessment of various aspects of the query system 300. For example, the sensor component 314 can include a sound sensor. Additionally, the sensor component 314 can detect the open / closed state of the query system 300, the relative positioning of components, such as the display and keypad of the query system 300. The sensor component 314 can also detect the operating state of the query system 300 or a component of the query system 300, the orientation of the query system 300 or acceleration / deceleration, and the temperature change of the query system 300. The sensor component 314 can include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor component 314 can also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor component 314 can further include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0167] The communication component 316 is configured to enable the query system 300 to provide communication capabilities with other devices and cloud platforms in a wired or wireless manner. The query system 300 can access a wireless network based on communication standards, such as WiFi, 2G, or 3G, or a combination thereof. In an exemplary embodiment, the communication component 316 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 316 further includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0168] In an exemplary embodiment, the query system 300 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for performing the query method described in any of the above embodiments.
[0169] The present application also provides a computer-readable storage medium. When the instructions in the storage medium are executed by a processor corresponding to the query system, the query system can implement the query method described in any of the above embodiments.
[0170] Those skilled in the art should understand that the embodiments of the present application may be provided as a method, a system, or a computer program product. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program code.
[0171] The present application is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of flows and / or blocks in the flowcharts and / or block diagrams, can be realized by computer program instructions. These computer program instructions can be provided to the processors of general-purpose computers, special-purpose computers, embedded processors, or other programmable data processing devices to generate a machine, so that the instructions executed by the processors of the computer or other programmable data processing devices generate means for realizing the functions specified in one Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0172] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured article including an instruction device, and the instruction device realizes the functions specified in one Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0173] These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process. Thus, the instructions executed on the computer or other programmable device provide means for realizing the functions in the process Figure 1One or more processes and / or blocks Figure 1 Steps of functions specified in one or more blocks.
[0174] Obviously, those skilled in the art can make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalent technologies, this application is also intended to include these modifications and variations.
Claims
1. A query method, characterized in that: include: receiving a query request; Extracting at least one query condition in the query request according to the type of the dynamic multi-layer index, so that the query condition corresponds to the type of the dynamic multi-layer index, wherein the dynamic multi-layer index is composed of parallel index layers of multiple different attributes; The data meeting the query condition is screened by the dynamic multi-layer index to obtain preliminary query results corresponding to each query condition; A final query result is determined based on the preliminary query result.
2. The method according to claim 1, characterized in that Determining the final query result according to the preliminary query result includes: When there is one preliminary query result, determining the preliminary query result as the final query result; When there are multiple preliminary query results, the intersection of the multiple preliminary query results is determined as the final query result.
3. The method according to claim 1, characterized in that When there are multiple query conditions, the data that meets the query conditions is filtered through the dynamic multi-layer index, including: Determine an index in the dynamic multi-layer index corresponding to the query condition; Determine the execution order of each index; According to the execution order of the various indexes, the corresponding indexes are called in sequence to filter the data that meets the query conditions.
4. The method according to claim 3, characterized in that Determining the execution order of each index includes: Get the priority of each index; The query order of each index is determined according to the priority of each index.
5. The method according to claim 1, characterized in that The method further comprises: Build a regional block index as the first-level index through a multi-tree; Build a hash table based on vehicle ID and build a balanced tree based on time series as the second-level index; Build multiple types of indexes including status index, inverted index, and nested index as the third-level index.
6. The method according to claim 5, characterized in that The method further comprises: The dynamic multi-layer index is constructed according to a multi-layer index including at least the first layer index, the second layer index and the third layer index.
7. The method according to claim 5, characterized in that The data that meets the query condition is screened by the dynamic multi-layer index to obtain preliminary query results corresponding to each query condition, including: Locate the spatial area where the vehicle is located by using the first layer index; Determine the ID of the target vehicle within a specific time range in the spatial area according to the second layer index; The designated information of the target vehicle is queried through the third-level index.
8. A query device, characterized in that: include: A receiving module, used for receiving a query request; an extraction module, configured to extract at least one query condition in the query request according to a type of a dynamic multi-layer index, so that the query condition corresponds to the type of the dynamic multi-layer index, wherein the dynamic multi-layer index is composed of parallel index layers of multiple different attributes; A screening module, used to screen data that meets the query conditions through the dynamic multi-layer index to obtain preliminary query results corresponding to each query condition; A determination module is used to determine a final query result based on the preliminary query result.
9. A query system, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to implement the query method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor corresponding to the query system, the query system can implement the query method as described in any one of claims 1 to 7.