Data processing method, device, electronic device and storage medium

By constructing a binary tree structure with the interval endpoint value as the root node to store associated data, the problem of low data search efficiency in the existing technology is solved, and an efficient data storage method for quickly locating the index interval and obtaining the index result is realized.

CN113111227BActive Publication Date: 2024-10-18LAUNCH TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110400643.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-14
Publication Date
2024-10-18
Estimated Expiration
2041-04-14

AI Technical Summary

Technical Problem

In the existing technology, associated data is usually stored in an unordered manner or in ascending order according to the interval endpoint values ​​of the index interval, resulting in low data search efficiency. Especially when the amount of data is huge, the search process is complicated.

Method used

By constructing binary tree data with the interval endpoint value of the index interval as the root node, the left subtree and the right subtree contain interval endpoint values ​​smaller than and greater than the root node respectively, and the index results corresponding to the index interval are used as leaf nodes to achieve ordering The binary tree structure is stored.

Benefits of technology

This method improves the efficiency of data search, can quickly locate the index interval and obtain the corresponding index results, and achieves an efficient and convenient data storage method.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113111227B_ABST
    Figure CN113111227B_ABST
Patent Text Reader

Abstract

The present application is applicable to the field of computer technology, and provides a data processing method, device, electronic device and storage medium, including: obtaining original data, the original data including each preset index interval and the index result corresponding to the index interval; constructing target binary tree data according to the interval endpoint value of each index interval and the index result; wherein the target binary tree data is binary tree data with the median of the interval endpoint value as the root node, and the left subtree of the target binary tree data includes each interval endpoint value less than the root node, the right subtree of the target binary tree data includes each interval endpoint value greater than the root node, and each leaf node of the target binary tree data is the index result corresponding to each index interval. The embodiment of the present application can provide a data storage method that is convenient for data search.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of computer technology, and in particular, relates to a data processing method, device, electronic device and storage medium. Background Art

[0002] In the application of four-wheel alignment, each numerical range of wheel height is usually stored in correspondence with the standard value of the corresponding wheel parameter (such as toe, caster) in advance to obtain associated data. When the wheel alignment of the current vehicle is required, it is only necessary to input the wheel height of the current vehicle, and the standard value stored corresponding to the numerical range can be obtained by determining the numerical range of the wheel height of the vehicle as the standard value of the wheel parameter of the current vehicle. The various numerical ranges of wheel height here can be called index intervals, and the standard value of the wheel parameter corresponding to the numerical range can be called index results. In other application scenarios, there are also such associated data with various numerical ranges of certain data as index intervals and another data as index results.

[0003] At present, when storing the above-mentioned related data, it is usually stored in an unordered manner, or in a database or table, each pair of related data is stored in the order of the interval endpoint values ​​of the index interval from small to large. These storage methods result in the need to traverse each pair of related data in turn until the corresponding index interval is found to obtain the corresponding index result when searching for data later. When the amount of related data is large, this storage method will make the data search process complicated and inefficient. Summary of the invention

[0004] In view of this, embodiments of the present application provide a data processing method, device, and electronic device to solve the problem in the prior art of how to provide a data storage method that facilitates data search.

[0005] A first aspect of an embodiment of the present application provides a data processing method, including:

[0006] Acquire original data, where the original data includes each preset index interval and index results corresponding to the index interval;

[0007] According to the interval endpoint values ​​of each of the index intervals and the index results, target binary tree data are constructed; wherein the target binary tree data is binary tree data with the median of the interval endpoint values ​​as the root node, and the left subtree of the target binary tree data includes each of the interval endpoint values ​​that is smaller than the root node, the right subtree of the target binary tree data includes each of the interval endpoint values ​​that is larger than the root node, and each leaf node of the target binary tree data is the index result corresponding to each of the index intervals.

[0008] Optionally, constructing target binary tree data according to the interval endpoint values ​​of each of the index intervals and the index result includes:

[0009] According to the interval endpoint values ​​of each of the index intervals, an interval endpoint array is obtained; the interval endpoint array includes each of the interval endpoint values ​​arranged in order;

[0010] Divide the interval endpoint array into at least two ordered sub-arrays according to the binary search method, and construct a first binary tree data; wherein each node of the first binary tree data corresponds one-to-one to each interval endpoint value of the interval endpoint array, and the first binary tree data uses the median in the interval endpoint array as a root node, uses a sub-array smaller than the root node as a left sub-tree, and uses a sub-array larger than the root node as a right sub-tree;

[0011] According to the root node of the first binary tree data, a right child node is added to the node with the largest value in the left subtree, and a left child node is added to the node with the smallest value in the right subtree, to obtain a second binary tree data;

[0012] Determine the nodes to be processed in the second binary tree data, and add the corresponding index results as leaf nodes for each of the nodes to be processed to obtain the target binary tree data; the nodes to be processed are nodes with at most one child node in the second binary tree data.

[0013] Optionally, dividing the interval endpoint array into at least two ordered sub-arrays according to a binary search method and constructing a first binary tree data includes:

[0014] Taking the interval endpoint array as the first-level array, bisection the interval endpoint array level by level according to the bisection method to obtain a target array set composed of the first-level array and each sub-array in order level by level;

[0015] For each level of array in the target array set, the median of the array is used as the root node, the left subtree is composed of the endpoint values ​​of the intervals in the array that are less than the median, and the right subtree is composed of the endpoint values ​​of the intervals in the array that are greater than the median, and each layer of binary tree data is constructed step by step until each array in the target array set has been constructed into binary tree data of the corresponding level, and the first binary tree data is obtained.

[0016] Optionally, after obtaining the original data, the method further includes:

[0017] For each index interval, determining corresponding endpoint types for two interval endpoint values ​​of the index interval respectively, and associating the interval endpoint value, the endpoint type and the index result corresponding to the index interval and storing them in a multi-mapping container;

[0018] Correspondingly, adding a corresponding index result as a leaf node for each of the nodes to be processed to obtain target binary tree data includes:

[0019] For each of the nodes to be processed, determining the index result and the position to be connected of the node to be processed according to the connection relationship between the node to be processed and the parent node of the node to be processed and the multi-mapping container;

[0020] The index result of the node to be processed is used as a leaf node, and the leaf node is connected to the to-be-connected position of the node to be processed to obtain target binary tree data.

[0021] Optionally, after the target binary tree data is obtained by constructing, the method further includes:

[0022] Get the input index value;

[0023] According to the index value and the target binary tree data, an index result corresponding to the index value is searched.

