1 Introduction

In the industrial Internet of Things (IIoT), most productions/machines generate much-perceived data, which requires high-performance computing and tolerates low delay to support typical IIoT applications, such as remote maintenance, intelligent factories, smart logistics, and so on [1]. Cloud computing has witnessed success in high-performance computing for data analysis and mining. However, with the ever-increasing data generated from various IIoT applications, a massive amount of data bursts into the cloud center, which has seriously exhausted the bandwidth resource of the communication network from data source to cloud center [2]. In addition, the cloud computing paradigm exposes data to public networks and computing centers, leading to intolerable long network transmission delays and rising security and privacy issues, respectively.

In recent years, multi-access edge computing (MEC) has been considered a promising computing paradigm for applications demanding low delay and high security. In MEC, edge servers with cloud-like computing capability are deployed at the network edge close to the data source. In addition, Internet of Things (IoT) devices (e.g., machines with sensors and communication modules) are also endowed with some computing capability. Thus, data could be processed locally at IoT devices or offloaded to an edge server for computing, which would reduce network transmission delay and improve data security and privacy.

However, since most productions/machines work as IoT devices in an IIoT environment, the competition for shared bandwidth and computing resources is still very intense in MEC. In addition, due to the dynamic nature of the wireless transmission environment, some data may be unable to be offloaded from the data source to the edge server for computing if the wireless link is blocked or worse. Furthermore, the battery energy of an IoT device is limited due to its small volume size. Therefore, it is desired to study how to efficiently utilize the computation resource of IoT devices and edge servers as well as the precious wireless resource to achieve green MEC for IIoT applications.

Recently, reconfigurable intelligent surface (RIS) has appeared as a new emerging wireless technology for energy efficiency and transmission performance improvement [3, 4]. In RIS, several passive reflecting elements are deployed to establish extra links between wireless users and the base station (BS) [5]. The RIS elements could be reconfigured according to the surrounding environment, such that high beamforming gain between users and BS could be achieved [6]. In addition, the passive RIS elements just reflect the wireless signals; no extra transmission power is required for IoT devices. It is beneficial to apply RIS in edge computing for reducing transmission delay while improving energy efficiency. However, RIS is presently in its initiate stage, how to merge RIS into edge computing desires further study.

Motivated by the attractive characteristics of RIS, this paper studies a RIS-assisted device-edge collaborative edge computing problem in an industrial environment, aiming at reducing the energy consumption of IoT devices constrained to the delay requirements of computation tasks from IIoT applications by jointly optimizing (a) the offloading decisions, e.g., local computing at IoT devices, or, offloading to the edge server via the RIS-assisted wireless network for edge computing; (b) the phase shift in RIS for high beamforming gain; (c) the computation resource allocation for offloaded tasks at edge server; (d) the transmission power of IoT devices for task offloading.

The main contributions are summarized as follows.

  • A joint computation offloading and resource allocation problem (called JCORA) for energy efficiency in a RIS-assisted device-edge collaborative edge computing IIoT environment is formulated. In order to find out a low complex scheme for addressing such non-convex NP-hard problem, the problem is further decomposed into two concatenated subproblems, computation offloading (CO) and the joint RIS phase beamforming optimization and computation resource allocation (PORA).

  • A distributed and cooperative scheme, called RIS-assisted delay-aware energy minimization computation offloading (RIS-assisted DAEM), which consists of delay-aware energy consumption minimization offloading (DAECO) for the CO subproblem and delay-constrained transmission-energy-minimization resource optimization (DCEM) for the PORA subproblem, is proposed to address the JCORA problem. By joining DAECO and DCEM in RIS-assisted DAEM, optimum offloading decisions, RIS phase shift, computation resource allocation strategy, as well as transmission power are found.

  • The simulations have illustrated that, RIS-assisted DAEM can significantly improve the energy efficiency constrained to the end-to-end delay requirements of computation tasks in comparison with benchmarked algorithms. In addition, RIS-assisted DAEM also outperforms benchmarked algorithms in delay guarantee capability.

The remainder of this paper is organized as follows. Section 2 describes the related work. Section 3 presents the system, delay and energy consumption models. In Section 4, the problem is formulated and addressed in detail. We provide the performance evaluation of the proposal through computer simulations in Section 5, and conclude the paper in Section 6.

2 Related work

Edge computing has attracted significant attentions in recent years [7, 8]. By deploying cloud-like computing nodes (e.g., edge server, end-device) in the network edge close to data source, edge computing could explicitly reduce network transmission delay of computation tasks. Since the computation resource of an edge node is limited in comparison with that of cloud computing, computation offloading problem such as where to process the tasks and how to upload the offloaded tasks arise with the appearance of edge computing.

A number of edge computing algorithms have been proposed for achieving different objectives.

Edge computing for energy efficiency. Energy-aware edge computing has been studied for various types of networks with various methods. Zhou et al. has studied the energy-efficient workload offloading problem in vehicular networks [9]. The authors have proposed a low-complex distributed solution based on consensus alternating direction method of multipliers to address the problem for energy saving. Zhang et al. studied the energy-efficient computation offloading for mobile edge computing in 5 G heterogeneous networks [10]. By jointly optimizing offloading and radio resource allocation, the minimal energy consumption under the latency constraints is achieved in [10]. Song et al. considered the energy-efficient computation offloading problem for terrestrial-satellite IoT [11]. They decomposed the computation offloading problem into two layered subproblems and solved separately. Then an energy-efficient computation offloading and resource allocation algorithm based on the solutions of the two subproblems are proposed. The joint optimization of computation offloading and resource allocation for energy efficiency in a dynamic multiuser MEC system is considered in [12]. The problem is formulated as a mixed-integer nonlinear programming (MINLP) problem and solved via a value iteration-based reinforcement learning method. Wang et al. proposed a task offloading and resource allocation mechanism, which considered the clock frequency configuration, transmission power allocation, channel rate scheduling and offloading strategy selection, to achieve energy-efficient offloading performance in MEC [13].

