Vehicle information query method, device and equipment, storage medium and vehicle
By using trie and pruning tree techniques in vehicle information retrieval, the problem of slow query speed in existing technologies is solved, and efficient vehicle information retrieval is achieved.
Patent Information
- Application Number
- CN202310100742.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-28
- Publication Date
- 2026-06-02
- Estimated Expiration
- 2043-01-28
AI Technical Summary
Current technology for querying vehicle information is slow, requiring traversing every node in the database and comparing characters one by one, resulting in low efficiency.
The query uses a trie structure. By comparing the strings of nodes in the trie in descending order of level, the first node is determined. Then, the pruning tree technique is used to reduce unnecessary string comparisons and directly obtain the target vehicle information.
By using trie and pruning tree techniques, unnecessary string comparisons are minimized, significantly improving query efficiency and accelerating the search for target vehicle information.
Smart Images

Figure CN116932537B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of data service technology, and in particular relates to a method, device, equipment, storage medium and vehicle for querying vehicle information. Background Technology
[0002] VSS stands for Vehicle Information Specification, which is a vehicle information standard. Based on this standard, vehicle information obtained from vehicles can be uploaded to a cloud database for vehicle information exchange and user queries.
[0003] However, in related technologies, if a user needs to query a vehicle information item in a database, a query request needs to be sent to the database. Based on the query request, every node in the database is traversed, and each node is compared with the query request. Each node's string is compared character by character to see if it includes the string in the query request. The vehicle information to be queried is then further filtered out from all nodes that include the string in the query request. This method of querying is relatively slow. Summary of the Invention
[0004] This application provides a method, apparatus, device, storage medium, and vehicle for querying vehicle information, which can solve the problem of slow query speed in existing systems.
[0005] In a first aspect, embodiments of this application provide a method for querying vehicle information, the method comprising:
[0006] Receive a subscription request sent by an electronic device, the subscription request including a first string;
[0007] The strings of each node in the trie are compared with the first string in descending order of the trie levels until the first node is determined. The string of the first node is the same as the first string. The trie is a tree structure for storing strings. The trie includes at least two levels, and each level includes at least one node.
[0008] Determine the M absolute paths where the first node is located, and define the M absolute paths as a pruning tree. The trie includes N absolute paths, and the pruning tree includes M absolute paths from the N absolute paths. Each absolute path includes at least two nodes and at least one vehicle information. N is an integer greater than 1, and M is a positive integer less than N. The absolute path is a path without sub-paths.
[0009] The target vehicle information included in the pruned tree is sent to the electronic device.
[0010] In some embodiments, comparing the strings of each node in the trie with the first string in descending order of hierarchy until the first node is determined includes:
[0011] The first hash value corresponding to the first string is calculated using a hash algorithm;
[0012] Determine the hash value corresponding to each node in the trie;
[0013] The node in the trie whose hash value is the first hash value is determined as the second node;
[0014] The strings of each second node are compared with the first string in descending order of their level in the trie until the first node is determined from among the second nodes.
[0015] In some embodiments, comparing the strings of each second node with the first string in descending order of the second node's hierarchy in the trie until the first node is determined from among the second nodes includes:
[0016] When the number of second nodes is P, the first string and the strings in the P second nodes are compared character by character in descending order of their level in the trie, until a second node is found that is the same as the first string, and the second node that is the same as the first string is determined as the first node, where P is a positive integer greater than 1.
[0017] In some embodiments, after determining the node in the trie with a hash value of the first hash value as the second node, the method further includes:
[0018] If the number of the second node is 1, the second node is determined as the first node.
[0019] In some embodiments, before sending the target vehicle information included in the pruned tree to the electronic device, the method further includes:
[0020] Obtain the M leaf nodes from the M absolute paths, where each absolute path includes one leaf node;
[0021] The strings corresponding to the M leaf nodes are determined as the target vehicle information included in the M absolute paths.
[0022] In some embodiments, after determining the M absolute paths containing the first node and defining the M absolute paths as a pruned tree, the method further includes:
[0023] When a first absolute path is added to the pruning tree, the leaf nodes in the first absolute path are obtained, where the first absolute path is the absolute path added to the pruning tree after the pruning operation.
[0024] The leaf nodes in the first absolute path are identified as the target vehicle information.
[0025] Secondly, embodiments of this application provide a vehicle information query device, the device comprising:
[0026] A receiving module is configured to receive a subscription request sent by an electronic device, the subscription request including a first string;
[0027] The determination module is used to compare the strings of each node in the trie with the first string in descending order of the trie levels until the first node is determined, wherein the string of the first node is the same as the first string. The trie is a tree structure for storing strings, and the trie includes at least two levels, each level including at least one node.
[0028] The pruning module is used to determine the M absolute paths where the first node is located, and to determine the M absolute paths as a pruning tree. The trie includes N absolute paths, and the pruning tree includes M absolute paths from the N absolute paths. Each absolute path includes at least two nodes and at least one vehicle information. N is an integer greater than 1, and M is a positive integer less than N. The absolute path is a path without sub-paths.
[0029] The sending module is used to send the target vehicle information included in the pruned tree to the electronic device.
[0030] Thirdly, embodiments of this application provide a vehicle information query device, the device including: a processor and a memory storing computer program instructions;
[0031] The processor executes computer program instructions to implement the above method for querying vehicle information.
[0032] Fourthly, embodiments of this application provide a computer storage medium storing computer program instructions, which, when executed by a processor, implement the above-mentioned method for querying vehicle information.
[0033] Fifthly, embodiments of this application provide a vehicle, the vehicle including computer program instructions, which, when executed by a processor, implement the above-described method for querying vehicle information.
[0034] In this application, a trie can be constructed based on the vehicle's information. After receiving a user's subscription request, the trie is pruned based on the first string in the subscription request to obtain a pruned tree prefixed with the first string. The information in the pruned tree is then used to identify the target vehicle information and sent to the user. By searching for the target vehicle information using the trie, the query stops as soon as a node matching the string in the subscription request is found, eliminating the need to traverse the string of every node. This minimizes unnecessary string comparisons, significantly improves query efficiency, and speeds up the search for the target vehicle information. Attached Figure Description
[0035] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0036] Figure 1 This is a flowchart illustrating a vehicle information query method provided in an embodiment of this application;
[0037] Figure 2 This is a schematic diagram of a scenario for a vehicle information query method provided in another embodiment of this application;
[0038] Figure 3 This is a schematic diagram of the hardware structure of a vehicle information query device provided in one embodiment of this application;
[0039] Figure 4 This is a schematic diagram of the structure of a vehicle information query device provided in an embodiment of this application. Detailed Implementation
[0040] The features and exemplary embodiments of various aspects of this application will be described in detail below. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples of this application.
[0041] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.
[0042] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. The embodiments will now be described in detail with reference to the accompanying drawings.
[0043] VSS stands for Vehicle Information Specification, which is a vehicle information standard. Based on this standard, vehicle information obtained from vehicles can be uploaded to a cloud database for vehicle information exchange and user queries.
[0044] However, in related technologies, if a user needs to query a certain vehicle information in the database, it is necessary to traverse every node in the entire database and compare each node character by character to see if it meets the query requirements. This method is slow.
[0045] Specifically, in order to solve the problems of the prior art, embodiments of this application provide a method, apparatus, device, storage medium, and vehicle for querying vehicle information. The method for querying vehicle information provided in this application embodiment will be described first below.
[0046] Figure 1 A flowchart illustrating a vehicle information query method according to an embodiment of this application is shown. The method includes the following steps:
[0047] S110, Receive a subscription request sent by an electronic device, the subscription request including a first string.
[0048] In this embodiment, the collected vehicle information can be stored in a cloud database based on the VSS specification. If a user wants to subscribe to one or more types of vehicle information, they can send a subscription request to the cloud through an electronic device. The first string included in the subscription request is used to characterize the type of vehicle information that the user wants to subscribe to.
[0049] Vehicle information can be signals collected by sensors installed on the vehicle. For example, vehicle information may include the vehicle's speed collected by a speed sensor, the tire pressure collected by a pressure sensor, and so on.
[0050] S120, in descending order of the levels in the trie, the strings of each node in the trie are compared with the first string until the first node is determined, and the string of the first node is the same as the first string. The trie is a tree structure for storing strings, and the trie includes at least two levels, each level including at least one node.
[0051] A trie (prefix tree) is a word lookup tree used to store collections of strings. By using a trie for string lookups, common prefixes can be leveraged to reduce search time and minimize unnecessary string comparisons. The trie in this application is used to store strings related to vehicle information.
[0052] In this embodiment, nodes in the trie can be divided into different levels based on the attributes of vehicle information; that is, nodes representing the same attribute are set at the same level in the trie. The hierarchical order of the levels in the trie is determined by the subordinate relationships between the nodes.
[0053] For example, a string representing a vehicle can be used as the root node of the trie, which is set at one level of the trie; a string representing the type of vehicle information can be used as an intermediate node from the root node to the leaf node, which is set at at least one level of the trie; and a string representing specific vehicle information can be used as the leaf node of the trie, which is set at one level of the trie.
[0054] Since the root node is the parent node of the intermediate nodes, and the intermediate nodes are the parent nodes of the leaf nodes, the order of the levels in this trie from high to low is as follows: the level where the root node is located, the level where the intermediate nodes are located, and the level where the leaf nodes are located.
[0055] Alternatively, the strings of each node in the trie can be compared with the first string in descending order of hierarchy in the trie, until the first node with the same string is found. The comparison can then be stopped, and the first node can be used to further obtain the vehicle information that needs to be subscribed.
[0056] S130, determine the M absolute paths where the first node is located, and define the M absolute paths as a pruned tree. The trie includes N absolute paths, and the pruned tree includes M absolute paths from the N absolute paths. Each absolute path includes at least two nodes and at least one vehicle information. N is an integer greater than 1, and M is a positive integer less than N. The absolute path is a path without sub-paths.
[0057] In this embodiment, the pruning operation involves deleting a subset of nodes from the trie, and the pruned tree is a collection of partial paths from the trie.
[0058] After determining the first string in the subscription request, the set of paths prefixed with the first string can be defined as a pruning tree. Then, all vehicle information in the pruning tree represents the target vehicle information that the user wants to subscribe to.
[0059] In this embodiment, after determining the first string in the subscription request, the first node in the trie that contains the same string as the first string can be found. It can be seen that the target vehicle information that the user wants to subscribe to in the subscription request is the vehicle information contained in the subtree rooted at the first node in the trie.
[0060] Therefore, we can find all M absolute paths that include the first node, and determine the set of these M absolute paths as a pruned tree.
[0061] As an optional embodiment, in order to find the first node, the step of comparing the strings of each node in the trie with the first string in descending order of level in the trie until the first node is determined includes:
[0062] The first hash value corresponding to the first string is calculated using a hash algorithm;
[0063] Determine the hash value corresponding to each node in the trie;
[0064] The node in the trie whose hash value is the first hash value is determined as the second node;
[0065] The strings of each second node are compared with the first string in descending order of their level in the trie until the first node is determined from among the second nodes.
[0066] In this embodiment, during the process of finding the first node in the trie, the hash value corresponding to the first string in the subscription information can be determined first using a hash algorithm, and then the hash value corresponding to each node in the trie can be determined. Since the hash value must be the same when the strings are the same, if a second node with the hash value of the first hash value is found, and the number of second nodes is 1, this second node can be directly determined as the first node.
[0067] The hash value of the string in each node is determined by a hash algorithm, and at least one second node with the first hash value is selected. The strings of each second node are compared with the first string in descending order of their level in the trie, until the first node is determined from among the second nodes, at which point the comparison stops.
[0068] Finding the first node in this way avoids traversing the entire trie and comparing the first string with the strings in each node character by character, thus saving time in finding the first node.
[0069] As an optional embodiment, the step of comparing the strings of each second node with the first string according to the descending order of the second node's level in the trie, until the first node is determined among the second nodes, includes:
[0070] When the number of second nodes is P, the first string and the strings in the P second nodes are compared character by character in descending order of their level in the trie, until a second node is found that is the same as the first string, and the second node that is the same as the first string is determined as the first node, where P is a positive integer greater than 1.
[0071] In this embodiment, due to the existence of hash collisions, different strings may have the same hash value. That is, if there are P second nodes with the first hash value, then it is necessary to further determine the first node from these P second nodes.
[0072] We can compare the strings in these P second nodes with the first string character by character, according to the order of their levels in the trie from high to low. We can find the second node in which every character in the second node is the same as the first string, that is, the second node that includes the first string, and then determine the second node that includes the first string as the first node.
[0073] As an optional embodiment, after determining the node in the trie with a hash value of the first hash value as the second node, the method further includes:
[0074] If the number of the second node is 1, the second node is determined as the first node.
[0075] In this embodiment, since the corresponding hash values are necessarily the same when the strings are identical, if only one second node has a string with the first hash value, then the string in that second node can be directly determined as the first string, and thus the second node can be identified as the first node.
[0076] As an optional embodiment, in order to determine the target vehicle information, the process before S140 may further include:
[0077] Obtain the M leaf nodes from the M absolute paths, where each absolute path includes one leaf node;
[0078] The strings corresponding to the M leaf nodes are determined as the target vehicle information included in the M absolute paths.
[0079] In this embodiment, an absolute path is a path in the trie that does not include subpaths, and a leaf node is the lowest-level node in the trie, i.e., a node without children. The trie includes M absolute paths, and each absolute path includes one leaf node.
[0080] In each absolute path, the string in the root node represents the vehicle, the leaf nodes contain vehicle information, and the nodes between the leaf nodes and the root node contain strings representing the type and attributes of the vehicle information.
[0081] Therefore, after determining the M absolute paths included in the pruned tree, the M leaf nodes in the M absolute paths are determined, and the strings in the M leaf nodes can be identified as the target vehicle information.
[0082] For example, the constructed trie is Figure 2 As shown, if a user wants to subscribe to information about a vehicle at a car repair center, the first string in the subscription request could be "vehicle.carcenter". Therefore, the first node with the string "vehicle.carcenter" can be found in the trie. The four absolute paths including the first node are then defined as a pruned tree. Since the pruned tree contains four absolute paths, it has four leaf nodes. The target vehicle information can then be searched for in the strings corresponding to these four leaf nodes.
[0083] S140, send the target vehicle information included in the pruned tree to the electronic device.
[0084] In this embodiment, after determining the M absolute paths included in the pruned tree, the vehicle information included in these M absolute paths can be identified as the target vehicle information, and the target vehicle information can be sent to the user's electronic device.
[0085] Using the above method, a trie can be constructed based on the vehicle information. After receiving a user's subscription request, the trie is pruned based on the first string in the subscription request to obtain a pruned tree prefixed with the first string. The information in the pruned tree is then used to identify the target vehicle information and sent to the user. Searching for the target vehicle information using a trie minimizes unnecessary string comparisons, significantly improving query efficiency and speeding up the search for the target vehicle information.
[0086] As an optional embodiment, after determining the M absolute paths containing the first node and defining the M absolute paths as a pruned tree, the above method may further include:
[0087] When a first absolute path is added to the pruning tree, the leaf nodes in the first absolute path are obtained, where the first absolute path is the absolute path added to the pruning tree after the pruning operation.
[0088] The leaf nodes in the first absolute path are identified as the target vehicle information.
[0089] In this embodiment, after a user subscribes to the target vehicle information, a pruned tree is generated based on the user's subscription. The strings of each leaf node in the pruned tree represent the target vehicle information.
[0090] After a user subscribes to the pruning tree, if new information is generated in the target vehicle information, a new first absolute path is added to the corresponding trie. The new information will be stored in the leaf node of the first absolute path in the trie. Since the prefix of this new information in the trie will also be the first string, and all nodes with the first string as their prefix are automatically added to the pruning tree when added to the trie, the first absolute path will also be added to the pruning tree. Therefore, the leaf node in the first absolute path can also be identified as the target vehicle information.
[0091] If the original target vehicle information is updated, that is, if the strings on each leaf node are updated, the updated strings can be sent to the customer's electronic device in real time as the updated target vehicle information.
[0092] Therefore, when adding a new first absolute path in the pruned tree, the vehicle information contained in the leaf nodes of the first absolute path can also be identified as the target vehicle information and added to the subscription.
[0093] Based on the vehicle information query method provided in the above embodiments, this application also provides a specific implementation of the vehicle information query device. Please refer to the following embodiments.
[0094] First see Figure 3 The vehicle information query device 300 provided in this application embodiment includes the following modules:
[0095] The receiving module 301 is configured to receive a subscription request sent by an electronic device, the subscription request including a first string;
[0096] The determining module 302 is used to compare the strings of each node in the trie with the first string in descending order of the trie hierarchy until the first node is determined, wherein the string of the first node is the same as the first string. The trie is a tree structure for storing strings, and the trie includes at least two levels, each level including at least one node.
[0097] The pruning module 303 is used to determine the M absolute paths where the first node is located, and to determine the M absolute paths as a pruning tree. The trie includes N absolute paths, and the pruning tree includes M absolute paths from the N absolute paths. Each absolute path includes at least two nodes and at least one vehicle information. N is an integer greater than 1, and M is a positive integer less than N. The absolute path is a path without sub-paths.
[0098] The sending module 304 is used to send the target vehicle information included in the pruning tree to the electronic device.
[0099] Using the aforementioned device, a trie can be constructed based on vehicle information. Upon receiving a user's subscription request, the trie is pruned based on the first string in the subscription request to obtain a pruned tree prefixed with the first string. The information in the pruned tree is then used to identify the target vehicle information and sent to the user. Searching for the target vehicle information using the trie minimizes unnecessary string comparisons, significantly improving query efficiency and accelerating the search for the target vehicle information.
[0100] As one implementation of this application, the determining module 302 may further include:
[0101] A calculation unit is used to calculate the first hash value corresponding to the first string using a hash algorithm;
[0102] A hash unit is used to determine the hash value corresponding to each node in the trie;
[0103] A determining unit is used to determine the node in the trie whose hash value is the first hash value as the second node;
[0104] The query unit is used to compare the strings of each second node with the first string in descending order of the hierarchy of the second node in the trie, until the first node is determined among the second nodes.
[0105] As one implementation of this application, the above query unit can also be used for:
[0106] When the number of second nodes is P, the first string and the strings in the P second nodes are compared character by character in descending order of their level in the trie, until a second node is found that is the same as the first string, and the second node that is the same as the first string is determined as the first node, where P is a positive integer greater than 1.
[0107] As one implementation of this application, the determining module 302 described above can also be used for:
[0108] If the number of the second node is 1, the second node is determined as the first node.
[0109] As one implementation of this application, the vehicle information query device 300 may further include:
[0110] The acquisition module is used to acquire M leaf nodes from the M absolute paths, wherein each absolute path includes one leaf node;
[0111] The determination module is used to determine the strings corresponding to the M leaf nodes as the target vehicle information included in the M absolute paths.
[0112] As one implementation of this application, the vehicle information query device 300 described above can also be used for:
[0113] When a first absolute path is added to the pruned tree, the leaf nodes in the first absolute path are obtained;
[0114] The leaf nodes in the first absolute path are identified as the target vehicle information.
[0115] The vehicle information query device provided in this embodiment of the invention can implement the steps in the above method embodiments, and will not be repeated here to avoid repetition.
[0116] Figure 4 A schematic diagram of the hardware structure of the vehicle information query device provided in an embodiment of this application is shown.
[0117] The vehicle information query device may include a processor 401 and a memory 402 storing computer program instructions.
[0118] Specifically, the processor 401 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.
[0119] Memory 402 may include mass storage for data or instructions. For example, and not limitingly, memory 402 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 402 may include removable or non-removable (or fixed) media. Where appropriate, memory 402 may be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, memory 402 is non-volatile solid-state memory.
[0120] Memory may include read-only memory (ROM), random access memory (RAM), disk storage media devices, optical storage media devices, flash memory devices, and electrical, optical, or other physical / tangible memory storage devices. Therefore, typically, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the methods according to one aspect of this disclosure.
[0121] The processor 401 reads and executes computer program instructions stored in the memory 402 to implement any of the vehicle information query methods in the above embodiments.
[0122] In one example, the vehicle information query device may also include a communication interface 403 and a bus 410. For example, Figure 4 As shown, the processor 401, memory 402, and communication interface 403 are connected through bus 410 and complete communication with each other.
[0123] The communication interface 403 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.
[0124] Bus 410 includes hardware, software, or both, that couples components of a vehicle information query device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 410 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, any suitable bus or interconnect is contemplated herein.
[0125] The vehicle information query device can be based on the above embodiments to realize the vehicle information query method and device described above.
[0126] Furthermore, in conjunction with the vehicle information query method in the above embodiments, this application embodiment can provide a computer storage medium for implementation. This computer storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the vehicle information query methods in the above embodiments and achieve the same technical effect. To avoid repetition, further details are omitted here. The aforementioned computer-readable storage medium may include non-transitory computer-readable storage media, such as read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks, etc., and is not limited thereto.
[0127] In addition, this application also provides a vehicle including computer program instructions, which, when executed by a processor, can implement the steps and corresponding content of the aforementioned method embodiments.
[0128] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.
[0129] The functional blocks shown in the above block diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.
[0130] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.
[0131] The aspects of this disclosure have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus, and vehicles according to embodiments of this disclosure. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to create a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowchart illustrations, and combinations of blocks in the block diagrams and / or flowchart illustrations, can also be implemented by special-purpose hardware performing the specified functions or actions, or can be implemented by a combination of special-purpose hardware and computer instructions.
[0132] The above are merely specific embodiments of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.
Claims
1. A method for querying vehicle information, characterized in that, The method includes: Receive a subscription request sent by an electronic device, the subscription request including a first string; Following the order of hierarchy in the trie from highest to lowest, a hash algorithm is used to compare the strings of each node in the trie with the first string until the first node is determined, and the string of the first node is the same as the first string. The trie is a tree structure used to store strings, and it includes at least two levels, each level including at least one node. The trie is constructed based on vehicle information, and the nodes in the trie are divided into different levels based on the attributes of the vehicle information. Determine the M absolute paths where the first node is located, and define the M absolute paths as a pruning tree. The trie includes N absolute paths, and the pruning tree includes M absolute paths from the N absolute paths. Each absolute path includes at least two nodes and at least one vehicle information. N is an integer greater than 1, and M is a positive integer less than N. The absolute path is a path without sub-paths. Send the target vehicle information included in the pruned tree to the electronic device; the target vehicle information is the string corresponding to the leaf node in the absolute path included in the pruned tree.
2. The vehicle information query method according to claim 1, characterized in that, The step of comparing the strings of each node in the trie with the first string using a hash algorithm, in descending order of hierarchy in the trie, until the first node is determined, includes: The first hash value corresponding to the first string is calculated using a hash algorithm; Determine the hash value corresponding to each node in the trie; The node in the trie whose hash value is the first hash value is determined as the second node; The strings of each second node are compared with the first string in descending order of their level in the trie until the first node is determined from among the second nodes.
3. The method according to claim 2, characterized in that, The step of comparing the strings of each second node with the first string in descending order of the second node's hierarchy in the trie until the first node is determined from among the second nodes includes: When the number of second nodes is P, the first string and the strings in the P second nodes are compared character by character in descending order of their level in the trie, until a second node is found that is the same as the first string, and the second node that is the same as the first string is determined as the first node, where P is a positive integer greater than 1.
4. The method according to claim 2, characterized in that, After determining the node in the trie with the hash value of the first hash value as the second node, the method further includes: If the number of the second node is 1, the second node is determined as the first node.
5. The method for querying vehicle information according to claim 1, characterized in that, Before sending the target vehicle information included in the pruned tree to the electronic device, the method further includes: Obtain the M leaf nodes from the M absolute paths, where each absolute path includes one leaf node; The strings corresponding to the M leaf nodes are determined as the target vehicle information included in the M absolute paths.
6. The method for querying vehicle information according to claim 1, characterized in that, After determining the M absolute paths containing the first node and defining the M absolute paths as a pruned tree, the method further includes: When a first absolute path is added to the pruning tree, the leaf nodes in the first absolute path are obtained, where the first absolute path is the absolute path added to the pruning tree after the pruning operation. The leaf nodes in the first absolute path are identified as the target vehicle information.
7. A vehicle information query device, characterized in that, The device includes: A receiving module is configured to receive a subscription request sent by an electronic device, the subscription request including a first string; The determination module is used to compare the strings of each node in the trie with the first string using a hash algorithm, according to the order of the levels in the trie from high to low, until the first node is determined, and the string of the first node is the same as the first string. The trie is a tree structure for storing strings, and the trie includes at least two levels, each level including at least one node. The trie is constructed based on vehicle information, and the nodes in the trie are divided into different levels based on the attributes of the vehicle information. The pruning module is used to determine the M absolute paths where the first node is located, and to determine the M absolute paths as a pruning tree. The trie includes N absolute paths, and the pruning tree includes M absolute paths from the N absolute paths. Each absolute path includes at least two nodes and at least one vehicle information. N is an integer greater than 1, and M is a positive integer less than N. The absolute path is a path without sub-paths. The sending module is used to send the target vehicle information included in the pruning tree to the electronic device; the target vehicle information is the string corresponding to the leaf node in the absolute path included in the pruning tree.
8. A vehicle information query device, characterized in that, The vehicle information query device includes: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, it implements the vehicle information query method as described in any one of claims 1-6.
9. A computer storage medium, characterized in that, The computer storage medium stores computer program instructions, which, when executed by a processor, implement the vehicle information query method as described in any one of claims 1-6.
10. A vehicle, characterized in that, The vehicle includes the vehicle information query device as described in claim 7 or the vehicle information query equipment as described in claim 8.
Citation Information
Patent Citations
Index establishment method and device and storage medium
CN112667636A
Node query method and device, electronic equipment and storage medium
CN114691674A