[0024] Optionally, searching for an index result corresponding to the index value according to the index value and the target binary tree data includes:

[0025] Determine a target subtree according to a comparison result between the index value and the root node of the target binary tree data; the target subtree includes a left subtree or a right subtree corresponding to the root node;

[0026] According to the index value and the target subtree, the target index interval is determined, and the leaf node corresponding to the interval endpoint value of the target index interval is obtained to obtain the index result corresponding to the index value; wherein the target index interval is the index interval where the index value is located.

[0027] Optionally, the data processing method is applied to a four-wheel aligner, the index interval is a height interval of a wheel of a vehicle, and the index result is a standard value of a parameter corresponding to the wheel.

[0028] A second aspect of an embodiment of the present application provides a data processing device, including:

[0029] An original data acquisition unit, used to acquire original data, wherein the original data includes each preset index interval and an index result corresponding to the index interval;

[0030] A target binary tree data construction unit is used to construct target binary tree data according to the interval endpoint values ​​of each index interval and the index results; wherein the target binary tree data is binary tree data with the median of the interval endpoint values ​​as the root node, and the left subtree of the target binary tree data includes each interval endpoint value smaller than the root node, the right subtree of the target binary tree data includes each interval endpoint value greater than the root node, and each leaf node of the target binary tree data is the index result corresponding to each index interval.

[0031] Optionally, the target binary tree data construction unit includes an array determination module, a first binary tree data construction module, a second binary tree data construction module and a target binary tree data construction module:

[0032] An array determination module, configured to obtain an interval endpoint array according to the interval endpoint values ​​of each of the index intervals; the interval endpoint array includes each of the interval endpoint values ​​arranged in order;

[0033] A first binary tree data construction module is used to divide the interval endpoint array into at least two ordered sub-arrays according to the binary method, and construct a first binary tree data; wherein each node of the first binary tree data corresponds to each interval endpoint value of the interval endpoint array one by one, and the first binary tree data uses the median in the interval endpoint array as a root node, uses a sub-array smaller than the root node as a left sub-tree, and uses a sub-array larger than the root node as a right sub-tree;

[0034] A second binary tree data construction module is used to add a right child node to the node with the largest value in the left subtree and add a left child node to the node with the smallest value in the right subtree according to the root node of the first binary tree data, so as to obtain second binary tree data;

[0035] The target binary tree data construction module is used to determine the nodes to be processed in the second binary tree data, and add the corresponding index results as leaf nodes for each of the nodes to be processed to obtain the target binary tree data; the nodes to be processed are nodes with at most one child node in the second binary tree data.

[0036] Optionally, if the interval endpoint array contains an even number of interval endpoint values, any one of the two middle interval endpoint values ​​in the interval endpoint array is used as the root node of the first binary tree data.

[0037] Optionally, the first binary tree data construction module is specifically used to use the interval endpoint array as the first-level array, and to binary divide the interval endpoint array level by level according to the binary search method to obtain a target array set composed of the first-level array and each sub-array in order level by level; for each level of array in the target array set, the median of the array is used as the root node, and the left subtree is composed of each interval endpoint value in the array that is less than the median, and the right subtree is composed of each interval endpoint value in the array that is greater than the median, and each layer of binary tree data is constructed level by level until each array in the target array set has been constructed as binary tree data of the corresponding level, and the first binary tree data is obtained.

[0038] Optionally, the data processing device further includes:

[0039] An associative storage unit, for determining, for each index interval, corresponding endpoint types for two interval endpoint values ​​of the index interval, and associatively storing the interval endpoint value, the endpoint type and the index result corresponding to the index interval in a multi-mapping container;

[0040] Correspondingly, the target binary tree data construction module is used to determine the index result and the position to be connected of each node to be processed according to the connection relationship between the node to be processed and the parent node of the node to be processed and the multi-mapping container; use the index result of the node to be processed as a leaf node, and connect the leaf node to the position to be connected of the node to be processed to obtain the target binary tree data.

[0041] Optionally, the data processing device further includes:

[0042] An index value obtaining unit, which obtains an input index value;

[0043] A search unit is used to search for an index result corresponding to the index value according to the index value and the target binary tree data.

[0044] Optionally, the search unit is specifically used to determine the target subtree based on the comparison result of the index value and the root node of the target binary tree data; the target subtree includes the left subtree or the right subtree corresponding to the root node; according to the index value and the target subtree, the target index interval is determined, and the leaf node corresponding to the interval endpoint value of the target index interval is obtained to obtain the index result corresponding to the index value; wherein, the target index interval is the index interval where the index value is located.

[0045] Optionally, the data processing device is specifically applied to a four-wheel aligner, the index interval is a height interval of a wheel of a vehicle, and the index result is a standard value of a parameter corresponding to the wheel.

[0046] A third aspect of an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the electronic device implements the steps of the data processing method.

[0047] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the electronic device implements the steps of the data processing method.

[0048] A fifth aspect of an embodiment of the present application provides a computer program product. When the computer program product runs on an electronic device, the electronic device executes the data processing method described in any one of the first aspects above.

[0049] Compared with the prior art, the beneficial effect of the embodiment of the present application is that: in the embodiment of the present application, after obtaining the original data including each preset index interval and the index result corresponding to the index interval, the target binary tree data is constructed according to the interval endpoint value and the index result of each index interval. Since the constructed target binary tree data is a binary tree data with the median of the interval endpoint value of the index interval as the root node, each interval endpoint value less than the root node as the left subtree, each interval endpoint value greater than the root node as the right subtree, and the index result corresponding to each index interval as the leaf node, each index interval can be divided into binary tree structure data in an orderly manner, so as to facilitate the subsequent rapid determination of the index interval according to the target binary tree data, obtain the corresponding leaf node, and obtain the required index result, thereby realizing an orderly and efficient data storage method that is convenient for data search. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or descriptions of the prior art.

[0051] Figure 1 It is a schematic diagram of an implementation flow of a data processing method provided in an embodiment of the present application;

[0052] Figure 2 is an example diagram of target binary tree data provided by an embodiment of the present application;

[0053] Figure 3 is an example diagram of a first binary tree data provided in an embodiment of the present application;

[0054] Figure 4 is an example diagram of second binary tree data provided in an embodiment of the present application;

[0055] Figure 5 is a schematic diagram of a data processing device provided in an embodiment of the present application;

[0056] Figure 6 It is a schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0057] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0058] In order to illustrate the technical solution described in this application, a specific embodiment is provided below for illustration.