Edge computing for delay minimization. Since one of the most important goal of edge computing is to reduce the delay of computation tasks, many proposals have focused on the issues of delay minimization in edge computing. Yi et al. studied a MEC framework with multiuser computation offloading and transmission scheduling for delay-sensitive applications [14]. By considering tradeoffs between local and edge computing, wireless features and non-cooperative game interactions among mobile users, a joint computation offloading and transmission scheduling as well as pricing rule problem for such MEC framework is formulated and solved in [14]. Kuang et al. studied the joint problem of cooperative computation task offloading and resource assignment in MEC [15]. The objective of minimizing the latency while guaranteeing the constraint of transmission power, energy consumption and CPU cycle frequency is achieved by formulating the optimization problem as a nonconvex mixed-integer problem and solving via a joint iterative algorithm. The delay-aware and energy-efficient computation offloading in a dynamic MEC with multiple edge servers has been studied in [16]. The authors proposed an end-to-end deep reinforcement learning (DRL) approach to address the computation offloading problem for maximizing the completed tasks before their respective deadlines and minimizing energy consumption. Shahryari et al. also proposed an energy-efficient and delay-guaranteed computation offloading method for fog-based IoT networks [17]. Differently, Liu et al. studied the joint optimization of energy and delay for computation offloading in cloudlet-assisted mobile cloud computing [18]. Chen et al. has studied the problem of joint computation offloading and unmanned aerial vehicle (UAV) deployment for average task response time minimization [19], where a two-layer joint optimization method, called PSO-GA-G, is proposed to address the problem.

Fig. 1
figure 1

Model of a RIS-assisted MEC system

RIS-assisted wireless communication. RIS, also termed as intelligent reflecting surface (IRS) [6, 20, 21], is a promising new solution to energy-efficiently improve the wireless transmission performance towards fifth-generation (5 G) and sixth-generation (6 G) networks. In RIS, a number of low-cost reconfigurable passive elements is deployed. By smartly adjusting the phase shift of all passive elements in RIS, the reflected signals can change the wireless propagation environment. For example, by adjusting the reflecting beamforming coherently with the signals from other paths, the received signal power at the receiver would be enhanced. Since RIS has attractive advantages for wireless performance improvement, RIS-assisted wireless communication has been widely studied recently. Wei et al. studied the channel estimation issue for RIS assisted wireless communications [5, 22]. Wu et al. studied the joint RIS phase shift optimization and wireless powered non-orthogonal multiple access (NOMA) resource allocation problem, the aim is to maximize the sum throughput of all wireless powered devices [23]. The impact of spatial channel correlation on the outage probability of IRS-assisted single-input single-output (SISO) communication systems has been studied in [24]. A downlink RIS-assisted multiple-input multiple-output (MIMO) wireless communication system that comprising three communication links of Rician channel, e.g., links from BS to RIS, RIS to user, and BS to user has been studied in [3], where an optimal transmit covariance matrix at BS and diagonal phase-shifting matrix at RIS have been explored to maximize the achievable ergodic rate with statistical channel state information at BS. Al-Hilo et al. designed a RIS-assisted UAV method for timely data collection in IoT networks [25]. Different from other studies that just focus on the reflection function of RIS, Zuo et al. proposed a joint design for simultaneously transmitting and reflecting (STAR) RIS assisted NOMA system to maximize the achievable sum rate [4]. Sankar et al. considered a hybrid RIS comprising of active and passive elements to aid an integrated sensing and communication system [26]. The authors jointly designed transmit beamformers and RIS coefficients to maximize the worst-case target illumination power while ensuring a desired signal-to-interference-plus-noise ratio for communication links and constraining the RIS noise power due to the active elements. An effective iterative algorithm for solving the problem of joint phase-shifts of the RIS and the resource allocation of the relays in RIS-assisted multi-hop MEC network for network throughput optimization has been designed in [27]. The joint trajectory-task-cache optimization with phase-shift design has been considered by placing a RIS between UAV, which works as MEC server, and ground terminals (GTs), for performance improving on mobile computing [28]. Bai et al. has used a block coordinate descent (BCD) technique to solve the joint computation offloading and RIS phase shift design problem in RIS aided MEC for latency minimization [29]. The joint optimization of the CPU frequencies of the smart terminals (STs), the offloading schedule, the RIS phase shifts, and the receive beamformers of the BS for minimizing the energy consumption of the STs in RIS-assisted MEC has been studied in [30].

Different from the existing works, this paper studies the RIS-assisted device-edge collaborative edge computing for industrial applications, where we jointly optimize the computation offloading and phase shift of RIS as well as computation resource allocation of edge servers for minimizing the energy consumption of IoT devices constrained to the delay requirements of industrial tasks. Furthermore, since the offloading decisions, phase shift of RIS, computation resource allocation, and transmission power of IoT devices affect each other, we decompose the joint computation offloading and multiple resource allocation problem into two subproblems and solve with distinct algorithms. Then, a distributed and cooperative scheme, which iteratively combines the up-to-date solutions of the above two subproblems, is designed to obtain one-shot solution for achieving the goal of energy consumption minimization constrained to the delay requirements of industrial tasks. In addition, different from existing works that generally transform the RIS phase shift optimization problem into a convex semidefinite program and then apply semidefinite relaxation (SDR) solver [31] to obtain the phase shift [6, 26, 32], which is off-line and time-consuming, we design a low-complex iterative algorithm to find out the suboptimal phase shift for multiple users.

3 Model formulation

3.1 System model

