Access method and device of binary tree table, equipment, storage medium and vehicle

By assigning the addresses of binary tree tables to the same sub-tables based on the modulo result of a preset value and establishing a corresponding relationship, the problem of low access efficiency of binary tree tables is solved, and faster data retrieval is achieved.

CN117290548BActive Publication Date: 2025-12-30BEIJING CO WHEELS TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210686952.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-16
Publication Date
2025-12-30
Estimated Expiration
2042-06-16

AI Technical Summary

Technical Problem

Existing binary tree tables suffer from low access efficiency due to the need for multiple comparisons when searching for data, especially when the data is located at a later position.

Method used

Addresses in the binary tree table that have the same remainder result after taking a preset value are assigned to the same sub-table, and a correspondence is established between the sub-table and the remainder result. The target address in the received access request is processed by taking the remainder, and the sub-table corresponding to the target address is found for data lookup.

Benefits of technology

This reduces the amount of data to search and improves the access speed of binary tree tables.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117290548B_ABST
    Figure CN117290548B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a binary tree table access method, device, equipment, medium and vehicle, the method comprising: being suitable for a binary tree table, in the binary tree table, addresses with the same remainder result of a preset value and data corresponding to the addresses are allocated to the same sub-table, the binary tree table also includes the correspondence between the sub-table and the remainder result, receiving an access request, the access request includes a target address, performing remainder processing on the preset value based on the target address, obtaining the remainder of the target address relative to the preset value, based on the correspondence between the sub-table in the binary tree table and the remainder, finding the data corresponding to the target address in the sub-table corresponding to the remainder. The present disclosure can find the data corresponding to the target address faster by taking the remainder of the target address in the access request relative to the preset data, and improving the access speed of the binary tree table.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and in particular to a method, apparatus, device, storage medium, and vehicle for accessing a binary tree table. Background Technology

[0002] With the development of computer technology, people have increasingly higher demands for computer processing speed. Binary tree tables, as a traditional data storage structure, store large amounts of data. When the data to be searched is located towards the end of the binary tree, it requires comparing the searched data with every related data stored before it, resulting in numerous comparisons and low search efficiency. Therefore, improving the access efficiency of binary tree tables is a technical problem that needs to be solved. Summary of the Invention

[0003] To address the aforementioned technical problems, this disclosure provides a method, apparatus, device, storage medium, and vehicle for accessing binary tree tables.

[0004] A first aspect of this disclosure provides a method for accessing a binary tree table, the method comprising:

[0005] The method is applicable to a binary tree table, in which addresses with the same modulo result of a preset value and the data corresponding to those addresses are assigned to the same sub-table. The binary tree table also includes a correspondence between the sub-table and the modulo result. The method includes:

[0006] Receive an access request, the access request including a target address;

[0007] The target address is moduloed by the preset value to obtain the remainder of the target address relative to the preset value.

[0008] Based on the correspondence between the sub-tables in the binary tree table and the remainder, the data corresponding to the target address is searched in the sub-table corresponding to the remainder.

[0009] A second aspect of this disclosure provides an access device for a binary tree table, the device comprising:

[0010] The device is applicable to a binary tree table, in which addresses with the same modulo result for a preset value and the data corresponding to those addresses are assigned to the same sub-table. The binary tree table also includes a correspondence between the sub-table and the modulo result. The device includes:

[0011] A receiving module is used to receive access requests, wherein the access requests include a target address;

[0012] The remainder module is used to perform remainder processing on the preset value based on the target address to obtain the remainder of the target address relative to the preset value;

[0013] The lookup module is used to search for the data corresponding to the target address in the sub-table corresponding to the remainder based on the correspondence between the sub-tables in the binary tree table and the remainder.

[0014] A third aspect of this disclosure provides a computer device including a memory and a processor, and a computer program, wherein the memory stores the computer program, and when the computer program is executed by the processor, it implements the binary tree table access method as described in the first aspect above.

[0015] A fourth aspect of this disclosure provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the binary tree table access method of the first aspect described above.

[0016] A fifth aspect of this disclosure provides a vehicle including a memory, a processor, and a computer program, wherein the memory stores the computer program, and when the computer program is executed by the processor, it implements the binary tree table access method as described in the first aspect above.

[0017] The technical solution provided in this disclosure has the following advantages compared with the prior art:

[0018] The binary tree table access method, apparatus, device, storage medium, and vehicle provided in this disclosure are applicable to a binary tree table. In this binary tree table, addresses with the same remainder result when modulo a preset value, and the data corresponding to those addresses, are assigned to the same sub-table. The binary tree table also includes a correspondence between sub-tables and remainder results. By receiving an access request including a target address, performing a remainder operation on the preset value based on the target address, and obtaining the remainder of the target address relative to the preset value, the data corresponding to the target address is searched in the sub-table corresponding to the remainder based on the correspondence between sub-tables and remainders in the binary tree table. Since this disclosure embodiment can search for data in the corresponding sub-table using the remainder of the target address, it does not require traversing the entire binary tree table. Compared to searching the entire binary tree table, this reduces the amount of data searched and improves the access speed of the binary tree table. Attached Figure Description