[0059] It should be understood that when used in this specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.

[0060] It should also be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0061] It should be further understood that the term “and / or” used in the specification and appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0062] As used in this specification and the appended claims, the term "if" may be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrases "if it is determined" or "if [described condition or event] is detected" may be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.

[0063] In addition, in the description of the present application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0064] At present, when storing each pair of associated data consisting of an index interval and an index result, it is usually stored in an unordered manner, or each pair of associated data is stored in order from the smallest to the largest interval endpoint value of the index interval. This storage method results in the need to traverse each pair of associated data in sequence during subsequent data search until the corresponding index interval is found and the corresponding index result is obtained. When the amount of associated data is large, this storage method will lead to a complicated data search process and low efficiency. In order to solve this technical problem, an embodiment of the present application provides a data processing method, device, electronic device and storage medium. After obtaining the original data including each preset index interval and the index result corresponding to the index interval, the target binary tree data is constructed according to the interval endpoint value and index result of each index interval. Since the target binary tree data constructed is a binary tree data with the median of the interval endpoint values ​​of the index interval as the root node, each interval endpoint value smaller than the root node as the left subtree, each interval endpoint value greater than the root node as the right subtree, and the index results corresponding to each index interval as the leaf node, each index interval can be orderly divided into binary tree structure data, so that the index interval can be quickly determined according to the target binary tree data, the corresponding leaf node can be obtained, and the required index result can be obtained, thereby realizing an orderly and efficient data storage method that is easy to find data.

[0065] Embodiment 1:

[0066] Figure 1 A flow chart of a data processing method provided by an embodiment of the present application is shown, which is described in detail as follows:

[0067] In S101, original data is obtained, where the original data includes each preset index interval and index results corresponding to the index interval.

[0068] In the embodiment of the present application, the preset index interval, that is, the preset numerical range as the index condition, each preset index interval has a corresponding index result, and the index result can be any one or more data forms such as a numerical value, a numerical range (for example, 0.1 to 0.2), a string, a string range (for example, AA to AZ), an object pointer, a picture, etc. Exemplarily, each preset index interval can be a numerical range of age, and the index result can be the corresponding standard blood pressure value. For example, if the standard blood pressure value corresponding to 26 years old and 30 years old is 115 mmHg, and the standard blood pressure value corresponding to 30 years old and 35 years old is 117 mmHg, then "26 to 30" can be used as an index interval, and the value "115" can be used as the index result corresponding to the index interval; and "30 to 35" can be used as another index interval, and the value "117" can be used as the index result corresponding to the index interval. Exemplarily, each preset index interval can be a numerical range of blood pressure, and the index result is the blood pressure type; when the blood pressure is in the range of 115 to 130, it belongs to the normal blood pressure type, and when the blood pressure is in the range of 130 to 139, it belongs to the normal high blood pressure type. Then "115 to 130" can be used as an index interval, and the character string "normal blood pressure" can be used as the index result corresponding to the index interval; and, "130 to 139" can be used as another index interval, and the character string "normal high blood pressure" can be used as the corresponding index result.

[0069] The original data in the embodiment of the present application is data including each preset index interval and the index results stored corresponding to each index interval. In one embodiment, the original data can be data in the Extensible Markup Language (XML) format, as shown below:

[0070] <row>

[0071] <min> 27< / min>

[0072] <max> 30< / max>

[0073] <value> -0.12< / value>

[0074] < / row>

[0075] <row>

[0076] <min> 30< / min>

[0077] <max> 38< / max>

[0078] <value> -0.07< / value>

[0079] < / row>

[0080] <row>

[0081] <min> 38< / min>

[0082] <max> 49< / max>

[0083] <value> -0.03< / value>

[0084] < / row>

[0085] <row>

[0086] <min> 49< / min>

[0087] <max> 55< / max>

[0088] <value> 0.02< / value>

[0089] < / row>

[0090] <row>

[0091] <min> 55< / min>

[0092] <max> 63< / max>

[0093] <value> 0.05< / value>

[0094] < / row>

[0095] <row>

[0096] <min> 63< / min>

[0097] <max> 80< / max>

[0098] <value> 0.10< / value>

[0099] < / row>

[0100] Among them, a pair <row>A tag encapsulates a pair of associated data, where the tag <min>Used to encapsulate the minimum value of the index interval (that is, the left interval endpoint value of the index interval), label <max>Used to encapsulate the maximum value of the index interval (that is, the right interval endpoint value of the index interval), label <value>Used to encapsulate the index result corresponding to the index interval. For example, the first <row>The tag encapsulates the associated data with the index interval "27-30" and the corresponding index result "-0.12". You can obtain the preset XML file, parse the XML formatted associated data contained in the XML file, and obtain each index interval and the corresponding index result. Usually, after obtaining the original data in XML format, it is stored in a table in a sequential manner, as shown in the following table:

[0101] Table 1:

[0102]

[0103]

[0104] The above-mentioned storage method according to the table results in that each index interval needs to be traversed in order when searching for data later, resulting in low data query efficiency. In the embodiment of the present application, after obtaining the above-mentioned original data, the original data is not stored in the form of a table, but the storage of the original data is realized by the following step S102.

[0105] In S102, target binary tree data are constructed based on the interval endpoint values ​​of each index interval and the index results; wherein the target binary tree data is binary tree data with the median of the interval endpoint values ​​as the root node, and the left subtree of the target binary tree data includes each interval endpoint value that is smaller than the root node, the right subtree of the target binary tree data includes each interval endpoint value that is larger than the root node, and each leaf node of the target binary tree data is the index result corresponding to each index interval.

[0106] In the embodiment of the present application, after obtaining the original data and parsing the various index intervals and index results contained in the original data, the target binary tree data is constructed according to the interval endpoint values ​​and index results corresponding to each index interval, so as to realize the corresponding storage of the index intervals and index results in the original data. The target binary tree data specifically uses the median of all interval endpoint values ​​as the root node, each interval endpoint value less than the root node as the node of the left subtree, and each interval endpoint value greater than the root node as the node of the right subtree, so that each index interval is divided into two parts to facilitate subsequent comparison and search. In addition, the leaf node of the target binary tree is the index result corresponding to the index interval, so that when the target binary tree data is finally reached by searching the target binary tree data, the corresponding index result is just obtained. Specifically, the interval endpoint value with the largest value in the left subtree of the target binary tree and the interval endpoint value with the smallest value in the right subtree of the target binary tree are also connected to the above-mentioned median to facilitate the complete positioning of the index interval. For example, in the original data in XML format of the above example, after deduplication, the interval endpoint values ​​include 7 values: 27, 30, 38, 49, 55, 63, and 80, and the corresponding interval endpoint value median is 49. Therefore, 49 is used as the root node, and the interval endpoint values ​​less than 49: 27, 30, and 38 are used as nodes of the left subtree, and the interval endpoint values ​​greater than 49: 55, 63, and 80 are used as nodes of the right subtree, and the following is obtained: Figure 2 The target binary tree data is shown.