As illustrated in Fig. 1, this paper considers a RIS-assisted MEC system in industrial environments. The system consists of a base station endowed with an edge server located at the center of the wireless network, a number of IoT devices (e.g., machines, industrial terminals) randomly located in the network. The edge server can process multiple tasks in parallel via virtualization technologies [33], while each IoT device could only serve one task per time. There is a RIS deploying in a location between IoT devices and the base station for enhancing the communication efficiency.

The IoT devices generate industrial computation tasks. For each task, the corresponding IoT device has to decide where to process the task, e.g., local computing, or, offloading to the edge server for edge computing. If the decision is offloading, then, the task should be uploaded to the edge server via the RIS-assisted wireless network before its processing at the edge server; otherwise, the task will be executed locally. In addition, for the offloaded tasks, there are another two types of decisions are further needed to make. The first is the RIS phase beamforming optimization, which includes the phase shift of passive reflecting elements in RIS and the transmission power of the offloaded IoT devices, for energy-efficiently improving the task upload rate. The second type of decision is the computation resource allocation at edge server, which decides how to allocate the computation resource among offloaded tasks for quality of service (QoS) provisioning.

Let \(\mathcal {M}=\{1, 2, \ldots , M\}\) be the IoT device set in the system. Assuming the passive reflecting elements equipped in the RIS is N. The channel coefficient from IoT device \(m\in \mathcal {M}\) to RIS, from IoT device m directly to the BS, and from the RIS to the BS are represented by \(h_m^{I}\in \mathbb {C}^{N\times 1}\), \(h_m^{D} \in \mathbb {C}^{1\times 1}\) and \(g^{H}\in \mathbb {C}^{1\times N}\), respectively.

Let \(S_m\) represent the task size (in bits) generated from IoT device \(m\in \mathcal {M}\), the corresponding computation size is denoted as \(W_m\) (in CPU cycles).

Let \(\mathcal {I}=(I_1, I_2, \ldots , I_m, \ldots , I_M)\) be the offloading decision vector, where \(I_m=1\) if the task generated from IoT device m is offloaded to edge server, \(I_m=0\) otherwise. Let \(\mathcal {M}^{\text {O}}\subset \mathcal {M}\) represent the IoT device set that offloads the tasks to edge server, and \(\mathcal {M}^{\text {L}}\subset \mathcal {M}\) is the IoT device set that determines to local computing.

The summary of notations is listed in Table 1.

Table 1 Summary of notations

3.2 RIS-assisted edge computing model

When a task from IoT device m is offloaded to the edge server for computing, it will experience two types of delays, upload delay \(D_m^{\text {O, Tx}}\) from data source to the edge server and the computation delay \(D_m^{\text {O, CPU}}\) at the edge server. Thus, the edge computation delay of the task is expressed by

$$\begin{aligned} D_m^{\text {O}}=D_m^{\text {O, Tx}} + D_m^{\text {O, CPU}}. \end{aligned}$$
(1)

The upload delay is derived by

$$\begin{aligned} D_m^{\text {O, Tx}} = \frac{S_m}{R_m}, \end{aligned}$$
(2)

where \(R_m\) is the transmission rate from IoT device m to the edge server (we ignore the delay from the BS to the edge server), which is expressed by

$$\begin{aligned} R_{m}=B \log _2\left( 1+\frac{p_{m}\vert g^{\text {H}} \Lambda h_m ^{\text {I}} + h_m^{\text {D}}\vert ^2}{\sigma _0} \right) , \end{aligned}$$
(3)

where B is the bandwidth, \(p_m\) is the transmission power, \(\Lambda =\text {diag}(e^{j\theta _1}, e^{j\theta _2}, \ldots , e^{j\theta _n}, \ldots , e^{j\theta _N})\) is the reflection coefficient matrix, where \(\theta _n \in [0, 2\pi ]\) is the phase shift of the nth passive reflecting element in RIS, and \(\sigma _0\) is the additive Gaussian noise power. Define \(\theta =(\theta _1, \theta _2, \ldots , \theta _N)\) as the phase shift of the passive reflecting elements in the RIS.

As seen in Eq. (3), with RIS, the signal-to-noise ration (SNR) of the upload transmission is changed to the complex superposition of the reflect-path (e.g., \(g^{\text {H}} \Lambda h_m ^{\text {I}}\)) and direct-path (e.g., \(h_m^{\text {D}}\)) signals. In this case, the phase shift (e.g, \(\Lambda\)) has important impact on the superposition signal. For example, some range of phase shift could enhance the signal, while some others may suppress the direct-path signal at the receiver.

The computation delay at the edge server is derived by

$$\begin{aligned} D_m^{\text {O,CPU}}=\frac{W_m}{f_m^{\text {O}}}, \end{aligned}$$
(4)

where \(f_m^{\text {O}}\) is the CPU rate of the edge server allocated to the task, which is constrained by

$$\begin{aligned} \sum _{m\in \mathcal {M}} I_m f_m^{\text {O}} \le f^{\text {O}}. \end{aligned}$$
(5)

In this paper, we mainly consider the energy consumption of IoT devices, due to its batter volume constraint and difficult to harvest energy. Therefore, the energy consumption for task offloading is defined as

$$\begin{aligned} E_m^{\text {O}}=E_m^{\text {O, Tx}}. \end{aligned}$$
(6)

Since the passive reflecting element in the RIS does not consume energy [34], the energy consumed for data upload is mainly determined by its transmission power and transmission duration (equivalently, upload delay) [35]. Accordingly, the energy consumption for data upload could be expressed by

$$\begin{aligned} E_m^{\text {O, Tx}}=p_m D_m^{\text {O, Tx}}. \end{aligned}$$
(7)

3.3 Local computing model

When a task from IoT device m is determined to local computing, it will only experience the data computation delay \(D_m^{\text {L}}\) at local IoT device. That is,

