Electronic device and query processing method therefor
Patent Information
- Application Number
- PCT/KR2023/018878
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-10-04
- Filing Date
- 2023-11-22
- Publication Date
- 2025-04-10
AI Technical Summary
Existing query processing methods struggle to balance output load and query processing speed when extracting large datasets from databases, often leading to network congestion, time-outs, and inefficient data extraction.
An electronic device and query processing method that dynamically determine the appropriate query range by calculating interval information based on estimated data quantities and network capacities, ensuring balanced output load and query processing speed.
The method optimizes data extraction by dividing the query range effectively, reducing network congestion and time-outs, while ensuring efficient data processing and extraction.
Smart Images

Figure KR2023018878_10042025_PF_FP_ABST
Abstract
Description
Electronic device and method for processing queries thereof
[0001] The present disclosure relates to an electronic device and a query processing method thereof for processing a query in an optimized manner by determining an appropriate query range that is balanced in terms of output load and query processing speed.
[0002] When extracting large amounts of data from a database, it's necessary to decide whether to extract all data at once or in multiple chunks, and if so, how many chunks to extract. Several factors must be considered when doing so. The first is the output load. Retaining snapshots on a Read Replica for too long places a significant load on the database, and extracting data beyond network capacity can cause network congestion. Furthermore, generic queries can take too long, and such lengthy queries can lead to timeouts and data loss. However, if the query scope is fragmented too finely to account for this output load issue, the query processing speed will not be as fast as desired. A query processing method that appropriately sets the query scope and balances these two aspects is needed.
[0003] The disclosed embodiments provide an electronic device and a query processing method thereof. Specifically, the purpose is to determine an appropriate query range that achieves a balance in terms of output load and query processing speed.
[0004] The technical tasks to be achieved by this embodiment are not limited to the technical tasks described above, and other technical tasks can be inferred from the following embodiments.
[0005] One aspect of the present disclosure provides a query processing method of an electronic device, comprising: when a query for extracting data corresponding to a selected time range from a database is confirmed, a step of confirming appropriate amount information related to an appropriate extraction amount of rows; a step of confirming interval information corresponding to at least a portion of the time range based on estimated density information related to an hourly storage amount of rows and the appropriate amount information; and a step of performing at least a portion of the query by extracting at least a portion of rows of the data corresponding to the interval information.
[0006] In one embodiment of the present disclosure, the step of checking the appropriate amount information may further include a step of checking the maximum amount information checked based on the ratio information between the buffer size of the driver operating in conjunction with the database and the maximum size of the row included in the data, and the cutoff amount information checked based on the ratio information between the cutoff size set for the network to which the database is connected and the average size of the row included in the data; and a step of checking the appropriate amount information based on at least a portion of the maximum amount information and the cutoff amount information.
[0007] Additionally, in one embodiment of the present disclosure, the step of confirming the appropriate amount information may include a query processing method of confirming the result of calculating a weighted average between the maximum amount information and the cutoff amount information as the appropriate amount information.
[0008] In addition, in one embodiment of the present disclosure, the step of checking the interval information may further include a step of checking the estimated density information based on ratio information between the total number of rows of the entire data included in the database and the entire time range corresponding to the entire data; and a step of checking the ratio information between the appropriate amount information and the estimated density information as the interval information.
[0009] Additionally, in one embodiment of the present disclosure, the method for processing a query may further include a step of performing at least a portion of the remainder of the query by updating the interval information and further extracting at least a portion of the remainder of the data corresponding to the updated interval information.
[0010] In addition, in one embodiment of the present disclosure, the query processing method may further include a step of sequentially extracting at least a portion of each of the data corresponding to each updated interval information by repeatedly updating the interval information until the query is fully performed.
[0011] In addition, in one embodiment of the present disclosure, the step of performing at least a portion of the remainder of the query may further include the steps of: extracting at least a portion of the rows of the data corresponding to the interval information, while checking extraction amount information related to an actual extraction amount of the rows; verifying whether the interval information satisfies an appropriate condition based on the extraction amount information and the appropriate amount information, and then updating the estimated density information based on whether the appropriate condition is satisfied; and updating the interval information based on the updated appropriate amount information and the updated estimated density information confirmed at the time of update, and then further extracting at least a portion of the remainder of the data corresponding to the updated interval information based on the updated interval information, thereby further performing at least a portion of the remainder of the query.
[0012] In addition, in one embodiment of the present disclosure, the step of updating the estimated density information may include a query processing method in which, when the ratio information between the appropriate amount information and the extracted amount information is included in a first range corresponding to under-extraction, the interval information is determined to not satisfy the appropriate condition and the estimated density information is updated by reducing the interval information.
[0013] In addition, in one embodiment of the present disclosure, when the ratio information is included in the first range, the estimated density information is updated by confirming a result of dividing the appropriate amount information by first correction interval information obtained by adding first correction information to the interval information as the estimated density information, and the first correction information may include a query processing method confirmed as a result of multiplying (i) difference information between reference interval information, which is one of past interval information, and the interval information, and (ii) the square root of ratio information between difference information between the appropriate amount information and reference extraction amount information, which is one of past extraction amount information, and difference information between the extraction amount information and the reference extraction amount information.
[0014] In addition, in one embodiment of the present disclosure, the step of updating the estimated density information may include a query processing method in which, when the ratio information between the appropriate amount information and the extracted amount information is included in a second range corresponding to over-extraction, the interval information is determined to not satisfy the appropriate condition and the estimated density information is updated by increasing the interval information.
[0015] In addition, in one embodiment of the present disclosure, when the ratio information is included in the second range, the estimated density information is updated by confirming the result of dividing the appropriate amount information by the second correction interval information obtained by subtracting the second correction information from the interval information as the estimated density information, wherein the second correction information may include a query processing method confirmed as the result of multiplying (i) difference information between reference interval information, which is one of past interval information, and the interval information, and (ii) difference information between the appropriate amount information and reference extraction amount information, which is one of past extraction amount information, and ratio information between the extraction amount information and the reference extraction amount and the difference information between the reference extraction amount and the square root of the difference information from 1.
[0016] In addition, in one embodiment of the present disclosure, the step of updating the estimated density information may include a query processing method in which, if the ratio information between the appropriate amount information and the extracted amount information is included in a third range corresponding to appropriate extraction, the interval information is determined to satisfy an appropriate condition, and the estimated density information is maintained.
[0017] Another aspect of the present disclosure is an electronic device for processing a query, comprising a memory for storing instructions and a processor connected to the memory, configured to perform at least a part of the query by, when a query for extracting data corresponding to a selected time range from a database is identified, identifying appropriate amount information related to an appropriate amount of rows to be extracted, identifying interval information corresponding to at least a part of the time range based on estimated density information related to an amount of storage per hour of rows and the appropriate amount information, and extracting at least a part of the rows of the data corresponding to the interval information.
[0018] Another aspect of the present disclosure may provide a computer-readable, non-transitory recording medium having recorded thereon a program for executing the above-described information providing method on a computer.
[0019] Specific details of other embodiments are included in the detailed description and drawings.
[0020] According to the proposed embodiment, one or more of the following effects can be expected.
[0021] According to the embodiment of the present specification, queries can be divided into optimized ranges and processed by determining an appropriate query range that is balanced in terms of output load and query processing speed.
[0022] Additionally, according to the embodiments of the present specification, data can be efficiently extracted through queries without causing network congestion.
[0023] The effects of the invention are not limited to the effects mentioned above, and other effects not mentioned will be clearly understood by those skilled in the art from the description of the claims.
[0024] FIG. 1 illustrates an electronic device and a database performing a query processing method according to one embodiment.
[0025] Figure 2 is a flowchart illustrating a query processing method according to one embodiment.
[0026] FIG. 3 is a block diagram conceptually illustrating a query processing method according to one embodiment.
[0027] FIG. 4 is a block diagram illustrating an example of a query processing method at the time of initial extraction according to one embodiment.
[0028] Figures 5a and 5b are examples of code for updating estimated density information according to each embodiment.
[0029] FIG. 6 is a diagram illustrating a configuration of an electronic device that performs a query processing method according to one embodiment.
[0030] The terms used in the examples have been selected from widely used, current terms, taking into account the functions of the present disclosure. However, these terms may vary depending on the intentions of those skilled in the art, precedents, the emergence of new technologies, etc. Furthermore, in certain cases, terms may be arbitrarily selected by the applicant, in which case their meanings will be described in detail in the relevant description. Therefore, the terms used in this disclosure should not be defined simply as names, but rather based on the meanings of the terms and the overall content of the present disclosure.
[0031] When a part of a specification is said to "include" a component, this does not mean that it excludes other components, but rather that it may include other components, unless otherwise stated.
[0032] The expression "at least one of a, b, and c" described throughout the specification may encompass 'a alone', 'b alone', 'c alone', 'a and b', 'a and c', 'b and c', or 'all of a, b, and c'.
[0033] The "terminal" mentioned below may be implemented as a computer or portable terminal that can connect to a server or other terminal via a network. Here, the computer includes, for example, a notebook, desktop, laptop, etc. equipped with a web browser, and the portable terminal may include, for example, a wireless communication device that guarantees portability and mobility, and may include all types of handheld-based wireless communication devices such as communication-based terminals such as IMT (International Mobile Telecommunication), CDMA (Code Division Multiple Access), W-CDMA (W-Code Division Multiple Access), LTE (Long Term Evolution), smartphones, tablet PCs, etc.
[0034] Below, embodiments of the present disclosure are described in detail with reference to the attached drawings so that those skilled in the art can easily implement the present disclosure. However, the present disclosure may be implemented in various different forms and is not limited to the embodiments described herein.
[0035] Hereinafter, embodiments of the present disclosure will be described in detail with reference to the drawings.
[0036] FIG. 1 illustrates an electronic device and a database performing a query processing method according to one embodiment.
[0037] Referring to FIG. 1, a configuration in which an electronic device (100) operates in conjunction with a database (200) can be confirmed. Meanwhile, the electronic device (100) and database (200) illustrated in FIG. 1 only illustrate components related to the present embodiment. Therefore, those skilled in the art will understand that, in addition to the components illustrated in FIG. 1, other general-purpose components may be included. According to one embodiment, the database (200) may be a relational database, but is not limited thereto.
[0038] When providing online services, it's common to transfer large amounts of data stored in a specific database to another database or extract them for analysis. Extracting too much data at once can significantly increase the database's output load. Therefore, it's necessary to appropriately segment the data extraction scope within the query and use a method to extract the data in separate chunks. However, if the query directly includes information about the number of data to be extracted, segmenting the data extraction scope in this way can be straightforward. However, depending on the service, queries often don't include this information. An example of this is when a query is intended to extract data created or modified within a specific time range. If the time range contains too much data, executing the query as-is can lead to issues with the aforementioned output load. Conversely, if the time range contains relatively little data, dividing the data extraction scope into smaller chunks to account for the aforementioned issues can result in inefficiencies in data extraction time. Therefore, it is necessary to estimate how much data is contained in the time range and dynamically determine the time range so that an appropriate amount of data can be extracted accordingly.
[0039] The electronic device (100) can dynamically determine the appropriate data extraction time range described above for the database (200). For example, an administrator can transmit a query to the database (200) to extract data created or modified after 10:23:17 on August 3, 2016. The electronic device (100) can calculate an appropriate time range for the query, i.e., interval information, so that the time range of such a query can be appropriately divided to extract data. As an example of such interval information for a query to extract data created or modified after 10:23:17 on August 3, 2016, the interval information can be a time range from 10:23:17 to 15:21:24. The database (200) extracts data corresponding to this time range, and then the electronic device (100) can recalculate the next interval information and transmit it to the database (200), and by repeating this process, all data required by the query can be extracted.
[0040] Referring to Figure 2 below, the above query processing method will be described.
[0041] Figure 2 is a flowchart illustrating a query processing method according to one embodiment.
[0042] In step S210, if a query for extracting data corresponding to a selected time range is confirmed from the database (200), appropriate amount information related to an appropriate amount of rows to be extracted can be confirmed. In step S220, interval information corresponding to at least a portion of the time range can be confirmed based on the estimated density information and appropriate amount information related to the amount of rows to be stored per hour. In step S230, at least a portion of the query can be performed by extracting at least a portion of rows of data corresponding to the interval information.
[0043] Below, each step is explained in detail.
[0044] Accordingly, the electronic device (100) can obtain a query from the database (200) to extract data corresponding to a time range selected by the administrator and received by the database (200). As a first process for calculating interval information, the electronic device (100) can check the appropriate amount of information. The appropriate amount of information can include information on the number of rows suitable for extraction, i.e., the appropriate amount of extraction. Such appropriate amount of information can be determined in terms of output capacity and network capacity.
[0045] According to one embodiment, the appropriate amount information can be confirmed based on maximum amount information and cutoff amount information. Here, the maximum amount information can be confirmed based on the ratio information obtained by dividing the buffer size of the driver operating in conjunction with the database (200) by the maximum size of the largest row included in the data of the corresponding time range. Here, the buffer size may be, but is not limited to, the buffer size of the JDBC driver frequently used for extracting such data. Through the maximum amount information, information on the number of rows that can be extracted when the output capacity is used to the maximum, that is, when the driver's buffer is used to extract only the largest rows, can be confirmed. The cutoff amount information can be confirmed based on the ratio information obtained by dividing the cutoff size set for the network to which the database (200) is connected by the average size of the rows included in the data. Cutoff size information provides information on the number of rows that can be extracted, assuming that data of an appropriate size (i.e., the cutoff size) is extracted while extracting rows of average size, considering network capacity. The cutoff size can be specified by the network administrator.
[0046] In one embodiment, the appropriate amount information can be identified as the result of calculating a weighted average between the maximum amount information and the cutoff amount information. In other words, a value that appropriately considers the aforementioned output capacity and network capacity aspects can be identified as the appropriate amount information. Basically, the appropriate amount information can be identified by averaging the maximum amount information and the cutoff amount information on a one-to-one basis. Depending on the situation, the appropriate amount information can be identified by calculating a weighted average with varying ratios.
[0047] In addition, in parallel with this, the electronic device (100) can check the estimated density information. The estimated density information may be information for initially estimating the number of rows that will exist in the time range included in the query. To this end, the electronic device (100) can check the estimated density information based on the ratio information obtained by dividing the total number of rows of all data included in the database (200) by the total time range corresponding to the entire data. Here, the total time range may be integer information calculated as the difference between the timestamp value of the upper threshold value and the timestamp value of the lower threshold value of the corresponding range.
[0048] Thereafter, the electronic device (100) can check the ratio information obtained by dividing the appropriate amount information by the estimated density information as interval information. When the appropriate amount information is divided by the estimated density information, the number of appropriate rows is divided by the number of rows per time range included in the database (200), so a time range predicted to include the number of rows as much as the appropriate amount information, i.e., interval information, is derived. Here, the interval information can be obtained as an integer timestamp value. The electronic device (100) can perform at least a part of the query by extracting at least a part of the aforementioned data corresponding to the time range as much as the interval information from the database (200).
[0049] The electronic device (100) can further perform at least a portion of the remaining query by updating such interval information and extracting at least a portion of the remaining data corresponding to the updated interval information. Furthermore, the electronic device can sequentially extract at least a portion of each data corresponding to each repeatedly updated interval information by repeatedly updating the interval information until the entire query is performed. By extracting data in an optimized number of rows through this process, an appropriate data extraction process can be performed in terms of output load. The following describes a method for updating interval information.
[0050] According to one embodiment, the electronic device (100) can extract at least a portion of rows of data corresponding to interval information, and check extraction amount information related to the actual extraction amount of the rows. That is, the electronic device (100) can generate extraction amount information that is a result of counting how many rows are included in a time range corresponding to the interval information.
[0051] Thereafter, the electronic device (100) can verify whether the interval information satisfies the appropriate conditions based on the extraction amount information and the appropriate amount information. That is, it can verify whether the appropriate conditions are satisfied by determining whether the extraction amount information is similar to, greater than, or smaller than the appropriate amount information.
[0052] According to one embodiment, if the ratio information, which is obtained by dividing the appropriate amount of information by the extracted amount of information, falls within a first range corresponding to underextraction, it may be determined that the interval information does not satisfy the appropriate condition. The first range may correspond to a case where the ratio information exceeds 1, but is not limited to this numerical value. In this case, it may be determined that the estimated density information is estimated to be somewhat larger than the actual value, resulting in a small interval information, and thus a small number of extracted rows, resulting in inefficient data extraction. Therefore, in this case, it is necessary to reduce the estimated density information to be used in the next data extraction compared to the corresponding point in time.
[0053] In one embodiment, if the ratio information, which is calculated by dividing the appropriate amount of information by the extracted amount of information, falls within a second range corresponding to overextraction, the interval information may be determined to not satisfy the appropriate condition. The second range may correspond to a case where the ratio information is less than 0.5, but is not limited to this value. In this case, the estimated density information may be estimated to be slightly smaller than the actual value, resulting in a large interval information, which may increase the number of extracted rows, leading to the determination that slightly more data has been extracted than in the ideal case. Therefore, in this case, the estimated density information to be used for the next data extraction needs to be increased compared to the corresponding point in time.
[0054] In one embodiment, if the ratio information, which is calculated by dividing the appropriate amount of information by the extracted amount of information, falls within a third range corresponding to appropriate extraction, the interval information may be determined to satisfy the appropriate condition. The third range may correspond to a case where the ratio information is 0.5 or more and 1 or less, but is not limited to such a value. In this case, the estimated density information can be considered to have been appropriately estimated, and therefore, the estimated density information can be used as is without updating during the next data extraction.
[0055] As described above, the electronic device (100) can update the estimated density information differently depending on which of the first to third ranges the ratio information, which is the ratio information obtained by dividing the appropriate amount information by the extracted amount information, falls within. Specifically, if the ratio information falls within the first range, the estimated density information is decreased. If the ratio information falls within the second range, the estimated density information is increased. If the ratio information falls within the third range, the estimated density information is maintained. The specific amounts of increase and decrease will be described later.
[0056] Next, the electronic device (100) updates the interval information based on the updated appropriate amount information confirmed at the time of update and the updated estimated density information as described above, and then further performs at least a portion of the remainder of the query by extracting at least a portion of the remainder of the data corresponding to the updated interval information based on the updated interval information.
[0057] Specifically, the electronic device (100) can newly acquire at least some of the buffer size information, the maximum row size information, the cutoff size, and the average size information at the time of update, newly calculate at least some of the maximum amount information and the cutoff amount information, and check the updated appropriate amount information based on the newly obtained information. In addition, the interval information can be updated based on the estimated density information updated through the above-described process. That is, the appropriate amount information at the time of update can be divided by the estimated density information updated through the above-described process to check the updated interval information. In this way, at least some of the remaining data can be further extracted based on the updated interval information, thereby further performing at least some of the remaining queries.
[0058] According to one embodiment, the electronic device (100) can sequentially extract at least a portion of each data corresponding to each updated interval information by repeatedly updating the interval information until the entire query is performed. That is, by repeatedly performing the aforementioned process, the estimated density information is repeatedly updated, and the interval information is repeatedly calculated based on the updated appropriate amount information at each time point, thereby continuously extracting an appropriate amount of data, thereby performing the query.
[0059] To summarize this overall flow, refer to Figure 3.
[0060] FIG. 3 is a block diagram conceptually illustrating a query processing method according to one embodiment.
[0061] Referring to FIG. 3, first, as described above, Table Info can be obtained from the database (200), and Application / Environment Requirements can be obtained. These may be information obtained to calculate the above-described appropriate amount information and estimated density information. Regarding each variable, TABLE_ROWS included in Table Info means the total number of rows of the above-described entire data, MAX_ROW_SIZE means information on the maximum size of the largest row, MIN_CURSOR and MAX_CURSOR mean the lower threshold and upper threshold of the entire time range corresponding to the entire data as integer timestamp values, and AVG_ROW_LENGTH may mean the average size of the rows included in the data. In addition, MAX_BUFFER_SIZE included in Application / Environment Requirements means the above-described buffer size, and STREAM_CUTOFF_LIMIT may mean a cutoff size set for the network.
[0062] Once this information is obtained, the MIN_INTERVAL can be estimated through the aforementioned process and data can be extracted. At this time, the number of rows in the extracted data, i.e., the extraction volume, is determined to be greater or less than the predicted optimal volume. As previously mentioned, if the estimated density information is appropriate, the estimated density information can be reused. If the estimated density information is not appropriate, the estimated density information can be increased or decreased and then used in the next extraction process.
[0063] The processing process when extracting data for the first time will be further explained using the example in Fig. 4.
[0064] FIG. 4 is a block diagram illustrating an example of a query processing method at the time of initial extraction according to one embodiment.
[0065] Referring to FIG. 4, when a query for extracting data from 2016-08-03 10:23:17 is obtained, it can be confirmed that MAX_ROW_SIZE, AVG_ROW_LENGTH, TABLE_ROWS, MAX_CURSOR, and MIN_CURSOR information are obtained from the database (200), and MAX_BUFFER_SIZE and STREAM_CUTOFF_LIMIT values are obtained. Thereafter, the electronic device (100) can calculate AVG_FETCH_ROW_COUNT, which is appropriate amount information, and ROWS_PER_CURSOR, which is estimated density information, using the above-described information. In addition, the electronic device (100) can calculate MIN_INTERVAL based on AVG_FETCH_ROW_COUNT and ROWS_PER_CURSOR. For example, let's assume that MIN_INTERVAL corresponds to 4 hours, 58 minutes, and 4 seconds. Accordingly, data from 2016-08-03 10:23:17 to 2016-08-03 15:21:24 can be extracted from the database (200) as at least part of the query.
[0066] Thereafter, when the extraction amount information, MIN_COUNT, is input to the electronic device (100), the electronic device (100) can calculate MIN_DENSITY, which is the ratio information obtained by dividing the extraction amount information by the appropriate amount information, to determine whether the interval information satisfies the appropriate condition. Based on MIN_DENSITY, the electronic device (100) can determine whether the interval information satisfies the appropriate condition. According to the above-described process, by determining which of the first to third ranges MIN_DENSITY is included in, the estimated density information ROWS_PER_CURSOR can be updated. Thereafter, the process as described above can be repeated to sequentially perform the update of MIN_INTERVAL and query extraction.
[0067] Below, the process of updating the aforementioned estimated density information will be described.
[0068] According to one embodiment, when the ratio information between the appropriate amount information and the extracted amount information is included in the first range, the electronic device (100) can check the result of dividing the appropriate amount information by the first correction interval information obtained by adding the first correction information to the interval information as updated estimated density information.
[0069] Here, in order to calculate the first correction information, the electronic device (100) may calculate the reference interval information, which is one of the past interval information, and the difference information between the interval information. The reference interval information may be a value that is initially set to 0 and used to store the interval information at the corresponding point in time whenever an update is performed to reduce the estimated density information. In addition, the electronic device may calculate the difference information between the appropriate amount information and the reference extraction amount information, which is one of the past extraction amount information, and the ratio information between the extraction amount information and the reference extraction amount information. Here, the reference extraction amount information may be a value that is initially set to 0 and used to store the extraction amount information at the corresponding point in time whenever an update is performed to reduce the estimated density information.
[0070] Thereafter, the electronic device (100) can calculate the first correction information by multiplying the square root of the difference information between the reference interval information and the interval information, the difference information between the appropriate amount information and the reference extraction amount information, and the ratio information between the difference information between the extraction amount information and the reference extraction amount information. Such first correction information can be expressed by the following equation.
[0071]
[0072] AVG_FETCH_ROW_COUNT, MIN_COUNT, and MIN_INTERVAL are as described above, and LEFT_COUNT can correspond to reference extraction amount information, and LEFT_INTERVAL can correspond to reference interval information.
[0073] Alternatively, the square root of the product of the difference information between the reference interval information and the interval information, the difference information between the appropriate amount information and the reference extraction amount information, and the ratio information between the difference information between the extraction amount information and the reference extraction amount information may be calculated as the first information.
[0074]
[0075] In this case, the first correction information can be calculated as in the above formula. The value calculated by dividing the appropriate amount information by the first correction interval information obtained according to one of the above embodiments can be confirmed as the updated estimated density information.
[0076] According to one embodiment, when the ratio information between the appropriate amount information and the extracted amount information is included in the second range, the electronic device (100) can confirm the result of dividing the appropriate amount information by the second correction interval information obtained by subtracting the second correction information from the interval information as updated estimated density information.
[0077] To calculate the second correction information, the electronic device (100) can calculate the difference information between the reference interval information and the interval information. In addition, the electronic device can calculate the difference information between the appropriate amount information and the reference extraction amount information, and the ratio information between the difference information between the extraction amount information and the reference extraction amount information.
[0078] Thereafter, the electronic device (100) can calculate the second correction information by multiplying the difference information between the reference interval information and the interval information, the difference information between the appropriate amount information and the reference extraction amount information, the ratio information between the difference information between the extraction amount information and the reference extraction amount information, and the square root of the difference information with 1.
[0079]
[0080] Such second correction information can be expressed according to the above formula.
[0081] Alternatively, the square root of the product of the difference information between the reference interval information and the interval information, the difference information between the appropriate amount information and the reference extraction amount information, the ratio information between the difference information between the extraction amount information and the reference extraction amount information, and the difference information with 1 may be calculated as the first information.
[0082]
[0083] In this case, the second correction information can be calculated as in the above formula. The second correction interval information obtained according to one of the above embodiments can be divided into the appropriate amount information and the calculated value can be confirmed as updated estimated density information.
[0084] The update process of estimated density information, including additional processes such as exception handling, will be described with reference to Figures 5a and 5b, which are expressed in code.
[0085] Figures 5a and 5b are examples of code for updating estimated density information according to each embodiment.
[0086] Referring to Fig. 5a, similar to the process described above, it can be confirmed that the code is executed when MIN_DENSITY is 0.5 or more and 1.0 or less, when it is greater than 1.0, and when it is less than 0.5.
[0087] If MIN_DENSITY of Fig. 5a exceeds 1.0, first, the MIN_INTERVAL value, which is interval information, can be stored in the PREV_INTERVAL variable. Then, it can be checked whether the extraction amount information MIN_COUNT is the same as the reference extraction amount information LEFT_COUNT. This process may be for exception handling when MIN_COUNT and LEFT_COUNT are the same, since MIN_COUNT - LEFT_COUNT is entered as the denominator when calculating the first correction information. If MIN_COUNT is the same as LEFT_COUNT, MIN_INTERVAL can be increased by the difference between MIN_INTERVAL and the reference interval information LEFT_INTERVAL. Afterwards, RIGHT_INTERVAL and MIN_INTERVAL can be compared to select a smaller value. Here, RIGHT_INTERVAL may be a value used to store interval information at a given point in time whenever an update is performed to increase the estimated density information, as one of the past interval information. Initially, RIGHT_INTERVAL may be set to a value obtained by subtracting the initial MIN_INTERVAL from MAX_CURSOR, which is the upper threshold of the entire time range corresponding to the entire data, plus 1. This may be a configuration to ensure that, in exception handling, the first correction interval information is set to be equal to or smaller than RIGHT_INTERVAL.
[0088] If MIN_COUNT and LEFT_COUNT are different, the first correction information can be generated through the above-described process, and then the first correction interval information can be generated using this. That is, as illustrated, the electronic device (100) stores, in MIN_DENSITY, information on the difference between the appropriate amount information and the reference extraction amount information, and information on the ratio of the difference between the extraction amount information and the reference extraction amount information, and then, after confirming the value obtained by multiplying the square root of the value stored in MIN_DENSITY by the difference information between the interval information and the reference interval information as the first correction information, the first correction information can be added to the interval information to generate the first correction interval information. Thereafter, as an exception processing, the first correction interval information can be compared with the preset maximum interval information, and the smaller value of the two can be used. This may be a process that prevents a value larger than the maximum interval information from being used as interval information. Afterwards, MIN_INTERVAL, that is, PREV_INTERVAL, which stores interval information before correction, is compared with LEFT_INTERVAL, which is reference interval information, and if PREV_INTERVAL is greater than LEFT_INTERVAL, LEFT_INTERVAL, which is reference interval information, can be updated with the PREV_INTERVAL value, and LEFT_COUNT, which is reference extraction amount information, can be updated with the MIN_COUNT value, which is extraction amount information.
[0089] In contrast, if MIN_DENSITY is less than 0.5, RIGHT_INTERVAL and MIN_INTERVAL can be compared first. If RIGHT_INTERVAL is larger, RIGHT_INTERVAL can be updated to the value of MIN_INTERVAL, and RIGHT_COUNT, which is one of the past extraction amount information, can be updated to the value of MIN_COUNT. Thereafter, as described above, MIN_DENSITY stores the difference information between the appropriate amount information and the reference extraction amount information and the ratio information between the difference information between the extraction amount information and the reference extraction amount information, and multiplies the square root of 1-MIN_DENSITY by the difference information between the interval information and the reference interval information to check the second correction information, and then the second correction interval information can be calculated.
[0090] Through this process, you can obtain the maintained MIN_INTERVAL or the increased / decreased MIN_INTERVAL value, and divide AVG_FETCH_ROW_COUNT by MIN_INTERVAL to update ROWS_PER_CURSOR, i.e., the estimated density information.
[0091] FIG. 5b is an example diagram of code for updating estimated density information according to an embodiment different from FIG. 5a.
[0092] Fig. 5b is slightly different from Fig. 5a in that when MIN_DENSITY exceeds 1.0, the case where MIN_COUNT is not equal to LEFT_COUNT is different. That is, after storing the difference information between the proper amount information and the reference extraction amount information and the difference information between the extraction amount information and the reference extraction amount information in the MIN_DENSITY value, and then, if the ratio value is greater than 1, a value calculated in the same manner as the first correction interval information can be first added to the interval information. In addition, if the ratio value is less than 0.5, a value calculated in the same manner as the second correction interval information can be subtracted from the interval information. Thereafter, the first correction interval information can be obtained by adding the first correction interval information described above back to the interval information. The other processes may be the same as Fig. 5a.
[0093] Figure 6 illustrates a block diagram of an electronic device according to one embodiment.
[0094] The electronic device (100) may include, according to one embodiment, a memory (101) and a processor (102). The electronic device (100) illustrated in FIG. 9 only illustrates components related to the present embodiment. Therefore, those skilled in the art will appreciate that, in addition to the components illustrated in FIG. 9, other general-purpose components may be included. In one embodiment, the processor (102) may be included in a controller.
[0095] The processor (102) can control the overall operation of the electronic device (100) and process data and signals. The processor (102) can be composed of at least one hardware unit. In addition, the processor (102) can operate by one or more software modules generated by executing program codes stored in the memory (101). The processor (102) can include a memory, and the processor (102) can control the overall operation of the electronic device (100) and process data and signals by executing program codes stored in the memory.
[0096] The processor (102) may be configured to perform at least a part of the query by, when a query for extracting data corresponding to a selected time range from a database is confirmed, confirming appropriate amount information related to an appropriate extraction amount of rows, confirming interval information corresponding to at least a part of the time range based on estimated density information related to an hourly storage amount of rows and the appropriate amount information, and extracting at least a part of the rows of the data corresponding to the interval information.
[0097] Depending on the embodiment, the electronic device (100) may additionally include a transceiver for performing wired / wireless communication. The electronic device (100) may communicate with an external electronic device using the transceiver. The external electronic device may be a terminal or a server. In addition, the communication technologies used by the transceiver may include GSM (Global System for Mobile communication), CDMA (Code Division Multi Access), LTE (Long Term Evolution), 5G, WLAN (Wireless LAN), Wi-Fi (Wireless-Fidelity), Bluetooth (Bluetooth), RFID (Radio Frequency Identification), Infrared Data Association (IrDA), ZigBee, NFC (Near Field Communication), etc.
[0098] The electronic device according to the above-described embodiments may include a processor, a memory for storing and executing program data, permanent storage such as a disk drive, a communication port for communicating with an external device, a user interface device such as a touch panel, a key, a button, etc. The methods implemented as software modules or algorithms may be stored on a computer-readable recording medium as computer-readable codes or program instructions executable on the processor. Here, the computer-readable recording medium includes a magnetic storage medium (e.g., read-only memory (ROM), random-access memory (RAM), floppy disk, hard disk, etc.) and an optical reading medium (e.g., CD-ROM, DVD: Digital Versatile Disc)). The computer-readable recording medium may be distributed to computer systems connected to a network, so that the computer-readable code may be stored and executed in a distributed manner. The medium may be readable by a computer, stored in a memory, and executed by a processor.
[0099] The present embodiment may be represented by functional block configurations and various processing steps. These functional blocks may be implemented by various hardware and / or software configurations that perform specific functions. For example, the embodiment may employ direct circuit configurations such as memory, processing, logic, look-up tables, etc., which may perform various functions under the control of one or more microprocessors or other control devices. Similarly, the present embodiment may be implemented in a programming or scripting language such as C, C++, Java, assembler, etc., including various algorithms implemented as a combination of data structures, processes, routines, or other programming configurations. Functional aspects may be implemented as algorithms that execute on one or more processors. Furthermore, the present embodiment may employ conventional techniques for electronic configuration, signal processing, and / or data processing. Terms such as "mechanism," "element," "means," and "composition" can be used broadly and are not limited to mechanical or physical structures. These terms can also encompass a series of software routines, such as those associated with a processor.
[0100] The above-described embodiments are merely examples, and other embodiments may be implemented within the scope of the claims set forth below.
Claims
1. In a method for processing a query of an electronic device, When a query for extracting data corresponding to a selected time range is identified from a database, a step of checking appropriate information related to an appropriate extraction amount of rows; A step of checking interval information corresponding to at least a part of the time range based on the estimated density information related to the storage amount per hour of the row and the appropriate amount information; and A query processing method comprising the step of performing at least a part of the query by extracting at least a part of the rows of the data corresponding to the interval information.
2. In paragraph 1, The step of checking the above appropriate amount information is: A step of confirming the maximum amount information confirmed based on the ratio information between the buffer size of the driver operating in conjunction with the database and the maximum size of the row included in the data, and the cutoff amount information confirmed based on the ratio information between the cutoff size set for the network to which the database is connected and the average size of the row included in the data; and A query processing method further comprising a step of confirming the appropriate amount information based on at least a portion of the maximum amount information and the cutoff amount information.
3. In paragraph 2, The step of checking the above appropriate amount information is: A query processing method for confirming the result of calculating the weighted average between the above maximum amount information and the above cutoff amount information as the above appropriate amount information.
4. In paragraph 1, The steps to check the above interval information are: A step of confirming the estimated density information based on the ratio information between the total number of rows of all data included in the database and the total time range corresponding to the entire data; and A query processing method further comprising a step of confirming the ratio information between the appropriate amount information and the estimated density information as the interval information.
5. In paragraph 1, A query processing method further comprising the step of performing at least a portion of the remainder of the query by updating the interval information and further extracting at least a portion of the remainder of the data corresponding to the updated interval information.
6. In paragraph 5, A query processing method further comprising the step of sequentially extracting at least a portion of each of the data corresponding to each updated interval information by repeatedly updating the interval information until the entire query is performed.
7. In paragraph 5, The step of performing at least part of the remainder of the above query is: A step of extracting at least a portion of the rows of the data corresponding to the interval information, and confirming extraction amount information related to the actual extraction amount of the rows; A step of verifying whether the interval information satisfies an appropriate condition based on the above extraction amount information and the above appropriate amount information, and then updating the estimated density information depending on whether the appropriate condition is satisfied; and A query processing method further comprising the step of updating the interval information based on the updated appropriate amount information confirmed at the time of update and the updated estimated density information, and then further performing at least a portion of the remainder of the query by further extracting at least a portion of the remainder of the data corresponding to the updated interval information based on the updated interval information.
8. In paragraph 7, The step of updating the above estimated density information is: A query processing method in which, when the ratio information between the above-mentioned appropriate amount information and the above-mentioned extracted amount information is included in a first range corresponding to under-extraction, the interval information is determined to not satisfy the appropriate condition, and the estimated density information is updated by reducing it.
9. In paragraph 8, If the above ratio information is included in the first range, the estimated density information is updated by confirming the result of dividing the appropriate amount information by the first correction interval information obtained by adding the first correction information to the interval information as the estimated density information. A query processing method, wherein the first correction information is identified as a result of multiplying the square root of the difference information between (i) reference interval information, which is one of past interval information, and the difference information between the interval information, and (ii) the difference information between the appropriate amount information and the reference extraction amount information, which is one of past extraction amount information, and the difference information between the extraction amount information and the reference extraction amount information.
10. In paragraph 7, The step of updating the above estimated density information is: A query processing method in which, when the ratio information between the above-mentioned appropriate amount information and the above-mentioned extracted amount information is included in a second range corresponding to over-extraction, the interval information is determined to not satisfy the above-mentioned appropriate condition, and the estimated density information is updated by increasing it.
11. In paragraph 10, If the above ratio information is included in the second range, the estimated density information is updated by confirming the result of dividing the appropriate amount information by the second correction interval information obtained by subtracting the second correction information from the interval information as the estimated density information. A query processing method, wherein the second correction information is identified as the result of multiplying (i) the reference interval information, which is one of the past interval information, and the difference information between the interval information, and (ii) the difference information between the appropriate amount information and the reference extraction amount information, which is one of the past extraction amount information, and the ratio information between the extraction amount information and the reference extraction amount, and the square root of the difference information with respect to 1.
12. In paragraph 7, The step of updating the above estimated density information is: A query processing method in which, when the ratio information between the above-mentioned appropriate amount information and the above-mentioned extracted amount information is included in a third range corresponding to appropriate extraction, the interval information is determined to satisfy the appropriate condition and the estimated density information is maintained.
13. A non-transitory computer-readable recording medium having recorded thereon a program for executing the method of any one of clauses 1 to 12 on a computer.
14. As an electronic device for processing queries, An electronic device comprising a memory for storing commands and a processor connected to the memory, configured to perform at least a part of the query by, when a query for extracting data corresponding to a time range selected from a database is confirmed, confirming appropriate amount information related to an appropriate amount of rows to be extracted, confirming interval information corresponding to at least a part of the time range based on estimated density information related to an amount of storage per hour of rows and the appropriate amount information, and extracting at least a part of the rows of the data corresponding to the interval information.
Citation Information
Patent Citations
A graph computing system and method based on the Spark platform that supports spatial data management.
CN106528773B
Efficient quick data retrieval method supporting multi-dimensional retrieval
CN107766445A
Providing search results to a computing device
KR1020120037383A
USB with lost preventing function
KR1020250036326A
Solar cell type secure pole system having rest area chair
KR102477381B1