[0107] Optionally, the above step S102 specifically includes:

[0108] A1: obtaining an interval endpoint array according to the interval endpoint values ​​of each of the index intervals; the interval endpoint array includes each of the interval endpoint values ​​arranged in order;

[0109] A2: Divide the interval endpoint array into at least two ordered sub-arrays according to the binary search method, and construct a first binary tree data; wherein each node of the first binary tree data corresponds one-to-one to each interval endpoint value of the interval endpoint array, and the first binary tree data uses the median in the interval endpoint array as a root node, uses a sub-array smaller than the root node as a left sub-tree, and uses a sub-array larger than the root node as a right sub-tree;

[0110] A3: According to the root node of the first binary tree data, a right child node is added to the node with the largest value in the left subtree, and a left child node is added to the node with the smallest value in the right subtree, to obtain a second binary tree data;

[0111] A4: Determine a node to be processed in the second binary tree data, where the node to be processed is a node that has at most one child node in the second binary tree data;

[0112] A5: Add corresponding index results to each of the nodes to be processed as leaf nodes to obtain target binary tree data.

[0113] In step A1, the original data is parsed to obtain the interval endpoint values ​​of each index interval in the original data, and the interval endpoint values ​​are removed and stored in an array. After that, the array is sorted to obtain an interval endpoint array, which is an array composed of each interval endpoint value arranged in order. Exemplarily, after removing and sorting the interval endpoint values ​​of each index interval in the original data in the XML format of the above example, the interval endpoint array obtained is: [27 30 3849 55 63 80].

[0114] In step A2, the interval endpoint array of step A1 is divided into a plurality of ordered sub-arrays, and the first binary tree data is constructed based on the interval endpoint array and these sub-arrays. Specifically, the median of the interval endpoint array is obtained, and the interval endpoint values ​​in the interval endpoint array that are less than the median are sequentially combined to obtain the first sub-array, and the interval endpoint values ​​that are greater than the median are sequentially combined to obtain the second sub-array. Afterwards, the first binary tree data is constructed with the interval endpoint array as the root node, the first sub-array as the left sub-tree, and the second sub-array as the right sub-tree. Among them, the left sub-tree of the first binary tree data specifically uses the median of the first sub-array as the root node of the left sub-tree, that is, as the left child node of the root node of the first binary tree data, so as to realize the connection between the left sub-tree and the root node of the first binary tree data; the right sub-tree of the first binary tree data specifically uses the median of the second sub-array as the root node of the right sub-tree, that is, as the right child node of the root node of the first binary tree data, so as to realize the connection between the right sub-tree and the root node of the first binary tree data.

[0115] Specifically, the step A2 includes:

[0116] Taking the interval endpoint array as the first-level array, bisection the interval endpoint array level by level according to the bisection method to obtain a target array set composed of the first-level array and each sub-array in order level by level;

[0117] For each level of array in the target array set, the median of the array is used as the root node, the left subtree is composed of the endpoint values ​​of the intervals in the array that are less than the median, and the right subtree is composed of the endpoint values ​​of the intervals in the array that are greater than the median, and each layer of binary tree data is constructed step by step until each array in the target array set has been constructed into binary tree data of the corresponding level, and the first binary tree data is obtained.

[0118] In the embodiment of the present application, the interval endpoint array is taken as the first-level array, and the interval endpoint array is divided into two levels by the binary method. Specifically, the median in the interval endpoint array is used as the dividing point to divide the interval endpoint array into two second-level arrays; if for each second-level array, if the number of interval endpoint values ​​contained in the second-level array is greater than 4, then the second-level array is further divided into a third-level array. Similarly, if the number of interval endpoint values ​​contained in the third-level array is greater than 4, it can be further divided into a fourth-level array. By analogy, the interval endpoint array is divided into sub-arrays of various levels, wherein the number of interval endpoint values ​​contained in the last-level sub-array is 3 or 4. The interval endpoint array is taken as the first-level array, and each sub-array is taken as an array of various levels, and they are combined in sequence to obtain a target array set containing arrays of various levels.

[0119] For each level of array in each target array set, i.e., the first level array (interval endpoint array) and each sub-array corresponding to the first level array, the median of the array is used as the root node, the interval endpoint value in the array that is less than the median is used as the left subtree, and the interval endpoint value in the array that is greater than the median is used as the right subtree, and each layer of binary tree data is constructed level by level. When each array in the target array set is constructed as the binary tree data of the corresponding level, i.e., the last level sub-array is constructed as the last level sub-tree, the first binary tree data is obtained. In the first binary tree data thus constructed, the median of the interval endpoint array is the root node of the entire first binary tree data, which can also be called the root node of the first-level data of the first binary tree data, and the medians of the sub-arrays into which the interval endpoint array is divided are the root nodes corresponding to the sub-trees at each level of the first binary tree data, respectively. In addition, for the root node of the next-level subtree, the left subtree (composed of the interval endpoint values ​​smaller than the root node) and the right subtree (composed of the interval endpoint values ​​greater than the root node) corresponding to the root node can be obtained based on the size relationship between the interval endpoint value and the root node.

[0120] For example, the median of the above interval endpoint array [27 30 38 49 55 63 80] is 49. According to the median, the interval endpoint array is divided into the second-level sub-arrays: [27 30 38] and [55 63 80]. Then, the median "49" of the interval endpoint array is used as the root node of the entire binary tree data, the interval endpoint values ​​of the array [27 30 38] form the left subtree, and the interval endpoint values ​​of the array [55 63 80] form the right subtree, and the following is obtained: Figure 3 The first binary tree data is shown. Among them, the root node of the left subtree itself is the median "30" of the array [27 30 38]. The median also subdivides the left subtree into the left part "27" less than "30", and the right part "38" greater than "30". Similarly, the root node of the right subtree itself is the median "63" of the array [55 63 80]. By analogy, when the number of interval endpoint values ​​contained in the subarray is greater than 4, the median of the subarray can be determined, and more subarrays can be obtained by binary division, and the next level of subtree can be constructed accordingly.