[0019] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.

[0020] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1 This is a schematic diagram of the structure of a binary tree table provided in an embodiment of the present disclosure;

[0022] Figure 2 This is a schematic diagram of the structure of two sub-tables corresponding to a binary tree table provided in an embodiment of the present disclosure;

[0023] Figure 3 This is a flowchart of a binary tree table access method provided in an embodiment of this disclosure;

[0024] Figure 4 This is a flowchart of a data transmission method provided in an embodiment of this disclosure;

[0025] Figure 5 This is a schematic diagram of the structure of an access device for a binary tree table provided in an embodiment of this disclosure;

[0026] Figure 6 This is a schematic diagram of the structure of a computer device provided in an embodiment of this disclosure. Detailed Implementation

[0027] To better understand the above-mentioned objectives, features, and advantages of this disclosure, the solutions disclosed herein will be further described below. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.

[0028] Numerous specific details are set forth in the following description in order to provide a full understanding of this disclosure, but this disclosure may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only some, and not all, of the embodiments of this disclosure.

[0029] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.

[0030] 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 one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0031] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".

[0032] Currently, the structures for accessing data in a database are mainly divided into three categories: binary tree tables, hash tables, and content-addressed lookup tables. Among them, the binary tree table access method accesses data from a binary tree table that stores multiple sets of data. Starting from the first node in the binary tree table, the data to be searched is compared with each node, and the next node to be compared is determined based on the comparison results, until the data stored in a node that matches the data to be searched is found. However, in using this binary tree table-based access method, the applicant found the following problem: when the node storing the corresponding data in the binary tree table is far from the first node (also called the root node), it takes a long time to access that node, thus reducing the access efficiency of the binary tree table.

[0033] In summary, improving the speed of access methods for binary tree tables is a technical problem that urgently needs to be solved.

[0034] Figure 1 This is a schematic diagram of a binary tree table provided in an embodiment of this disclosure. Figure 1As shown, this structure includes nodes 110-117 that store addresses and their corresponding data. Since a binary tree table can be understood as a hierarchical table storing data, each node stores a set of addresses and their corresponding data. A parent node can be understood as the parent node relative to the node at the next level, and a child node can be understood as the child node relative to the node at the previous level. Each node can only have one parent node and at most two child nodes. The address stored in the left child node of the parent node is less than the address stored in the parent node itself, and the address stored in the right child node of the parent node is less than the address stored in the parent node itself. The address of the left child node is greater than the address stored in the parent node. Here, node 110 is the parent node relative to nodes 111 and 112, node 111 is the left child node relative to node 110, and node 112 is the right child node relative to node 110. The address stored in the left child node 111 is less than the address stored in the parent node 110, and the address stored in the right child node 112 is greater than the address stored in the parent node 110. Node 111 is the parent node relative to node 113, and node 113 is the left child node relative to node 111. The address stored in the left child node 113 is greater than the address stored in the parent node 110. The address is less than the address stored in parent node 111. Node 112 is the parent node relative to nodes 114 and 115. Node 114 is the left child node relative to node 112, and node 115 is the right child node relative to node 112. The address stored in the left child node 114 is less than the address stored in parent node 112, and the address stored in the right child node 115 is greater than the address stored in parent node 112. Node 113 is the parent node relative to node 116, and node 116 is the left child node relative to node 113. The address stored in the left child node 116 is less than the address stored in parent node 114. The address is less than the address stored in parent node 113. Node 114 is the parent node relative to node 117, and node 117 is the right child node relative to node 114. The address stored in the right child node 117 is greater than the address stored in parent node 114. The addresses stored in nodes 110, 113, 115, and 117 can be addresses where the remainder 'a' obtained by taking the modulo of a preset value. The addresses stored in nodes 111, 112, 114, and 116 can be addresses where the remainder 'b' obtained by taking the modulo of a preset value.

[0035] Figure 2 This is a schematic diagram illustrating the structure of two sub-tables corresponding to a binary tree table provided in an embodiment of this disclosure. For example... Figure 2 As shown, the addresses stored in nodes 110-117 and the data corresponding to those addresses are... Figure 1Since the addresses and corresponding data stored in nodes 110-117 are the same, the remainder when the addresses stored in nodes 110, 113, 115, and 117 are modulo a with respect to a preset value. Sub-table 210 is the sub-table corresponding to the remainder result 'a', including nodes 110, 113, 115, and 117. Node 110 is the parent node relative to nodes 113 and 114, node 113 is the left child node relative to node 110, and node 115 is the right child node relative to node 110. The address stored in the left child node 113 is less than the address stored in the parent node 110, and the address stored in the right child node 115 is greater than the address stored in the parent node 110. Node 115 is the parent node relative to node 117, and node 111 is the left child node relative to node 115. The address stored in the left child node 117 is... The address is less than the address stored in the parent node 115; the addresses stored in nodes 111, 112, 114, and 116 have the same remainder result b when moduloed by a preset value. Sub-table 220 is the sub-table corresponding to the remainder result b, including nodes 111, 112, 114, and 116. Among them, node 111 is the parent node relative to nodes 116 and 112, node 116 is the left child node relative to node 111, and node 112 is the right child node relative to node 111. The address stored in the left child node 116 is less than the address stored in the parent node 111, and the address stored in the right child node 112 is greater than the address stored in the parent node 111. Node 112 is the parent node relative to node 114, and node 114 is the left child node relative to node 112. The address stored in the left child node 114 is less than the address stored in the parent node 112.

