## 2 Materials and Methods
### Mathematical Model and Evaluation Metric
Hence, the energy of interest required in a response process by the VA could be graphically represented as shown in Figure 5.  
The low level indicates the VA's consumption while processing the user's query, and the high level occurs in two moments: one when the VA is searching in the cache and the other when querying the Internet. Next, the effect of multiple devices within the same network asking the same question \(Q_{j}\) at different times \(T_{1},\ T_{2},\ldots,T_{n}\) close to each other, is considered. Based on this situation, the following question arises:  
Would battery and time be saved if the router or the VA cached the response obtained at time \(T_{1}\) to handle other queries from other users at later times (\(T_{n}>T_{n-1}>\ldots>T_{1}\))? To resolve \(Q_{j}\), the VA needs to search locally or access only the router that has cached the response from the previous query made at time \(T_{j}\). In this way,  
Figure 3:0 Figure 3:1  
Then, we define a consumption metric \(M_{C}\) as a comparison between the energy consumption for processing an inquiry (\(C\)) and the nominal consumption of the VA as if it were responding from the Internet (\(C_{N_{i}}\)), that would be the maximum processing time, and so, maximum consumption. This consumption is the product of nominal power (\(P_{N}\)) times the required time required in the external connection:  
Figure 3:2  
Figure 3:3  
This metric is normalized, meaning, \(0<M_{C}\leq 1\) where \(M_{C}=1\) in the listening state, i.e., when \(\Delta t_{q}=\Delta t_{c}=\Delta t_{i}=0\) y \(M_{C}\approx 0\) when the process consumes excessive energy in the other stages, i.e., \(\sum_{j}P_{j}\Delta t_{j}\to P_{N}\big{(}\Delta t_{q}+\Delta t_{c}+\Delta t_{i} \big{)}\). Figure 3:4 Schematic representation of energy required by the VA depending on the function performed. The mathematical automation model for consumption optimization depends on finding the minimum power and time required for the process. It means minimizing Equation (5) for consumption \(C\):  
Figure 3:5  
If the part of consumption associated with the query and cache processes are combined into one part called \(\Delta C_{c}\) and the processes involving Internet connection are combined into a part called \(\Delta C_{i}\), then the total consumption \(C\) would be given by the following:  
Figure 3:6  
Given the previous parametrization, the goal is to minimize the consumption of the VAs, which in turn depends on the time it takes to perform a query and obtain a response. To optimize this time, it is proposed to minimize or reduce the consumption time for the Internet connection to zero by obtaining responses directly from the cache server. Therefore, if a query is made only locally, then  
Figure 3:7  
Thus \(C_{L}\) is the consumption for the query up to the cache device. Hence, we can define \(C_{L}\) as follows:  
Figure 3:8  
Considering that both consumption and time are always zero or positive,  
Figure 3:9  
Then,  
\[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}\]0  
It follows that if the device does not need to query the Internet, the consumption will always be less than or equal to that of querying over the Internet. Thus, a metric \(M_{Cc}\) for queries within the internal network is proposed, eliminating the power consumption of the connection and response from the Internet, which can be expressed from Equation (11) (the initial metric) by removing the external connection consumption:  
Summarized, it would be  
\[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}\]1  
For greater accuracy in the optimization process, the following parameters will be considered, each having a determined value:  
* Standard or version supported by the WiFi network devices Institute of Electrical and Electronics Engineers (IEEE).