[0121] In step A3, after obtaining the first binary tree data, the root node of the first binary tree data, that is, the median of the interval endpoint array, is added to the right child node of the node with the largest value in the left subtree, and to the left child node of the node with the smallest value in the right subtree, to obtain the second binary tree data, so that the second binary tree data can cover all index intervals in series. For example, based on Figure 4 The first binary tree data, the node with the largest value in its left subtree, that is, the node closest to the right is node "38", add a right child node to this node, and the right child node is equal to the value of the root node "49"; Figure 3 The node with the smallest value in the right subtree of the first binary tree data, that is, the node closest to the left is node "55", and a left child node is added to the node, and the left child node is equal to the value of the root node "49", so that the following is obtained: Figure 4 The second binary tree data is shown.

[0122] In step A4, after obtaining the second binary tree data that can completely cover all index intervals in series, add the index result as a leaf node to the second binary tree data, so as to obtain the target binary tree data that can completely express the index interval and its corresponding index result. Specifically, determine the nodes that have at most one child node from the second binary tree data (that is, either the left or right child nodes of the node is empty or both the left and right child nodes of the node are empty), and refer to such nodes as nodes to be processed, and the nodes to be processed are nodes to which the corresponding index results can be added. Specifically, for each node to be processed, determine that the node to be processed and the surrounding nodes together form an index interval based on its specific position in the second binary tree data, and then determine the index result corresponding to the index interval from the original data as the index result of the current node to be processed, and use the index result as the leaf node of the node to be processed and connect it to the node to be processed. Exemplarily, as Figure 4 In the second binary tree data shown, node "27" does not have any child node, that is, the node meets the condition of "at most one child node", so node "27" is used as a node to be processed; according to the node "27" to be processed and the node "30" connected to it, the index interval corresponding to the node to be processed is determined to be "27-30", and according to the index interval, the original data is queried to obtain the corresponding index result "-0.12", and the index result is connected to the node to be processed as a child node of the node to be processed. Figure 4 The nodes to be processed shown also include node "38", node "55", node "80" and two nodes "49" in the left and right subtrees. For these nodes to be processed, the corresponding index intervals are also found, and the corresponding index results are determined as leaf nodes and connected to the nodes to be processed. When all the nodes to be processed are added with the corresponding leaf nodes, the following can be obtained: Figure 2 The target binary tree data is shown.

[0123] In the embodiment of the present application, since the preliminary first binary tree data can be constructed through array arrangement and binary division, and the second binary tree data that can cover all index intervals in series is supplemented based on the first binary tree data, and the index results are added to the second binary tree data as leaf nodes, the target binary tree data that can fully describe each index interval and its corresponding index results can be gradually and accurately constructed.

[0124] Optionally, if the interval endpoint array contains an even number of interval endpoint values, any one of the two middle interval endpoint values ​​in the interval endpoint array is used as the root node of the first binary tree data.

[0125] In an embodiment of the present application, when the number of interval endpoint values ​​contained in the above-mentioned interval endpoint array is an even number, if the general median method is used at this time, the median obtained is the average of the two middle interval endpoint values, and this average cannot be used as data that can reflect the complete index interval. Therefore, this average is not suitable as a node of binary tree data. At this time, the two middle interval endpoint values ​​in the interval endpoint array can be specifically located, and any one of these two interval endpoint values ​​can be used as the current median, that is, as the root node of the current first binary tree data, so that the constructed first binary tree data can correspond to the actual index interval. Exemplarily, if the interval endpoint array is: [27 3038 55 63 80], then "38" or "55" can be used as the root node of the first binary tree data.

[0126] Optionally, after obtaining the original data, the method further includes:

[0127] For each index interval, determining corresponding endpoint types for two interval endpoint values ​​of the index interval respectively, and associating the interval endpoint value, the endpoint type and the index result corresponding to the index interval and storing them in a multi-mapping container;

[0128] Correspondingly, adding a corresponding index result as a leaf node for each of the nodes to be processed to obtain target binary tree data includes:

[0129] For each of the nodes to be processed, determining the index result and the position to be connected of the node to be processed according to the connection relationship between the node to be processed and the parent node of the node to be processed and the multi-mapping container;

[0130] The index result of the node to be processed is used as a leaf node, and the leaf node is connected to the to-be-connected position of the node to be processed to obtain target binary tree data.

[0131] In the embodiment of the present application, for each index interval, two interval endpoint values ​​are included: a left interval endpoint value with an endpoint type of "minimum value", and a right interval endpoint value with an endpoint type of "maximum value". When each index interval in the original data is an interval with continuous values, there are the same interval endpoint values ​​corresponding to different endpoint types between two adjacent index intervals. Therefore, the embodiment of the present application can specifically store the association relationship between interval endpoint values, endpoint types of interval endpoint values ​​and their corresponding index results through a multimap container that allows storage of repeated elements. The multimap container can specifically use the interval endpoint value as the key value of the multimap, and use the endpoint type of the interval endpoint value and the index result corresponding to the index interval when the interval endpoint value is the endpoint type to form value data containing two elements, thereby realizing the associated storage of interval endpoint values, endpoint types of interval endpoint values ​​and corresponding index results. Exemplarily, the specific storage situation of the original data of the above example in the multimap container can be shown in Table 2:

[0132] Table 2:

[0133]

[0134] Among them, for each key value, there are two rows of value values. The first row of value values ​​is the index result, and the second row of value values ​​is the endpoint type, where "0" represents the "minimum value" type and "1" represents the "maximum value" type.

[0135] Correspondingly, in the subsequent step A4, for each node to be processed, the current endpoint type of the node to be processed and its to-be-connected position can be determined based on the connection relationship between the node to be processed and the parent node of the node to be processed. The to-be-connected position is the position where the node to be processed needs to connect to the leaf node. Among them, if the node to be processed is connected to the left side of its parent node, that is, the node to be processed belongs to the left child node corresponding to its parent node, the current endpoint type of the node to be processed is determined to be "minimum value", and the corresponding to-be-connected position that needs to connect to the leaf node is the right side; on the contrary, if the node to be processed is connected to the right side of its parent node, that is, the node to be processed belongs to the right child node corresponding to its parent node, the current endpoint type of the node to be processed is determined to be "maximum value", and the corresponding to-be-connected position that needs to connect to the leaf node is the left side. Afterwards, according to the endpoint type and the value of the node to be processed, the above-mentioned multi-mapping container multimap is queried to obtain the index result corresponding to the node to be processed. Exemplarily, as Figure 4 In the second binary tree data shown, the node to be processed "27" is connected to the left side of its parent node "30", that is, the node to be connected is the left child node of the parent node "30", then it can be determined that the endpoint type of the node to be processed "27" is "minimum value", and its corresponding position to be connected is the right side. After determining the endpoint type of the node to be processed "27", the multimap container multimap shown in Table 2 is queried according to the corresponding relationship of the value "27" and the endpoint type "minimum value", and the index result "-0.12" corresponding to the node to be processed is obtained.