[0036] In practice, after receiving a storage instruction containing an address and its corresponding data, the system can perform a modulo operation on the obtained address relative to a preset value to obtain the modulo result. Then, based on the correspondence between the modulo result and the sub-table, the system can find the sub-table to be stored and store the address and its corresponding data in the sub-table. This allows the binary tree table access controller to find the corresponding data based on the target address contained in the access request after receiving the access request.

[0037] The preset value can be the number of sub-tables determined based on the total amount of data to be stored in the binary tree table and the expected access speed of the binary tree table access device. With the total amount of data remaining constant, the more sub-tables set, the larger the preset value, and the faster the access speed.

[0038] This involves performing a modulo operation on the obtained address relative to a preset value to obtain the modulo result. Alternatively, the modulo result can be calculated directly, or the data in the target data bits of the address can be selected, and the modulo result of that data relative to the preset value can be calculated. In this case, assuming the number of target data bits is g and the preset value is j, when determining the value of g, condition 2 must be satisfied. g ≥j, for example, can satisfy condition 2. g The minimum value of ≥j is used as the value of g. For example, if the preset value is 3, g can be 2. Select any 2 data bits in the address, such as the data in the first 2 data bits modulo 3, and use the remainder result as the remainder result of the address relative to the preset data. Alternatively, you can calculate the cyclic redundancy check code corresponding to the address, and take the remainder of the cyclic redundancy check code relative to the preset value, and use the remainder result as the remainder result of the address relative to the preset data.

[0039] The process involves finding the sub-table to be stored based on the correspondence between the remainder result and the sub-table. In other words, the storage address of the root node in the sub-table is obtained based on the remainder result. Since each node in the sub-table corresponds to a storage address, and the address of each node is obtained based on the storage address of its parent node and the address offset of the node relative to its parent node (where the address offset is a pre-set value), the storage address of each node in the sub-table is obtained based on the address of the root node of the sub-table. The address of the sub-table can be represented by the address of the root node in the sub-table. By finding the address of the root node in the sub-table corresponding to the remainder result based on the correspondence between the remainder result and the sub-table, the address of the root node of the sub-table corresponding to the remainder result can be found. For example, the correspondence between the remainder result and the address of the root node of the corresponding sub-table can be stored in a data table.

[0040] Specifically, after finding the sub-table corresponding to the address using the modulo result of the address to be stored, the sub-table corresponding to the address is used as... Figure 2Taking sub-table 210 as an example, to store the address and its corresponding data in sub-table 210, we can first retrieve the flag data stored in root node 110 from sub-table 210. The flag data can be used to indicate whether the node stores an address and its corresponding data. The value of the flag data can be 0 or 1. When the value of the flag data stored in root node 110 is 0, it can be considered that no data is stored in root node 110. At this time, the address and its corresponding data can be stored in root node 110, resulting in root node 110 storing the address and its corresponding data. 10. If the flag value is 1, it can be assumed that the root node 110 already stores the address and its corresponding data. At this point, the data for the address to be stored is compared with the data for the address stored in the root node 110. If the data for the address to be stored is equal to the data for the address stored in the root node 110, it can be assumed that the address to be stored and its corresponding data have been stored in the sub-table 210, and the storage process ends. If the data for the address to be stored is less than the data for the address stored in the root node 110, the left child node 113 relative to the root node can be used as a reference. The address offset of point 110 is used to obtain the storage address of the left child node 113 of root node 110. The comparison process is then continued in the left child node 113 of root node 110 until a node with a flag value of 0 is found. The address to be stored and its corresponding data are then stored in this node. Alternatively, a node is found where the data at the address stored is equal to the data at the address to be stored, at which point the storage process ends. If the data at the address to be stored is greater than the data at the address stored in root node 110, the storage process can be adjusted based on the right child node 115 of root node 110 relative to root node 110. The address offset is 0. The storage address of the right child node 115 of the root node 110 is obtained. The comparison process is continued in the right child node 115 of the root node 110 until a node with a flag value of 0 is found. The address to be stored and the corresponding data are stored in that node. Alternatively, a node is found where the data of the address stored is equal to the data of the address to be stored. The storage process ends. This process is repeated until all addresses to be stored and the corresponding data are stored in the corresponding nodes of the corresponding sub-tables, resulting in multiple sub-tables that store multiple sets of addresses and corresponding data.

[0041] Figure 3 This is a flowchart illustrating a method for accessing a binary tree table according to an embodiment of this disclosure. This method can be executed by a binary tree table access device. Figure 3 As shown, the binary tree table access method provided in this embodiment includes the following steps:

