A data query method and device, electronic equipment and storage medium
By obtaining the first and second query conditions in the query request, using vehicle characteristic data to determine the index range and selecting an appropriate indexing method, the problems of high memory consumption of hash queries and slow speed of binary search queries are solved, thus achieving efficient data querying.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-27
- Publication Date
- 2026-04-07
AI Technical Summary
Existing technologies for querying the energy consumption distribution ratio of the front and rear motors of a car require a large amount of memory for hash queries, while binary queries are less efficient, especially with large amounts of data.
By obtaining the first and second query conditions from the query request, the initial index value and the target index value are determined using vehicle characteristic data, the index range is narrowed, and either the binary search method or the sequential index method is selected for querying based on the relationship between the difference and the preset threshold.
Without increasing system resource consumption, it improves data query efficiency, reduces the search scope, and increases query speed.
Smart Images

Figure CN115687412B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of data query, and particularly relates to a data query method and device, electronic equipment and storage medium. BACKGROUND
[0002] In the prior art, the travel energy consumption of an automobile is generally calculated according to the motor characteristics of the automobile, and the motor characteristics of the automobile are related to the working efficiency of the motor. When the automobile is driven by front and rear motors to travel, the energy distribution ratio of the front and rear motors is different at different vehicle speeds and torques.
[0003] In the prior art, historical vehicle speeds and torques are sorted in ascending order of data and a two-dimensional table is constructed. When it is necessary to query the front and rear motor energy distribution ratio corresponding to a certain vehicle speed and torque to determine the travel energy of the automobile, a hash query or a binary query is used to query the front and rear motor distribution ratio corresponding to a certain vehicle speed and torque. Although the hash query is efficient, it requires additional memory space, especially when the table data is large, a large amount of memory space is consumed. For large data, the binary query needs to query each data in turn, and each query starts from the whole and is divided into two parts, so the query speed is slow. SUMMARY
[0004] To solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a data query method, device, electronic equipment and storage medium, which improves the data query efficiency.
[0005] In a first aspect, the embodiments of the present disclosure provide a data query method, comprising:
[0006] The data query method comprises:
[0007] A query request is obtained, the query request comprising a first query condition and a query target, wherein the first query condition comprises a first vehicle speed and a first torque;
[0008] A second query request is determined according to the query target, the second query request comprising a second query condition, wherein the second query condition comprises a second vehicle speed and a second torque, and the second query request is a query request at a previous time corresponding to the query request;
[0009] A query result is determined according to the second query condition and the first query condition in the query request.
[0010] Optionally, the query result is determined according to the second query condition and the first query condition in the query request, comprising:
[0011] An initial index value corresponding to the first query condition is obtained;
[0012] determining a target index value according to the first query condition, the second query condition and vehicle characteristic data, wherein the vehicle characteristic data comprises vehicle speed characteristic data and torque characteristic data;
[0013] determining an index range according to the initial index value and the target index value;
[0014] querying a query result corresponding to the first query condition in the index range.
[0015] Optionally, the initial index value comprises a first vehicle speed initial index value and a first torque initial index value.
[0016] The obtaining of the initial index value corresponding to the first query condition comprises:
[0017] obtaining a first vehicle speed initial index value corresponding to the first vehicle speed;
[0018] obtaining a first torque initial index value corresponding to the first torque.
[0019] Optionally, the target index value comprises a first vehicle speed target index value and a first torque target index value.
[0020] The determining of the target index value according to the first query condition, the second query condition and the vehicle characteristic data comprises:
[0021] determining a first vehicle speed target index value according to the first vehicle speed, the second vehicle speed and the vehicle speed characteristic data;
[0022] determining a first torque target index value according to the first torque, the second torque and the torque characteristic data.
[0023] Optionally, the determining of the index range according to the initial index value and the target index value comprises:
[0024] when the initial index value is greater than the target index value, the index range is from the target index value to the initial index value;
[0025] when the initial index value is less than the target index value, the index range is from the initial index value to the target index value.
[0026] Optionally, the index range comprises a vehicle speed index range and a torque index range.
[0027] when the first vehicle speed initial index value is greater than the first vehicle speed target index value, the vehicle speed index range is from the first vehicle speed target index value to the first vehicle speed initial index value;
[0028] When the first torque initial index value is greater than the first torque target index value, the torque index range is from the first torque target index value to the first torque initial index value;
[0029] When the first vehicle speed initial index value is less than the first vehicle speed target index value, the vehicle speed index range is from the first vehicle speed initial index value to the first vehicle speed target index value.
[0030] When the first torque initial index value is less than the first torque target index value, the torque index range is from the first torque initial index value to the first torque target index value.
[0031] Optionally, the querying the query result corresponding to the first query condition in the index range comprises:
[0032] querying a first vehicle speed index value corresponding to the first vehicle speed in the vehicle speed index range;
[0033] querying a first torque index value corresponding to the first torque in the torque index range;
[0034] determining the query result according to the first vehicle speed index value and the first torque index value.
[0035] Optionally, after the determining the index range according to the initial index value and the target index value, the method further comprises:
[0036] determining the index method according to a relationship between a difference between the second query condition and the first query condition and a preset threshold.
[0037] Optionally, the determining the index method according to the relationship between the difference between the second query condition and the first query condition and the preset threshold comprises:
[0038] determining a second vehicle speed index method according to a relationship between a difference between the second vehicle speed and the first vehicle speed and a first preset threshold;
[0039] determining a second torque index method according to a relationship between a difference between the second torque and the first torque and a second preset threshold.
[0040] Optionally, the determining the first vehicle speed index method according to the relationship between the difference between the second vehicle speed and the first vehicle speed and the first preset threshold comprises:
[0041] when the difference between the second vehicle speed and the first vehicle speed is greater than or equal to the first preset threshold, the first vehicle speed index method is a dichotomy index;
[0042] when the difference between the second vehicle speed and the first vehicle speed is less than the first preset threshold, the first vehicle speed index method is a sequential index.
[0043] Optionally, the method for determining the first torque index according to the relationship between the difference between the second torque and the first torque and the second preset threshold value comprises:
[0044] When the difference between the second torque and the first torque is greater than or equal to the second preset threshold value, the first torque index method is a dichotomy index.
[0045] When the difference between the second torque and the first torque is less than the second preset threshold value, the first torque index method is a sequential index.
[0046] In a second aspect, the embodiments of the present disclosure provide a data query device, comprising:
[0047] A query request acquisition module is configured to acquire a query request, wherein the query request comprises a first query condition and a query target.
[0048] A query request determination module is configured to determine a second query request according to the query target, wherein the second query request comprises a second query condition, the second query condition comprises a second vehicle speed and a second torque, and the second query request is a query request at a previous moment corresponding to the query request.
[0049] A query module is configured to determine a query result according to the second query condition and the first query condition in the query request.
[0050] In a third aspect, the embodiments of the present disclosure provide an electronic device, comprising:
[0051] One or more processors;
[0052] A storage device configured to store one or more programs,
[0053] When the one or more programs are executed by the one or more processors, the one or more processors implement the data query method according to any one of the first aspect.
[0054] In a fourth aspect, the embodiments of the present disclosure provide a computer readable storage medium having a computer program stored thereon, wherein the program is executed by a processor to implement the data query method according to any one of the first aspect.
[0055] The technical solutions provided by the embodiments of the present disclosure have the following advantages compared with the prior art:
[0056] The data query method, device, electronic device and storage medium provided by the embodiments of the present disclosure first acquire a query request, determine a second query request according to a query target corresponding to the query request, and determine a query result according to a second query condition and a first query condition in the query request, thereby reducing the data search range, reducing system resource consumption, and improving data query efficiency. BRIEF DESCRIPTION OF DRAWINGS
[0057] The accompanying drawings, which are incorporated herein and constitute a part of the specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0058] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the accompanying drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, for those skilled in the art, other drawings can also be obtained without creative labor based on these drawings.
[0059] Figure 1 is a flow diagram of a data query method provided by an embodiment of the present disclosure;
[0060] Figure 2 is a flow diagram of another data query method provided by an embodiment of the present disclosure;
[0061] Figure 3 is a flow diagram of another data query method provided by an embodiment of the present disclosure;
[0062] Figure 4 is a flow diagram of another data query method provided by an embodiment of the present disclosure;
[0063] Figure 5 is a structural diagram of a data query device provided by an embodiment of the present disclosure;
[0064] Figure 6 is a structural diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0065] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the accompanying drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, for those skilled in the art, other drawings can also be obtained without creative labor based on these drawings.
[0066] In the following description, many specific details are set forth in order to provide a thorough understanding of the present disclosure, but the present disclosure can also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only some embodiments of the present disclosure, not all embodiments.
[0067] Exemplarily, the present disclosure provides a data query method, device, electronic equipment and storage medium. The first query condition corresponding to the first query operation triggered by the user is obtained, and the first query object is queried according to the first query condition. When the second query operation is triggered by the user, the second query object is queried according to the relationship between the second query condition and the first query condition and the vehicle characteristic data. The data query efficiency is improved without increasing the system resource consumption.
[0068] The data query method of the present disclosure is executed by an electronic equipment or an application program, a webpage, a public account, etc. in the electronic equipment. The electronic equipment can be a tablet computer, a mobile phone, a wearable device, a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), a smart television, a smart screen, a high-definition television, a 4K television, a smart speaker, a smart projector, etc. The present disclosure does not make any limitation on the specific type of the electronic equipment.
[0069] The present disclosure does not make any limitation on the type of the operating system of the electronic equipment. For example, the Android system, the Linux system, the Windows system, the iOS system, etc.
[0070] Based on the foregoing description, the present disclosure will be described in detail in the embodiments taking the electronic equipment as an example in combination with the application scenarios.
[0071] As shown in Figure 1 The data query method comprises:
[0072] S10, obtaining a query request, the query request comprising a first query condition and a query target.
[0073] The first query condition comprises a first vehicle speed and a first torque.
[0074] After obtaining the query request triggered by the user, the first query condition and the query target corresponding to the query request are obtained.
[0075] Exemplarily, in the first query condition, the first vehicle speed is 20 km / h, the first torque is 150 N·m, and the query target is the front-rear motor energy distribution ratio in the car corresponding to the vehicle speed of 20 km / h and the torque of 150 N·m.
[0076] S20, determine a second query request according to the query target, the second query request comprising a second query condition.
[0077] The second query condition comprises a second vehicle speed and a second torque, and the second query request is a query request at a previous time corresponding to the query request.
[0078] When the first query condition and the query target in the query request are obtained, a second query request is determined according to the query target in the query request. For example, when the query target is a vehicle speed of 20 km / h and a torque of 150 N·m, the corresponding second query request comprises a second vehicle speed of 5 km / h and a second torque of 50 N·m.
[0079] Table 1: vehicle speed and torque index table
[0080] Vehicle speed index value 1 4 6 8 10 12 14 Torque index value Torque / vehicle speed 5 20 40 60 80 100 120 1 0 0.5 0.5 0.5 0.5 0.5 0.5 0.5 4 150 0.5 0.5 0.5 0.5 0.5 0.5 0.5 8 400 0.5 0.5 0.5 0.5 0.5 0.5 0.5 12 800 0.5 0.5 0.5 0.53 0.5 0.5 0.5 16 1400 0.47 0.5 0.5 0.51 0.5 0.5 0.5 20 2200 0.57 0.55 0.55 0.55 0.55 0.55 0.55 24 3000 0.6 0.55 0.55 0.55 0.55 0.55 0.55
[0081] It should be noted that in the specific embodiments, the second query request can be the first time that the user queries the vehicle speed and torque corresponding to the front and rear motor energy distribution ratio in the vehicle, or the second time that the user queries the vehicle speed and torque corresponding to the front and rear motor energy distribution ratio in the vehicle. When the second query request is the first time that the user queries the vehicle speed and torque corresponding to the front and rear motor energy distribution ratio in the vehicle, the method of querying the vehicle speed and torque corresponding to the front and rear motor energy distribution ratio in the vehicle according to the first query request is a hash query or a binary search query, i.e., the query request is a request corresponding to the second query, and the second query request is a request corresponding to the first query. When the second query request is the second time that the user queries the vehicle speed and torque corresponding to the front and rear motor energy distribution ratio in the vehicle, the method of querying the vehicle speed and torque corresponding to the front and rear motor energy distribution ratio in the vehicle according to the second query request is a data query method in the present application, i.e., the query request is a request corresponding to the third query, and the second query request is a request corresponding to the second query. Similarly, the method of querying the vehicle speed and torque corresponding to the front and rear motor energy distribution ratio in the vehicle according to the second query request is a data query method in the present application.
[0082] S30, determine a query result according to the second query condition and the first query condition in the query request.
[0083] If the user wants to obtain the query result corresponding to the first vehicle speed and the first torque in the query request, the user can trigger the query request, at which time the second query request can be determined according to the query target in the query request triggered by the user, and then the query result can be determined according to the first query condition corresponding to the query request and the second query condition corresponding to the second query request.
[0084] For example, the user triggers a query request, the first query condition in the query request corresponds to a first vehicle speed of 20 km / h and a first torque of 150 N·m, the second query request determined according to the query target corresponds to a second vehicle speed of 5 km / h and a second torque of 50 N·m, as shown in Table 1, the index value corresponding to the second vehicle speed of 5 km / h is 1, and the torque index value corresponding to the second torque of 150 N·m is 4.
[0085] The query result is determined according to the relationship between the second query condition and the first query condition, for example, the relationship between the first query condition and the second query condition can be the size of the speed, the size of the weight, and the size of the driving force, and the like. For example, if the first vehicle speed is greater than the second vehicle speed in the user triggered query request, for example, the first vehicle speed is 20 km / h, the second vehicle speed index value corresponding to the first vehicle speed can be queried as a starting point, and the second vehicle speed index value corresponding to the first vehicle speed is queried. Similarly, if the first torque is greater than the second torque in the user triggered query request, the first torque index value corresponding to the first torque can be queried as a starting point, the index range is reduced, and the data query efficiency is improved.
[0086] It should be noted that the energy distribution ratio of the front motor and the rear motor in the vehicle is exemplarily queried according to the vehicle speed and the torque in the embodiments of the present disclosure, and in other implementable manners, the first query condition is not limited to including the first vehicle speed and the first torque, and the second query condition is not limited to including the second vehicle speed and the second torque. For other data with regular arrangement, the data query method provided in the embodiments of the present disclosure can also be used.
[0087] The data query method provided in the embodiments of the present disclosure first acquires a query request, determines a second query request according to a query target corresponding to the query request, and determines a query result according to a second query condition and a first query condition in the query request, thereby improving the data query efficiency without increasing the system resource consumption.
[0088] Figure 2 is a flow diagram of another data query method provided in the embodiments of the present disclosure, and the present embodiment is based on the above-mentioned embodiments, wherein one implementable manner of the step S30 includes:
[0089] S31, acquiring an initial index value corresponding to the first query condition.
[0090] Optionally, the initial index value corresponding to the first query condition is acquired, including:
[0091] The first vehicle speed initial index value corresponding to the first vehicle speed is acquired.
[0092] When the second query condition corresponding to the second query request is determined, the second torque index value corresponding to the second torque in the second query condition is obtained, and at this time, the second torque index value corresponding to the second torque is the first torque initial index value corresponding to the first torque in the first query condition. For example, continuing to refer to Table 1, the second torque index value corresponding to the second torque of 150 N·m is 4, and at this time, the first torque initial index value corresponding to the first torque is determined to be 4. The second torque index value corresponding to the second torque of 2200 N·m is 20, and at this time, the first torque initial index value corresponding to the first torque is determined to be 20.
[0093] The first torque initial index value corresponding to the first torque is obtained.
[0094] When the second query condition corresponding to the second query request is determined, the second torque index value corresponding to the second torque in the second query condition is obtained, and at this time, the second torque index value corresponding to the second torque is the first torque initial index value corresponding to the first torque in the first query condition. For example, continuing to refer to Table 1, the second torque index value corresponding to the second torque of 150 N·m is 4, and at this time, the first torque initial index value corresponding to the first torque is determined to be 4. The second torque index value corresponding to the second torque of 2200 N·m is 20, and at this time, the first torque initial index value corresponding to the first torque is determined to be 20.
[0095] S32, determining a target index value according to the first query condition, the second query condition and the vehicle characteristic data.
[0096] For example, the second speed in the second query condition is 5 km / h, and the second torque is 50 N·m. The first speed in the first query condition is 25 km / h, and the first torque is 150 N·m. The speed characteristic data in the vehicle characteristic data is that the speed can be increased by X1 km / h within 1 s, and the speed can be reduced by Y2 km / h within 1 s. The torque characteristic data is that the torque can be increased by X2 N·m within 1 s, and the torque can be reduced by Y2 N·m within 1 s. The specific process of determining the target index value according to the first query condition, the second query condition and the vehicle characteristic data is described below.
[0097] Optionally, the target index value is determined according to the first query condition, the second query condition and the vehicle characteristic data, comprising:
[0098] The second speed target index value is determined according to the first speed, the second speed and the speed characteristic data.
[0099] For example, the second speed in the second query condition is 5 km / h, the first speed in the first query condition is 25 km / h, and the speed characteristic data in the vehicle characteristic data is that the speed can be increased by 25 km / h and decreased by 30 km / h in 1 s. Then, based on the second speed of 5 km / h, the speed of the vehicle can reach 30 km / h in 1 s. Since the first speed in the first query condition is 25 km / h, which is between the second speed of 5 km / h and the speed of 30 km / h, the target index value of the first speed is determined as the index value corresponding to the speed of 30 km / h. As shown in Table 1, the index value corresponding to the speed of 30 km / h is 5, and thus the target index value of the first speed is 5.
[0100] In addition, if the second speed in the second query condition is 80 km / h, the first speed in the first query condition is 25 km / h, and the speed characteristic data in the vehicle characteristic data is that the speed can be increased by 25 km / h and decreased by 30 km / h in 1 s. Then, based on the second speed of 80 km / h, the speed of the vehicle can reach 50 km / h in 1 s and 2 s. Since the first speed in the first query condition is 25 km / h, which is between the second speed of 80 km / h and the speed of 20 km / h, the target index value of the first speed is determined as the index value corresponding to the speed of 20 km / h. As shown in Table 1, the index value corresponding to the speed of 20 km / h is 4, and thus the target index value of the first speed is 4.
[0101] The second torque target index value is determined according to the first torque, the second torque, and the torque characteristic data.
[0102] For example, the second torque in the second query condition is 150 N·m, the first torque in the first query condition is 400 N·m, and the torque characteristic data in the vehicle characteristic data is that the torque can be increased and decreased by a value related to the speed and other factors in 1 s. For example, if the torque can be increased by 650 N·m in 1 s when the vehicle speed is 5 km / h, then based on the second torque of 150 N·m when the vehicle speed is 5 km / h, the torque of the vehicle can reach 800 N·m in 1 s. Since the first torque in the first query condition is 400 N·m, which is between the second torque of 150 N·m and the torque of 800 N·m, the target index value of the first torque is determined as the index value corresponding to the torque of 800 N·m. As shown in Table 1, the index value corresponding to the torque of 800 N·m is 12, and thus the target index value of the first torque is 12.
[0103] Furthermore, if the second torque in the second query condition is 2200 N·m, and the first torque in the first query condition is 150 N·m, if the vehicle speed is 80 km / h, and the second torque is 2200 N·m, the torque can be reduced by 1200 N·m within 1 second, the vehicle torque can reach 1000 N·m after 1 second, and the vehicle torque can reach 0 N·m after 2 seconds. Since the first torque of 150 N·m in the first query condition is between the second torque of 2200 N·m and the torque of 0 N·m, the target index value of the first torque is determined to be the index value corresponding to the torque of 0 N·m. As shown in Table 1, the index value of the torque of 0 N·m is 1. Therefore, the target index value of the first torque is 1.
[0104] S33. Determine the index range based on the initial index value and the target index value.
[0105] Optionally, the index range can be determined based on the initial index value and the target index value, including:
[0106] When the initial index value is greater than the target index value, the index range is from the target index value to the initial index value.
[0107] Specifically, when the initial index value of the first vehicle speed is greater than the target index value of the second vehicle speed, the vehicle speed index range is from the target index value of the first vehicle speed to the initial index value of the first vehicle speed.
[0108] For example, when the second vehicle speed is 80 km / h and the first vehicle speed is 25 km / h, the initial index value of the first vehicle speed is 10, and the target index value of the first vehicle speed is 4. In the case where the second vehicle speed is 80 km / h and the first vehicle speed is 25 km / h: the initial index value of the first vehicle speed is 10, and the target index value of the second vehicle speed is 4. Therefore, the determined range of the first vehicle speed index is (4:10), that is, the speed index range is from the target index value of the first vehicle speed to the initial index value of the first vehicle speed.
[0109] When the initial index value of the first torque is greater than the target index value of the first torque, the torque index range is from the target index value of the first torque to the initial index value of the second torque.
[0110] For example, when the second torque is 2200 N·m and the first torque is 150 N·m, the initial index value of the first torque is 20, and the target index value of the first torque is 1. In the case where the second torque is 2200 N·m and the first torque is 150 N·m: the initial index value of the first torque is 20, and the target index value of the first torque is 1. Therefore, the determined range of the first torque index is (1:20), that is, the torque index range is from the target index value of the first torque to the initial index value of the first torque.
[0111] When the initial index value is less than the target index value, the fast index range is from the initial index value to the target index value.
[0112] Specifically, when the initial index value of the first vehicle speed is less than the target index value of the first vehicle speed, the range of the vehicle speed index is from the initial index value of the first vehicle speed to the target index value of the first vehicle speed.
[0113] For example, when the second vehicle speed is 5 km / h and the first vehicle speed is 25 km / h, the initial index value of the first vehicle speed is 1, and the target index value of the first vehicle speed is 5. In the case where the second vehicle speed is 5 km / h and the first vehicle speed is 25 km / h: the initial index value of the first vehicle speed is 1, and the target index value of the first vehicle speed is 5. Therefore, the speed index range is determined to be (1:5), that is, the speed index range is from the initial index value of the first vehicle speed to the target index value of the first vehicle speed.
[0114] When the initial index value of the first torque is less than the target index value of the first torque, the torque index range is from the initial index value of the first torque to the target index value of the first torque.
[0115] For example, when the second torque is 150 N·m and the first torque is 400 N·m, the initial index value of the first torque is 4, and the target index value of the first torque is 12. In the case where the second torque is 150 N·m and the first torque is 400 N·m, the initial index value of the first torque is 4, and the target index value of the first torque is 12. Therefore, the determined torque index range is (4:12), meaning the torque index range is from the initial index value of the first torque to the target index value of the first torque.
[0116] S34. Query the query results corresponding to the first query condition within the index range.
[0117] Within the vehicle speed index range, search for the first vehicle speed index value corresponding to the first vehicle speed.
[0118] Specifically, if the speed index range is determined to be (1:5), then the first speed index value corresponding to the first speed is queried within the speed index range (1:5). If the speed index range is determined to be (4:10), then the first speed index value corresponding to the first speed is queried within the speed index range (4:10).
[0119] Search for the first torque index value corresponding to the first torque within the torque index range.
[0120] Specifically, if the torque index range is determined to be (2:12), then the first vehicle torque index value corresponding to the first torque is queried within the torque index range (4:12). If the torque index range is determined to be (1:20), then the first torque index value corresponding to the first torque is queried within the torque index range (1:20).
[0121] The query results are determined based on the first vehicle speed index value and the first torque index value.
[0122] For example, in the first scenario, the second query condition specifies a second vehicle speed of 5 km / h and a second torque of 150 N·m, while the first query condition specifies a first vehicle speed of 25 km / h and a first torque of 400 N·m. First, the query retrieves the first vehicle speed index value within the speed index range (1:5), and then retrieves the first torque index value within the torque index range (4:12). In the second scenario, the second query condition specifies a second vehicle speed of 80 km / h and a second torque of 2200 N·m, while the first query condition specifies a first vehicle speed of 25 km / h and a first torque of 150 N·m. First, the query retrieves the first vehicle speed index value within the speed index range (4:10), and then retrieves the first torque index value within the torque index range (1:20). Finally, the query result is determined based on the retrieved first vehicle speed index value and first torque index value.
[0123] Figure 3 This is a flowchart illustrating another data query method provided in this embodiment. Figure 2 Based on the provided embodiments, such as Figure 3 As shown, after step S33, the following steps are also included:
[0124] S330. Determine the indexing method based on the relationship between the difference between the second query condition and the first query condition and the preset threshold.
[0125] Specifically, after determining the index range based on the initial index value and the target index value, the indexing method is determined based on the relationship between the difference between the first query condition and the second query condition and a preset threshold. For example, if the difference between the first vehicle speed in the first query condition and the second vehicle speed in the second query condition is large (e.g., the first speed is 140 km / h and the second speed is 5 km / h), a binary search index can be used to query the index value corresponding to the first speed of 140 km / h within the index range. If the difference between the first vehicle speed in the first query condition and the second speed in the second query condition is small (e.g., the first speed is 20 km / h and the second speed is 5 km / h), a sequential index can be used to query the index value corresponding to the first speed of 20 km / h within the index range, improving the efficiency of data retrieval.
[0126] Furthermore, the indexing method for the first torque is the same as the indexing method for the first vehicle speed, and this disclosure will not provide specific examples of this.
[0127] Figure 4 This is a flowchart illustrating another data query method provided in this embodiment. Figure 3 Based on the provided embodiments, such as Figure 4 As shown, one possible implementation of step S330 includes:
[0128] S331. Determine the second vehicle speed index method based on the relationship between the difference between the second vehicle speed and the first vehicle speed and the first preset threshold.
[0129] Optionally, the method for determining the first vehicle speed index based on the relationship between the difference between the second vehicle speed and the first vehicle speed and a first preset threshold includes:
[0130] When the difference between the second vehicle speed and the first vehicle speed is greater than or equal to the first preset threshold, the indexing method for the first vehicle speed is binary search indexing.
[0131] When the difference between the second vehicle speed and the first vehicle speed is less than the first preset threshold, the first vehicle speed indexing method is sequential indexing.
[0132] Specifically, the setting of the first preset threshold is related to the vehicle speed characteristics. For example, if the minimum vehicle speed is 0 and the maximum is 150 km / h, the first preset threshold can be set to 60 km / h. When the difference between the second vehicle speed and the first vehicle speed is greater than or equal to the first preset threshold, the first vehicle speed indexing method is binary indexing. When the difference between the second vehicle speed and the first vehicle speed is less than the first preset threshold, the first vehicle speed indexing method is sequential indexing.
[0133] S332. Determine the first torque index method based on the relationship between the difference between the second torque and the first torque and the second preset threshold.
[0134] Optionally, the method for determining the first torque index based on the relationship between the difference between the second torque and the first torque and a second preset threshold includes:
[0135] When the difference between the second torque and the first torque is greater than or equal to the second preset threshold, the first torque indexing method is the binary indexing method.
[0136] When the difference between the second torque and the first torque is less than the second preset threshold, the first torque indexing method is sequential indexing.
[0137] Specifically, the setting of the second preset threshold is related to the torque characteristics. For example, if the minimum torque of a vehicle is 0 and the maximum is 3000 N·m, then the second preset threshold can be set to 1200 N·m. When the difference between the second torque and the first torque is greater than or equal to the second preset threshold, the first torque indexing method is the binary indexing method. When the difference between the second torque and the first torque is less than the second preset threshold, the first torque indexing method is the sequential indexing method.
[0138] It should be noted that the above embodiments are merely illustrative examples illustrating that the first torque and the first vehicle speed can be indexed using a binary search method or a sequential index. In specific embodiments, the first vehicle speed indexing method is a binary search method and the first torque indexing method is a sequential index, or the first vehicle speed indexing method is a binary search method and the first torque indexing method is a binary search method, or the first vehicle speed indexing method is a sequential index and the first torque indexing method is a sequential index, or the first vehicle speed indexing method is a sequential index and the first torque indexing method is a binary search method. This disclosure does not specifically limit these embodiments.
[0139] Figure 5 This is a schematic diagram of the structure of a data query device provided in an embodiment of this disclosure, as shown below. Figure 5 As shown, the data query device includes:
[0140] The query request acquisition module 510 is used to acquire a query request, wherein the query request includes a first query condition and a query target;
[0141] The query request determination module 520 is used to determine a second query request based on the query target. The second query request includes a second query condition, which includes a second vehicle speed and a second torque. The second query request is the query request of the previous moment corresponding to the query request.
[0142] The query module 530 is used to determine the query result based on the second query condition and the first query condition in the query request.
[0143] The data query device provided in this embodiment of the present disclosure includes a query request acquisition module that acquires a query request, a query request determination module that determines a second query request based on the query target, and a query module that determines the query result based on the second query condition and the first query condition in the query request. This improves the data query efficiency without increasing system resource consumption.
[0144] It is worth noting that in the embodiments of the above data query method, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the scope of protection of the present invention.
[0145] The data query device provided in the embodiments of the present invention can execute the data query method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0146] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure, such as... Figure 6 As shown, the electronic device includes a processor 810, a memory 820, an input device 830, and an output device 840; the number of processors 810 in the electronic device can be one or more. Figure 6 Taking a processor 810 as an example; the processor 810, memory 820, input device 830, and output device 840 in an electronic device can be connected via a bus or other means. Figure 6 Taking the example of a connection between China and Israel via a bus.
[0147] The memory 820, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the data query method in this embodiment of the invention. The processor 810 executes various functional applications and data processing of the electronic device by running the software programs, instructions, and modules stored in the memory 820, thereby implementing the data query method provided in this embodiment of the invention.
[0148] The memory 820 may primarily include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a given function; the data storage area may store data created based on terminal usage. Furthermore, the memory 820 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory, or other non-volatile solid-state storage device. In some instances, the memory 820 may further include memory remotely located relative to the processor 810, which can be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0149] The input device 830 can be used to receive input digital or character information and generate key signal inputs related to user settings and function control of electronic devices, and may include a keyboard, mouse, etc. The output device 840 may include display devices such as a display screen.
[0150] This disclosure also provides a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to implement the data query method provided in this embodiment of the invention.
[0151] Of course, the computer-executable instructions provided in the embodiments of the present invention are not limited to the method operations described above, but can also perform related operations in the data query method provided in any embodiment of the present invention.
[0152] This disclosure also provides a computer program product that, when run on a computer, causes the computer to execute a method for querying data of the application program described in the preceding embodiments.
[0153] In the above embodiments, all or part of the functionality can be implemented by software, hardware, or a combination of software and hardware. When implemented using software, it can be implemented wholly or partially in the form of a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or functionality according to the embodiments of this disclosure is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).
[0154] 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.
[0155] 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 data query method, characterized in that, include: Obtain a query request, the query request including a first query condition and a query target, wherein the first query condition includes a first vehicle speed and a first torque, and the query target is the energy distribution ratio of the front and rear motors in the car when the vehicle speed is the first vehicle speed and the torque is the first torque; A second query request is determined based on the query target. The second query request includes a second query condition, wherein the second query condition includes a second vehicle speed and a second torque. The second query request is a query request from the previous moment corresponding to the query request. Obtain the initial index value corresponding to the first query condition, wherein the initial index value includes the first vehicle speed initial index value and the first torque initial index value; The target index value is determined based on the first query condition, the second query condition, and the vehicle characteristic data, wherein the vehicle characteristic data includes vehicle speed characteristic data and torque characteristic data, and the target index value includes a first vehicle speed target index value and a first torque target index value. The index range is determined based on the initial index value and the target index value; Within the index range, query the query results corresponding to the first query condition. The query results are the energy distribution ratio of the front and rear motors in the car when the vehicle speed and the torque meet the first query condition.
2. The method according to claim 1, characterized in that... Obtaining the initial index value corresponding to the first query condition includes: Obtain the initial index value of the first vehicle speed corresponding to the first vehicle speed; Obtain the initial index value of the first torque corresponding to the first torque.
3. The method according to claim 2, characterized in that, The step of determining the target index value based on the first query condition, the second query condition, and the vehicle characteristic data includes: The first vehicle speed target index value is determined based on the first vehicle speed, the second vehicle speed, and the vehicle speed characteristic data; The first torque target index value is determined based on the first torque, the second torque, and the torque characteristic data.
4. The method according to claim 1, characterized in that, Determining the index range based on the initial index value and the target index value includes: When the initial index value is greater than the target index value, the index range is from the target index value to the initial index value; When the initial index value is less than the target index value, the index range is from the initial index value to the target index value.
5. The method according to claim 3, characterized in that, The index range includes the vehicle speed index range and the torque index range; When the first initial vehicle speed index value is greater than the first target vehicle speed index value, the vehicle speed index range is from the first target vehicle speed index value to the first initial vehicle speed index value; When the first initial torque index value is greater than the first target torque index value, the torque index range is from the first target torque index value to the first initial torque index value; When the first initial vehicle speed index value is less than the first target vehicle speed index value, the vehicle speed index range is from the first initial vehicle speed index value to the first target vehicle speed index value; When the first initial torque index value is less than the first target torque index value, the torque index range is from the first initial torque index value to the first target torque index value.
6. The method according to claim 5, characterized in that, The step of querying the query results corresponding to the first query condition within the index range includes: Within the vehicle speed index range, query the first vehicle speed index value corresponding to the first vehicle speed; Within the torque index range, query the first torque index value corresponding to the first torque; The query result is determined based on the first vehicle speed index value and the first torque index value.
7. The method according to claim 1, characterized in that, After determining the index range based on the initial index value and the target index value, the process further includes: The indexing method is determined based on the relationship between the difference between the second query condition and the first query condition and a preset threshold.
8. The method according to claim 7, characterized in that, The method for determining the index based on the relationship between the difference between the second query condition and the first query condition and a preset threshold includes: The first vehicle speed indexing method is determined based on the relationship between the difference between the second vehicle speed and the first vehicle speed and a first preset threshold. The first torque indexing method is determined based on the relationship between the difference between the second torque and the first torque and a second preset threshold.
9. The method according to claim 8, characterized in that, The method for determining the first vehicle speed index based on the relationship between the difference between the second vehicle speed and the first vehicle speed and a first preset threshold includes: When the difference between the second vehicle speed and the first vehicle speed is greater than or equal to the first preset threshold, the first vehicle speed indexing method is binary search indexing; When the difference between the second vehicle speed and the first vehicle speed is less than the first preset threshold, the first vehicle speed indexing method is sequential indexing.
10. The method according to claim 8, characterized in that, The method for determining the first torque index based on the relationship between the difference between the second torque and the first torque and a second preset threshold includes: When the difference between the second torque and the first torque is greater than or equal to the second preset threshold, the first torque indexing method is a binary indexing method. When the difference between the second torque and the first torque is less than a second preset threshold, the first torque indexing method is sequential indexing.
11. A data query device, characterized in that, include: The query request acquisition module is used to acquire a query request, which includes a first query condition and a query target. The first query condition includes a first vehicle speed and a first torque, and the query target is the energy distribution ratio of the front and rear motors in the car when the vehicle speed is the first vehicle speed and the torque is the first torque. The query request determination module is used to determine a second query request based on the query target. The second query request includes a second query condition, wherein the second query condition includes a second vehicle speed and a second torque. The second query request is a query request from the previous moment corresponding to the query request. The query module is used for: Obtain the initial index value corresponding to the first query condition, wherein the initial index value includes the first vehicle speed initial index value and the first torque initial index value; The target index value is determined based on the first query condition, the second query condition, and the vehicle characteristic data, wherein the vehicle characteristic data includes vehicle speed characteristic data and torque characteristic data, and the target index value includes a first vehicle speed target index value and a first torque target index value. The index range is determined based on the initial index value and the target index value; Within the index range, query the query results corresponding to the first query condition. The query results are the energy distribution ratio of the front and rear motors in the car when the vehicle speed and the torque meet the first query condition.
12. An electronic device, characterized in that, include: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the data query method as described in any one of claims 1 to 10.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by the processor, the program implements the data query method as described in any one of claims 1 to 10.
Citation Information
Patent Citations
Vehicle data retrieval method and device and computer readable storage medium
CN110928868A
Data query method, device, server and storage medium
CN112364014A