## 2 Materials and Methods
### Mathematical Model and Evaluation Metric  
Mathematical analysis and calculations are performed to characterize the energy consumption and processing times of the VA in the ON state. The consumption can be presented in two scenarios:  
1. When the VA operates offline, retrieve the response directly from the local cache or edge devices, but without connecting to the Internet;
2. When the VA seeks the response by connecting to the Internet, make the respective query to cloud databases or through AI. In both cases, the initial consumption parameters are the same, including WiFi or Ethernet connection, memory usage, CPU cycles, and activation of voice recognition processes. However, for the second scenario, the consumption required by the connection to the mobile network or external ISP network must be considered. Accordingly, VAs consume energy during the connection process and when processing queries. This situation can be modeled using the power required in each process:  
\[P(t)= \begin{cases}P_{l},&t_{0}<t\leq t_{l}\\ P_{q},&t_{l}<t\leq t_{q}\\ P_{c},&t_{q}<t\leq t_{c}\\ P_{t},&t_{c}<t\leq t_{i}\\ P_{a}.&t_{i}<t\leq t_{a}\end{cases}  \tag{1}\]  
where  
\(P(t)\), is the power function at every time;  
\(P_{l}(t)\), is the power of the VA in listening mode;  
\(P_{q}(t)\), is the power consumed during the processing of the query;  
\(P_{c}(t)\), is the power of the VA while performing a search in the cache memory;  
\(P_{i}(t)\), is the power of the VA while retrieving the response from the Internet;  
\(P_{a}(t)\), is the power required to deliver the response to the user. Here, the energy consumption can be represented by the following integral:  
\[C=\int_{t_{0}}^{t_{a}}P(t)dt \tag{2}\]  
Figure 3: Network architecture for local and remote VA queries. In this model, the energy consumption related to processing while the VA is performing other connection processes is disregarded. Considering the previous function, the consumption can be defined as follows for both the case where the response is obtained locally from the cache (Local), \(C_{L}\), and when the assistant must query in the cloud (External), \(C_{E}\), for example, through an AI:  
\[C_{L}=\left[\int_{\Delta t_{l}}P_{l}dt+\int_{\Delta t_{q}}P_{q}dt+\int_{\Delta t _{c}}P_{c}dt+\int_{\Delta t_{a}}P_{a}dt\right] \tag{3}\]  
\[C_{E}=\left[\int_{\Delta t_{l}}P_{l}dt+\int_{\Delta t_{q}}P_{q}dt+\int_{\Delta t _{c}}P_{c}dt+\int_{\Delta t_{i}}P_{i}dt+\int_{\Delta t_{a}}P_{a}dt\right] \tag{4}\]  
If average power values are assumed for each section of the process, Equation (2) is equivalent to the following:  
\[C=\sum_{j}P_{j}\Delta t_{j}. \tag{5}\]  
However, for the local case \(j=l,q,\ c,\ a\) and for the external case \(j=l,q,\ c,\ i,a\) which means that the following will always hold:  
\[C_{L}=\sum_{j}P_{j}\Delta t_{j}=P_{l}\Delta t_{l}+P_{q}\Delta t_{q}+P_{c} \Delta t_{c}+P_{a}\Delta t_{a}\ \text{and} \tag{6}\]  
\[C_{E}=\sum_{j}P_{j}\Delta t_{j}=P_{l}\Delta t_{l}+P_{q}\Delta t_{q}+P_{c} \Delta t_{c}+P_{i}\Delta t_{i}+P_{a}\Delta t_{a} \tag{7}\]  
Considering that in practice the power and time associated with the response process \(P_{a}\) are embedded in the consumption calculated for the processes defined in this work as Local (on cache) and External (on the Internet), respectively, this parameter will be omitted in the following equations. Graphically, the power consumption for the query and response process from the cache memory and the AI on the Internet, as described in Equations (6) and (7), is presented in Figure 4.  
If the energy consumption while the VA is listening is not of interest for the comparison, i.e., the energy consumption before a query is being detected and  
Figure 4: Power consumption according to the proposed architecture. \(P_{l}\Delta t_{l}\) can be excluded from further consideration.