[0042] S301. Receive an access request, wherein the access request includes a target address.

[0043] The target address in this embodiment can be understood as the address to be searched in the binary tree table. For example, the address can be understood as the address of the target hardware to which the message is to be delivered, or as the storage address of application data, etc. There are no restrictions here. When the target address is the address of the target hardware to which the message is to be delivered, the data corresponding to the address can be the target port. When the target address is the storage address of application data, the data corresponding to the target address can be specific application data.

[0044] In this embodiment of the disclosure, the binary tree table access device can obtain the target address based on the received access request, so that the binary tree table access device can access the data corresponding to the target address in the binary tree table.

[0045] S302. Perform a remainder operation on the preset value based on the target address to obtain the remainder of the target address relative to the preset value.

[0046] In this embodiment of the disclosure, the preset value can be the number of sub-tables. The number of sub-tables is determined based on the total amount of data to be stored in the binary tree table and the expected access speed of the binary tree table access device. When the total amount of data remains unchanged, the more sub-tables there are, the faster the access speed.

[0047] In this embodiment of the disclosure, performing a remainder operation on a preset value based on the target address can be understood as using the target address as the dividend and the preset value as the divisor to calculate the remainder of the dividend relative to the divisor.

[0048] In this embodiment of the disclosure, the binary tree table access device can, after extracting the target address in the access request, determine the size of a preset value based on the number of sub-tables, and perform a remainder operation on the preset value based on the target address, using the target address as the dividend and the preset value as the divisor to obtain the remainder of the target address relative to the preset value.

[0049] S303. Based on the correspondence between the sub-tables in the binary tree table and the remainder, search for the data corresponding to the target address in the sub-table corresponding to the remainder.

[0050] The tree in this embodiment can be understood as a hierarchical collection of multiple nodes. A binary tree table can be understood as a tree structure table where each node has at most two child nodes. Among the two child nodes of the same parent node, the child node to the left of the parent node can be understood as the child node whose stored data is less than the data stored in the parent node, and the child node to the right of the parent node can be understood as the child node whose stored data is greater than the data stored in the parent node. For ease of understanding, in this embodiment, the child node of the left branch of the parent node can be exemplarily taken as the left child node, and the child node of the right branch of the parent node can be taken as the right child node. The data stored in the node can be an address and its corresponding data. For example, the node can also store a flag bit indicating whether the node stores data; the value of the flag bit can be 0 or 1.

[0051] In this embodiment, a sub-table can be understood as a binary tree table storing all data that is split according to a preset rule to obtain multiple binary tree sub-tables storing partial data. The sub-tables and the binary tree table have the same structure. In this embodiment, the rule for splitting the binary tree table into multiple sub-tables can be to combine nodes in the binary tree table that have the same remainder into a sub-table. The remainder is the remainder of the address stored in the node relative to a preset value.

[0052] The correspondence between sub-tables and remainders in this embodiment can be understood as the correspondence between the address of a node in a sub-table and the remainder of the address stored in the sub-table relative to a preset value. For example, a sub-table can correspond to a remainder, and the remainder of the address stored in any node in the sub-table relative to the preset value is the same.

[0053] In this embodiment of the disclosure, the binary tree table access device can, after obtaining the remainder of the target address in the access request relative to a preset value, determine the binary tree sub-table to be accessed based on the correspondence between the sub-table and the remainder, and select a parent node in the binary tree sub-table for searching. For example, based on the remainder of the target address relative to the preset value and the correspondence between the sub-table and the remainder, it can determine the target address. Figure 2When accessing sub-table 210, the target address to be searched is compared with the value of the address stored in parent node 110. If the value of the target address is less than the value of the address stored in parent node 110, the target address is searched in the left child node 113 of parent node 110 in sub-table 210, that is, the value of the target address is compared with the value of the address stored in the left child node 113 of parent node 110. If the value of the target address is greater than the value of the address stored in parent node 110 in sub-table 210, the target address is searched in the right child node 115 of parent node 110 in sub-table 210, that is, the value of the target address is compared with the value of the address stored in the right child node 115 of parent node 110, and so on. Based on the result of each search, the corresponding child node of the currently searched parent node is used as the parent node for the next search, and the search process continues. The above search process continues until the node corresponding to the target address is found.

[0054] In one exemplary embodiment of this disclosure, to search for data corresponding to the target address in the sub-table corresponding to the remainder, the location of the sub-table corresponding to the remainder must first be obtained, that is, the storage address of the sub-table. Since each node in the sub-table has its own storage address, and the storage addresses of all nodes in the sub-table are obtained based on the storage address of the root node in the sub-table, for example... Figure 2 In sub-table 210, the storage address of child node 115 is the sum of the storage address of root node 110 and the address offset, and the storage address of child node 117 is the sum of the storage address of parent node 115 and the address offset. The address offset can be preset. The address offsets of the left and right child nodes relative to the parent node are different. Therefore, to find the data corresponding to the target address in the sub-table corresponding to the remainder, it is necessary to obtain the storage address of the root node in the sub-table corresponding to the remainder. At this time, the binary tree table access device can obtain the storage address of the root node of the sub-table according to the correspondence between the sub-table and the remainder after obtaining the remainder of the target address relative to the preset value, thereby finding the sub-table corresponding to the target address and selecting the root node in the sub-table as the first parent node for searching, thus executing the search process in this embodiment.