$$\begin{aligned} D_m^{\text {L}}=\frac{W_m}{f_m^{\text {L}}}. \end{aligned}$$
(8)

Therefore, the energy consumption for local computing is just the energy consumed for data computing. That is,

$$\begin{aligned} E_m^{\text {L}}=\beta W_m f_m^{\text {L}}=\beta D_m^{\text {L}} (f_m^{\text {L}})^2, \end{aligned}$$
(9)

where \(\beta\) is the energy factor at local IoT device.

3.4 Problem formulation

The end-to-end delay of a task generated from IoT device m could be uniformly expressed as

$$\begin{aligned} D_m=(1-I_m) D_m^{\text {L}} + I_m D_m^{\text {O}}. \end{aligned}$$
(10)

Similarly, the energy consumption for processing the task from IoT device m could be uniformly expressed as

$$\begin{aligned} E_m=(1-I_m) E_m^{\text {L}} + I_m E_m^{\text {O}}. \end{aligned}$$
(11)

The total energy consumption of all tasks from all IoT devices is defined as

$$\begin{aligned} E= \sum _{m\in \mathcal {M}} E_m. \end{aligned}$$
(12)

In this paper, we aim at minimizing the total energy consumption constrained to tasks’ delay requirements by jointly optimizing the offloading decision \(\mathcal {I}\), RIS phase beamforming \(\Lambda\), transmission power \(\texttt {p}\triangleq \{p_m: \forall m\in \mathcal {M}^{\text {O}}\}\), and computation resource allocation \(\texttt {f}\triangleq \{f_m^{\text {O}}: \forall m \in \mathcal {M}^{\text {O}}\}\) for offloaded tasks. We call the above problem as the JCORA problem, and formulate it as

$$\begin{aligned} {\text {JCORA}:} \min _{\mathcal {I}, \Lambda , \texttt {p}, \texttt {f}} \; {E} \end{aligned}$$
(13a)
$$\begin{aligned} \text {s.t.} \quad&{D_{m} \le d_m^{\text {Th}}, \forall m\in \mathcal {M} }{}{}{ } \end{aligned}$$
(13b)
$$\begin{aligned}&{I_{m} \in \{0,1\}, \forall m\in \mathcal {M} }{}{}{ } \end{aligned}$$
(13c)
$$\begin{aligned}&{ \mathcal {M}^{\text {O}}\cup \mathcal {M}^{\text {L}}\subseteq \mathcal {M} }{}{}{ } \end{aligned}$$
(13d)
$$\begin{aligned}&{0\le \theta _n\le 2\pi , \forall n \in \mathcal {N}}{}{}{ } \end{aligned}$$
(13e)
$$\begin{aligned}&{p_m \le p_m^{\text {max}}}{}{}{} \end{aligned}$$
(13f)
$$\begin{aligned}&{\sum _{m\in \mathcal {M}^{\text {O}}}f_m^{\text {O}} \le f^{\text {O}}\ . }{}{}{} \end{aligned}$$
(13g)

where Eq. (13b) is the end-to-end delay bound constraint, \(d_m^{\text {Th}}\) is the maximum tolerable delay of the task from IoT device m, Eqs. (13c) and (13d) indicate that any task is either local computing or computation offloading to the edge server, (13e) is the beamforming constraint, Eq. (13f) is the transmission power constraint, Eq. (13g) is the computation resource constraint of the edge server.

3.5 Problem decomposition

Since the JCORA problem described in Eq. (13a) involves the offloading decisions in multiple IoT devices, phase shift optimization in RIS, and computation resource allocation in edge server, which is indeed a non-convex NP-hard problem. In order to find out optimum solutions with low algorithm complexity, our approach in this paper is to decompose it into two concatenated subproblems, referred to as the CO subproblem in the involved IoT devices, and the PORA subproblem for the offloaded tasks. We use an iterative policy to update the offloading decision \(\mathcal {I}\) of the CO subproblem based on the up-to-date result of the PORA subproblem. The solution of the PORA subproblem is all affected by the offloading decision of the CO subproblem in each iteration. The optimum one-shot solution of the JCORA problem is yielded when no decision update could further improve the performance of the CO and PORA subproblems. The detail of the decomposition process is described as the following.

Firstly, given the most update \((\Lambda ^{\text {*}}, \texttt {p}^{*}, \texttt {f}^{*})\) of the PORA subproblem, the current value of the energy consumption as well as end-to-end delay of the offloaded tasks is also determined. The IoT devices can also estimate the energy consumption as well as local computation delay of the local computing tasks. Thus, as to IoT devices, the JCORA problem is reduced to the CO subproblem as follows.

$$CO:\underset{\mathcal{I}^{\ast}}{min\;E}$$
(14a)
$$\begin{aligned} \text {s.t.}\quad&\text{(13b) (13c), (13d)}\end{aligned}$$
(14b)
$$\begin{aligned} {\Lambda =\Lambda ^{*}, \texttt {p}=\texttt {p}^{*}, \texttt {f}=\texttt {f}^{*} \ , }{}{}{} \end{aligned}$$
(14c)

where Eq. (14a) follows (13a) given \(\Lambda ^{\text {*}}\), \(\texttt {p}^{*}\) and \(\texttt {f}^{*}\); (14c) is the most updated solution of the PORA subproblem.

Secondly, the objective of the PORA subproblem is further to optimize the transmission energy consumption constrained to the delay requirements of offloaded tasks with respect to the solution of CO subproblem. That is, the PORA subproblem is formulated as,

$$\begin{aligned} {\text {PORA}:} \min\underset{\Lambda ^{*}, \texttt {p}^{*}, \texttt {f}^{*}}{E}{}\end{aligned}$$
(15a)
$$\begin{aligned} \text {s.t.}\quad&\text {(13b), (13e), (13f), (13g)}\end{aligned}$$
(15b)
$$\begin{aligned} { \mathcal {I}=\mathcal {I}^{*}\ . }{}{}{} \end{aligned}$$
(15c)

