Electronic device and control method therefor
The electronic device optimizes query execution by dynamically adjusting start times and types based on resource availability, addressing inefficiencies in database management systems to evenly distribute query loads and reduce costs.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- SAMSUNG ELECTRONICS CO LTD
- Filing Date
- 2025-12-22
- Publication Date
- 2026-07-02
AI Technical Summary
Database management systems face challenges in efficiently processing complex and massive data queries due to unpredictable query concentrations, resource inefficiencies, and inflexible execution conditions, leading to performance degradation, delays, and increased costs.
An electronic device and method that dynamically distribute query execution based on resource availability, adjusting start times and query types to optimize resource utilization, including identifying optimal start times and changing query schedules as needed.
This approach evenly distributes query loads, preventing resource bottlenecks, reducing execution delays, and minimizing resource costs by optimizing query execution times and types.
Smart Images

Figure KR2025022525_02072026_PF_FP_ABST
Abstract
Description
Electronic device and control method thereof
[0001] The present disclosure relates to an electronic device and a method for controlling an electronic device, and specifically, to an electronic device capable of providing services related to a database based on a query and a method for controlling the same.
[0002] Database management systems are facing the challenge of processing increasingly complex and massive data. Recently, with the proliferation of environments requiring large-scale data analysis, real-time processing, and cloud environments, the need for technologies that efficiently utilize limited server resources is becoming increasingly prominent.
[0003] In particular, for systems that perform database-related operations based on queries, numerous queries can be executed in a short period and have diverse purposes; therefore, efficiently processing these queries without causing performance degradation or bottlenecks in the server's limited resources is a critical challenge to address.
[0004] However, conventional technology has problems such as the difficulty in predicting the timing of occurrence and the potential concentration of queries during specific time periods for spot queries generated at unspecified times due to the occurrence of users or events, as well as the difficulty in distributing queries because immediate execution is required.
[0005] Meanwhile, in the case of scheduled queries with a period, there are problems such as the fact that numerous queries are executed at a specific time (e.g., 0:00) on the date corresponding to the period, which can lead to a concentration of queries at a specific time, and that available resources and total traffic, which vary at each execution period, are not taken into account. Furthermore, these problems can be exacerbated because the method of setting conditions for query execution is not flexible.
[0006] Furthermore, the problems of the aforementioned conventional technologies can lead to issues such as delays in query execution speed, reduced data usability due to task delays, overall resource inefficiency, and increased resource purchasing costs for users.
[0007] The present disclosure is intended to solve the problems of the prior art as described above, and the purpose of the present disclosure is to provide an electronic device and a method for controlling the same that can provide database-related services in an efficient and effective manner by distributing the execution of queries according to resources.
[0008] According to one embodiment of the present disclosure for achieving the purpose described above, an electronic device comprises at least one processor including a memory for storing a database and instructions and a processing circuit, wherein when the instructions are executed individually or collectively by the at least one processor, the electronic device receives a request for a query to perform a task related to the database, and if the query is a schedule query to perform the task at a periodic rate, identifies a start time to start the task based on a end time to complete the task on a date corresponding to the period and an execution time required to perform the task, stores the period and the start time as setting information for the query, and when the date arrives, starts the task at the start time.
[0009] Meanwhile, when the above instructions are executed individually or collectively by the at least one processor, the electronic device may identify whether there is another query among a plurality of previously registered queries for performing another task related to the above task, and if the other query exists, identify the start time based on the total end time for completing the above task and the other task on the above date, and the total execution time required to perform the above task and the other task.
[0010] Meanwhile, when the above instructions are executed individually or collectively by the at least one processor, the electronic device may, upon the arrival of the said date, obtain load information indicating the load of the said task based on the traffic required for the said task, the traffic required for other tasks, and the resources of the electronic device, change the start time in the setting information based on the load information, and perform the said task at the changed start time.
[0011] Meanwhile, when the above instructions are executed individually or collectively by the at least one processor, the electronic device may obtain a score indicating the magnitude of the load currently being performed based on the load information if the query is a one-time query for performing the operation once, and if the score is less than a threshold value, perform the operation.
[0012] Meanwhile, the device may further include a communication interface, and when the instructions are executed individually or collectively by the at least one processor, the electronic device may control the communication interface to transmit the load information or information about a user interface representing the load information to an external device if the score is greater than or equal to the threshold value.
[0013] Meanwhile, when the above instructions are executed individually or collectively by the at least one processor, the electronic device may change the query into the one-time scheduled query when it receives query change information from the external device to change the query into the one-time scheduled query, identify the start time based on the end time and the execution time included in the query change information, and store the period and the start time included in the query change information as the setting information for the query.
[0014] Meanwhile, when the above instructions are executed individually or collectively by the at least one processor, the electronic device may identify the cycle and the end time based on user input, and identify the execution time based on information regarding the execution history of the task stored in the memory.
[0015] Meanwhile, when the above instructions are executed individually or collectively by the at least one processor, the electronic device may identify the start time by subtracting the execution time and a preset margin time from the end time.
[0016] According to one embodiment of the present disclosure for achieving the purpose described above, a control method for an electronic device comprises: receiving a request for a query to perform a task related to a database; if the query is a schedule query to perform the task at a periodic rate, identifying a start time to start the task based on an end time to complete the task on a date corresponding to the period and an execution time required to perform the task; storing the period and the start time as setting information for the query; and, when the date arrives, starting the task at the start time.
[0017] Meanwhile, the step of identifying the start time may include a step of identifying whether there is another query among a plurality of previously registered queries for performing other tasks related to the task, and if the other query exists, a step of identifying the start time based on the total end time for completing the task and the other task on the date and the total execution time required to perform the task and the other task.
[0018] Meanwhile, when the above date arrives, the method may further include the steps of obtaining load information indicating the load of the above task based on traffic required for the above task, traffic required for other tasks, and resources of the electronic device, changing the start time in the setting information based on the load information, and performing the above task at the changed start time.
[0019] Meanwhile, if the above query is a one-time query for performing the above task once, it may further include the step of obtaining a score representing the magnitude of the load resulting from currently performing the above task based on the load information, and the step of performing the above task if the score is less than a threshold value.
[0020] Meanwhile, if the score is greater than or equal to the threshold value, the method may further include the step of transmitting the load information or information about the user interface representing the load information to an external device.
[0021] Meanwhile, when query change information for changing the query into a one-time scheduled query is received from the external device, the method may further include the steps of changing the query into a one-time scheduled query, identifying the start time based on the end time and execution time included in the query change information, and registering the period and the start time included in the query change information as the setting information for the query.
[0022] Meanwhile, the step of identifying the start time may include the step of identifying the cycle and the end time based on user input, and the step of identifying the execution time based on information regarding the execution history of the task stored in the memory.
[0023] Meanwhile, the step of identifying the start time may include the step of identifying the start time by subtracting the execution time and a preset margin time from the end time.
[0024] A non-transient computer-readable recording medium comprising a program for executing a method of controlling an electronic device, wherein the method of controlling the electronic device comprises: receiving a request for a query to perform a task related to a database; if the query is a schedule query to perform the task at a periodic rate, identifying a start time to initiate the task based on an end time to complete the task on a date corresponding to the period and an execution time required to perform the task; storing the period and the start time as setting information for the query; and, when the date arrives, initiating the task at the start time.
[0025] Other aspects, features, and advantages of one embodiment according to the present disclosure will become more apparent from the following detailed description in conjunction with the accompanying drawings.
[0026] FIG. 1 is a flowchart illustrating a method for controlling an electronic device according to one embodiment of the present disclosure,
[0027] FIG. 2 is a flowchart illustrating a method for controlling an electronic device according to another embodiment of the present disclosure,
[0028] FIG. 3 is a graph showing the degree of dispersion of a query according to the prior art,
[0029] FIG. 4 is a graph showing the degree of dispersion of a query according to the present disclosure,
[0030] FIG. 5 is a block diagram showing the configuration of an electronic device according to the present disclosure,
[0031] FIG. 6 is a block diagram showing a plurality of modules according to the present disclosure, and,
[0032] FIG. 7 is a block diagram showing in detail the configuration of an electronic device according to the present disclosure.
[0033] The embodiments described herein are subject to various modifications and may have various forms; specific embodiments are illustrated in the drawings and described in detail in the detailed description. However, this is not intended to limit the scope of specific embodiments and should be understood to include various modifications, equivalents, and / or alternatives of the embodiments of the present disclosure. In relation to the description of the drawings, similar reference numerals may be used for similar components.
[0034] In describing the present disclosure, if it is determined that a detailed description of related known functions or configurations could unnecessarily obscure the essence of the present disclosure, such detailed description is omitted.
[0035] Additionally, the following embodiments may be modified in various other forms, and the scope of the technical concept of the present disclosure is not limited to the following embodiments. Rather, these embodiments are provided to make the present disclosure more faithful and complete and to fully convey the technical concept of the present disclosure to those skilled in the art.
[0036] The terms used in this disclosure are used merely to describe specific embodiments and are not intended to limit the scope of the rights. The singular expression includes the plural expression unless the context clearly indicates otherwise.
[0037] In the present disclosure, expressions such as “have,” “may have,” “include,” or “may include” indicate the presence of such features (e.g., numerical values, functions, actions, or components such as parts) and do not exclude the presence of additional features.
[0038] In the present disclosure, expressions such as “A or B,” “at least one of A or / and B,” or “one or more of A or / and B” may include all possible combinations of items listed together. For example, “A or B,” “at least one of A and B,” or “at least one of A or B” may refer to cases including (1) at least one A, (2) at least one B, or (3) both at least one A and at least one B.
[0039] Expressions such as "first," "second," "first," or "second" used in this disclosure may modify various components regardless of order and / or importance, and are used only to distinguish one component from another and do not limit said components.
[0040] Where it is stated that a certain component (e.g., a first component) is "(operatively or communicatively) coupled with / to" or "connected to" another component (e.g., a second component), it should be understood that the said certain component may be directly connected to the said other component or connected through another component (e.g., a third component).
[0041] On the other hand, when it is stated that a certain component (e.g., a first component) is "directly connected" or "directly coupled" to another component (e.g., a second component), it may be understood that no other component (e.g., a third component) exists between said certain component and said other component.
[0042] As used in this disclosure, the expression “configured to” may be replaced, depending on the context, with, for example, “suitable for,” “having the capacity to,” “designed to,” “adapted to,” “made to,” or “capable of.” The term “configured to” may not necessarily mean only “specifically designed to” in hardware.
[0043] Instead, in some situations, the expression “device configured to do something” may mean that the device is “capable of doing something” together with other devices or components. For example, the phrase “processor configured (or set) to perform A, B, and C” may mean a dedicated processor for performing those operations (e.g., an embedded processor), or a generic-purpose processor (e.g., a CPU or application processor) capable of performing those operations by executing one or more software programs stored in a memory device.
[0044] In the embodiments, a 'module' or 'part' performs at least one function or operation and may be implemented in hardware or software, or a combination of hardware and software. Additionally, a plurality of 'modules' or a plurality of 'parts' may be integrated into at least one module and implemented by at least one processor, except for the 'module' or 'part' that needs to be implemented in specific hardware.
[0045] Meanwhile, various elements and areas in the drawings are depicted schematically. Accordingly, the technical concept of the present invention is not limited by the relative sizes or spacing depicted in the attached drawings.
[0046] Hereinafter, embodiments according to the present disclosure are described in detail with reference to the attached drawings so that those skilled in the art can easily implement them.
[0047] FIG. 1 is a flowchart illustrating a control method of an electronic device (100) according to one embodiment of the present disclosure.
[0048] The ‘electronic device (100)’ according to the present disclosure refers to a device capable of providing services related to a database based on a query. For example, the electronic device (100) may be implemented as a server including a database management system (DBMS, Database Management System, or platform) and may provide various services based on a query for interaction between users. However, there are no special limitations on the type of the electronic device (100) according to the present disclosure.
[0049] In the present disclosure, the term 'query' may collectively refer to commands or requests for performing tasks or jobs or operations related to a database. Specifically, a query may include commands or requests used to search, modify, delete, insert, and analyze data stored in a database. Queries are written to interact with a database management system and may primarily use languages such as SQL (Structured Query Language).
[0050] Meanwhile, for the sake of convenience of explanation below, the target query may be simply referred to as 'query' or 'target query,' and the task corresponding to the target query, that is, the task performed by the target query, may be simply referred to as 'task' or 'target task.'
[0051] As illustrated in FIG. 1, the electronic device (100) may receive a request for a query to perform operations related to a database (S110). Here, the 'request for a query' may include a 'request for registration' for the query and a 'reset request' for the query. The request for a query may be received based on user input received by the electronic device (100), the occurrence of a pre-set event, or information received from an external device, etc.
[0052] 'Registration for a query' may refer to writing and saving specific operations (e.g., searching, modifying, deleting, inserting, and analyzing data) as a single query when it is necessary to perform them one-time or repeatedly in a database.
[0053] 'Resetting a query' may mean adding, deleting, or changing the configuration information stored when registering a query. For example, if the query is a scheduled query, when an event occurs indicating that a pre-set time or period has arrived, the electronic device (100) can identify that a request to reset the query has been received based on the occurrence of the event.
[0054] Here, the pre-configured time or period may be the execution time or period of a query, or it may be a monitoring time or period configured separately. For example, the configuration information may be reset (changed / updated) whenever the pre-configured execution period arrives according to the scheduled query. In addition, the configuration information may be reset at a monitoring time or period configured for resetting the query, separate from the execution time or period of the query.
[0055] When a request for a query is received, the electronic device (100) can identify the type of target query. Specifically, the electronic device (100) can identify whether the type of target query is a scheduled query (S120). For example, the types of queries may include one-time queries, scheduled queries, and one-time scheduled queries.
[0056] A 'one-time query' refers to a query designed to perform a specific task immediately and once; it may also be referred to as a 'spot query' or 'immediate query' because it can be generated spot-based at unspecified times. A 'schedule query' refers to a query designed to perform a specific task at pre-set intervals, and thus may also be referred to as a 'periodical query.' A 'one-time scheduled query' is a query designed to perform a specific task once by scheduling it at a pre-set time; it can be distinguished from a scheduled query in that it is executed only once, and from a one-time query in that it is executed at a scheduled time rather than immediately.
[0057] Hereinafter, an embodiment related to the case where the query is a scheduled query (S120-Y) is described first, and embodiments related to the case where it is not a scheduled query (S120-N) are described below with reference to FIG. 2.
[0058] If the query is a schedule query for performing a task at a periodic rate (S120-Y), the electronic device (100) can identify a start time for starting the task based on a end time for completing the task on a date corresponding to the period and an execution time required to perform the task (S130).
[0059] In the present disclosure, 'start time' refers to a time (time) for starting a target task, 'execution time' refers to a time (length of time) required to perform a target task, and 'end time' refers to a time (time) for completing a target task. The start time, execution time, and end time may refer to a specific point in time or interval (e.g., 1:00 PM, 1 hour, etc.), but may also refer to a point in time or interval having a range (e.g., 12:55 PM to 1:05 PM, 1 hour to 1 hour 30 minutes, etc.).
[0060] If the query is a schedule query, the electronic device (100) can identify a pre-set period and end time based on user input. Specifically, the user may input user input for setting the period and user input for setting the end time to the electronic device (100) or an external device connected to the electronic device (100), together with or separately from the registration request, and the electronic device (100) can identify the period and end time based on the user input received by the electronic device (100) or the external device.
[0061] The electronic device (100) can identify the execution time required to perform a target task based on information regarding the execution history of the target task. Specifically, the electronic device (100) can determine the average of the times taken as a result of performing the target task (which may include similar tasks) as the execution time of the target task corresponding to the target query. Information regarding the execution history of the task may be stored in the memory (120) of the electronic device (100) or in the memory (120) of an external device.
[0062] Once the end time and execution time of a target task are identified, the electronic device (100) can identify the start time based on the end time and execution time. Specifically, the electronic device (100) can calculate the start time by subtracting the execution time from the end time. The electronic device (100) can identify the start time by subtracting the execution time and a preset margin time from the end time. The 'margin time' is a buffer time to ensure that the task can be completed at the end time even if an unexpected delay occurs, and can be determined or changed according to the settings of the user or developer. For example, if the end time is 24 hours, the execution time is 4 hours, and the margin time is 2 hours, the electronic device (100) can calculate 18 hours as the start time.
[0063] Meanwhile, the electronic device (100) can identify whether there is another query among the multiple pre-registered queries for performing other tasks related to the target task. Here, another task related to the target task refers to at least one task that can be performed sequentially when the target task is completed. If there is another query related to the target task, the electronic device (100) can identify the start time of the target task based on the total end time for completing the target task and other tasks on a date corresponding to a pre-set cycle, and the total execution time required to perform the target task and other tasks.
[0064] For example, if the target task is the first task and the second task and the third task are set to be performed sequentially following the first task, the electronic device (100) can calculate the start time of the first task by subtracting 8 hours, which is the total execution time required to perform the first task, the second task, and the third task, from 15 hours, which is the end time of the third task.
[0065] Although the above description is based on the premise that other tasks related to the target task are performed after the target task is completed, the embodiments according to the present disclosure may be similarly applied even when the target task is performed after other tasks are completed. That is, the electronic device (100) can identify the start time of other tasks based on the total end time for completing the target task and other tasks, and the total execution time required to perform the target task and other tasks.
[0066] In the foregoing, an operation for identifying a start time for a target task as a trigger condition for a target task based on the end time and execution time of the target task has been described, but the present disclosure is not limited thereto. For example, an electronic device (100) may obtain information regarding a start time based on user input and determine a start time for a target task by using the information regarding the start time together with information regarding the end time and execution time of the target task. In this case, the electronic device (100) may identify the earlier of the start time based on the information regarding the start time and the start time based on the end time and execution time of the target task as the start time for the target task.
[0067] The electronic device (100) can store a pre-set period and start time as setting information for the query (S140). If the request for the query is a registration request, the electronic device (100) can register the target query and store the pre-set period and start time as setting information for the target query. In particular, if the target query is a schedule query, the electronic device (100) can generate a query containing setting information for performing the target task at the identified start time at each pre-set period and store it in the memory (120) of the electronic device (100). If the request for the query is a reset request, the electronic device (100) can reset (change / update) the information for the target query and store it.
[0068] For example, the electronic device (100) can determine one of various types, such as a procedure for sequentially performing complex storage operations, a view for referencing a virtual table for querying specific data, a user-defined function for returning a function value or a table, and can register / reset a query with the determined type.
[0069] When a date corresponding to a preset cycle arrives, the electronic device (100) can start the operation at the identified start time (S150). Specifically, when a date corresponding to a preset cycle arrives, the electronic device (100) can start the operation at the identified start time, that is, at the start time stored in the setting information.
[0070] Meanwhile, the electronic device (100) may obtain information indicating the load when performing a target task before registering query and setting information, and determine the start time by taking this into consideration. Additionally, the electronic device (100) may update the start time when a pre-set period arrives after registering the query and setting information. Although the following description will explain the operation of updating the start time after first registering the query and setting information, the following operation may be performed before registering the query and setting information.
[0071] Specifically, when a date corresponding to a preset cycle arrives, the electronic device (100) can obtain load information indicating the load of the target task based on the traffic required for the target task, the traffic required for other tasks, and the resources of the electronic device (100).
[0072] The traffic required for a target operation can be determined based on the size of the table referenced by the target query, the depth of the query indicating the level of nesting of the query if the target query is a multiple query, whether the target query includes commands that increase complexity (e.g., SQL outer join, unnest, pivot, window, script, etc.), and whether a table similar to the table referenced by the target query exists in the cache.
[0073] Here, 'other tasks' refer to tasks corresponding to other queries registered in the configuration information, and the traffic required for other tasks can be determined in the same way as the traffic required for the target task.
[0074] "Load information" may collectively refer to information indicating the extent of the load when performing a target task in light of the resources of the electronic device (100). Load information may include information indicating the current load of the target task as well as information indicating the future load. Load information may include time-series information of the load according to the target task during the current time and a predetermined future time (e.g., the next 12 hours).
[0075] The electronic device (100) can change the start time in the setting information based on load information and perform the work at the changed start time. For example, the electronic device (100) can identify at least one time zone (time interval) in which the overload of resources is not caused when performing the target work during the current time or a predetermined future time, change the start time of the earliest time zone among the at least one time zone to the start time for the target work, and perform the work at the changed start time.
[0076] As in the example described above, the end time is 24 hours, the execution time is 4 hours, and the margin time is 2 hours, and thus 18:00 is identified as the start time and stored as setting information. When the date corresponding to the cycle arrives, the electronic device (100) can identify whether an overload will occur when performing a target task with 18:00 as the start time based on load information (or based on load information and information about the task (or job) that is being executed or scheduled). If it is identified that no overload will occur, the electronic device (100) can start the target task at 18:00. If it is identified that an overload will occur, the electronic device (100) can change the time for starting the target task.
[0077] Specifically, the electronic device (100) can identify, based on load information, that performing a target task between 06:00 and 08:00 and between 12:00 and 14:00 does not result in an overload of resources. In this case, the electronic device (100) can change the start time for the target task to 06:00, which is the start time of the earliest of the two time zones of 06:00 and 08:00 and between 12:00 and 14:00, and perform the task at the changed start time.
[0078] In other words, the electronic device (100) can change the start time of the task corresponding to the query by taking into account the overall resource situation, setting the start time of the task corresponding to the query to the earliest possible time if there is a surplus of available resources, and delaying the start time of the task corresponding to the query to the latest possible time if there is a shortage of available resources.
[0079] The action of changing the start time in the configuration information based on load information and the action of performing the work at the changed start time may be performed not only at the time of query registration and the time of query execution (or execution cycle), but also at a separately configured monitoring time (or monitoring cycle).
[0080] According to the embodiment described above with reference to FIG. 1, the electronic device (100) can provide database-related services in an efficient and effective manner relative to the resources of the electronic device (100) by distributing the execution of queries according to the resources.
[0081] In particular, according to the present disclosure, the electronic device (100) can separate the cycle and start time of a target task when registering and resetting a schedule query. Additionally, the electronic device (100) can identify the start time of a target task by calculating backward from the end time without fixing it when registering and resetting a schedule query. Furthermore, the electronic device (100) can identify the start time by taking into account the execution of other tasks related to the target task. Moreover, the electronic device (100) can set optimal task execution conditions by repeatedly updating the start time while considering load information.
[0082] As a result, the electronic device (100) can resolve the problem of queries being concentrated in specific time periods, and accordingly, problems such as delays in query execution speed, reduced usability of data due to work delays, inefficiency of overall resources, and increased resource purchase costs for users can be resolved.
[0083] FIG. 2 is a flowchart illustrating a control method of an electronic device (100) according to another embodiment of the present disclosure.
[0084] In the above description, an embodiment related to the case where the query is a scheduled query (S120-Y) was described with reference to FIG. 1. Below, embodiments related to the case where the query is not a scheduled query (S120-N) will be described.
[0085] As illustrated in FIG. 2, the electronic device (100) may receive a request for a query to perform a task related to a database (S210). If the query is a one-time query to perform the task once (S220), the electronic device (100) may obtain load information indicating the load of the target task based on the traffic required for the task, the traffic required for other tasks, and the resources of the electronic device (100) (S230). Since the above steps have been described in detail in the description of FIG. 1, a redundant description of the same content is omitted.
[0086] The electronic device (100) can obtain a score indicating the magnitude of the load resulting from currently performing a target task based on load information (S240). Then, if the score is less than a threshold value (S250-Y), the electronic device (100) can perform the target task (S260).
[0087] In other words, if the score is below a threshold value, it is identified that performing the current target task will not cause an overload, so the electronic device (100) can perform the target task immediately. This is because if the target query is a one-time query, performing the target task immediately is likely to meet the user's intention. Instead of a score, a level representing a score within a certain range may be used.
[0088] If the score is greater than or equal to a threshold value (S250-N), the electronic device (100) can provide load information (S270). For example, if the score is greater than or equal to a threshold value, the electronic device (100) can transmit the load information to an external device (e.g., a user terminal, etc.) and can transmit information about a user interface containing the load information to the external device. The electronic device (100) may also display a user interface containing the load information on the display of the electronic device (100).
[0089] In other words, if the score is above a threshold value, the electronic device (100) can induce the user to change the query to a one-time scheduled query by notifying the user that an overload may occur when performing the target task.
[0090] For example, the user interface may include load information, and thus may include information indicating the extent of the load when performing the target task in light of the resources. The user interface may include time-series information on the load associated with the target task for the current time and a predetermined future time (e.g., the next 12 hours). The user interface may represent the magnitude of the load associated with performing the target task as a numerical value or as a color, such as a traffic light.
[0091] When query change information for changing to a one-time reservation query is received (S275-Y), the electronic device (100) can change the query to a one-time reservation query (S280). For example, if information regarding the end time is received from the user's external device, or if user input regarding the end time is received by the electronic device (100), this is for the user to change the query to a one-time reservation query, and it can be interpreted that query change information for changing to a one-time reservation query based on user input has been received.
[0092] Specifically, the electronic device (100) can identify the start time of a target task based on the end time and execution time of the target task (S290). Additionally, the electronic device (100) can store the identified start time as setting information for a query (S295).
[0093] Meanwhile, if query change information for changing to a one-time reservation query is not received (S275-N), the electronic device (100) can identify whether a request to continue the operation for the query has been received (S285). If a request to continue is received (S285-Y), the electronic device (100) can perform the operation (S260), and if a request to continue is not received (e.g., if a request to terminate is received or if no request is received for a critical time), the operation can be terminated.
[0094] Although an embodiment related to changing a one-time query into a one-time scheduled query has been described above, an embodiment of changing a one-time query into a scheduled query, that is, a periodic query, is also possible. Specifically, when information / user input regarding the period and end time is received, this can be interpreted as the user changing the query into a scheduled query, and therefore, in this case, the electronic device (100) can perform operations according to the embodiments described above with reference to FIG. 1. For example, the electronic device (100) can register the period and start time as setting information for the query. Furthermore, when a date corresponding to the pre-set period arrives, the electronic device (100) can start the operation at the identified start time and may change (reset) the setting information including the start time.
[0095] The above describes an embodiment related to providing load information to a user and inducing the user to change the query to a one-time scheduled query when the score is above a threshold value. According to another embodiment, when the score is above a threshold value, at least one time period (time interval) in which a resource overload is not caused when performing a target task during the current time or a predetermined future time is identified based on the load information, and the target task can be performed at the start time of the earliest time period among the at least one time period. Furthermore, the electronic device (100) can provide load information when at least one time period in which a resource overload is not caused is not identified even up to a predetermined future time.
[0096] According to the embodiment described above with reference to FIG. 2, the electronic device (100) can provide database-related services in an efficient and effective manner relative to resources by immediately executing a target task or inducing a change to a one-time scheduled query depending on whether an overload on resources is caused in the case of a one-time query.
[0097] FIG. 3 is a graph showing the degree of dispersion of a query according to the prior art, and FIG. 4 is a graph showing the degree of dispersion of a query according to the present disclosure.
[0098] As mentioned above, according to the prior art, resource usage due to one-time (spot) queries and resource usage due to tasks due to scheduled queries may be concentrated in specific time periods.
[0099] The first graph (310) of FIG. 3 shows the resource usage (or traffic) of a one-time query over approximately 8 days according to the prior art, and the second graph (320) of FIG. 3 shows the resource usage of a scheduled query over approximately 8 days according to the prior art.
[0100] As illustrated in FIG. 3, according to the prior art, resource usage for both one-time queries and scheduled queries is not evenly distributed by time of day, and high usage is observed during specific time periods. For example, one-time queries may show high usage during times of high user activity, namely between 9:00 AM and 3:00 PM, while scheduled queries may show the highest usage around midnight. Furthermore, if the periods of high usage for one-time queries and the periods of high resource usage for scheduled queries overlap, resource inefficiency can become severe.
[0101] On the other hand, according to the present disclosure, the electronic device (100) can identify the optimal task start time relative to resources according to embodiments such as separating the cycle and start time of the target task when registering and resetting the schedule query, and identifying the start time of the target task by calculating backward from the end time. In addition, the electronic device (100) can maximize resource efficiency by immediately executing the target task or inducing a change to the schedule query depending on whether performing the target task in the case of a one-time query causes an overload on resources.
[0102] The first graph (410) of FIG. 4 shows the resource usage of a one-time query for about 8 days according to the present disclosure, and the second graph (420) of FIG. 4 shows the resource usage of a scheduled query for about 8 days according to the present disclosure.
[0103] As illustrated in FIG. 4, according to the present disclosure, it can be seen that the resource usage of both one-time queries and scheduled queries is not concentrated in specific time periods but is evenly distributed compared to the prior art.
[0104] Ultimately, according to the present disclosure, the electronic device (100) can resolve the problem of queries being concentrated at specific times, and accordingly, can resolve problems such as delays in query execution speed, reduced usability of data due to work delays, inefficiency of overall resources, and increased resource purchase costs for users.
[0105] FIG. 5 is a block diagram showing the configuration of an electronic device (100) according to the present disclosure. FIG. 6 is a block diagram showing a plurality of modules according to the present disclosure.
[0106] As illustrated in FIG. 5, the electronic device (100) may include memory (120) and a processor (130).
[0107] At least one instruction regarding an electronic device (100) may be stored in the memory (120). Additionally, an operating system (O / S) for operating the electronic device (100) may be stored in the memory (120). Furthermore, various software programs or applications for operating the electronic device (100) may be stored in the memory (120) according to various embodiments of the present disclosure. Additionally, the memory (120) may include semiconductor memory such as flash memory or magnetic storage media such as a hard disk.
[0108] Specifically, various software modules for operating an electronic device (100) according to various embodiments of the present disclosure may be stored in the memory (120), and the processor (130) may control the operation of the electronic device (100) by executing the various software modules stored in the memory (120). That is, the memory (120) is accessed by the processor (130), and reading / writing / modifying / deleting / updating of data by the processor (130) may be performed.
[0109] Meanwhile, in the present disclosure, the term memory (120) may be used to include memory (120), ROM, RAM, or a memory card (e.g., micro SD card, memory stick) mounted in the electronic device (100) within the processor (130).
[0110] In one embodiment, the memory (120) may store a database according to the present disclosure, information about a task corresponding to a query, a request for registration of the query, a result of registration of the query, a request for resetting of the query, and a result of resetting of the query. The memory (120) may store information about the execution cycle, end time, start time, execution time, etc. of a target task. The memory (120) may store information about the resources of the electronic device (100), information about traffic per task, and load information.
[0111] In addition, various information necessary within the scope of achieving the purpose of the present disclosure may be stored in the memory (120), and the information stored in the memory (120) may be updated as it is received from an external device or input by a user.
[0112] The processor (130) controls the overall operation of the electronic device (100). Specifically, the processor (130) is connected to the configuration of the electronic device (100) including a memory (120), and can control the overall operation of the electronic device (100) by executing at least one instruction stored in the memory (120) as described above.
[0113] The processor (130) can be implemented in various ways. For example, the processor (130) can be implemented as at least one of an Application Specific Integrated Circuit (ASIC), an embedded processor, a microprocessor, hardware control logic, a hardware Finite State Machine (FSM), and a Digital Signal Processor (DSP). Meanwhile, in this disclosure, the term processor (130) may be used to include a CPU (Central Processing Unit), a GPU (Graphic Processing Unit), and an MPU (Micro Processor Unit), etc.
[0114] In one embodiment, the processor (130) may implement various embodiments for providing database-related services by distributing the execution of queries. For example, the processor (130) may receive a request for a query to perform a database-related task. If the query is a scheduled query to perform a task at a periodic rate, the processor (130) may identify a start time to initiate the task based on the end time to complete the task on the date corresponding to the period and the execution time required to perform the task. The processor (130) may store the period and the start time as configuration information for the query. Then, when the date corresponding to the period arrives, the processor (130) may initiate the task at the start time.
[0115] The processor (130) can implement the embodiments described above with reference to FIGS. 1 to 4 using a plurality of modules. As shown in FIG. 6, the plurality of modules may include a query type identification module (610), a query analysis module (620), a query registration / resetting module (630), a query resetting module (650), a load monitoring module (640), a query execution module (660), and a new job execution / waiting monitoring module (670). Below, an exemplary case in which an embodiment according to the present disclosure is implemented through a plurality of modules will be described.
[0116] When a request for a query to perform a task related to a database is received, the processor (130) can identify the type of the target query through the query type identification module (610). For example, the processor (130) can identify through the query type identification module (610) whether the target query is a scheduled query to perform the target task periodically or a one-time query to perform the target task once.
[0117] The processor (130) can perform an analysis of when it is appropriate to perform a target task based on the type of query through the query analysis module (620). For example, the processor (130) can identify a start time to initiate a task based on the end time for completing the task on a date corresponding to the cycle and the execution time required to perform the task through the query analysis module (620).
[0118] The processor (130) can identify whether there are other queries related to the target task through the query analysis module (620). If other queries exist, the processor (130) can identify the start time of the target task through the query analysis module (620), based on the total end time for completing the target task and other tasks on a date corresponding to a preset cycle, and the total execution time required to perform the target task and other tasks.
[0119] The processor (130) can register a target query and configuration information therefor through the query registration module (630). Specifically, the processor (130) can register a pre-configured period and start time as configuration information for the query through the query registration module (630).
[0120] The processor (130) can obtain load information indicating the load of a target task based on the traffic consumed by the target task, the traffic consumed by other tasks, and the resources of the electronic device (100) through the load monitoring module (640). The processor (130) can provide the load information to the query analysis module (620) so that the query analysis module (620) can reflect the load information in the analysis of when it is appropriate to perform the target task.
[0121] The processor (130) can change the registered configuration information through the query reset module (650). Specifically, the processor (130) can change the start time in the configuration information based on load information through the query reset module (650) and perform the work at the changed start time.
[0122] The processor (130) can execute a registered query according to the registered configuration information through the query execution module (660). Specifically, when a target query and its configuration information are registered through the query registration module (630), or when the configuration information for the target query is updated through the query reset module (650), the processor (130) can execute the registered query according to the registered configuration information through the query execution module (660).
[0123] The processor (130) can monitor whether to execute or wait for a new task through the new task execution / waiting monitoring module (670), and can change the registered setting information by inputting the monitoring results into the query reset module (650). At this time, the query reset module (650) can change the start time in the setting information by considering not only the load information obtained through the load monitoring module (640) but also the information on tasks that are executed or scheduled to be executed after the query execution, and can perform the task at the changed start time.
[0124] Various embodiments according to the present disclosure based on the control of the processor (130) have been described in detail with reference to FIGS. 1 to 4, so a redundant description is omitted.
[0125] FIG. 7 is a block diagram showing in detail the configuration of an electronic device (100) according to the present disclosure.
[0126] As illustrated in FIG. 7, the electronic device (100) may further include a communication interface (140), an input interface (150), and an output interface (160), in addition to the memory (120) and the processor (130). However, the configurations illustrated in FIG. 5 and FIG. 7 are merely exemplary, and it is understood that in carrying out the present disclosure, new configurations may be added or some configurations may be omitted in addition to the configurations illustrated in FIG. 5 and FIG. 7.
[0127] The communication interface (140) includes a circuit and can perform communication with an external device. Specifically, the processor (130) can receive various data or information from an external device connected through the communication interface (140) and can also transmit various data or information to the external device.
[0128] The communication interface (140) may include at least one of a WiFi module, a Bluetooth module, a wireless communication module, an NFC module, and an Ultra-Wide Band (UWB) module. Specifically, the WiFi module and the Bluetooth module can each perform communication using the WiFi method and the Bluetooth method. When using the WiFi module or the Bluetooth module, various connection information such as SSID is first transmitted and received, and then various information can be transmitted and received after establishing a communication connection using this information.
[0129] In addition, the wireless communication module can perform communication according to various communication standards such as IEEE, Zigbee, 3G (3rd Generation), 3GPP (3rd Generation Partnership Project), LTE (Long Term Evolution), and 5G (5th Generation). Furthermore, the NFC module can perform communication using the NFC (Near Field Communication) method, which utilizes the 13.56 MHz band among various RF-ID frequency bands such as 135 kHz, 13.56 MHz, 433 MHz, 860~960 MHz, and 2.45 GHz. Additionally, the UWB module can accurately measure the Time of Arrival (ToA), which is the time it takes for a pulse to reach a target, and the Angle of Arrival (AoA), which is the angle of arrival of the pulse at the transmitting device, through communication between UWB antennas. Accordingly, precise distance and location recognition within an error range of tens of centimeters indoors is possible.
[0130] The input interface (150) includes a circuit, and the processor (130) can receive user commands to control the operation of the electronic device (100) through the input interface (150). Specifically, the input interface (150) may be composed of components such as a microphone, a camera, and a remote control signal receiver. Additionally, the input interface (150) may be implemented in a form included in a display as a touch screen. In particular, the microphone can receive a voice signal and convert the received voice signal into an electrical signal.
[0131] The output interface (160) includes a circuit, and the processor (130) can output various functions that the electronic device (100) can perform through the output interface (160). Also, the output interface (160) may include at least one of a display, a speaker, and an indicator.
[0132] The display can output image data under the control of the processor (130). Specifically, the display can output an image stored in the memory (120) under the control of the processor (130). In particular, the display according to one embodiment of the present disclosure may display a user interface stored in the memory (120). The display may be implemented as an LCD (Liquid Crystal Display Panel), OLED (Organic Light Emitting Diodes), etc., and the display may also be implemented as a flexible display, a transparent display, etc. depending on the case. However, the display according to the present disclosure is not limited to a specific type.
[0133] The speaker can output audio data under the control of the processor (130). The indicator can be lit under the control of the processor (130). Specifically, the indicator can be lit in various colors under the control of the processor (130). For example, the indicator can be implemented as an LED (Light Emitting Diodes), LCD (Liquid Crystal Display Panel), VFD (Vacuum Fluorescent Display), etc., but is not limited thereto.
[0134] In one embodiment, if the query is identified as a one-time query and the score indicating the magnitude of the load resulting from the current execution of the target task is greater than or equal to a threshold value, the processor (130) may control the communication interface (140) to transmit load information to an external device (e.g., a user terminal). Additionally, the processor (130) may control the interface to transmit information about a user interface containing load information to an external device, in which case the user interface may be displayed on the display of the external device.
[0135] If the score indicating the magnitude of the load resulting from the current performance of the target task is greater than or equal to a threshold value, the processor (130) can control the output interface (160) to provide load information. In particular, the processor (130) may also control the output interface (160) to display a user interface containing load information.
[0136] For example, a user interface displayed on the display of an electronic device (100) and / or on the display of an external device may include load information, and thus may include information indicating the extent of the load when performing a target task in light of resources. The user interface may include time-series information of the load according to the target task for the current time and a predetermined future time (e.g., the next 12 hours). The user interface may indicate the magnitude of the load according to the target task as a number or as a color, such as a traffic light.
[0137] After load information is provided, if information regarding the period and end time is received from the user's external device through the communication interface (140), the processor (130) can change the query into a schedule query. Even if user input regarding the period and end time is received through the input interface (150) after load information is provided, the processor (130) can change the query into a schedule query.
[0138] Meanwhile, the control method of the electronic device (100) described with reference to FIGS. 1 to 4 may be implemented as a program and provided to the electronic device (100). In particular, the program including the control method of the electronic device (100) may be stored and provided on a non-transitory computer-readable medium.
[0139] Specifically, in a non-transient computer-readable recording medium comprising a program for executing a control method of an electronic device (100), the control method of the electronic device (100) may include: receiving a request for registration of a query for performing a task related to a database; if the query is a schedule query for performing a task at a periodic rate, identifying a start time for starting a task based on an end time for completing the task on a date corresponding to the period and an execution time required to perform the task; registering the period and the start time as setting information for the query; and when the date arrives, starting the task at the start time.
[0140] Although a method for controlling an electronic device (100) and a computer-readable recording medium including a program for executing the method for controlling the electronic device (100) have been briefly described above, this is merely to avoid redundant descriptions, and it is obvious that various embodiments of the electronic device (100) can also be applied to a method for controlling the electronic device (100) and a computer-readable recording medium including a program for executing the method for controlling the electronic device (100).
[0141] A device-readable storage medium may be provided in the form of a non-transitory storage medium. Here, 'non-transitory storage medium' simply means that it is a tangible device and does not contain a signal (e.g., electromagnetic waves), and the term does not distinguish between cases where data is stored semi-permanently and cases where it is stored temporarily. For example, a 'non-transitory storage medium' may include a buffer in which data is stored temporarily.
[0142] According to one embodiment, the method according to the various embodiments disclosed herein may be provided by being included in a computer program product. The computer program product may be traded between a seller and a buyer as a product. The computer program product may be distributed in the form of a device-readable storage medium (e.g., compact disc read-only memory (CD-ROM)) or an application store (e.g., Play Store). TM It can be distributed online (e.g., downloaded or uploaded) through ) or directly between two user devices (e.g., smartphones). In the case of online distribution, at least a portion of the computer program product (e.g., downloadable app) may be temporarily stored or temporarily created in a device-readable storage medium such as the memory (120) of the manufacturer's server, the application store's server, or the relay server.
[0143] Each component (e.g., module or program) according to the various embodiments of the present disclosure as described above may be composed of a single or multiple entities, and some of the aforementioned sub-components may be omitted, or other sub-components may be further included in the various embodiments. Generally or additionally, some components (e.g., module or program) may be integrated into a single entity to perform the same or similar functions as those performed by each of the respective components prior to integration.
[0144] Operations performed by a module, program, or other component according to various embodiments may be executed sequentially, in parallel, iteratively, or heuristically, or at least some operations may be executed in a different order, omitted, or other operations may be added.
[0145] Meanwhile, the terms “part” or “module” as used in this disclosure include a unit composed of hardware, software, or firmware, and may be used interchangeably with terms such as logic, logic block, component, or circuit, for example. A “part” or “module” may be a component formed integrally, or a minimum unit or part thereof that performs one or more functions. For example, a module may be composed of an application-specific integrated circuit (ASIC).
[0146] Various embodiments of the present disclosure may be implemented as software including instructions stored on a machine-readable storage medium (e.g., a computer). The machine may include an electronic device (100) (e.g., electronic device (100)(100)) according to the disclosed embodiments, which is a device capable of calling instructions stored from the storage medium and operating according to the called instructions.
[0147] When the above command is executed by the processor (130), the processor (130) may perform a function corresponding to the command using other components, either directly or under the control of the processor (130). The command may include code generated or executed by a compiler or an interpreter.
[0148] Although preferred embodiments of the present disclosure have been illustrated and described above, the present disclosure is not limited to the specific embodiments described above. It is understood that various modifications can be made by those skilled in the art without departing from the essence of the present disclosure as claimed in the claims, and such modifications should not be understood individually from the technical spirit or perspective of the present disclosure.
Claims
1. In an electronic device (100), Memory (120) for storing databases and instructions; and At least one processor (130) including a processing circuit; comprising, When the above instructions are executed individually or collectively by the at least one processor (130), the electronic device (100), Receives a request for a query to perform operations related to the above database, and If the above query is a schedule query for performing the above task at periodic intervals, the start time for initiating the above task is identified based on the end time for completing the above task on the date corresponding to the period and the execution time required to perform the above task, and The above period and the above start time are stored as setting information for the above query, and An electronic device (100) that initiates the above work at the above start time when the above date arrives.
2. In Paragraph 1, When the above instructions are executed individually or collectively by the at least one processor (130), the electronic device (100), Identify whether there exists another query among multiple previously registered queries to perform other tasks related to the above task, and If the above other query exists, an electronic device (100) for identifying the start time based on the total end time for completing the above task and the above other task on the above date, and the total execution time required to perform the above task and the other task.
3. In Paragraph 1, When the above instructions are executed individually or collectively by the at least one processor (130), the electronic device (100), When the above date arrives, load information indicating the load of the above task is obtained based on the traffic required for the above task, the traffic required for other tasks, and the resources of the electronic device (100). Based on the above load information, change the start time in the above setting information, and An electronic device (100) that performs the above task at the above changed start time.
4. In Paragraph 3, When the above instructions are executed individually or collectively by the at least one processor (130), the electronic device (100), If the above query is a one-time query for performing the above task once, based on the above load information, a score representing the magnitude of the load resulting from currently performing the above task is obtained, and An electronic device (100) that performs the above task when the above score is less than a threshold value.
5. In Paragraph 4, It further includes a communication interface (140), When the above instructions are executed individually or collectively by the at least one processor (130), the electronic device (100), An electronic device (100) that controls the communication interface (140) to transmit information about the load information or the user interface representing the load information to an external device when the score is greater than or equal to the threshold value.
6. In Paragraph 5, When the above instructions are executed individually or collectively by the at least one processor (130), the electronic device (100), When query change information for changing the query into a one-time scheduled query is received from the above external device, the query is changed into the one-time scheduled query, and Based on the end time included in the above query change information and the above execution time, the above start time is identified, and An electronic device (100) that stores the period included in the above query change information and the above start time as the above setting information for the above query.
7. In Paragraph 1, When the above instructions are executed individually or collectively by the at least one processor (130), the electronic device (100), Based on user input, identify the above period and the above end time, and An electronic device (100) that identifies the execution time based on information regarding the execution history of the above task stored in the above memory (120).
8. In Paragraph 1, When the above instructions are executed individually or collectively by the at least one processor (130), the electronic device (100), An electronic device (100) that identifies the start time by subtracting the execution time and a preset margin time from the end time.
9. A method for controlling an electronic device (100), A step of receiving a request for a query to perform operations related to the database; If the above query is a schedule query for performing the above task at periodic intervals, a step of identifying a start time for initiating the above task based on an end time for completing the above task on a date corresponding to the period and an execution time required to perform the above task; A step of storing the above period and the above start time as setting information for the above query; and A method for controlling an electronic device (100), comprising the step of initiating the above operation at the above start time when the above date arrives.
10. In Paragraph 9, The step of identifying the above start time is, A step of identifying whether there exists another query among a plurality of previously registered queries to perform other tasks related to the above task; and A method for controlling an electronic device (100), comprising the step of identifying the start time based on the total end time for completing the task and the other task on the date, and the total execution time required to perform the task and the other task, if the other query exists.
11. In Paragraph 9, When the above date arrives, a step of obtaining load information indicating the load of the above task based on the traffic required for the above task, the traffic required for other tasks, and the resources of the electronic device (100); A step of changing the start time in the setting information based on the load information; and A method for controlling an electronic device (100) further comprising the step of performing the above task at the above changed start time.
12. In Paragraph 11, If the above query is a one-time query for performing the above operation once, a step of obtaining a score representing the magnitude of the load resulting from currently performing the above operation based on the load information; and A control method for an electronic device (100) further comprising the step of performing the above operation if the above score is less than a threshold value.
13. In Paragraph 12, A method for controlling an electronic device (100), further comprising the step of transmitting information about the load information or a user interface representing the load information to an external device if the score is greater than or equal to the threshold value.
14. In Paragraph 13, When query change information for changing the query to a one-time scheduled query is received from the external device, the step of changing the query to the one-time scheduled query; A step of identifying the start time based on the end time and execution time included in the above query change information; and A method for controlling an electronic device (100) further comprising the step of storing the period included in the above query change information and the above start time as the above setting information for the above query.
15. A non-transient computer-readable recording medium comprising a program for executing a method of controlling an electronic device (100), The control method of the above electronic device (100) is, A step of receiving a request for a query to perform operations related to the database; If the above query is a schedule query for performing the above task at periodic intervals, a step of identifying a start time for initiating the above task based on an end time for completing the above task on a date corresponding to the period and an execution time required to perform the above task; A step of storing the above period and the above start time as setting information for the above query; and A computer-readable recording medium comprising the step of initiating the above operation at the above start time when the above date arrives.