[0055] In one exemplary embodiment of the present disclosure, the binary tree table access device can establish a data table containing the correspondence between remainders and sub-tables. For example, the data table can store the root node address of the sub-table corresponding to each remainder. After obtaining the remainder of the target address relative to a preset value, the root node address of the sub-table corresponding to the remainder can be obtained according to the data table, and the data corresponding to the target address can be searched in the sub-table where the root node is located.

[0056] In an exemplary embodiment of this disclosure, when the access device of the binary tree table searches for data corresponding to the target address in the sub-table corresponding to the remainder, it can first obtain the flag bit data stored in the node to be searched. The value of the flag bit data can be 0 or 1, used to indicate whether the node stores an address and the data corresponding to the address. If the value of the flag bit data is 0, it means that the node where the flag bit data is located does not store an address and the data corresponding to the address. At this time, the sub-table where the node to be searched is located does not store the target address to be searched and the data corresponding to the target address, and the search process ends. For example, a search failure prompt message can be returned. If the value of the flag bit data is 1, it means that the node where the flag bit data is located stores an address and the data corresponding to the address, and the search process in this embodiment of the disclosure can continue to be executed.

[0057] This disclosure applies to binary tree tables where addresses with the same remainder result from a preset value and the corresponding data are assigned to the same sub-table, and the sub-tables correspond to the remainder results. By receiving an access request including a target address and performing a remainder operation on the preset value based on the target address, the remainder of the target address relative to the preset value is obtained. Then, based on the correspondence between the sub-tables and the remainders in the binary tree table, the data corresponding to the target address is searched in the sub-table corresponding to the remainder. This allows the data corresponding to the target address to be searched in the corresponding sub-table using the remainder of the target address, without needing to traverse the entire binary tree table. Compared to searching the entire binary tree table, this reduces the amount of data searched and improves the access speed of the binary tree table.

[0058] In some embodiments of this disclosure, the remainder result corresponding to the sub-table is obtained by taking the remainder of the data in the target data bit of the address in the sub-table. The step of performing remainder processing on the preset value based on the target address to obtain the remainder of the target address relative to the preset value includes: taking the remainder of the preset value by using the data in the target data bit of the target address, to obtain the remainder of the data in the target data bit relative to the preset value.

[0059] In some embodiments of this disclosure, the target data bit can be understood as a data bit determined based on a preset rule, and the target data bit of the address in the sub-table can be understood as a preset data bit among all the data bits in the address data stored in the sub-table.

[0060] In some embodiments of this disclosure, the access device for a binary tree table can determine the target data bit through a preset method, and take the remainder of the data in the address data stored in the node of the sub-table that is in the target data bit to obtain the remainder result corresponding to the sub-table. Then, it can determine the target data bit in the target address through a preset method, and take the remainder of the data in the target address data that is in the target data bit with a preset value. The data in the data corresponding to the target address that is in the target data bit is used as the dividend, and the preset value is used as the divisor to obtain the remainder of the data in the target data bit relative to the preset value.

[0061] For example, we can assume that the first p bits of the data are the target data bits, with a preset value of q. When determining the value of p, condition 2 needs to be satisfied. p ≥q, for example, can satisfy condition 2. p The smallest p value greater than or equal to q is used as the value of p. For example, if the preset value is 3, p can be 2. Select any two data bits in the address. For example, take the remainder of the data in the first two data bits with 3 to get the remainder of the data in the target data bit relative to the preset value.

[0062] Optionally, the target data bits may include: a preset plurality of consecutive data bits, or a preset plurality of non-consecutive data bits.

[0063] In some embodiments of this disclosure, the target data bits can be multiple consecutive data bits or multiple non-consecutive data bits. Assuming the target data bits are 3 bits, the target data bits can be 3 consecutive data bits or 3 non-consecutive data bits. When the target data bits are 3 consecutive data bits, the 3 consecutive data bits can be the first 3 data bits or any 3 data bits in the middle of all data bits. When the target data bits are 3 non-consecutive data bits, the 3 non-consecutive data bits can be the 1st, 3rd, and 5th data bits or any 3 non-consecutive data bits. The specific method of determining the target data bits is not limited here.

[0064] Some embodiments of this disclosure obtain the remainder result corresponding to the sub-table by taking the remainder of the data on the target data bits of the address in the sub-table, and then take the remainder of the data on the target data bits in the target address relative to the preset value to obtain the remainder of the data on the target data bits relative to the preset value. The target data bits include: a preset multiple consecutive data bits, or a preset multiple non-consecutive data bits. This can obtain the remainder result corresponding to the sub-table and the remainder result corresponding to the data on the target data bits in the target address. When performing the remainder operation on the target address to be searched, the data on a portion of the data bits in the target address can be used to replace the target address for the remainder operation, reducing the number of bits in the dividend, thereby reducing the amount of data to be processed and further improving the speed of binary tree table access.

