## 2 Resource Model
### Resource Description  
Since the resources accessed by the CPS components, both physical and cyber, could be of different types, we regard the CPS as a complex heterogeneous environment. To reduce the complexity of handling resources in CPS, a resource accessed or produced by CPS should declare some of its significant properties in order that property-based matching and management are possible. In our model, Resource Supply Description Template (RSDT) and Resource Instance Notation (RIN) describe the resources and their properties. In a CPS, the resource provider (RP) will generate and hold the RSDT as a contract for other systems. If one RP decides to join the CPS and support resources, the RSDT will register into the middleware, and this middleware has the methods and rights to monitor resource supply conditions. While the CPS is running by the support from RPs as described at RSDTs, the real-time resource supply situation can be indicated by RIN. The RSDT is based on the Resource Description Template (RDT), which was proposed in [10]. In [11], the resources in a CPS are categorized into several different types, including human resources, biological resources, natural resources, man-made resources and virtual resources. The description of one type of resource is expressed as an XML version model-based formal specification. The resource providers can modify their RDTs to construct new RDTs and publish them. This process is independent from the final use of resources when a service is provided by a service provider. However, that model is tightly bound to assist a three-layer service-oriented cyber-physical system, and the RDT is just a description at the physical layer. When the resources are consumed in the system, many resource attributes in the RDT are not related to the running system. As shown in the robot example in [10], the availability notation is necessary, because if the resource requester is not in China, the robot resource located in China is not available. However, when the robot is being used in the system, the real location of the robot does not affect the system. To solve this problem, in our new resource model, the description can be either from the resource provider or the resource itself. The RSDT will describe the static properties, and the RIN will handle the changing attributes. It will be published by the resource provider to describe the resource information. Table 1 indicates a basic RSDT, and the semantics of it is given below:  
(1) The template holder is the resource provider who publishes this RSDT. This holder is responsible for providing the resources described in this template. \begin{table}
\begin{tabular}{c c} \hline
**Template Holder** & the resource provider \\
**Template Unify ID** & the identity of this template \\
**Resource Name** & the provided resource name \\
**Characters** & to help the system decide how to use this resource \\
**Attributes** & can be inherited to the resource instances \\
**Cost** & cost per unit \\
**Availability** & a set of constraints like time, location and etc. \\
**Legal Rules for Supply** & URI to a website \\
**Other Resource in the Context of Use** & a set of context resource dependencies \\ \hline \end{tabular}
\end{table} 
Table 1: Resource Supply Description Template (RSDT). (2) The template unify ID is the identity of this RSDT. It is defined as a number, and an IPv6 address is used to express this identity. (3) The section \"characters\" contains many properties, which will be used by the system to decide how to use this kind of resource. For instance, the resource might be continuous, so the system has to quantize its information to calculate the supply and predicate further requirements. All characters will be read by the resource operating decision machine (RODM) and register at this machine. The decision about how to use the resources generated from the RSDT is decided by the RODM. (4) The section \"attributes\" contains all attributes that will get a real value when the system is running.