[0136] For each node to be processed, after determining its corresponding index result and the position to be connected, the index result can be used as the leaf node of the node to be processed and connected to the position to be connected of the node to be processed, thereby obtaining the target binary tree data that includes both the endpoint values ​​of each interval of the index interval and the index result.

[0137] In an embodiment of the present application, since there are repeated interval endpoint values ​​for each continuous index interval, it is possible to accurately implement the storage of interval endpoint values ​​of different index intervals and their corresponding index results by distinguishing the endpoint types of the interval endpoint values ​​and by supporting repeated elements to save the multi-mapping container multimap, so that the corresponding leaf nodes can be accurately and effectively added to the nodes to be processed according to the multi-mapping container to obtain accurate target binary tree data.

[0138] Optionally, after the above step S102, the method further includes:

[0139] Get the input index value;

[0140] According to the index value and the target binary tree data, an index result corresponding to the index value is searched.

[0141] In the embodiment of the present application, the index value is a numerical value input by the user for searching for the corresponding index result. Exemplarily, the index value input by the user is obtained by receiving a touch command, a keyboard input command or a voice input command from the user.

[0142] After obtaining the index value, the target binary tree data with the median as the root node constructed above can be searched according to the index value. The index direction can be determined by comparing the index value with the root node and each parent node of the target binary tree data. The search is then performed level by level according to the determined index direction until a leaf node is found. The value of the leaf node is used as the index result corresponding to the index value.

[0143] In the embodiment of the present application, after obtaining the input index value, the index interval is quickly determined through the target binary tree constructed as above, the corresponding leaf node is obtained, and the required index result is obtained, thereby improving data query efficiency.

[0144] Optionally, searching for an index result corresponding to the index value according to the index value and the target binary tree data includes:

[0145] Determine a target subtree according to a comparison result between the index value and the root node of the target binary tree data; the target subtree includes a left subtree or a right subtree corresponding to the root node;

[0146] According to the index value and the target subtree, the target index interval is determined, and the leaf node corresponding to the interval endpoint value of the target index interval is obtained to obtain the index result corresponding to the index value; wherein the target index interval is the index interval where the index value is located.

[0147] In an embodiment of the present application, after obtaining the index value, the target subtree is determined specifically based on the comparison result between the index value and the root node of the target binary tree data. The target subtree is the left subtree or the right subtree corresponding to the root node. Specifically, if the index value is less than the root node of the target binary tree, the left subtree corresponding to the root node is determined as the target subtree. If the index value is greater than the root node of the target binary tree, the right subtree corresponding to the root node is determined as the target subtree.

[0148] After the target subtree is determined, the index node is also compared with the root node of the target subtree to determine the index direction of the next level, that is, to determine whether the subtree to be searched next is the left subtree or the right subtree of the target subtree, and so on, until the index interval corresponding to the index value, that is, the target index interval, is found, and the value of the leaf node corresponding to the endpoint value of the target index interval is obtained, and the index result corresponding to the current index value can be obtained. Specifically, when the node with a leaf node (called the target node) is found by comparing the index value level by level, the target node and the parent node of the target node can be used to determine the current target index interval, and the value of the leaf node corresponding to the target node is used as the index result.

[0149] For example, Figure 2 The binary tree data shown is used as the target binary tree data to illustrate the above search process:

[0150] After obtaining the currently input index value "28", the index value "28" is first compared with the root node "49" of the target binary tree data. The comparison result is that 28 is less than 49, so the left subtree corresponding to the root node "49" is used as the target subtree for search; when searching the target subtree, the index value "28" is continued to be compared with the root node "30" of the target subtree. The comparison result is that 28 is less than 30, so the search continues to the left subtree corresponding to the root node "30", and the node "27" with a leaf node is found at this time; because "28" is greater than "27", the target index interval corresponding to the index value is determined to be "27~30", and the leaf node "-0.12" connected to the node "27" is obtained, and the final index result corresponding to the index value is "-0.12".

[0151] In an embodiment of the present application, since it is possible to accurately determine the target subtree based on the comparison result between the index value and the root node of the target binary tree data, narrow the search range, quickly determine the index interval corresponding to the index value, and obtain the corresponding leaf node as the index result, the data query efficiency can be improved.

[0152] Optionally, the above data processing method is specifically applied to a four-wheel aligner, the index interval is a height interval of the wheels of the vehicle, and the index result is a standard value of a parameter corresponding to the wheel.

[0153] In the embodiment of the present application, the four-wheel aligner often needs to find the corresponding height interval according to the input wheel height value, and determine the standard value of the parameter corresponding to the height interval. Therefore, in the four-wheel aligner, the wheel height interval can be used as the index interval, and the corresponding parameter standard value can be used as the index result. The target binary tree data is constructed by the data processing method of the embodiment of the present application to realize the corresponding storage of the wheel height interval and the standard value of its parameter, and the standard value of the parameter is efficiently and accurately searched through the target binary tree data, thereby improving the working efficiency of the four-wheel aligner. Wherein, the wheels in the embodiment of the present application may include front wheels and rear wheels, and the parameters corresponding to the front wheels may include any one or more of the front wheel toe, front wheel caster, front wheel inclination, and front wheel camber, and the parameters corresponding to the rear wheels may include any one or more of the rear wheel toe, rear wheel caster, rear wheel inclination, and rear wheel camber. The above data processing method is realized by taking the height interval of the front wheel of the vehicle as the index interval and the standard value of the parameter of the front wheel as the index result; or taking the height interval of the rear wheel of the vehicle as the index interval and the standard value of the parameter of the rear wheel as the index result.

[0154] In the embodiment of the present application, after obtaining the original data including each preset index interval and the index result corresponding to the index interval, the target binary tree data is constructed according to the interval endpoint value and the index result of each index interval. Since the constructed target binary tree data is a binary tree data with the median of the interval endpoint value of the index interval as the root node, each interval endpoint value less than the root node as the left subtree, each interval endpoint value greater than the root node as the right subtree, and the index result corresponding to each index interval as the leaf node, each index interval can be divided into binary tree structure data in an orderly manner, so as to facilitate the subsequent rapid determination of the index interval according to the target binary tree data, obtain the corresponding leaf node, and obtain the required index result, thereby realizing an orderly and efficient data storage method that is convenient for data search.