[0065] In other embodiments of this disclosure, in the binary tree table, the remainder result corresponding to the sub-table is obtained by taking the remainder of the cyclic redundancy check (CRC) code corresponding to the address in the sub-table; the step of performing the remainder operation on the preset value based on the target address to obtain the remainder of the target address relative to the preset value includes: determining the target CRC code corresponding to the target address. The remainder of the target CRC code relative to the preset value is obtained by taking the remainder of the target CRC code relative to the preset value.

[0066] In other embodiments of this disclosure, a Cyclic Redundancy Check (CRC) can be understood as a short, fixed-length checksum generated from data such as network packets or computer files. It can convert data of arbitrary length into fixed-length data. For example, when calculating a 16-bit CRC, a 16-bit CRC register can be set up, with each bit preset to 1. The CRC register is then XORed with the data at the target address. Afterward, the CRC register is shifted from high to low, with zeros padded at the highest bit position. If the lowest bit is 1, the register is XORed with a preset polynomial code; if the lowest bit is 1, no XOR operation is needed. This process is repeated until all data at the target address has undergone this process. The value in the CRC register is the final 16-bit CRC value, which is the target CRC value.

[0067] In other embodiments of this disclosure, the access device for the binary tree table can calculate the cyclic redundancy check code corresponding to the address stored in the node in the sub-table, and take the remainder of the cyclic redundancy check code to obtain the remainder result corresponding to the sub-table. Then, it can determine the target cyclic redundancy check code corresponding to the target address to be searched, and take the remainder of the target cyclic redundancy check code relative to the preset value based on the target cyclic redundancy check code. The data of the target cyclic redundancy check code is used as the dividend, and the preset value is used as the divisor to obtain the remainder of the target cyclic redundancy check code relative to the preset value.

[0068] In other embodiments of this disclosure, the remainder of the address in the sub-table is obtained by taking the remainder of the cyclic redundancy check code. Then, the remainder of the target cyclic redundancy check code obtained from the target address is taken with respect to the preset value to obtain the remainder of the target cyclic redundancy check code relative to the preset value. In this way, when selecting the dividend relative to the preset value, the dividend can be obtained from all the data of the target address. Compared with the case where the data corresponding to the target address is used as the dividend, the number of bits of the dividend can be reduced, thereby reducing the amount of data to be calculated and further improving the speed of binary tree table access.

[0069] Figure 4 This is a flowchart of a data transmission method provided in an embodiment of this disclosure, such as... Figure 4 As shown, based on the above embodiments, data can be transmitted using the following method.

[0070] In this embodiment of the disclosure, the access request further includes target transmission data, the data corresponding to the target address includes a port, and after searching for the data corresponding to the target address in the sub-table corresponding to the remainder, the method further includes:

[0071] S401. Obtain the first status information of the port.

[0072] The first state information in this embodiment can be understood as state information used to characterize whether the port can communicate normally.

[0073] In this embodiment of the disclosure, the binary tree table access device can obtain first state information to characterize whether the port can communicate normally.

[0074] S402. Based on the first status information, determine whether the port is a faulty port.

[0075] In this embodiment of the disclosure, the binary tree table access device can, after obtaining first state information characterizing whether a port can communicate normally, determine whether the port is a faulty port that cannot communicate normally based on the first state information.

[0076] S403. If the port is not a faulty port, then the data is transmitted through the port.

[0077] In this embodiment of the disclosure, the access device for the binary tree table can transmit the target data in the access request through the port after determining that the port is not a faulty port.

[0078] This embodiment of the disclosure obtains the first status information of the port to determine whether the port is a faulty port, and transmits data through the port when the port is not a faulty port. After finding the port corresponding to the target address in the binary tree table by the aforementioned method, the status of the port can be further determined, thereby transmitting the target data contained in the access request through the port when the port is not a faulty port, thus improving the efficiency of data transmission.

[0079] In some embodiments of this disclosure, when the port is not a faulty port, it is determined whether the port is an idle port based on the second state information of the port. When the port is an idle port, the data is transmitted through the port. When the port is not an idle port, the data is added to the task queue of the port.

[0080] The second state information in some embodiments of this disclosure can be understood as being used to characterize whether there is data being transmitted through the port. If not, the second state information is idle state information.

[0081] In some embodiments of this disclosure, the port's task queue can be understood as a task queue consisting of tasks waiting to transmit data through the port. Adding data to the port's task queue can be done by creating a task to transmit the data and adding the task containing the data to the task queue.

[0082] In some embodiments of this disclosure, the access device for the binary tree table can, after determining that the port is not a faulty port, further obtain the second state information of the port and determine whether the port is an idle port based on the second state information. After determining that the port is an idle port, the data contained in the access request is transmitted through the port. When the port is not an idle port, the data is added to the task queue of the port. For example, the task containing the data can be directly added to the end of the task queue, or the task containing the data can be added to any position in the message queue according to the urgency. No limitation is made here.