In the next section, heuristic algorithms to solve both the CO and PORA subproblems are designed. The one-shot solution to the original JCORA problem will be obtained by combining the computation offloading, computation resource allocation, the RIS phase shift and transmission power optimization together via the proposed RIS-assisted DAEM scheme.

4 Proposed RIS-assisted DAEM scheme for JCORA

minimization offloading (DAECO) algorithm for solving the CO subproblem, 2) the delay-constrained transmission-energy-minimization resource optimization (DCEM) algorithm for solving the PORA subproblem. By iteratively updating the mutually affected decisions of DAECO and DCEM in limited rounds, the solution of the JCORA problem is yielded.

A heuristic RIS-assisted DAEM scheme to solve the JCORA problem is designed. As illustrated in Algorithm 1, the DAEM scheme consists of a) the DAECO algorithm for solving the CO subproblem, 2) the DCEM algorithm for solving the PORA subproblem. By iteratively updating the mutually affected decisions of DAECO and DCEM in limited rounds, the solution of the JCORA problem is yielded.

figure d

In special, as illustrated in Algorithm 1, at the beginning, we assume that all IoT devices are willing to offload their tasks to the edge server for computing. Then, we initiate the DAECO algorithm (see Algorithm 2) to update the offloading decisions of some IoT devices considering the present system state as well as the end-to-end delay of tasks and energy consumption of IoT devices. Next, we initiate the DCEM algorithm (see Algorithm 3) to optimize the phase shift of the RIS and computation resource allocation at edge server for reducing the delay-constrained energy consumption of offloaded tasks. After that, we again calculate the end-to-end delay and energy consumption of all tasks. We compare the energy consumption of the pre- and after- DAECO and DCEM policy-interchanging-update. If the policy update reduces the energy consumption, then we repeat the DAECO and DCEM policy-interchanging-update process; otherwise, or, the iteration reaches the repeat count, we stop the policy-interchanging update, and yield the solution of the JCORA problem by joining the up-to-date solutions given by DAECO for the CO subproblem and DCEM for the PORA subproblem.

4.1 DAECO for CO

Given the computation resource allocation policy of the edge server for offloaded tasks and the phase shift beamforming of the RIS as well as the transmission power, the end-to-end delay and energy consumption of the offloading tasks are determined. For the tasks determined to local computing, since per IoT device handles one local task in parallel, the end-to-end delay as well as energy consumption is also estimable. However, since the offloading decision switching of one IoT device would affect the end-to-end delay and energy consumption performance of other IoT devices due to the computation resource sharing at the edge server and phase shift beamforming optimization for all offloading tasks, it is better to iteratively update the offloading decisions of some IoT devices for reducing the energy consumption constrained to delay requirement. Based on the above observation, we design an iterative delay-aware energy consumption minimization offloading algorithm as illustrated in Algorithm 2 for solving the CO subproblem.

figure e

