In most sematic based service discovery procedure, subsumption testing and LCA (lowest common ancestor) detection are the necessary step. There are a lot of algorisms to do this job. However, in the multiple inheritance hierarchies' scenery, many traditional algorisms cannot work properly. In this paper, we propose a gene based ontology encoding method which can implement subsumption testing and LCA detection in constant time. Experimental results show that the proposed method can effectively reduce the time of semantic service discovery.