[0083] Some embodiments of this disclosure determine whether a port is idle based on its second state information when the port is not a faulty port. When the port is idle, data is transmitted through the port. When the port is not idle, the data is added to the port's task queue. This allows for a decision on whether to transmit data directly or add it to the task queue after further determining the port's idle / busy status, thereby improving data transmission efficiency.

[0084] Figure 5 This is a schematic diagram of a binary tree table access device provided in an embodiment of this disclosure. This device can be understood as a partial functional module of the aforementioned binary tree table access device. For example... Figure 5 As shown, the device is applicable to a binary tree table. In the binary tree table, addresses with the same remainder result when modulo a preset value and the data corresponding to those addresses are assigned to the same sub-table. The binary tree table also includes a correspondence between the sub-tables and the remainder result. The access device 500 for the binary tree table includes: a receiving module 510, a remainder module 520, and a search module 530. The receiving module 510 is used to receive an access request, which includes a target address. The remainder module 520 is used to perform a remainder operation on the preset value based on the target address to obtain the remainder of the target address relative to the preset value. The search module 530 is used to search for the data corresponding to the target address in the sub-table corresponding to the remainder, based on the correspondence between the sub-tables in the binary tree table and the remainder.

[0085] Optionally, in the binary tree table, the remainder result corresponding to the sub-table is obtained by taking the remainder of the data in the target data bit of the address in the sub-table; the remainder module 520 includes: a first remainder unit, used to take the remainder of the preset value by taking the data in the target data bit of the target address, so as to obtain the remainder of the data in the target data bit relative to the preset value.

[0086] Optionally, the target data bits include: a preset plurality of consecutive data bits, or a preset plurality of non-consecutive data bits.

[0087] Optionally, in the binary tree table, the remainder result corresponding to the sub-table is obtained by taking the remainder of the cyclic redundancy check code corresponding to the address in the sub-table; the remainder module 520 includes: a first determining unit, used to determine the target cyclic redundancy check code corresponding to the target address; and a second remainder unit, used to take the remainder of the target cyclic redundancy check code relative to the preset value based on the target cyclic redundancy check code.

[0088] Optionally, the access request may also include target data to be transmitted, and the data corresponding to the target address may include a port; the binary tree table access device 500 may further include: a first status information acquisition unit, used to acquire first status information of the port; a second determination unit, used to determine whether the port is a faulty port based on the first status information; and a non-faulty port unit, used to transmit the data through the port when the port is not a faulty port.

[0089] Optionally, the non-faulty port unit includes: a second status information acquisition subunit, used to determine whether the port is an idle port based on the second status information of the port when the port is not a faulty port; a transmission subunit, used to transmit the data through the port when the port is an idle port; and an addition subunit, used to add the data to the task queue of the port when the port is not an idle port.

[0090] Figure 6 A schematic diagram of the structure of a computer device provided in an embodiment of this disclosure is shown.

[0091] like Figure 6 As shown, the computer device may include a processor 610 and a memory 620 storing computer program instructions.

[0092] Specifically, the processor 610 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.

[0093] Memory 620 may include a large-capacity storage for information or instructions. For example, and not limitingly, memory 620 may include a hard disk drive (HDD), a floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or a Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 620 may include removable or non-removable (or fixed) media. Where appropriate, memory 620 may be internal or external to the integrated gateway device. In a particular embodiment, memory 620 is a non-volatile solid-state memory. In a particular embodiment, memory 620 includes read-only memory (ROM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (Electrically Programmable ROM, EPROM), an electrically erasable programmable PROM (EEPROM), an electrically alterable ROM (EAROM), or flash memory, or a combination of two or more of these.

[0094] The processor 610 reads and executes computer program instructions stored in the memory 620 to perform the steps of the multi-zone speech recognition method provided in this embodiment of the present disclosure.

[0095] In one example, the computer device may also include a transceiver 630 and a bus 640. Wherein, as... Figure 6 As shown, the processor 610, memory 620 and transceiver 630 are connected via bus 640 and communicate with each other.

[0096] Bus 640 may include hardware, software, or both. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industrial 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 Bus (VLB) bus, or other suitable buses, or a combination of two or more of these. Where appropriate, bus 640 may include one or more buses. Although specific buses are described and illustrated in the embodiments of this application, this application considers any suitable bus or interconnection.

[0097] Furthermore, computer equipment may also include human-computer interaction devices, such as screens, which can communicate with the processor via a bus. These devices can display voice control commands and their corresponding execution results to the user, making voice interaction visual and improving the user's voice interaction experience.

[0098] This disclosure also provides a computer-readable storage medium that can store a computer program. When the computer program is executed by a processor, the processor implements the multi-zone speech recognition method provided in this disclosure.

[0099] The aforementioned storage medium may, for example, include a memory 620 for computer program instructions, which can be executed by a processor 610 of a binary tree table access device to complete the binary tree table access method provided in this embodiment. Optionally, the storage medium may be a non-transitory computer-readable storage medium, such as a ROM, random access memory (RAM), compact disc ROM (CD-ROM), magnetic tape, floppy disk, and optical data storage device. The aforementioned computer program may be written in any combination of one or more programming languages ​​to perform the operations of this embodiment, including object-oriented programming languages ​​such as Java and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code may be executed entirely on a user computing device, partially on a user device, as a standalone software package, partially on a user computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0100] This disclosure also provides a vehicle, which includes a memory, a processor, and a computer program. The memory stores the computer program, and when the computer program is executed by the processor, it can realize the various processes and effects described in the above embodiments of this disclosure, which will not be elaborated here.