As illustrated in Algorithm 2, in order to guarantee the end-to-end delay of as more as possible offloaded tasks, in each round of iteration, we choose an offloaded IoT device \(m'\) who would experience the longest end-to-end delay, which generally has the worst link quality among offloaded IoT devices, even under the assistance of RIS. Then, we estimate its local computation delay and corresponding energy consumption. If its offloading decision switching could reduce the energy consumption constrained to delay requirement or satisfying the end-to-end delay requirement of the task, then we update its offloading decision (see lines 7 and 13 of Algorithm 2); otherwise, the offloading decision is reserved (see lines 9 and 16 of Algorithm 2). We repeat the offloading decision switching steps until all offloaded IoT devices have been ergodic. After the ergodic process, we return the up-to-date offloading decision \(\mathcal {I}^{*}\) as well as local and offloaded IoT device sets \(\mathcal {M}^{\text {L*}}\) and \(\mathcal {M}^{\text {O*}}\) back to Algorithm 1 for assisting in solving the PORA subproblem and yielding the one-shot solution.

4.2 DCEM for PORA

Given the offloading decision \(\mathcal {I}^{*}\), the number of offloaded IoT devices \(M^{\text {O*}}\) is also determined, then the PORA subpproblem is equivalent to the joint phase shift beamforming optimization, transmission power reduction and computation resource allocation for these offloaded tasks/IoT devices. We design a DCEM algorithm to solve it.

As illustrated in Algorithm 3, the DCEM algorithm consists of three subprocesses, computation resource allcation, iterative beamforming optimization and transmission power reduction.

figure f

Computation resource allocation: The computation resource of the edge server for the competing offloaded tasks is allocated based on the weighted fair policy. That is, the allocated computation resource of an offloaded task is proportional to its computing amount. The motivation of using the weighted fair policy is that, it provies a workload based fairness to all competing tasks. In addition, it is easy to implement with low time-complexity.

Iterative beamforming optimization: As shown in Eqs. (6) and (7), in the offloading case, the transmission power of the IoT devices and the upload delay mainly affect the energy consumption of IoT devices. Furthermore, as shown in Eqs. (2) and (3), optimizing the RIS phase shift \(\Lambda\), the SNR could be improved, thus reducing the upload delay, leading to the energy consumption reduction. Accordingly, given the computation delay \(D_m^{\text {O, CPU}}\) \(\forall m\in \mathcal {M}^{\text {O}}\) at edge server and the transmission power \(p_m^{*}\) \(\forall m\in \mathcal {M}^{\text {O}}\), the energy consumption minimization problem for offloaded tasks/IoT devices is equivalent to the SNR maximization by reconfiguring the RIS phase shift problem (called BeamOpt), which is formulated as

$$\begin{aligned} {\text {BeamOpt}:} \max _{\Lambda ^{*}}{ \Psi =\sum _{m\in \mathcal {M}^{\text {O}}} \Psi _m}{} \text {s.t.}\quad&{\Psi _m=\vert g^{H}\Lambda h_m^{I} +h_m^{\text {D}} \vert ^2 }{} \end{aligned}$$
(20a)
$$\begin{aligned} {\Lambda =\text {diag}(e^{j\theta _1}, e^{j\theta _2}, \ldots , e^{j\theta _N}) }{} \end{aligned}$$
(20b)
$$\begin{aligned} { 0\le \theta _n \le 2\pi , n\in \mathcal {N} }{}{}{ } \end{aligned}$$
(20c)
$$\begin{aligned} { p_m=p_m^{*} . }{}{}{} \end{aligned}$$
(20d)

where Eq. (20a) follows Eq. (3), (20c) follows Eq. (13e).

Since

$$\begin{aligned} \vert g^{H}\Lambda h_m^{\text {I}} +h_m^{\text {D}} \vert \le \vert g^{H}\Lambda h_m^{I} \vert + \vert h_m^{\text {D}}\vert , \end{aligned}$$
(21)

the equality holds if and only if the phase of \(g^{H}\Lambda h_m^{\text {I}}\) equals to that of \(h_m^{\text {D}}\) [6]. Let \(\text {arg}(h_m^{\text {D}})\triangleq \phi _{m,0}\), then, for any offloading IoT device m, to maximize \(\Psi _m\) is equivalent to maximize \(\vert g^{H}\Lambda h_m^{\text {I}}\vert ^2\) constrained to \(\text {arg}(g^{H}\Lambda h_m^{\text {I}} ) = \phi _{m,0}\).

Let \(\textrm{v}=(e^{j\theta _1}, e^{j\theta _2}, \ldots , e^{j\theta _N})^{H}\), then we have \(g^{\text {H}}\Lambda h_m^{\text {I}}=\textrm{v}^{H} \text {diag}(g^{\text {H}}) h_m^{\text {I}}\). Accordingly, with Eq. (21), the problem described in Eq. (20) is equivalent to

$$\begin{aligned} \max _{\textrm{v} }{\sum _{m\in \mathcal {M}^{\text {O}}} \vert \textrm{v}^{H} \text {diag}(g^{\text {H}}) h_m^{\text {I}}\vert ^2}{} \end{aligned}$$
(22a)
$$\begin{aligned} \text {s.t}\quad {\vert v_{n}\vert =1, \forall n=1, 2, \ldots , N}{}{}{} \end{aligned}$$
(22b)
$$\begin{aligned} {\text {arg}(\textrm{v}^{H} \text {diag}(g^{\text {H}}) h_m^{\text {I}})=\phi _{m, 0}, \forall m\in \mathcal {M}^{\text {O}}. }{}{}{} \end{aligned}$$
(22c)

For \(m\in \mathcal {M}^{\text {O}}\), the optimum \(\vert \textrm{v}^{H} \text {diag}(g^{\text {H}}) h_m^{\text {I}}\vert ^2\) is yielded by \(\textrm{v}_{m}^{*}=e^{j(\phi _{m, 0} - \arg (\text {diag}(g^{\text {H}})h_m^{\text {I}} ))}\). That is, the nth phase shift of RIS considering the user-specific channel quality could be given by

$$\begin{aligned} {\begin{matrix} \theta _{m, n}&{}=\phi _{m, 0}-\text {arg}(g_{n}^{\text {H}} h_{n,m}^{\text {I}})\\ &{}=\phi _{m, 0} -\text {arg}(g_{n}^{\text {H}}) - \text {arg}( h_{n,m}^{\text {I}}), \end{matrix}} \end{aligned}$$
(23)

where \(g_{n}^{\text {H}}\) is the nth element of \(g^{\text {H}}\), \(h_{n, m}^{\text {I}}\) is the effective channel of the nth element of the RIS to IoT device m.

Since the angle of incidence from distinct IoT devices to the RIS may be different, as described in Eq. (23), the optimum \(\theta\) for distinct IoT devices might be different. In this case, we use a sum-SNR-maximization beamforming optimization algorithm as illustrated in Algorithm 4 to iteratively search an optimum \(\textrm{v}^{*}\) among \(\textrm{v}_{m}^{*}\) obtaining via Eq. (23) for an optimum Eq. (22a). The detail is illustrated in Algorithm 4.

figure g

Transmission power reduction: Given \(f_m^{\text {O*}}\), the computation delay of offloaded tasks is determined, thus, the tolerable data upload delay constrained to end-to-end delay could be estimated. Furthermore, as shown in Eq. (7) and Eq. (3), given the maximum tolerable upload delay \(D_m^{\text {O,Tx}}\), the transmission power could be optimized for reducing the energy consumption. Accordingly, we use the method described in transmission power reduction of Algorithm 3 to derive the optimum transmission power for reducing the transmission energy consumption.

5 Performance evaluation

Simulation results are provided in this section to demonstrate the effectiveness of the proposed RIS-assisted DAEM for energy efficiency constrained to delay requirements.

5.1 Parameter setting

In simulations, the number of IoT devices and passive reflecting elements in RIS are set to \(M=20\) and \(N=20\), respectively. The positions of the base station and RIS are set to (0, 0, 0)m and (20, 0, 0)m, respectively. The IoT devices are randomly distributed in a circular zone, where the minimum and maximum horizontal (x-axis) distances from the base station are \(d_{\text {min}}=50\)m and \(d_{\text {max}}=55\)m respectively, the radius of the circular zone is set to \(r=(d_{\text {max}} - d_{\text {min}})/2\), while the vertical (z-axis) distance is set to \(d_v=3\)m from the base station, as illustrated in Fig. 2. The large-scale fading model is given by \(L(d)=C_0 (d)^{-a}\) [32], where \(C_0=-30\)dB, \(\alpha\) for IoT devices to BS, IoT devices to RIS, and RIS to BS, are set as 5, 2.8, 2 respectively.

Fig. 2
figure 2

Simulation setup (top view)

The computation capabilities of the edge server and IoT device are set to \(f^{\text {O}}=20\) GHz and \(f_m^{\text {L}}=0.6\)GHz for \(m\in \mathcal {M}\), respectively. The task size is randomly distributed between 0.5Mb and 0.8Mb in bits, corresponding to 2.95G CPU cycles and 4.72G CPU cycles, respectively. The delay bound of a task is set to \(d_m^{\text {Th}}=10\)ms for \(m\in \mathcal {M}\). The other parameters are set as follows: \(\sigma _0=10^{-11}\), \(\alpha =1.0\), \(\beta =0.25 \times 10^{-18}\).

This paper evaluates the efficiency of the proposal with the following four benchmarked schemes.

  • Local computing Greedy (LG): All tasks are computed at local source nodes [32].

  • RIS-assisted Edge computing Greedy (RIS-assisted EG): All tasks are offloaded to the edge server via the RIS-assisted wireless network for edge computing. In special, the offloading decisions are made according to the edge computing greedy policy [36]. The optimum phase shift of the RIS is solved via semi-definite relaxation (SDR) method as described in [6, 30], while the optimum transmission power is determined with the delay-aware energy minimization transmission policy as shown in lines 9-10 of Algorithm 3.

  • Delay-Constrained Computation Offloading without RIS (DCCO): The offloading decisions are made according to the delay requirements of tasks. That is, an offloading policy satisfying the delay bound of a task is chosen [36]. For the task determined to local computing, similar method as described in line 4 of Algorithm 1 is used to allocate CPU resource of local computing nodes to local computing tasks. For the tasks determined to edge computing, delay-constrained energy minimization transmission policy (similar to Algorithm 3) is adopted.

  • Energy-efficient Task Offloading Strategy (ETOS): ETOS is a hybrid method based on particle swarm optimization (PSO) and grey wolf optimizer (GWO) to solve the energy-efficient task offloading problem, which considers efficient resource allocation such as sub-carries, power, and bandwidth for offloading to guarantee minimum energy consumption along with satisfying delay requirements [37].

To evaluate the delay guarantee capability of the investigated schemes, we introduce a delay guarantee ratio defined as follows.

$$\begin{aligned} G=\frac{\text {The number of delay guaranteed tasks }}{\text {Total tasks}} \times 100\%. \end{aligned}$$
(24)

The higher of G, the higher delay guarantee capability of the investigated scheme.

5.2 Adaptive to task size

First, we investigate the impact of the task size on the energy efficiency constrained to delay requirement. As shown in Fig. 3, the energy consumptions of all the investigated schemes increase with the increasing task size, which is accordance with our intuition. The DCCO, ETOS and RIS-assisted DAEM schemes outperform the LG and RIS-assisted EG schemes by given lower energy consumption under various task sizes, which demonstrates that the device-edge collaborative computation offloading schemes, which consider the delay requirements and energy-efficiency, outperform both of the device-single and the edge-single computation offloading schemes.

Fig. 3
figure 3

Energy consumption with respect to task size

RIS-assisted DAEM outperforms the other investigated schemes by always consuming the lowest energy and providing the highest delay guarantee ratio under various task sizes, as illustrated in Figs. 3 and 4. This is because, under RIS-assisted DAEM, the IoT device would adaptively select a computing node (e.g., local node or edge server) for energy reduction constrained to the delay requirement of the corresponding task. In addition, energy efficiency resource allocation algorithms, such as delay-constrained CPU rate allocation and delay-aware transmission power determination, as well as phase shift beamforming optimization are collaboratively used in RIS-assisted DAEM to further improve the energy efficiency.

Fig. 4
figure 4

Delay guarantee ratio with respect to task size

LG provides the worst performance by given the highest energy consumption (see Fig. 3). In addition, when the task size exceeds 0.7MB/task (equivalently, the CPU computing amount exceeds 4.13 G CPU cycles/task), the delay guarantee ratio given by LG decreases quickly. When the task size reaches 1.1 MB/task (equivalently, the CPU computing amount reaches 6.49 G CPU cycles/task), the delay guarantee ratio given by LG reduces to zero, as illustrated in Fig. 4. This is because, without the computation assistance of edge server, the limited computation resource of an end device is difficult to support the low-delay and high performance computation tasks.

Notice that, when the average task size reaches 0.7MB/task (equivalently, the CPU computing amount reaches 4.13 G CPU cycles/task), the average workload of the system has been 2.6 times of the MEC system’s computing capacity. Therefore, it is unsurprising that, when the average task size exceeds 0.7MB/task, the delay guarantee ratio given by all the investigated schemes decrease with the increasing task size. However, RIS-assisted DAEM outperforms the other investigated schemes by providing the highest delay guarantee ratio under various task sizes. For example, as illustrated in Fig. 4, when the task size reaches 1.5 MB/task, the average workload of the system has been 5.53 times of the MEC system’s computing capacity (severe heavy load state), the delay guarantee ratio given by RIS-assisted DAEM could still be greater than 40%, while those given by LG and RIS-assisted EG has reached zero.

When the workload is slight (e.g., the task size is less than 0.5 MB/task), RIS-assisted EG consumes similar energy with DCCO and ETOS. However, when the task size continually increases, the energy consumption of RIS-assisted EG increases quickly and exceeds that of DCCO and ETOS, as shown in Fig. 3. This is because, although the assistance of RIS could reduce the transmission energy consumption, however, under the full offloading scheme (e.g., RIS-assisted EG), the transmission energy consumption is still larger than those of the partial offloading schemes (e.g., DCCO, ETOS and RIS-assisted DAEM).

5.3 Adaptive to user number

We further observe the performance by varying the number of IoT devices. We set the delay bound to \(d_m^{\text {Th}}=6\)ms for \(m\in \mathcal {M}\). Other parameters are the same as described in Section 5.1.

The energy consumption and delay guarantee ratio of the investigated schemes are shown in Figs. 5 and 6, respectively. Since the number of tasks increases with the increasing number of IoT devices, it is unsurprising that the energy consumption given by all the investigated schemes increases with the increasing number of IoT devices.

Fig. 5
figure 5

Energy consumption with respect to IoT user number

The effectiveness of RIS-assisted DAEM is again validated by given the lowest energy consumption (see Fig. 5) while providing the highest delay guarantee ratio (see Fig. 6) under various IoT device numbers. This is because, RIS-assisted DAEM can dynamically switch between local computing and edge server computing adaptive to the varying of IoT device numbers to reduce the energy consumption considering the tolerable delay of tasks.

Fig. 6
figure 6

Delay guarantee ratio with respect to IoT user number

LG again consumes the highest energy for processing similar tasks in comparison with other investigated schemes under various number of IoT devices, as illustrated in Fig. 5. However, the delay guarantee ratio given by LG is stable under various number of IoT devices, as shown in Fig. 6. This is because, the per user’s local processing task under LG does not change with the varying of IoT user numbers. Thus, it is unsurprising that the delay guarantee ratio given by LG would not change with the varying of IoT user numbers. The delay guarantee ratio given by RIS-assisted EG decreases quickly with the increasing number of users, as illustrated in Fig. 6. The reason is that, with the increasing number of users, the offloading workload given by the full offloading scheme (e.g., EG and its variants) increases the fastest in comparison with partial offloading schemes (e.g., DCCO, ETOS and RIS-assisted DAEM). The delay guarantee ratio given by DCCO is better than that by ETOS, since DCCO takes delay guarantee as its optimum object, while ETOS takes energy-efficiency as its optimum object. Thus, the energy consumption of ETOS is less than that of DCCO, as shown in Fig. 5.

5.4 Adaptive to delay bound

Finally, we investigate the impact of delay bound on the performance. We can see in Fig. 7 that, the energy consumption of RIS-assisted EG, DCCO and RIS-assisted DAEM decrease with the increasing delay bound. The reason is that, DCCO and RIS-assisted DAEM are delay-aware computation offloading schemes, they can dynamically switch between local computing and edge server computing for delay guarantee. Furthermore, the allocated CPU rate as well as the transmission power could be reduced with the loosing delay bound. Therefore, the energy consumption given by both DCCO and RIS-assisted DAEM decrease explicitly with the increasing delay bound. Under RIS-assisted EG, the allocated CPU rate and the transmission power could also be reduced with the loosing delay bound, thus the energy consumption of RIS-assisted EG also decreases with the increasing delay bound.

Fig. 7
figure 7

Energy consumption with respect to delay bound

Since LG is delay-unaware scheme, the energy consumption of LG does not change with the varying of delay bound, as shown in Fig. 7. Since under ETOS, the varying of delay bound in a small range (e.g., a low delay bound in a range of 1ms to 10ms) has less impact on the offloading decisions in comparison with the energy consumption, the energy consumption (equivalently, offloading decision) of ETOS does not change with the varying of delay bound. Indeed, as shown in Fig. 7, the varying of energy consumption given by ETOS is due to the varying of wireless transmission environment.

Compared to the workload (task request), the CPU resource of both IoT device and edge server is not sufficient for extremely low delay (e.g., < 8ms) provisioning in the simulation setting, furthermore, the distance between data source (IoT device) and base station is a little far ( \(> 50m\)), it is unsurprising that all the investigated schemes could not bound the delays of all tasks when the delay bound is less than 8ms, as illustrated in Fig. 8. However, the delay-aware offloading schemes, such as DCCO and RIS-assisted DAEM, still outperforms the delay-unaware offloading schemes, such as LG, RIS-assisted EG and ETOS. Indeed, the increasing of delay guarantee ratio given by LG and ETOS is mostly due to the statistical property.

Fig. 8
figure 8

Delay guarantee ratio with respect to delay bound

The effectiveness of RIS-assisted DAEM is again validated by that, the energy consumption given by RIS-assisted DAEM reduces faster and is lower than those of the other investigated schemes when \(d^{\text {Th}}\ge\) 3ms, in addition, the delay guarantee ratio given by RIS-assisted DAEM increases faster and is higher than those of the other investigated schemes, as illustrated in Figs. 7 and 8, respectively.

6 Conclusion

This paper has proposed a RIS-assisted device-edge collaborative edge computing scheme, termed RIS-assisted DAEM, for addressing the problem of energy consumption minimization constrained to the delay requirements in IIoT environments. In the proposal, a RIS is deployed between IoT devices and edge server for improving the wireless performance. To find out optimum offloading decisions, e.g., local computing or edge computing, a DAECO algorithm is proposed to address the CO subproblem. To find out optimum phase shift of RIS, computation resource allocation strategy at edge server and transmission power at IoT devices, for offloading tasks, the DCEM algorithm is proposed to solve the PORA subproblem. By joining the up-to-date solutions of CO and PORA via iterative RIS-assisted DAEM, the goal of energy consumption minimization constrained to the delay requirements is yielded. Simulation results show that the proposed scheme can significantly reduce the energy consumption of IoT devices constrained to the delay requirements. RIS-assisted DAEM also outperforms the benchmarked schemes in terms of delay guarantee.