[0155] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0156] Embodiment 2:

[0157] Figure 5 A schematic diagram of the structure of a data processing device provided in an embodiment of the present application is shown. For the sake of convenience, only the part related to the embodiment of the present application is shown:

[0158] The data processing device comprises: an original data acquisition unit 51 and a target binary tree data construction unit 52. Among them:

[0159] The original data acquisition unit 51 is used to acquire original data, where the original data includes each preset index interval and an index result corresponding to the index interval.

[0160] The target binary tree data construction unit 52 is used to construct the target binary tree data according to the interval endpoint values ​​of each index interval and the index results; wherein the target binary tree data is the binary tree data with the median of the interval endpoint values ​​as the root node, and the left subtree of the target binary tree data includes each interval endpoint value less than the root node, the right subtree of the target binary tree data includes each interval endpoint value greater than the root node, and each leaf node of the target binary tree data is the index result corresponding to each index interval.

[0161] Optionally, the target binary tree data construction unit 52 includes an array determination module, a first binary tree data construction module, a second binary tree data construction module and a target binary tree data construction module:

[0162] An array determination module, configured to obtain an interval endpoint array according to the interval endpoint values ​​of each of the index intervals; the interval endpoint array includes each of the interval endpoint values ​​arranged in order;

[0163] A first binary tree data construction module is used to divide the interval endpoint array into at least two ordered sub-arrays according to the binary method, and construct a first binary tree data; wherein each node of the first binary tree data corresponds to each interval endpoint value of the interval endpoint array one by one, and the first binary tree data uses the median in the interval endpoint array as a root node, uses a sub-array smaller than the root node as a left sub-tree, and uses a sub-array larger than the root node as a right sub-tree;

[0164] A second binary tree data construction module is used to add a right child node to the node with the largest value in the left subtree and add a left child node to the node with the smallest value in the right subtree according to the root node of the first binary tree data, so as to obtain second binary tree data;

[0165] The target binary tree data construction module is used to determine the nodes to be processed in the second binary tree data, and add the corresponding index results as leaf nodes for each of the nodes to be processed to obtain the target binary tree data; the nodes to be processed are nodes with at most one child node in the second binary tree data.

[0166] Optionally, if the interval endpoint array contains an even number of interval endpoint values, any one of the two middle interval endpoint values ​​in the interval endpoint array is used as the root node of the first binary tree data.

[0167] Optionally, the first binary tree data construction module is specifically used to use the interval endpoint array as the first-level array, and to binary divide the interval endpoint array level by level according to the binary search method to obtain a target array set composed of the first-level array and each sub-array in order level by level; for each level of array in the target array set, the median of the array is used as the root node, and the left subtree is composed of each interval endpoint value in the array that is less than the median, and the right subtree is composed of each interval endpoint value in the array that is greater than the median, and each layer of binary tree data is constructed level by level until each array in the target array set has been constructed as binary tree data of the corresponding level, and the first binary tree data is obtained.

[0168] Optionally, the data processing device further includes:

[0169] An associative storage unit, for determining, for each index interval, corresponding endpoint types for two interval endpoint values ​​of the index interval, and associatively storing the interval endpoint value, the endpoint type and the index result corresponding to the index interval in a multi-mapping container;

[0170] Correspondingly, the target binary tree data construction module is used to determine the index result and the position to be connected of each node to be processed according to the connection relationship between the node to be processed and the parent node of the node to be processed and the multi-mapping container; use the index result of the node to be processed as a leaf node, and connect the leaf node to the position to be connected of the node to be processed to obtain the target binary tree data.

[0171] Optionally, the data processing device further includes:

[0172] An index value obtaining unit, which obtains an input index value;

[0173] A search unit is used to search for an index result corresponding to the index value according to the index value and the target binary tree data.

[0174] Optionally, the search unit is specifically used to determine the target subtree based on the comparison result of the index value and the root node of the target binary tree data; the target subtree includes the left subtree or the right subtree corresponding to the root node; according to the index value and the target subtree, the target index interval is determined, and the leaf node corresponding to the interval endpoint value of the target index interval is obtained to obtain the index result corresponding to the index value; wherein, the target index interval is the index interval where the index value is located.

[0175] Optionally, the data processing device is specifically applied to a four-wheel aligner, the index interval is a height interval of a wheel of a vehicle, and the index result is a standard value of a parameter corresponding to the wheel.

[0176] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0177] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0178] Embodiment three:

[0179] Figure 6 is a schematic diagram of an electronic device provided by an embodiment of the present application. Figure 6 As shown, the electronic device 6 of this embodiment includes: a processor 60, a memory 61, and a computer program 62 stored in the memory 61 and executable on the processor 60, such as a data processing program. When the processor 60 executes the computer program 62, the steps in the above-mentioned data processing method embodiments are implemented, such as Figure 1 Alternatively, when the processor 60 executes the computer program 62, the functions of each module / unit in the above-mentioned device embodiments are realized, for example Figure 5 The functions of the original data acquisition unit 51 to the target binary tree data construction unit 52 are shown.

[0180] Exemplarily, the computer program 62 may be divided into one or more modules / units, which are stored in the memory 61 and executed by the processor 60 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program 62 in the electronic device 6.

[0181] The electronic device 6 may be a four-wheel alignment device, a vehicle diagnostic device, a desktop computer, a notebook, a PDA, or other computing devices. The electronic device may include, but is not limited to, a processor 60 and a memory 61. Those skilled in the art will appreciate that Figure 6 It is only an example of the electronic device 6 and does not constitute a limitation of the electronic device 6. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device may also include input and output devices, network access devices, buses, etc.

[0182] The processor 60 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0183] The memory 61 may be an internal storage unit of the electronic device 6, such as a hard disk or memory of the electronic device 6. The memory 61 may also be an external storage device of the electronic device 6, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 6. Further, the memory 61 may also include both an internal storage unit and an external storage device of the electronic device 6. The memory 61 is used to store the computer program and other programs and data required by the electronic device. The memory 61 may also be used to temporarily store data that has been output or is to be output.

[0184] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0185] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0186] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

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

[0188] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

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

[0190] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0191] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.< / row> < / value> < / max> < / min> < / row>