[0101] The above description is merely a specific embodiment of this disclosure, enabling those skilled in the art to understand or implement it. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method of accessing a binary tree table, characterized by, The binary tree table has a hierarchical relationship, in which one parent node corresponds to at most two child nodes, the first child node corresponding to the parent node stores an address smaller than that stored in the parent node, the second child node corresponding to the parent node stores an address larger than that stored in the parent node, addresses with the same remainder result of a preset value and data corresponding to the addresses are allocated to the same child table, the binary tree table further includes a correspondence between the child tables and the remainder results, and the method comprises: receiving an access request, the access request including a target address; performing remainder processing on the preset value based on the target address to obtain a remainder of the target address relative to the preset value; based on the correspondence between the child tables in the binary tree table and the remainder, searching for data corresponding to the target address in the child table corresponding to the remainder; the searching for data corresponding to the target address in the child table corresponding to the remainder based on the correspondence between the child tables in the binary tree table and the remainder comprises: determining an address of a root node of the child table corresponding to the remainder based on the correspondence between the child tables in the binary tree table and the remainder; based on the address of the root node of the child table corresponding to the remainder and a preset address offset, searching for data corresponding to the target address in the child table corresponding to the remainder, the address offset being an offset between a storage address of a parent node and a storage address of a child node in a child table.

2. The method of claim 1, wherein, in the binary tree table, the remainder result corresponding to a child table is obtained by taking the data on a target data bit of an address in the child table as a remainder; the performing remainder processing on the preset value based on the target address to obtain a remainder of the target address relative to the preset value comprises: taking the data on the target data bit in the target address as a remainder of the preset value to obtain a remainder of the data on the target data bit relative to the preset value.

3. The method of claim 2, wherein, the target data bit includes a plurality of preset continuous data bits or a plurality of preset non-continuous data bits.

4. The method of claim 1, wherein, in the binary tree table, the remainder result corresponding to a child table is obtained by taking a cyclic redundancy check code corresponding to an address in the child table as a remainder; the performing remainder processing on the preset value based on the target address to obtain a remainder of the target address relative to the preset value comprises: determining a target cyclic redundancy check code corresponding to the target address; taking the target cyclic redundancy check code as a remainder of the preset value to obtain a remainder of the target cyclic redundancy check code relative to the preset value.

5. The method according to any one of claims 1-4, characterized in that, the access request further includes target transmission data, and the data corresponding to the target address includes a port; after the searching for data corresponding to the target address in the child table corresponding to the remainder, the method further comprises: obtaining first state information of the port; based on the first state information, determining whether the port is a faulty port; if the port is not a faulty port, transmitting the data through the port.

6. The method of claim 5, wherein, if the port is not a faulty port, transmitting the data through the port comprises: When the port is not a fault port, determining whether the port is an idle port according to second state information of the port; When the port is an idle port, transmitting the data through the port; When the port is not an idle port, adding the data into a task queue of the port.

7. Apparatus for accessing a binary tree table, characterized in that The device is suitable for a binary tree table having a hierarchical relationship, in which one parent node corresponds to at most two child nodes, the first child node corresponding to the parent node stores an address smaller than that stored in the parent node, the second child node corresponding to the parent node stores an address larger than that stored in the parent node, addresses having the same remainder result of a preset value and data corresponding to the addresses are allocated into a same child table, the binary tree table further includes a correspondence between the child table and the remainder result, and the device comprises: a receiving module configured to receive an access request, the access request including a target address; a remainder module configured to perform remainder processing on the preset value based on the target address to obtain a remainder of the target address relative to the preset value; a searching module configured to search for data corresponding to the target address in a child table corresponding to the remainder based on a correspondence between the child table in the binary tree table and the remainder; The searching module is specifically configured to determine an address of a root node of the child table corresponding to the remainder based on the correspondence between the child table in the binary tree table and the remainder, and search for the data corresponding to the target address in the child table corresponding to the remainder based on the address of the root node of the child table corresponding to the remainder and a preset address offset, the address offset being an offset between a storage address of a parent node and a storage address of a child node in a child table.

8. A computer device, comprising: comprise: a memory; a processor; and a computer program; wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method of any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, and when the computer program is executed by a processor, an access method of a binary tree table as claimed in any one of claims 1-6 is implemented.

10. A vehicle characterized by comprising: comprise: a memory; a processor; and a computer program; wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method of any one of claims 1-6.

Citation Information

Patent Citations

  • Method for optimizing memorizer performance

    CN101211346A

  • MAC address finding and transmitting method and device

    CN103581022A