29 International Journal of Advanced Network Monitoring and Controls Volume 02, No.2, 2017 Research of Virtual Network Classroom Collaborative Mechanism Based on Petri Net Shengquan Yang1, Shujuan Huang2 School of Computer Science and Engineering Xi’an Technological University, Xi’an, 710032 China Email: 1xaitysq@163.com; 2Shujuanhuang@163.com Abstract. In order to keep multi-role communication action of virtual network classroom orderly and correctly at the same time, this paper proposes and studies its communication collaborative relationship based on Petri Net. Firstly, it introduces the basic theory and the system state change graph of the roles in virtual classroom, and discusses in detail the collaborative relationship between students and teacher in network environment. Especially by taking advantage of Petri Net tool, this paper in virtue of formalized method describes and analyzes collaborative relationship and collaborative mechanism between teacher and students, which exists in the virtual classroom. Finally, the collaborative mechanism has been realized successfully with the theory about process control concurrence view. Keywords: Virtual Classroom, Collaborative Mechanism, Petri Net, Process Control 1. Introduction The remote distance learning is a new generation educational pattern which is produced by the combination between computer network and the multimedia technologies today. It uses modern network and information technology to overcome geographic limitations of space, so that teachers, students can complete learning activities in different places. The modern distance learning is one kind of new education form which produces along with the present development of information technology, which is a principal means to construct people lifelong to study mode during the era of knowledge economy. In distance learning interactive system, although teachers and students living in different places, but it feels like in a classroom, in which the teachers and students can see each other and be able to hear mutually. But because all activities are carry on under the network environment, the teacher is the teaching activity main body, he must have lots of qualifications such as that he can control the student to join, to make the student withdraw, to ask questions to students, and can cause the student to obtain the right to speak, and can cancel the student to speak jurisdictions and so on. The students may ask questions to the teacher at any time. That is, in the entire teaching activities, each kind of activity which will occur will be concurrent, indefinite, and stochastic, therefore a collaborative mechanism must be studied successfully in order to suit the above characteristic, what’s more to maintain the orderliness of the whole teaching and learning activities. 30 International Journal of Advanced Network Monitoring and Controls Volume 02, No.2, 2017 2. The Cooperative Relationship of Virtual Classroom Virtual classroom is the local area network (LAN) or wide area network (WAN) space to create a virtual reality, interactive teaching and learning environment in order to achieve a variety of traditional classroom teaching function, which can provide a shared collaborative Classroom learning environment for a geographically dispersed network of online teachers and students to so that it can be a variety of real-time communication and collaboration [1]. In the virtual classroom, teacher and the students are acting with the traditional teaching in the same role, but in realizes specifically has the essential difference. This kind of difference mainly displays in the virtual classroom teaching process, because in the long- distance teaching the teacher and the student usually are in the different place, the overwhelming majority students in the network region also possibly are scattered, which causes each kind of concurrent activity becomes very complex. In order to accurately describe the synergy between teaching and learning activities, specific states which exist in teacher and students must be narrated clearly and concretely. (b) Student in seven states Figure.1 The states graph of teacher and student in virtual network classroom In teaching activities, there are two kinds of the teacher’s states (see Figure 1-a): speak (teaching lectures) and listen to students speak, however student’s states (see Figure 1-b) are: listen, speak, pause to speak, continue to speak, be cancelled speeches, be cancelled attendance, allow to speak and listen, a total of seven states. According to the changed states of teacher and student in figure 1, their collaborative relationships are described below : In the entire teaching process, there is only a speaker allowed, which either is the teacher, either is the student; At any time each role is played in between speaking and listening state, and what’s more their roles are transformed uncertainly in the two states. When the teacher is at the speech condition, the student listens, When the teacher asks questions or one student applies for speech and obtains the right Research of Virtual Network Classroom Collaborative Mechanism Based on Petri Net 31 to speak, this student starts to speak, but the teacher listens at the time; In order to control the entire ordering process of teaching students, the state change of students must be under the control of teachers, while teacher have rights to cancel the students to speak, to enable students to continue, abolish the “unpopular or unwelcome” students to speak, allowing students to listen and so on. In the network environment, all kinds of states in teaching will be a variety of unpredictable changes in concurrent operation, of which the appearance have many properties such as randomness, uncertainty and instability, etc. For example, students may ask questions at any time, a number of students to apply to speak, where there must be change between listen and speak, teachers and students how to coordinate and so on, it is necessary to control a variety of concurrent activities of a cooperative mechanism. 3. Petri Net Model of Cooperative Relations Coordination mechanism among the virtual classroom is a typical computer supported collaborative work of the problem, which is abbreviated as CSCW. The so-called computer supported collaborative work that is more than one member of a group existed in some distributed network systems use multiple computers to work together to accomplish a task. Because of this thinking is reflected in the information age groups, the way people work, interactive, distributed and collaborative nature of the objective requirements, it gives full play to the computer network as a potential communications media and superiority, which is being increasingly widely appreciated. That, computer supported cooperative work applied to the teaching field, is known as computer supported collaborative learning, abbreviated as CSCL. Petri net is a useful tool of graphical representation, which has a combination of available models, and it has much unique strengths when needing to find on the description and analysis of the phenomenon. Petri net is also well and strict defined mathematical object; furthermore it may be appropriate not only to static structural analysis, but also to dynamic behavior analysis by way of the mathematical development of the Petri net analysis methods and techniques[3] [4]. 3.1 Establish the Petri net model Definition 1: a triple-type N = (S, T; F) can be called a net, if and only if (1) (2) (3)dom(F) ∪ cod(F)= S ∪ T and x˙={ y | ( y ∈ S ∪ T ) ∧ ((x, y) ∈ F )} are called the pre-set and rear-set. Definition 2: Quadruple PN = (P, T, F, M) can be called Petri net, if and only if 1) N = (P, T; F) is a net. 2) M: S → Z (set of non-negative integers) for the identity function, where M0 is the initial marking 32 International Journal of Advanced Network Monitoring and Controls Volume 02, No.2, 2017 (that is initial state) 3) Firing rules: when transition (migration change) t ∈ T can be called enabled under state M, if and only if s ∈ ˙t : M(p) ≥ 1; From M the transition that t is enabled can lead to state changes, which is obtained subsequent identification M’ after triggering. Petri net is consists of four different elements, as follows: Place (P), with “O” expression, Transition (T), with “—” expression, the arc of direction that connect Place and Transition, and the token in the Place (Token, with a “●” expression). Place is used to describe the logic state of the system, and transition is used for the action and production process of all events. The input function (I) and the output function (O) expresses are used for contiguous function relations separately between the place and the transition, If a Place is given a mark k (k is a non-negative integer), then the Place has k tokens, also known as the Place has been marked, Thus a marked Petri net in the definition 2 can be decomposed into a quintuple PN = (P, T, I, O, M), M is the Petri net state identification sets. The collaborative mechanism among the virtual network classroom can be described into a Petri net, as shown in Figure 2: Figure.2 Petri net model of the collaborative mechanism among the virtual network classroom The concrete description meaning see Table 1, including: Place P={ P1,P2,P3,P4,P5,P6}, Transition T={ T1,T2,T3,T4,T5 }, Token ω=N+1 in P1 indicates N student and 1 teacher, Token ● in P5 indicates that one speak right resource is available. Research of Virtual Network Classroom Collaborative Mechanism Based on Petri Net 33 Table 1 Petri net model concrete description meaning 3.2 Analyze the Petri net model of the collaborative mechanism The description of figure 2 is happen to the initial state of the system, which represents the teacher and student’s token are in the P1 place. Teacher work flow showing is as follows: 1) When teacher is teaching, the teacher needs to apply for the speak right to the system, then the T1 transition will work so that teacher token flows from the P1 place to the P2 place, which indicates that the teacher wants to get the speak right from the system, and by now if a student X is in the P3 place, then will enter (2), otherwise will change over to (3). 2) The teacher has the highest priority of the system, this now if a student X is in the P3 place, which namely indicates that the student X is speaking, then the system sends out an event of letting this student X release speak right unconditionally, so that the T3 transition occurs, the student X flows from the P3 place to the P1 place, simultaneously the right to speak resources flow from the P6 place to the P5 place, which namely indicates that the right to speak will change from busy state to idle condition. 3) Because the right to speak resources are at the idling condition, the system allows the teacher to obtain the speech firstly, then the T2 transition occurs, teacher token flows from the P2 place to P3 the place, which indicates that the teacher is at teaching or the commentary condition; Simultaneously the right to speak resources flow from the P5 place to the P6 place, which indicates that the right resources to speak is not available. 4) The teacher speaks a subject or a section of curricula, then puts forward a question or permits some student inquiry, or lets the student in waiting queue who was spoke ago, the teacher sends out the release speak right event, the T3 transition occurs, the teacher flows from the P3 place to the P1 place, simultaneously the speak right resources flows from the P6 place to the P5 place, which namely indicates that the right to speak will change from busy state to idle condition. The system enters the next round of speak right resources competition recurrent state. Student work flow showing is as follows: Place State or behavior P1 the teacher or the student are at listen state P2 Execute the task of applying for speak right resources P3 With obtained the speak right, can execute speak task P4 Expressed that the student is at forbids to listen the teaching P5 Indicated that the speak right resources is at the idling state P6 Indicated that the speak right resources is at the using state Transition command or event T1 Send command to apply for speak T2 Send command to apply for speak T3 Send command to release the speak right resources T4 Send command to cancel the students listening T5 Send command to allow the students listening 34 International Journal of Advanced Network Monitoring and Controls Volume 02, No.2, 2017 1) When some student ask questions to teachers, the student must apply for the speak right to the system, T1 transition occurs, the student token X flow from P1 place to P2 place, which indicates that the student X is at applying for the right to speak condition. 2) At this time, if the teacher is lecturing or other student in his speech, this student X will be at the waiting status in the P2 place, until the right to speak is changed from the busy to idle (Idle) state, then transfers to (3) to execute. 3) Because the right to speak resources is at the release condition, according to the priority of students waiting to speak, the system adopts a first-input-first-out (FIFO) principle to serve for them, when student X ‘s priority is highest, T2 transition occurs, students X Token flows from the P2 place to the P3 place, indicating that X is at the speech or inquires some question to teacher; Simultaneously the right to speak resources flows from the P5 place to the P6 place, which indicates that the right to speak resources is occupied. 4) If this student X inquires to teacher, it needs teacher the gap-like to answer the question, then after the student X speaks, the system sends out the suspension speech event, the T3 transition occurs, the student X flows from the P3 place to the P2 place, and the system inserts the student to the first position of the waiting queue that applies for the speak right resources, which indicates that it has the highest priority in the queue of the waiting speech students, Simultaneously the right to speak resources flows from the P6 place to the P5 place, which namely indicates that the right to speak changes form by busy into the idle condition. By now it needs the teacher back and forth to answer questions for the topic, because teacher’s priority is highest, he does not use lining up, once the teacher requests to speak, the system enters teacher’s work flow immediately. 5) In the midway, if teacher wants to cancel the current student X speech, then the teacher sends out cancels the current student to speak the event, which forces this student X unconditional release right to speak, the T3 transition occurs, so that the student X must flow from the P3 place to the P1 place, and the student transforms to listening state, simultaneously the right to speak resources flow from the P6 place to the P5 place, which namely indicates that the right to speak changes from busy into idle condition. The system enters the next round of speak right resources competition recurrent state. 6) During the students listening process, when there is “not welcome” student existence discovered by the teacher, the teacher will send out cancel listening event for the “undesirable” student, the T4 transition occurs, the student X flows from the P1 place to the P4 place, the student transforms into the condition of forbidding to listen. 7) When the student X sends out to the teacher an information that he is willing to observe the classroom discipline, and the teacher permits it’s again adding to listening, the teacher may sends out the event that joins the student X into listening, the T5 transition occurs, the student X from the P4 place flows to the P1 place, the student X transforms into the condition of permission listening. 3.3 model analysis of concurrent and conflict According to the Petri net model knowledge which is described for collaborative mechanism of the virtual classroom, the student and the teacher are just like many advancements stochastically in the system interior, the concurrent movement [2]. But when there are a lot of students common in the application for speak right state, for example, to Research of Virtual Network Classroom Collaborative Mechanism Based on Petri Net 35 identify the M0 = (m, u, 0,0,1,0), and T2 transition is enabled, the students, of which number is v, in the P2 place can flow into the P2 place, because: M0 [T2] M1 = (m,u-v,v,0,1-v,0) And, Mi[T]Mj expresses that the transition T stimulation (also calls ignition), causes the Petri net by to mark Mi to enter marks Mj. But there is only one resources in the P5 place, it must guarantee that 1-v >=0 is correct only, and then makes sense. Therefore, V <= 1, this means that any time a process can only be allowed to get the speech right. Therefore, we must resolve their conflicts arising from the common run-time, critical resources, and the conflict is the essence of competition [5]. 3.4 solution of resources competition conflict The process of multiple concurrent accesses to critical resources must be controlled to make the system to normal operation. With the aid of the process dispatching management game theory method in the operating system may solve this problem [6]. The introduction of semaphore S (initial value is 1) plus Priority Power and events Event strategy. In S can be P operation and V operation. Power and the Event is defined as: Power = 1 show that the teachers priority, Power = 0 shows that students priority, Event = 1 cancel the speech, Event = 2 suspend the speech, Event = 0 there is no immediate action; P(S, Power, Event) definition is as follows: 1) When Power=1 and S<0, if Event=1,system will eliminate the speech advancement resources of the current process, which causes it transform to listen state; If Event=2, system will eliminate the speech advancement resources of the current process, which is inserted into the head of the blocking queue at once; If Power=0 or S>0, system immediately enters (2); 2) S = S - 1; 3) If S>=0, then this process continues to carry on; 4) If S <0, then the process is blocked, and it is inserted into the blocking queue of semaphore S, then the system re-schedule another process to put into operation. V(S) definition is as follows: 1) S=S+1; 2) If S>=0, then this process continues to carry on; 3) If S <= 0, which shows that there are some process that are blocked, the system must wake up the first blocking process in queue of semaphore S, so that it can be entered the ready queue and continue the operation of the process. 36 International Journal of Advanced Network Monitoring and Controls Volume 02, No.2, 2017 4. Implementation of collaborative mechanism IPremise: Makes the teacher process is ProcessT, and it has the highest priority; Makes the student i process is ProcessSi, and all students have the same level priority; Strategy: 1) when process ProcessT is running and applying for the speak right resources, the system adopts “deprivation of way”, namely according to the event type which is sent out by ProcessT, if it cancels the current process ProcessSi to speak, the system will deprive ProcessSi of the right to speak resources, transforms ProcessSi to the listen condition; If suspends current ProcessSi speaking, the system will eliminate ProcessSi the right to speak resources, and insert process ProcessSi into the first place of the student waiting blocking speech queue. 2) When a ProcessSi is running and applying for the speak right resources, the system will take “non- deprivation mode “, which enables the release of the current process that is using speak right resources, the system according to the principle of first come first served (FIFO), will wake up the first place of the student waiting blocking speech queue, and make it obtain access to critical resources. Finally an explanation point: When students are in the waiting blocking process speech queue, the state of the ProcessSi is listening, that indicates waiting speech student retains the right to listen, which is consistent with the actual classroom. Implementation parts of the codes are as follows: Teacher process control routine similar as follows: ProcessT_Work Begin …… P(S,1,1 or 2);//apply for speak right resources // or cancel / suspend the current students to speak T Process speak;//teaching …… T Process ask question;//for students V(S); //release speak right resources …… End; Every student process control routine similar as follows: ProcessSi_Work(i) Begin …… Si Listen to teacher’s lecture;//in listening state …… P(S,0,0); // apply for speak right resources Si Process speak;//for student V(S); //release speak right resources …… End; Research of Virtual Network Classroom Collaborative Mechanism Based on Petri Net 37 5. Conclusion The Research of Virtual Classroom’s Collaborative Mechanism discussed in this paper have decomposed the complex question into simple forms very much, which has highly versatile and scientific rigor, and it provides a better model and a good method for other similar research, so it has high practical and referenced value . The author has utilized this model method successfully, which is designed for the actual development work of the Chinese some university distance learning system, and it has made the very good movement progress. Acknowledgment The Research is supported by the State and Provincial Joint Engineering Laboratory of Advanced Network, Monitoring and Control. (Financing projects No. GSYSJ2016014). References [1] Yu Huang, Wenhui Hu, Xin Gao, Hart-pin Wang, “WSCI Formal Model Analysis Based on Petri Nets”, Computer Engineering & Science, vol. 31, pp. 60-63, Octoble 2009 [2] Yebai Li, Fuqi Mao, “Research of the Verification in Workflow Process Modeling on the Application of Petri Nets ”, 2010. IC4E,10. International Conference on , Sanya, pp. 21 – 24, January 2010 [3] Zouaghi, L.; Wagner, A.; Badreddin, E., “Hybrid, recursive, nested monitoring of control systems using Petri nets and particle filters ”, Dependable Systems and Networks Workshops (DSN-W), 2010 International Conference on, Chicago, pp. 73 – 79, August 2010 [4] Arpaia, P.; Fiscarelli, L.; La Commara, G.; Romano, F., “A Petri Net-Based Software Synchronizer for Automatic Measurement Systems ”, Instrumentation and Measurement, IEEE Transactions on, vol. 60, pp. 319 – 328, January 2011 [5] Mahgoub H Hammad, Alsadig Mohammed, Moawia E. Eldow . , “Design an electronic system use the audio fingerprint to access virtual classroom using Artificial Neural Networks”, Computer, Communications, and Control Technology (I4CT), 2015 International Conference on, Kuching, Malaysia, pp. 578-585, April 2015 [6] Ziyue Ma , Yin Tong , Zhiwu Li , Alessandro Giua. “Basis Marking Representation of Petri Net Reachability Spaces and Its Application to the Reachability Problem”, IEEE Transactions on Automatic Control, vol. 3, pp. 1078 - 1093, May 2016