Claims

1. A data processing method, characterized in that: The method is applied to a four-wheel aligner, comprising: Acquire original data, the original data including each preset index interval and an index result corresponding to the index interval; the index interval is a height interval of a wheel of a vehicle, and the index result is a standard value of a parameter corresponding to the wheel; According to the interval endpoint values ​​of each of the index intervals and the index results, target binary tree data are constructed; wherein the target binary tree data is binary tree data with the median of the interval endpoint values ​​as the root node, and the left subtree of the target binary tree data includes each of the interval endpoint values ​​that is smaller than the root node, the right subtree of the target binary tree data includes each of the interval endpoint values ​​that is larger than the root node, and each leaf node of the target binary tree data is the index result corresponding to each of the index intervals; The step of constructing target binary tree data according to the interval endpoint values ​​of each index interval and the index result includes: According to the interval endpoint values ​​of each of the index intervals, an interval endpoint array is obtained; the interval endpoint array includes each of the interval endpoint values ​​arranged in order; Divide the interval endpoint array into at least two ordered sub-arrays according to the binary search method, and construct a first binary tree data; wherein each node of the first binary tree data corresponds one-to-one to each interval endpoint value of the interval endpoint array, and the first binary tree data uses the median in the interval endpoint array as a root node, uses a sub-array smaller than the root node as a left sub-tree, and uses a sub-array larger than the root node as a right sub-tree; According to the root node of the first binary tree data, a right child node is added to the node with the largest value in the left subtree, and a left child node is added to the node with the smallest value in the right subtree, to obtain a second binary tree data; Determine the nodes to be processed in the second binary tree data, and add the corresponding index results as leaf nodes for each of the nodes to be processed to obtain target binary tree data; the nodes to be processed are nodes that have at most one child node in the second binary tree data; After obtaining the original data, the method further includes: For each index interval, determining corresponding endpoint types for two interval endpoint values ​​of the index interval respectively, and associating the interval endpoint value, the endpoint type and the index result corresponding to the index interval and storing them in a multi-mapping container; Correspondingly, adding a corresponding index result as a leaf node for each of the nodes to be processed to obtain target binary tree data includes: For each of the nodes to be processed, determining the index result and the position to be connected of the node to be processed according to the connection relationship between the node to be processed and the parent node of the node to be processed and the multi-mapping container; The index result of the node to be processed is used as a leaf node, and the leaf node is connected to the to-be-connected position of the node to be processed to obtain target binary tree data.

2. The data processing method according to claim 1, characterized in that: The step of dividing the interval endpoint array into at least two ordered sub-arrays according to the binary method and constructing the first binary tree data includes: Taking the interval endpoint array as the first-level array, bisection the interval endpoint array level by level according to the bisection method to obtain a target array set composed of the first-level array and each sub-array in order level by level; For each level of array in the target array set, the median of the array is used as the root node, the endpoint value of the interval in the array that is less than the median is used as the left subtree, and the endpoint value of the interval in the array that is greater than the median is used as the right subtree, and each layer of binary tree data is constructed step by step until each array in the target array set has been constructed as binary tree data of the corresponding level, thereby obtaining the first binary tree data.

3. The data processing method according to claim 1, characterized in that: After the target binary tree data is obtained by the construction, the method further includes: Get the input index value; According to the index value and the target binary tree data, an index result corresponding to the index value is searched.

4. The data processing method according to claim 3, characterized in that: The searching, according to the index value and the target binary tree data, for an index result corresponding to the index value includes: Determine a target subtree according to a comparison result between the index value and the root node of the target binary tree data; the target subtree includes a left subtree or a right subtree corresponding to the root node; According to the index value and the target subtree, the target index interval is determined, and the leaf node corresponding to the interval endpoint value of the target index interval is obtained to obtain the index result corresponding to the index value; wherein the target index interval is the index interval where the index value is located.

5. A data processing device, characterized in that: The device is applied to a four-wheel aligner, comprising: An original data acquisition unit, used to acquire original data, wherein the original data includes each preset index interval and an index result corresponding to the index interval; the index interval is a height interval of a wheel of a vehicle, and the index result is a standard value of a parameter corresponding to the wheel; A target binary tree data construction unit, used to construct target binary tree data according to the interval endpoint values ​​of each index interval and the index result; wherein the target binary tree data is binary tree data with the median of the interval endpoint values ​​as the root node, and the left subtree of the target binary tree data includes each interval endpoint value less than the root node, the right subtree of the target binary tree data includes each interval endpoint value greater than the root node, and each leaf node of the target binary tree data is the index result corresponding to each index interval respectively; The target binary tree data construction unit comprises: An array determination module, configured to obtain an interval endpoint array according to the interval endpoint values ​​of each of the index intervals; the interval endpoint array includes each of the interval endpoint values ​​arranged in order; A first binary tree data construction module is used to divide the interval endpoint array into at least two ordered sub-arrays according to the binary method, and construct a first binary tree data; wherein each node of the first binary tree data corresponds to each interval endpoint value of the interval endpoint array one by one, and the first binary tree data uses the median in the interval endpoint array as a root node, uses a sub-array smaller than the root node as a left sub-tree, and uses a sub-array larger than the root node as a right sub-tree; A second binary tree data construction module is used to add a right child node to the node with the largest value in the left subtree and add a left child node to the node with the smallest value in the right subtree according to the root node of the first binary tree data, so as to obtain second binary tree data; A target binary tree data construction module is used to determine the nodes to be processed in the second binary tree data, and add the corresponding index result as a leaf node for each of the nodes to be processed to obtain the target binary tree data; the nodes to be processed are nodes in the second binary tree data that have at most one child node; The data processing device further includes: An associative storage unit, for determining, for each index interval, corresponding endpoint types for two interval endpoint values ​​of the index interval, and associatively storing the interval endpoint value, the endpoint type and the index result corresponding to the index interval in a multi-mapping container; Correspondingly, the target binary tree data construction module is also used to: for each of the nodes to be processed, determine the index result and the position to be connected of the node to be processed according to the connection relationship between the node to be processed and the parent node of the node to be processed and the multi-mapping container; use the index result of the node to be processed as a leaf node, and connect the leaf node to the position to be connected of the node to be processed to obtain the target binary tree data.

6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the electronic device implements the steps of the method according to any one of claims 1 to 4.

7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the electronic device implements the steps of the method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • K-d (k-dimensional) tree generation method and k-d tree generation device

    CN105787126A

  • Data index searching method and device, and related equipment

    CN111984649A